Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
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


WPS Block diagram