since buttons are associated with GPIO, we can do the export wps gpio using its number
→ In mt7988a-bananapi-bpi-r4-nand.dts file, we can see WPS is defined with 14
wps {
label = "wps";
linux,code = <KEY_WPS_BUTTON>;
gpios = <&pio 14 GPIO_ACTIVE_LOW>;
};
root@Filogic-GW:~# cd /sys/class/gpio/
export gpiochip428/ unexport
→ Here by using 14+428=442, 428 (gpiochip428 refers to a GPIO controller that manages GPIO pins, starting from GPIO number 428.)
→ export the WPS pin number
root@Filogic-GW:/sys/class/gpio# echo 442 > /sys/class/gpio/export
root@Filogic-GW:/sys/class/gpio/gpio442# cat value
1
→ Whenever we press the WPS, this gpio442 value is changed to 0
root@Filogic-GW:/sys/class/gpio/gpio442# cat value
0 |