diff --git a/nfc/common.c b/nfc/common.c index 9154fbdfb7..49485d6f87 100644 --- a/nfc/common.c +++ b/nfc/common.c @@ -649,6 +649,19 @@ long nfc_dev_ioctl(struct file *pfile, unsigned int cmd, unsigned long arg) case NFC_SET_PWR: ret = nfc_ioctl_power_states(nfc_dev, arg); break; + case NFC_SET_RESET_READ_PENDING: + if (arg == NFC_SET_READ_PENDING) { + nfc_dev->cold_reset.is_nfc_read_pending = true; + /* Set default NFC state as NCI for Nfc read pending request */ + nfc_dev->nfc_state = NFC_STATE_NCI; + } + else if (arg == NFC_RESET_READ_PENDING){ + nfc_dev->cold_reset.is_nfc_read_pending = false; + } + else { + ret = -EINVAL; + } + break; case ESE_SET_PWR: ret = nfc_ese_pwr(nfc_dev, arg); break; diff --git a/nfc/common.h b/nfc/common.h index 81cff58e4c..014042fc89 100644 --- a/nfc/common.h +++ b/nfc/common.h @@ -100,10 +100,11 @@ // Ioctls // The type should be aligned with MW HAL definitions -#define NFC_SET_PWR _IOW(NFC_MAGIC, 0x01, uint32_t) -#define ESE_SET_PWR _IOW(NFC_MAGIC, 0x02, uint32_t) -#define ESE_GET_PWR _IOR(NFC_MAGIC, 0x03, uint32_t) -#define NFC_SECURE_ZONE _IOW(NFC_MAGIC, 0x0A, uint32_t) +#define NFC_SET_PWR _IOW(NFC_MAGIC, 0x01, uint32_t) +#define ESE_SET_PWR _IOW(NFC_MAGIC, 0x02, uint32_t) +#define ESE_GET_PWR _IOR(NFC_MAGIC, 0x03, uint32_t) +#define NFC_SET_RESET_READ_PENDING _IOW(NFC_MAGIC, 0x04, uint32_t) +#define NFC_SECURE_ZONE _IOW(NFC_MAGIC, 0x0A, uint32_t) #define DTS_IRQ_GPIO_STR "qcom,sn-irq" #define DTS_VEN_GPIO_STR "qcom,sn-ven" @@ -177,6 +178,11 @@ enum nfcc_ioctl_request { NFC_DISABLE, }; +enum nfc_read_pending { + NFC_RESET_READ_PENDING, + NFC_SET_READ_PENDING, +}; + /* nfc platform interface type */ enum interface_flags { /* I2C physical IF for NFCC */ diff --git a/nfc/ese_cold_reset.h b/nfc/ese_cold_reset.h index 3cf2507407..77e03b9ef3 100644 --- a/nfc/ese_cold_reset.h +++ b/nfc/ese_cold_reset.h @@ -71,6 +71,7 @@ struct cold_reset { bool rsp_pending; /* Is NFC enabled from UI */ bool is_nfc_enabled; + bool is_nfc_read_pending; }; struct nfc_dev;