summaryrefslogtreecommitdiff
path: root/package/base-files/files/lib/functions/uci-defaults.sh
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2016-05-31 14:35:24 +0200
committerJo-Philipp Wich <jo@mein.io>2016-06-08 00:31:09 +0200
commit07f03d08335aca0914059425a29d708e5490846e (patch)
treea5f28c6c575d7ec7cb26f9142757e0bbfd688d27 /package/base-files/files/lib/functions/uci-defaults.sh
parent197c32e7bd7aba8bbc984841302c6e9704b99c1e (diff)
downloadmtk-20170518-07f03d08335aca0914059425a29d708e5490846e.zip
mtk-20170518-07f03d08335aca0914059425a29d708e5490846e.tar.gz
mtk-20170518-07f03d08335aca0914059425a29d708e5490846e.tar.bz2
base-files: support port_state LED types in board.d
Add support for handling port_state LEDs as used by ADM5120. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'package/base-files/files/lib/functions/uci-defaults.sh')
-rwxr-xr-xpackage/base-files/files/lib/functions/uci-defaults.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh
index b097fba..8c95437 100755
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -432,6 +432,25 @@ ucidef_set_led_switch() {
json_select ..
}
+ucidef_set_led_portstate() {
+ local cfg="led_$1"
+ local name="$2"
+ local sysfs="$3"
+ local port_state="$4"
+
+ json_select_object led
+
+ json_select_object "$1"
+ json_add_string name "$name"
+ json_add_string type portstate
+ json_add_string sysfs "$sysfs"
+ json_add_string trigger port_state
+ json_add_string port_state "$port_state"
+ json_select ..
+
+ json_select ..
+}
+
ucidef_set_led_default() {
local cfg="led_$1"
local name="$2"