aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/apm821xx/base-files/etc
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@googlemail.com>2016-08-30 19:42:38 +0200
committerJohn Crispin <john@phrozen.org>2016-09-08 13:40:02 +0200
commitf7c1d9c8a551dea1dfe50cbac4d84f949191887d (patch)
tree4c1cbe7e0660090e60a06c8264fb7b9c2dc28e64 /target/linux/apm821xx/base-files/etc
parent1974ad5a96c191a4697ce07d2a46b770462ff65e (diff)
downloadupstream-f7c1d9c8a551dea1dfe50cbac4d84f949191887d.tar.gz
upstream-f7c1d9c8a551dea1dfe50cbac4d84f949191887d.tar.bz2
upstream-f7c1d9c8a551dea1dfe50cbac4d84f949191887d.zip
apm821xx: detect sd-card media changes for the WNDR4700
The insertion or removal of the sd-card cannot be detected by the hardware itself. This is by design. To workaround this, for the WNDR4700 unload/load the dwc2 module in case the the special SD CARD GPIO line is low/high. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Diffstat (limited to 'target/linux/apm821xx/base-files/etc')
-rwxr-xr-xtarget/linux/apm821xx/base-files/etc/rc.button/BTN_119
1 files changed, 19 insertions, 0 deletions
diff --git a/target/linux/apm821xx/base-files/etc/rc.button/BTN_1 b/target/linux/apm821xx/base-files/etc/rc.button/BTN_1
new file mode 100755
index 0000000000..995641237b
--- /dev/null
+++ b/target/linux/apm821xx/base-files/etc/rc.button/BTN_1
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+. /lib/functions.sh
+. /lib/apm821xx.sh
+
+BOARD=$(apm821xx_board_name)
+
+if [ $BOARD == "wndr4700" ]; then
+ case "$ACTION" in
+ released)
+ rmmod dwc2
+ ;;
+ pressed)
+ modprobe dwc2
+ ;;
+ esac
+fi
+
+return 0