Did something change with gpio system from 4.14 to 4.19?

I upgraded my system from 4.14 to 4.19 ipq806x (EA8500) and I noticed a differents in the gpio system.

I have soldered a reed switch in parallel to the WPS button.
To change the events for button pressed and released I change the file /etc/rc.button/wps



source /lib/functions.sh

do_button () {

    local button
    local action
    local handler
    local min
    local max

    config_get button "${1}" button
    config_get action "${1}" action
    config_get handler "${1}" handler
    config_get min "${1}" min
    config_get max "${1}" max

   echo "${1} action = ${ACTION} handler =  ${handler} $(date +%T) ${SEEN}" >> /tmp/Button_test

    [ "${ACTION}" = "${action}" -a "${BUTTON}" = "${button}" -a -n "${handler}" ] && {
        [ -z "${min}" -o -z "${max}" ] && eval ${handler}
        [ -n "${min}" -a -n "${max}" ] && {
            [ "${min}" -le "${SEEN}" -a "${max}" -ge "${SEEN}" ] && eval ${handler}
config_load system

config_foreach do_button button

return 0

to get an action I added in /etc/config/system this section

config button
        option button 'wps'
        option action 'pressed'
        option handler '/usr/bin/temperature/wps_pressed.sh'

config button
        option button 'wps'
        option action 'released'
        option handler '/usr/bin/temperature/wps_released.sh'

Everything worked fine until I upgraded to 4.19.
When the WPS button is pressed I loose access to my router (bytheway I'm using it with a wireless bridged setup away from my wired network) So it could be that only the wifi get's turned off.

By connecting a serial connection I still have access to the router so the router is not locked up.
How should I start troubleshooting from here.
I assume that the wps function is somewhere called and the wifi gets turned off. How could I verify this and eliminate this?


Just a general question can I compile the older kernel version for now with the latest snap shot by changing this in the File



Will this work. Ifnot I could continue using a snapshot from December 2019 which still has Kernel version 4.14

I guess I can answer my own question
changing the
will compile it with 4.14 kernel

The solution to stay on 4.19 was to take the wps button out in the **qcom-ipq8064-ea8500.dts** file.
Now it works for me.
I just used the gpio sysfs to look at the status

When the WPS button is pressed, the commands from the /etc/rc.button/rfkill file are executed.
rfkill can be deleted, renamed or edited for yourself.

And you will not need to edit the source.

I did this without the result I needed.
Actually wps gets executed when wps is pressed rfkill is executed when the wifi button is pressed.
It still gave me problems. The other good thing i got out of changing the source is that I can actually check the status in /sys/class/gpio/gpio508/value
which helps me. But thanks for the reply

I just found this


Maybe this is what I noticed ?

It wasn't.
That PR fixed buttons getting ignored since Linux 5.2, which was noticed after the kernel was bumped to 5.4 in ipq806x.
Buttons worked ok at same time in 4.19

1 Like