blob: ec9dbf4fad83a02a9c6bb108011a5eaa33ba27ef [file] [log] [blame]
Ilan Elias93aead42011-09-18 11:19:36 +03001/*
2 * Texas Instrument's NFC Driver For Shared Transport.
3 *
4 * NFC Driver acts as interface between NCI core and
5 * TI Shared Transport Layer.
6 *
7 * Copyright (C) 2011 Texas Instruments, Inc.
8 *
9 * Written by Ilan Elias <ilane@ti.com>
10 *
11 * Acknowledgements:
12 * This file is based on btwilink.c, which was written
13 * by Raja Mani and Pavan Savoy.
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as
17 * published by the Free Software Foundation.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 *
28 */
29#include <linux/platform_device.h>
Paul Gortmakerbaf79c32011-09-28 15:31:14 -040030#include <linux/module.h>
Ilan Elias3ed13262012-01-17 14:11:31 +020031#include <linux/types.h>
Ilan Elias1195d892012-01-17 14:11:32 +020032#include <linux/firmware.h>
Ilan Elias93aead42011-09-18 11:19:36 +030033#include <linux/nfc.h>
34#include <net/nfc/nci.h>
35#include <net/nfc/nci_core.h>
36#include <linux/ti_wilink_st.h>
37
38#define NFCWILINK_CHNL 12
39#define NFCWILINK_OPCODE 7
40#define NFCWILINK_MAX_FRAME_SIZE 300
41#define NFCWILINK_HDR_LEN 4
42#define NFCWILINK_OFFSET_LEN_IN_HDR 1
43#define NFCWILINK_LEN_SIZE 2
44#define NFCWILINK_REGISTER_TIMEOUT 8000 /* 8 sec */
Ilan Elias1195d892012-01-17 14:11:32 +020045#define NFCWILINK_CMD_TIMEOUT 5000 /* 5 sec */
46
47#define BTS_FILE_NAME_MAX_SIZE 40
48#define BTS_FILE_HDR_MAGIC 0x42535442
49#define BTS_FILE_CMD_MAX_LEN 0xff
50#define BTS_FILE_ACTION_TYPE_SEND_CMD 1
51
52#define NCI_VS_NFCC_INFO_CMD_GID 0x2f
53#define NCI_VS_NFCC_INFO_CMD_OID 0x12
54#define NCI_VS_NFCC_INFO_RSP_GID 0x4f
55#define NCI_VS_NFCC_INFO_RSP_OID 0x12
Ilan Elias93aead42011-09-18 11:19:36 +030056
57struct nfcwilink_hdr {
Ilan Elias3ed13262012-01-17 14:11:31 +020058 __u8 chnl;
59 __u8 opcode;
60 __le16 len;
Ilan Elias93aead42011-09-18 11:19:36 +030061} __packed;
62
Ilan Elias1195d892012-01-17 14:11:32 +020063struct nci_vs_nfcc_info_cmd {
64 __u8 gid;
65 __u8 oid;
66 __u8 plen;
67} __packed;
68
69struct nci_vs_nfcc_info_rsp {
70 __u8 gid;
71 __u8 oid;
72 __u8 plen;
73 __u8 status;
74 __u8 hw_id;
75 __u8 sw_ver_x;
76 __u8 sw_ver_z;
77 __u8 patch_id;
78} __packed;
79
80struct bts_file_hdr {
81 __le32 magic;
82 __le32 ver;
83 __u8 rfu[24];
84 __u8 actions[0];
85} __packed;
86
87struct bts_file_action {
88 __le16 type;
89 __le16 len;
90 __u8 data[0];
91} __packed;
92
Ilan Elias93aead42011-09-18 11:19:36 +030093struct nfcwilink {
94 struct platform_device *pdev;
95 struct nci_dev *ndev;
96 unsigned long flags;
97
98 char st_register_cb_status;
99 long (*st_write) (struct sk_buff *);
Ilan Elias1195d892012-01-17 14:11:32 +0200100
101 struct completion completed;
102
103 struct nci_vs_nfcc_info_rsp nfcc_info;
Ilan Elias93aead42011-09-18 11:19:36 +0300104};
105
106/* NFCWILINK driver flags */
107enum {
108 NFCWILINK_RUNNING,
Ilan Elias1195d892012-01-17 14:11:32 +0200109 NFCWILINK_FW_DOWNLOAD,
Ilan Elias93aead42011-09-18 11:19:36 +0300110};
111
Frederic Danis1095e692013-05-22 11:36:17 +0200112static int nfcwilink_send(struct nci_dev *ndev, struct sk_buff *skb);
Ilan Elias1195d892012-01-17 14:11:32 +0200113
114static inline struct sk_buff *nfcwilink_skb_alloc(unsigned int len, gfp_t how)
115{
116 struct sk_buff *skb;
117
118 skb = alloc_skb(len + NFCWILINK_HDR_LEN, how);
119 if (skb)
120 skb_reserve(skb, NFCWILINK_HDR_LEN);
121
122 return skb;
123}
124
125static void nfcwilink_fw_download_receive(struct nfcwilink *drv,
126 struct sk_buff *skb)
127{
128 struct nci_vs_nfcc_info_rsp *rsp = (void *)skb->data;
129
130 /* Detect NCI_VS_NFCC_INFO_RSP and store the result */
131 if ((skb->len > 3) && (rsp->gid == NCI_VS_NFCC_INFO_RSP_GID) &&
132 (rsp->oid == NCI_VS_NFCC_INFO_RSP_OID)) {
133 memcpy(&drv->nfcc_info, rsp,
134 sizeof(struct nci_vs_nfcc_info_rsp));
135 }
136
137 kfree_skb(skb);
138
139 complete(&drv->completed);
140}
141
142static int nfcwilink_get_bts_file_name(struct nfcwilink *drv, char *file_name)
143{
144 struct nci_vs_nfcc_info_cmd *cmd;
145 struct sk_buff *skb;
146 unsigned long comp_ret;
147 int rc;
148
Ilan Elias1195d892012-01-17 14:11:32 +0200149 skb = nfcwilink_skb_alloc(sizeof(struct nci_vs_nfcc_info_cmd),
150 GFP_KERNEL);
151 if (!skb) {
152 nfc_dev_err(&drv->pdev->dev,
153 "no memory for nci_vs_nfcc_info_cmd");
154 return -ENOMEM;
155 }
156
Ilan Elias1195d892012-01-17 14:11:32 +0200157 cmd = (struct nci_vs_nfcc_info_cmd *)
158 skb_put(skb, sizeof(struct nci_vs_nfcc_info_cmd));
159 cmd->gid = NCI_VS_NFCC_INFO_CMD_GID;
160 cmd->oid = NCI_VS_NFCC_INFO_CMD_OID;
161 cmd->plen = 0;
162
163 drv->nfcc_info.plen = 0;
164
Frederic Danis1095e692013-05-22 11:36:17 +0200165 rc = nfcwilink_send(drv->ndev, skb);
Ilan Elias1195d892012-01-17 14:11:32 +0200166 if (rc)
167 return rc;
168
169 comp_ret = wait_for_completion_timeout(&drv->completed,
170 msecs_to_jiffies(NFCWILINK_CMD_TIMEOUT));
Joe Perchesb4834832013-04-05 12:27:37 -0700171 dev_dbg(&drv->pdev->dev, "wait_for_completion_timeout returned %ld\n",
172 comp_ret);
Ilan Elias1195d892012-01-17 14:11:32 +0200173 if (comp_ret == 0) {
Joe Perchesb4834832013-04-05 12:27:37 -0700174 dev_err(&drv->pdev->dev,
175 "timeout on wait_for_completion_timeout\n");
Ilan Elias1195d892012-01-17 14:11:32 +0200176 return -ETIMEDOUT;
177 }
178
Joe Perchesb4834832013-04-05 12:27:37 -0700179 dev_dbg(&drv->pdev->dev, "nci_vs_nfcc_info_rsp: plen %d, status %d\n",
180 drv->nfcc_info.plen, drv->nfcc_info.status);
Ilan Elias1195d892012-01-17 14:11:32 +0200181
182 if ((drv->nfcc_info.plen != 5) || (drv->nfcc_info.status != 0)) {
183 nfc_dev_err(&drv->pdev->dev,
184 "invalid nci_vs_nfcc_info_rsp");
185 return -EINVAL;
186 }
187
188 snprintf(file_name, BTS_FILE_NAME_MAX_SIZE,
189 "TINfcInit_%d.%d.%d.%d.bts",
190 drv->nfcc_info.hw_id,
191 drv->nfcc_info.sw_ver_x,
192 drv->nfcc_info.sw_ver_z,
193 drv->nfcc_info.patch_id);
194
195 nfc_dev_info(&drv->pdev->dev, "nfcwilink FW file name: %s", file_name);
196
197 return 0;
198}
199
200static int nfcwilink_send_bts_cmd(struct nfcwilink *drv, __u8 *data, int len)
201{
202 struct nfcwilink_hdr *hdr = (struct nfcwilink_hdr *)data;
203 struct sk_buff *skb;
204 unsigned long comp_ret;
205 int rc;
206
Ilan Elias1195d892012-01-17 14:11:32 +0200207 /* verify valid cmd for the NFC channel */
208 if ((len <= sizeof(struct nfcwilink_hdr)) ||
209 (len > BTS_FILE_CMD_MAX_LEN) ||
210 (hdr->chnl != NFCWILINK_CHNL) ||
211 (hdr->opcode != NFCWILINK_OPCODE)) {
212 nfc_dev_err(&drv->pdev->dev,
213 "ignoring invalid bts cmd, len %d, chnl %d, opcode %d",
214 len, hdr->chnl, hdr->opcode);
215 return 0;
216 }
217
218 /* remove the ST header */
219 len -= sizeof(struct nfcwilink_hdr);
220 data += sizeof(struct nfcwilink_hdr);
221
222 skb = nfcwilink_skb_alloc(len, GFP_KERNEL);
223 if (!skb) {
224 nfc_dev_err(&drv->pdev->dev, "no memory for bts cmd");
225 return -ENOMEM;
226 }
227
Ilan Elias1195d892012-01-17 14:11:32 +0200228 memcpy(skb_put(skb, len), data, len);
229
Frederic Danis1095e692013-05-22 11:36:17 +0200230 rc = nfcwilink_send(drv->ndev, skb);
Ilan Elias1195d892012-01-17 14:11:32 +0200231 if (rc)
232 return rc;
233
234 comp_ret = wait_for_completion_timeout(&drv->completed,
235 msecs_to_jiffies(NFCWILINK_CMD_TIMEOUT));
Joe Perchesb4834832013-04-05 12:27:37 -0700236 dev_dbg(&drv->pdev->dev, "wait_for_completion_timeout returned %ld\n",
237 comp_ret);
Ilan Elias1195d892012-01-17 14:11:32 +0200238 if (comp_ret == 0) {
239 nfc_dev_err(&drv->pdev->dev,
240 "timeout on wait_for_completion_timeout");
241 return -ETIMEDOUT;
242 }
243
244 return 0;
245}
246
247static int nfcwilink_download_fw(struct nfcwilink *drv)
248{
249 unsigned char file_name[BTS_FILE_NAME_MAX_SIZE];
250 const struct firmware *fw;
251 __u16 action_type, action_len;
252 __u8 *ptr;
253 int len, rc;
254
Ilan Elias1195d892012-01-17 14:11:32 +0200255 set_bit(NFCWILINK_FW_DOWNLOAD, &drv->flags);
256
257 rc = nfcwilink_get_bts_file_name(drv, file_name);
258 if (rc)
259 goto exit;
260
261 rc = request_firmware(&fw, file_name, &drv->pdev->dev);
262 if (rc) {
263 nfc_dev_err(&drv->pdev->dev, "request_firmware failed %d", rc);
264
265 /* if the file is not found, don't exit with failure */
266 if (rc == -ENOENT)
267 rc = 0;
268
269 goto exit;
270 }
271
272 len = fw->size;
273 ptr = (__u8 *)fw->data;
274
275 if ((len == 0) || (ptr == NULL)) {
Joe Perchesb4834832013-04-05 12:27:37 -0700276 dev_dbg(&drv->pdev->dev,
277 "request_firmware returned size %d\n", len);
Ilan Elias1195d892012-01-17 14:11:32 +0200278 goto release_fw;
279 }
280
281 if (__le32_to_cpu(((struct bts_file_hdr *)ptr)->magic) !=
282 BTS_FILE_HDR_MAGIC) {
283 nfc_dev_err(&drv->pdev->dev, "wrong bts magic number");
284 rc = -EINVAL;
285 goto release_fw;
286 }
287
288 /* remove the BTS header */
289 len -= sizeof(struct bts_file_hdr);
290 ptr += sizeof(struct bts_file_hdr);
291
292 while (len > 0) {
293 action_type =
294 __le16_to_cpu(((struct bts_file_action *)ptr)->type);
295 action_len =
296 __le16_to_cpu(((struct bts_file_action *)ptr)->len);
297
Joe Perchesb4834832013-04-05 12:27:37 -0700298 dev_dbg(&drv->pdev->dev, "bts_file_action type %d, len %d\n",
299 action_type, action_len);
Ilan Elias1195d892012-01-17 14:11:32 +0200300
301 switch (action_type) {
302 case BTS_FILE_ACTION_TYPE_SEND_CMD:
303 rc = nfcwilink_send_bts_cmd(drv,
304 ((struct bts_file_action *)ptr)->data,
305 action_len);
306 if (rc)
307 goto release_fw;
308 break;
309 }
310
311 /* advance to the next action */
312 len -= (sizeof(struct bts_file_action) + action_len);
313 ptr += (sizeof(struct bts_file_action) + action_len);
314 }
315
316release_fw:
317 release_firmware(fw);
318
319exit:
320 clear_bit(NFCWILINK_FW_DOWNLOAD, &drv->flags);
321 return rc;
322}
323
Ilan Elias93aead42011-09-18 11:19:36 +0300324/* Called by ST when registration is complete */
325static void nfcwilink_register_complete(void *priv_data, char data)
326{
327 struct nfcwilink *drv = priv_data;
328
Ilan Elias93aead42011-09-18 11:19:36 +0300329 /* store ST registration status */
330 drv->st_register_cb_status = data;
331
332 /* complete the wait in nfc_st_open() */
Ilan Elias1195d892012-01-17 14:11:32 +0200333 complete(&drv->completed);
Ilan Elias93aead42011-09-18 11:19:36 +0300334}
335
336/* Called by ST when receive data is available */
337static long nfcwilink_receive(void *priv_data, struct sk_buff *skb)
338{
339 struct nfcwilink *drv = priv_data;
340 int rc;
341
Ilan Elias93aead42011-09-18 11:19:36 +0300342 if (!skb)
343 return -EFAULT;
344
345 if (!drv) {
346 kfree_skb(skb);
347 return -EFAULT;
348 }
349
Joe Perchesb4834832013-04-05 12:27:37 -0700350 dev_dbg(&drv->pdev->dev, "receive entry, len %d\n", skb->len);
Wei Yongjund6650a22012-09-08 09:53:22 +0800351
Ilan Elias93aead42011-09-18 11:19:36 +0300352 /* strip the ST header
353 (apart for the chnl byte, which is not received in the hdr) */
354 skb_pull(skb, (NFCWILINK_HDR_LEN-1));
355
Ilan Elias1195d892012-01-17 14:11:32 +0200356 if (test_bit(NFCWILINK_FW_DOWNLOAD, &drv->flags)) {
357 nfcwilink_fw_download_receive(drv, skb);
358 return 0;
359 }
360
Ilan Elias93aead42011-09-18 11:19:36 +0300361 /* Forward skb to NCI core layer */
Frederic Danis1095e692013-05-22 11:36:17 +0200362 rc = nci_recv_frame(drv->ndev, skb);
Ilan Elias93aead42011-09-18 11:19:36 +0300363 if (rc < 0) {
364 nfc_dev_err(&drv->pdev->dev, "nci_recv_frame failed %d", rc);
365 return rc;
366 }
367
368 return 0;
369}
370
371/* protocol structure registered with ST */
372static struct st_proto_s nfcwilink_proto = {
373 .chnl_id = NFCWILINK_CHNL,
374 .max_frame_size = NFCWILINK_MAX_FRAME_SIZE,
375 .hdr_len = (NFCWILINK_HDR_LEN-1), /* not including chnl byte */
376 .offset_len_in_hdr = NFCWILINK_OFFSET_LEN_IN_HDR,
377 .len_size = NFCWILINK_LEN_SIZE,
378 .reserve = 0,
379 .recv = nfcwilink_receive,
380 .reg_complete_cb = nfcwilink_register_complete,
381 .write = NULL,
382};
383
384static int nfcwilink_open(struct nci_dev *ndev)
385{
386 struct nfcwilink *drv = nci_get_drvdata(ndev);
387 unsigned long comp_ret;
388 int rc;
389
Ilan Elias93aead42011-09-18 11:19:36 +0300390 if (test_and_set_bit(NFCWILINK_RUNNING, &drv->flags)) {
391 rc = -EBUSY;
392 goto exit;
393 }
394
395 nfcwilink_proto.priv_data = drv;
396
Ilan Elias1195d892012-01-17 14:11:32 +0200397 init_completion(&drv->completed);
Ilan Elias93aead42011-09-18 11:19:36 +0300398 drv->st_register_cb_status = -EINPROGRESS;
399
400 rc = st_register(&nfcwilink_proto);
401 if (rc < 0) {
402 if (rc == -EINPROGRESS) {
403 comp_ret = wait_for_completion_timeout(
Ilan Elias1195d892012-01-17 14:11:32 +0200404 &drv->completed,
Ilan Elias93aead42011-09-18 11:19:36 +0300405 msecs_to_jiffies(NFCWILINK_REGISTER_TIMEOUT));
406
Joe Perchesb4834832013-04-05 12:27:37 -0700407 dev_dbg(&drv->pdev->dev,
408 "wait_for_completion_timeout returned %ld\n",
409 comp_ret);
Ilan Elias93aead42011-09-18 11:19:36 +0300410
411 if (comp_ret == 0) {
412 /* timeout */
413 rc = -ETIMEDOUT;
414 goto clear_exit;
415 } else if (drv->st_register_cb_status != 0) {
416 rc = drv->st_register_cb_status;
417 nfc_dev_err(&drv->pdev->dev,
418 "st_register_cb failed %d", rc);
419 goto clear_exit;
420 }
421 } else {
422 nfc_dev_err(&drv->pdev->dev,
423 "st_register failed %d", rc);
424 goto clear_exit;
425 }
426 }
427
428 /* st_register MUST fill the write callback */
429 BUG_ON(nfcwilink_proto.write == NULL);
430 drv->st_write = nfcwilink_proto.write;
431
Ilan Elias1195d892012-01-17 14:11:32 +0200432 if (nfcwilink_download_fw(drv)) {
433 nfc_dev_err(&drv->pdev->dev, "nfcwilink_download_fw failed %d",
434 rc);
435 /* open should succeed, even if the FW download failed */
436 }
437
Ilan Elias93aead42011-09-18 11:19:36 +0300438 goto exit;
439
440clear_exit:
441 clear_bit(NFCWILINK_RUNNING, &drv->flags);
442
443exit:
444 return rc;
445}
446
447static int nfcwilink_close(struct nci_dev *ndev)
448{
449 struct nfcwilink *drv = nci_get_drvdata(ndev);
450 int rc;
451
Ilan Elias93aead42011-09-18 11:19:36 +0300452 if (!test_and_clear_bit(NFCWILINK_RUNNING, &drv->flags))
453 return 0;
454
455 rc = st_unregister(&nfcwilink_proto);
456 if (rc)
457 nfc_dev_err(&drv->pdev->dev, "st_unregister failed %d", rc);
458
459 drv->st_write = NULL;
460
461 return rc;
462}
463
Frederic Danis1095e692013-05-22 11:36:17 +0200464static int nfcwilink_send(struct nci_dev *ndev, struct sk_buff *skb)
Ilan Elias93aead42011-09-18 11:19:36 +0300465{
Ilan Elias93aead42011-09-18 11:19:36 +0300466 struct nfcwilink *drv = nci_get_drvdata(ndev);
467 struct nfcwilink_hdr hdr = {NFCWILINK_CHNL, NFCWILINK_OPCODE, 0x0000};
468 long len;
469
Joe Perchesb4834832013-04-05 12:27:37 -0700470 dev_dbg(&drv->pdev->dev, "send entry, len %d\n", skb->len);
Ilan Elias93aead42011-09-18 11:19:36 +0300471
Ilan Eliasea9917d2012-01-17 14:11:33 +0200472 if (!test_bit(NFCWILINK_RUNNING, &drv->flags)) {
473 kfree_skb(skb);
474 return -EINVAL;
475 }
Ilan Elias93aead42011-09-18 11:19:36 +0300476
477 /* add the ST hdr to the start of the buffer */
Ilan Elias3ed13262012-01-17 14:11:31 +0200478 hdr.len = cpu_to_le16(skb->len);
Ilan Elias93aead42011-09-18 11:19:36 +0300479 memcpy(skb_push(skb, NFCWILINK_HDR_LEN), &hdr, NFCWILINK_HDR_LEN);
480
481 /* Insert skb to shared transport layer's transmit queue.
482 * Freeing skb memory is taken care in shared transport layer,
483 * so don't free skb memory here.
484 */
485 len = drv->st_write(skb);
486 if (len < 0) {
487 kfree_skb(skb);
488 nfc_dev_err(&drv->pdev->dev, "st_write failed %ld", len);
489 return -EFAULT;
490 }
491
492 return 0;
493}
494
495static struct nci_ops nfcwilink_ops = {
496 .open = nfcwilink_open,
497 .close = nfcwilink_close,
498 .send = nfcwilink_send,
499};
500
501static int nfcwilink_probe(struct platform_device *pdev)
502{
503 static struct nfcwilink *drv;
504 int rc;
Ilan Elias3ed13262012-01-17 14:11:31 +0200505 __u32 protocols;
Ilan Elias93aead42011-09-18 11:19:36 +0300506
Julia Lawall5f4d6212012-12-06 23:10:40 +0100507 drv = devm_kzalloc(&pdev->dev, sizeof(struct nfcwilink), GFP_KERNEL);
Ilan Elias93aead42011-09-18 11:19:36 +0300508 if (!drv) {
509 rc = -ENOMEM;
510 goto exit;
511 }
512
513 drv->pdev = pdev;
514
515 protocols = NFC_PROTO_JEWEL_MASK
Samuel Ortiz01d719a2012-07-04 00:14:04 +0200516 | NFC_PROTO_MIFARE_MASK | NFC_PROTO_FELICA_MASK
517 | NFC_PROTO_ISO14443_MASK
518 | NFC_PROTO_ISO14443_B_MASK
519 | NFC_PROTO_NFC_DEP_MASK;
Ilan Elias93aead42011-09-18 11:19:36 +0300520
521 drv->ndev = nci_allocate_device(&nfcwilink_ops,
522 protocols,
523 NFCWILINK_HDR_LEN,
524 0);
525 if (!drv->ndev) {
526 nfc_dev_err(&pdev->dev, "nci_allocate_device failed");
527 rc = -ENOMEM;
Julia Lawall5f4d6212012-12-06 23:10:40 +0100528 goto exit;
Ilan Elias93aead42011-09-18 11:19:36 +0300529 }
530
531 nci_set_parent_dev(drv->ndev, &pdev->dev);
532 nci_set_drvdata(drv->ndev, drv);
533
534 rc = nci_register_device(drv->ndev);
535 if (rc < 0) {
536 nfc_dev_err(&pdev->dev, "nci_register_device failed %d", rc);
537 goto free_dev_exit;
538 }
539
540 dev_set_drvdata(&pdev->dev, drv);
541
542 goto exit;
543
544free_dev_exit:
545 nci_free_device(drv->ndev);
546
Ilan Elias93aead42011-09-18 11:19:36 +0300547exit:
548 return rc;
549}
550
551static int nfcwilink_remove(struct platform_device *pdev)
552{
553 struct nfcwilink *drv = dev_get_drvdata(&pdev->dev);
554 struct nci_dev *ndev;
555
Ilan Elias93aead42011-09-18 11:19:36 +0300556 if (!drv)
557 return -EFAULT;
558
559 ndev = drv->ndev;
560
561 nci_unregister_device(ndev);
562 nci_free_device(ndev);
563
Ilan Elias93aead42011-09-18 11:19:36 +0300564 dev_set_drvdata(&pdev->dev, NULL);
565
566 return 0;
567}
568
569static struct platform_driver nfcwilink_driver = {
570 .probe = nfcwilink_probe,
571 .remove = nfcwilink_remove,
572 .driver = {
573 .name = "nfcwilink",
574 .owner = THIS_MODULE,
575 },
576};
577
Syam Sidhardhan058576d2012-08-15 14:04:10 +0530578module_platform_driver(nfcwilink_driver);
Ilan Elias93aead42011-09-18 11:19:36 +0300579
580/* ------ Module Info ------ */
581
582MODULE_AUTHOR("Ilan Elias <ilane@ti.com>");
583MODULE_DESCRIPTION("NFC Driver for TI Shared Transport");
584MODULE_LICENSE("GPL");