^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * STMicroelectronics TPM Linux driver for TPM ST33ZP24
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (C) 2009 - 2016 STMicroelectronics
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #ifndef __LOCAL_ST33ZP24_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #define __LOCAL_ST33ZP24_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define TPM_WRITE_DIRECTION 0x80
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #define ST33ZP24_BUFSIZE 2048
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) struct st33zp24_dev {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) struct tpm_chip *chip;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) void *phy_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) const struct st33zp24_phy_ops *ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) int locality;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) int irq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) u32 intrs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) int io_lpcpd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) wait_queue_head_t read_queue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) struct st33zp24_phy_ops {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) int (*send)(void *phy_id, u8 tpm_register, u8 *tpm_data, int tpm_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) int (*recv)(void *phy_id, u8 tpm_register, u8 *tpm_data, int tpm_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #ifdef CONFIG_PM_SLEEP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) int st33zp24_pm_suspend(struct device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) int st33zp24_pm_resume(struct device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) int st33zp24_probe(void *phy_id, const struct st33zp24_phy_ops *ops,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) struct device *dev, int irq, int io_lpcpd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) int st33zp24_remove(struct tpm_chip *chip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) #endif /* __LOCAL_ST33ZP24_H__ */