Commit Graph

27 Commits (9601d94138de66e4fc9f55a08dfb348cdfcc3181)

Author SHA1 Message Date
Karl Vogel 76378c6b9f build: use KERNEL_MAKE_FLAGS for kernel file compilations
The build system already defines KERNEL_CROSS which defaults to TARGET_CROSS.
Make use of this variable for kernel makefiles.

Signed-off-by: Karl Vogel <karl.vogel@gmail.com>
7 years ago
Furong Xu 5a22df69e4 gpio-button-hotplug: leave platform_device.dev.platform_data untouched
get platform_data from gpio_keys_button_dev.pdata, and fix a illegal pointer
dereference like this:

[   51.143776] gpio-keys-polled gpio-keys-polled: missing poll_interval value
[   51.150852] gpio-keys-polled: probe of gpio-keys-polled failed with error -22
[  828.159993] gpio-keys-polled gpio-keys-polled: no memory for button data
[  828.166821] gpio-keys-polled: probe of gpio-keys-polled failed with error -12

Signed-off-by: Furong Xu <xfr@outlook.com>
7 years ago
Florian Eckert 4482063c34 treewide: add license tags
Add licence tags where missing.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
7 years ago
Mathias Kresin d561b2f5ce gpio-button-hotplug: add more buttons
The keycodes are used by some boards.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Alexandru Ardelean a1236a30a0 kernel/gpio-button-hotplug: drop Build/Prepare rule in favor of default one
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
8 years ago
Felix Fietkau 7eeb254cc4 treewide: replace nbd@openwrt.org with nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
John Crispin 4ac3411f09 kernel: gpio-button-hotplug: Add missing ONESHOT flag to threaded IRQ request
Without the IRQF_ONESHOT flag in devm_request_threaded_irq() call I get
following error:

  genirq: Threaded irq requested with handler=NULL and !ONESHOT for irq 56
  gpio-keys gpio-keys: failed to request irq:56 for gpio:20

>From kernel/irq/manage.c:

 The interrupt was requested with handler = NULL, so we use the default
 primary handler for it. But it does not have the oneshot flag set. In
 combination with level interrupts this is deadly, because the default
 primary handler just wakes the thread, then the irq lines is reenabled,
 but the device still has the level irq asserted. Rinse and repeat....

 While this works for edge type interrupts, we play it safe and reject
 unconditionally because we can't say for sure which type this interrupt
 really has. The type flags are unreliable as the underlying chip
 implementation can override them.

Signed-off-by: Petr Štetiar <ynezz@true.cz>

SVN-Revision: 48894
8 years ago
John Crispin 69517e88be kernel: gpio-button-hotplug: update to use threaded irq's
Many gpio controllers 'cansleep' due to the fact that they are behind busses
e.g. i2c etc.

Using threaded irq's allows for 'sleep-able' gpio's to be used.

Signed-off-by: Pushpal Sidhu <psidhu@gateworks.com>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>

SVN-Revision: 48696
8 years ago
Hauke Mehrtens 886764657a gpio-button-hotplug: handle EPROBE_DEFER and other errors
of_get_gpio_flags() could return an error like EPROBE_DEFER which was
not handled before. This patch takes the code from gpio_keys_polled.c
for error handling and also improves some other unrelated small parts.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

SVN-Revision: 46502
9 years ago
Felix Fietkau 3120c9c9c2 build: drop obsolete kernel version dependencies
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44110
9 years ago
Felix Fietkau 6ee4d92e34 gpio-button-hotplug: remove #ifdef CONFIG_HOTPLUG, it is gone in newer kernels (fixes #16413)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40838
10 years ago
Hauke Mehrtens a5ced8b408 gpio-button-hotplug: fix (and extend) package description
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 40765
10 years ago
Florian Fainelli 0d92f34977 gpio-button-hotplug: don't build for 3.3 kernels
3.3 kernels do not have the required changes which would make
gpio-button-hotplug work, disallow building on those kernels for now.

Signed-off-by: Florian Fainelli <florian@openwrt.org>

SVN-Revision: 39903
10 years ago
Hauke Mehrtens 45e3898a11 gpio-button-hotplug: add wwan button
The wimax key will be used as a generic wwan key starting with Linux
3.13. The brcm47xx target uses this key for the 3g buttons. Also remove
the ifdef around KEY_WPS_BUTTON, this is in the kernel for a long time
now.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

SVN-Revision: 39290
10 years ago
Jonas Gorski 5c2aee90ac gpio-button-hotplug: fix crash on remove
Don't call gpio_keys_remove recursively. Setting the platform
data to NULL triggered an oops on the second iteration, so there was
no infinate loop.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>

SVN-Revision: 39124
11 years ago
John Crispin bc76dec31f gpio-button-hotplug: add irq mode to driver
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 39021
11 years ago
John Crispin 40031fdf9b gpio-button-hotplug: add support for sliding switches
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 38725
11 years ago
John Crispin 14457da13f gpio-button-hotplug: add support for power buttons
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 38557
11 years ago
Felix Fietkau 6743f2625b gpio-button-hotplug: debounce the initial button state, the first reads at boot time might be wrong
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 37702
11 years ago
Felix Fietkau 18e37d8caf gpio-button-hotplug: cleanup, fix compiler warning
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 37665
11 years ago
Felix Fietkau 4281026dda gpio-button-hotplug: fix active_low handling, possibly broken in r37643
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 37664
11 years ago
John Crispin 1eabf431df gpio-button-hotplug: use gpio_button_get_value() to initialize last_state.
TL-WR720N-v3 has a slider switch composed of 2 GPIO buttons which can be
used to swtich between 3 positions.  At leat 1 button is in pressed state
in any of those positions.  Initialize 'last_state' as 0 (released) will
cause the device to automatically enter failsafe mode on every bootup.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>

SVN-Revision: 37643
11 years ago
John Crispin ef96422920 gpio-button-hotplug: use gpio_button_get_value() to fetch state.
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>

SVN-Revision: 37642
11 years ago
John Crispin 2c19af6ac5 gpio-button-hotplug: add inline function gpio_button_get_value().
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>

SVN-Revision: 37641
11 years ago
Luka Perkov 6988613f7a gpio-button-hotplug: add support for EV_SW
Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 37130
11 years ago
Felix Fietkau 0f6e9c9fcc gpio-button-hotplug: improve gpio button debouncing, verify state changes over multiple polls. fixes spurious failsafe triggers (#13784)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 37090
11 years ago
John Crispin 4ebf19b48f packages: clean up the package folder
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 37007
11 years ago