diff options
author | Olof Johansson <olof@lixom.net> | 2013-08-14 12:10:52 +0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2013-08-14 12:10:52 +0400 |
commit | 70ba4d285a52db57d8b939745b4d01639d1e6ff2 (patch) | |
tree | 2bf786dd7f70f50bebd73672a83800cf104b1863 /arch/arm/mach-shmobile/board-ape6evm.c | |
parent | 6b08e4370c0ffa57acfdb593d69306bbd6ca8b03 (diff) | |
parent | 4901e136aa5c35873701156c4c0af5b3c2c8faee (diff) | |
download | linux-70ba4d285a52db57d8b939745b4d01639d1e6ff2.tar.xz |
Merge tag 'renesas-boards2-for-v3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/boards
From Simon Horman:
Second round of Renesas ARM-based SoC board updates for v3.12
* Enable ether on lager board
* Enable GPIO LEDs and switches on ape6evm board
* tag 'renesas-boards2-for-v3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
ARM: shmobile: lager: enable Ether
ARM: shmobile: ape6evm: Add GPIO LEDs
ARM: shmobile: ape6evm: support GPIO switches
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-shmobile/board-ape6evm.c')
-rw-r--r-- | arch/arm/mach-shmobile/board-ape6evm.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c index ccf8b0429083..db97460665d5 100644 --- a/arch/arm/mach-shmobile/board-ape6evm.c +++ b/arch/arm/mach-shmobile/board-ape6evm.c @@ -19,6 +19,8 @@ */ #include <linux/gpio.h> +#include <linux/gpio_keys.h> +#include <linux/input.h> #include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/mfd/tmio.h> @@ -37,6 +39,58 @@ #include <asm/mach-types.h> #include <asm/mach/arch.h> +/* LEDS */ +static struct gpio_led ape6evm_leds[] = { + { + .name = "gnss-en", + .gpio = 28, + .default_state = LEDS_GPIO_DEFSTATE_OFF, + }, { + .name = "nfc-nrst", + .gpio = 126, + .default_state = LEDS_GPIO_DEFSTATE_OFF, + }, { + .name = "gnss-nrst", + .gpio = 132, + .default_state = LEDS_GPIO_DEFSTATE_OFF, + }, { + .name = "bt-wakeup", + .gpio = 232, + .default_state = LEDS_GPIO_DEFSTATE_OFF, + }, { + .name = "strobe", + .gpio = 250, + .default_state = LEDS_GPIO_DEFSTATE_OFF, + }, { + .name = "bbresetout", + .gpio = 288, + .default_state = LEDS_GPIO_DEFSTATE_OFF, + }, +}; + +static __initdata struct gpio_led_platform_data ape6evm_leds_pdata = { + .leds = ape6evm_leds, + .num_leds = ARRAY_SIZE(ape6evm_leds), +}; + +/* GPIO KEY */ +#define GPIO_KEY(c, g, d, ...) \ + { .code = c, .gpio = g, .desc = d, .active_low = 1 } + +static struct gpio_keys_button gpio_buttons[] = { + GPIO_KEY(KEY_0, 324, "S16"), + GPIO_KEY(KEY_MENU, 325, "S17"), + GPIO_KEY(KEY_HOME, 326, "S18"), + GPIO_KEY(KEY_BACK, 327, "S19"), + GPIO_KEY(KEY_VOLUMEUP, 328, "S20"), + GPIO_KEY(KEY_VOLUMEDOWN, 329, "S21"), +}; + +static struct __initdata gpio_keys_platform_data ape6evm_keys_pdata = { + .buttons = gpio_buttons, + .nbuttons = ARRAY_SIZE(gpio_buttons), +}; + /* Dummy supplies, where voltage doesn't matter */ static struct regulator_consumer_supply dummy_supplies[] = { REGULATOR_SUPPLY("vddvario", "smsc911x"), @@ -172,6 +226,12 @@ static void __init ape6evm_add_standard_devices(void) platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 1, sdhi1_resources, ARRAY_SIZE(sdhi1_resources), &sdhi1_pdata, sizeof(sdhi1_pdata)); + platform_device_register_data(&platform_bus, "gpio-keys", -1, + &ape6evm_keys_pdata, + sizeof(ape6evm_keys_pdata)); + platform_device_register_data(&platform_bus, "leds-gpio", -1, + &ape6evm_leds_pdata, + sizeof(ape6evm_leds_pdata)); } static const char *ape6evm_boards_compat_dt[] __initdata = { |