Commit ab0f0987 authored by Stephan Gerhold's avatar Stephan Gerhold Committed by Bjorn Andersson

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: default avatarStephan Gerhold <stephan@gerhold.net>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211004201921.18526-7-stephan@gerhold.net
parent 792b4950
......@@ -168,6 +168,32 @@ touchkey@20 {
pinctrl-0 = <&tkey_default>;
};
};
i2c-nfc {
compatible = "i2c-gpio";
sda-gpios = <&msmgpio 0 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
scl-gpios = <&msmgpio 1 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
pinctrl-names = "default";
pinctrl-0 = <&nfc_i2c_default>;
#address-cells = <1>;
#size-cells = <0>;
nfc@2b {
compatible = "nxp,pn547", "nxp,nxp-nci-i2c";
reg = <0x2b>;
interrupt-parent = <&msmgpio>;
interrupts = <21 IRQ_TYPE_EDGE_RISING>;
enable-gpios = <&msmgpio 20 GPIO_ACTIVE_HIGH>;
firmware-gpios = <&msmgpio 49 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&nfc_default>;
};
};
};
&blsp_i2c2 {
......@@ -434,6 +460,30 @@ muic_irq_default: muic-irq-default {
bias-disable;
};
nfc_default: nfc-default {
pins = "gpio20", "gpio49";
function = "gpio";
drive-strength = <2>;
bias-disable;
irq {
pins = "gpio21";
function = "gpio";
drive-strength = <2>;
bias-pull-down;
};
};
nfc_i2c_default: nfc-i2c-default {
pins = "gpio0", "gpio1";
function = "gpio";
drive-strength = <2>;
bias-disable;
};
tkey_default: tkey-default {
pins = "gpio98";
function = "gpio";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment