Input: gpio_keys_polled - keep button data constant

Commit 633a21d80b ("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>
This commit is contained in:
Dmitry Torokhov
2016-02-23 15:32:14 -08:00
parent 8dd5e0b364
commit 0f78ba96bb
3 changed files with 64 additions and 56 deletions

View File

@@ -2,7 +2,6 @@
#define _GPIO_KEYS_H
struct device;
struct gpio_desc;
/**
* struct gpio_keys_button - configuration parameters
@@ -18,7 +17,6 @@ struct gpio_desc;
* disable button via sysfs
* @value: axis value for %EV_ABS
* @irq: Irq number in case of interrupt keys
* @gpiod: GPIO descriptor
*/
struct gpio_keys_button {
unsigned int code;
@@ -31,7 +29,6 @@ struct gpio_keys_button {
bool can_disable;
int value;
unsigned int irq;
struct gpio_desc *gpiod;
};
/**
@@ -46,7 +43,7 @@ struct gpio_keys_button {
* @name: input device name
*/
struct gpio_keys_platform_data {
struct gpio_keys_button *buttons;
const struct gpio_keys_button *buttons;
int nbuttons;
unsigned int poll_interval;
unsigned int rep:1;