mirror of https://gitee.com/openkylin/linux.git
tpm/st33zp24/spi: Use functions name with st33zp24_spi_ prefix
Make sure every function name use st33zp24_spi_ prefix. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
This commit is contained in:
parent
9feaab5dd2
commit
b83ada0caa
|
@ -145,7 +145,7 @@ static int st33zp24_spi_send(void *phy_id, u8 tpm_register, u8 *tpm_data,
|
||||||
} /* st33zp24_spi_send() */
|
} /* st33zp24_spi_send() */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* read8_recv
|
* st33zp24_spi_read8_recv
|
||||||
* Recv byte from the TIS register according to the ST33ZP24 SPI protocol.
|
* Recv byte from the TIS register according to the ST33ZP24 SPI protocol.
|
||||||
* @param: phy_id, the phy description
|
* @param: phy_id, the phy description
|
||||||
* @param: tpm_register, the tpm tis register where the data should be read
|
* @param: tpm_register, the tpm tis register where the data should be read
|
||||||
|
@ -153,7 +153,8 @@ static int st33zp24_spi_send(void *phy_id, u8 tpm_register, u8 *tpm_data,
|
||||||
* @param: tpm_size, tpm TPM response size to read.
|
* @param: tpm_size, tpm TPM response size to read.
|
||||||
* @return: should be zero if success else a negative error code.
|
* @return: should be zero if success else a negative error code.
|
||||||
*/
|
*/
|
||||||
static int read8_reg(void *phy_id, u8 tpm_register, u8 *tpm_data, int tpm_size)
|
static int st33zp24_spi_read8_reg(void *phy_id, u8 tpm_register, u8 *tpm_data,
|
||||||
|
int tpm_size)
|
||||||
{
|
{
|
||||||
u8 data = 0;
|
u8 data = 0;
|
||||||
int total_length = 0, ret;
|
int total_length = 0, ret;
|
||||||
|
@ -185,7 +186,7 @@ static int read8_reg(void *phy_id, u8 tpm_register, u8 *tpm_data, int tpm_size)
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
} /* read8_reg() */
|
} /* st33zp24_spi_read8_reg() */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* st33zp24_spi_recv
|
* st33zp24_spi_recv
|
||||||
|
@ -201,13 +202,13 @@ static int st33zp24_spi_recv(void *phy_id, u8 tpm_register, u8 *tpm_data,
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = read8_reg(phy_id, tpm_register, tpm_data, tpm_size);
|
ret = st33zp24_spi_read8_reg(phy_id, tpm_register, tpm_data, tpm_size);
|
||||||
if (!st33zp24_status_to_errno(ret))
|
if (!st33zp24_status_to_errno(ret))
|
||||||
return tpm_size;
|
return tpm_size;
|
||||||
return ret;
|
return ret;
|
||||||
} /* st33zp24_spi_recv() */
|
} /* st33zp24_spi_recv() */
|
||||||
|
|
||||||
static int evaluate_latency(void *phy_id)
|
static int st33zp24_spi_evaluate_latency(void *phy_id)
|
||||||
{
|
{
|
||||||
struct st33zp24_spi_phy *phy = phy_id;
|
struct st33zp24_spi_phy *phy = phy_id;
|
||||||
int latency = 1, status = 0;
|
int latency = 1, status = 0;
|
||||||
|
@ -215,7 +216,8 @@ static int evaluate_latency(void *phy_id)
|
||||||
|
|
||||||
while (!status && latency < MAX_SPI_LATENCY) {
|
while (!status && latency < MAX_SPI_LATENCY) {
|
||||||
phy->latency = latency;
|
phy->latency = latency;
|
||||||
status = read8_reg(phy_id, TPM_INTF_CAPABILITY, &data, 1);
|
status = st33zp24_spi_read8_reg(phy_id, TPM_INTF_CAPABILITY,
|
||||||
|
&data, 1);
|
||||||
latency++;
|
latency++;
|
||||||
}
|
}
|
||||||
return latency - 1;
|
return latency - 1;
|
||||||
|
@ -227,7 +229,7 @@ static const struct st33zp24_phy_ops spi_phy_ops = {
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_OF
|
#ifdef CONFIG_OF
|
||||||
static int tpm_stm_spi_of_request_resources(struct st33zp24_spi_phy *phy)
|
static int st33zp24_spi_of_request_resources(struct st33zp24_spi_phy *phy)
|
||||||
{
|
{
|
||||||
struct device_node *pp;
|
struct device_node *pp;
|
||||||
struct spi_device *dev = phy->spi_device;
|
struct spi_device *dev = phy->spi_device;
|
||||||
|
@ -265,14 +267,14 @@ static int tpm_stm_spi_of_request_resources(struct st33zp24_spi_phy *phy)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static int tpm_stm_spi_of_request_resources(struct st33zp24_spi_phy *phy)
|
static int st33zp24_spi_of_request_resources(struct st33zp24_spi_phy *phy)
|
||||||
{
|
{
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int tpm_stm_spi_request_resources(struct spi_device *dev,
|
static int st33zp24_spi_request_resources(struct spi_device *dev,
|
||||||
struct st33zp24_spi_phy *phy)
|
struct st33zp24_spi_phy *phy)
|
||||||
{
|
{
|
||||||
struct st33zp24_platform_data *pdata;
|
struct st33zp24_platform_data *pdata;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -301,13 +303,12 @@ static int tpm_stm_spi_request_resources(struct spi_device *dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* tpm_st33_spi_probe initialize the TPM device
|
* st33zp24_spi_probe initialize the TPM device
|
||||||
* @param: dev, the spi_device drescription (TPM SPI description).
|
* @param: dev, the spi_device drescription (TPM SPI description).
|
||||||
* @return: 0 in case of success.
|
* @return: 0 in case of success.
|
||||||
* or a negative value describing the error.
|
* or a negative value describing the error.
|
||||||
*/
|
*/
|
||||||
static int
|
static int st33zp24_spi_probe(struct spi_device *dev)
|
||||||
tpm_st33_spi_probe(struct spi_device *dev)
|
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct st33zp24_platform_data *pdata;
|
struct st33zp24_platform_data *pdata;
|
||||||
|
@ -328,11 +329,11 @@ tpm_st33_spi_probe(struct spi_device *dev)
|
||||||
phy->spi_device = dev;
|
phy->spi_device = dev;
|
||||||
pdata = dev->dev.platform_data;
|
pdata = dev->dev.platform_data;
|
||||||
if (!pdata && dev->dev.of_node) {
|
if (!pdata && dev->dev.of_node) {
|
||||||
ret = tpm_stm_spi_of_request_resources(phy);
|
ret = st33zp24_spi_of_request_resources(phy);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
} else if (pdata) {
|
} else if (pdata) {
|
||||||
ret = tpm_stm_spi_request_resources(dev, phy);
|
ret = st33zp24_spi_request_resources(dev, phy);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -340,7 +341,7 @@ tpm_st33_spi_probe(struct spi_device *dev)
|
||||||
phy->spi_xfer.tx_buf = phy->tx_buf;
|
phy->spi_xfer.tx_buf = phy->tx_buf;
|
||||||
phy->spi_xfer.rx_buf = phy->rx_buf;
|
phy->spi_xfer.rx_buf = phy->rx_buf;
|
||||||
|
|
||||||
phy->latency = evaluate_latency(phy);
|
phy->latency = st33zp24_spi_evaluate_latency(phy);
|
||||||
if (phy->latency <= 0)
|
if (phy->latency <= 0)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
|
@ -349,11 +350,11 @@ tpm_st33_spi_probe(struct spi_device *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* tpm_st33_spi_remove remove the TPM device
|
* st33zp24_spi_remove remove the TPM device
|
||||||
* @param: client, the spi_device drescription (TPM SPI description).
|
* @param: client, the spi_device drescription (TPM SPI description).
|
||||||
* @return: 0 in case of success.
|
* @return: 0 in case of success.
|
||||||
*/
|
*/
|
||||||
static int tpm_st33_spi_remove(struct spi_device *dev)
|
static int st33zp24_spi_remove(struct spi_device *dev)
|
||||||
{
|
{
|
||||||
struct tpm_chip *chip = spi_get_drvdata(dev);
|
struct tpm_chip *chip = spi_get_drvdata(dev);
|
||||||
|
|
||||||
|
@ -377,18 +378,18 @@ MODULE_DEVICE_TABLE(of, of_st33zp24_spi_match);
|
||||||
static SIMPLE_DEV_PM_OPS(st33zp24_spi_ops, st33zp24_pm_suspend,
|
static SIMPLE_DEV_PM_OPS(st33zp24_spi_ops, st33zp24_pm_suspend,
|
||||||
st33zp24_pm_resume);
|
st33zp24_pm_resume);
|
||||||
|
|
||||||
static struct spi_driver tpm_st33_spi_driver = {
|
static struct spi_driver st33zp24_spi_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = TPM_ST33_SPI,
|
.name = TPM_ST33_SPI,
|
||||||
.pm = &st33zp24_spi_ops,
|
.pm = &st33zp24_spi_ops,
|
||||||
.of_match_table = of_match_ptr(of_st33zp24_spi_match),
|
.of_match_table = of_match_ptr(of_st33zp24_spi_match),
|
||||||
},
|
},
|
||||||
.probe = tpm_st33_spi_probe,
|
.probe = st33zp24_spi_probe,
|
||||||
.remove = tpm_st33_spi_remove,
|
.remove = st33zp24_spi_remove,
|
||||||
.id_table = st33zp24_spi_id,
|
.id_table = st33zp24_spi_id,
|
||||||
};
|
};
|
||||||
|
|
||||||
module_spi_driver(tpm_st33_spi_driver);
|
module_spi_driver(st33zp24_spi_driver);
|
||||||
|
|
||||||
MODULE_AUTHOR("TPM support (TPMsupport@list.st.com)");
|
MODULE_AUTHOR("TPM support (TPMsupport@list.st.com)");
|
||||||
MODULE_DESCRIPTION("STM TPM 1.2 SPI ST33 Driver");
|
MODULE_DESCRIPTION("STM TPM 1.2 SPI ST33 Driver");
|
||||||
|
|
Loading…
Reference in New Issue