[PATCH] arm64: dts: qcom: sdm845-lg: Enable NFC

Paul Sajna posted 1 patch 3 weeks, 2 days ago
There is a newer version of this series
arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi | 31 ++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
[PATCH] arm64: dts: qcom: sdm845-lg: Enable NFC
Posted by Paul Sajna 3 weeks, 2 days ago
Add the i2c and tlmm nodes to support the NXP PN547 NFC chip

Downstream dtsi for reference:
https://github.com/LineageOS/android_kernel_lge_sdm845/blob/lineage-22.2/arch/arm64/boot/dts/lge/sdm845-judy/sdm845-judyln_lao_com/sdm845-judyln_lao_com-nfc.dtsi

Signed-off-by: Paul Sajna <sajattack@postmarketos.org>
---
 arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi | 31 ++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
index b030a10009c5..069d1cf3dead 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
@@ -471,6 +471,25 @@ &gpu {
 	status = "okay";
 };
 
+&i2c3 {
+	clock-frequency = <1000000>;
+
+	status = "okay";
+
+	nfc@28 {
+		compatible = "nxp,pn547", "nxp,nxp-nci-i2c";
+		reg = <0x28>;
+
+		interrupts-extended = <&tlmm 63 IRQ_TYPE_EDGE_RISING>;
+
+		enable-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;
+		firmware-gpios = <&tlmm 62 GPIO_ACTIVE_HIGH>;
+
+		pinctrl-0 = <&nfc_default>;
+		pinctrl-names = "default";
+	};
+};
+
 &ipa {
 	status = "okay";
 };
@@ -551,6 +570,11 @@ &qupv3_id_1 {
 	status = "okay";
 };
 
+&qup_i2c3_default {
+	drive-strength = <2>;
+	bias-disable;
+};
+
 &qup_uart9_rx {
 	drive-strength = <2>;
 	bias-pull-up;
@@ -609,6 +633,13 @@ sd_card_det_n: sd-card-det-n-state {
 		function = "gpio";
 		bias-pull-up;
 	};
+
+	nfc_default: nfc-default-state {
+		pins = "gpio12", "gpio62", "gpio63";
+		function = "gpio";
+		drive-strength = <6>;
+		bias-pull-up;
+	};
 };
 
 &uart6 {

---
base-commit: 32b6ef9a5d0eca44f9cd91f52f4faa89f145a0de
change-id: 20260902-sdm845-lg-judy-nfc-5f9e5775393d

Best regards,
-- 
Paul Sajna <sajattack@postmarketos.org>
Re: [PATCH] arm64: dts: qcom: sdm845-lg: Enable NFC
Posted by David Heidelberg 3 weeks, 1 day ago
On 03/09/2026 04:03, Paul Sajna wrote:
> Add the i2c and tlmm nodes to support the NXP PN547 NFC chip
> 
> Downstream dtsi for reference:
> https://github.com/LineageOS/android_kernel_lge_sdm845/blob/lineage-22.2/arch/arm64/boot/dts/lge/sdm845-judy/sdm845-judyln_lao_com/sdm845-judyln_lao_com-nfc.dtsi
> 
> Signed-off-by: Paul Sajna <sajattack@postmarketos.org>
> ---
>   arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi | 31 ++++++++++++++++++++++++++
>   1 file changed, 31 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
> index b030a10009c5..069d1cf3dead 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
> @@ -471,6 +471,25 @@ &gpu {
>   	status = "okay";
>   };
>   
> +&i2c3 {
> +	clock-frequency = <1000000>;
> +
> +	status = "okay";
> +
> +	nfc@28 {
> +		compatible = "nxp,pn547", "nxp,nxp-nci-i2c";
> +		reg = <0x28>;
> +
> +		interrupts-extended = <&tlmm 63 IRQ_TYPE_EDGE_RISING>;
> +
> +		enable-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;
> +		firmware-gpios = <&tlmm 62 GPIO_ACTIVE_HIGH>;
> +
> +		pinctrl-0 = <&nfc_default>;
> +		pinctrl-names = "default";
> +	};
> +};
> +
>   &ipa {
>   	status = "okay";
>   };
> @@ -551,6 +570,11 @@ &qupv3_id_1 {
>   	status = "okay";
>   };
>   
> +&qup_i2c3_default {
> +	drive-strength = <2>;
> +	bias-disable;
> +};
> +
>   &qup_uart9_rx {
>   	drive-strength = <2>;
>   	bias-pull-up;
> @@ -609,6 +633,13 @@ sd_card_det_n: sd-card-det-n-state {
>   		function = "gpio";
>   		bias-pull-up;
>   	};
> +
> +	nfc_default: nfc-default-state {
> +		pins = "gpio12", "gpio62", "gpio63";

if you want to, you could make it more descriptive with -pins,

see

https://lore.kernel.org/all/20260902-sdm670-sargo-nfc-v1-2-bed1cbbffc46@ixit.cz/

David

> +		function = "gpio";
> +		drive-strength = <6>;
> +		bias-pull-up;
> +	};
>   };
>   
>   &uart6 {
> 
> ---
> base-commit: 32b6ef9a5d0eca44f9cd91f52f4faa89f145a0de
> change-id: 20260902-sdm845-lg-judy-nfc-5f9e5775393d
> 
> Best regards,
Re: [PATCH] arm64: dts: qcom: sdm845-lg: Enable NFC
Posted by Konrad Dybcio 3 weeks, 1 day ago
On 9/3/26 4:03 AM, Paul Sajna wrote:
> Add the i2c and tlmm nodes to support the NXP PN547 NFC chip
> 
> Downstream dtsi for reference:
> https://github.com/LineageOS/android_kernel_lge_sdm845/blob/lineage-22.2/arch/arm64/boot/dts/lge/sdm845-judy/sdm845-judyln_lao_com/sdm845-judyln_lao_com-nfc.dtsi
> 
> Signed-off-by: Paul Sajna <sajattack@postmarketos.org>
> ---

[...]

> +	nfc_default: nfc-default-state {
> +		pins = "gpio12", "gpio62", "gpio63";
> +		function = "gpio";
> +		drive-strength = <6>;
> +		bias-pull-up;

active-high pins and pull-ups don't really go well together, please
verify that

Konrad
Re: [PATCH] arm64: dts: qcom: sdm845-lg: Enable NFC
Posted by Paul Sajna 2 weeks, 5 days ago
On 2026-09-03 1:10 a.m., Konrad Dybcio wrote:
> On 9/3/26 4:03 AM, Paul Sajna wrote:
>> Add the i2c and tlmm nodes to support the NXP PN547 NFC chip
>>
>> Downstream dtsi for reference:
>> https://github.com/LineageOS/android_kernel_lge_sdm845/blob/lineage-22.2/arch/arm64/boot/dts/lge/sdm845-judy/sdm845-judyln_lao_com/sdm845-judyln_lao_com-nfc.dtsi
>>
>> Signed-off-by: Paul Sajna <sajattack@postmarketos.org>
>> ---
> 
> [...]
> 
>> +	nfc_default: nfc-default-state {
>> +		pins = "gpio12", "gpio62", "gpio63";
>> +		function = "gpio";
>> +		drive-strength = <6>;
>> +		bias-pull-up;
> 
> active-high pins and pull-ups don't really go well together, please
> verify that
> 
> Konrad

Downstream decompile sez

nfc {

				nfc_int_active {
					phandle = <0x46a>;

					config {
						pins = "gpio63";
						drive-strength = <0x02>;
						bias-pull-up;
					};

					mux {
						pins = "gpio63";
						function = "gpio";
					};
				};

				nfc_enable_suspend {
					phandle = <0x46d>;

					config {
						pins = "gpio12", "gpio62", "gpio116";
						bias-disable;
						drive-strength = <0x02>;
					};

					mux {
						pins = "gpio12", "gpio62", "gpio116";
						function = "gpio";
					};
				};

				nfc_enable_active {
					phandle = <0x46c>;

					config {
						pins = "gpio12", "gpio62", "gpio116";
						drive-strength = <0x02>;
						bias-pull-up;
					};

					mux {
						pins = "gpio12", "gpio62", "gpio116";
						function = "gpio";
					};
				};

				nfc_int_suspend {
					phandle = <0x46b>;

					config {
						pins = "gpio63";
						drive-strength = <0x02>;
						bias-pull-up;
					};

					mux {
						pins = "gpio63";
						function = "gpio";
					};
				};
			};



-- 
Hal: They're going for the kernel!
Margo: Colonel Who?
Re: [PATCH] arm64: dts: qcom: sdm845-lg: Enable NFC
Posted by Paul Sajna 2 weeks, 5 days ago
On 2026-09-06 11:13 a.m., Paul Sajna wrote:
> On 2026-09-03 1:10 a.m., Konrad Dybcio wrote:
>> On 9/3/26 4:03 AM, Paul Sajna wrote:
>>> Add the i2c and tlmm nodes to support the NXP PN547 NFC chip
>>>
>>> Downstream dtsi for reference:
>>> https://github.com/LineageOS/android_kernel_lge_sdm845/blob/ 
>>> lineage-22.2/arch/arm64/boot/dts/lge/sdm845-judy/sdm845- 
>>> judyln_lao_com/sdm845-judyln_lao_com-nfc.dtsi
>>>
>>> Signed-off-by: Paul Sajna <sajattack@postmarketos.org>
>>> ---
>>
>> [...]
>>
>>> +    nfc_default: nfc-default-state {
>>> +        pins = "gpio12", "gpio62", "gpio63";
>>> +        function = "gpio";
>>> +        drive-strength = <6>;
>>> +        bias-pull-up;
>>
>> active-high pins and pull-ups don't really go well together, please
>> verify that
>>
>> Konrad
> 
> Downstream decompile sez
> 
> nfc {
> 
>                  nfc_int_active {
>                      phandle = <0x46a>;
> 
>                      config {
>                          pins = "gpio63";
>                          drive-strength = <0x02>;
>                          bias-pull-up;
>                      };
> 
>                      mux {
>                          pins = "gpio63";
>                          function = "gpio";
>                      };
>                  };
> 
>                  nfc_enable_suspend {
>                      phandle = <0x46d>;
> 
>                      config {
>                          pins = "gpio12", "gpio62", "gpio116";
>                          bias-disable;
>                          drive-strength = <0x02>;
>                      };
> 
>                      mux {
>                          pins = "gpio12", "gpio62", "gpio116";
>                          function = "gpio";
>                      };
>                  };
> 
>                  nfc_enable_active {
>                      phandle = <0x46c>;
> 
>                      config {
>                          pins = "gpio12", "gpio62", "gpio116";
>                          drive-strength = <0x02>;
>                          bias-pull-up;
>                      };
> 
>                      mux {
>                          pins = "gpio12", "gpio62", "gpio116";
>                          function = "gpio";
>                      };
>                  };
> 
>                  nfc_int_suspend {
>                      phandle = <0x46b>;
> 
>                      config {
>                          pins = "gpio63";
>                          drive-strength = <0x02>;
>                          bias-pull-up;
>                      };
> 
>                      mux {
>                          pins = "gpio63";
>                          function = "gpio";
>                      };
>                  };
>              };
> 
> 
> 

Also active high (0x00)

pn547@28 {
	compatible = "nxp,pn547";
	nxp,i2c-pull-up = <0x01>;
	nxp,gpio_irq = <0x34 0x3f 0x00>;
	nxp,gpio_ven = <0x34 0x0c 0x00>;
	nxp,gpio_mode = <0x34 0x3e 0x00>;
	nxp,gpio_scl = <0x34 0x2a 0x00>;
	nxp,gpio_sda = <0x34 0x29 0x00>;
	status = "ok";
	interrupt-parent = <0x34>;
	interrupts = <0x3f 0x00>;
	reg = <0x28>;
	qcom,clk-src = "BBCLK2";
	interrupt-names = "nfc_irq";
};

-- 
Hal: They're going for the kernel!
Margo: Colonel Who?