1bf38b871SChristophe Ricard /*
2bf38b871SChristophe Ricard  * STMicroelectronics TPM Linux driver for TPM ST33ZP24
32c2b217aSChristophe RICARD  * Copyright (C) 2009 - 2016  STMicroelectronics
4bf38b871SChristophe Ricard  *
5bf38b871SChristophe Ricard  * This program is free software; you can redistribute it and/or modify it
6bf38b871SChristophe Ricard  * under the terms and conditions of the GNU General Public License,
7bf38b871SChristophe Ricard  * version 2, as published by the Free Software Foundation.
8bf38b871SChristophe Ricard  *
9bf38b871SChristophe Ricard  * This program is distributed in the hope that it will be useful,
10bf38b871SChristophe Ricard  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11bf38b871SChristophe Ricard  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12bf38b871SChristophe Ricard  * GNU General Public License for more details.
13bf38b871SChristophe Ricard  *
14bf38b871SChristophe Ricard  * You should have received a copy of the GNU General Public License
15bf38b871SChristophe Ricard  * along with this program; if not, see <http://www.gnu.org/licenses/>.
16bf38b871SChristophe Ricard  */
17bf38b871SChristophe Ricard 
18bf38b871SChristophe Ricard #ifndef __LOCAL_ST33ZP24_H__
19bf38b871SChristophe Ricard #define __LOCAL_ST33ZP24_H__
20bf38b871SChristophe Ricard 
21f042a315SChristophe Ricard #define TPM_WRITE_DIRECTION             0x80
22f042a315SChristophe Ricard #define TPM_BUFSIZE                     2048
23f042a315SChristophe Ricard 
24570a3609SChristophe Ricard struct st33zp24_dev {
25570a3609SChristophe Ricard 	struct tpm_chip *chip;
26570a3609SChristophe Ricard 	void *phy_id;
27570a3609SChristophe Ricard 	const struct st33zp24_phy_ops *ops;
28570a3609SChristophe Ricard 	int irq;
29570a3609SChristophe Ricard 	u32 intrs;
30570a3609SChristophe Ricard 	int io_lpcpd;
31570a3609SChristophe Ricard };
32570a3609SChristophe Ricard 
33570a3609SChristophe Ricard 
34bf38b871SChristophe Ricard struct st33zp24_phy_ops {
35bf38b871SChristophe Ricard 	int (*send)(void *phy_id, u8 tpm_register, u8 *tpm_data, int tpm_size);
36bf38b871SChristophe Ricard 	int (*recv)(void *phy_id, u8 tpm_register, u8 *tpm_data, int tpm_size);
37bf38b871SChristophe Ricard };
38bf38b871SChristophe Ricard 
39bf38b871SChristophe Ricard #ifdef CONFIG_PM_SLEEP
40bf38b871SChristophe Ricard int st33zp24_pm_suspend(struct device *dev);
41bf38b871SChristophe Ricard int st33zp24_pm_resume(struct device *dev);
42bf38b871SChristophe Ricard #endif
43bf38b871SChristophe Ricard 
44bf38b871SChristophe Ricard int st33zp24_probe(void *phy_id, const struct st33zp24_phy_ops *ops,
45bf38b871SChristophe Ricard 		   struct device *dev, int irq, int io_lpcpd);
46bf38b871SChristophe Ricard int st33zp24_remove(struct tpm_chip *chip);
47bf38b871SChristophe Ricard #endif /* __LOCAL_ST33ZP24_H__ */
48