diff options
Diffstat (limited to 'arch/arm/mach-at91/board-sam9260ek.c')
-rw-r--r-- | arch/arm/mach-at91/board-sam9260ek.c | 80 |
1 files changed, 76 insertions, 4 deletions
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c index cb20e70b3b06..b49eb6e4918a 100644 --- a/arch/arm/mach-at91/board-sam9260ek.c +++ b/arch/arm/mach-at91/board-sam9260ek.c | |||
@@ -27,8 +27,10 @@ | |||
27 | #include <linux/spi/spi.h> | 27 | #include <linux/spi/spi.h> |
28 | #include <linux/spi/at73c213.h> | 28 | #include <linux/spi/at73c213.h> |
29 | #include <linux/clk.h> | 29 | #include <linux/clk.h> |
30 | #include <linux/i2c/at24.h> | ||
31 | #include <linux/gpio_keys.h> | ||
32 | #include <linux/input.h> | ||
30 | 33 | ||
31 | #include <mach/hardware.h> | ||
32 | #include <asm/setup.h> | 34 | #include <asm/setup.h> |
33 | #include <asm/mach-types.h> | 35 | #include <asm/mach-types.h> |
34 | #include <asm/irq.h> | 36 | #include <asm/irq.h> |
@@ -37,6 +39,7 @@ | |||
37 | #include <asm/mach/map.h> | 39 | #include <asm/mach/map.h> |
38 | #include <asm/mach/irq.h> | 40 | #include <asm/mach/irq.h> |
39 | 41 | ||
42 | #include <mach/hardware.h> | ||
40 | #include <mach/board.h> | 43 | #include <mach/board.h> |
41 | #include <mach/gpio.h> | 44 | #include <mach/gpio.h> |
42 | 45 | ||
@@ -163,11 +166,11 @@ static struct mtd_partition __initdata ek_nand_partition[] = { | |||
163 | { | 166 | { |
164 | .name = "Partition 1", | 167 | .name = "Partition 1", |
165 | .offset = 0, | 168 | .offset = 0, |
166 | .size = 256 * 1024, | 169 | .size = SZ_256K, |
167 | }, | 170 | }, |
168 | { | 171 | { |
169 | .name = "Partition 2", | 172 | .name = "Partition 2", |
170 | .offset = 256 * 1024, | 173 | .offset = MTDPART_OFS_NXTBLK, |
171 | .size = MTDPART_SIZ_FULL, | 174 | .size = MTDPART_SIZ_FULL, |
172 | }, | 175 | }, |
173 | }; | 176 | }; |
@@ -222,6 +225,73 @@ static struct gpio_led ek_leds[] = { | |||
222 | } | 225 | } |
223 | }; | 226 | }; |
224 | 227 | ||
228 | /* | ||
229 | * I2C devices | ||
230 | */ | ||
231 | static struct at24_platform_data at24c512 = { | ||
232 | .byte_len = SZ_512K / 8, | ||
233 | .page_size = 128, | ||
234 | .flags = AT24_FLAG_ADDR16, | ||
235 | }; | ||
236 | |||
237 | static struct i2c_board_info __initdata ek_i2c_devices[] = { | ||
238 | { | ||
239 | I2C_BOARD_INFO("24c512", 0x50), | ||
240 | .platform_data = &at24c512, | ||
241 | }, | ||
242 | /* more devices can be added using expansion connectors */ | ||
243 | }; | ||
244 | |||
245 | |||
246 | /* | ||
247 | * GPIO Buttons | ||
248 | */ | ||
249 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
250 | static struct gpio_keys_button ek_buttons[] = { | ||
251 | { | ||
252 | .gpio = AT91_PIN_PA30, | ||
253 | .code = BTN_3, | ||
254 | .desc = "Button 3", | ||
255 | .active_low = 1, | ||
256 | .wakeup = 1, | ||
257 | }, | ||
258 | { | ||
259 | .gpio = AT91_PIN_PA31, | ||
260 | .code = BTN_4, | ||
261 | .desc = "Button 4", | ||
262 | .active_low = 1, | ||
263 | .wakeup = 1, | ||
264 | } | ||
265 | }; | ||
266 | |||
267 | static struct gpio_keys_platform_data ek_button_data = { | ||
268 | .buttons = ek_buttons, | ||
269 | .nbuttons = ARRAY_SIZE(ek_buttons), | ||
270 | }; | ||
271 | |||
272 | static struct platform_device ek_button_device = { | ||
273 | .name = "gpio-keys", | ||
274 | .id = -1, | ||
275 | .num_resources = 0, | ||
276 | .dev = { | ||
277 | .platform_data = &ek_button_data, | ||
278 | } | ||
279 | }; | ||
280 | |||
281 | static void __init ek_add_device_buttons(void) | ||
282 | { | ||
283 | at91_set_gpio_input(AT91_PIN_PA30, 1); /* btn3 */ | ||
284 | at91_set_deglitch(AT91_PIN_PA30, 1); | ||
285 | at91_set_gpio_input(AT91_PIN_PA31, 1); /* btn4 */ | ||
286 | at91_set_deglitch(AT91_PIN_PA31, 1); | ||
287 | |||
288 | platform_device_register(&ek_button_device); | ||
289 | } | ||
290 | #else | ||
291 | static void __init ek_add_device_buttons(void) {} | ||
292 | #endif | ||
293 | |||
294 | |||
225 | static void __init ek_board_init(void) | 295 | static void __init ek_board_init(void) |
226 | { | 296 | { |
227 | /* Serial */ | 297 | /* Serial */ |
@@ -239,12 +309,14 @@ static void __init ek_board_init(void) | |||
239 | /* MMC */ | 309 | /* MMC */ |
240 | at91_add_device_mmc(0, &ek_mmc_data); | 310 | at91_add_device_mmc(0, &ek_mmc_data); |
241 | /* I2C */ | 311 | /* I2C */ |
242 | at91_add_device_i2c(NULL, 0); | 312 | at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices)); |
243 | /* SSC (to AT73C213) */ | 313 | /* SSC (to AT73C213) */ |
244 | at73c213_set_clk(&at73c213_data); | 314 | at73c213_set_clk(&at73c213_data); |
245 | at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX); | 315 | at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX); |
246 | /* LEDs */ | 316 | /* LEDs */ |
247 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); | 317 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); |
318 | /* Push Buttons */ | ||
319 | ek_add_device_buttons(); | ||
248 | } | 320 | } |
249 | 321 | ||
250 | MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK") | 322 | MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK") |