diff options
author | Magnus Damm <damm@opensource.se> | 2013-10-07 23:40:08 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-12-10 03:24:19 -0500 |
commit | 721319d1ab8bb854ad4befc3ac70b7401d2d7dab (patch) | |
tree | 0d294d9dfe642f692797806c3e1ecf81e38c318e | |
parent | 87a2934ecff1e054b5d2b7cb6dea2ee0eb649ff3 (diff) |
ARM: shmobile: Add Koelsch SW2 support
Enable Koelsch GPIO switch for GPIO input and IRQ testing purpose.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r-- | arch/arm/mach-shmobile/board-koelsch.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c index 2299d658a843..59fa0b975473 100644 --- a/arch/arm/mach-shmobile/board-koelsch.c +++ b/arch/arm/mach-shmobile/board-koelsch.c | |||
@@ -19,6 +19,9 @@ | |||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <linux/gpio.h> | ||
23 | #include <linux/gpio_keys.h> | ||
24 | #include <linux/input.h> | ||
22 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
23 | #include <linux/leds.h> | 26 | #include <linux/leds.h> |
24 | #include <linux/platform_data/gpio-rcar.h> | 27 | #include <linux/platform_data/gpio-rcar.h> |
@@ -51,6 +54,22 @@ static const struct gpio_led_platform_data koelsch_leds_pdata __initconst = { | |||
51 | .num_leds = ARRAY_SIZE(koelsch_leds), | 54 | .num_leds = ARRAY_SIZE(koelsch_leds), |
52 | }; | 55 | }; |
53 | 56 | ||
57 | /* GPIO KEY */ | ||
58 | #define GPIO_KEY(c, g, d, ...) \ | ||
59 | { .code = c, .gpio = g, .desc = d, .active_low = 1 } | ||
60 | |||
61 | static struct gpio_keys_button gpio_buttons[] = { | ||
62 | GPIO_KEY(KEY_4, RCAR_GP_PIN(5, 3), "SW2-pin4"), | ||
63 | GPIO_KEY(KEY_3, RCAR_GP_PIN(5, 2), "SW2-pin3"), | ||
64 | GPIO_KEY(KEY_2, RCAR_GP_PIN(5, 1), "SW2-pin2"), | ||
65 | GPIO_KEY(KEY_1, RCAR_GP_PIN(5, 0), "SW2-pin1"), | ||
66 | }; | ||
67 | |||
68 | static const struct gpio_keys_platform_data koelsch_keys_pdata __initconst = { | ||
69 | .buttons = gpio_buttons, | ||
70 | .nbuttons = ARRAY_SIZE(gpio_buttons), | ||
71 | }; | ||
72 | |||
54 | static void __init koelsch_add_standard_devices(void) | 73 | static void __init koelsch_add_standard_devices(void) |
55 | { | 74 | { |
56 | r8a7791_clock_init(); | 75 | r8a7791_clock_init(); |
@@ -59,6 +78,9 @@ static void __init koelsch_add_standard_devices(void) | |||
59 | platform_device_register_data(&platform_bus, "leds-gpio", -1, | 78 | platform_device_register_data(&platform_bus, "leds-gpio", -1, |
60 | &koelsch_leds_pdata, | 79 | &koelsch_leds_pdata, |
61 | sizeof(koelsch_leds_pdata)); | 80 | sizeof(koelsch_leds_pdata)); |
81 | platform_device_register_data(&platform_bus, "gpio-keys", -1, | ||
82 | &koelsch_keys_pdata, | ||
83 | sizeof(koelsch_keys_pdata)); | ||
62 | } | 84 | } |
63 | 85 | ||
64 | static const char * const koelsch_boards_compat_dt[] __initconst = { | 86 | static const char * const koelsch_boards_compat_dt[] __initconst = { |