lantiq: remove lantiq_board_model, it is unused
[openwrt/openwrt.git] / target / linux / lantiq / base-files / lib / functions / lantiq.sh
index ca52d08a60f396954175f149d28b706745b376b7..d9758f50f6b9b984142e06685be98db4f787e2a3 100644 (file)
@@ -1,9 +1,17 @@
 #!/bin/sh
 
-lantiq_board_id() {
-       grep "^system type" /proc/cpuinfo | sed "s/system type.*: \(.*\)/\1/g" | sed "s/.* - \(.*\) - .*/\1/g"
+lantiq_get_dt_led() {
+       local label
+       local ledpath
+       local basepath="/sys/firmware/devicetree/base"
+       local nodepath="$basepath/aliases/led-$1"
+
+       [ -f "$nodepath" ] && ledpath=$(cat "$nodepath")
+       [ -n "$ledpath" ] && label=$(cat "$basepath$ledpath/label")
+
+       echo "$label"
 }
 
-lantiq_board_name() {
-       grep "^system type" /proc/cpuinfo | sed "s/system type.*: \(.*\)/\1/g" | sed "s/.* - \(.*\)/\1/g"
+lantiq_is_vdsl_system() {
+       grep -qE "system type.*: (VR9|xRX200)" /proc/cpuinfo
 }