Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec876526 authored by John W. Linville's avatar John W. Linville
Browse files


Samuel Ortiz <sameo@linux.intel.com> says:

"NFC: 3.17 pull request

This is the NFC pull request for 3.17.
This is a rather quiet one, we have:

- A new driver from ST Microelectronics for their NCI ST21NFCB,
  including device tree  support.

- p2p support for the ST21NFCA driver

- A few fixes an enhancements for the NFC digital layer"

Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parents 9a244409 bf30a67c
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
* STMicroelectronics SAS. ST21NFCB NFC Controller

Required properties:
- compatible: Should be "st,st21nfcb_i2c".
- clock-frequency: I²C work frequency.
- reg: address on the bus
- interrupt-parent: phandle for the interrupt gpio controller
- interrupts: GPIO interrupt to which the chip is connected
- reset-gpios: Output GPIO pin used to reset the ST21NFCB

Optional SoC Specific Properties:
- pinctrl-names: Contains only one value - "default".
- pintctrl-0: Specifies the pin control groups used for this controller.

Example (for ARM-based BeagleBoard xM with ST21NFCB on I2C2):

&i2c2 {

	status = "okay";

	st21nfcb: st21nfcb@8 {

		compatible = "st,st21nfcb_i2c";

		reg = <0x08>;
		clock-frequency = <400000>;

		interrupt-parent = <&gpio5>;
		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;

		reset-gpios = <&gpio5 29 GPIO_ACTIVE_HIGH>;
	};
};
+1 −1
Original line number Diff line number Diff line
@@ -72,5 +72,5 @@ source "drivers/nfc/pn544/Kconfig"
source "drivers/nfc/microread/Kconfig"
source "drivers/nfc/nfcmrvl/Kconfig"
source "drivers/nfc/st21nfca/Kconfig"

source "drivers/nfc/st21nfcb/Kconfig"
endmenu
+2 −1
Original line number Diff line number Diff line
@@ -12,5 +12,6 @@ obj-$(CONFIG_NFC_PORT100) += port100.o
obj-$(CONFIG_NFC_MRVL)		+= nfcmrvl/
obj-$(CONFIG_NFC_TRF7970A)	+= trf7970a.o
obj-$(CONFIG_NFC_ST21NFCA)  	+= st21nfca/
obj-$(CONFIG_NFC_ST21NFCB)	+= st21nfcb/

ccflags-$(CONFIG_NFC_DEBUG) := -DDEBUG
+1 −1
Original line number Diff line number Diff line
@@ -4,5 +4,5 @@

st21nfca_i2c-objs  = i2c.o

obj-$(CONFIG_NFC_ST21NFCA)     += st21nfca.o
obj-$(CONFIG_NFC_ST21NFCA)     += st21nfca.o st21nfca_dep.o
obj-$(CONFIG_NFC_ST21NFCA_I2C) += st21nfca_i2c.o
+5 −4
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ struct st21nfca_i2c_phy {
	int hard_fault;
	struct mutex phy_lock;
};
static u8 len_seq[] = { 13, 24, 15, 29 };
static u8 len_seq[] = { 16, 24, 12, 29 };
static u16 wait_tab[] = { 2, 3, 5, 15, 20, 40};

#define I2C_DUMP_SKB(info, skb)					\
@@ -397,12 +397,11 @@ static int st21nfca_hci_i2c_read(struct st21nfca_i2c_phy *phy,
		 * The first read sequence does not start with SOF.
		 * Data is corrupeted so we drop it.
		 */
		if (!phy->current_read_len && buf[0] != ST21NFCA_SOF_EOF) {
		if (!phy->current_read_len && !IS_START_OF_FRAME(buf)) {
			skb_trim(skb, 0);
			phy->current_read_len = 0;
			return -EIO;
		} else if (phy->current_read_len &&
			IS_START_OF_FRAME(buf)) {
		} else if (phy->current_read_len && IS_START_OF_FRAME(buf)) {
			/*
			 * Previous frame transmission was interrupted and
			 * the frame got repeated.
@@ -487,6 +486,8 @@ static irqreturn_t st21nfca_hci_irq_thread_fn(int irq, void *phy_id)
		 */
		nfc_hci_recv_frame(phy->hdev, phy->pending_skb);
		phy->crc_trials = 0;
	} else {
		kfree_skb(phy->pending_skb);
	}

	phy->pending_skb = alloc_skb(ST21NFCA_HCI_LLC_MAX_SIZE * 2, GFP_KERNEL);
Loading