[openwrt/openwrt] ramips: enable LED button for TP-Link EC330-G5u v1
LEDE Commits
lede-commits at lists.infradead.org
Thu Jun 8 08:28:56 PDT 2023
chunkeey pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/91221d9e741abaad6c1342b24139ae72c24e28f4
commit 91221d9e741abaad6c1342b24139ae72c24e28f4
Author: Mikhail Zhilkin <csharper2005 at gmail.com>
AuthorDate: Sat Jun 3 08:37:54 2023 +0000
ramips: enable LED button for TP-Link EC330-G5u v1
The device already has LED push button (KEY_LIGHTS_TOGGLE)
and exported GPIO control "led-light". This commit adds
button handler script for switching on/off all device LEDs.
Signed-off-by: Mikhail Zhilkin <csharper2005 at gmail.com>
Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
(cherry picked from commit d955b41275eaf93b7600f8eb7d706f40302f26c2)
---
.../ramips/mt7621/base-files/etc/rc.button/lights_toggle | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/target/linux/ramips/mt7621/base-files/etc/rc.button/lights_toggle b/target/linux/ramips/mt7621/base-files/etc/rc.button/lights_toggle
new file mode 100755
index 0000000000..c008b633a4
--- /dev/null
+++ b/target/linux/ramips/mt7621/base-files/etc/rc.button/lights_toggle
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+[[ "${ACTION}" = "released" ]] || exit 0
+
+. /lib/functions.sh
+
+case "$(board_name)" in
+tplink,ec330-g5u-v1)
+ led_light="/sys/class/gpio/led-light/value"
+ echo "$((!$(cat $led_light)))" > "$led_light"
+;;
+ *)
+;;
+esac
+
+return 0
More information about the lede-commits
mailing list