root@GL-AR750S:~# echo 21 > /sys/class/gpio/export
root@GL-AR750S:~# cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-31, parent: platform/ath79-gpio, ath79-gpio:
gpio-1 ( |gl-ar750s:white:powe) out lo
gpio-2 ( |reset ) in hi
gpio-5 ( |sysfs ) out hi
gpio-7 ( |gl-ar750s:white:usbp) out hi
gpio-8 ( |right ) in hi
gpio-19 ( |gl-ar750s:white:wlan) out hi
gpio-20 ( |gl-ar750s:white:wlan) out hi
gpio-21 ( |sysfs ) in hi
gpio-22 ( |sysfs ) out hi
gpiochip1: GPIOs 489-511, parent: platform/qca956x_wmac, ath9k-phy1:
gpio-490 ( |ath9k-phy1 ) in lo
重開機之後,就重新回到分配給 I2C 的設定:
root@GL-AR750S:~# cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-31, parent: platform/ath79-gpio, ath79-gpio:
gpio-1 ( |gl-ar750s:white:powe) out lo
gpio-2 ( |reset ) in hi
gpio-5 ( |sda ) in hi
gpio-7 ( |gl-ar750s:white:usbp) out hi
gpio-8 ( |right ) in hi
gpio-19 ( |gl-ar750s:white:wlan) out lo
gpio-20 ( |gl-ar750s:white:wlan) out hi
gpio-21 ( |scl ) in hi
gpiochip1: GPIOs 489-511, parent: platform/qca956x_wmac, ath9k-phy1:
gpio-490 ( |ath9k-phy1 ) in lo
# sh unbindi2c.sh
===== all gpio {5,18,21,22} set to LOW =====
gpiochip0: GPIOs 0-31, parent: platform/ath79-gpio, ath79-gpio:
gpio-1 ( |gl-ar750s:white:powe) out lo
gpio-2 ( |reset ) in hi
gpio-5 ( |sysfs ) out lo
gpio-7 ( |gl-ar750s:white:usbp) out hi
gpio-8 ( |right ) in hi
gpio-18 ( |sysfs ) out lo
gpio-19 ( |gl-ar750s:white:wlan) out lo
gpio-20 ( |gl-ar750s:white:wlan) out hi
gpio-21 ( |sysfs ) out lo
gpio-22 ( |sysfs ) out hi
gpiochip1: GPIOs 489-511, parent: platform/qca956x_wmac, ath9k-phy1:
gpio-490 ( |ath9k-phy1 ) in lo
===== all gpio {5,18,21,22} set to HIGH =====
gpiochip0: GPIOs 0-31, parent: platform/ath79-gpio, ath79-gpio:
gpio-1 ( |gl-ar750s:white:powe) out lo
gpio-2 ( |reset ) in hi
gpio-5 ( |sysfs ) out hi
gpio-7 ( |gl-ar750s:white:usbp) out hi
gpio-8 ( |right ) in hi
gpio-18 ( |sysfs ) out hi
gpio-19 ( |gl-ar750s:white:wlan) out lo
gpio-20 ( |gl-ar750s:white:wlan) out hi
gpio-21 ( |sysfs ) out hi
gpio-22 ( |sysfs ) out hi
gpiochip1: GPIOs 489-511, parent: platform/qca956x_wmac, ath9k-phy1:
gpio-490 ( |ath9k-phy1 ) in lo