diff mbox series

[v4,5/8] arm64: dts: rockchip: add IR-receiver to NanoPC-T6

Message ID 20240822-friendlyelec-nanopc-t6-lts-v4-5-892aebcec0c6@linaro.org (mailing list archive)
State Superseded, archived
Headers show
Series FriendlyELEC NanoPC-T6 improvements | expand

Commit Message

Marcin Juszkiewicz Aug. 22, 2024, 1:32 p.m. UTC
FriendlyELEC NanoPC-T6 has IR receiver connected to PWM3_IR_M0 line
which ends as GPIO0_D4.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
 arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

Comments

Jonas Karlman Aug. 22, 2024, 8:59 p.m. UTC | #1
Hi Marcin,

On 2024-08-22 15:32, Marcin Juszkiewicz wrote:
> FriendlyELEC NanoPC-T6 has IR receiver connected to PWM3_IR_M0 line
> which ends as GPIO0_D4.
> 
> Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
> ---
>  arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi
> index 292022a56332..fcea11ff2af2 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi
> @@ -25,6 +25,11 @@ chosen {
>  		stdout-path = "serial2:1500000n8";
>  	};
>  
> +	ir-receiver {
> +		compatible = "gpio-ir-receiver";
> +		gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_LOW>;

I would expect to see pinctrl here that configure pin for gpio func use.

> +	};
> +
>  	leds {
>  		compatible = "gpio-leds";
>  
> @@ -228,7 +233,7 @@ &gpio0 {
>  			  "HEADER_10", "HEADER_08", "HEADER_32", "",
>  			  /* GPIO0 D0-D7 */
>  			  "", "", "", "",
> -			  "", "", "", "";
> +			  "IR receiver [PWM3_IR_M0]", "", "", "";
>  };
>  
>  &gpio1 {
> @@ -530,6 +535,13 @@ &pwm1 {
>  	status = "okay";
>  };
>  
> +/* Connected to IR Receiver */
> +&pwm3 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pwm3m0_pins>;
> +	status = "okay";
> +};

Is this really needed/correct? A pinctrl for gpio func in ir-receiver
node should be enough for the ir-receiver?

Regards,
Jonas

> +
>  &saradc {
>  	vref-supply = <&avcc_1v8_s0>;
>  	status = "okay";
>
Marcin Juszkiewicz Aug. 23, 2024, 8:22 a.m. UTC | #2
On 22.08.2024 22:59, Jonas Karlman wrote:
> Hi Marcin,
> 
> On 2024-08-22 15:32, Marcin Juszkiewicz wrote:
>> FriendlyELEC NanoPC-T6 has IR receiver connected to PWM3_IR_M0 line
>> which ends as GPIO0_D4.
>>
>> Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
>> ---
>>   arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi | 14 +++++++++++++-
>>   1 file changed, 13 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi
>> index 292022a56332..fcea11ff2af2 100644
>> --- a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi
>> +++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi
>> @@ -25,6 +25,11 @@ chosen {
>>   		stdout-path = "serial2:1500000n8";
>>   	};
>>   
>> +	ir-receiver {
>> +		compatible = "gpio-ir-receiver";
>> +		gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_LOW>;
> 
> I would expect to see pinctrl here that configure pin for gpio func use.

Thanks. I based on rk3588-friendlyelec-cm3588-nas.dts which has 
ir-receiver done this way. Will copy from rk3588-orangepi-5-plus.dts 
which is more like you describe.

Have to find a way to test it too.
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi
index 292022a56332..fcea11ff2af2 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi
@@ -25,6 +25,11 @@  chosen {
 		stdout-path = "serial2:1500000n8";
 	};
 
+	ir-receiver {
+		compatible = "gpio-ir-receiver";
+		gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_LOW>;
+	};
+
 	leds {
 		compatible = "gpio-leds";
 
@@ -228,7 +233,7 @@  &gpio0 {
 			  "HEADER_10", "HEADER_08", "HEADER_32", "",
 			  /* GPIO0 D0-D7 */
 			  "", "", "", "",
-			  "", "", "", "";
+			  "IR receiver [PWM3_IR_M0]", "", "", "";
 };
 
 &gpio1 {
@@ -530,6 +535,13 @@  &pwm1 {
 	status = "okay";
 };
 
+/* Connected to IR Receiver */
+&pwm3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pwm3m0_pins>;
+	status = "okay";
+};
+
 &saradc {
 	vref-supply = <&avcc_1v8_s0>;
 	status = "okay";