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_WRITE_DIRECTION	0x80
11 #define ST33ZP24_BUFSIZE	2048
12 
13 struct st33zp24_dev {
14 	struct tpm_chip *chip;
15 	void *phy_id;
16 	const struct st33zp24_phy_ops *ops;
17 	int locality;
18 	int irq;
19 	u32 intrs;
20 	int io_lpcpd;
21 	wait_queue_head_t read_queue;
22 };
23 
24 
25 struct st33zp24_phy_ops {
26 	int (*send)(void *phy_id, u8 tpm_register, u8 *tpm_data, int tpm_size);
27 	int (*recv)(void *phy_id, u8 tpm_register, u8 *tpm_data, int tpm_size);
28 };
29 
30 #ifdef CONFIG_PM_SLEEP
31 int st33zp24_pm_suspend(struct device *dev);
32 int st33zp24_pm_resume(struct device *dev);
33 #endif
34 
35 int st33zp24_probe(void *phy_id, const struct st33zp24_phy_ops *ops,
36 		   struct device *dev, int irq, int io_lpcpd);
37 int st33zp24_remove(struct tpm_chip *chip);
38 #endif /* __LOCAL_ST33ZP24_H__ */
39