Commit 04593028 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Jarkko Sakkinen

tpm: st33zp24: drop support for platform data

Drop support for platform data from the driver because there are no
users of st33zp24_platform_data structure in the mainline kernel.
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
parent 479174d4
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/tpm.h> #include <linux/tpm.h>
#include <linux/platform_data/st33zp24.h>
#include "../tpm.h" #include "../tpm.h"
#include "st33zp24.h" #include "st33zp24.h"
...@@ -178,36 +177,6 @@ static int st33zp24_i2c_of_request_resources(struct i2c_client *client) ...@@ -178,36 +177,6 @@ static int st33zp24_i2c_of_request_resources(struct i2c_client *client)
return 0; return 0;
} }
static int st33zp24_i2c_request_resources(struct i2c_client *client)
{
struct tpm_chip *chip = i2c_get_clientdata(client);
struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev);
struct st33zp24_i2c_phy *phy = tpm_dev->phy_id;
struct st33zp24_platform_data *pdata;
int ret;
pdata = client->dev.platform_data;
if (!pdata) {
dev_err(&client->dev, "No platform data\n");
return -ENODEV;
}
/* store for late use */
phy->io_lpcpd = pdata->io_lpcpd;
if (gpio_is_valid(pdata->io_lpcpd)) {
ret = devm_gpio_request_one(&client->dev,
pdata->io_lpcpd, GPIOF_OUT_INIT_HIGH,
"TPM IO_LPCPD");
if (ret) {
dev_err(&client->dev, "Failed to request lpcpd pin\n");
return ret;
}
}
return 0;
}
/* /*
* st33zp24_i2c_probe initialize the TPM device * st33zp24_i2c_probe initialize the TPM device
* @param: client, the i2c_client description (TPM I2C description). * @param: client, the i2c_client description (TPM I2C description).
...@@ -219,7 +188,6 @@ static int st33zp24_i2c_probe(struct i2c_client *client, ...@@ -219,7 +188,6 @@ static int st33zp24_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id) const struct i2c_device_id *id)
{ {
int ret; int ret;
struct st33zp24_platform_data *pdata;
struct st33zp24_i2c_phy *phy; struct st33zp24_i2c_phy *phy;
if (!client) { if (!client) {
...@@ -240,19 +208,16 @@ static int st33zp24_i2c_probe(struct i2c_client *client, ...@@ -240,19 +208,16 @@ static int st33zp24_i2c_probe(struct i2c_client *client,
phy->client = client; phy->client = client;
pdata = client->dev.platform_data; if (client->dev.of_node) {
if (!pdata && client->dev.of_node) {
ret = st33zp24_i2c_of_request_resources(client); ret = st33zp24_i2c_of_request_resources(client);
if (ret) if (ret)
return ret; return ret;
} else if (pdata) {
ret = st33zp24_i2c_request_resources(client);
if (ret)
return ret;
} else if (ACPI_HANDLE(&client->dev)) { } else if (ACPI_HANDLE(&client->dev)) {
ret = st33zp24_i2c_acpi_request_resources(client); ret = st33zp24_i2c_acpi_request_resources(client);
if (ret) if (ret)
return ret; return ret;
} else {
return -ENODEV;
} }
return st33zp24_probe(phy, &i2c_phy_ops, &client->dev, client->irq, return st33zp24_probe(phy, &i2c_phy_ops, &client->dev, client->irq,
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/tpm.h> #include <linux/tpm.h>
#include <linux/platform_data/st33zp24.h>
#include "../tpm.h" #include "../tpm.h"
#include "st33zp24.h" #include "st33zp24.h"
...@@ -296,37 +295,6 @@ static int st33zp24_spi_of_request_resources(struct spi_device *spi_dev) ...@@ -296,37 +295,6 @@ static int st33zp24_spi_of_request_resources(struct spi_device *spi_dev)
return 0; return 0;
} }
static int st33zp24_spi_request_resources(struct spi_device *dev)
{
struct tpm_chip *chip = spi_get_drvdata(dev);
struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev);
struct st33zp24_spi_phy *phy = tpm_dev->phy_id;
struct st33zp24_platform_data *pdata;
int ret;
pdata = dev->dev.platform_data;
if (!pdata) {
dev_err(&dev->dev, "No platform data\n");
return -ENODEV;
}
/* store for late use */
phy->io_lpcpd = pdata->io_lpcpd;
if (gpio_is_valid(pdata->io_lpcpd)) {
ret = devm_gpio_request_one(&dev->dev,
pdata->io_lpcpd, GPIOF_OUT_INIT_HIGH,
"TPM IO_LPCPD");
if (ret) {
dev_err(&dev->dev, "%s : reset gpio_request failed\n",
__FILE__);
return ret;
}
}
return 0;
}
/* /*
* st33zp24_spi_probe initialize the TPM device * st33zp24_spi_probe initialize the TPM device
* @param: dev, the spi_device description (TPM SPI description). * @param: dev, the spi_device description (TPM SPI description).
...@@ -336,7 +304,6 @@ static int st33zp24_spi_request_resources(struct spi_device *dev) ...@@ -336,7 +304,6 @@ static int st33zp24_spi_request_resources(struct spi_device *dev)
static int st33zp24_spi_probe(struct spi_device *dev) static int st33zp24_spi_probe(struct spi_device *dev)
{ {
int ret; int ret;
struct st33zp24_platform_data *pdata;
struct st33zp24_spi_phy *phy; struct st33zp24_spi_phy *phy;
/* Check SPI platform functionnalities */ /* Check SPI platform functionnalities */
...@@ -353,19 +320,16 @@ static int st33zp24_spi_probe(struct spi_device *dev) ...@@ -353,19 +320,16 @@ static int st33zp24_spi_probe(struct spi_device *dev)
phy->spi_device = dev; phy->spi_device = dev;
pdata = dev->dev.platform_data; if (dev->dev.of_node) {
if (!pdata && dev->dev.of_node) {
ret = st33zp24_spi_of_request_resources(dev); ret = st33zp24_spi_of_request_resources(dev);
if (ret) if (ret)
return ret; return ret;
} else if (pdata) {
ret = st33zp24_spi_request_resources(dev);
if (ret)
return ret;
} else if (ACPI_HANDLE(&dev->dev)) { } else if (ACPI_HANDLE(&dev->dev)) {
ret = st33zp24_spi_acpi_request_resources(dev); ret = st33zp24_spi_acpi_request_resources(dev);
if (ret) if (ret)
return ret; return ret;
} else {
return -ENODEV;
} }
phy->latency = st33zp24_spi_evaluate_latency(phy); phy->latency = st33zp24_spi_evaluate_latency(phy);
...@@ -411,7 +375,7 @@ static SIMPLE_DEV_PM_OPS(st33zp24_spi_ops, st33zp24_pm_suspend, ...@@ -411,7 +375,7 @@ static SIMPLE_DEV_PM_OPS(st33zp24_spi_ops, st33zp24_pm_suspend,
static struct spi_driver st33zp24_spi_driver = { static struct spi_driver st33zp24_spi_driver = {
.driver = { .driver = {
.name = TPM_ST33_SPI, .name = "st33zp24-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),
.acpi_match_table = ACPI_PTR(st33zp24_spi_acpi_match), .acpi_match_table = ACPI_PTR(st33zp24_spi_acpi_match),
......
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
#ifndef __LOCAL_ST33ZP24_H__ #ifndef __LOCAL_ST33ZP24_H__
#define __LOCAL_ST33ZP24_H__ #define __LOCAL_ST33ZP24_H__
#define TPM_ST33_I2C "st33zp24-i2c"
#define TPM_ST33_SPI "st33zp24-spi"
#define TPM_WRITE_DIRECTION 0x80 #define TPM_WRITE_DIRECTION 0x80
#define ST33ZP24_BUFSIZE 2048 #define ST33ZP24_BUFSIZE 2048
......
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* STMicroelectronics TPM Linux driver for TPM 1.2 ST33ZP24
* Copyright (C) 2009 - 2016 STMicroelectronics
*/
#ifndef __ST33ZP24_H__
#define __ST33ZP24_H__
#define TPM_ST33_I2C "st33zp24-i2c"
#define TPM_ST33_SPI "st33zp24-spi"
struct st33zp24_platform_data {
int io_lpcpd;
};
#endif /* __ST33ZP24_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment