1*46fe7771SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 2bf38b871SChristophe Ricard /* 3bf38b871SChristophe Ricard * STMicroelectronics TPM Linux driver for TPM ST33ZP24 42c2b217aSChristophe RICARD * Copyright (C) 2009 - 2016 STMicroelectronics 5bf38b871SChristophe Ricard */ 6bf38b871SChristophe Ricard 7bf38b871SChristophe Ricard #ifndef __LOCAL_ST33ZP24_H__ 8bf38b871SChristophe Ricard #define __LOCAL_ST33ZP24_H__ 9bf38b871SChristophe Ricard 10f042a315SChristophe Ricard #define TPM_WRITE_DIRECTION 0x80 118ab547a2SJarkko Sakkinen #define ST33ZP24_BUFSIZE 2048 12f042a315SChristophe Ricard 13570a3609SChristophe Ricard struct st33zp24_dev { 14570a3609SChristophe Ricard struct tpm_chip *chip; 15570a3609SChristophe Ricard void *phy_id; 16570a3609SChristophe Ricard const struct st33zp24_phy_ops *ops; 1756671c89SChristophe Ricard int locality; 18570a3609SChristophe Ricard int irq; 19570a3609SChristophe Ricard u32 intrs; 20570a3609SChristophe Ricard int io_lpcpd; 216e599f6fSChristophe Ricard wait_queue_head_t read_queue; 22570a3609SChristophe Ricard }; 23570a3609SChristophe Ricard 24570a3609SChristophe Ricard 25bf38b871SChristophe Ricard struct st33zp24_phy_ops { 26bf38b871SChristophe Ricard int (*send)(void *phy_id, u8 tpm_register, u8 *tpm_data, int tpm_size); 27bf38b871SChristophe Ricard int (*recv)(void *phy_id, u8 tpm_register, u8 *tpm_data, int tpm_size); 28bf38b871SChristophe Ricard }; 29bf38b871SChristophe Ricard 30bf38b871SChristophe Ricard #ifdef CONFIG_PM_SLEEP 31bf38b871SChristophe Ricard int st33zp24_pm_suspend(struct device *dev); 32bf38b871SChristophe Ricard int st33zp24_pm_resume(struct device *dev); 33bf38b871SChristophe Ricard #endif 34bf38b871SChristophe Ricard 35bf38b871SChristophe Ricard int st33zp24_probe(void *phy_id, const struct st33zp24_phy_ops *ops, 36bf38b871SChristophe Ricard struct device *dev, int irq, int io_lpcpd); 37bf38b871SChristophe Ricard int st33zp24_remove(struct tpm_chip *chip); 38bf38b871SChristophe Ricard #endif /* __LOCAL_ST33ZP24_H__ */ 39