diff options
Diffstat (limited to 'arch/arm/mach-s5pv310/mach-universal_c210.c')
-rw-r--r-- | arch/arm/mach-s5pv310/mach-universal_c210.c | 81 |
1 files changed, 77 insertions, 4 deletions
diff --git a/arch/arm/mach-s5pv310/mach-universal_c210.c b/arch/arm/mach-s5pv310/mach-universal_c210.c index d7c2ec770f88..16d8fc00cafd 100644 --- a/arch/arm/mach-s5pv310/mach-universal_c210.c +++ b/arch/arm/mach-s5pv310/mach-universal_c210.c | |||
@@ -7,15 +7,20 @@ | |||
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/i2c.h> | ||
14 | #include <linux/gpio_keys.h> | ||
15 | #include <linux/gpio.h> | ||
11 | 16 | ||
12 | #include <asm/mach/arch.h> | 17 | #include <asm/mach/arch.h> |
13 | #include <asm/mach-types.h> | 18 | #include <asm/mach-types.h> |
14 | #include <asm/hardware/cache-l2x0.h> | ||
15 | 19 | ||
16 | #include <plat/regs-serial.h> | 20 | #include <plat/regs-serial.h> |
17 | #include <plat/s5pv310.h> | 21 | #include <plat/s5pv310.h> |
18 | #include <plat/cpu.h> | 22 | #include <plat/cpu.h> |
23 | #include <plat/devs.h> | ||
19 | 24 | ||
20 | #include <mach/map.h> | 25 | #include <mach/map.h> |
21 | 26 | ||
@@ -60,6 +65,72 @@ static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = { | |||
60 | }, | 65 | }, |
61 | }; | 66 | }; |
62 | 67 | ||
68 | static struct gpio_keys_button universal_gpio_keys_tables[] = { | ||
69 | { | ||
70 | .code = KEY_VOLUMEUP, | ||
71 | .gpio = S5PV310_GPX2(0), /* XEINT16 */ | ||
72 | .desc = "gpio-keys: KEY_VOLUMEUP", | ||
73 | .type = EV_KEY, | ||
74 | .active_low = 1, | ||
75 | .debounce_interval = 1, | ||
76 | }, { | ||
77 | .code = KEY_VOLUMEDOWN, | ||
78 | .gpio = S5PV310_GPX2(1), /* XEINT17 */ | ||
79 | .desc = "gpio-keys: KEY_VOLUMEDOWN", | ||
80 | .type = EV_KEY, | ||
81 | .active_low = 1, | ||
82 | .debounce_interval = 1, | ||
83 | }, { | ||
84 | .code = KEY_CONFIG, | ||
85 | .gpio = S5PV310_GPX2(2), /* XEINT18 */ | ||
86 | .desc = "gpio-keys: KEY_CONFIG", | ||
87 | .type = EV_KEY, | ||
88 | .active_low = 1, | ||
89 | .debounce_interval = 1, | ||
90 | }, { | ||
91 | .code = KEY_CAMERA, | ||
92 | .gpio = S5PV310_GPX2(3), /* XEINT19 */ | ||
93 | .desc = "gpio-keys: KEY_CAMERA", | ||
94 | .type = EV_KEY, | ||
95 | .active_low = 1, | ||
96 | .debounce_interval = 1, | ||
97 | }, { | ||
98 | .code = KEY_OK, | ||
99 | .gpio = S5PV310_GPX3(5), /* XEINT29 */ | ||
100 | .desc = "gpio-keys: KEY_OK", | ||
101 | .type = EV_KEY, | ||
102 | .active_low = 1, | ||
103 | .debounce_interval = 1, | ||
104 | }, | ||
105 | }; | ||
106 | |||
107 | static struct gpio_keys_platform_data universal_gpio_keys_data = { | ||
108 | .buttons = universal_gpio_keys_tables, | ||
109 | .nbuttons = ARRAY_SIZE(universal_gpio_keys_tables), | ||
110 | }; | ||
111 | |||
112 | static struct platform_device universal_gpio_keys = { | ||
113 | .name = "gpio-keys", | ||
114 | .dev = { | ||
115 | .platform_data = &universal_gpio_keys_data, | ||
116 | }, | ||
117 | }; | ||
118 | |||
119 | /* I2C0 */ | ||
120 | static struct i2c_board_info i2c0_devs[] __initdata = { | ||
121 | /* Camera, To be updated */ | ||
122 | }; | ||
123 | |||
124 | /* I2C1 */ | ||
125 | static struct i2c_board_info i2c1_devs[] __initdata = { | ||
126 | /* Gyro, To be updated */ | ||
127 | }; | ||
128 | |||
129 | static struct platform_device *universal_devices[] __initdata = { | ||
130 | &universal_gpio_keys, | ||
131 | &s5p_device_onenand, | ||
132 | }; | ||
133 | |||
63 | static void __init universal_map_io(void) | 134 | static void __init universal_map_io(void) |
64 | { | 135 | { |
65 | s5p_init_io(NULL, 0, S5P_VA_CHIPID); | 136 | s5p_init_io(NULL, 0, S5P_VA_CHIPID); |
@@ -69,9 +140,11 @@ static void __init universal_map_io(void) | |||
69 | 140 | ||
70 | static void __init universal_machine_init(void) | 141 | static void __init universal_machine_init(void) |
71 | { | 142 | { |
72 | #ifdef CONFIG_CACHE_L2X0 | 143 | i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs)); |
73 | l2x0_init(S5P_VA_L2CC, 1 << 28, 0xffffffff); | 144 | i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); |
74 | #endif | 145 | |
146 | /* Last */ | ||
147 | platform_add_devices(universal_devices, ARRAY_SIZE(universal_devices)); | ||
75 | } | 148 | } |
76 | 149 | ||
77 | MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") | 150 | MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") |