arm64: dts: rockchip: Fix adc-keys wiring for Orange Pi 5 family
Subsystems (2)
PATCH 1/1 arm64: dts: rockchip: Fix adc-keys wiring for Orange Pi 5 family
When working on u-boot for the Orange Pi 5 Pro it was called out that the Pro does not have a recovery button and was missing the definition for the maskrom button.
The shared rk3588s-orangepi-5.dtsi describes a "Recovery" adc-keys button on SARADC channel 1. This is correct for the Orange Pi 5 and 5B, but the Orange Pi 5 Pro schematic shows channel 1 is pulled up with no button ever wired to it, so the key can never be pressed. Each board's schematic also shows SARADC channel 0 is connected to a real, populated Maskrom button, but no board described it.
Fix this by moving the common hardware (Maskrom on channel 0) into the shared base used by all three boards, and keeping the board-specific hardware (Recovery on channel 1) only in the dtsi shared by the Orange Pi 5 and 5B, which the Pro does not include:
- rk3588s-orangepi-5.dtsi (OPi5, OPi5B, OPi5 Pro): adc-keys-0, button-maskrom on &saradc 0.
- rk3588s-orangepi-5-5b.dtsi (OPi5, OPi5B only): adc-keys-1, button-recovery on &saradc 1.
Verified against the Orange Pi 5, 5B and 5 Pro v1.2 schematics:
the Maskrom button is wired identically on all three (button -> 22R -> SARADC_IN0_BOOT, AW15, pulled up to VCCA_1V8_S0), while the Recovery button only exists as a populated pull-up with no button attached on the Pro (the board's "RESET"-silkscreened pushbutton is wired to PMIC_RESET_L, not to the SARADC).
--- .../boot/dts/rockchip/rk3588s-orangepi-5-5b.dtsi | 15 +++++++++++++++ .../boot/dts/rockchip/rk3588s-orangepi-5.dtsi | 12 ++++++------ 2 files changed, 21 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5-5b.dtsi +15 -0
@@ -4,10 +4,25 @@ * but not the Orange Pi 5 Pro. */ +#include <dt-bindings/input/input.h> #include <dt-bindings/usb/pd.h> #include "rk3588s-orangepi-5.dtsi" / { + adc-keys-1 { + compatible = "adc-keys"; + io-channels = <&saradc 1>; + io-channel-names = "buttons"; + keyup-threshold-microvolt = <1800000>; + poll-interval = <100>; + + button-recovery { + label = "Recovery"; + linux,code = <KEY_VENDOR>; + press-threshold-microvolt = <1800>; + }; + }; + aliases { ethernet0 = &gmac1; };
arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtsi +6 -6
@@ -14,17 +14,17 @@ chosen { stdout-path = "serial2:1500000n8"; }; - adc-keys { + adc-keys-0 { compatible = "adc-keys"; - io-channels = <&saradc 1>; + io-channels = <&saradc 0>; io-channel-names = "buttons"; keyup-threshold-microvolt = <1800000>; poll-interval = <100>; - button-recovery { - label = "Recovery"; - linux,code = <KEY_VENDOR>; - press-threshold-microvolt = <1800>; + button-maskrom { + label = "Mask Rom"; + linux,code = <KEY_SETUP>; + press-threshold-microvolt = <2000>; }; };
Signature · 1 line
2.56.0
Quoted 4 lines · Dennis Gilmore
When working on u-boot for the Orange Pi 5 Pro it was called out that the Pro does not have a recovery button and was missing the definition for the maskrom button.
Quoted 8 lines
The shared
rk3588s-orangepi-5.dtsidescribes a "Recovery" adc-keys button on SARADC channel 1. This is correct for the Orange Pi 5 and 5B, but the Orange Pi 5 Pro schematic shows channel 1 is pulled up with no button ever wired to it, so the key can never be pressed. Each board's schematic also shows SARADC channel 0 is connected to a real, populated Maskrom button, but no board described it.[...]
Applied, thanks!
[1/1] arm64: dts: rockchip: Fix adc-keys wiring for Orange Pi 5 family
commit: 591ff7dda0603cf21cfe3bfd7d9b1d10be8154c1
Best regards,
Signature · 1 line
Heiko Stuebner <[email protected]>