aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/gpio_keys_polled.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-02-14Input: gpio_keys_polled - replace zero-length array with flexible-array memberGustavo A. R. Silva1-1/+1
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Link: https://lore.kernel.org/r/20200214171907.GA26588@embeddedor Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-29Input: gpio_keys_polled - switch to using polled mode of input devicesDmitry Torokhov1-31/+34
We have added polled mode to the normal input devices with the intent of retiring input_polled_dev. This converts gpio_keys_polled driver to use the polling mode of standard input devices and removes dependency on INPUT_POLLDEV. Note that we still keep polled and non-polled gpio-keys drivers separate, as they are different enough and mixing them up would make the code pretty confusing. Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.kernel.org/r/20191017204217.106453-9-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-27Input: gpio_keys_polled - switch to using devm_fwnode_gpiod_get()Dmitry Torokhov1-4/+3
devm_fwnode_get_gpiod_from_child() is going away as the name is too unwieldy, let's switch to using the new devm_fwnode_gpiod_get(). Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-15Merge tag 'v5.2' into nextDmitry Torokhov1-4/+1
Sync up with mainline to resolve conflicts in iforce driver.
2019-07-06Input: gpio_keys_polled - allow specifying name of input deviceEnrico Weigelt, metux IT consult1-1/+3
Instead of hardcoding the input name to the driver name ('gpio-keys-polled'), allow specifying the name of the device via "label" property. If the property is not present (nor name is set in board-supplied platform data), we'll default to the old name. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: gpio_keys_polled - use struct_size() in devm_kzalloc()Gustavo A. R. Silva1-4/+2
One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct gpio_keys_polled_dev { ... struct gpio_keys_button_data data[0]; }; size = sizeof(struct gpio_keys_polled_dev) + count * sizeof(struct gpio_keys_button_data); instance = devm_kzalloc(dev, size, GFP_KERNEL); Instead of leaving these open-coded and prone to type mistakes, we can now use the new struct_size() helper: instance = devm_kzalloc(dev, struct_size(instance, data, count), GFP_KERNEL); Notice that, in this case, variable size is not necessary, hence it is removed. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-4/+1
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-23Merge tag 'gpio-v4.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpioLinus Torvalds1-10/+4
Pull GPIO updates from Linus Walleij: "This is the bulk of GPIO changes for the v4.11 cycle Core changes: - Augment fwnode_get_named_gpiod() to configure the GPIO pin immediately after requesting it like all other APIs do. This is a treewide change also updating all users. - Pass a GPIO label down to gpiod_request() from fwnode_get_named_gpiod(). This makes debugfs and the userspace ABI correctly reflect the current in-kernel consumer of a pin taken using this abstraction. This is a treewide change also updating all users. - Rename devm_get_gpiod_from_child() to devm_fwnode_get_gpiod_from_child() to reflect the fact that this function is operating on a fwnode object. This is a treewide change also updating all users. - Make it possible to take multiple GPIOs in a single hog of device tree hogs. - The refactorings switching GPIO chips to use the .set_config() callback using standard pin control properties and providing a backend into the pin control subsystem that were also merged into the pin control tree naturally appear here too. Testing instrumentation: - A whole slew of cleanups and improvements to the mockup GPIO driver. We now have an extended userspace test exercising the subsystem, and we can inject interrupts etc from userspace to fully test the core GPIO functionality. New drivers: - New driver for the Cortina Systems Gemini GPIO controller. - New driver for the Exar XR17V352/354/358 chips. - New driver for the ACCES PCI-IDIO-16 PCI GPIO card. Driver changes: - RCAR: set the irqchip parent device, add fine-grained runtime PM support. - pca953x: support optional RESET control line on the chip. - DaVinci: cleanups and simplifications. Add support for multiple instances. - .set_multiple() and naming of lines on more or less all of the ISA/PCI GPIO controllers. - mcp23s08: refactored to use regmap as a first step to further rewrites and modernizations" * tag 'gpio-v4.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (61 commits) gpio: reintroduce devm_get_gpiod_from_child() gpio: pci-idio-16: Fix PCI BAR index gpio: pci-idio-16: Fix PCI device ID code gpio: mockup: implement event injecting over debugfs gpio: mockup: add a dummy irqchip gpio: mockup: implement naming the lines gpio: mockup: code shrink gpio: mockup: readability tweaks gpio: Add GPIO support for the ACCES PCI-IDIO-16 gpio: Add the devm_fwnode_get_index_gpiod_from_child() helper gpio: Rename devm_get_gpiod_from_child() gpio: mcp23s08: Select REGMAP/REGMAP_I2C to fix build error gpio: ws16c48: Add support for GPIO names gpio: gpio-mm: Add support for GPIO names gpio: 104-idio-16: Add support for GPIO names gpio: 104-idi-48: Add support for GPIO names gpio: 104-dio-48e: Add support for GPIO names gpio: ws16c48: Remove unnecessary driver_data set gpio: gpio-mm: Remove unnecessary driver_data set gpio: 104-idio-16: Remove unnecessary driver_data set ...
2017-02-04gpio: Rename devm_get_gpiod_from_child()Boris Brezillon1-4/+4
Rename devm_get_gpiod_from_child() into devm_fwnode_get_gpiod_from_child() to reflect the fact that this function is operating on a fwnode object. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2017-01-26gpio: Pass GPIO label down to gpiod_requestAlexander Stein1-1/+2
Currently all users of fwnode_get_named_gpiod() have no way to specify a label for the GPIO. So GPIOs listed in debugfs are shown with label "?". With this change a proper label is used. Also adjust all users so they can pass a label, properly retrieved from device tree properties. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2017-01-26gpiolib: Convert fwnode_get_named_gpiod() to configure GPIOAndy Shevchenko1-9/+2
Make fwnode_get_named_gpiod() consistent with the rest of gpiod_get() like API, i.e. configure GPIO pin immediately after request. Besides obvious clean up it will help to configure pins based on firmware provided resources. Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2017-01-21Input: keyboard - use local variables consistentlyGuenter Roeck1-3/+3
If a function declares a variable to access a structure element, use it consistently. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-01-21Input: keyboard - drop calls to platform_set_drvdata and i2c_set_clientdataGuenter Roeck1-1/+0
There is no call to i2c_get_clientdata(), platform_get_drvdata(), or dev_get_drvdata() in any of the drivers in this patch. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-11-17Input: gpio_keys - set input direction explicitlySudeep Holla1-0/+8
Commit 700a38b27eef ("Input: gpio_keys - switch to using generic device properties") switched to use generic device properties for GPIO keys and commit 5feeca3c1e39 ("Input: gpio_keys - add support for GPIO descriptors") switched from legacy GPIO numbers to GPIO descriptors. Previously devm_gpio_request_one was explicitly passed GPIOF_DIR_IN flag to set the GPIO direction as input. However devm_get_gpiod_from_child doesn't have such provisions and hence fwnode_get_named_gpiod can't set it as input. This breaks few platforms with the following error: " gpiochip_lock_as_irq: tried to flag a GPIO set as output for IRQ unable to lock HW IRQ <n> for IRQ genirq: Failed to request resources for POWER (irq <x>) on irqchip gpio_keys: Unable to claim irq <x>; error -22 gpio-keys: probe failed with error -22 " This patch fixes the issue by setting input direction explicitly for gpio lines described by generic properties. Fixes: 700a38b27eef ("Input: gpio_keys - switch to using generic device properties") Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-11-07Input: gpio_keys_polled - always use gpiod_get_value_cansleepDmitry Torokhov1-11/+10
It does not matter if given GPIO may sleep or not when reading state, polling is always done in a non-atomic context, so we should always be able to simply use gpiod_get_value_cansleep(). Also let's note in the logs when we fail to read gpio state. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-11-07Input: gpio_keys_polled - keep button data constantDmitry Torokhov1-47/+58
Commit 633a21d80b4a ("input: gpio_keys_polled: Add support for GPIO descriptors") placed gpio descriptor into gpio_keys_button structure, which is supposed to be part of platform data and not modifiable by the driver. To keep the data constant, let's move the descriptor to gpio_keys_button_data structure instead. Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-10-14Input: gpio_keys_polled - add support for abs/rel axisHans de Goede1-9/+79
This changAdd support for EV_ABS / EV_REL events to the gpio-keys-polled driver. The driver already allows specifying what type of events (key / rel / abs) a button generates when pressed, but for rel / abs axis we also need to specify which value this specific gpio represents. One use case is digital joysticks / direction-pads which are hooked up to gpio, in this case we've left and right buttons which we want to map to EV_ABS, ABS_X and we want generate events for left with a value of -1 and for right with a value of +1 (and similar for up / down and ABS_Y). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-09-03Merge branch 'next' into for-linusDmitry Torokhov1-2/+5
Prepare first round of input updates for 4.3 merge window.
2015-08-20Input: gpio_keys_polled - request GPIO pin as input.Vincent Pelletier1-1/+1
GPIOF_IN flag was lost in: Commit 633a21d80b4a("input: gpio_keys_polled: Add support for GPIO descriptors"). Without this flag, legacy code path (for non-descriptor GPIO declarations) would configure GPIO as output (0 meaning GPIOF_DIR_OUT | GPIOF_INIT_LOW). Cc: stable@vger.kernel.org Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-07-23Input: gpio_keys[_polled] - change name of wakeup propertyDmitry Torokhov1-1/+4
Wakeup property of device is not Linux-specific, it describes intended system behavior regardless of the OS being used. Therefore let's drop "linux," prefix, and, while at it, use the same name as I2C bus does: "wakeup-source". We keep parsing old name to keep compatibility with old DTSes. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-04gpio: add parameter to allow the use named gpiosOlliver Schinagl1-1/+1
The gpio binding document says that new code should always use named gpios. Patch 40b73183 added support to parse a list of gpios from child nodes, but does not make it possible to use named gpios. This patch adds the con_id property and implements it is done in gpiolib.c, where the old-style of using unnamed gpios still works. Signed-off-by: Olliver Schinagl <oliver@schinagl.nl> Acked-by: Bryan Wu <cooloney@gmail.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-12-14Merge tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-coreLinus Torvalds1-1/+0
Pull driver core update from Greg KH: "Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while" * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits) Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries" fs: debugfs: add forward declaration for struct device type firmware class: Deletion of an unnecessary check before the function call "vunmap" firmware loader: fix hung task warning dump devcoredump: provide a one-way disable function device: Add dev_<level>_once variants ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries ath: use seq_file api for ath9k debugfs files debugfs: add helper function to create device related seq_file drivers/base: cacheinfo: remove noisy error boot message Revert "core: platform: add warning if driver has no owner" drivers: base: support cpu cache information interface to userspace via sysfs drivers: base: add cpu_device_create to support per-cpu devices topology: replace custom attribute macros with standard DEVICE_ATTR* cpumask: factor out show_cpumap into separate helper function driver core: Fix unbalanced device reference in drivers_probe driver core: fix race with userland in device_add() sysfs/kernfs: make read requests on pre-alloc files use the buffer. sysfs/kernfs: allow attributes to request write buffer be pre-allocated. fs: sysfs: return EGBIG on write if offset is larger than file size ...
2014-11-04input: gpio_keys_polled: Make use of device property APIAaron Lu1-49/+24
Make use of device property API in this driver so that both OF based system and ACPI based system can use this driver. Signed-off-by: Aaron Lu <aaron.lu@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-11-04input: gpio_keys_polled: Add support for GPIO descriptorsAaron Lu1-12/+27
GPIO descriptors are the preferred way over legacy GPIO numbers nowadays. Convert the driver to use GPIO descriptors internally but still allow passing legacy GPIO numbers from platform data to support existing platforms. Signed-off-by: Aaron Lu <aaron.lu@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-10-20input: keyboard: drop owner assignment from platform_driversWolfram Sang1-1/+0
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-05-14Input: gpio_keys_polled - convert to devm-* APIAlexander Shiyan1-77/+21
Replace existing resource handling in the driver with managed device resources, this ensures more consistent error values and simplifies error handling paths: kzalloc -> devm_kzalloc gpio_request_one -> devm_gpio_request_one input_allocate_polled_device -> devm_input_allocate_polled_device Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-05-14Input: gpio_keys_polled - make of_device_id array constJingoo Han1-1/+1
Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-01-06Input: delete non-required instances of include <linux/init.h>Paul Gortmaker1-1/+0
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-10-06Input: gpio_keys_polled - include linux/of.h headerSachin Kamat1-0/+1
'of_match_ptr' is defined in linux/of.h. Include it explicitly. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-05-08Input: gpio_keys_polled - remove redundant platform_set_drvdata()Sachin Kamat1-2/+0
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-12-24Input: gpio_keys_polled - defer probing if GPIO probing is deferredGabor Juhos1-1/+12
If GPIO probing is deferred, the driver tries to claim an invalid GPIO line which leads to an error message like this: gpio-keys-polled buttons.2: unable to claim gpio 4294966779, err=-22 gpio-keys-polled: probe of buttons.2 failed with error -22 We should make sure that error code returned by of_get_gpio_flags (including -EPROBE_DEFER) is propagated up the stack. Cc: stable@vger.kernel.org Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-12-03Input: gpio_keys_polled - switch to using gpio_request_one()Dmitry Torokhov1-10/+2
This saves us a few lines of code. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-11-29Input: gpio-keys-polled - honor 'autorepeat' setting in platform dataAlexander Shiyan1-1/+4
Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-11-24Input: remove use of __devexitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-11-24Input: remove use of __devinitBill Pemberton1-3/+2
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-11-24Input: remove use of __devexit_pBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-09-12Input: gpio_keys_polled - fix dt pdata->nbuttonsAlexandre Pereira da Silva1-0/+1
pdata->nbuttons should be updated by the dt code. Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-08-21Input: gpio_keys_polled - convert to dtAlexandre Pereira da Silva1-5/+127
Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-08-21Input: gpio-keys-polled - constify pointers to platform dataDmitry Torokhov1-7/+7
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2011-11-30Input: keyboard - use macro module_platform_driver()JJ Ding1-13/+1
Commit 940ab88962bc1aff3273a8356d64577a6e386736 introduced a new macro to save some platform_driver boilerplate code. Use it. Signed-off-by: JJ Ding <dgdunix@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-12-06Input: add input driver for polled GPIO buttonsGabor Juhos1-0/+261
The existing gpio-keys driver can be usable only for GPIO lines with interrupt support. Several devices have buttons connected to a GPIO line which is not capable to generate interrupts. This patch adds a new input driver using the generic GPIO layer and the input-polldev to support such buttons. [Ben Gardiner <bengardiner@nanometrics.ca: fold code to use more of the original gpio_keys infrastructure; cleanups and other improvements.] Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca> Tested-by: Ben Gardiner <bengardiner@nanometrics.ca> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>