diff --git a/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-r33s.dts b/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-r33s.dts index 21dbab6d19..1d443b3e92 100644 --- a/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-r33s.dts +++ b/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-r33s.dts @@ -15,6 +15,22 @@ this = "r33s"; }; + gpio-leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&power_led_pin>; + + led-0 { + /* Mono blue power LED on GPIO2_B5 (BSP gpio77), active + * low: the old JELOS quirk wrote 1 through the legacy + * gpio sysfs to turn it off. sysfs name is blue:status. */ + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio2 RK_PB5 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + }; + builtin_gamepad: r33s_joypad { compatible = "archr-singleadc-joypad"; pinctrl-names = "default"; @@ -107,6 +123,12 @@ }; &pinctrl { + leds { + power_led_pin: power-led-pin { + rockchip,pins = <2 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + btns { btn_pins: btn-pins { rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>, diff --git a/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-r36s.dts b/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-r36s.dts index 72aff5fb19..44c6400ec0 100644 --- a/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-r36s.dts +++ b/projects/ArchR/devices/RK3326/linux/dts/rockchip/rk3326-gameconsole-r36s.dts @@ -15,6 +15,23 @@ this = "r36s"; }; + gpio-leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&power_led_pin>; + + led-0 { + /* Bicolor power LED behind a single line (BSP gpio77 = + * GPIO2_B5): driving it high lights red, low shows the + * green side, so there is no hardware "off". Exposed as + * the red half; sysfs name is red:status. */ + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio2 RK_PB5 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; + joypad: odroidgo3-joypad { compatible = "odroidgo3-joypad"; pwms = <&pwm0 0 200000000 0>; @@ -202,6 +219,12 @@ }; &pinctrl { + leds { + power_led_pin: power-led-pin { + rockchip,pins = <2 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + btns { btn_pins: btn-pins { rockchip,pins = <1 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>, diff --git a/projects/ArchR/packages/hardware/quirks/devices/Game Console R33S/001-device_config b/projects/ArchR/packages/hardware/quirks/devices/Game Console R33S/001-device_config index 243906cf13..574439fc1a 100755 --- a/projects/ArchR/packages/hardware/quirks/devices/Game Console R33S/001-device_config +++ b/projects/ArchR/packages/hardware/quirks/devices/Game Console R33S/001-device_config @@ -6,6 +6,7 @@ cat </storage/.config/profile.d/001-device_config # Device Features DEVICE_PLAYBACK_PATH_SPK="HP" DEVICE_PLAYBACK_PATH_HP="SPK" -DEVICE_PWR_LED_GPIO="77" +# Mono blue power LED (GPIO2_B5, BSP gpio77, active low): sysfs blue:status. +DEVICE_POWER_LED="blue:status" DEVICE_TEMP_SENSOR="/sys/devices/virtual/thermal/thermal_zone0/temp" EOF diff --git a/projects/ArchR/packages/hardware/quirks/devices/Game Console R33S/002-disable-led b/projects/ArchR/packages/hardware/quirks/devices/Game Console R33S/002-disable-led deleted file mode 100755 index 7e5ed7a899..0000000000 --- a/projects/ArchR/packages/hardware/quirks/devices/Game Console R33S/002-disable-led +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -# SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS) - -# Set export GPIO for Power LED -if [ ! -d "/sys/class/gpio/gpio${DEVICE_PWR_LED_GPIO}" ]; then - echo ${DEVICE_PWR_LED_GPIO} > /sys/class/gpio/export -fi - -#Disable blue led on R33S -echo out >/sys/class/gpio/gpio${DEVICE_PWR_LED_GPIO}/direction -echo 1 >/sys/class/gpio/gpio${DEVICE_PWR_LED_GPIO}/value diff --git a/projects/ArchR/packages/hardware/quirks/devices/Game Console R36S/001-device_config b/projects/ArchR/packages/hardware/quirks/devices/Game Console R36S/001-device_config index 21855399ad..86b6e3bb4d 100755 --- a/projects/ArchR/packages/hardware/quirks/devices/Game Console R36S/001-device_config +++ b/projects/ArchR/packages/hardware/quirks/devices/Game Console R36S/001-device_config @@ -6,7 +6,9 @@ cat </storage/.config/profile.d/001-device_config # Device Features DEVICE_PLAYBACK_PATH_SPK="HP" DEVICE_PLAYBACK_PATH_HP="SPK" -DEVICE_PWR_LED_GPIO="77" +# Bicolor power LED on one line (GPIO2_B5, BSP gpio77): sysfs red:status; +# brightness 1 = red, 0 = the green side. There is no hardware off. +DEVICE_POWER_LED="red:status" DEVICE_TEMP_SENSOR="/sys/devices/virtual/thermal/thermal_zone0/temp" # thermal_zone1 is the gpu-thermal IP — System Information shows the # GPU temperature alongside the CPU one when this is set. diff --git a/projects/ArchR/packages/hardware/quirks/devices/Game Console R36S/002-disable-led b/projects/ArchR/packages/hardware/quirks/devices/Game Console R36S/002-disable-led deleted file mode 100755 index 7e5ed7a899..0000000000 --- a/projects/ArchR/packages/hardware/quirks/devices/Game Console R36S/002-disable-led +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -# SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS) - -# Set export GPIO for Power LED -if [ ! -d "/sys/class/gpio/gpio${DEVICE_PWR_LED_GPIO}" ]; then - echo ${DEVICE_PWR_LED_GPIO} > /sys/class/gpio/export -fi - -#Disable blue led on R33S -echo out >/sys/class/gpio/gpio${DEVICE_PWR_LED_GPIO}/direction -echo 1 >/sys/class/gpio/gpio${DEVICE_PWR_LED_GPIO}/value diff --git a/projects/ArchR/packages/hardware/quirks/devices/R36S Clone/001-device_config b/projects/ArchR/packages/hardware/quirks/devices/R36S Clone/001-device_config index ef6fbfc575..8efdb742c8 100755 --- a/projects/ArchR/packages/hardware/quirks/devices/R36S Clone/001-device_config +++ b/projects/ArchR/packages/hardware/quirks/devices/R36S Clone/001-device_config @@ -8,6 +8,8 @@ # exactly, so this folder name MUST equal the DTS `model` string. Audio # routing and LED config are intentionally left to the working defaults. cat </storage/.config/profile.d/001-device_config +# LED nodes use color+function (no label), so sysfs is blue:power. +DEVICE_POWER_LED="blue:power" DEVICE_TEMP_SENSOR="/sys/devices/virtual/thermal/thermal_zone0/temp" DEVICE_GPU_TEMP_SENSOR="/sys/devices/virtual/thermal/thermal_zone1/temp" CONF