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; 28*56671c89SChristophe Ricard int locality; 29570a3609SChristophe Ricard int irq; 30570a3609SChristophe Ricard u32 intrs; 31570a3609SChristophe Ricard int io_lpcpd; 326e599f6fSChristophe Ricard wait_queue_head_t read_queue; 33570a3609SChristophe Ricard }; 34570a3609SChristophe Ricard 35570a3609SChristophe Ricard 36bf38b871SChristophe Ricard struct st33zp24_phy_ops { 37bf38b871SChristophe Ricard int (*send)(void *phy_id, u8 tpm_register, u8 *tpm_data, int tpm_size); 38bf38b871SChristophe Ricard int (*recv)(void *phy_id, u8 tpm_register, u8 *tpm_data, int tpm_size); 39bf38b871SChristophe Ricard }; 40bf38b871SChristophe Ricard 41bf38b871SChristophe Ricard #ifdef CONFIG_PM_SLEEP 42bf38b871SChristophe Ricard int st33zp24_pm_suspend(struct device *dev); 43bf38b871SChristophe Ricard int st33zp24_pm_resume(struct device *dev); 44bf38b871SChristophe Ricard #endif 45bf38b871SChristophe Ricard 46bf38b871SChristophe Ricard int st33zp24_probe(void *phy_id, const struct st33zp24_phy_ops *ops, 47bf38b871SChristophe Ricard struct device *dev, int irq, int io_lpcpd); 48bf38b871SChristophe Ricard int st33zp24_remove(struct tpm_chip *chip); 49bf38b871SChristophe Ricard #endif /* __LOCAL_ST33ZP24_H__ */ 50