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 /arch | |
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 'arch')
-rw-r--r-- | arch/arm/boards/archosg9/board.c | 5 | ||||
-rw-r--r-- | arch/arm/boards/at91sam9261ek/init.c | 7 | ||||
-rw-r--r-- | arch/arm/boards/at91sam9m10g45ek/init.c | 15 | ||||
-rw-r--r-- | arch/arm/boards/usb-a926x/init.c | 9 |
4 files changed, 20 insertions, 16 deletions
diff --git a/arch/arm/boards/archosg9/board.c b/arch/arm/boards/archosg9/board.c index f80714ec37..6f82f5ee26 100644 --- a/arch/arm/boards/archosg9/board.c +++ b/arch/arm/boards/archosg9/board.c @@ -26,6 +26,7 @@ #include <gpio_keys.h> #include <twl6030_pwrbtn.h> #include <readkey.h> +#include <input/input.h> #include "archos_features.h" #define GPIO_LCD_PWON 38 @@ -72,8 +73,8 @@ static struct twl6030_pwrbtn_platform_data pwrbtn_data = { .code = BB_KEY_ENTER }; static struct gpio_keys_button keys[] = { - { .code = BB_KEY_UP , .gpio = 43, .active_low = 1 }, - { .code = BB_KEY_DOWN, .gpio = 44, .active_low = 1 }, + { .code = KEY_UP , .gpio = 43, .active_low = 1 }, + { .code = KEY_DOWN, .gpio = 44, .active_low = 1 }, }; static struct gpio_keys_platform_data gk_data = { .buttons = keys, diff --git a/arch/arm/boards/at91sam9261ek/init.c b/arch/arm/boards/at91sam9261ek/init.c index a0b0219191..6cb170192a 100644 --- a/arch/arm/boards/at91sam9261ek/init.c +++ b/arch/arm/boards/at91sam9261ek/init.c @@ -39,6 +39,7 @@ #include <readkey.h> #include <led.h> #include <spi/spi.h> +#include <input/input.h> static struct atmel_nand_data nand_pdata = { .ale = 22, @@ -235,13 +236,13 @@ static void ek_add_device_lcdc(void) {} #ifdef CONFIG_KEYBOARD_GPIO struct gpio_keys_button keys[] = { { - .code = BB_KEY_UP, + .code = KEY_UP, .gpio = AT91_PIN_PA26, }, { - .code = BB_KEY_DOWN, + .code = KEY_DOWN, .gpio = AT91_PIN_PA25, }, { - .code = BB_KEY_ENTER, + .code = KEY_ENTER, .gpio = AT91_PIN_PA24, }, }; diff --git a/arch/arm/boards/at91sam9m10g45ek/init.c b/arch/arm/boards/at91sam9m10g45ek/init.c index e00908bc39..fb444d820d 100644 --- a/arch/arm/boards/at91sam9m10g45ek/init.c +++ b/arch/arm/boards/at91sam9m10g45ek/init.c @@ -40,6 +40,7 @@ #include <gpio_keys.h> #include <readkey.h> #include <spi/spi.h> +#include <input/input.h> /* * board revision encoding @@ -183,25 +184,25 @@ static void ek_device_add_leds(void) {} #ifdef CONFIG_KEYBOARD_GPIO struct gpio_keys_button keys[] = { { - .code = BB_KEY_HOME, + .code = KEY_HOME, .gpio = AT91_PIN_PB6, }, { - .code = BB_KEY_RETURN, + .code = KEY_ENTER, .gpio = AT91_PIN_PB7, }, { - .code = BB_KEY_LEFT, + .code = KEY_LEFT, .gpio = AT91_PIN_PB14, }, { - .code = BB_KEY_RIGHT, + .code = KEY_RIGHT, .gpio = AT91_PIN_PB15, }, { - .code = BB_KEY_UP, + .code = KEY_UP, .gpio = AT91_PIN_PB16, }, { - .code = BB_KEY_DOWN, + .code = KEY_DOWN, .gpio = AT91_PIN_PB17, }, { - .code = BB_KEY_RETURN, + .code = KEY_ENTER, .gpio = AT91_PIN_PB18, }, }; diff --git a/arch/arm/boards/usb-a926x/init.c b/arch/arm/boards/usb-a926x/init.c index 958c3c3662..a9a0549adf 100644 --- a/arch/arm/boards/usb-a926x/init.c +++ b/arch/arm/boards/usb-a926x/init.c @@ -41,6 +41,7 @@ #include <gpio_keys.h> #include <readkey.h> #include <spi/spi.h> +#include <input/input.h> static void usb_a9260_set_board_type(void) { @@ -340,16 +341,16 @@ struct gpio_led dab_mmx_leds[] = { #ifdef CONFIG_KEYBOARD_GPIO struct gpio_keys_button keys[] = { { - .code = BB_KEY_UP, + .code = KEY_UP, .gpio = AT91_PIN_PB25, }, { - .code = BB_KEY_HOME, + .code = KEY_HOME, .gpio = AT91_PIN_PB13, }, { - .code = BB_KEY_DOWN, + .code = KEY_DOWN, .gpio = AT91_PIN_PA26, }, { - .code = BB_KEY_ENTER, + .code = KEY_ENTER, .gpio = AT91_PIN_PC9, }, }; |