All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage
@ 2017-06-05 20:19 Andy Shevchenko
  2017-06-05 20:19 ` [PATCH v2 01/12] NFC: pn544: Switch to devm_acpi_dev_add_driver_gpios() Andy Shevchenko
                   ` (13 more replies)
  0 siblings, 14 replies; 17+ messages in thread
From: Andy Shevchenko @ 2017-06-05 20:19 UTC (permalink / raw)
  To: Samuel Ortiz, linux-wireless; +Cc: Andy Shevchenko

This clean up series to NFC drivers that are using GPIOs on ACPI enabled
platforms. Since GPIO ACPI library goes stricter about requesting
resources we need to amend drivers for that. Here we are for NFC
subsystem.

While doing above, get rid of legacy and unused platform data as well as
some artificial IDs.

Changelog v2:
- add patches 1,4-12

Andy Shevchenko (12):
  NFC: pn544: Switch to devm_acpi_dev_add_driver_gpios()
  NFC: st21nfca: Add GPIO ACPI mapping table
  NFC: st21nfca: Get rid of code duplication in ->probe()
  NFC: fdp: Convert I2C driver to ->probe_new()
  NFC: fdp: Convert to use devres API
  NFC: fdp: Add GPIO ACPI mapping table
  NFC: st-nci: Get rid of platform data
  NFC: st-nci: Get rid of "interesting" use of interrupt polarity
  NFC: st-nci: Covert to use GPIO descriptor
  NFC: st-nci: Use unified device property API meaningfully
  NFC: st-nci: Add GPIO ACPI mapping table
  NFC: st-nci: Get rid of code duplication in ->probe()

 drivers/nfc/fdp/fdp.c                |  15 +---
 drivers/nfc/fdp/i2c.c                |  38 ++++----
 drivers/nfc/pn544/i2c.c              |   3 +-
 drivers/nfc/st-nci/i2c.c             | 164 ++++++----------------------------
 drivers/nfc/st-nci/spi.c             | 165 ++++++-----------------------------
 drivers/nfc/st21nfca/i2c.c           |  62 ++++---------
 include/linux/platform_data/st-nci.h |  31 -------
 7 files changed, 91 insertions(+), 387 deletions(-)
 delete mode 100644 include/linux/platform_data/st-nci.h

-- 
2.11.0

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v2 01/12] NFC: pn544: Switch to devm_acpi_dev_add_driver_gpios()
  2017-06-05 20:19 [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
@ 2017-06-05 20:19 ` Andy Shevchenko
  2017-06-05 20:19 ` [PATCH v2 02/12] NFC: st21nfca: Add GPIO ACPI mapping table Andy Shevchenko
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Andy Shevchenko @ 2017-06-05 20:19 UTC (permalink / raw)
  To: Samuel Ortiz, linux-wireless; +Cc: Andy Shevchenko

Switch to use managed variant of acpi_dev_add_driver_gpios() to simplify
error path and fix potentially wrong assingment if ->probe() fails.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/nfc/pn544/i2c.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c
index 71ac0836c9f4..619181e5b395 100644
--- a/drivers/nfc/pn544/i2c.c
+++ b/drivers/nfc/pn544/i2c.c
@@ -904,7 +904,7 @@ static int pn544_hci_i2c_probe(struct i2c_client *client,
 	phy->i2c_dev = client;
 	i2c_set_clientdata(client, phy);
 
-	r = acpi_dev_add_driver_gpios(ACPI_COMPANION(dev), acpi_pn544_gpios);
+	r = devm_acpi_dev_add_driver_gpios(dev, acpi_pn544_gpios);
 	if (r)
 		dev_dbg(dev, "Unable to add GPIO mapping table\n");
 
@@ -958,7 +958,6 @@ static int pn544_hci_i2c_remove(struct i2c_client *client)
 	if (phy->powered)
 		pn544_hci_i2c_disable(phy);
 
-	acpi_dev_remove_driver_gpios(ACPI_COMPANION(&client->dev));
 	return 0;
 }
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 02/12] NFC: st21nfca: Add GPIO ACPI mapping table
  2017-06-05 20:19 [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
  2017-06-05 20:19 ` [PATCH v2 01/12] NFC: pn544: Switch to devm_acpi_dev_add_driver_gpios() Andy Shevchenko
@ 2017-06-05 20:19 ` Andy Shevchenko
  2017-06-05 20:20 ` [PATCH v2 03/12] NFC: st21nfca: Get rid of code duplication in ->probe() Andy Shevchenko
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Andy Shevchenko @ 2017-06-05 20:19 UTC (permalink / raw)
  To: Samuel Ortiz, linux-wireless; +Cc: Andy Shevchenko

In order to make GPIO ACPI library stricter prepare users of
gpiod_get_index() to correctly behave when there no mapping is
provided by firmware.

Here we add explicit mapping between _CRS GpioIo() resources and
their names used in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/nfc/st21nfca/i2c.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c
index 02a920ca07c8..9b889e017a9d 100644
--- a/drivers/nfc/st21nfca/i2c.c
+++ b/drivers/nfc/st21nfca/i2c.c
@@ -501,14 +501,25 @@ static struct nfc_phy_ops i2c_phy_ops = {
 	.disable = st21nfca_hci_i2c_disable,
 };
 
+static const struct acpi_gpio_params enable_gpios = { 1, 0, false };
+
+static const struct acpi_gpio_mapping acpi_st21nfca_gpios[] = {
+	{ "enable-gpios", &enable_gpios, 1 },
+	{},
+};
+
 static int st21nfca_hci_i2c_acpi_request_resources(struct i2c_client *client)
 {
 	struct st21nfca_i2c_phy *phy = i2c_get_clientdata(client);
 	struct device *dev = &client->dev;
+	int ret;
+
+	ret = devm_acpi_dev_add_driver_gpios(dev, acpi_st21nfca_gpios);
+	if (ret)
+		return ret;
 
 	/* Get EN GPIO from ACPI */
-	phy->gpiod_ena = devm_gpiod_get_index(dev, ST21NFCA_GPIO_NAME_EN, 1,
-					      GPIOD_OUT_LOW);
+	phy->gpiod_ena = devm_gpiod_get(dev, ST21NFCA_GPIO_NAME_EN, GPIOD_OUT_LOW);
 	if (IS_ERR(phy->gpiod_ena)) {
 		nfc_err(dev, "Unable to get ENABLE GPIO\n");
 		return PTR_ERR(phy->gpiod_ena);
@@ -523,8 +534,7 @@ static int st21nfca_hci_i2c_of_request_resources(struct i2c_client *client)
 	struct device *dev = &client->dev;
 
 	/* Get GPIO from device tree */
-	phy->gpiod_ena = devm_gpiod_get_index(dev, ST21NFCA_GPIO_NAME_EN, 0,
-					      GPIOD_OUT_HIGH);
+	phy->gpiod_ena = devm_gpiod_get(dev, ST21NFCA_GPIO_NAME_EN, GPIOD_OUT_HIGH);
 	if (IS_ERR(phy->gpiod_ena)) {
 		nfc_err(dev, "Failed to request enable pin\n");
 		return PTR_ERR(phy->gpiod_ena);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 03/12] NFC: st21nfca: Get rid of code duplication in ->probe()
  2017-06-05 20:19 [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
  2017-06-05 20:19 ` [PATCH v2 01/12] NFC: pn544: Switch to devm_acpi_dev_add_driver_gpios() Andy Shevchenko
  2017-06-05 20:19 ` [PATCH v2 02/12] NFC: st21nfca: Add GPIO ACPI mapping table Andy Shevchenko
@ 2017-06-05 20:20 ` Andy Shevchenko
  2017-06-05 20:20 ` [PATCH v2 04/12] NFC: fdp: Convert I2C driver to ->probe_new() Andy Shevchenko
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Andy Shevchenko @ 2017-06-05 20:20 UTC (permalink / raw)
  To: Samuel Ortiz, linux-wireless; +Cc: Andy Shevchenko

Since OF and ACPI case almost the same get rid of code duplication
by moving gpiod_get() calls directly to ->probe().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/nfc/st21nfca/i2c.c | 62 ++++++++--------------------------------------
 1 file changed, 10 insertions(+), 52 deletions(-)

diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c
index 9b889e017a9d..e0efe3e77745 100644
--- a/drivers/nfc/st21nfca/i2c.c
+++ b/drivers/nfc/st21nfca/i2c.c
@@ -61,8 +61,6 @@
 #define ST21NFCA_HCI_DRIVER_NAME "st21nfca_hci"
 #define ST21NFCA_HCI_I2C_DRIVER_NAME "st21nfca_hci_i2c"
 
-#define ST21NFCA_GPIO_NAME_EN "enable"
-
 struct st21nfca_i2c_phy {
 	struct i2c_client *i2c_dev;
 	struct nfc_hci_dev *hdev;
@@ -508,44 +506,10 @@ static const struct acpi_gpio_mapping acpi_st21nfca_gpios[] = {
 	{},
 };
 
-static int st21nfca_hci_i2c_acpi_request_resources(struct i2c_client *client)
-{
-	struct st21nfca_i2c_phy *phy = i2c_get_clientdata(client);
-	struct device *dev = &client->dev;
-	int ret;
-
-	ret = devm_acpi_dev_add_driver_gpios(dev, acpi_st21nfca_gpios);
-	if (ret)
-		return ret;
-
-	/* Get EN GPIO from ACPI */
-	phy->gpiod_ena = devm_gpiod_get(dev, ST21NFCA_GPIO_NAME_EN, GPIOD_OUT_LOW);
-	if (IS_ERR(phy->gpiod_ena)) {
-		nfc_err(dev, "Unable to get ENABLE GPIO\n");
-		return PTR_ERR(phy->gpiod_ena);
-	}
-
-	return 0;
-}
-
-static int st21nfca_hci_i2c_of_request_resources(struct i2c_client *client)
-{
-	struct st21nfca_i2c_phy *phy = i2c_get_clientdata(client);
-	struct device *dev = &client->dev;
-
-	/* Get GPIO from device tree */
-	phy->gpiod_ena = devm_gpiod_get(dev, ST21NFCA_GPIO_NAME_EN, GPIOD_OUT_HIGH);
-	if (IS_ERR(phy->gpiod_ena)) {
-		nfc_err(dev, "Failed to request enable pin\n");
-		return PTR_ERR(phy->gpiod_ena);
-	}
-
-	return 0;
-}
-
 static int st21nfca_hci_i2c_probe(struct i2c_client *client,
 				  const struct i2c_device_id *id)
 {
+	struct device *dev = &client->dev;
 	struct st21nfca_i2c_phy *phy;
 	int r;
 
@@ -572,21 +536,15 @@ static int st21nfca_hci_i2c_probe(struct i2c_client *client,
 	mutex_init(&phy->phy_lock);
 	i2c_set_clientdata(client, phy);
 
-	if (client->dev.of_node) {
-		r = st21nfca_hci_i2c_of_request_resources(client);
-		if (r) {
-			nfc_err(&client->dev, "No platform data\n");
-			return r;
-		}
-	} else if (ACPI_HANDLE(&client->dev)) {
-		r = st21nfca_hci_i2c_acpi_request_resources(client);
-		if (r) {
-			nfc_err(&client->dev, "Cannot get ACPI data\n");
-			return r;
-		}
-	} else {
-		nfc_err(&client->dev, "st21nfca platform resources not available\n");
-		return -ENODEV;
+	r = devm_acpi_dev_add_driver_gpios(dev, acpi_st21nfca_gpios);
+	if (r)
+		dev_dbg(dev, "Unable to add GPIO mapping table\n");
+
+	/* Get EN GPIO from resource provider */
+	phy->gpiod_ena = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW);
+	if (IS_ERR(phy->gpiod_ena)) {
+		nfc_err(dev, "Unable to get ENABLE GPIO\n");
+		return PTR_ERR(phy->gpiod_ena);
 	}
 
 	phy->se_status.is_ese_present =
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 04/12] NFC: fdp: Convert I2C driver to ->probe_new()
  2017-06-05 20:19 [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
                   ` (2 preceding siblings ...)
  2017-06-05 20:20 ` [PATCH v2 03/12] NFC: st21nfca: Get rid of code duplication in ->probe() Andy Shevchenko
@ 2017-06-05 20:20 ` Andy Shevchenko
  2017-06-05 20:20 ` [PATCH v2 05/12] NFC: fdp: Convert to use devres API Andy Shevchenko
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Andy Shevchenko @ 2017-06-05 20:20 UTC (permalink / raw)
  To: Samuel Ortiz, linux-wireless; +Cc: Andy Shevchenko

There is no platform code that uses i2c module table. Remove it altogether and
adjust ->probe() to be ->probe_new().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/nfc/fdp/i2c.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/nfc/fdp/i2c.c b/drivers/nfc/fdp/i2c.c
index 712936f5d2d6..754d8d89c580 100644
--- a/drivers/nfc/fdp/i2c.c
+++ b/drivers/nfc/fdp/i2c.c
@@ -281,8 +281,7 @@ static void fdp_nci_i2c_read_device_properties(struct device *dev,
 		*clock_type, *clock_freq, *fw_vsc_cfg != NULL ? "yes" : "no");
 }
 
-static int fdp_nci_i2c_probe(struct i2c_client *client,
-			     const struct i2c_device_id *id)
+static int fdp_nci_i2c_probe(struct i2c_client *client)
 {
 	struct fdp_i2c_phy *phy;
 	struct device *dev = &client->dev;
@@ -360,12 +359,6 @@ static int fdp_nci_i2c_remove(struct i2c_client *client)
 	return 0;
 }
 
-static struct i2c_device_id fdp_nci_i2c_id_table[] = {
-	{"int339a", 0},
-	{}
-};
-MODULE_DEVICE_TABLE(i2c, fdp_nci_i2c_id_table);
-
 static const struct acpi_device_id fdp_nci_i2c_acpi_match[] = {
 	{"INT339A", 0},
 	{}
@@ -377,8 +370,7 @@ static struct i2c_driver fdp_nci_i2c_driver = {
 		   .name = FDP_I2C_DRIVER_NAME,
 		   .acpi_match_table = ACPI_PTR(fdp_nci_i2c_acpi_match),
 		  },
-	.id_table = fdp_nci_i2c_id_table,
-	.probe = fdp_nci_i2c_probe,
+	.probe_new = fdp_nci_i2c_probe,
 	.remove = fdp_nci_i2c_remove,
 };
 module_i2c_driver(fdp_nci_i2c_driver);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 05/12] NFC: fdp: Convert to use devres API
  2017-06-05 20:19 [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
                   ` (3 preceding siblings ...)
  2017-06-05 20:20 ` [PATCH v2 04/12] NFC: fdp: Convert I2C driver to ->probe_new() Andy Shevchenko
@ 2017-06-05 20:20 ` Andy Shevchenko
  2017-06-05 20:20 ` [PATCH v2 06/12] NFC: fdp: Add GPIO ACPI mapping table Andy Shevchenko
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Andy Shevchenko @ 2017-06-05 20:20 UTC (permalink / raw)
  To: Samuel Ortiz, linux-wireless; +Cc: Andy Shevchenko

It looks like there are two leftovers, at least one of which can leak
the resource (IRQ).

Convert both places to use devm variants of functions.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/nfc/fdp/fdp.c | 15 ++++-----------
 drivers/nfc/fdp/i2c.c | 10 +++++-----
 2 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/nfc/fdp/fdp.c b/drivers/nfc/fdp/fdp.c
index 7c1eaea3b685..8946eb21128d 100644
--- a/drivers/nfc/fdp/fdp.c
+++ b/drivers/nfc/fdp/fdp.c
@@ -750,11 +750,9 @@ int fdp_nci_probe(struct fdp_i2c_phy *phy, struct nfc_phy_ops *phy_ops,
 	u32 protocols;
 	int r;
 
-	info = kzalloc(sizeof(struct fdp_nci_info), GFP_KERNEL);
-	if (!info) {
-		r = -ENOMEM;
-		goto err_info_alloc;
-	}
+	info = devm_kzalloc(dev, sizeof(struct fdp_nci_info), GFP_KERNEL);
+	if (!info)
+		return -ENOMEM;
 
 	info->phy = phy;
 	info->phy_ops = phy_ops;
@@ -776,8 +774,7 @@ int fdp_nci_probe(struct fdp_i2c_phy *phy, struct nfc_phy_ops *phy_ops,
 				   tx_tailroom);
 	if (!ndev) {
 		nfc_err(dev, "Cannot allocate nfc ndev\n");
-		r = -ENOMEM;
-		goto err_alloc_ndev;
+		return -ENOMEM;
 	}
 
 	r = nci_register_device(ndev);
@@ -793,9 +790,6 @@ int fdp_nci_probe(struct fdp_i2c_phy *phy, struct nfc_phy_ops *phy_ops,
 
 err_regdev:
 	nci_free_device(ndev);
-err_alloc_ndev:
-	kfree(info);
-err_info_alloc:
 	return r;
 }
 EXPORT_SYMBOL(fdp_nci_probe);
@@ -809,7 +803,6 @@ void fdp_nci_remove(struct nci_dev *ndev)
 
 	nci_unregister_device(ndev);
 	nci_free_device(ndev);
-	kfree(info);
 }
 EXPORT_SYMBOL(fdp_nci_remove);
 
diff --git a/drivers/nfc/fdp/i2c.c b/drivers/nfc/fdp/i2c.c
index 754d8d89c580..250cbaddb5a9 100644
--- a/drivers/nfc/fdp/i2c.c
+++ b/drivers/nfc/fdp/i2c.c
@@ -303,8 +303,7 @@ static int fdp_nci_i2c_probe(struct i2c_client *client)
 		return -ENODEV;
 	}
 
-	phy = devm_kzalloc(dev, sizeof(struct fdp_i2c_phy),
-			   GFP_KERNEL);
+	phy = devm_kzalloc(dev, sizeof(struct fdp_i2c_phy), GFP_KERNEL);
 	if (!phy)
 		return -ENOMEM;
 
@@ -312,9 +311,10 @@ static int fdp_nci_i2c_probe(struct i2c_client *client)
 	phy->next_read_size = FDP_NCI_I2C_MIN_PAYLOAD;
 	i2c_set_clientdata(client, phy);
 
-	r = request_threaded_irq(client->irq, NULL, fdp_nci_i2c_irq_thread_fn,
-				 IRQF_TRIGGER_RISING | IRQF_ONESHOT,
-				 FDP_I2C_DRIVER_NAME, phy);
+	r = devm_request_threaded_irq(dev, client->irq,
+				      NULL, fdp_nci_i2c_irq_thread_fn,
+				      IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+				      FDP_I2C_DRIVER_NAME, phy);
 
 	if (r < 0) {
 		nfc_err(&client->dev, "Unable to register IRQ handler\n");
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 06/12] NFC: fdp: Add GPIO ACPI mapping table
  2017-06-05 20:19 [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
                   ` (4 preceding siblings ...)
  2017-06-05 20:20 ` [PATCH v2 05/12] NFC: fdp: Convert to use devres API Andy Shevchenko
@ 2017-06-05 20:20 ` Andy Shevchenko
  2017-06-05 20:20 ` [PATCH v2 07/12] NFC: st-nci: Get rid of platform data Andy Shevchenko
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Andy Shevchenko @ 2017-06-05 20:20 UTC (permalink / raw)
  To: Samuel Ortiz, linux-wireless; +Cc: Andy Shevchenko

In order to make GPIO ACPI library stricter prepare users of
gpiod_get_index() to correctly behave when there no mapping is
provided by firmware.

Here we add explicit mapping between _CRS GpioIo() resources and
their names used in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/nfc/fdp/i2c.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/nfc/fdp/i2c.c b/drivers/nfc/fdp/i2c.c
index 250cbaddb5a9..9f79f2c53525 100644
--- a/drivers/nfc/fdp/i2c.c
+++ b/drivers/nfc/fdp/i2c.c
@@ -27,7 +27,6 @@
 
 #define FDP_I2C_DRIVER_NAME	"fdp_nci_i2c"
 
-#define FDP_DP_POWER_GPIO_NAME	"power"
 #define FDP_DP_CLOCK_TYPE_NAME	"clock-type"
 #define FDP_DP_CLOCK_FREQ_NAME	"clock-freq"
 #define FDP_DP_FW_VSC_CFG_NAME	"fw-vsc-cfg"
@@ -281,6 +280,13 @@ static void fdp_nci_i2c_read_device_properties(struct device *dev,
 		*clock_type, *clock_freq, *fw_vsc_cfg != NULL ? "yes" : "no");
 }
 
+static const struct acpi_gpio_params power_gpios = { 0, 0, false };
+
+static const struct acpi_gpio_mapping acpi_fdp_gpios[] = {
+	{ "power-gpios", &power_gpios, 1 },
+	{},
+};
+
 static int fdp_nci_i2c_probe(struct i2c_client *client)
 {
 	struct fdp_i2c_phy *phy;
@@ -321,10 +327,12 @@ static int fdp_nci_i2c_probe(struct i2c_client *client)
 		return r;
 	}
 
-	/* Requesting the power gpio */
-	phy->power_gpio = devm_gpiod_get(dev, FDP_DP_POWER_GPIO_NAME,
-					 GPIOD_OUT_LOW);
+	r = devm_acpi_dev_add_driver_gpios(dev, acpi_fdp_gpios);
+	if (r)
+		dev_dbg(dev, "Unable to add GPIO mapping table\n");
 
+	/* Requesting the power gpio */
+	phy->power_gpio = devm_gpiod_get(dev, "power", GPIOD_OUT_LOW);
 	if (IS_ERR(phy->power_gpio)) {
 		nfc_err(dev, "Power GPIO request failed\n");
 		return PTR_ERR(phy->power_gpio);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 07/12] NFC: st-nci: Get rid of platform data
  2017-06-05 20:19 [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
                   ` (5 preceding siblings ...)
  2017-06-05 20:20 ` [PATCH v2 06/12] NFC: fdp: Add GPIO ACPI mapping table Andy Shevchenko
@ 2017-06-05 20:20 ` Andy Shevchenko
  2017-06-05 20:20 ` [PATCH v2 08/12] NFC: st-nci: Get rid of "interesting" use of interrupt polarity Andy Shevchenko
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Andy Shevchenko @ 2017-06-05 20:20 UTC (permalink / raw)
  To: Samuel Ortiz, linux-wireless; +Cc: Andy Shevchenko

Legacy platform data must go away. We are on the safe side here since
there are no users of it in the kernel.

If anyone by any odd reason needs it the GPIO lookup tables and
built-in device properties at your service.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/nfc/st-nci/i2c.c             | 43 ++----------------------------------
 drivers/nfc/st-nci/spi.c             | 43 ++----------------------------------
 include/linux/platform_data/st-nci.h | 31 --------------------------
 3 files changed, 4 insertions(+), 113 deletions(-)
 delete mode 100644 include/linux/platform_data/st-nci.h

diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c
index 9dfae0efa922..6d3d8e43fa50 100644
--- a/drivers/nfc/st-nci/i2c.c
+++ b/drivers/nfc/st-nci/i2c.c
@@ -27,7 +27,6 @@
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/nfc.h>
-#include <linux/platform_data/st-nci.h>
 
 #include "st-nci.h"
 
@@ -40,6 +39,7 @@
 #define ST_NCI_I2C_MIN_SIZE 4   /* PCB(1) + NCI Packet header(3) */
 #define ST_NCI_I2C_MAX_SIZE 250 /* req 4.2.1 */
 
+#define ST_NCI_DRIVER_NAME "st_nci"
 #define ST_NCI_I2C_DRIVER_NAME "st_nci_i2c"
 
 #define ST_NCI_GPIO_NAME_RESET "reset"
@@ -281,41 +281,10 @@ static int st_nci_i2c_of_request_resources(struct i2c_client *client)
 	return 0;
 }
 
-static int st_nci_i2c_request_resources(struct i2c_client *client)
-{
-	struct st_nci_nfc_platform_data *pdata;
-	struct st_nci_i2c_phy *phy = i2c_get_clientdata(client);
-	int r;
-
-	pdata = client->dev.platform_data;
-	if (pdata == NULL) {
-		nfc_err(&client->dev, "No platform data\n");
-		return -EINVAL;
-	}
-
-	/* store for later use */
-	phy->gpio_reset = pdata->gpio_reset;
-	phy->irq_polarity = pdata->irq_polarity;
-
-	r = devm_gpio_request_one(&client->dev,
-			phy->gpio_reset, GPIOF_OUT_INIT_HIGH,
-			ST_NCI_GPIO_NAME_RESET);
-	if (r) {
-		pr_err("%s : reset gpio_request failed\n", __FILE__);
-		return r;
-	}
-
-	phy->se_status.is_ese_present = pdata->is_ese_present;
-	phy->se_status.is_uicc_present = pdata->is_uicc_present;
-
-	return 0;
-}
-
 static int st_nci_i2c_probe(struct i2c_client *client,
 				  const struct i2c_device_id *id)
 {
 	struct st_nci_i2c_phy *phy;
-	struct st_nci_nfc_platform_data *pdata;
 	int r;
 
 	dev_dbg(&client->dev, "%s\n", __func__);
@@ -335,20 +304,12 @@ static int st_nci_i2c_probe(struct i2c_client *client,
 
 	i2c_set_clientdata(client, phy);
 
-	pdata = client->dev.platform_data;
-	if (!pdata && client->dev.of_node) {
+	if (client->dev.of_node) {
 		r = st_nci_i2c_of_request_resources(client);
 		if (r) {
 			nfc_err(&client->dev, "No platform data\n");
 			return r;
 		}
-	} else if (pdata) {
-		r = st_nci_i2c_request_resources(client);
-		if (r) {
-			nfc_err(&client->dev,
-				"Cannot get platform resources\n");
-			return r;
-		}
 	} else if (ACPI_HANDLE(&client->dev)) {
 		r = st_nci_i2c_acpi_request_resources(client);
 		if (r) {
diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c
index 89e341eba3eb..ee8ea708d5b7 100644
--- a/drivers/nfc/st-nci/spi.c
+++ b/drivers/nfc/st-nci/spi.c
@@ -28,7 +28,6 @@
 #include <linux/delay.h>
 #include <linux/nfc.h>
 #include <net/nfc/nci.h>
-#include <linux/platform_data/st-nci.h>
 
 #include "st-nci.h"
 
@@ -41,6 +40,7 @@
 #define ST_NCI_SPI_MIN_SIZE 4   /* PCB(1) + NCI Packet header(3) */
 #define ST_NCI_SPI_MAX_SIZE 250 /* req 4.2.1 */
 
+#define ST_NCI_DRIVER_NAME "st_nci"
 #define ST_NCI_SPI_DRIVER_NAME "st_nci_spi"
 
 #define ST_NCI_GPIO_NAME_RESET "reset"
@@ -296,40 +296,9 @@ static int st_nci_spi_of_request_resources(struct spi_device *dev)
 	return 0;
 }
 
-static int st_nci_spi_request_resources(struct spi_device *dev)
-{
-	struct st_nci_nfc_platform_data *pdata;
-	struct st_nci_spi_phy *phy = spi_get_drvdata(dev);
-	int r;
-
-	pdata = dev->dev.platform_data;
-	if (pdata == NULL) {
-		nfc_err(&dev->dev, "No platform data\n");
-		return -EINVAL;
-	}
-
-	/* store for later use */
-	phy->gpio_reset = pdata->gpio_reset;
-	phy->irq_polarity = pdata->irq_polarity;
-
-	r = devm_gpio_request_one(&dev->dev,
-			phy->gpio_reset, GPIOF_OUT_INIT_HIGH,
-			ST_NCI_GPIO_NAME_RESET);
-	if (r) {
-		pr_err("%s : reset gpio_request failed\n", __FILE__);
-		return r;
-	}
-
-	phy->se_status.is_ese_present = pdata->is_ese_present;
-	phy->se_status.is_uicc_present = pdata->is_uicc_present;
-
-	return 0;
-}
-
 static int st_nci_spi_probe(struct spi_device *dev)
 {
 	struct st_nci_spi_phy *phy;
-	struct st_nci_nfc_platform_data *pdata;
 	int r;
 
 	dev_dbg(&dev->dev, "%s\n", __func__);
@@ -351,20 +320,12 @@ static int st_nci_spi_probe(struct spi_device *dev)
 
 	spi_set_drvdata(dev, phy);
 
-	pdata = dev->dev.platform_data;
-	if (!pdata && dev->dev.of_node) {
+	if (dev->dev.of_node) {
 		r = st_nci_spi_of_request_resources(dev);
 		if (r) {
 			nfc_err(&dev->dev, "No platform data\n");
 			return r;
 		}
-	} else if (pdata) {
-		r = st_nci_spi_request_resources(dev);
-		if (r) {
-			nfc_err(&dev->dev,
-				"Cannot get platform resources\n");
-			return r;
-		}
 	} else if (ACPI_HANDLE(&dev->dev)) {
 		r = st_nci_spi_acpi_request_resources(dev);
 		if (r) {
diff --git a/include/linux/platform_data/st-nci.h b/include/linux/platform_data/st-nci.h
deleted file mode 100644
index f6494b347c06..000000000000
--- a/include/linux/platform_data/st-nci.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Driver include for ST NCI NFC chip family.
- *
- * Copyright (C) 2014-2015  STMicroelectronics SAS. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _ST_NCI_H_
-#define _ST_NCI_H_
-
-#define ST_NCI_DRIVER_NAME "st_nci"
-
-struct st_nci_nfc_platform_data {
-	unsigned int gpio_reset;
-	unsigned int irq_polarity;
-	bool is_ese_present;
-	bool is_uicc_present;
-};
-
-#endif /* _ST_NCI_H_ */
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 08/12] NFC: st-nci: Get rid of "interesting" use of interrupt polarity
  2017-06-05 20:19 [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
                   ` (6 preceding siblings ...)
  2017-06-05 20:20 ` [PATCH v2 07/12] NFC: st-nci: Get rid of platform data Andy Shevchenko
@ 2017-06-05 20:20 ` Andy Shevchenko
  2017-06-05 20:20 ` [PATCH v2 09/12] NFC: st-nci: Covert to use GPIO descriptor Andy Shevchenko
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Andy Shevchenko @ 2017-06-05 20:20 UTC (permalink / raw)
  To: Samuel Ortiz, linux-wireless; +Cc: Andy Shevchenko

I2C and SPI frameworks followed by IRQ framework do set
interrupt polarity correctly if it's properly specified in firmware
(ACPI or DT).

Get rid of the redundant trick when requesting interrupt.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/nfc/st-nci/i2c.c | 8 +-------
 drivers/nfc/st-nci/spi.c | 8 +-------
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c
index 6d3d8e43fa50..bdfbd543e671 100644
--- a/drivers/nfc/st-nci/i2c.c
+++ b/drivers/nfc/st-nci/i2c.c
@@ -21,7 +21,6 @@
 #include <linux/i2c.h>
 #include <linux/gpio.h>
 #include <linux/gpio/consumer.h>
-#include <linux/of_irq.h>
 #include <linux/of_gpio.h>
 #include <linux/acpi.h>
 #include <linux/interrupt.h>
@@ -51,7 +50,6 @@ struct st_nci_i2c_phy {
 	bool irq_active;
 
 	unsigned int gpio_reset;
-	unsigned int irq_polarity;
 
 	struct st_nci_se_status se_status;
 };
@@ -225,8 +223,6 @@ static int st_nci_i2c_acpi_request_resources(struct i2c_client *client)
 
 	phy->gpio_reset = desc_to_gpio(gpiod_reset);
 
-	phy->irq_polarity = irq_get_trigger_type(client->irq);
-
 	phy->se_status.is_ese_present = false;
 	phy->se_status.is_uicc_present = false;
 
@@ -271,8 +267,6 @@ static int st_nci_i2c_of_request_resources(struct i2c_client *client)
 	}
 	phy->gpio_reset = gpio;
 
-	phy->irq_polarity = irq_get_trigger_type(client->irq);
-
 	phy->se_status.is_ese_present =
 				of_property_read_bool(pp, "ese-present");
 	phy->se_status.is_uicc_present =
@@ -333,7 +327,7 @@ static int st_nci_i2c_probe(struct i2c_client *client,
 	phy->irq_active = true;
 	r = devm_request_threaded_irq(&client->dev, client->irq, NULL,
 				st_nci_irq_thread_fn,
-				phy->irq_polarity | IRQF_ONESHOT,
+				IRQF_ONESHOT,
 				ST_NCI_DRIVER_NAME, phy);
 	if (r < 0)
 		nfc_err(&client->dev, "Unable to register IRQ handler\n");
diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c
index ee8ea708d5b7..4585e205778b 100644
--- a/drivers/nfc/st-nci/spi.c
+++ b/drivers/nfc/st-nci/spi.c
@@ -21,7 +21,6 @@
 #include <linux/spi/spi.h>
 #include <linux/gpio.h>
 #include <linux/gpio/consumer.h>
-#include <linux/of_irq.h>
 #include <linux/of_gpio.h>
 #include <linux/acpi.h>
 #include <linux/interrupt.h>
@@ -52,7 +51,6 @@ struct st_nci_spi_phy {
 	bool irq_active;
 
 	unsigned int gpio_reset;
-	unsigned int irq_polarity;
 
 	struct st_nci_se_status se_status;
 };
@@ -240,8 +238,6 @@ static int st_nci_spi_acpi_request_resources(struct spi_device *spi_dev)
 
 	phy->gpio_reset = desc_to_gpio(gpiod_reset);
 
-	phy->irq_polarity = irq_get_trigger_type(spi_dev->irq);
-
 	phy->se_status.is_ese_present = false;
 	phy->se_status.is_uicc_present = false;
 
@@ -286,8 +282,6 @@ static int st_nci_spi_of_request_resources(struct spi_device *dev)
 	}
 	phy->gpio_reset = gpio;
 
-	phy->irq_polarity = irq_get_trigger_type(dev->irq);
-
 	phy->se_status.is_ese_present =
 				of_property_read_bool(pp, "ese-present");
 	phy->se_status.is_uicc_present =
@@ -349,7 +343,7 @@ static int st_nci_spi_probe(struct spi_device *dev)
 	phy->irq_active = true;
 	r = devm_request_threaded_irq(&dev->dev, dev->irq, NULL,
 				st_nci_irq_thread_fn,
-				phy->irq_polarity | IRQF_ONESHOT,
+				IRQF_ONESHOT,
 				ST_NCI_SPI_DRIVER_NAME, phy);
 	if (r < 0)
 		nfc_err(&dev->dev, "Unable to register IRQ handler\n");
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 09/12] NFC: st-nci: Covert to use GPIO descriptor
  2017-06-05 20:19 [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
                   ` (7 preceding siblings ...)
  2017-06-05 20:20 ` [PATCH v2 08/12] NFC: st-nci: Get rid of "interesting" use of interrupt polarity Andy Shevchenko
@ 2017-06-05 20:20 ` Andy Shevchenko
  2017-06-05 20:20 ` [PATCH v2 10/12] NFC: st-nci: Use unified device property API meaningfully Andy Shevchenko
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Andy Shevchenko @ 2017-06-05 20:20 UTC (permalink / raw)
  To: Samuel Ortiz, linux-wireless; +Cc: Andy Shevchenko

Since we got rid of platform data, the driver may use GPIO descriptor
directly.

Looking deeply to the use of the GPIO pin it looks like it should be
a GPIO based reset control rather than custom GPIO handling. But this
is out of scope of the change.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/nfc/st-nci/i2c.c | 38 +++++++++++---------------------------
 drivers/nfc/st-nci/spi.c | 40 ++++++++++++----------------------------
 2 files changed, 23 insertions(+), 55 deletions(-)

diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c
index bdfbd543e671..cc63c2f6823f 100644
--- a/drivers/nfc/st-nci/i2c.c
+++ b/drivers/nfc/st-nci/i2c.c
@@ -19,13 +19,12 @@
 
 #include <linux/module.h>
 #include <linux/i2c.h>
-#include <linux/gpio.h>
 #include <linux/gpio/consumer.h>
-#include <linux/of_gpio.h>
 #include <linux/acpi.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/nfc.h>
+#include <linux/of.h>
 
 #include "st-nci.h"
 
@@ -49,7 +48,7 @@ struct st_nci_i2c_phy {
 
 	bool irq_active;
 
-	unsigned int gpio_reset;
+	struct gpio_desc *gpiod_reset;
 
 	struct st_nci_se_status se_status;
 };
@@ -58,9 +57,9 @@ static int st_nci_i2c_enable(void *phy_id)
 {
 	struct st_nci_i2c_phy *phy = phy_id;
 
-	gpio_set_value(phy->gpio_reset, 0);
+	gpiod_set_value(phy->gpiod_reset, 0);
 	usleep_range(10000, 15000);
-	gpio_set_value(phy->gpio_reset, 1);
+	gpiod_set_value(phy->gpiod_reset, 1);
 	usleep_range(80000, 85000);
 
 	if (phy->ndlc->powered == 0 && phy->irq_active == 0) {
@@ -209,20 +208,16 @@ static struct nfc_phy_ops i2c_phy_ops = {
 static int st_nci_i2c_acpi_request_resources(struct i2c_client *client)
 {
 	struct st_nci_i2c_phy *phy = i2c_get_clientdata(client);
-	struct gpio_desc *gpiod_reset;
 	struct device *dev = &client->dev;
 	u8 tmp;
 
 	/* Get RESET GPIO from ACPI */
-	gpiod_reset = devm_gpiod_get_index(dev, ST_NCI_GPIO_NAME_RESET, 1,
-					   GPIOD_OUT_HIGH);
-	if (IS_ERR(gpiod_reset)) {
+	phy->gpiod_reset = devm_gpiod_get_index(dev, ST_NCI_GPIO_NAME_RESET, 1, GPIOD_OUT_HIGH);
+	if (IS_ERR(phy->gpiod_reset)) {
 		nfc_err(dev, "Unable to get RESET GPIO\n");
 		return -ENODEV;
 	}
 
-	phy->gpio_reset = desc_to_gpio(gpiod_reset);
-
 	phy->se_status.is_ese_present = false;
 	phy->se_status.is_uicc_present = false;
 
@@ -242,30 +237,19 @@ static int st_nci_i2c_acpi_request_resources(struct i2c_client *client)
 static int st_nci_i2c_of_request_resources(struct i2c_client *client)
 {
 	struct st_nci_i2c_phy *phy = i2c_get_clientdata(client);
+	struct device *dev = &client->dev;
 	struct device_node *pp;
-	int gpio;
-	int r;
 
 	pp = client->dev.of_node;
 	if (!pp)
 		return -ENODEV;
 
 	/* Get GPIO from device tree */
-	gpio = of_get_named_gpio(pp, "reset-gpios", 0);
-	if (gpio < 0) {
-		nfc_err(&client->dev,
-			"Failed to retrieve reset-gpios from device tree\n");
-		return gpio;
-	}
-
-	/* GPIO request and configuration */
-	r = devm_gpio_request_one(&client->dev, gpio,
-				GPIOF_OUT_INIT_HIGH, ST_NCI_GPIO_NAME_RESET);
-	if (r) {
-		nfc_err(&client->dev, "Failed to request reset pin\n");
-		return r;
+	phy->gpiod_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+	if (IS_ERR(phy->gpiod_reset)) {
+		nfc_err(dev, "Unable to get RESET GPIO\n");
+		return PTR_ERR(phy->gpiod_reset);
 	}
-	phy->gpio_reset = gpio;
 
 	phy->se_status.is_ese_present =
 				of_property_read_bool(pp, "ese-present");
diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c
index 4585e205778b..acf339d83360 100644
--- a/drivers/nfc/st-nci/spi.c
+++ b/drivers/nfc/st-nci/spi.c
@@ -19,13 +19,12 @@
 
 #include <linux/module.h>
 #include <linux/spi/spi.h>
-#include <linux/gpio.h>
 #include <linux/gpio/consumer.h>
-#include <linux/of_gpio.h>
 #include <linux/acpi.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/nfc.h>
+#include <linux/of.h>
 #include <net/nfc/nci.h>
 
 #include "st-nci.h"
@@ -50,7 +49,7 @@ struct st_nci_spi_phy {
 
 	bool irq_active;
 
-	unsigned int gpio_reset;
+	struct gpio_desc *gpiod_reset;
 
 	struct st_nci_se_status se_status;
 };
@@ -59,9 +58,9 @@ static int st_nci_spi_enable(void *phy_id)
 {
 	struct st_nci_spi_phy *phy = phy_id;
 
-	gpio_set_value(phy->gpio_reset, 0);
+	gpiod_set_value(phy->gpiod_reset, 0);
 	usleep_range(10000, 15000);
-	gpio_set_value(phy->gpio_reset, 1);
+	gpiod_set_value(phy->gpiod_reset, 1);
 	usleep_range(80000, 85000);
 
 	if (phy->ndlc->powered == 0 && phy->irq_active == 0) {
@@ -224,20 +223,16 @@ static struct nfc_phy_ops spi_phy_ops = {
 static int st_nci_spi_acpi_request_resources(struct spi_device *spi_dev)
 {
 	struct st_nci_spi_phy *phy = spi_get_drvdata(spi_dev);
-	struct gpio_desc *gpiod_reset;
 	struct device *dev = &spi_dev->dev;
 	u8 tmp;
 
 	/* Get RESET GPIO from ACPI */
-	gpiod_reset = devm_gpiod_get_index(dev, ST_NCI_GPIO_NAME_RESET, 1,
-					   GPIOD_OUT_HIGH);
-	if (IS_ERR(gpiod_reset)) {
+	phy->gpiod_reset = devm_gpiod_get_index(dev, ST_NCI_GPIO_NAME_RESET, 1, GPIOD_OUT_HIGH);
+	if (IS_ERR(phy->gpiod_reset)) {
 		nfc_err(dev, "Unable to get RESET GPIO\n");
-		return -ENODEV;
+		return PTR_ERR(phy->gpiod_reset);
 	}
 
-	phy->gpio_reset = desc_to_gpio(gpiod_reset);
-
 	phy->se_status.is_ese_present = false;
 	phy->se_status.is_uicc_present = false;
 
@@ -257,30 +252,19 @@ static int st_nci_spi_acpi_request_resources(struct spi_device *spi_dev)
 static int st_nci_spi_of_request_resources(struct spi_device *dev)
 {
 	struct st_nci_spi_phy *phy = spi_get_drvdata(dev);
+	struct device *dev = &dev->dev;
 	struct device_node *pp;
-	int gpio;
-	int r;
 
 	pp = dev->dev.of_node;
 	if (!pp)
 		return -ENODEV;
 
 	/* Get GPIO from device tree */
-	gpio = of_get_named_gpio(pp, "reset-gpios", 0);
-	if (gpio < 0) {
-		nfc_err(&dev->dev,
-			"Failed to retrieve reset-gpios from device tree\n");
-		return gpio;
-	}
-
-	/* GPIO request and configuration */
-	r = devm_gpio_request_one(&dev->dev, gpio,
-				GPIOF_OUT_INIT_HIGH, ST_NCI_GPIO_NAME_RESET);
-	if (r) {
-		nfc_err(&dev->dev, "Failed to request reset pin\n");
-		return r;
+	phy->gpiod_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+	if (IS_ERR(phy->gpiod_reset)) {
+		nfc_err(dev, "Unable to get RESET GPIO\n");
+		return PTR_ERR(phy->gpiod_reset);
 	}
-	phy->gpio_reset = gpio;
 
 	phy->se_status.is_ese_present =
 				of_property_read_bool(pp, "ese-present");
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 10/12] NFC: st-nci: Use unified device property API meaningfully
  2017-06-05 20:19 [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
                   ` (8 preceding siblings ...)
  2017-06-05 20:20 ` [PATCH v2 09/12] NFC: st-nci: Covert to use GPIO descriptor Andy Shevchenko
@ 2017-06-05 20:20 ` Andy Shevchenko
  2017-06-05 20:20 ` [PATCH v2 11/12] NFC: st-nci: Add GPIO ACPI mapping table Andy Shevchenko
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Andy Shevchenko @ 2017-06-05 20:20 UTC (permalink / raw)
  To: Samuel Ortiz, linux-wireless; +Cc: Andy Shevchenko

Use unified device property API in meaningful way.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/nfc/st-nci/i2c.c | 30 ++++++------------------------
 drivers/nfc/st-nci/spi.c | 29 +++++------------------------
 2 files changed, 11 insertions(+), 48 deletions(-)

diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c
index cc63c2f6823f..157e99992eae 100644
--- a/drivers/nfc/st-nci/i2c.c
+++ b/drivers/nfc/st-nci/i2c.c
@@ -209,7 +209,6 @@ static int st_nci_i2c_acpi_request_resources(struct i2c_client *client)
 {
 	struct st_nci_i2c_phy *phy = i2c_get_clientdata(client);
 	struct device *dev = &client->dev;
-	u8 tmp;
 
 	/* Get RESET GPIO from ACPI */
 	phy->gpiod_reset = devm_gpiod_get_index(dev, ST_NCI_GPIO_NAME_RESET, 1, GPIOD_OUT_HIGH);
@@ -218,19 +217,6 @@ static int st_nci_i2c_acpi_request_resources(struct i2c_client *client)
 		return -ENODEV;
 	}
 
-	phy->se_status.is_ese_present = false;
-	phy->se_status.is_uicc_present = false;
-
-	if (device_property_present(dev, "ese-present")) {
-		device_property_read_u8(dev, "ese-present", &tmp);
-		phy->se_status.is_ese_present = tmp;
-	}
-
-	if (device_property_present(dev, "uicc-present")) {
-		device_property_read_u8(dev, "uicc-present", &tmp);
-		phy->se_status.is_uicc_present = tmp;
-	}
-
 	return 0;
 }
 
@@ -238,11 +224,6 @@ static int st_nci_i2c_of_request_resources(struct i2c_client *client)
 {
 	struct st_nci_i2c_phy *phy = i2c_get_clientdata(client);
 	struct device *dev = &client->dev;
-	struct device_node *pp;
-
-	pp = client->dev.of_node;
-	if (!pp)
-		return -ENODEV;
 
 	/* Get GPIO from device tree */
 	phy->gpiod_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
@@ -251,17 +232,13 @@ static int st_nci_i2c_of_request_resources(struct i2c_client *client)
 		return PTR_ERR(phy->gpiod_reset);
 	}
 
-	phy->se_status.is_ese_present =
-				of_property_read_bool(pp, "ese-present");
-	phy->se_status.is_uicc_present =
-				of_property_read_bool(pp, "uicc-present");
-
 	return 0;
 }
 
 static int st_nci_i2c_probe(struct i2c_client *client,
 				  const struct i2c_device_id *id)
 {
+	struct device *dev = &client->dev;
 	struct st_nci_i2c_phy *phy;
 	int r;
 
@@ -300,6 +277,11 @@ static int st_nci_i2c_probe(struct i2c_client *client,
 		return -ENODEV;
 	}
 
+	phy->se_status.is_ese_present =
+				device_property_read_bool(dev, "ese-present");
+	phy->se_status.is_uicc_present =
+				device_property_read_bool(dev, "uicc-present");
+
 	r = ndlc_probe(phy, &i2c_phy_ops, &client->dev,
 			ST_NCI_FRAME_HEADROOM, ST_NCI_FRAME_TAILROOM,
 			&phy->ndlc, &phy->se_status);
diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c
index acf339d83360..d21259cf42c0 100644
--- a/drivers/nfc/st-nci/spi.c
+++ b/drivers/nfc/st-nci/spi.c
@@ -224,7 +224,6 @@ static int st_nci_spi_acpi_request_resources(struct spi_device *spi_dev)
 {
 	struct st_nci_spi_phy *phy = spi_get_drvdata(spi_dev);
 	struct device *dev = &spi_dev->dev;
-	u8 tmp;
 
 	/* Get RESET GPIO from ACPI */
 	phy->gpiod_reset = devm_gpiod_get_index(dev, ST_NCI_GPIO_NAME_RESET, 1, GPIOD_OUT_HIGH);
@@ -233,19 +232,6 @@ static int st_nci_spi_acpi_request_resources(struct spi_device *spi_dev)
 		return PTR_ERR(phy->gpiod_reset);
 	}
 
-	phy->se_status.is_ese_present = false;
-	phy->se_status.is_uicc_present = false;
-
-	if (device_property_present(dev, "ese-present")) {
-		device_property_read_u8(dev, "ese-present", &tmp);
-		tmp = phy->se_status.is_ese_present;
-	}
-
-	if (device_property_present(dev, "uicc-present")) {
-		device_property_read_u8(dev, "uicc-present", &tmp);
-		tmp = phy->se_status.is_uicc_present;
-	}
-
 	return 0;
 }
 
@@ -253,11 +239,6 @@ static int st_nci_spi_of_request_resources(struct spi_device *dev)
 {
 	struct st_nci_spi_phy *phy = spi_get_drvdata(dev);
 	struct device *dev = &dev->dev;
-	struct device_node *pp;
-
-	pp = dev->dev.of_node;
-	if (!pp)
-		return -ENODEV;
 
 	/* Get GPIO from device tree */
 	phy->gpiod_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
@@ -266,11 +247,6 @@ static int st_nci_spi_of_request_resources(struct spi_device *dev)
 		return PTR_ERR(phy->gpiod_reset);
 	}
 
-	phy->se_status.is_ese_present =
-				of_property_read_bool(pp, "ese-present");
-	phy->se_status.is_uicc_present =
-				of_property_read_bool(pp, "uicc-present");
-
 	return 0;
 }
 
@@ -316,6 +292,11 @@ static int st_nci_spi_probe(struct spi_device *dev)
 		return -ENODEV;
 	}
 
+	phy->se_status.is_ese_present =
+			device_property_read_bool(&dev->dev, "ese-present");
+	phy->se_status.is_uicc_present =
+			device_property_read_bool(&dev->dev, "uicc-present");
+
 	r = ndlc_probe(phy, &spi_phy_ops, &dev->dev,
 			ST_NCI_FRAME_HEADROOM, ST_NCI_FRAME_TAILROOM,
 			&phy->ndlc, &phy->se_status);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 11/12] NFC: st-nci: Add GPIO ACPI mapping table
  2017-06-05 20:19 [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
                   ` (9 preceding siblings ...)
  2017-06-05 20:20 ` [PATCH v2 10/12] NFC: st-nci: Use unified device property API meaningfully Andy Shevchenko
@ 2017-06-05 20:20 ` Andy Shevchenko
  2017-06-05 20:20 ` [PATCH v2 12/12] NFC: st-nci: Get rid of code duplication in ->probe() Andy Shevchenko
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Andy Shevchenko @ 2017-06-05 20:20 UTC (permalink / raw)
  To: Samuel Ortiz, linux-wireless; +Cc: Andy Shevchenko

In order to make GPIO ACPI library stricter prepare users of
gpiod_get_index() to correctly behave when there no mapping is
provided by firmware.

Here we add explicit mapping between _CRS GpioIo() resources and
their names used in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/nfc/st-nci/i2c.c | 16 +++++++++++++---
 drivers/nfc/st-nci/spi.c | 16 +++++++++++++---
 2 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c
index 157e99992eae..edda253b07fe 100644
--- a/drivers/nfc/st-nci/i2c.c
+++ b/drivers/nfc/st-nci/i2c.c
@@ -40,8 +40,6 @@
 #define ST_NCI_DRIVER_NAME "st_nci"
 #define ST_NCI_I2C_DRIVER_NAME "st_nci_i2c"
 
-#define ST_NCI_GPIO_NAME_RESET "reset"
-
 struct st_nci_i2c_phy {
 	struct i2c_client *i2c_dev;
 	struct llt_ndlc *ndlc;
@@ -205,13 +203,25 @@ static struct nfc_phy_ops i2c_phy_ops = {
 	.disable = st_nci_i2c_disable,
 };
 
+static const struct acpi_gpio_params reset_gpios = { 1, 0, false };
+
+static const struct acpi_gpio_mapping acpi_st_nci_gpios[] = {
+	{ "reset-gpios", &reset_gpios, 1 },
+	{},
+};
+
 static int st_nci_i2c_acpi_request_resources(struct i2c_client *client)
 {
 	struct st_nci_i2c_phy *phy = i2c_get_clientdata(client);
 	struct device *dev = &client->dev;
+	int r;
+
+	r = devm_acpi_dev_add_driver_gpios(dev, acpi_st_nci_gpios);
+	if (r)
+		return r;
 
 	/* Get RESET GPIO from ACPI */
-	phy->gpiod_reset = devm_gpiod_get_index(dev, ST_NCI_GPIO_NAME_RESET, 1, GPIOD_OUT_HIGH);
+	phy->gpiod_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
 	if (IS_ERR(phy->gpiod_reset)) {
 		nfc_err(dev, "Unable to get RESET GPIO\n");
 		return -ENODEV;
diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c
index d21259cf42c0..80afdb9ea248 100644
--- a/drivers/nfc/st-nci/spi.c
+++ b/drivers/nfc/st-nci/spi.c
@@ -41,8 +41,6 @@
 #define ST_NCI_DRIVER_NAME "st_nci"
 #define ST_NCI_SPI_DRIVER_NAME "st_nci_spi"
 
-#define ST_NCI_GPIO_NAME_RESET "reset"
-
 struct st_nci_spi_phy {
 	struct spi_device *spi_dev;
 	struct llt_ndlc *ndlc;
@@ -220,13 +218,25 @@ static struct nfc_phy_ops spi_phy_ops = {
 	.disable = st_nci_spi_disable,
 };
 
+static const struct acpi_gpio_params reset_gpios = { 1, 0, false };
+
+static const struct acpi_gpio_mapping acpi_st_nci_gpios[] = {
+	{ "reset-gpios", &reset_gpios, 1 },
+	{},
+};
+
 static int st_nci_spi_acpi_request_resources(struct spi_device *spi_dev)
 {
 	struct st_nci_spi_phy *phy = spi_get_drvdata(spi_dev);
 	struct device *dev = &spi_dev->dev;
+	int r;
+
+	r = devm_acpi_dev_add_driver_gpios(dev, acpi_st_nci_gpios);
+	if (r)
+		return r;
 
 	/* Get RESET GPIO from ACPI */
-	phy->gpiod_reset = devm_gpiod_get_index(dev, ST_NCI_GPIO_NAME_RESET, 1, GPIOD_OUT_HIGH);
+	phy->gpiod_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
 	if (IS_ERR(phy->gpiod_reset)) {
 		nfc_err(dev, "Unable to get RESET GPIO\n");
 		return PTR_ERR(phy->gpiod_reset);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 12/12] NFC: st-nci: Get rid of code duplication in ->probe()
  2017-06-05 20:19 [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
                   ` (10 preceding siblings ...)
  2017-06-05 20:20 ` [PATCH v2 11/12] NFC: st-nci: Add GPIO ACPI mapping table Andy Shevchenko
@ 2017-06-05 20:20 ` Andy Shevchenko
  2017-06-12 15:36 ` [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
  2017-06-18 23:11 ` Samuel Ortiz
  13 siblings, 0 replies; 17+ messages in thread
From: Andy Shevchenko @ 2017-06-05 20:20 UTC (permalink / raw)
  To: Samuel Ortiz, linux-wireless; +Cc: Andy Shevchenko

Since OF and ACPI case almost the same get rid of code duplication
by moving gpiod_get() calls directly to ->probe().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/nfc/st-nci/i2c.c | 61 +++++++---------------------------------------
 drivers/nfc/st-nci/spi.c | 63 ++++++++----------------------------------------
 2 files changed, 19 insertions(+), 105 deletions(-)

diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c
index edda253b07fe..515f08d037fb 100644
--- a/drivers/nfc/st-nci/i2c.c
+++ b/drivers/nfc/st-nci/i2c.c
@@ -210,41 +210,6 @@ static const struct acpi_gpio_mapping acpi_st_nci_gpios[] = {
 	{},
 };
 
-static int st_nci_i2c_acpi_request_resources(struct i2c_client *client)
-{
-	struct st_nci_i2c_phy *phy = i2c_get_clientdata(client);
-	struct device *dev = &client->dev;
-	int r;
-
-	r = devm_acpi_dev_add_driver_gpios(dev, acpi_st_nci_gpios);
-	if (r)
-		return r;
-
-	/* Get RESET GPIO from ACPI */
-	phy->gpiod_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
-	if (IS_ERR(phy->gpiod_reset)) {
-		nfc_err(dev, "Unable to get RESET GPIO\n");
-		return -ENODEV;
-	}
-
-	return 0;
-}
-
-static int st_nci_i2c_of_request_resources(struct i2c_client *client)
-{
-	struct st_nci_i2c_phy *phy = i2c_get_clientdata(client);
-	struct device *dev = &client->dev;
-
-	/* Get GPIO from device tree */
-	phy->gpiod_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
-	if (IS_ERR(phy->gpiod_reset)) {
-		nfc_err(dev, "Unable to get RESET GPIO\n");
-		return PTR_ERR(phy->gpiod_reset);
-	}
-
-	return 0;
-}
-
 static int st_nci_i2c_probe(struct i2c_client *client,
 				  const struct i2c_device_id *id)
 {
@@ -260,8 +225,7 @@ static int st_nci_i2c_probe(struct i2c_client *client,
 		return -ENODEV;
 	}
 
-	phy = devm_kzalloc(&client->dev, sizeof(struct st_nci_i2c_phy),
-			   GFP_KERNEL);
+	phy = devm_kzalloc(dev, sizeof(struct st_nci_i2c_phy), GFP_KERNEL);
 	if (!phy)
 		return -ENOMEM;
 
@@ -269,21 +233,14 @@ static int st_nci_i2c_probe(struct i2c_client *client,
 
 	i2c_set_clientdata(client, phy);
 
-	if (client->dev.of_node) {
-		r = st_nci_i2c_of_request_resources(client);
-		if (r) {
-			nfc_err(&client->dev, "No platform data\n");
-			return r;
-		}
-	} else if (ACPI_HANDLE(&client->dev)) {
-		r = st_nci_i2c_acpi_request_resources(client);
-		if (r) {
-			nfc_err(&client->dev, "Cannot get ACPI data\n");
-			return r;
-		}
-	} else {
-		nfc_err(&client->dev,
-			"st_nci platform resources not available\n");
+	r = devm_acpi_dev_add_driver_gpios(dev, acpi_st_nci_gpios);
+	if (r)
+		dev_dbg(dev, "Unable to add GPIO mapping table\n");
+
+	/* Get RESET GPIO */
+	phy->gpiod_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+	if (IS_ERR(phy->gpiod_reset)) {
+		nfc_err(dev, "Unable to get RESET GPIO\n");
 		return -ENODEV;
 	}
 
diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c
index 80afdb9ea248..5be9fd326488 100644
--- a/drivers/nfc/st-nci/spi.c
+++ b/drivers/nfc/st-nci/spi.c
@@ -225,41 +225,6 @@ static const struct acpi_gpio_mapping acpi_st_nci_gpios[] = {
 	{},
 };
 
-static int st_nci_spi_acpi_request_resources(struct spi_device *spi_dev)
-{
-	struct st_nci_spi_phy *phy = spi_get_drvdata(spi_dev);
-	struct device *dev = &spi_dev->dev;
-	int r;
-
-	r = devm_acpi_dev_add_driver_gpios(dev, acpi_st_nci_gpios);
-	if (r)
-		return r;
-
-	/* Get RESET GPIO from ACPI */
-	phy->gpiod_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
-	if (IS_ERR(phy->gpiod_reset)) {
-		nfc_err(dev, "Unable to get RESET GPIO\n");
-		return PTR_ERR(phy->gpiod_reset);
-	}
-
-	return 0;
-}
-
-static int st_nci_spi_of_request_resources(struct spi_device *dev)
-{
-	struct st_nci_spi_phy *phy = spi_get_drvdata(dev);
-	struct device *dev = &dev->dev;
-
-	/* Get GPIO from device tree */
-	phy->gpiod_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
-	if (IS_ERR(phy->gpiod_reset)) {
-		nfc_err(dev, "Unable to get RESET GPIO\n");
-		return PTR_ERR(phy->gpiod_reset);
-	}
-
-	return 0;
-}
-
 static int st_nci_spi_probe(struct spi_device *dev)
 {
 	struct st_nci_spi_phy *phy;
@@ -275,8 +240,7 @@ static int st_nci_spi_probe(struct spi_device *dev)
 		return -ENODEV;
 	}
 
-	phy = devm_kzalloc(&dev->dev, sizeof(struct st_nci_spi_phy),
-			   GFP_KERNEL);
+	phy = devm_kzalloc(&dev->dev, sizeof(struct st_nci_spi_phy), GFP_KERNEL);
 	if (!phy)
 		return -ENOMEM;
 
@@ -284,22 +248,15 @@ static int st_nci_spi_probe(struct spi_device *dev)
 
 	spi_set_drvdata(dev, phy);
 
-	if (dev->dev.of_node) {
-		r = st_nci_spi_of_request_resources(dev);
-		if (r) {
-			nfc_err(&dev->dev, "No platform data\n");
-			return r;
-		}
-	} else if (ACPI_HANDLE(&dev->dev)) {
-		r = st_nci_spi_acpi_request_resources(dev);
-		if (r) {
-			nfc_err(&dev->dev, "Cannot get ACPI data\n");
-			return r;
-		}
-	} else {
-		nfc_err(&dev->dev,
-			"st_nci platform resources not available\n");
-		return -ENODEV;
+	r = devm_acpi_dev_add_driver_gpios(&dev->dev, acpi_st_nci_gpios);
+	if (r)
+		dev_dbg(&dev->dev, "Unable to add GPIO mapping table\n");
+
+	/* Get RESET GPIO */
+	phy->gpiod_reset = devm_gpiod_get(&dev->dev, "reset", GPIOD_OUT_HIGH);
+	if (IS_ERR(phy->gpiod_reset)) {
+		nfc_err(&dev->dev, "Unable to get RESET GPIO\n");
+		return PTR_ERR(phy->gpiod_reset);
 	}
 
 	phy->se_status.is_ese_present =
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage
  2017-06-05 20:19 [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
                   ` (11 preceding siblings ...)
  2017-06-05 20:20 ` [PATCH v2 12/12] NFC: st-nci: Get rid of code duplication in ->probe() Andy Shevchenko
@ 2017-06-12 15:36 ` Andy Shevchenko
  2017-06-12 20:56   ` Samuel Ortiz
  2017-06-18 23:11 ` Samuel Ortiz
  13 siblings, 1 reply; 17+ messages in thread
From: Andy Shevchenko @ 2017-06-12 15:36 UTC (permalink / raw)
  To: Samuel Ortiz, linux-wireless

On Mon, 2017-06-05 at 23:19 +0300, Andy Shevchenko wrote:
> This clean up series to NFC drivers that are using GPIOs on ACPI
> enabled
> platforms. Since GPIO ACPI library goes stricter about requesting
> resources we need to amend drivers for that. Here we are for NFC
> subsystem.
> 
> While doing above, get rid of legacy and unused platform data as well
> as
> some artificial IDs.

Samuel, anything to comment?

> 
> Changelog v2:
> - add patches 1,4-12
> 
> Andy Shevchenko (12):
>   NFC: pn544: Switch to devm_acpi_dev_add_driver_gpios()
>   NFC: st21nfca: Add GPIO ACPI mapping table
>   NFC: st21nfca: Get rid of code duplication in ->probe()
>   NFC: fdp: Convert I2C driver to ->probe_new()
>   NFC: fdp: Convert to use devres API
>   NFC: fdp: Add GPIO ACPI mapping table
>   NFC: st-nci: Get rid of platform data
>   NFC: st-nci: Get rid of "interesting" use of interrupt polarity
>   NFC: st-nci: Covert to use GPIO descriptor
>   NFC: st-nci: Use unified device property API meaningfully
>   NFC: st-nci: Add GPIO ACPI mapping table
>   NFC: st-nci: Get rid of code duplication in ->probe()
> 
>  drivers/nfc/fdp/fdp.c                |  15 +---
>  drivers/nfc/fdp/i2c.c                |  38 ++++----
>  drivers/nfc/pn544/i2c.c              |   3 +-
>  drivers/nfc/st-nci/i2c.c             | 164 ++++++------------------
> ----------
>  drivers/nfc/st-nci/spi.c             | 165 ++++++------------------
> -----------
>  drivers/nfc/st21nfca/i2c.c           |  62 ++++---------
>  include/linux/platform_data/st-nci.h |  31 -------
>  7 files changed, 91 insertions(+), 387 deletions(-)
>  delete mode 100644 include/linux/platform_data/st-nci.h
> 

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage
  2017-06-12 15:36 ` [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
@ 2017-06-12 20:56   ` Samuel Ortiz
  2017-06-13  8:41     ` Andy Shevchenko
  0 siblings, 1 reply; 17+ messages in thread
From: Samuel Ortiz @ 2017-06-12 20:56 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-wireless

Andy,

On Mon, Jun 12, 2017 at 06:36:12PM +0300, Andy Shevchenko wrote:
> On Mon, 2017-06-05 at 23:19 +0300, Andy Shevchenko wrote:
> > This clean up series to NFC drivers that are using GPIOs on ACPI
> > enabled
> > platforms. Since GPIO ACPI library goes stricter about requesting
> > resources we need to amend drivers for that. Here we are for NFC
> > subsystem.
> > 
> > While doing above, get rid of legacy and unused platform data as well
> > as
> > some artificial IDs.
> 
> Samuel, anything to comment?
I will get to my pending NFC patches during the week.

Cheers,
Samuel.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage
  2017-06-12 20:56   ` Samuel Ortiz
@ 2017-06-13  8:41     ` Andy Shevchenko
  0 siblings, 0 replies; 17+ messages in thread
From: Andy Shevchenko @ 2017-06-13  8:41 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-wireless

On Mon, 2017-06-12 at 22:56 +0200, Samuel Ortiz wrote:
> On Mon, Jun 12, 2017 at 06:36:12PM +0300, Andy Shevchenko wrote:

> > Samuel, anything to comment?
> 
> I will get to my pending NFC patches during the week.

Thanks!

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage
  2017-06-05 20:19 [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
                   ` (12 preceding siblings ...)
  2017-06-12 15:36 ` [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
@ 2017-06-18 23:11 ` Samuel Ortiz
  13 siblings, 0 replies; 17+ messages in thread
From: Samuel Ortiz @ 2017-06-18 23:11 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-wireless, Linux NFC

Hi Andy,

On Mon, Jun 05, 2017 at 11:19:57PM +0300, Andy Shevchenko wrote:
> Andy Shevchenko (12):
>   NFC: pn544: Switch to devm_acpi_dev_add_driver_gpios()
>   NFC: st21nfca: Add GPIO ACPI mapping table
>   NFC: st21nfca: Get rid of code duplication in ->probe()
>   NFC: fdp: Convert I2C driver to ->probe_new()
>   NFC: fdp: Convert to use devres API
>   NFC: fdp: Add GPIO ACPI mapping table
>   NFC: st-nci: Get rid of platform data
>   NFC: st-nci: Get rid of "interesting" use of interrupt polarity
>   NFC: st-nci: Covert to use GPIO descriptor
>   NFC: st-nci: Use unified device property API meaningfully
>   NFC: st-nci: Add GPIO ACPI mapping table
>   NFC: st-nci: Get rid of code duplication in ->probe()
After fixing a couple of nitpicks, all patches applied now.
I'm fine with getting rid of the platform data, let's see if out of tree
users (especially for the ST driver) complain. Also, I'd appreciate if
you could cc linux-nfc to your submissions.

Cheers,
Samuel.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2017-06-18 23:11 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-05 20:19 [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
2017-06-05 20:19 ` [PATCH v2 01/12] NFC: pn544: Switch to devm_acpi_dev_add_driver_gpios() Andy Shevchenko
2017-06-05 20:19 ` [PATCH v2 02/12] NFC: st21nfca: Add GPIO ACPI mapping table Andy Shevchenko
2017-06-05 20:20 ` [PATCH v2 03/12] NFC: st21nfca: Get rid of code duplication in ->probe() Andy Shevchenko
2017-06-05 20:20 ` [PATCH v2 04/12] NFC: fdp: Convert I2C driver to ->probe_new() Andy Shevchenko
2017-06-05 20:20 ` [PATCH v2 05/12] NFC: fdp: Convert to use devres API Andy Shevchenko
2017-06-05 20:20 ` [PATCH v2 06/12] NFC: fdp: Add GPIO ACPI mapping table Andy Shevchenko
2017-06-05 20:20 ` [PATCH v2 07/12] NFC: st-nci: Get rid of platform data Andy Shevchenko
2017-06-05 20:20 ` [PATCH v2 08/12] NFC: st-nci: Get rid of "interesting" use of interrupt polarity Andy Shevchenko
2017-06-05 20:20 ` [PATCH v2 09/12] NFC: st-nci: Covert to use GPIO descriptor Andy Shevchenko
2017-06-05 20:20 ` [PATCH v2 10/12] NFC: st-nci: Use unified device property API meaningfully Andy Shevchenko
2017-06-05 20:20 ` [PATCH v2 11/12] NFC: st-nci: Add GPIO ACPI mapping table Andy Shevchenko
2017-06-05 20:20 ` [PATCH v2 12/12] NFC: st-nci: Get rid of code duplication in ->probe() Andy Shevchenko
2017-06-12 15:36 ` [PATCH v2 00/12] NFC: clean up for ACPI GPIO usage Andy Shevchenko
2017-06-12 20:56   ` Samuel Ortiz
2017-06-13  8:41     ` Andy Shevchenko
2017-06-18 23:11 ` Samuel Ortiz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.