From af944fff10d7f00aa6d652ed27adb080d620c1ca Mon Sep 17 00:00:00 2001 From: Karthik Poosa Date: Mon, 20 Jan 2020 13:06:22 +0530 Subject: [PATCH] NFC: Add support to get NFC interface type Add new ioctl NFC_GET_PLATFORM_TYPE to get the NFC interface type. This is used by the NFC HAL to do the firmware download according to the interface type. Change-Id: I45e8c4814e04348daa88c8b7a026bd44fa84163a Signed-off-by: Karthik Poosa --- drivers/nfc/qti/nfc_common.c | 3 +++ drivers/nfc/qti/nfc_common.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/nfc/qti/nfc_common.c b/drivers/nfc/qti/nfc_common.c index fe8173d49333..c7c883fbaee1 100644 --- a/drivers/nfc/qti/nfc_common.c +++ b/drivers/nfc/qti/nfc_common.c @@ -530,6 +530,9 @@ long nfc_dev_ioctl(struct file *pfile, unsigned int cmd, unsigned long arg) case NFCC_GET_INFO: ret = nfc_ioctl_nfcc_info(pfile, arg); break; + case NFC_GET_PLATFORM_TYPE: + ret = nfc_dev->interface; + break; default: pr_err("%s bad cmd %lu\n", __func__, arg); ret = -ENOIOCTLCMD; diff --git a/drivers/nfc/qti/nfc_common.h b/drivers/nfc/qti/nfc_common.h index 762c4193b14e..000069fb6cd0 100644 --- a/drivers/nfc/qti/nfc_common.h +++ b/drivers/nfc/qti/nfc_common.h @@ -79,6 +79,7 @@ #define NFC_SET_PWR _IOW(NFC_MAGIC, 0x01, unsigned int) #define ESE_SET_PWR _IOW(NFC_MAGIC, 0x02, unsigned int) #define ESE_GET_PWR _IOR(NFC_MAGIC, 0x03, unsigned int) +#define NFC_GET_PLATFORM_TYPE _IO(NFC_MAGIC, 0x04) #define DTS_IRQ_GPIO_STR "qcom,sn-irq" #define DTS_VEN_GPIO_STR "qcom,sn-ven"