[v3,1/2] arm64: dts: allwinner: h616: orangepi-zero2w: add 24-pin expansion overlay

Message ID 20260923112009.1062-1-anykey196@gmail.com (mailing list archive)
State New
Headers
Series [v3,1/2] arm64: dts: allwinner: h616: orangepi-zero2w: add 24-pin expansion overlay |

Commit Message

Влад СВН Sept. 23, 2026, 11:20 a.m. UTC
The optional 24-pin expansion board carries two buttons on LRADC channel 0
and an IR receiver.  Keep them out of the base board .dts: with the board
detached the LRADC input and the IR receiver pin are not driven and float,
which can produce phantom key presses and interrupt storms.

Provide them as a devicetree overlay instead, following the existing
sun8i-orangepi-zero-interface-board.dtso approach.

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

Signed-off-by: Vladimir <anykey196@gmail.com>
---
 arch/arm64/boot/dts/allwinner/Makefile        |  2 +
 .../sun50i-h618-orangepi-zero2w-24pin.dtso    | 42 +++++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w-24pin.dtso
  

Comments

sashiko-bot@kernel.org Sept. 23, 2026, 11:28 a.m. UTC | #1
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dts: missing USB 2.0 nodes in 24-pin expansion board overlay
--

commit 1a9550663d27bb916af61d191100635d3dbfb863
Author: Vladimir <anykey196@gmail.com>

arm64: dts: allwinner: h616: orangepi-zero2w: add 24-pin expansion overlay

This adds a devicetree overlay for the optional 24-pin expansion board, which
provides two buttons on LRADC channel 0 and an IR receiver.

> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w-24pin.dtso b/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w-24pin.dtso
> new file mode 100644
> index 0000000000000..2d7e98e4b66d8
> --- /dev/null
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w-24pin.dtso

[ ... ]

> +&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";
> +};

[Severity: Medium]
Are the USB 2.0 nodes missing here?

The base board device tree (sun50i-h618-orangepi-zero2w.dts) explicitly leaves
USB 2 and 3 disabled, expecting them to be enabled by an overlay. Without
references to &ehci2, &ehci3, &ohci2, and &ohci3, the physical USB ports on the
24-pin expansion board will remain disabled and non-functional when this
overlay is applied.

Could these nodes be added so the expansion board is fully supported?
  
Andre Przywara Sept. 23, 2026, 11:56 a.m. UTC | #2
Hi Vladimir,

thanks for your patches, but please do not send new revisions that 
quickly! The kernel doc says to leave *at least* 24 hours between 
respins, but I would wait even longer: we are all humans, mostly 
hobbyists, so please give all the reviewers some time to have a look!

Thanks,
Andre

On 9/23/26 13:20, Vladimir wrote:
> The optional 24-pin expansion board carries two buttons on LRADC channel 0
> and an IR receiver.  Keep them out of the base board .dts: with the board
> detached the LRADC input and the IR receiver pin are not driven and float,
> which can produce phantom key presses and interrupt storms.
> 
> Provide them as a devicetree overlay instead, following the existing
> sun8i-orangepi-zero-interface-board.dtso approach.
> 
> Tested on: OrangePi Zero 2W (Allwinner H618) with the 24-pin expansion board.
> 
> Signed-off-by: Vladimir <anykey196@gmail.com>
> ---
>   arch/arm64/boot/dts/allwinner/Makefile        |  2 +
>   .../sun50i-h618-orangepi-zero2w-24pin.dtso    | 42 +++++++++++++++++++
>   2 files changed, 44 insertions(+)
>   create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w-24pin.dtso
> 
> diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
> index d1f768dd646..e4576030276 100644
> --- a/arch/arm64/boot/dts/allwinner/Makefile
> +++ b/arch/arm64/boot/dts/allwinner/Makefile
> @@ -57,6 +57,8 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb
>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-x96-mate.dtb
>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-longanpi-3h.dtb
>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-orangepi-zero2w.dtb
> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-orangepi-zero2w-24pin.dtb
> +sun50i-h618-orangepi-zero2w-24pin-dtbs := sun50i-h618-orangepi-zero2w.dtb sun50i-h618-orangepi-zero2w-24pin.dtbo
>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-orangepi-zero3.dtb
>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-transpeed-8k618-t.dtb
>   dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-yuzukihd-chameleon.dtb
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w-24pin.dtso b/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w-24pin.dtso
> new file mode 100644
> index 00000000000..2d7e98e4b66
> --- /dev/null
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w-24pin.dtso
> @@ -0,0 +1,42 @@
> +// SPDX-License-Identifier: (GPL-2.0-or-later OR X11)
> +/*
> + * Device tree overlay for the Orange Pi Zero 2W 24-pin expansion board.
> + *
> + * The expansion board provides two buttons wired to LRADC channel 0 and an
> + * IR receiver.  These are only present when the board is attached, so they
> + * are deliberately kept out of the base .dts: on a bare board the LRADC
> + * input and the IR receiver pin are not driven and float, which can cause
> + * phantom key presses and interrupt storms.
> + *
> + * Apply on top of:
> + *   arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w.dts
> + */
> +
> +/dts-v1/;
> +/plugin/;
> +
> +#include <dt-bindings/input/input.h>
> +
> +&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";
> +};
  

Patch

diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
index d1f768dd646..e4576030276 100644
--- a/arch/arm64/boot/dts/allwinner/Makefile
+++ b/arch/arm64/boot/dts/allwinner/Makefile
@@ -57,6 +57,8 @@  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-x96-mate.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-longanpi-3h.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-orangepi-zero2w.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-orangepi-zero2w-24pin.dtb
+sun50i-h618-orangepi-zero2w-24pin-dtbs := sun50i-h618-orangepi-zero2w.dtb sun50i-h618-orangepi-zero2w-24pin.dtbo
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-orangepi-zero3.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-transpeed-8k618-t.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-yuzukihd-chameleon.dtb
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w-24pin.dtso b/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w-24pin.dtso
new file mode 100644
index 00000000000..2d7e98e4b66
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w-24pin.dtso
@@ -0,0 +1,42 @@ 
+// SPDX-License-Identifier: (GPL-2.0-or-later OR X11)
+/*
+ * Device tree overlay for the Orange Pi Zero 2W 24-pin expansion board.
+ *
+ * The expansion board provides two buttons wired to LRADC channel 0 and an
+ * IR receiver.  These are only present when the board is attached, so they
+ * are deliberately kept out of the base .dts: on a bare board the LRADC
+ * input and the IR receiver pin are not driven and float, which can cause
+ * phantom key presses and interrupt storms.
+ *
+ * Apply on top of:
+ *   arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w.dts
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/input/input.h>
+
+&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";
+};