Updated corresponding to - NFC_AR_00_E800_13.02.01_OpnSrc

This commit is contained in:
nxf24591
2022-02-01 17:31:42 +05:30
parent 55d2657f94
commit edbd2aaad6
4 changed files with 20 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
obj-$(CONFIG_NXP_NFC_I2C) := pn553_i2c.o obj-$(CONFIG_NXP_NFC_I2C) := nfc_i2c.o
pn553_i2c-y := common.o \ nfc_i2c-y := common.o \
common_ese.o \ common_ese.o \
i2c_drv.o i2c_drv.o

View File

@@ -30,7 +30,7 @@
#define CLASS_NAME "nfc" #define CLASS_NAME "nfc"
/* NFC character device name, this will be in /dev/ */ /* NFC character device name, this will be in /dev/ */
#define NFC_CHAR_DEV_NAME "pn553" #define NFC_CHAR_DEV_NAME "nxp-nci"
/* NCI packet details */ /* NCI packet details */
#define NCI_CMD (0x20) #define NCI_CMD (0x20)
@@ -78,9 +78,9 @@
#define ESE_SET_PWR _IOW(NFC_MAGIC, 0x02, uint32_t) #define ESE_SET_PWR _IOW(NFC_MAGIC, 0x02, uint32_t)
#define ESE_GET_PWR _IOR(NFC_MAGIC, 0x03, uint32_t) #define ESE_GET_PWR _IOR(NFC_MAGIC, 0x03, uint32_t)
#define DTS_IRQ_GPIO_STR "nxp,pn544-irq" #define DTS_IRQ_GPIO_STR "nxp,sn-irq"
#define DTS_VEN_GPIO_STR "nxp,pn544-ven" #define DTS_VEN_GPIO_STR "nxp,sn-ven-rstn"
#define DTS_FWDN_GPIO_STR "nxp,pn544-fw-dwnld" #define DTS_FWDN_GPIO_STR "nxp,sn-dwl-req"
enum nfcc_ioctl_request { enum nfcc_ioctl_request {
/* NFC disable request with VEN LOW */ /* NFC disable request with VEN LOW */

View File

@@ -323,27 +323,27 @@ int nfc_i2c_dev_probe(struct i2c_client *client, const struct i2c_device_id *id)
int ret = 0; int ret = 0;
struct nfc_dev *nfc_dev = NULL; struct nfc_dev *nfc_dev = NULL;
struct i2c_dev *i2c_dev = NULL; struct i2c_dev *i2c_dev = NULL;
struct platform_configs nfc_configs; struct platform_configs *nfc_configs = NULL;
struct platform_gpio *nfc_gpio = &nfc_configs.gpio; struct platform_gpio *nfc_gpio = NULL;
pr_debug("%s: enter\n", __func__); pr_debug("%s: enter\n", __func__);
nfc_dev = kzalloc(sizeof(struct nfc_dev), GFP_KERNEL);
if (nfc_dev == NULL) {
ret = -ENOMEM;
goto err;
}
nfc_configs = &nfc_dev->configs;
nfc_gpio = &nfc_configs->gpio;
/* retrieve details of gpios from dt */ /* retrieve details of gpios from dt */
ret = nfc_parse_dt(&client->dev, &nfc_configs, PLATFORM_IF_I2C); ret = nfc_parse_dt(&client->dev,nfc_configs, PLATFORM_IF_I2C);
if (ret) { if (ret) {
pr_err("%s: failed to parse dt\n", __func__); pr_err("%s: failed to parse dt\n", __func__);
goto err; goto err;
} }
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
pr_err("%s: need I2C_FUNC_I2C\n", __func__); pr_err("%s: need I2C_FUNC_I2C\n", __func__);
ret = -ENODEV; ret = -ENODEV;
goto err; goto err;
} }
nfc_dev = kzalloc(sizeof(struct nfc_dev), GFP_KERNEL);
if (nfc_dev == NULL) {
ret = -ENOMEM;
goto err;
}
nfc_dev->read_kbuf = kzalloc(MAX_NCI_BUFFER_SIZE, GFP_DMA | GFP_KERNEL); nfc_dev->read_kbuf = kzalloc(MAX_NCI_BUFFER_SIZE, GFP_DMA | GFP_KERNEL);
if (!nfc_dev->read_kbuf) { if (!nfc_dev->read_kbuf) {
ret = -ENOMEM; ret = -ENOMEM;
@@ -380,11 +380,6 @@ int nfc_i2c_dev_probe(struct i2c_client *client, const struct i2c_device_id *id)
pr_err("%s: unable to request nfc firm downl gpio [%d]\n", pr_err("%s: unable to request nfc firm downl gpio [%d]\n",
__func__, nfc_gpio->dwl_req); __func__, nfc_gpio->dwl_req);
} }
/* copy the retrieved gpio details from DT */
memcpy(&nfc_dev->configs, &nfc_configs,
sizeof(struct platform_configs));
/* init mutex and queues */ /* init mutex and queues */
init_waitqueue_head(&nfc_dev->read_wq); init_waitqueue_head(&nfc_dev->read_wq);
mutex_init(&nfc_dev->read_mutex); mutex_init(&nfc_dev->read_mutex);

View File

@@ -23,8 +23,8 @@
#include <linux/i2c.h> #include <linux/i2c.h>
/* kept same as dts */ /* kept same as dts */
#define NFC_I2C_DRV_STR "nxp,pn544" #define NFC_I2C_DRV_STR "nxp,sn-nci"
#define NFC_I2C_DEV_ID "pn553" #define NFC_I2C_DEV_ID "sn-i2c"
/* Interface specific parameters */ /* Interface specific parameters */
struct i2c_dev { struct i2c_dev {