diff options
author | Kyungmin Park <kyungmin.park@samsung.com> | 2010-08-20 20:49:49 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2010-10-20 18:52:15 -0400 |
commit | 34d79315a22b743a8f4e26c2e11fa16469c71473 (patch) | |
tree | f58fb76bd01ebbcf3a580daa6217fb77244f733a /arch/arm/mach-s5pv310 | |
parent | ca0ffd469af6a00a24a1f888ac280e3e7d4951f5 (diff) |
ARM: S5PV310: Add GPIO keys at Universal board
Universal board has 5 GPIO keys.
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s5pv310')
-rw-r--r-- | arch/arm/mach-s5pv310/mach-universal_c210.c | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/arch/arm/mach-s5pv310/mach-universal_c210.c b/arch/arm/mach-s5pv310/mach-universal_c210.c index 2388cb947936..b57efaeb295f 100644 --- a/arch/arm/mach-s5pv310/mach-universal_c210.c +++ b/arch/arm/mach-s5pv310/mach-universal_c210.c | |||
@@ -7,7 +7,11 @@ | |||
7 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/platform_device.h> | ||
10 | #include <linux/serial_core.h> | 11 | #include <linux/serial_core.h> |
12 | #include <linux/input.h> | ||
13 | #include <linux/gpio_keys.h> | ||
14 | #include <linux/gpio.h> | ||
11 | 15 | ||
12 | #include <asm/mach/arch.h> | 16 | #include <asm/mach/arch.h> |
13 | #include <asm/mach-types.h> | 17 | #include <asm/mach-types.h> |
@@ -60,6 +64,61 @@ static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = { | |||
60 | }, | 64 | }, |
61 | }; | 65 | }; |
62 | 66 | ||
67 | static struct gpio_keys_button universal_gpio_keys_tables[] = { | ||
68 | { | ||
69 | .code = KEY_VOLUMEUP, | ||
70 | .gpio = S5PV310_GPX2(0), /* XEINT16 */ | ||
71 | .desc = "gpio-keys: KEY_VOLUMEUP", | ||
72 | .type = EV_KEY, | ||
73 | .active_low = 1, | ||
74 | .debounce_interval = 1, | ||
75 | }, { | ||
76 | .code = KEY_VOLUMEDOWN, | ||
77 | .gpio = S5PV310_GPX2(1), /* XEINT17 */ | ||
78 | .desc = "gpio-keys: KEY_VOLUMEDOWN", | ||
79 | .type = EV_KEY, | ||
80 | .active_low = 1, | ||
81 | .debounce_interval = 1, | ||
82 | }, { | ||
83 | .code = KEY_CONFIG, | ||
84 | .gpio = S5PV310_GPX2(2), /* XEINT18 */ | ||
85 | .desc = "gpio-keys: KEY_CONFIG", | ||
86 | .type = EV_KEY, | ||
87 | .active_low = 1, | ||
88 | .debounce_interval = 1, | ||
89 | }, { | ||
90 | .code = KEY_CAMERA, | ||
91 | .gpio = S5PV310_GPX2(3), /* XEINT19 */ | ||
92 | .desc = "gpio-keys: KEY_CAMERA", | ||
93 | .type = EV_KEY, | ||
94 | .active_low = 1, | ||
95 | .debounce_interval = 1, | ||
96 | }, { | ||
97 | .code = KEY_OK, | ||
98 | .gpio = S5PV310_GPX3(5), /* XEINT29 */ | ||
99 | .desc = "gpio-keys: KEY_OK", | ||
100 | .type = EV_KEY, | ||
101 | .active_low = 1, | ||
102 | .debounce_interval = 1, | ||
103 | }, | ||
104 | }; | ||
105 | |||
106 | static struct gpio_keys_platform_data universal_gpio_keys_data = { | ||
107 | .buttons = universal_gpio_keys_tables, | ||
108 | .nbuttons = ARRAY_SIZE(universal_gpio_keys_tables), | ||
109 | }; | ||
110 | |||
111 | static struct platform_device universal_gpio_keys = { | ||
112 | .name = "gpio-keys", | ||
113 | .dev = { | ||
114 | .platform_data = &universal_gpio_keys_data, | ||
115 | }, | ||
116 | }; | ||
117 | |||
118 | static struct platform_device *universal_devices[] __initdata = { | ||
119 | &universal_gpio_keys, | ||
120 | }; | ||
121 | |||
63 | static void __init universal_map_io(void) | 122 | static void __init universal_map_io(void) |
64 | { | 123 | { |
65 | s5p_init_io(NULL, 0, S5P_VA_CHIPID); | 124 | s5p_init_io(NULL, 0, S5P_VA_CHIPID); |
@@ -72,6 +131,9 @@ static void __init universal_machine_init(void) | |||
72 | #ifdef CONFIG_CACHE_L2X0 | 131 | #ifdef CONFIG_CACHE_L2X0 |
73 | l2x0_init(S5P_VA_L2CC, 1 << 28, 0xffffffff); | 132 | l2x0_init(S5P_VA_L2CC, 1 << 28, 0xffffffff); |
74 | #endif | 133 | #endif |
134 | |||
135 | /* Last */ | ||
136 | platform_add_devices(universal_devices, ARRAY_SIZE(universal_devices)); | ||
75 | } | 137 | } |
76 | 138 | ||
77 | MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") | 139 | MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") |