[PATCH 7/7] arm64: dts: qcom: msm8916-samsung-fortuna: Add NFC

Krzysztof Kozlowski krzysztof.kozlowski at linaro.org
Thu Jun 22 08:20:55 PDT 2023


On 22/06/2023 02:05, Lin, Meng-Bo wrote:
> From: Joe Mason <buddyjojo06 at outlook.com>
> 
> The Samsung Galaxy Ace 4, Core Prime and some Grand Prime 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.
> 
> Grand Prime SM-G530Y (fortunaltezt) 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.
> 
> Signed-off-by: Joe Mason <buddyjojo06 at outlook.com>
> [Put i2c-nfc and NFC pinctrl into fortuna.dtsi to share it with other variants]
> Signed-off-by: Stephan Gerhold <stephan at gerhold.net>

This and other SoB chains look like missing Co-developed-by.

> [Add pn547_nfc]
> Signed-off-by: Lin, Meng-Bo <linmengbo0689 at protonmail.com>
> ---


> +		/* Available NFC chip varies depending on model variant */
> +		pn547_nfc: nfc at 2b {
> +			compatible = "nxp,pn547", "nxp,nxp-nci-i2c";
> +			reg = <0x2b>;
> +
> +			interrupt-parent = <&tlmm>;
> +			interrupts = <21 IRQ_TYPE_EDGE_RISING>;
> +
> +			enable-gpios = <&tlmm 20 GPIO_ACTIVE_HIGH>;
> +			firmware-gpios = <&tlmm 49 GPIO_ACTIVE_HIGH>;
> +
> +			pinctrl-0 = <&nfc_default>;
> +			pinctrl-names = "default";
> +
> +			status = "disabled";
> +		};
> +
> +		s3fwrn5_nfc: nfc at 27 {
> +			compatible = "samsung,s3fwrn5-i2c";
> +			reg = <0x27>;
> +
> +			interrupt-parent = <&tlmm>;
> +			interrupts = <21 IRQ_TYPE_EDGE_RISING>;
> +
> +			en-gpios = <&tlmm 20 GPIO_ACTIVE_HIGH>;
> +			wake-gpios = <&tlmm 49 GPIO_ACTIVE_HIGH>;
> +
> +			clocks = <&rpmcc RPM_SMD_BB_CLK2_PIN>;
> +
> +			pinctrl-0 = <&nfc_default>, <&nfc_clk_req>;
> +			pinctrl-names = "default";
> +
> +			status = "disabled";

Common part does not have two NFCs. It seems common part has zero
NFCs... or should be put into different file.

Best regards,
Krzysztof




More information about the linux-arm-kernel mailing list