arm64: dts: allwinner: h616: orangepi-zero2w: add 24-pin expansion buttons and IR

Message ID 20260923105208.198-1-anykey196@gmail.com (mailing list archive)
State New
Headers
Series arm64: dts: allwinner: h616: orangepi-zero2w: add 24-pin expansion buttons and IR |

Commit Message

Влад СВН Sept. 23, 2026, 10:52 a.m. UTC
From: Vladnwx <vladnwx@users.noreply.github.com>

The optional 24-pin expansion board exposes two LRADC buttons and an IR
receiver. KEY1/KEY2 are on LRADC channel 0 (measured ~1.0 V / ~1.6 V) and are
wired to KEY_1 / KEY_ENTER; the IR receiver is on the SoC ir controller (PH10).

Tested on: OrangePi Zero 2W (Allwinner H618).

Signed-off-by: Vladnwx <vladnwx@users.noreply.github.com>
---
  

Comments

sashiko-bot@kernel.org Sept. 23, 2026, 10:59 a.m. UTC | #1
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] arm64: dts: unconditionally enabling optional expansion board risks phantom inputs and IRQ storms
--

commit 51b58a06db4b29809dc98ff86ac9cae923d63f7c
Author: Vladnwx <vladnwx@users.noreply.github.com>

arm64: dts: allwinner: h616: orangepi-zero2w: add 24-pin expansion buttons and IR

This commit adds device tree nodes for the LRADC buttons and IR receiver on
the OrangePi Zero 2W. It maps the buttons to KEY_1 and KEY_ENTER and enables
both the LRADC and IR controller hardware.

> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w.dts b/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w.dts
> index ff9b40352a545..1b690e3cd041e 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w.dts
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w.dts
[ ... ]
> @@ -189,3 +190,31 @@ &usbphy {
>  	usb1_vbus-supply = <&reg_vcc5v>;
>  	status = "okay";
>  };
> +
> +/*
> + * Buttons and IR receiver on the optional 24-pin expansion board.
> + * KEY1 -> KEY_1, KEY2 -> KEY_ENTER (LRADC channel 0).
> + */
> +&lradc {
> +	vref-supply = <&reg_vcc3v3>;
> +	status = "okay";

[Severity: High]
Could unconditionally enabling the optional LRADC on the base board cause
phantom key presses? If the 24-pin expansion board is not attached, it seems
the floating LRADC pin could drift into the configured 1.0V/1.6V voltage
thresholds and trigger unexpected button presses for users out of the box.
Should this be enabled via a device tree overlay instead?

> +	wakeup-source;
> +
> +	button-1000 {
[ ... ]
> +	button-1600 {
> +		label = "KEY_ENTER";
> +		linux,code = <KEY_ENTER>;
> +		channel = <0>;
> +		voltage = <1600000>;
> +	};
> +};
> +
> +&ir {
> +	status = "okay";
> +};

[Severity: High]
Does unconditionally enabling the IR receiver risk interrupt storms? If the
optional board is missing, a floating IR RX pin lacking an internal pull-up
might pick up electrical noise and oscillate rapidly. This could severely
degrade system performance. Would it be safer to relegate this to an overlay
rather than the base device tree?
  
Влад СВН Sept. 23, 2026, 11:22 a.m. UTC | #2
Thanks for the review - you are right. The two buttons and the IR
receiver are on the optional 24-pin expansion board. With the board
detached the LRADC input and the IR receiver pin are undriven and
float, which can lead to phantom key presses and interrupt storms.

v2 drops them from the base board .dts and provides them as a
devicetree overlay (sun50i-h618-orangepi-zero2w-24pin.dtso) with a
Makefile entry, following the existing
sun8i-orangepi-zero-interface-board.dtso approach.

Tested on: OrangePi Zero 2W (Allwinner H618) with the 24-pin expansion board.


ср, 23 сент. 2026 г. в 16:11, Влад СВН <anykey196@gmail.com>:
>
> Thanks for the review - you are right. The two buttons and the IR receiver are on the optional 24-pin expansion board. With the board detached the LRADC input and the IR receiver pin are undriven and float, which can lead to phantom key presses and interrupt storms.
>
> v2 drops them from the base board .dts and provides them as a devicetree overlay (sun50i-h618-orangepi-zero2w-24pin.dtso) with a Makefile entry, following the existing sun8i-orangepi-zero-interface-board.dtso approach.
>
> Tested on: OrangePi Zero 2W (Allwinner H618) with the 24-pin expansion board.
>
> ср, 23 сент. 2026 г. в 15:59, <sashiko-bot@kernel.org>:
>>
>> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
>> - [High] arm64: dts: unconditionally enabling optional expansion board risks phantom inputs and IRQ storms
>> --
>>
>> commit 51b58a06db4b29809dc98ff86ac9cae923d63f7c
>> Author: Vladnwx <vladnwx@users.noreply.github.com>
>>
>> arm64: dts: allwinner: h616: orangepi-zero2w: add 24-pin expansion buttons and IR
>>
>> This commit adds device tree nodes for the LRADC buttons and IR receiver on
>> the OrangePi Zero 2W. It maps the buttons to KEY_1 and KEY_ENTER and enables
>> both the LRADC and IR controller hardware.
>>
>> > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w.dts b/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w.dts
>> > index ff9b40352a545..1b690e3cd041e 100644
>> > --- a/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w.dts
>> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w.dts
>> [ ... ]
>> > @@ -189,3 +190,31 @@ &usbphy {
>> >       usb1_vbus-supply = <&reg_vcc5v>;
>> >       status = "okay";
>> >  };
>> > +
>> > +/*
>> > + * Buttons and IR receiver on the optional 24-pin expansion board.
>> > + * KEY1 -> KEY_1, KEY2 -> KEY_ENTER (LRADC channel 0).
>> > + */
>> > +&lradc {
>> > +     vref-supply = <&reg_vcc3v3>;
>> > +     status = "okay";
>>
>> [Severity: High]
>> Could unconditionally enabling the optional LRADC on the base board cause
>> phantom key presses? If the 24-pin expansion board is not attached, it seems
>> the floating LRADC pin could drift into the configured 1.0V/1.6V voltage
>> thresholds and trigger unexpected button presses for users out of the box.
>> Should this be enabled via a device tree overlay instead?
>>
>> > +     wakeup-source;
>> > +
>> > +     button-1000 {
>> [ ... ]
>> > +     button-1600 {
>> > +             label = "KEY_ENTER";
>> > +             linux,code = <KEY_ENTER>;
>> > +             channel = <0>;
>> > +             voltage = <1600000>;
>> > +     };
>> > +};
>> > +
>> > +&ir {
>> > +     status = "okay";
>> > +};
>>
>> [Severity: High]
>> Does unconditionally enabling the IR receiver risk interrupt storms? If the
>> optional board is missing, a floating IR RX pin lacking an internal pull-up
>> might pick up electrical noise and oscillate rapidly. This could severely
>> degrade system performance. Would it be safer to relegate this to an overlay
>> rather than the base device tree?
>>
>> --
>> Sashiko AI review · https://sashiko.dev/#/patchset/20260923105208.198-1-anykey196@gmail.com?part=1
  
Влад СВН Sept. 23, 2026, 11:24 a.m. UTC | #3
Thanks for the review - you are right. The two buttons and the IR
receiver are on the optional 24-pin expansion board. With the board
detached the LRADC input and the IR receiver pin are undriven and
float, which can lead to phantom key presses and interrupt storms.

v2 drops them from the base board .dts and provides them as a
devicetree overlay (sun50i-h618-orangepi-zero2w-24pin.dtso) with a
Makefile entry, following the existing
sun8i-orangepi-zero-interface-board.dtso approach.

Tested on: OrangePi Zero 2W (Allwinner H618) with the 24-pin expansion board.
  
Влад СВН Sept. 23, 2026, 11:42 a.m. UTC | #4
Thanks for the review - you are right.  The two buttons and the IR receiver
are on the optional 24-pin expansion board.  With the board detached the
LRADC input and the IR receiver pin are undriven and float, which can lead to
phantom key presses and interrupt storms.

v2 drops them from the base board .dts and provides them as a devicetree
overlay (sun50i-h618-orangepi-zero2w-24pin.dtso) with a Makefile entry,
following the existing sun8i-orangepi-zero-interface-board.dtso approach.

Tested on: OrangePi Zero 2W (Allwinner H618) with the 24-pin expansion board.
  

Patch

--- a/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w.dts
@@ -10,6 +10,7 @@ 
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/leds/common.h>
 
 / {
@@ -189,3 +190,31 @@ 
 	usb1_vbus-supply = <&reg_vcc5v>;
 	status = "okay";
 };
+
+/*
+ * Buttons and IR receiver on the optional 24-pin expansion board.
+ * KEY1 -> KEY_1, KEY2 -> KEY_ENTER (LRADC channel 0).
+ */
+&lradc {
+	vref-supply = <&reg_vcc3v3>;
+	status = "okay";
+	wakeup-source;
+
+	button-1000 {
+		label = "KEY_1";
+		linux,code = <KEY_1>;
+		channel = <0>;
+		voltage = <1000000>;
+	};
+
+	button-1600 {
+		label = "KEY_ENTER";
+		linux,code = <KEY_ENTER>;
+		channel = <0>;
+		voltage = <1600000>;
+	};
+};
+
+&ir {
+	status = "okay";
+};