<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pm24.git/drivers/input/keyboard/gpio_keys.c, branch v6.4</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>https://git.kobert.dev/pm24.git/atom/drivers/input/keyboard/gpio_keys.c?h=v6.4</id>
<link rel='self' href='https://git.kobert.dev/pm24.git/atom/drivers/input/keyboard/gpio_keys.c?h=v6.4'/>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/'/>
<updated>2023-02-21T21:56:36Z</updated>
<entry>
<title>Input: gpio-keys - add support for linux,input-value DTS property</title>
<updated>2023-02-21T21:56:36Z</updated>
<author>
<name>Gergo Koteles</name>
<email>soyer@irl.hu</email>
</author>
<published>2023-02-21T19:47:48Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=4b665e1781e2cd64b3b9492e49156925ba02bfa9'/>
<id>urn:sha1:4b665e1781e2cd64b3b9492e49156925ba02bfa9</id>
<content type='text'>
Allows setting the value of EV_ABS events from DTS.
This property is included in the gpio-keys.yaml scheme, but was only
implemented for gpio-keys-polled.

Signed-off-by: Gergo Koteles &lt;soyer@irl.hu&gt;
Link: https://lore.kernel.org/r/3519a11b0ef5324a2befbd137cd2aa0cb8fd057d.1676850819.git.soyer@irl.hu
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: gpio-keys - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()</title>
<updated>2022-12-07T21:26:56Z</updated>
<author>
<name>Jonathan Cameron</name>
<email>Jonathan.Cameron@huawei.com</email>
</author>
<published>2022-12-04T18:08:15Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=ba4de5d944357b8bfba0e987f539530bc75ac6e7'/>
<id>urn:sha1:ba4de5d944357b8bfba0e987f539530bc75ac6e7</id>
<content type='text'>
SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection
against unused function warnings.  The new combination of pm_sleep_ptr()
and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions,
thus suppressing the warning, but still allowing the unused code to be
removed. Thus also drop the __maybe_unused markings.

Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Link: https://lore.kernel.org/r/20221204180841.2211588-7-jic23@kernel.org
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: gpio-keys - cancel delayed work only in case of GPIO</title>
<updated>2022-05-26T16:56:40Z</updated>
<author>
<name>Lad Prabhakar</name>
<email>prabhakar.mahadev-lad.rj@bp.renesas.com</email>
</author>
<published>2022-05-25T21:39:28Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=cee409bbba0d1bd3fb73064fb480ff365f453b5d'/>
<id>urn:sha1:cee409bbba0d1bd3fb73064fb480ff365f453b5d</id>
<content type='text'>
gpio_keys module can either accept gpios or interrupts. The module
initializes delayed work in case of gpios only and is only used if
debounce timer is not used, so make sure cancel_delayed_work_sync()
is called only when its gpio-backed and debounce_use_hrtimer is false.

This fixes the issue seen below when the gpio_keys module is unloaded and
an interrupt pin is used instead of GPIO:

[  360.297569] ------------[ cut here ]------------
[  360.302303] WARNING: CPU: 0 PID: 237 at kernel/workqueue.c:3066 __flush_work+0x414/0x470
[  360.310531] Modules linked in: gpio_keys(-)
[  360.314797] CPU: 0 PID: 237 Comm: rmmod Not tainted 5.18.0-rc5-arm64-renesas-00116-g73636105874d-dirty #166
[  360.324662] Hardware name: Renesas SMARC EVK based on r9a07g054l2 (DT)
[  360.331270] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[  360.338318] pc : __flush_work+0x414/0x470
[  360.342385] lr : __cancel_work_timer+0x140/0x1b0
[  360.347065] sp : ffff80000a7fba00
[  360.350423] x29: ffff80000a7fba00 x28: ffff000012b9c5c0 x27: 0000000000000000
[  360.357664] x26: ffff80000a7fbb80 x25: ffff80000954d0a8 x24: 0000000000000001
[  360.364904] x23: ffff800009757000 x22: 0000000000000000 x21: ffff80000919b000
[  360.372143] x20: ffff00000f5974e0 x19: ffff00000f5974e0 x18: ffff8000097fcf48
[  360.379382] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000053f40
[  360.386622] x14: ffff800009850e88 x13: 0000000000000002 x12: 000000000000a60c
[  360.393861] x11: 000000000000a610 x10: 0000000000000000 x9 : 0000000000000008
[  360.401100] x8 : 0101010101010101 x7 : 00000000a473c394 x6 : 0080808080808080
[  360.408339] x5 : 0000000000000001 x4 : 0000000000000000 x3 : ffff80000919b458
[  360.415578] x2 : ffff8000097577f0 x1 : 0000000000000001 x0 : 0000000000000000
[  360.422818] Call trace:
[  360.425299]  __flush_work+0x414/0x470
[  360.429012]  __cancel_work_timer+0x140/0x1b0
[  360.433340]  cancel_delayed_work_sync+0x10/0x18
[  360.437931]  gpio_keys_quiesce_key+0x28/0x58 [gpio_keys]
[  360.443327]  devm_action_release+0x10/0x18
[  360.447481]  release_nodes+0x8c/0x1a0
[  360.451194]  devres_release_all+0x90/0x100
[  360.455346]  device_unbind_cleanup+0x14/0x60
[  360.459677]  device_release_driver_internal+0xe8/0x168
[  360.464883]  driver_detach+0x4c/0x90
[  360.468509]  bus_remove_driver+0x54/0xb0
[  360.472485]  driver_unregister+0x2c/0x58
[  360.476462]  platform_driver_unregister+0x10/0x18
[  360.481230]  gpio_keys_exit+0x14/0x828 [gpio_keys]
[  360.486088]  __arm64_sys_delete_module+0x1e0/0x270
[  360.490945]  invoke_syscall+0x40/0xf8
[  360.494661]  el0_svc_common.constprop.3+0xf0/0x110
[  360.499515]  do_el0_svc+0x20/0x78
[  360.502877]  el0_svc+0x48/0xf8
[  360.505977]  el0t_64_sync_handler+0x88/0xb0
[  360.510216]  el0t_64_sync+0x148/0x14c
[  360.513930] irq event stamp: 4306
[  360.517288] hardirqs last  enabled at (4305): [&lt;ffff8000080b0300&gt;] __cancel_work_timer+0x130/0x1b0
[  360.526359] hardirqs last disabled at (4306): [&lt;ffff800008d194fc&gt;] el1_dbg+0x24/0x88
[  360.534204] softirqs last  enabled at (4278): [&lt;ffff8000080104a0&gt;] _stext+0x4a0/0x5e0
[  360.542133] softirqs last disabled at (4267): [&lt;ffff8000080932ac&gt;] irq_exit_rcu+0x18c/0x1b0
[  360.550591] ---[ end trace 0000000000000000 ]---

Signed-off-by: Lad Prabhakar &lt;prabhakar.mahadev-lad.rj@bp.renesas.com&gt;
Link: https://lore.kernel.org/r/20220524135822.14764-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: gpio-keys - avoid clearing twice some memory</title>
<updated>2022-01-04T06:05:22Z</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2022-01-04T05:35:37Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=08a6df09063818d55c1f0aa8cf3385d8d217b506'/>
<id>urn:sha1:08a6df09063818d55c1f0aa8cf3385d8d217b506</id>
<content type='text'>
bitmap_parselist() already clears the 'bits' bitmap, so there is no need
to clear it when it is allocated. This just wastes some cycles.

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Acked-by: Paul Cercueil &lt;paul@crapouillou.net&gt;
Link: https://lore.kernel.org/r/d6ee621b9dd75b92f8831db365cee58dc2025322.1640813136.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: gpio-keys - fix crash when disabliing GPIO-less buttons</title>
<updated>2021-04-08T06:20:52Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2021-04-08T06:14:50Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=2531fdbf8bfc22b0a2554bb3e3772dd8105d74ad'/>
<id>urn:sha1:2531fdbf8bfc22b0a2554bb3e3772dd8105d74ad</id>
<content type='text'>
My brain-damaged adjustments to Paul's patch caused crashes in
gpio_keys_disable_button() when driver is used in GPIO-less (i.e.
purely interrupt-driven) setups, because I mixed together debounce and
release timers when they are in fact separate:

Unable to handle kernel NULL pointer dereference at virtual address 0000000c
...
PC is at hrtimer_active+0xc/0x98
LR is at hrtimer_try_to_cancel+0x24/0x140
...
[&lt;c01c43b8&gt;] (hrtimer_active) from [&lt;c01c50f4&gt;] (hrtimer_try_to_cancel+0x24/0x140)
[&lt;c01c50f4&gt;] (hrtimer_try_to_cancel) from [&lt;c01c5224&gt;] (hrtimer_cancel+0x14/0x4c)
[&lt;c01c5224&gt;] (hrtimer_cancel) from [&lt;bf1cae24&gt;] (gpio_keys_attr_store_helper+0x1b8/0x1d8 [gpio_keys])
[&lt;bf1cae24&gt;] (gpio_keys_attr_store_helper [gpio_keys]) from [&lt;bf1cae80&gt;] (gpio_keys_store_disabled_keys+0x18/0x24 [gpio_keys])
[&lt;bf1cae80&gt;] (gpio_keys_store_disabled_keys [gpio_keys]) from [&lt;c038ec7c&gt;] (kernfs_fop_write_iter+0x10c/0x1cc)
[&lt;c038ec7c&gt;] (kernfs_fop_write_iter) from [&lt;c02df858&gt;] (vfs_write+0x2ac/0x404)
[&lt;c02df858&gt;] (vfs_write) from [&lt;c02dfaf4&gt;] (ksys_write+0x64/0xdc)
[&lt;c02dfaf4&gt;] (ksys_write) from [&lt;c0100080&gt;] (ret_fast_syscall+0x0/0x58)

Let's fix it up.

Fixes: c9efb0ba281e ("Input: gpio-keys - use hrtimer for software debounce, if possible")
Reported-by: Tony Lindgren &lt;tony@atomide.com&gt;
Tested-by: Tony Lindgren &lt;tony@atomide.com&gt;
Link: https://lore.kernel.org/r/YG1DFFgojSVfdpaz@google.com
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: gpio-keys - use hrtimer for software debounce, if possible</title>
<updated>2021-03-25T18:14:08Z</updated>
<author>
<name>Paul Cercueil</name>
<email>paul@crapouillou.net</email>
</author>
<published>2021-03-21T23:09:29Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=c9efb0ba281e88e2faec6ad919be509b6ab8ead6'/>
<id>urn:sha1:c9efb0ba281e88e2faec6ad919be509b6ab8ead6</id>
<content type='text'>
We want to be able to report the input event as soon as the debounce
delay elapsed. However, the current code does not really ensure that,
as it uses the jiffies-based schedule_delayed_work() API. With a small
enough HZ value (HZ &lt;= 100), this results in some input events being
lost, when a key is quickly pressed then released (on a human's time
scale).

Switching to hrtimers fixes this issue, and will work even on extremely
low HZ values (tested at HZ=24). This is however only possible if
reading the GPIO is possible without sleeping. If this condition is not
met, the previous approach of using a jiffies-based timer is taken.

Signed-off-by: Paul Cercueil &lt;paul@crapouillou.net&gt;
Link: https://lore.kernel.org/r/20210307222240.380583-3-paul@crapouillou.net
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: gpio-keys - use hrtimer for release timer</title>
<updated>2021-03-25T18:14:08Z</updated>
<author>
<name>Paul Cercueil</name>
<email>paul@crapouillou.net</email>
</author>
<published>2021-03-21T23:06:34Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=019002f20cb5b9f78d39360aff244265d035e08a'/>
<id>urn:sha1:019002f20cb5b9f78d39360aff244265d035e08a</id>
<content type='text'>
Dealing with input, timing is important; if the button should be
released in one millisecond, then it should be done in one millisecond
and not a hundred milliseconds.

Therefore, the standard timer API is not really suitable for this task.

Convert the gpio-keys driver to use a hrtimer instead of the standard
timer to address this issue.

Note that by using a hard IRQ for the hrtimer callback, we can get rid
of the spin_lock_irqsave() and spin_unlock_irqrestore().

Signed-off-by: Paul Cercueil &lt;paul@crapouillou.net&gt;
Link: https://lore.kernel.org/r/20210307222240.380583-2-paul@crapouillou.net
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: gpio-keys - remove extra call to input_sync</title>
<updated>2021-03-25T18:14:08Z</updated>
<author>
<name>Paul Cercueil</name>
<email>paul@crapouillou.net</email>
</author>
<published>2021-03-21T23:06:23Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=36a8fc6fa230eb936385884391cac80420cd0e6f'/>
<id>urn:sha1:36a8fc6fa230eb936385884391cac80420cd0e6f</id>
<content type='text'>
The input_sync() function is already called after the loop in
gpio_keys_report_state(), so it does not need to be called after each
iteration within gpio_keys_gpio_report_event().

Signed-off-by: Paul Cercueil &lt;paul@crapouillou.net&gt;
Link: https://lore.kernel.org/r/20210307222240.380583-1-paul@crapouillou.net
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: use input_device_enabled()</title>
<updated>2020-12-03T06:10:33Z</updated>
<author>
<name>Andrzej Pietrasiewicz</name>
<email>andrzej.p@collabora.com</email>
</author>
<published>2020-10-05T04:16:07Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=d69f0a43c677e8afc67a222e1e7b51b9acc69cd3'/>
<id>urn:sha1:d69f0a43c677e8afc67a222e1e7b51b9acc69cd3</id>
<content type='text'>
Use the newly added helper in relevant input drivers.

Signed-off-by: Andrzej Pietrasiewicz &lt;andrzej.p@collabora.com&gt;
Link: https://lore.kernel.org/r/20200608112211.12125-3-andrzej.p@collabora.com
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: gpio_keys - fix misnamed function parameter 'dev'</title>
<updated>2020-11-09T06:23:59Z</updated>
<author>
<name>Lee Jones</name>
<email>lee.jones@linaro.org</email>
</author>
<published>2020-11-09T06:08:01Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=2216c0e414c6596b03a354b5c08ba98af4cbef85'/>
<id>urn:sha1:2216c0e414c6596b03a354b5c08ba98af4cbef85</id>
<content type='text'>
Fixes the following W=1 kernel build warning(s):

 drivers/input/keyboard/gpio_keys.c:119: warning: Function parameter or member 'dev' not described in 'get_bm_events_by_type'
 drivers/input/keyboard/gpio_keys.c:119: warning: Excess function parameter 'input' description in 'get_bm_events_by_type'

Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Link: https://lore.kernel.org/r/20201104162427.2984742-12-lee.jones@linaro.org
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
</feed>
