<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openwrt/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c, branch master</title>
<subtitle>OpenWrt Source Repository</subtitle>
<id>http://x-nagi.com/cgit/openwrt/atom?h=master</id>
<link rel='self' href='http://x-nagi.com/cgit/openwrt/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/openwrt/'/>
<updated>2023-05-18T15:11:43Z</updated>
<entry>
<title>gpio-button-hotplug: do not error on interrupt attached keys</title>
<updated>2023-05-18T15:11:43Z</updated>
<author>
<name>Tim Harvey</name>
<email>tharvey@gateworks.com</email>
</author>
<published>2023-02-28T00:56:25Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/openwrt/commit/?id=23845fa10bc135bfc7fd4380948b5965b9d20cb5'/>
<id>urn:sha1:23845fa10bc135bfc7fd4380948b5965b9d20cb5</id>
<content type='text'>
The Linux gpio-keys driver bindings allow for GPIO attached or interrupt
attached keys. Currently if an interrupt attached key is encountered
gpio_keys_button_probe() will fail due to not being able to get a gpio
descriptor:
gpio-keys: probe of gpio-keys failed with error -2

Skip the failure in the case of interrupt attached keys to resolve this.

Signed-off-by: Tim Harvey &lt;tharvey@gateworks.com&gt;
</content>
</entry>
<entry>
<title>gpio-button-hotplug: fix data race</title>
<updated>2022-04-09T13:56:04Z</updated>
<author>
<name>Andrey Erokhin</name>
<email>a.erokhin@inango-systems.com</email>
</author>
<published>2022-04-06T09:36:15Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/openwrt/commit/?id=1e991e09b73c309321d21b9cb706bd5139d952d2'/>
<id>urn:sha1:1e991e09b73c309321d21b9cb706bd5139d952d2</id>
<content type='text'>
bh_event_add_var can be called by multiple threads concurrently,
so it shall not use a static char buffer

Signed-off-by: Andrey Erokhin &lt;a.erokhin@inango-systems.com&gt;
</content>
</entry>
<entry>
<title>gpio-button-hotplug: convert to gpio descriptor (gpiod_) API</title>
<updated>2021-08-26T19:00:26Z</updated>
<author>
<name>Christian Lamparter</name>
<email>chunkeey@gmail.com</email>
</author>
<published>2021-08-05T13:29:25Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/openwrt/commit/?id=2b0378cf9f3163bac29fa9946b3aa1607fc03802'/>
<id>urn:sha1:2b0378cf9f3163bac29fa9946b3aa1607fc03802</id>
<content type='text'>
OpenWrt's special gpio-button-hotplug driver is still using
exclusively the legacy GPIO Subsystem gpio_ API.

While it still does work fine for most devices, upstream
linux is starting to convert platform support like that of
the APU2/3/4 to the new GPIOD LOOKUP tables that are not
supported by it.

Hence, this patch replaces the gpio_ calls present in
gpio-button-hotplug with gpiod_ equivalent wherever
it's possible. This allows the driver to use the
gpiod lookup tables and still have a fallback for
legacy platform data code that just sets button-&gt;gpio
set to the real button/switch GPIO.

As a bonus: the active_low logic is now being handled
by the linux's gpio subsystem too. Another issue that
was address is the of_handle leak in the dt parser
error path.

Tested with legacy platform data: x86_64: APU2, MX-100
Tested on OF: ATH79; MR18, APM821xx: Netgear WNDR4700,
	      RAMIPS: WL-330N3G
	      LANTIQ: AVM FritzBox 7360v1

Reported-by: Chris Blake &lt;chrisrblake93@gmail.com&gt;
Tested-by: Chris Blake &lt;chrisrblake93@gmail.com&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Christian Lamparter &lt;chunkeey@gmail.com&gt;
</content>
</entry>
<entry>
<title>gpio-button-hotplug: remove duplicate logging text</title>
<updated>2020-03-08T14:10:55Z</updated>
<author>
<name>Petr Štetiar</name>
<email>ynezz@true.cz</email>
</author>
<published>2020-03-03T11:13:29Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/openwrt/commit/?id=d1c2b25212fdfdf50bafb16cb8aa6197f780408c'/>
<id>urn:sha1:d1c2b25212fdfdf50bafb16cb8aa6197f780408c</id>
<content type='text'>
Removes one of the duplicate `gpio-keys` words found in the logs:

 gpio-keys gpio-keys: gpio-keysdoes not support key code:143

Signed-off-by: Petr Štetiar &lt;ynezz@true.cz&gt;
</content>
</entry>
<entry>
<title>gpio-button-hotplug: add volume button handling</title>
<updated>2019-08-08T13:00:59Z</updated>
<author>
<name>Chuanhong Guo</name>
<email>gch981213@gmail.com</email>
</author>
<published>2019-08-04T08:29:39Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/openwrt/commit/?id=11182349e1f31f873ebddd69d6b87dec638eaabf'/>
<id>urn:sha1:11182349e1f31f873ebddd69d6b87dec638eaabf</id>
<content type='text'>
This is used by PISEN WMB001N.

Signed-off-by: Chuanhong Guo &lt;gch981213@gmail.com&gt;
</content>
</entry>
<entry>
<title>gpio-button-hotplug: unify polled and interrupt code</title>
<updated>2019-07-14T12:02:20Z</updated>
<author>
<name>David Bauer</name>
<email>mail@david-bauer.net</email>
</author>
<published>2019-07-02T21:57:18Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/openwrt/commit/?id=27f3f493de0610c74de2ea406641b256bfcc13a9'/>
<id>urn:sha1:27f3f493de0610c74de2ea406641b256bfcc13a9</id>
<content type='text'>
This patch unifies the polled and interrupt-driven gpio_keys code
paths as well implements consistent handling of the debounce
interval set for the GPIO buttons and switches.

Hotplug events will only be fired if

1. The input changes its state and remains stable for the duration
   of the debounce interval (default is 5 ms).

2. In the initial stable (no state-change for duration of the
   debounce interval) state once the driver module gets loaded.

   Switch type inputs will always report their stable state.
   Unpressed buttons will not trigger an event for the initial
   stable state. Whereas pressed buttons will trigger an event.
   This is consistent with upstream's gpio-key driver that uses
   the input subsystem (and dont use autorepeat).

Prior to this patch, this was handled inconsistently for interrupt-based
an polled gpio-keys. Hence this patch unifies the shared logic into the
gpio_keys_handle_button() function and modify both implementations to
handle the initial state properly.

The changes described in 2. ) . can have an impact on the
failsafe trigger. Up until now, the script checked for button
state changes. On the down side, this allowed to trigger the
failsafe by releasing a held button at the right time. On the
plus side, the button's polarity setting didn't matter.

Now, the failsafe will only engage when a button was pressed
at the right moment (same as before), but now it can
theoretically also trigger when the button was pressed the
whole time the kernel booted and well into the fast-blinking
preinit phase. However, the chances that this can happen are
really small. This is because the gpio-button module is usually
up and ready even before the preinit state is entered. So, the
initial pressed button event gets lost and most devices behave
as before.

Bisectors: If this patch causes a device to permanently go into
failsafe or experience weird behavior due to inputs, please
check the following:
 - the GPIO polarity setting for the button
 - the software-debounce value

Run-tested for 'gpio-keys' and 'gpio-keys-polled' on

 - devolo WiFi pro 1200e
 - devolo WiFi pro 1750c
 - devolo WiFi pro 1750x
 - Netgear WNDR4700
 - Meraki MR24
 - RT-AC58U

Signed-off-by: David Bauer &lt;mail@david-bauer.net&gt;
Signed-off-by: Christian Lamparter &lt;chunkeey@gmail.com&gt; [further
cleanups, simplification and unification]
</content>
</entry>
<entry>
<title>gpio-button-hotplug: fix 4.19 build breakage on malta/be64</title>
<updated>2019-06-17T07:42:36Z</updated>
<author>
<name>Petr Štetiar</name>
<email>ynezz@true.cz</email>
</author>
<published>2019-06-15T09:28:05Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/openwrt/commit/?id=dd6d82112a10796dd5aa0f9e9c76ec8e77e7e211'/>
<id>urn:sha1:dd6d82112a10796dd5aa0f9e9c76ec8e77e7e211</id>
<content type='text'>
While testing 4.19 build on malta/be64, I've encountered following
error:

 gpio-button-hotplug/gpio-button-hotplug.c:529:18: error: implicit
 declaration of function 'gpio_to_desc'

which is caused by the missing include fixed by this patch.

Signed-off-by: Petr Štetiar &lt;ynezz@true.cz&gt;
</content>
</entry>
<entry>
<title>gpio-button-hotplug: gpio-keys: fix always missing first event</title>
<updated>2019-06-09T12:51:47Z</updated>
<author>
<name>Petr Štetiar</name>
<email>ynezz@true.cz</email>
</author>
<published>2019-06-04T11:14:41Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/openwrt/commit/?id=6c5bfaac84b085df813cf4e620981b94fa2a77cd'/>
<id>urn:sha1:6c5bfaac84b085df813cf4e620981b94fa2a77cd</id>
<content type='text'>
Commit afc056d7dc83 ("gpio-button-hotplug: support interrupt
properties") changed the gpio-keys interrupt handling logic in a way,
that it always misses first event, which causes issues with rc.button
scripts, so this patch restores the previous behaviour.

Fixes: afc056d7dc83 ("gpio-button-hotplug: support interrupt properties")
Reported-by: Kristian Evensen &lt;kristian.evensen@gmail.com&gt;
Tested-by: Kuan-Yi Li &lt;kyli.tw@gmail.com&gt;
Signed-off-by: Petr Štetiar &lt;ynezz@true.cz&gt;
Signed-off-by: Christian Lamparter &lt;chunkeey@gmail.com&gt; [drop state check]
</content>
</entry>
<entry>
<title>gpio-button-hotplug: fix wrong initial seen value</title>
<updated>2019-06-09T12:51:47Z</updated>
<author>
<name>Petr Štetiar</name>
<email>ynezz@true.cz</email>
</author>
<published>2019-06-03T21:08:01Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/openwrt/commit/?id=27d234a345669f0459fc3db54e618c80b20b7998'/>
<id>urn:sha1:27d234a345669f0459fc3db54e618c80b20b7998</id>
<content type='text'>
Currently the generated event contains wrong seen value, when the button
is pressed for the first time:

 rmmod gpio_button_hotplug; modprobe gpio_button_hotplug
 [ pressing the wps key immediately after modprobe ]
 gpio-keys: create event, name=wps, seen=1088, pressed=1

So this patch adds a check for this corner case and makes seen=0 if the
button is pressed for the first time.

Tested-by: Kuan-Yi Li &lt;kyli.tw@gmail.com&gt;
Signed-off-by: Petr Štetiar &lt;ynezz@true.cz&gt;
</content>
</entry>
<entry>
<title>gpio-button-hotplug: use pr_debug and pr_err</title>
<updated>2019-06-09T12:51:47Z</updated>
<author>
<name>Petr Štetiar</name>
<email>ynezz@true.cz</email>
</author>
<published>2019-06-03T20:05:41Z</published>
<link rel='alternate' type='text/html' href='http://x-nagi.com/cgit/openwrt/commit/?id=33ccfe0e149f19c9d18165fa45b9df4b0c30e881'/>
<id>urn:sha1:33ccfe0e149f19c9d18165fa45b9df4b0c30e881</id>
<content type='text'>
pr_debug can be used with dynamic debugging.

Tested-by: Kuan-Yi Li &lt;kyli.tw@gmail.com&gt;
Signed-off-by: Petr Štetiar &lt;ynezz@true.cz&gt;
</content>
</entry>
</feed>
