Skip to contentSkip to conversation

NFC: nxp-nci: clean up and new device support

PATCH In review Andy Shevchenko 3 participants 18 messages Jul 29, 2019 – Aug 23, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v4 cover NFC: nxp-nci: clean up and new device support

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
Signature · 1 line
2.20.1
#1 lore raw

PATCH v4 1/14 NFC: fix attrs checks in netlink interface

From: Andrey Konovalov <[email protected]>

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.

---
 net/nfc/netlink.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
net/nfc/netlink.c +4 -2
index 4a30309bb67f..60fd2748d0ea 100644
@@ -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]);
Signature · 1 line
2.20.1
#2 lore raw

PATCH v4 2/14 NFC: nxp-nci: Add NXP1001 to the ACPI ID table

In reply to Andy Shevchenko

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.

---
 drivers/nfc/nxp-nci/i2c.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nfc/nxp-nci/i2c.c +1 -0
index 4aeb3861b409..5db71869f04b 100644
@@ -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" },
 	{ },
 };
Signature · 1 line
2.20.1
#3 lore raw

PATCH v4 3/14 NFC: nxp-nci: Get rid of platform data

In reply to 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.

---
 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
MAINTAINERS +0 -1
index 99f64e395623..f204f7a65428 100644
@@ -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
drivers/nfc/nxp-nci/core.c +0 -1
index 8dafc696719f..aed18ca60170 100644
@@ -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>
 
drivers/nfc/nxp-nci/i2c.c +1 -8
index 5db71869f04b..47b3b7e612e6 100644
@@ -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)
drivers/nfc/nxp-nci/nxp-nci.h +0 -1
index 6fe7c45544bf..ae3fb2735a4e 100644
@@ -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>
 
include/linux/platform_data/nxp-nci.h deleted +0 -19
deleted file mode 100644
index 97827ad468e2..000000000000
@@ -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 <[email protected]>
- */
-
-#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_ */
Signature · 1 line
2.20.1
#4 lore raw

PATCH v4 4/14 NFC: nxp-nci: Convert to use GPIO descriptor

In reply to Andy Shevchenko

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

---
 drivers/nfc/nxp-nci/core.c |  1 -
 drivers/nfc/nxp-nci/i2c.c  | 60 ++++++++++----------------------------
 2 files changed, 15 insertions(+), 46 deletions(-)
drivers/nfc/nxp-nci/core.c +0 -1
index aed18ca60170..a0ce95a287c5 100644
@@ -11,7 +11,6 @@
  */
 
 #include <linux/delay.h>
-#include <linux/gpio.h>
 #include <linux/module.h>
 #include <linux/nfc.h>
 
drivers/nfc/nxp-nci/i2c.c +15 -45

112 lines not on this page · raw message

Signature · 1 line
2.20.1
#5 lore raw

PATCH v4 5/14 NFC: nxp-nci: Add GPIO ACPI mapping table

In reply to Andy Shevchenko

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.

---
 drivers/nfc/nxp-nci/i2c.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
drivers/nfc/nxp-nci/i2c.c +16 -2
index 713c267acf88..7344405feddf 100644
@@ -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");
Signature · 1 line
2.20.1
#6 lore raw

PATCH v4 6/14 NFC: nxp-nci: Get rid of code duplication in ->probe()

In reply to Andy Shevchenko

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

---
 drivers/nfc/nxp-nci/i2c.c | 68 +++++++++------------------------------
 1 file changed, 15 insertions(+), 53 deletions(-)
drivers/nfc/nxp-nci/i2c.c +15 -53
index 7344405feddf..6a627d1b6f85 100644
@@ -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,
Signature · 1 line
2.20.1
#7 lore raw

PATCH v4 7/14 NFC: nxp-nci: Get rid of useless label

In reply to Andy Shevchenko

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

---
 drivers/nfc/nxp-nci/i2c.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/nfc/nxp-nci/i2c.c +4 -8
index 6a627d1b6f85..bec9b1ea78e2 100644
@@ -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;
 }
 
Signature · 1 line
2.20.1
#8 lore raw

PATCH v4 8/14 NFC: nxp-nci: Constify acpi_device_id

In reply to Andy Shevchenko

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.

---
 drivers/nfc/nxp-nci/i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nfc/nxp-nci/i2c.c +1 -1
index bec9b1ea78e2..4e71962dc557 100644
@@ -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" },
 	{ },
Signature · 1 line
2.20.1
#9 lore raw

PATCH v4 9/14 NFC: nxp-nci: Drop of_match_ptr() use

In reply to Andy Shevchenko

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

---
 drivers/nfc/nxp-nci/i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nfc/nxp-nci/i2c.c +1 -1
index 4e71962dc557..f2c8a560e265 100644
@@ -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,
Signature · 1 line
2.20.1
#10 lore raw

PATCH v4 10/14 NFC: nxp-nci: Drop comma in terminator lines

In reply to Andy Shevchenko

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.

---
 drivers/nfc/nxp-nci/i2c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nfc/nxp-nci/i2c.c +2 -2
index f2c8a560e265..59b0a02a813d 100644
@@ -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
Signature · 1 line
2.20.1
#11 lore raw

PATCH v4 11/14 NFC: nxp-nci: Remove unused macro pr_fmt()

In reply to Andy Shevchenko

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.

---
 drivers/nfc/nxp-nci/i2c.c | 2 --
 1 file changed, 2 deletions(-)
drivers/nfc/nxp-nci/i2c.c +0 -2
index 59b0a02a813d..307bd2afbe05 100644
@@ -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>
Signature · 1 line
2.20.1
#12 lore raw

PATCH v4 12/14 NFC: nxp-nci: Remove 'default n' for the core

In reply to Andy Shevchenko

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.

---
 drivers/nfc/nxp-nci/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/nfc/nxp-nci/Kconfig +0 -1
index 12df2c8cc51d..ed6cbdf0f0b4 100644
@@ -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.
Signature · 1 line
2.20.1
#13 lore raw

PATCH v4 13/14 NFC: nxp-nci: Clarify on supported chips

In reply to Andy Shevchenko

From: Sedat Dilek <[email protected]>

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

---
 drivers/nfc/nxp-nci/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nfc/nxp-nci/Kconfig +2 -2
index ed6cbdf0f0b4..746b91aa74f0 100644
@@ -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.
 
Signature · 1 line
2.20.1
#14 lore raw

PATCH v4 14/14 NFC: nxp-nci: Fix recommendation for NFC_NXP_NCI_I2C Kconfig

In reply to Andy Shevchenko

From: Sedat Dilek <[email protected]>

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

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

---
 drivers/nfc/nxp-nci/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nfc/nxp-nci/Kconfig +1 -1
index 746b91aa74f0..e1f71deab6fc 100644
@@ -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.
Signature · 1 line
2.20.1
maintainer
#15 lore raw
In reply to Andy Shevchenko

From: Andy Shevchenko <[email protected]>
Date: Mon, 29 Jul 2019 16:35:00 +0300

Quoted 9 lines

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).

Quoted 3 lines

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

Series has been tested by Sedat.

...

Series applied to net-next, thanks.

#16 lore raw
In reply to Andy Shevchenko
Quoted 43 lines

Andy Shevchenko <[email protected]> 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

Quoted 12 lines
 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
Signature · 1 line
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

Signature · 14 lines
Mit freundlichen Grüssen 
Sedat Dilek
Telefon: +49 2166 9901-153 
E-Mail: [email protected]
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/
#17 lore raw
Quoted 30 lines · Sedat Dilek
Quoted 1 line

Andy Shevchenko <[email protected]> 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: [ ]

Quoted 8 lines

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.

Signature · 2 lines
With Best Regards,
Andy Shevchenko