mirror of https://github.com/hak5/openwrt.git
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>
parent
1974ad5a96
commit
f7c1d9c8a5
|
@ -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
|
|
@ -432,7 +432,7 @@
|
||||||
|
|
||||||
sdcard {
|
sdcard {
|
||||||
label = "SDCard inserted";
|
label = "SDCard inserted";
|
||||||
gpios = <&GPIO0 7 0>;
|
gpios = <&GPIO0 7 1>;
|
||||||
linux,code = <0x101>; /* BTN_1 */
|
linux,code = <0x101>; /* BTN_1 */
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue