aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2014-01-06 15:58:20 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2014-01-06 19:32:41 -0500
commit15203b4c79aaeb443f89ac3190eed3447bf2178b (patch)
treee645516b2407aacf4692c486cbbf306289aace76 /drivers/nfc
parentf26e30cc6b50ba81e30ca3016c29ad4b48b93eaa (diff)
NFC: nfcmrvl: Add setup handler
Marvell nfc device provides support for external coexistance control. It allows Device Host to inhibit the NFCC from polling when required by asserting a GPIO pin. A second pin allows the DH to have feedback on the current NFCC state. The required configuration for this feature is done in setup handler. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/nfcmrvl/main.c15
-rw-r--r--drivers/nfc/nfcmrvl/nfcmrvl.h6
2 files changed, 21 insertions, 0 deletions
diff --git a/drivers/nfc/nfcmrvl/main.c b/drivers/nfc/nfcmrvl/main.c
index 396fc270ffc3..5f91d4571429 100644
--- a/drivers/nfc/nfcmrvl/main.c
+++ b/drivers/nfc/nfcmrvl/main.c
@@ -66,10 +66,25 @@ static int nfcmrvl_nci_send(struct nci_dev *ndev, struct sk_buff *skb)
66 return priv->if_ops->nci_send(priv, skb); 66 return priv->if_ops->nci_send(priv, skb);
67} 67}
68 68
69static int nfcmrvl_nci_setup(struct nci_dev *ndev)
70{
71 __u8 val;
72
73 val = NFCMRVL_GPIO_PIN_NFC_NOT_ALLOWED;
74 nci_set_config(ndev, NFCMRVL_NOT_ALLOWED_ID, 1, &val);
75 val = NFCMRVL_GPIO_PIN_NFC_ACTIVE;
76 nci_set_config(ndev, NFCMRVL_ACTIVE_ID, 1, &val);
77 val = NFCMRVL_EXT_COEX_ENABLE;
78 nci_set_config(ndev, NFCMRVL_EXT_COEX_ID, 1, &val);
79
80 return 0;
81}
82
69static struct nci_ops nfcmrvl_nci_ops = { 83static struct nci_ops nfcmrvl_nci_ops = {
70 .open = nfcmrvl_nci_open, 84 .open = nfcmrvl_nci_open,
71 .close = nfcmrvl_nci_close, 85 .close = nfcmrvl_nci_close,
72 .send = nfcmrvl_nci_send, 86 .send = nfcmrvl_nci_send,
87 .setup = nfcmrvl_nci_setup,
73}; 88};
74 89
75struct nfcmrvl_private *nfcmrvl_nci_register_dev(void *drv_data, 90struct nfcmrvl_private *nfcmrvl_nci_register_dev(void *drv_data,
diff --git a/drivers/nfc/nfcmrvl/nfcmrvl.h b/drivers/nfc/nfcmrvl/nfcmrvl.h
index a007175f77fe..54c4a956bd45 100644
--- a/drivers/nfc/nfcmrvl/nfcmrvl.h
+++ b/drivers/nfc/nfcmrvl/nfcmrvl.h
@@ -19,6 +19,12 @@
19/* Define private flags: */ 19/* Define private flags: */
20#define NFCMRVL_NCI_RUNNING 1 20#define NFCMRVL_NCI_RUNNING 1
21 21
22#define NFCMRVL_EXT_COEX_ID 0xE0
23#define NFCMRVL_NOT_ALLOWED_ID 0xE1
24#define NFCMRVL_ACTIVE_ID 0xE2
25#define NFCMRVL_EXT_COEX_ENABLE 1
26#define NFCMRVL_GPIO_PIN_NFC_NOT_ALLOWED 0xA
27#define NFCMRVL_GPIO_PIN_NFC_ACTIVE 0xB
22#define NFCMRVL_NCI_MAX_EVENT_SIZE 260 28#define NFCMRVL_NCI_MAX_EVENT_SIZE 260
23 29
24struct nfcmrvl_private { 30struct nfcmrvl_private {