All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] arm64: dts: qcom: sdm845-oneplus-common: add PN553 NFC
@ 2023-03-07 18:59 Gergo Koteles
  2023-03-07 19:02 ` Konrad Dybcio
  0 siblings, 1 reply; 4+ messages in thread
From: Gergo Koteles @ 2023-03-07 18:59 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel, phone-devel, Gergo Koteles

The OnePlus 6/6T both have a NQ330 (PN553 + P73N2M0).
The PN533 supported by the nxp-nci-i2c driver in mainline.
It detects/reads NFC tags using "nfctool".

Signed-off-by: Gergo Koteles <soyer@irl.hu>
---
 .../boot/dts/qcom/sdm845-oneplus-common.dtsi  | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
index 64638ea94db7..5e45801031d8 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
@@ -380,6 +380,24 @@ zap-shader {
 	};
 };
 
+&i2c3 {
+	clock-frequency = <400000>;
+	status = "okay";
+
+	nfc@28 {
+		compatible = "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_int_active &nfc_enable_active &nfc_firmware_active>;
+		pinctrl-names = "default";
+	};
+};
+
 &i2c10 {
 	status = "okay";
 	clock-frequency = <100000>;
@@ -753,6 +771,27 @@ &usb_1_hsphy {
 &tlmm {
 	gpio-reserved-ranges = <0 4>, <81 4>;
 
+	nfc_int_active: nfc-int-active-state {
+		pins = "gpio63";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
+	nfc_enable_active: nfc-enable-active-state {
+		pins = "gpio12";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
+	nfc_firmware_active: nfc-firmware-active-state {
+		pins = "gpio62";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
 	tri_state_key_default: tri-state-key-default-state {
 		pins = "gpio40", "gpio42", "gpio26";
 		function = "gpio";
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] arm64: dts: qcom: sdm845-oneplus-common: add PN553 NFC
  2023-03-07 18:59 [PATCH v2] arm64: dts: qcom: sdm845-oneplus-common: add PN553 NFC Gergo Koteles
@ 2023-03-07 19:02 ` Konrad Dybcio
  2023-03-07 19:04   ` Gergo Koteles
  0 siblings, 1 reply; 4+ messages in thread
From: Konrad Dybcio @ 2023-03-07 19:02 UTC (permalink / raw)
  To: Gergo Koteles, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel, phone-devel



On 7.03.2023 19:59, Gergo Koteles wrote:
> The OnePlus 6/6T both have a NQ330 (PN553 + P73N2M0).
> The PN533 supported by the nxp-nci-i2c driver in mainline.
> It detects/reads NFC tags using "nfctool".
> 
> Signed-off-by: Gergo Koteles <soyer@irl.hu>
> ---
Next time include a changelog below this --- line detailing
what changed between revisions.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  .../boot/dts/qcom/sdm845-oneplus-common.dtsi  | 39 +++++++++++++++++++
>  1 file changed, 39 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> index 64638ea94db7..5e45801031d8 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
> @@ -380,6 +380,24 @@ zap-shader {
>  	};
>  };
>  
> +&i2c3 {
> +	clock-frequency = <400000>;
> +	status = "okay";
> +
> +	nfc@28 {
> +		compatible = "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_int_active &nfc_enable_active &nfc_firmware_active>;
> +		pinctrl-names = "default";
> +	};
> +};
> +
>  &i2c10 {
>  	status = "okay";
>  	clock-frequency = <100000>;
> @@ -753,6 +771,27 @@ &usb_1_hsphy {
>  &tlmm {
>  	gpio-reserved-ranges = <0 4>, <81 4>;
>  
> +	nfc_int_active: nfc-int-active-state {
> +		pins = "gpio63";
> +		function = "gpio";
> +		drive-strength = <2>;
> +		bias-pull-up;
> +	};
> +
> +	nfc_enable_active: nfc-enable-active-state {
> +		pins = "gpio12";
> +		function = "gpio";
> +		drive-strength = <2>;
> +		bias-pull-up;
> +	};
> +
> +	nfc_firmware_active: nfc-firmware-active-state {
> +		pins = "gpio62";
> +		function = "gpio";
> +		drive-strength = <2>;
> +		bias-pull-up;
> +	};
> +
>  	tri_state_key_default: tri-state-key-default-state {
>  		pins = "gpio40", "gpio42", "gpio26";
>  		function = "gpio";

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] arm64: dts: qcom: sdm845-oneplus-common: add PN553 NFC
  2023-03-07 19:02 ` Konrad Dybcio
@ 2023-03-07 19:04   ` Gergo Koteles
  2023-03-08 18:20     ` Gergo Koteles
  0 siblings, 1 reply; 4+ messages in thread
From: Gergo Koteles @ 2023-03-07 19:04 UTC (permalink / raw)
  To: Konrad Dybcio, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel, phone-devel

On 2023. 03. 07. 20:02, Konrad Dybcio wrote:
> 
> 
> On 7.03.2023 19:59, Gergo Koteles wrote:
>> The OnePlus 6/6T both have a NQ330 (PN553 + P73N2M0).
>> The PN533 supported by the nxp-nci-i2c driver in mainline.
>> It detects/reads NFC tags using "nfctool".
>>
>> Signed-off-by: Gergo Koteles <soyer@irl.hu>
>> ---
> Next time include a changelog below this --- line detailing
> what changed between revisions.
> 
Okey. Thanks for the suggestion and the review.

> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> 
> Konrad
>>   .../boot/dts/qcom/sdm845-oneplus-common.dtsi  | 39 +++++++++++++++++++
>>   1 file changed, 39 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
>> index 64638ea94db7..5e45801031d8 100644
>> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
>> @@ -380,6 +380,24 @@ zap-shader {
>>   	};
>>   };
>>   
>> +&i2c3 {
>> +	clock-frequency = <400000>;
>> +	status = "okay";
>> +
>> +	nfc@28 {
>> +		compatible = "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_int_active &nfc_enable_active &nfc_firmware_active>;
>> +		pinctrl-names = "default";
>> +	};
>> +};
>> +
>>   &i2c10 {
>>   	status = "okay";
>>   	clock-frequency = <100000>;
>> @@ -753,6 +771,27 @@ &usb_1_hsphy {
>>   &tlmm {
>>   	gpio-reserved-ranges = <0 4>, <81 4>;
>>   
>> +	nfc_int_active: nfc-int-active-state {
>> +		pins = "gpio63";
>> +		function = "gpio";
>> +		drive-strength = <2>;
>> +		bias-pull-up;
>> +	};
>> +
>> +	nfc_enable_active: nfc-enable-active-state {
>> +		pins = "gpio12";
>> +		function = "gpio";
>> +		drive-strength = <2>;
>> +		bias-pull-up;
>> +	};
>> +
>> +	nfc_firmware_active: nfc-firmware-active-state {
>> +		pins = "gpio62";
>> +		function = "gpio";
>> +		drive-strength = <2>;
>> +		bias-pull-up;
>> +	};
>> +
>>   	tri_state_key_default: tri-state-key-default-state {
>>   		pins = "gpio40", "gpio42", "gpio26";
>>   		function = "gpio";


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] arm64: dts: qcom: sdm845-oneplus-common: add PN553 NFC
  2023-03-07 19:04   ` Gergo Koteles
@ 2023-03-08 18:20     ` Gergo Koteles
  0 siblings, 0 replies; 4+ messages in thread
From: Gergo Koteles @ 2023-03-08 18:20 UTC (permalink / raw)
  To: Konrad Dybcio, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel, phone-devel

On 2023. 03. 07. 20:04, Gergo Koteles wrote:
> On 2023. 03. 07. 20:02, Konrad Dybcio wrote:
>>
>>
>> On 7.03.2023 19:59, Gergo Koteles wrote:
>>> The OnePlus 6/6T both have a NQ330 (PN553 + P73N2M0).
>>> The PN533 supported by the nxp-nci-i2c driver in mainline.
>>> It detects/reads NFC tags using "nfctool".
>>>
>>> Signed-off-by: Gergo Koteles <soyer@irl.hu>
>>> ---
>> Next time include a changelog below this --- line detailing
>> what changed between revisions.
>>
> Okey. Thanks for the suggestion and the review.
> 
>> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>
>> Konrad
>>>   .../boot/dts/qcom/sdm845-oneplus-common.dtsi  | 39 +++++++++++++++++++
>>>   1 file changed, 39 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi 
>>> b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
>>> index 64638ea94db7..5e45801031d8 100644
>>> --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
>>> +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
>>> @@ -380,6 +380,24 @@ zap-shader {
>>>       };
>>>   };
>>> +&i2c3 {
>>> +    clock-frequency = <400000>;
>>> +    status = "okay";
>>> +
>>> +    nfc@28 {
>>> +        compatible = "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_int_active &nfc_enable_active 
>>> &nfc_firmware_active>;
>>> +        pinctrl-names = "default";
>>> +    };
>>> +};
>>> +
>>>   &i2c10 {
>>>       status = "okay";
>>>       clock-frequency = <100000>;
>>> @@ -753,6 +771,27 @@ &usb_1_hsphy {
>>>   &tlmm {
>>>       gpio-reserved-ranges = <0 4>, <81 4>;
>>> +    nfc_int_active: nfc-int-active-state {
>>> +        pins = "gpio63";
>>> +        function = "gpio";
>>> +        drive-strength = <2>;
>>> +        bias-pull-up;
>>> +    };
>>> +
>>> +    nfc_enable_active: nfc-enable-active-state {
>>> +        pins = "gpio12";
>>> +        function = "gpio";
>>> +        drive-strength = <2>;
>>> +        bias-pull-up;
>>> +    };
>>> +
>>> +    nfc_firmware_active: nfc-firmware-active-state {
>>> +        pins = "gpio62";
>>> +        function = "gpio";
>>> +        drive-strength = <2>;
>>> +        bias-pull-up;
>>> +    };
>>> +
>>>       tri_state_key_default: tri-state-key-default-state {
>>>           pins = "gpio40", "gpio42", "gpio26";
>>>           function = "gpio";
> 
Hi,

Please disregard this patch. Although it can detect the tags and the 
tags type, the full readout does not work. I will send a new version 
when I figure out what's wrong.

Thanks


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-08 18:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-07 18:59 [PATCH v2] arm64: dts: qcom: sdm845-oneplus-common: add PN553 NFC Gergo Koteles
2023-03-07 19:02 ` Konrad Dybcio
2023-03-07 19:04   ` Gergo Koteles
2023-03-08 18:20     ` Gergo Koteles

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.