lantiq: set up DSL front-end GPIOs if they exist
authorThomas Nixon <tom@tomn.co.uk>
Sun, 2 Jul 2017 12:33:00 +0000 (13:33 +0100)
committerMathias Kresin <dev@kresin.me>
Fri, 7 Jul 2017 05:13:24 +0000 (07:13 +0200)
This is necessary for devices using the PSB80108/VRX220LD front-end
(currently only known on the Netgear DM200).

Signed-off-by: Thomas Nixon <tom@tomn.co.uk>
package/network/config/ltq-vdsl-app/files/dsl_control

index c659d50e1b8d2fa5c98a3afc666626b4ba767124..7406fe1c0c923d693987de8e820ac5d00c0c82a7 100644 (file)
@@ -225,6 +225,20 @@ start_service() {
                ;;
        esac
 
+       local annexgpio="/sys/class/gpio/annex"
+       if [ -d "${annexgpio}a" ] && [ -d "${annexgpio}b" ]; then
+               case "${annex}" in
+                       a*|l*|m*)
+                               echo 1 > "${annexgpio}a/value"
+                               echo 0 > "${annexgpio}b/value"
+                               ;;
+                       b*|j*)
+                               echo 0 > "${annexgpio}a/value"
+                               echo 1 > "${annexgpio}b/value"
+                               ;;
+               esac
+       fi
+
        if [ -z "${firmware}" ]; then
                # search for the firmware provided by dsl-vrx200-firmware-xdsl-*
                if grep -qE "system type.*: (VR9|xRX200)" /proc/cpuinfo; then