Updated corresponding to - NFC_AR_00_1E800_13.09.00_OpnSrc

This commit is contained in:
nxf24591
2022-07-29 19:28:34 +05:30
parent 71fa3f1d6b
commit 7dd0b7d546
4 changed files with 11 additions and 10 deletions

View File

@@ -4,3 +4,5 @@ nfc_i2c-y := common.o \
common_ese.o \
i2c_drv.o
ccflags-y += -DDYNAMIC_DEBUG_MODULE

View File

@@ -1,6 +1,6 @@
/******************************************************************************
* Copyright (C) 2015, The Linux Foundation. All rights reserved.
* Copyright (C) 2019-2021 NXP
* Copyright (C) 2019-2022 NXP
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -44,14 +44,14 @@ int nfc_parse_dt(struct device *dev, struct platform_configs *nfc_configs,
if ((!gpio_is_valid(nfc_gpio->irq))) {
pr_err("%s: irq gpio invalid %d\n", __func__,
nfc_gpio->irq);
return -EINVAL;
return nfc_gpio->irq;
}
pr_info("%s: irq %d\n", __func__, nfc_gpio->irq);
}
nfc_gpio->ven = of_get_named_gpio(np, DTS_VEN_GPIO_STR, 0);
if ((!gpio_is_valid(nfc_gpio->ven))) {
pr_err("%s: ven gpio invalid %d\n", __func__, nfc_gpio->ven);
return -EINVAL;
return nfc_gpio->ven;
}
/* some products like sn220 does not required fw dwl pin */
nfc_gpio->dwl_req = of_get_named_gpio(np, DTS_FWDN_GPIO_STR, 0);
@@ -410,10 +410,6 @@ int nfc_dev_close(struct inode *inode, struct file *filp)
if (nfc_dev->dev_ref_count == 1) {
nfc_dev->nfc_disable_intr(nfc_dev);
set_valid_gpio(nfc_dev->configs.gpio.dwl_req, 0);
}
if (nfc_dev->dev_ref_count > 0)
nfc_dev->dev_ref_count = nfc_dev->dev_ref_count - 1;
else {
/*
* Use "ESE_RST_PROT_DIS" as argument
* if eSE calls flow is via NFC driver
@@ -421,6 +417,9 @@ int nfc_dev_close(struct inode *inode, struct file *filp)
*/
nfc_ese_pwr(nfc_dev, ESE_RST_PROT_DIS_NFC);
}
if (nfc_dev->dev_ref_count > 0)
nfc_dev->dev_ref_count = nfc_dev->dev_ref_count - 1;
filp->private_data = NULL;
mutex_unlock(&nfc_dev->dev_ref_mutex);

View File

@@ -27,7 +27,7 @@
/* Max device count for this driver */
#define DEV_COUNT 1
/* i2c device class */
#define CLASS_NAME "nfc"
#define CLASS_NAME "nxpnfc"
/* NFC character device name, this will be in /dev/ */
#define NFC_CHAR_DEV_NAME "nxp-nci"

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* Copyright (C) 2020-2021 NXP
* Copyright (C) 2020-2022 NXP
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -135,6 +135,7 @@ static int validate_cold_reset_protection_request(struct cold_reset *cold_reset,
IS_SRC(arg, cold_reset->rst_prot_src)) {
pr_debug("%s: enable reset protection from same src\n",
__func__);
ret = -EINVAL;
} else {
pr_err("%s: operation not permitted\n", __func__);
ret = -EPERM;
@@ -161,7 +162,6 @@ static int perform_cold_reset_protection(struct nfc_dev *nfc_dev,
/* check if NFCC not in the FW download or hard reset state */
ret = validate_cold_reset_protection_request(cold_reset, arg);
if (ret < 0) {
pr_err("%s: invalid cmd\n", __func__);
goto err;
}