arm64: dts: qcom: msm8916-samsung-a2015: Add NFC
authorStephan Gerhold <stephan@gerhold.net>
Fri, 4 Jun 2021 17:27:42 +0000 (19:27 +0200)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Sun, 6 Jun 2021 04:07:51 +0000 (23:07 -0500)
commit5e57e5d0d62216502ce603f3399e411368e11a43
tree6dc5fc9864ee9e02cfa001f1e232baa18bc2b7d3
parent0c04d16f4123f5eccc9f7e0199ce2e050261fd0f
arm64: dts: qcom: msm8916-samsung-a2015: Add NFC

The Samsung Galaxy A3/A5 both have a Samsung S3FWRN5 NFC chip that
works quite well with the s3fwrn5 driver in the Linux NFC subsystem.

The clock setup for the NFC chip is a bit special (although this
seems to be a common approach used for Qualcomm devices with NFC):

The NFC chip has an output GPIO that is asserted whenever the clock
is needed to function properly. On the A3/A5 this is wired up to
PM8916 GPIO2, which is then configured with a special function
(NFC_CLK_REQ or BB_CLK2_REQ).

Enabling the rpmcc RPM_SMD_BB_CLK2_PIN clock will then instruct
PM8916 to automatically enable the clock whenever the NFC chip
requests it. The advantage is that the clock is only enabled when
needed and we don't need to manage it ourselves from the NFC driver.

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.

Cc: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20210604172742.10593-5-stephan@gerhold.net
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi