aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-07-03 18:14:04 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-07-09 16:42:24 -0400
commit01d719a2287ec34f631800d10f1fad3c134c3e89 (patch)
tree9b718a6c24ad36433f15febdc52ed25b23f41847 /drivers/nfc
parenta1fbbf1817c671a396b7ae3832bdfab63acea2e5 (diff)
NFC: Add ISO 14443 type B protocol
Some devices (e.g. Sony's PaSoRi) can not do type B polling, so we have to make a distinction between ISO14443 type A and B poll modes. Cc: Eric Lapuyade <eric.lapuyade@intel.com> Cc: Ilan Elias <ilane@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/nfcwilink.c7
-rw-r--r--drivers/nfc/pn533.c12
-rw-r--r--drivers/nfc/pn544_hci.c1
3 files changed, 12 insertions, 8 deletions
diff --git a/drivers/nfc/nfcwilink.c b/drivers/nfc/nfcwilink.c
index 1f74a77d040d..e7fd4938f9bc 100644
--- a/drivers/nfc/nfcwilink.c
+++ b/drivers/nfc/nfcwilink.c
@@ -535,9 +535,10 @@ static int nfcwilink_probe(struct platform_device *pdev)
535 drv->pdev = pdev; 535 drv->pdev = pdev;
536 536
537 protocols = NFC_PROTO_JEWEL_MASK 537 protocols = NFC_PROTO_JEWEL_MASK
538 | NFC_PROTO_MIFARE_MASK | NFC_PROTO_FELICA_MASK 538 | NFC_PROTO_MIFARE_MASK | NFC_PROTO_FELICA_MASK
539 | NFC_PROTO_ISO14443_MASK 539 | NFC_PROTO_ISO14443_MASK
540 | NFC_PROTO_NFC_DEP_MASK; 540 | NFC_PROTO_ISO14443_B_MASK
541 | NFC_PROTO_NFC_DEP_MASK;
541 542
542 drv->ndev = nci_allocate_device(&nfcwilink_ops, 543 drv->ndev = nci_allocate_device(&nfcwilink_ops,
543 protocols, 544 protocols,
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index 84d8175db818..d606f52fec84 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -49,13 +49,15 @@
49#define PN533_DEVICE_STD 0x1 49#define PN533_DEVICE_STD 0x1
50#define PN533_DEVICE_PASORI 0x2 50#define PN533_DEVICE_PASORI 0x2
51 51
52#define PN533_ALL_PROTOCOLS (NFC_PROTO_JEWEL_MASK | NFC_PROTO_MIFARE_MASK \ 52#define PN533_ALL_PROTOCOLS (NFC_PROTO_JEWEL_MASK | NFC_PROTO_MIFARE_MASK |\
53 | NFC_PROTO_FELICA_MASK | NFC_PROTO_ISO14443_MASK \ 53 NFC_PROTO_FELICA_MASK | NFC_PROTO_ISO14443_MASK |\
54 | NFC_PROTO_NFC_DEP_MASK) 54 NFC_PROTO_NFC_DEP_MASK |\
55 NFC_PROTO_ISO14443_B_MASK)
55 56
56#define PN533_NO_TYPE_B_PROTOCOLS (NFC_PROTO_JEWEL_MASK | \ 57#define PN533_NO_TYPE_B_PROTOCOLS (NFC_PROTO_JEWEL_MASK | \
57 NFC_PROTO_MIFARE_MASK | \ 58 NFC_PROTO_MIFARE_MASK | \
58 NFC_PROTO_FELICA_MASK | \ 59 NFC_PROTO_FELICA_MASK | \
60 NFC_PROTO_ISO14443_MASK | \
59 NFC_PROTO_NFC_DEP_MASK) 61 NFC_PROTO_NFC_DEP_MASK)
60 62
61static const struct usb_device_id pn533_table[] = { 63static const struct usb_device_id pn533_table[] = {
@@ -987,7 +989,7 @@ static int pn533_target_found_type_b(struct nfc_target *nfc_tgt, u8 *tgt_data,
987 if (!pn533_target_type_b_is_valid(tgt_type_b, tgt_data_len)) 989 if (!pn533_target_type_b_is_valid(tgt_type_b, tgt_data_len))
988 return -EPROTO; 990 return -EPROTO;
989 991
990 nfc_tgt->supported_protocols = NFC_PROTO_ISO14443_MASK; 992 nfc_tgt->supported_protocols = NFC_PROTO_ISO14443_B_MASK;
991 993
992 return 0; 994 return 0;
993} 995}
@@ -1094,7 +1096,7 @@ static void pn533_poll_create_mod_list(struct pn533 *dev,
1094 if (im_protocols & NFC_PROTO_JEWEL_MASK) 1096 if (im_protocols & NFC_PROTO_JEWEL_MASK)
1095 pn533_poll_add_mod(dev, PN533_POLL_MOD_106KBPS_JEWEL); 1097 pn533_poll_add_mod(dev, PN533_POLL_MOD_106KBPS_JEWEL);
1096 1098
1097 if (im_protocols & NFC_PROTO_ISO14443_MASK) 1099 if (im_protocols & NFC_PROTO_ISO14443_B_MASK)
1098 pn533_poll_add_mod(dev, PN533_POLL_MOD_847KBPS_B); 1100 pn533_poll_add_mod(dev, PN533_POLL_MOD_847KBPS_B);
1099 1101
1100 if (tm_protocols) 1102 if (tm_protocols)
diff --git a/drivers/nfc/pn544_hci.c b/drivers/nfc/pn544_hci.c
index c67b55e224e0..aa71807189ba 100644
--- a/drivers/nfc/pn544_hci.c
+++ b/drivers/nfc/pn544_hci.c
@@ -869,6 +869,7 @@ static int __devinit pn544_hci_probe(struct i2c_client *client,
869 NFC_PROTO_MIFARE_MASK | 869 NFC_PROTO_MIFARE_MASK |
870 NFC_PROTO_FELICA_MASK | 870 NFC_PROTO_FELICA_MASK |
871 NFC_PROTO_ISO14443_MASK | 871 NFC_PROTO_ISO14443_MASK |
872 NFC_PROTO_ISO14443_B_MASK |
872 NFC_PROTO_NFC_DEP_MASK; 873 NFC_PROTO_NFC_DEP_MASK;
873 874
874 info->shdlc = nfc_shdlc_allocate(&pn544_shdlc_ops, 875 info->shdlc = nfc_shdlc_allocate(&pn544_shdlc_ops,