netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support
@ 2019-07-29 13:35 Andy Shevchenko
  2019-07-29 13:35 ` [PATCH v4 01/14] NFC: fix attrs checks in netlink interface Andy Shevchenko
                   ` (15 more replies)
  0 siblings, 16 replies; 18+ messages in thread
From: Andy Shevchenko @ 2019-07-29 13:35 UTC (permalink / raw)
  To: Clément Perrochaud, Charles Gorand, netdev, David S. Miller,
	Sedat Dilek
  Cc: Andy Shevchenko

Few people reported that some laptops are coming with new ACPI ID for the
devices should be supported by nxp-nci driver.

This series adds new ID (patch 2), cleans up the driver from legacy platform
data and unifies GPIO request for Device Tree and ACPI (patches 3-6), removes
dead or unneeded code (patches 7, 9, 11), constifies ID table (patch 8),
removes comma in terminator line for better maintenance (patch 10) and
rectifies Kconfig entry (patches 12-14).

It also contains a fix for NFC subsystem as suggested by Sedat.

Series has been tested by Sedat.

Changelog v4:
- rebased on top of latest linux-next
- appended cover letter
- elaborated removal of pr_fmt() in the patch 11 (David)

Andrey Konovalov (1):
  NFC: fix attrs checks in netlink interface

Andy Shevchenko (11):
  NFC: nxp-nci: Add NXP1001 to the ACPI ID table
  NFC: nxp-nci: Get rid of platform data
  NFC: nxp-nci: Convert to use GPIO descriptor
  NFC: nxp-nci: Add GPIO ACPI mapping table
  NFC: nxp-nci: Get rid of code duplication in ->probe()
  NFC: nxp-nci: Get rid of useless label
  NFC: nxp-nci: Constify acpi_device_id
  NFC: nxp-nci: Drop of_match_ptr() use
  NFC: nxp-nci: Drop comma in terminator lines
  NFC: nxp-nci: Remove unused macro pr_fmt()
  NFC: nxp-nci: Remove 'default n' for the core

Sedat Dilek (2):
  NFC: nxp-nci: Clarify on supported chips
  NFC: nxp-nci: Fix recommendation for NFC_NXP_NCI_I2C Kconfig

 MAINTAINERS                           |   1 -
 drivers/nfc/nxp-nci/Kconfig           |   7 +-
 drivers/nfc/nxp-nci/core.c            |   2 -
 drivers/nfc/nxp-nci/i2c.c             | 134 +++++++-------------------
 drivers/nfc/nxp-nci/nxp-nci.h         |   1 -
 include/linux/platform_data/nxp-nci.h |  19 ----
 net/nfc/netlink.c                     |   6 +-
 7 files changed, 41 insertions(+), 129 deletions(-)
 delete mode 100644 include/linux/platform_data/nxp-nci.h

-- 
2.20.1


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

* [PATCH v4 01/14] NFC: fix attrs checks in netlink interface
  2019-07-29 13:35 [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support Andy Shevchenko
@ 2019-07-29 13:35 ` Andy Shevchenko
  2019-07-29 13:35 ` [PATCH v4 02/14] NFC: nxp-nci: Add NXP1001 to the ACPI ID table Andy Shevchenko
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Andy Shevchenko @ 2019-07-29 13:35 UTC (permalink / raw)
  To: Clément Perrochaud, Charles Gorand, netdev, David S. Miller,
	Sedat Dilek
  Cc: Andrey Konovalov, Andy Shevchenko

From: Andrey Konovalov <andreyknvl@google.com>

nfc_genl_deactivate_target() relies on the NFC_ATTR_TARGET_INDEX
attribute being present, but doesn't check whether it is actually
provided by the user. Same goes for nfc_genl_fw_download() and
NFC_ATTR_FIRMWARE_NAME.

This patch adds appropriate checks.

Found with syzkaller.

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 net/nfc/netlink.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index 4a30309bb67f..60fd2748d0ea 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -970,7 +970,8 @@ static int nfc_genl_dep_link_down(struct sk_buff *skb, struct genl_info *info)
 	int rc;
 	u32 idx;
 
-	if (!info->attrs[NFC_ATTR_DEVICE_INDEX])
+	if (!info->attrs[NFC_ATTR_DEVICE_INDEX] ||
+	    !info->attrs[NFC_ATTR_TARGET_INDEX])
 		return -EINVAL;
 
 	idx = nla_get_u32(info->attrs[NFC_ATTR_DEVICE_INDEX]);
@@ -1018,7 +1019,8 @@ static int nfc_genl_llc_get_params(struct sk_buff *skb, struct genl_info *info)
 	struct sk_buff *msg = NULL;
 	u32 idx;
 
-	if (!info->attrs[NFC_ATTR_DEVICE_INDEX])
+	if (!info->attrs[NFC_ATTR_DEVICE_INDEX] ||
+	    !info->attrs[NFC_ATTR_FIRMWARE_NAME])
 		return -EINVAL;
 
 	idx = nla_get_u32(info->attrs[NFC_ATTR_DEVICE_INDEX]);
-- 
2.20.1


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

* [PATCH v4 02/14] NFC: nxp-nci: Add NXP1001 to the ACPI ID table
  2019-07-29 13:35 [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support Andy Shevchenko
  2019-07-29 13:35 ` [PATCH v4 01/14] NFC: fix attrs checks in netlink interface Andy Shevchenko
@ 2019-07-29 13:35 ` Andy Shevchenko
  2019-07-29 13:35 ` [PATCH v4 03/14] NFC: nxp-nci: Get rid of platform data Andy Shevchenko
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Andy Shevchenko @ 2019-07-29 13:35 UTC (permalink / raw)
  To: Clément Perrochaud, Charles Gorand, netdev, David S. Miller,
	Sedat Dilek
  Cc: Andy Shevchenko, Sedat Dilek

It seems a lot of laptops are equipped with NXP NFC300 chip with
the ACPI ID NXP1001 as per DSDT.

Append it to the driver's ACPI ID table.

Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 drivers/nfc/nxp-nci/i2c.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index 4aeb3861b409..5db71869f04b 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -396,6 +396,7 @@ MODULE_DEVICE_TABLE(of, of_nxp_nci_i2c_match);
 
 #ifdef CONFIG_ACPI
 static struct acpi_device_id acpi_id[] = {
+	{ "NXP1001" },
 	{ "NXP7471" },
 	{ },
 };
-- 
2.20.1


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

* [PATCH v4 03/14] NFC: nxp-nci: Get rid of platform data
  2019-07-29 13:35 [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support Andy Shevchenko
  2019-07-29 13:35 ` [PATCH v4 01/14] NFC: fix attrs checks in netlink interface Andy Shevchenko
  2019-07-29 13:35 ` [PATCH v4 02/14] NFC: nxp-nci: Add NXP1001 to the ACPI ID table Andy Shevchenko
@ 2019-07-29 13:35 ` Andy Shevchenko
  2019-07-29 13:35 ` [PATCH v4 04/14] NFC: nxp-nci: Convert to use GPIO descriptor Andy Shevchenko
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Andy Shevchenko @ 2019-07-29 13:35 UTC (permalink / raw)
  To: Clément Perrochaud, Charles Gorand, netdev, David S. Miller,
	Sedat Dilek
  Cc: Andy Shevchenko, Sedat Dilek

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>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 MAINTAINERS                           |  1 -
 drivers/nfc/nxp-nci/core.c            |  1 -
 drivers/nfc/nxp-nci/i2c.c             |  9 +--------
 drivers/nfc/nxp-nci/nxp-nci.h         |  1 -
 include/linux/platform_data/nxp-nci.h | 19 -------------------
 5 files changed, 1 insertion(+), 30 deletions(-)
 delete mode 100644 include/linux/platform_data/nxp-nci.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 99f64e395623..f204f7a65428 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11353,7 +11353,6 @@ F:	include/net/nfc/
 F:	include/uapi/linux/nfc.h
 F:	drivers/nfc/
 F:	include/linux/platform_data/nfcmrvl.h
-F:	include/linux/platform_data/nxp-nci.h
 F:	Documentation/devicetree/bindings/net/nfc/
 
 NFS, SUNRPC, AND LOCKD CLIENTS
diff --git a/drivers/nfc/nxp-nci/core.c b/drivers/nfc/nxp-nci/core.c
index 8dafc696719f..aed18ca60170 100644
--- a/drivers/nfc/nxp-nci/core.c
+++ b/drivers/nfc/nxp-nci/core.c
@@ -14,7 +14,6 @@
 #include <linux/gpio.h>
 #include <linux/module.h>
 #include <linux/nfc.h>
-#include <linux/platform_data/nxp-nci.h>
 
 #include <net/nfc/nci_core.h>
 
diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index 5db71869f04b..47b3b7e612e6 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -23,7 +23,6 @@
 #include <linux/gpio/consumer.h>
 #include <linux/of_gpio.h>
 #include <linux/of_irq.h>
-#include <linux/platform_data/nxp-nci.h>
 #include <asm/unaligned.h>
 
 #include <net/nfc/nfc.h>
@@ -304,7 +303,6 @@ static int nxp_nci_i2c_probe(struct i2c_client *client,
 			    const struct i2c_device_id *id)
 {
 	struct nxp_nci_i2c_phy *phy;
-	struct nxp_nci_nfc_platform_data *pdata;
 	int r;
 
 	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
@@ -323,17 +321,12 @@ static int nxp_nci_i2c_probe(struct i2c_client *client,
 	phy->i2c_dev = client;
 	i2c_set_clientdata(client, phy);
 
-	pdata = client->dev.platform_data;
-
-	if (!pdata && client->dev.of_node) {
+	if (client->dev.of_node) {
 		r = nxp_nci_i2c_parse_devtree(client);
 		if (r < 0) {
 			nfc_err(&client->dev, "Failed to get DT data\n");
 			goto probe_exit;
 		}
-	} else if (pdata) {
-		phy->gpio_en = pdata->gpio_en;
-		phy->gpio_fw = pdata->gpio_fw;
 	} else if (ACPI_HANDLE(&client->dev)) {
 		r = nxp_nci_i2c_acpi_config(phy);
 		if (r < 0)
diff --git a/drivers/nfc/nxp-nci/nxp-nci.h b/drivers/nfc/nxp-nci/nxp-nci.h
index 6fe7c45544bf..ae3fb2735a4e 100644
--- a/drivers/nfc/nxp-nci/nxp-nci.h
+++ b/drivers/nfc/nxp-nci/nxp-nci.h
@@ -14,7 +14,6 @@
 #include <linux/completion.h>
 #include <linux/firmware.h>
 #include <linux/nfc.h>
-#include <linux/platform_data/nxp-nci.h>
 
 #include <net/nfc/nci_core.h>
 
diff --git a/include/linux/platform_data/nxp-nci.h b/include/linux/platform_data/nxp-nci.h
deleted file mode 100644
index 97827ad468e2..000000000000
--- a/include/linux/platform_data/nxp-nci.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Generic platform data for the NXP NCI NFC chips.
- *
- * Copyright (C) 2014  NXP Semiconductors  All rights reserved.
- *
- * Authors: Clément Perrochaud <clement.perrochaud@nxp.com>
- */
-
-#ifndef _NXP_NCI_H_
-#define _NXP_NCI_H_
-
-struct nxp_nci_nfc_platform_data {
-	unsigned int gpio_en;
-	unsigned int gpio_fw;
-	unsigned int irq;
-};
-
-#endif /* _NXP_NCI_H_ */
-- 
2.20.1


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

* [PATCH v4 04/14] NFC: nxp-nci: Convert to use GPIO descriptor
  2019-07-29 13:35 [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support Andy Shevchenko
                   ` (2 preceding siblings ...)
  2019-07-29 13:35 ` [PATCH v4 03/14] NFC: nxp-nci: Get rid of platform data Andy Shevchenko
@ 2019-07-29 13:35 ` Andy Shevchenko
  2019-07-29 13:35 ` [PATCH v4 05/14] NFC: nxp-nci: Add GPIO ACPI mapping table Andy Shevchenko
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Andy Shevchenko @ 2019-07-29 13:35 UTC (permalink / raw)
  To: Clément Perrochaud, Charles Gorand, netdev, David S. Miller,
	Sedat Dilek
  Cc: Andy Shevchenko, Sedat Dilek

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

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 drivers/nfc/nxp-nci/core.c |  1 -
 drivers/nfc/nxp-nci/i2c.c  | 60 ++++++++++----------------------------
 2 files changed, 15 insertions(+), 46 deletions(-)

diff --git a/drivers/nfc/nxp-nci/core.c b/drivers/nfc/nxp-nci/core.c
index aed18ca60170..a0ce95a287c5 100644
--- a/drivers/nfc/nxp-nci/core.c
+++ b/drivers/nfc/nxp-nci/core.c
@@ -11,7 +11,6 @@
  */
 
 #include <linux/delay.h>
-#include <linux/gpio.h>
 #include <linux/module.h>
 #include <linux/nfc.h>
 
diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index 47b3b7e612e6..713c267acf88 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -21,8 +21,6 @@
 #include <linux/module.h>
 #include <linux/nfc.h>
 #include <linux/gpio/consumer.h>
-#include <linux/of_gpio.h>
-#include <linux/of_irq.h>
 #include <asm/unaligned.h>
 
 #include <net/nfc/nfc.h>
@@ -37,8 +35,8 @@ struct nxp_nci_i2c_phy {
 	struct i2c_client *i2c_dev;
 	struct nci_dev *ndev;
 
-	unsigned int gpio_en;
-	unsigned int gpio_fw;
+	struct gpio_desc *gpiod_en;
+	struct gpio_desc *gpiod_fw;
 
 	int hard_fault; /*
 			 * < 0 if hardware error occurred (e.g. i2c err)
@@ -51,8 +49,8 @@ static int nxp_nci_i2c_set_mode(void *phy_id,
 {
 	struct nxp_nci_i2c_phy *phy = (struct nxp_nci_i2c_phy *) phy_id;
 
-	gpio_set_value(phy->gpio_fw, (mode == NXP_NCI_MODE_FW) ? 1 : 0);
-	gpio_set_value(phy->gpio_en, (mode != NXP_NCI_MODE_COLD) ? 1 : 0);
+	gpiod_set_value(phy->gpiod_fw, (mode == NXP_NCI_MODE_FW) ? 1 : 0);
+	gpiod_set_value(phy->gpiod_en, (mode != NXP_NCI_MODE_COLD) ? 1 : 0);
 	usleep_range(10000, 15000);
 
 	if (mode == NXP_NCI_MODE_COLD)
@@ -252,30 +250,18 @@ static irqreturn_t nxp_nci_i2c_irq_thread_fn(int irq, void *phy_id)
 static int nxp_nci_i2c_parse_devtree(struct i2c_client *client)
 {
 	struct nxp_nci_i2c_phy *phy = i2c_get_clientdata(client);
-	struct device_node *pp;
-	int r;
-
-	pp = client->dev.of_node;
-	if (!pp)
-		return -ENODEV;
 
-	r = of_get_named_gpio(pp, "enable-gpios", 0);
-	if (r == -EPROBE_DEFER)
-		r = of_get_named_gpio(pp, "enable-gpios", 0);
-	if (r < 0) {
-		nfc_err(&client->dev, "Failed to get EN gpio, error: %d\n", r);
-		return r;
+	phy->gpiod_en = devm_gpiod_get(&client->dev, "enable", GPIOD_OUT_LOW);
+	if (IS_ERR(phy->gpiod_en)) {
+		nfc_err(&client->dev, "Failed to get EN gpio\n");
+		return PTR_ERR(phy->gpiod_en);
 	}
-	phy->gpio_en = r;
 
-	r = of_get_named_gpio(pp, "firmware-gpios", 0);
-	if (r == -EPROBE_DEFER)
-		r = of_get_named_gpio(pp, "firmware-gpios", 0);
-	if (r < 0) {
-		nfc_err(&client->dev, "Failed to get FW gpio, error: %d\n", r);
-		return r;
+	phy->gpiod_fw = devm_gpiod_get(&client->dev, "firmware", GPIOD_OUT_LOW);
+	if (IS_ERR(phy->gpiod_fw)) {
+		nfc_err(&client->dev, "Failed to get FW gpio\n");
+		return PTR_ERR(phy->gpiod_fw);
 	}
-	phy->gpio_fw = r;
 
 	return 0;
 }
@@ -283,19 +269,15 @@ static int nxp_nci_i2c_parse_devtree(struct i2c_client *client)
 static int nxp_nci_i2c_acpi_config(struct nxp_nci_i2c_phy *phy)
 {
 	struct i2c_client *client = phy->i2c_dev;
-	struct gpio_desc *gpiod_en, *gpiod_fw;
 
-	gpiod_en = devm_gpiod_get_index(&client->dev, NULL, 2, GPIOD_OUT_LOW);
-	gpiod_fw = devm_gpiod_get_index(&client->dev, NULL, 1, GPIOD_OUT_LOW);
+	phy->gpiod_en = devm_gpiod_get_index(&client->dev, NULL, 2, GPIOD_OUT_LOW);
+	phy->gpiod_fw = devm_gpiod_get_index(&client->dev, NULL, 1, GPIOD_OUT_LOW);
 
-	if (IS_ERR(gpiod_en) || IS_ERR(gpiod_fw)) {
+	if (IS_ERR(phy->gpiod_en) || IS_ERR(phy->gpiod_fw)) {
 		nfc_err(&client->dev, "No GPIOs\n");
 		return -EINVAL;
 	}
 
-	phy->gpio_en = desc_to_gpio(gpiod_en);
-	phy->gpio_fw = desc_to_gpio(gpiod_fw);
-
 	return 0;
 }
 
@@ -331,24 +313,12 @@ static int nxp_nci_i2c_probe(struct i2c_client *client,
 		r = nxp_nci_i2c_acpi_config(phy);
 		if (r < 0)
 			goto probe_exit;
-		goto nci_probe;
 	} else {
 		nfc_err(&client->dev, "No platform data\n");
 		r = -EINVAL;
 		goto probe_exit;
 	}
 
-	r = devm_gpio_request_one(&phy->i2c_dev->dev, phy->gpio_en,
-				  GPIOF_OUT_INIT_LOW, "nxp_nci_en");
-	if (r < 0)
-		goto probe_exit;
-
-	r = devm_gpio_request_one(&phy->i2c_dev->dev, phy->gpio_fw,
-				  GPIOF_OUT_INIT_LOW, "nxp_nci_fw");
-	if (r < 0)
-		goto probe_exit;
-
-nci_probe:
 	r = nxp_nci_probe(phy, &client->dev, &i2c_phy_ops,
 			  NXP_NCI_I2C_MAX_PAYLOAD, &phy->ndev);
 	if (r < 0)
-- 
2.20.1


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

* [PATCH v4 05/14] NFC: nxp-nci: Add GPIO ACPI mapping table
  2019-07-29 13:35 [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support Andy Shevchenko
                   ` (3 preceding siblings ...)
  2019-07-29 13:35 ` [PATCH v4 04/14] NFC: nxp-nci: Convert to use GPIO descriptor Andy Shevchenko
@ 2019-07-29 13:35 ` Andy Shevchenko
  2019-07-29 13:35 ` [PATCH v4 06/14] NFC: nxp-nci: Get rid of code duplication in ->probe() Andy Shevchenko
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Andy Shevchenko @ 2019-07-29 13:35 UTC (permalink / raw)
  To: Clément Perrochaud, Charles Gorand, netdev, David S. Miller,
	Sedat Dilek
  Cc: Andy Shevchenko, Sedat Dilek

In order to unify GPIO resource request prepare gpiod_get_index()
to behave correctly when there is no mapping 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>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 drivers/nfc/nxp-nci/i2c.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index 713c267acf88..7344405feddf 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -247,6 +247,15 @@ static irqreturn_t nxp_nci_i2c_irq_thread_fn(int irq, void *phy_id)
 	return IRQ_NONE;
 }
 
+static const struct acpi_gpio_params firmware_gpios = { 1, 0, false };
+static const struct acpi_gpio_params enable_gpios = { 2, 0, false };
+
+static const struct acpi_gpio_mapping acpi_nxp_nci_gpios[] = {
+	{ "enable-gpios", &enable_gpios, 1 },
+	{ "firmware-gpios", &firmware_gpios, 1 },
+	{ }
+};
+
 static int nxp_nci_i2c_parse_devtree(struct i2c_client *client)
 {
 	struct nxp_nci_i2c_phy *phy = i2c_get_clientdata(client);
@@ -269,9 +278,14 @@ static int nxp_nci_i2c_parse_devtree(struct i2c_client *client)
 static int nxp_nci_i2c_acpi_config(struct nxp_nci_i2c_phy *phy)
 {
 	struct i2c_client *client = phy->i2c_dev;
+	int r;
 
-	phy->gpiod_en = devm_gpiod_get_index(&client->dev, NULL, 2, GPIOD_OUT_LOW);
-	phy->gpiod_fw = devm_gpiod_get_index(&client->dev, NULL, 1, GPIOD_OUT_LOW);
+	r = devm_acpi_dev_add_driver_gpios(&client->dev, acpi_nxp_nci_gpios);
+	if (r)
+		return r;
+
+	phy->gpiod_en = devm_gpiod_get(&client->dev, "enable", GPIOD_OUT_LOW);
+	phy->gpiod_fw = devm_gpiod_get(&client->dev, "firmware", GPIOD_OUT_LOW);
 
 	if (IS_ERR(phy->gpiod_en) || IS_ERR(phy->gpiod_fw)) {
 		nfc_err(&client->dev, "No GPIOs\n");
-- 
2.20.1


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

* [PATCH v4 06/14] NFC: nxp-nci: Get rid of code duplication in ->probe()
  2019-07-29 13:35 [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support Andy Shevchenko
                   ` (4 preceding siblings ...)
  2019-07-29 13:35 ` [PATCH v4 05/14] NFC: nxp-nci: Add GPIO ACPI mapping table Andy Shevchenko
@ 2019-07-29 13:35 ` Andy Shevchenko
  2019-07-29 13:35 ` [PATCH v4 07/14] NFC: nxp-nci: Get rid of useless label Andy Shevchenko
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Andy Shevchenko @ 2019-07-29 13:35 UTC (permalink / raw)
  To: Clément Perrochaud, Charles Gorand, netdev, David S. Miller,
	Sedat Dilek
  Cc: Andy Shevchenko, Sedat Dilek

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>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 drivers/nfc/nxp-nci/i2c.c | 68 +++++++++------------------------------
 1 file changed, 15 insertions(+), 53 deletions(-)

diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index 7344405feddf..6a627d1b6f85 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -256,48 +256,10 @@ static const struct acpi_gpio_mapping acpi_nxp_nci_gpios[] = {
 	{ }
 };
 
-static int nxp_nci_i2c_parse_devtree(struct i2c_client *client)
-{
-	struct nxp_nci_i2c_phy *phy = i2c_get_clientdata(client);
-
-	phy->gpiod_en = devm_gpiod_get(&client->dev, "enable", GPIOD_OUT_LOW);
-	if (IS_ERR(phy->gpiod_en)) {
-		nfc_err(&client->dev, "Failed to get EN gpio\n");
-		return PTR_ERR(phy->gpiod_en);
-	}
-
-	phy->gpiod_fw = devm_gpiod_get(&client->dev, "firmware", GPIOD_OUT_LOW);
-	if (IS_ERR(phy->gpiod_fw)) {
-		nfc_err(&client->dev, "Failed to get FW gpio\n");
-		return PTR_ERR(phy->gpiod_fw);
-	}
-
-	return 0;
-}
-
-static int nxp_nci_i2c_acpi_config(struct nxp_nci_i2c_phy *phy)
-{
-	struct i2c_client *client = phy->i2c_dev;
-	int r;
-
-	r = devm_acpi_dev_add_driver_gpios(&client->dev, acpi_nxp_nci_gpios);
-	if (r)
-		return r;
-
-	phy->gpiod_en = devm_gpiod_get(&client->dev, "enable", GPIOD_OUT_LOW);
-	phy->gpiod_fw = devm_gpiod_get(&client->dev, "firmware", GPIOD_OUT_LOW);
-
-	if (IS_ERR(phy->gpiod_en) || IS_ERR(phy->gpiod_fw)) {
-		nfc_err(&client->dev, "No GPIOs\n");
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
 static int nxp_nci_i2c_probe(struct i2c_client *client,
 			    const struct i2c_device_id *id)
 {
+	struct device *dev = &client->dev;
 	struct nxp_nci_i2c_phy *phy;
 	int r;
 
@@ -317,20 +279,20 @@ static int nxp_nci_i2c_probe(struct i2c_client *client,
 	phy->i2c_dev = client;
 	i2c_set_clientdata(client, phy);
 
-	if (client->dev.of_node) {
-		r = nxp_nci_i2c_parse_devtree(client);
-		if (r < 0) {
-			nfc_err(&client->dev, "Failed to get DT data\n");
-			goto probe_exit;
-		}
-	} else if (ACPI_HANDLE(&client->dev)) {
-		r = nxp_nci_i2c_acpi_config(phy);
-		if (r < 0)
-			goto probe_exit;
-	} else {
-		nfc_err(&client->dev, "No platform data\n");
-		r = -EINVAL;
-		goto probe_exit;
+	r = devm_acpi_dev_add_driver_gpios(dev, acpi_nxp_nci_gpios);
+	if (r)
+		return r;
+
+	phy->gpiod_en = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW);
+	if (IS_ERR(phy->gpiod_en)) {
+		nfc_err(dev, "Failed to get EN gpio\n");
+		return PTR_ERR(phy->gpiod_en);
+	}
+
+	phy->gpiod_fw = devm_gpiod_get(dev, "firmware", GPIOD_OUT_LOW);
+	if (IS_ERR(phy->gpiod_fw)) {
+		nfc_err(dev, "Failed to get FW gpio\n");
+		return PTR_ERR(phy->gpiod_fw);
 	}
 
 	r = nxp_nci_probe(phy, &client->dev, &i2c_phy_ops,
-- 
2.20.1


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

* [PATCH v4 07/14] NFC: nxp-nci: Get rid of useless label
  2019-07-29 13:35 [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support Andy Shevchenko
                   ` (5 preceding siblings ...)
  2019-07-29 13:35 ` [PATCH v4 06/14] NFC: nxp-nci: Get rid of code duplication in ->probe() Andy Shevchenko
@ 2019-07-29 13:35 ` Andy Shevchenko
  2019-07-29 13:35 ` [PATCH v4 08/14] NFC: nxp-nci: Constify acpi_device_id Andy Shevchenko
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Andy Shevchenko @ 2019-07-29 13:35 UTC (permalink / raw)
  To: Clément Perrochaud, Charles Gorand, netdev, David S. Miller,
	Sedat Dilek
  Cc: Andy Shevchenko, Sedat Dilek

Return directly in ->probe() since there no special cleaning is needed.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 drivers/nfc/nxp-nci/i2c.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index 6a627d1b6f85..bec9b1ea78e2 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -265,16 +265,13 @@ static int nxp_nci_i2c_probe(struct i2c_client *client,
 
 	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
 		nfc_err(&client->dev, "Need I2C_FUNC_I2C\n");
-		r = -ENODEV;
-		goto probe_exit;
+		return -ENODEV;
 	}
 
 	phy = devm_kzalloc(&client->dev, sizeof(struct nxp_nci_i2c_phy),
 			   GFP_KERNEL);
-	if (!phy) {
-		r = -ENOMEM;
-		goto probe_exit;
-	}
+	if (!phy)
+		return -ENOMEM;
 
 	phy->i2c_dev = client;
 	i2c_set_clientdata(client, phy);
@@ -298,7 +295,7 @@ static int nxp_nci_i2c_probe(struct i2c_client *client,
 	r = nxp_nci_probe(phy, &client->dev, &i2c_phy_ops,
 			  NXP_NCI_I2C_MAX_PAYLOAD, &phy->ndev);
 	if (r < 0)
-		goto probe_exit;
+		return r;
 
 	r = request_threaded_irq(client->irq, NULL,
 				 nxp_nci_i2c_irq_thread_fn,
@@ -307,7 +304,6 @@ static int nxp_nci_i2c_probe(struct i2c_client *client,
 	if (r < 0)
 		nfc_err(&client->dev, "Unable to register IRQ handler\n");
 
-probe_exit:
 	return r;
 }
 
-- 
2.20.1


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

* [PATCH v4 08/14] NFC: nxp-nci: Constify acpi_device_id
  2019-07-29 13:35 [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support Andy Shevchenko
                   ` (6 preceding siblings ...)
  2019-07-29 13:35 ` [PATCH v4 07/14] NFC: nxp-nci: Get rid of useless label Andy Shevchenko
@ 2019-07-29 13:35 ` Andy Shevchenko
  2019-07-29 13:35 ` [PATCH v4 09/14] NFC: nxp-nci: Drop of_match_ptr() use Andy Shevchenko
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Andy Shevchenko @ 2019-07-29 13:35 UTC (permalink / raw)
  To: Clément Perrochaud, Charles Gorand, netdev, David S. Miller,
	Sedat Dilek
  Cc: Andy Shevchenko, Sedat Dilek

The content of acpi_device_id is not supposed to change at runtime.
All functions working with acpi_device_id provided by <linux/acpi.h>
work with const acpi_device_id. So mark the non-const structs as const.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 drivers/nfc/nxp-nci/i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index bec9b1ea78e2..4e71962dc557 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -330,7 +330,7 @@ static const struct of_device_id of_nxp_nci_i2c_match[] = {
 MODULE_DEVICE_TABLE(of, of_nxp_nci_i2c_match);
 
 #ifdef CONFIG_ACPI
-static struct acpi_device_id acpi_id[] = {
+static const struct acpi_device_id acpi_id[] = {
 	{ "NXP1001" },
 	{ "NXP7471" },
 	{ },
-- 
2.20.1


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

* [PATCH v4 09/14] NFC: nxp-nci: Drop of_match_ptr() use
  2019-07-29 13:35 [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support Andy Shevchenko
                   ` (7 preceding siblings ...)
  2019-07-29 13:35 ` [PATCH v4 08/14] NFC: nxp-nci: Constify acpi_device_id Andy Shevchenko
@ 2019-07-29 13:35 ` Andy Shevchenko
  2019-07-29 13:35 ` [PATCH v4 10/14] NFC: nxp-nci: Drop comma in terminator lines Andy Shevchenko
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Andy Shevchenko @ 2019-07-29 13:35 UTC (permalink / raw)
  To: Clément Perrochaud, Charles Gorand, netdev, David S. Miller,
	Sedat Dilek
  Cc: Andy Shevchenko, Sedat Dilek

There is no need to guard OF device ID table with of_match_ptr().
Otherwise we would get a defined but not used data.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 drivers/nfc/nxp-nci/i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index 4e71962dc557..f2c8a560e265 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -342,7 +342,7 @@ static struct i2c_driver nxp_nci_i2c_driver = {
 	.driver = {
 		   .name = NXP_NCI_I2C_DRIVER_NAME,
 		   .acpi_match_table = ACPI_PTR(acpi_id),
-		   .of_match_table = of_match_ptr(of_nxp_nci_i2c_match),
+		   .of_match_table = of_nxp_nci_i2c_match,
 		  },
 	.probe = nxp_nci_i2c_probe,
 	.id_table = nxp_nci_i2c_id_table,
-- 
2.20.1


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

* [PATCH v4 10/14] NFC: nxp-nci: Drop comma in terminator lines
  2019-07-29 13:35 [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support Andy Shevchenko
                   ` (8 preceding siblings ...)
  2019-07-29 13:35 ` [PATCH v4 09/14] NFC: nxp-nci: Drop of_match_ptr() use Andy Shevchenko
@ 2019-07-29 13:35 ` Andy Shevchenko
  2019-07-29 13:35 ` [PATCH v4 11/14] NFC: nxp-nci: Remove unused macro pr_fmt() Andy Shevchenko
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Andy Shevchenko @ 2019-07-29 13:35 UTC (permalink / raw)
  To: Clément Perrochaud, Charles Gorand, netdev, David S. Miller,
	Sedat Dilek
  Cc: Andy Shevchenko, Sedat Dilek

There is no need to have a comma after terminator entry
in the arrays of IDs.

This may prevent the misguided addition behind the terminator
without compiler notice.

Drop the comma in terminator lines for good.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 drivers/nfc/nxp-nci/i2c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index f2c8a560e265..59b0a02a813d 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -325,7 +325,7 @@ MODULE_DEVICE_TABLE(i2c, nxp_nci_i2c_id_table);
 
 static const struct of_device_id of_nxp_nci_i2c_match[] = {
 	{ .compatible = "nxp,nxp-nci-i2c", },
-	{},
+	{}
 };
 MODULE_DEVICE_TABLE(of, of_nxp_nci_i2c_match);
 
@@ -333,7 +333,7 @@ MODULE_DEVICE_TABLE(of, of_nxp_nci_i2c_match);
 static const struct acpi_device_id acpi_id[] = {
 	{ "NXP1001" },
 	{ "NXP7471" },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, acpi_id);
 #endif
-- 
2.20.1


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

* [PATCH v4 11/14] NFC: nxp-nci: Remove unused macro pr_fmt()
  2019-07-29 13:35 [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support Andy Shevchenko
                   ` (9 preceding siblings ...)
  2019-07-29 13:35 ` [PATCH v4 10/14] NFC: nxp-nci: Drop comma in terminator lines Andy Shevchenko
@ 2019-07-29 13:35 ` Andy Shevchenko
  2019-07-29 13:35 ` [PATCH v4 12/14] NFC: nxp-nci: Remove 'default n' for the core Andy Shevchenko
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Andy Shevchenko @ 2019-07-29 13:35 UTC (permalink / raw)
  To: Clément Perrochaud, Charles Gorand, netdev, David S. Miller,
	Sedat Dilek
  Cc: Andy Shevchenko, Sedat Dilek

The macro had never been used.

The driver uses mostly the nfc_err(), which, with other macros in the family,
is backed by corresponding dev_err(). pr_fmt() is not used for dev_err()
macro. Moreover, there is no need to print the module name which is part of the
device instance name anyway.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 drivers/nfc/nxp-nci/i2c.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index 59b0a02a813d..307bd2afbe05 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -12,8 +12,6 @@
  * Copyright (C) 2012  Intel Corporation. All rights reserved.
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/acpi.h>
 #include <linux/delay.h>
 #include <linux/i2c.h>
-- 
2.20.1


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

* [PATCH v4 12/14] NFC: nxp-nci: Remove 'default n' for the core
  2019-07-29 13:35 [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support Andy Shevchenko
                   ` (10 preceding siblings ...)
  2019-07-29 13:35 ` [PATCH v4 11/14] NFC: nxp-nci: Remove unused macro pr_fmt() Andy Shevchenko
@ 2019-07-29 13:35 ` Andy Shevchenko
  2019-07-29 13:35 ` [PATCH v4 13/14] NFC: nxp-nci: Clarify on supported chips Andy Shevchenko
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Andy Shevchenko @ 2019-07-29 13:35 UTC (permalink / raw)
  To: Clément Perrochaud, Charles Gorand, netdev, David S. Miller,
	Sedat Dilek
  Cc: Andy Shevchenko, Sedat Dilek

It seems contributors follow the style of Kconfig entries where explicit
'default n' is present.  The default 'default' is 'n' already, thus, drop
these lines from Kconfig to make it more clear.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 drivers/nfc/nxp-nci/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/nfc/nxp-nci/Kconfig b/drivers/nfc/nxp-nci/Kconfig
index 12df2c8cc51d..ed6cbdf0f0b4 100644
--- a/drivers/nfc/nxp-nci/Kconfig
+++ b/drivers/nfc/nxp-nci/Kconfig
@@ -2,7 +2,6 @@
 config NFC_NXP_NCI
 	tristate "NXP-NCI NFC driver"
 	depends on NFC_NCI
-	default n
 	---help---
 	  Generic core driver for NXP NCI chips such as the NPC100
 	  or PN7150 families.
-- 
2.20.1


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

* [PATCH v4 13/14] NFC: nxp-nci: Clarify on supported chips
  2019-07-29 13:35 [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support Andy Shevchenko
                   ` (11 preceding siblings ...)
  2019-07-29 13:35 ` [PATCH v4 12/14] NFC: nxp-nci: Remove 'default n' for the core Andy Shevchenko
@ 2019-07-29 13:35 ` Andy Shevchenko
  2019-07-29 13:35 ` [PATCH v4 14/14] NFC: nxp-nci: Fix recommendation for NFC_NXP_NCI_I2C Kconfig Andy Shevchenko
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Andy Shevchenko @ 2019-07-29 13:35 UTC (permalink / raw)
  To: Clément Perrochaud, Charles Gorand, netdev, David S. Miller,
	Sedat Dilek
  Cc: Andy Shevchenko, Oleg Zhurakivskyy

From: Sedat Dilek <sedat.dilek@credativ.de>

This patch clarifies on the supported NXP NCI chips and families
and lists PN547 and PN548 separately which are known as NPC100
respectively NPC300.

This helps to find informations and identify drivers on vendor's
support websites.

For details see the discussion in [1] and [2].

[1] https://marc.info/?t=155774435600001&r=1&w=2
[2] https://patchwork.kernel.org/project/linux-wireless/list/?submitter=33142

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Suggested-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Signed-off-by: Sedat Dilek <sedat.dilek@credativ.de>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
---
 drivers/nfc/nxp-nci/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nfc/nxp-nci/Kconfig b/drivers/nfc/nxp-nci/Kconfig
index ed6cbdf0f0b4..746b91aa74f0 100644
--- a/drivers/nfc/nxp-nci/Kconfig
+++ b/drivers/nfc/nxp-nci/Kconfig
@@ -3,8 +3,8 @@ config NFC_NXP_NCI
 	tristate "NXP-NCI NFC driver"
 	depends on NFC_NCI
 	---help---
-	  Generic core driver for NXP NCI chips such as the NPC100
-	  or PN7150 families.
+	  Generic core driver for NXP NCI chips such as the NPC100 (PN547),
+	  NPC300 (PN548) or PN7150 families.
 	  This is a driver based on the NCI NFC kernel layers and
 	  will thus not work with NXP libnfc library.
 
-- 
2.20.1


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

* [PATCH v4 14/14] NFC: nxp-nci: Fix recommendation for NFC_NXP_NCI_I2C Kconfig
  2019-07-29 13:35 [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support Andy Shevchenko
                   ` (12 preceding siblings ...)
  2019-07-29 13:35 ` [PATCH v4 13/14] NFC: nxp-nci: Clarify on supported chips Andy Shevchenko
@ 2019-07-29 13:35 ` Andy Shevchenko
  2019-07-29 15:56 ` [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support David Miller
  2019-08-20 21:27 ` Sedat Dilek
  15 siblings, 0 replies; 18+ messages in thread
From: Andy Shevchenko @ 2019-07-29 13:35 UTC (permalink / raw)
  To: Clément Perrochaud, Charles Gorand, netdev, David S. Miller,
	Sedat Dilek
  Cc: Andy Shevchenko, Oleg Zhurakivskyy

From: Sedat Dilek <sedat.dilek@credativ.de>

This is a simple cleanup to the Kconfig help text as discussed in [1].

[1] https://marc.info/?t=155774435600001&r=1&w=2

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Suggested-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Signed-off-by: Sedat Dilek <sedat.dilek@credativ.de>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/nfc/nxp-nci/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/nxp-nci/Kconfig b/drivers/nfc/nxp-nci/Kconfig
index 746b91aa74f0..e1f71deab6fc 100644
--- a/drivers/nfc/nxp-nci/Kconfig
+++ b/drivers/nfc/nxp-nci/Kconfig
@@ -22,4 +22,4 @@ config NFC_NXP_NCI_I2C
 
 	  To compile this driver as a module, choose m here. The module will
 	  be called nxp_nci_i2c.
-	  Say Y if unsure.
+	  Say N if unsure.
-- 
2.20.1


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

* Re: [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support
  2019-07-29 13:35 [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support Andy Shevchenko
                   ` (13 preceding siblings ...)
  2019-07-29 13:35 ` [PATCH v4 14/14] NFC: nxp-nci: Fix recommendation for NFC_NXP_NCI_I2C Kconfig Andy Shevchenko
@ 2019-07-29 15:56 ` David Miller
  2019-08-20 21:27 ` Sedat Dilek
  15 siblings, 0 replies; 18+ messages in thread
From: David Miller @ 2019-07-29 15:56 UTC (permalink / raw)
  To: andriy.shevchenko; +Cc: clement.perrochaud, charles.gorand, netdev, sedat.dilek

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Mon, 29 Jul 2019 16:35:00 +0300

> Few people reported that some laptops are coming with new ACPI ID for the
> devices should be supported by nxp-nci driver.
> 
> This series adds new ID (patch 2), cleans up the driver from legacy platform
> data and unifies GPIO request for Device Tree and ACPI (patches 3-6), removes
> dead or unneeded code (patches 7, 9, 11), constifies ID table (patch 8),
> removes comma in terminator line for better maintenance (patch 10) and
> rectifies Kconfig entry (patches 12-14).
> 
> It also contains a fix for NFC subsystem as suggested by Sedat.
> 
> Series has been tested by Sedat.
 ...

Series applied to net-next, thanks.

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

* Re: [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support
  2019-07-29 13:35 [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support Andy Shevchenko
                   ` (14 preceding siblings ...)
  2019-07-29 15:56 ` [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support David Miller
@ 2019-08-20 21:27 ` Sedat Dilek
  2019-08-23 17:20   ` Andy Shevchenko
  15 siblings, 1 reply; 18+ messages in thread
From: Sedat Dilek @ 2019-08-20 21:27 UTC (permalink / raw)
  To: Andy Shevchenko, Clément Perrochaud, Charles Gorand, netdev,
	David S. Miller
  Cc: Sedat Dilek



> Andy Shevchenko <andriy.shevchenko@linux.intel.com> hat am 29. Juli 2019 15:35 geschrieben:
> 
>  
> Few people reported that some laptops are coming with new ACPI ID for the
> devices should be supported by nxp-nci driver.
> 
> This series adds new ID (patch 2), cleans up the driver from legacy platform
> data and unifies GPIO request for Device Tree and ACPI (patches 3-6), removes
> dead or unneeded code (patches 7, 9, 11), constifies ID table (patch 8),
> removes comma in terminator line for better maintenance (patch 10) and
> rectifies Kconfig entry (patches 12-14).
> 
> It also contains a fix for NFC subsystem as suggested by Sedat.
> 
> Series has been tested by Sedat.
> 
> Changelog v4:
> - rebased on top of latest linux-next
> - appended cover letter
> - elaborated removal of pr_fmt() in the patch 11 (David)
> 
> Andrey Konovalov (1):
>   NFC: fix attrs checks in netlink interface
> 
> Andy Shevchenko (11):
>   NFC: nxp-nci: Add NXP1001 to the ACPI ID table
>   NFC: nxp-nci: Get rid of platform data
>   NFC: nxp-nci: Convert to use GPIO descriptor
>   NFC: nxp-nci: Add GPIO ACPI mapping table
>   NFC: nxp-nci: Get rid of code duplication in ->probe()
>   NFC: nxp-nci: Get rid of useless label
>   NFC: nxp-nci: Constify acpi_device_id
>   NFC: nxp-nci: Drop of_match_ptr() use
>   NFC: nxp-nci: Drop comma in terminator lines
>   NFC: nxp-nci: Remove unused macro pr_fmt()
>   NFC: nxp-nci: Remove 'default n' for the core
> 
> Sedat Dilek (2):
>   NFC: nxp-nci: Clarify on supported chips
>   NFC: nxp-nci: Fix recommendation for NFC_NXP_NCI_I2C Kconfig
> 
>  MAINTAINERS                           |   1 -
>  drivers/nfc/nxp-nci/Kconfig           |   7 +-
>  drivers/nfc/nxp-nci/core.c            |   2 -
>  drivers/nfc/nxp-nci/i2c.c             | 134 +++++++-------------------
>  drivers/nfc/nxp-nci/nxp-nci.h         |   1 -
>  include/linux/platform_data/nxp-nci.h |  19 ----
>  net/nfc/netlink.c                     |   6 +-
>  7 files changed, 41 insertions(+), 129 deletions(-)
>  delete mode 100644 include/linux/platform_data/nxp-nci.h
> 
> -- 
> 2.20.1

Hi Andy,

I gave that patchset v4 a try against Linux v5.3-rc5.

And played with neard and neard-tools v0.16-0.1 from Debian/buster AMD64.

# nfctool --list

# nfctool --enable --device=nfc0

# nfctool --list --device=nfc0
nfc0:
          Tags: [ tag11 ]
          Devices: [ ]
          Protocols: [ Felica MIFARE Jewel ISO-DEP NFC-DEP ]
          Powered: Yes
          RF Mode: Initiator
          lto: 0
          rw: 0
          miux: 0

# nfctool --device=nfc0 --poll=Both --sniff --dump-symm
Start sniffer on nfc0

Start polling on nfc0 as both initiator and target

Targets found for nfc0
  Tags: [ tag11 ]
  Devices: [ ]

But I see in the logs:

# journalctl -u neard.service -f
Aug 20 23:01:15 iniza neard[6158]: Error while reading NFC bytes

What does this error mean?
How can I get more informations?
Can you aid with debugging help?

Thanks in advance.

Regards,
- Sedat -

[1] https://github.com/nfc-tools/libnfc/issues/455#issuecomment-523185147
[2] https://github.com/nfc-tools/libnfc/issues/455#issuecomment-523195283
[3] https://github.com/nfc-tools/libnfc/issues/455#issuecomment-523198304

-- 
Mit freundlichen Grüssen 
Sedat Dilek
Telefon: +49 2166 9901-153 
E-Mail: sedat.dilek@credativ.de
Internet: https://www.credativ.de/

GPG-Fingerprint: EA6D E17D D269 AC7E 101D C910 476F 2B3B 0AF7 F86B

credativ GmbH, Trompeterallee 108, 41189 Mönchengladbach 
Handelsregister: Amtsgericht Mönchengladbach HRB 12080 USt-ID-Nummer DE204566209 
Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer

Unser Umgang mit personenbezogenen Daten unterliegt folgenden Bestimmungen: 
https://www.credativ.de/datenschutz/

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

* Re: [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support
  2019-08-20 21:27 ` Sedat Dilek
@ 2019-08-23 17:20   ` Andy Shevchenko
  0 siblings, 0 replies; 18+ messages in thread
From: Andy Shevchenko @ 2019-08-23 17:20 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Clément Perrochaud, Charles Gorand, netdev, David S. Miller,
	Sedat Dilek

On Tue, Aug 20, 2019 at 11:27:59PM +0200, Sedat Dilek wrote:
> > Andy Shevchenko <andriy.shevchenko@linux.intel.com> hat am 29. Juli 2019 15:35 geschrieben:

> I gave that patchset v4 a try against Linux v5.3-rc5.
> 
> And played with neard and neard-tools v0.16-0.1 from Debian/buster AMD64.
> 
> # nfctool --list
> 
> # nfctool --enable --device=nfc0
> 
> # nfctool --list --device=nfc0
> nfc0:
>           Tags: [ tag11 ]
>           Devices: [ ]
>           Protocols: [ Felica MIFARE Jewel ISO-DEP NFC-DEP ]
>           Powered: Yes
>           RF Mode: Initiator
>           lto: 0
>           rw: 0
>           miux: 0
> 
> # nfctool --device=nfc0 --poll=Both --sniff --dump-symm
> Start sniffer on nfc0
> 
> Start polling on nfc0 as both initiator and target
> 
> Targets found for nfc0
>   Tags: [ tag11 ]
>   Devices: [ ]
> 
> But I see in the logs:
> 
> # journalctl -u neard.service -f
> Aug 20 23:01:15 iniza neard[6158]: Error while reading NFC bytes
> 
> What does this error mean?
> How can I get more informations?
> Can you aid with debugging help?

Unfortunately I have no idea about user space tools.
But I think neard has to be updated to match kernel somehow.

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2019-08-23 17:20 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29 13:35 [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support Andy Shevchenko
2019-07-29 13:35 ` [PATCH v4 01/14] NFC: fix attrs checks in netlink interface Andy Shevchenko
2019-07-29 13:35 ` [PATCH v4 02/14] NFC: nxp-nci: Add NXP1001 to the ACPI ID table Andy Shevchenko
2019-07-29 13:35 ` [PATCH v4 03/14] NFC: nxp-nci: Get rid of platform data Andy Shevchenko
2019-07-29 13:35 ` [PATCH v4 04/14] NFC: nxp-nci: Convert to use GPIO descriptor Andy Shevchenko
2019-07-29 13:35 ` [PATCH v4 05/14] NFC: nxp-nci: Add GPIO ACPI mapping table Andy Shevchenko
2019-07-29 13:35 ` [PATCH v4 06/14] NFC: nxp-nci: Get rid of code duplication in ->probe() Andy Shevchenko
2019-07-29 13:35 ` [PATCH v4 07/14] NFC: nxp-nci: Get rid of useless label Andy Shevchenko
2019-07-29 13:35 ` [PATCH v4 08/14] NFC: nxp-nci: Constify acpi_device_id Andy Shevchenko
2019-07-29 13:35 ` [PATCH v4 09/14] NFC: nxp-nci: Drop of_match_ptr() use Andy Shevchenko
2019-07-29 13:35 ` [PATCH v4 10/14] NFC: nxp-nci: Drop comma in terminator lines Andy Shevchenko
2019-07-29 13:35 ` [PATCH v4 11/14] NFC: nxp-nci: Remove unused macro pr_fmt() Andy Shevchenko
2019-07-29 13:35 ` [PATCH v4 12/14] NFC: nxp-nci: Remove 'default n' for the core Andy Shevchenko
2019-07-29 13:35 ` [PATCH v4 13/14] NFC: nxp-nci: Clarify on supported chips Andy Shevchenko
2019-07-29 13:35 ` [PATCH v4 14/14] NFC: nxp-nci: Fix recommendation for NFC_NXP_NCI_I2C Kconfig Andy Shevchenko
2019-07-29 15:56 ` [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support David Miller
2019-08-20 21:27 ` Sedat Dilek
2019-08-23 17:20   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).