gpio-button-hotplug: support interrupt properties
authorChristian Lamparter <chunkeey@gmail.com>
Sun, 19 May 2019 14:06:34 +0000 (16:06 +0200)
committerChristian Lamparter <chunkeey@gmail.com>
Fri, 31 May 2019 08:30:03 +0000 (10:30 +0200)
commitafc056d7dc833bbd714386007db1bfcf48188954
treedd5f1a5a0bcd5817a36f4fd6edea2cdf957a11d8
parent678ee30ee4c2a7d727d1b8a055faa5d274dd73ec
gpio-button-hotplug: support interrupt properties

Upstream Linux's input gpio-keys driver supports
specifying a external interrupt for a gpio via the
'interrupts' properties as well as having support
for software debounce.

This patch ports these features to OpenWrt's event
version. Only the "pure" interrupt-driven support is
left behind, since this goes a bit against the "gpio"
in the "gpio-keys" and I don't have a real device to
test this with.

This patch also silences the generated warnings showing
up since 4.14 due to the 'constification' of the
struct gpio_keys_button *buttons variable in the
upstream struct gpio_keys_platform_data declaration.

gpio-button-hotplug.c: In function 'gpio_keys_get_devtree_pdata':
gpio-button-hotplug.c:392:10: warning: assignment discards 'const'
qualifier from pointer target type [-Wdiscarded-qualifiers]
   button = &pdata->buttons[i++];
          ^
gpio-button-hotplug.c: In function 'gpio_keys_button_probe':
gpio-button-hotplug.c:537:12: warning: assignment discards 'const'
qualifier from pointer target type [-Wdiscarded-qualifiers]
   bdata->b = &pdata->buttons[i];
            ^
gpio-button-hotplug.c: In function 'gpio_keys_probe':
gpio-button-hotplug.c:563:37: warning: initialization discards 'const'
qualifier from pointer target type [-Wdiscarded-qualifiers]
   struct gpio_keys_button *button = &pdata->buttons[i];
                                   ^
Acked-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c