Skip to content

Commit 6895730

Browse files
cricard13Samuel Ortiz
authored andcommitted
NFC: ST21NFCA: Add driver for STMicroelectronics ST21NFCA NFC Chip
Add driver for STMicroelectronics ST21NFCA NFC controller. ST21NFCA is using HCI protocol, shdlc as LLC layer & I2C as communication protocol. Adding support for Reader/Writer mode with Tag type 1/2/3/4 A & B. It is using proprietary gate 15 for ISO14443-3 such as type 1 & type 2 tags. It is using proprietary gate 14 for type F tags. ST21NFCA_DEVICE_MGNT_GATE gives access to proprietary CLF configuration. Standard gate for ISO14443-4 A (13) & B (11) are also used. ST21NFCA specific mecanism: One particular point to notice for the data handling is that frame does not contain any length value. Therefore the i2c part of this driver is managing the reception with a read length sequence until the end of frame (0x7e) is reached. In order to avoid conflict between sof & eof a mecanism called byte stuffing concist of an escape byte (0x7d) insertion before special byte (0x7e, 0x7d). The special byte is then xored with 0x20. In this driver, When data are available in the CLF, the interrupt gpio is driven to active state and triggered an interrupt. Once the i2c_master_recv start, the interrupt gpio is driven to idle state until its complete. If the frame is incomplete or data are still available, interrupts will be triggered again. Signed-off-by: Christophe Ricard <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
1 parent 321d03c commit 6895730

File tree

8 files changed

+1253
-0
lines changed

8 files changed

+1253
-0
lines changed

drivers/nfc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,6 @@ config NFC_PORT100
7171
source "drivers/nfc/pn544/Kconfig"
7272
source "drivers/nfc/microread/Kconfig"
7373
source "drivers/nfc/nfcmrvl/Kconfig"
74+
source "drivers/nfc/st21nfca/Kconfig"
7475

7576
endmenu

drivers/nfc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ obj-$(CONFIG_NFC_SIM) += nfcsim.o
1111
obj-$(CONFIG_NFC_PORT100) += port100.o
1212
obj-$(CONFIG_NFC_MRVL) += nfcmrvl/
1313
obj-$(CONFIG_NFC_TRF7970A) += trf7970a.o
14+
obj-$(CONFIG_NFC_ST21NFCA) += st21nfca/
1415

1516
ccflags-$(CONFIG_NFC_DEBUG) := -DDEBUG

drivers/nfc/st21nfca/Kconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
config NFC_ST21NFCA
2+
tristate "STMicroelectronics ST21NFCA NFC driver"
3+
depends on NFC_HCI
4+
select CRC_CCITT
5+
default n
6+
---help---
7+
STMicroelectronics ST21NFCA core driver. It implements the chipset
8+
HCI logic and hooks into the NFC kernel APIs. Physical layers will
9+
register against it.
10+
11+
To compile this driver as a module, choose m here. The module will
12+
be called st21nfca.
13+
Say N if unsure.
14+
15+
config NFC_ST21NFCA_I2C
16+
tristate "NFC ST21NFCA i2c support"
17+
depends on NFC_ST21NFCA && I2C && NFC_SHDLC
18+
---help---
19+
This module adds support for the STMicroelectronics st21nfca i2c interface.
20+
Select this if your platform is using the i2c bus.
21+
22+
If you choose to build a module, it'll be called st21nfca_i2c.
23+
Say N if unsure.

drivers/nfc/st21nfca/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Makefile for ST21NFCA HCI based NFC driver
3+
#
4+
5+
st21nfca_i2c-objs = i2c.o
6+
7+
obj-$(CONFIG_NFC_ST21NFCA) += st21nfca.o
8+
obj-$(CONFIG_NFC_ST21NFCA_I2C) += st21nfca_i2c.o

0 commit comments

Comments
 (0)