Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: dts: qcom: msm8916-samsung-serranove: Add NFC

The LTE version of the S4 Mini VE has a NXP PN547, which is supported
by the nxp-nci-i2c driver in mainline. It seems to detect NFC tags
using "nfctool" just fine, although more testing is difficult given
there seem to be very few useful applications making use of the
Linux NFC subsystem. :(

Note that for some reason Samsung decided to connect the I2C pins
to GPIOs where no hardware I2C bus is available, so we need to
fall back to software bit-banging with i2c-gpio.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211004201921.18526-7-stephan@gerhold.net

authored by

Stephan Gerhold and committed by
Bjorn Andersson
ab0f0987 792b4950

+50
+50
arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts
··· 168 168 pinctrl-0 = <&tkey_default>; 169 169 }; 170 170 }; 171 + 172 + i2c-nfc { 173 + compatible = "i2c-gpio"; 174 + sda-gpios = <&msmgpio 0 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; 175 + scl-gpios = <&msmgpio 1 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; 176 + 177 + pinctrl-names = "default"; 178 + pinctrl-0 = <&nfc_i2c_default>; 179 + 180 + #address-cells = <1>; 181 + #size-cells = <0>; 182 + 183 + nfc@2b { 184 + compatible = "nxp,pn547", "nxp,nxp-nci-i2c"; 185 + reg = <0x2b>; 186 + 187 + interrupt-parent = <&msmgpio>; 188 + interrupts = <21 IRQ_TYPE_EDGE_RISING>; 189 + 190 + enable-gpios = <&msmgpio 20 GPIO_ACTIVE_HIGH>; 191 + firmware-gpios = <&msmgpio 49 GPIO_ACTIVE_HIGH>; 192 + 193 + pinctrl-names = "default"; 194 + pinctrl-0 = <&nfc_default>; 195 + }; 196 + }; 171 197 }; 172 198 173 199 &blsp_i2c2 { ··· 454 428 455 429 muic_irq_default: muic-irq-default { 456 430 pins = "gpio12"; 431 + function = "gpio"; 432 + 433 + drive-strength = <2>; 434 + bias-disable; 435 + }; 436 + 437 + nfc_default: nfc-default { 438 + pins = "gpio20", "gpio49"; 439 + function = "gpio"; 440 + 441 + drive-strength = <2>; 442 + bias-disable; 443 + 444 + irq { 445 + pins = "gpio21"; 446 + function = "gpio"; 447 + 448 + drive-strength = <2>; 449 + bias-pull-down; 450 + }; 451 + }; 452 + 453 + nfc_i2c_default: nfc-i2c-default { 454 + pins = "gpio0", "gpio1"; 457 455 function = "gpio"; 458 456 459 457 drive-strength = <2>;