Lines Matching +full:phy +full:- +full:i2c
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * STMicroelectronics TPM I2C Linux driver for TPM ST33ZP24
4 * Copyright (C) 2009 - 2016 STMicroelectronics
8 #include <linux/i2c.h>
25 * Send byte to the TIS register according to the ST33ZP24 I2C protocol.
33 struct st33zp24_i2c_phy *phy = phy_id; in write8_reg() local
35 phy->buf[0] = tpm_register; in write8_reg()
36 memcpy(phy->buf + 1, tpm_data, tpm_size); in write8_reg()
37 return i2c_master_send(phy->client, phy->buf, tpm_size + 1); in write8_reg()
42 * Recv byte from the TIS register according to the ST33ZP24 I2C protocol.
50 struct st33zp24_i2c_phy *phy = phy_id; in read8_reg() local
55 status = write8_reg(phy, tpm_register, &data, 1); in read8_reg()
57 status = i2c_master_recv(phy->client, tpm_data, tpm_size); in read8_reg()
63 * Send byte to the TIS register according to the ST33ZP24 I2C protocol.
64 * @param: phy_id, the phy description
79 * Recv byte from the TIS register according to the ST33ZP24 I2C protocol.
80 * @param: phy_id, the phy description
99 * @param: client, the i2c_client description (TPM I2C description).
102 * -1 in other case.
106 struct st33zp24_i2c_phy *phy; in st33zp24_i2c_probe() local
108 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { in st33zp24_i2c_probe()
109 dev_info(&client->dev, "client not i2c capable\n"); in st33zp24_i2c_probe()
110 return -ENODEV; in st33zp24_i2c_probe()
113 phy = devm_kzalloc(&client->dev, sizeof(struct st33zp24_i2c_phy), in st33zp24_i2c_probe()
115 if (!phy) in st33zp24_i2c_probe()
116 return -ENOMEM; in st33zp24_i2c_probe()
118 phy->client = client; in st33zp24_i2c_probe()
120 return st33zp24_probe(phy, &i2c_phy_ops, &client->dev, client->irq); in st33zp24_i2c_probe()
125 * @param: client, the i2c_client description (TPM I2C description).
139 MODULE_DEVICE_TABLE(i2c, st33zp24_i2c_id);
142 { .compatible = "st,st33zp24-i2c", },
171 MODULE_DESCRIPTION("STM TPM 1.2 I2C ST33 Driver");