diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-01-13 11:54:35 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-01-13 16:28:08 +0100 |
commit | 30b7c5ead35f8570cbd96d4344755a72a8f3307c (patch) | |
tree | 942d86cf6dbdf036c45a2329d10d3d4ffe3d99f5 /drivers/input | |
parent | dcaf3adb5383acb4e17b02054602d2c14c0a80a5 (diff) | |
download | barebox-30b7c5ead35f8570cbd96d4344755a72a8f3307c.tar.gz barebox-30b7c5ead35f8570cbd96d4344755a72a8f3307c.tar.xz |
input: gpio-keys: Use KEY_* keycodes
The gpio-keys driver takes ascii key codes from platform_data and Linux
keycodes from device tree. Convert the ascii keys over to Linux
keycodes to get rid of the special cases in the driver.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/gpio_keys.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/input/gpio_keys.c b/drivers/input/gpio_keys.c index 5b03fd76cb..acb9e07fb8 100644 --- a/drivers/input/gpio_keys.c +++ b/drivers/input/gpio_keys.c @@ -36,8 +36,6 @@ struct gpio_keys { struct kfifo *recv_fifo; struct poller_struct poller; struct console_device cdev; - - int use_keycodes; }; static inline struct gpio_keys * @@ -91,10 +89,7 @@ static int gpio_keys_getc(struct console_device *cdev) kfifo_get(gk->recv_fifo, (u_char*)&code, sizeof(int)); - if (IS_ENABLED(CONFIG_OFDEVICE) && gk->use_keycodes) - return keycode_bb_keys[code]; - else - return code; + return keycode_bb_keys[code]; } static int gpio_keys_probe_pdata(struct gpio_keys *gk, struct device_d *dev) @@ -162,8 +157,6 @@ static int gpio_keys_probe_dt(struct gpio_keys *gk, struct device_d *dev) i++; } - gk->use_keycodes = 1; - return 0; } |