xref: /linux/drivers/char/tpm/st33zp24/st33zp24.h (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * STMicroelectronics TPM Linux driver for TPM ST33ZP24
4  * Copyright (C) 2009 - 2016  STMicroelectronics
5  */
6 
7 #ifndef __LOCAL_ST33ZP24_H__
8 #define __LOCAL_ST33ZP24_H__
9 
10 #define TPM_ST33_I2C		"st33zp24-i2c"
11 #define TPM_ST33_SPI		"st33zp24-spi"
12 
13 #define TPM_WRITE_DIRECTION	0x80
14 #define ST33ZP24_BUFSIZE	2048
15 
16 struct st33zp24_dev {
17 	struct tpm_chip *chip;
18 	void *phy_id;
19 	const struct st33zp24_phy_ops *ops;
20 	int locality;
21 	int irq;
22 	u32 intrs;
23 	struct gpio_desc *io_lpcpd;
24 	wait_queue_head_t read_queue;
25 };
26 
27 
28 struct st33zp24_phy_ops {
29 	int (*send)(void *phy_id, u8 tpm_register, u8 *tpm_data, int tpm_size);
30 	int (*recv)(void *phy_id, u8 tpm_register, u8 *tpm_data, int tpm_size);
31 };
32 
33 #ifdef CONFIG_PM_SLEEP
34 int st33zp24_pm_suspend(struct device *dev);
35 int st33zp24_pm_resume(struct device *dev);
36 #endif
37 
38 int st33zp24_probe(void *phy_id, const struct st33zp24_phy_ops *ops,
39 		   struct device *dev, int irq);
40 void st33zp24_remove(struct tpm_chip *chip);
41 #endif /* __LOCAL_ST33ZP24_H__ */
42