diff options
Diffstat (limited to 'arch/arm/mach-at91/board-sam9263ek.c')
-rw-r--r-- | arch/arm/mach-at91/board-sam9263ek.c | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c index ab9dcc075454..f09347a86e71 100644 --- a/arch/arm/mach-at91/board-sam9263ek.c +++ b/arch/arm/mach-at91/board-sam9263ek.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <linux/spi/spi.h> | 27 | #include <linux/spi/spi.h> |
28 | #include <linux/spi/ads7846.h> | 28 | #include <linux/spi/ads7846.h> |
29 | #include <linux/fb.h> | 29 | #include <linux/fb.h> |
30 | #include <linux/gpio_keys.h> | ||
31 | #include <linux/input.h> | ||
30 | 32 | ||
31 | #include <video/atmel_lcdc.h> | 33 | #include <video/atmel_lcdc.h> |
32 | 34 | ||
@@ -163,6 +165,7 @@ static struct at91_mmc_data __initdata ek_mmc_data = { | |||
163 | * MACB Ethernet device | 165 | * MACB Ethernet device |
164 | */ | 166 | */ |
165 | static struct at91_eth_data __initdata ek_macb_data = { | 167 | static struct at91_eth_data __initdata ek_macb_data = { |
168 | .phy_irq_pin = AT91_PIN_PE31, | ||
166 | .is_rmii = 1, | 169 | .is_rmii = 1, |
167 | }; | 170 | }; |
168 | 171 | ||
@@ -264,6 +267,55 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data; | |||
264 | 267 | ||
265 | 268 | ||
266 | /* | 269 | /* |
270 | * GPIO Buttons | ||
271 | */ | ||
272 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
273 | static struct gpio_keys_button ek_buttons[] = { | ||
274 | { /* BP1, "leftclic" */ | ||
275 | .code = BTN_LEFT, | ||
276 | .gpio = AT91_PIN_PC5, | ||
277 | .active_low = 1, | ||
278 | .desc = "left_click", | ||
279 | .wakeup = 1, | ||
280 | }, | ||
281 | { /* BP2, "rightclic" */ | ||
282 | .code = BTN_RIGHT, | ||
283 | .gpio = AT91_PIN_PC4, | ||
284 | .active_low = 1, | ||
285 | .desc = "right_click", | ||
286 | .wakeup = 1, | ||
287 | }, | ||
288 | }; | ||
289 | |||
290 | static struct gpio_keys_platform_data ek_button_data = { | ||
291 | .buttons = ek_buttons, | ||
292 | .nbuttons = ARRAY_SIZE(ek_buttons), | ||
293 | }; | ||
294 | |||
295 | static struct platform_device ek_button_device = { | ||
296 | .name = "gpio-keys", | ||
297 | .id = -1, | ||
298 | .num_resources = 0, | ||
299 | .dev = { | ||
300 | .platform_data = &ek_button_data, | ||
301 | } | ||
302 | }; | ||
303 | |||
304 | static void __init ek_add_device_buttons(void) | ||
305 | { | ||
306 | at91_set_GPIO_periph(AT91_PIN_PC5, 0); /* left button */ | ||
307 | at91_set_deglitch(AT91_PIN_PC5, 1); | ||
308 | at91_set_GPIO_periph(AT91_PIN_PC4, 0); /* right button */ | ||
309 | at91_set_deglitch(AT91_PIN_PC4, 1); | ||
310 | |||
311 | platform_device_register(&ek_button_device); | ||
312 | } | ||
313 | #else | ||
314 | static void __init ek_add_device_buttons(void) {} | ||
315 | #endif | ||
316 | |||
317 | |||
318 | /* | ||
267 | * AC97 | 319 | * AC97 |
268 | */ | 320 | */ |
269 | static struct atmel_ac97_data ek_ac97_data = { | 321 | static struct atmel_ac97_data ek_ac97_data = { |
@@ -271,6 +323,30 @@ static struct atmel_ac97_data ek_ac97_data = { | |||
271 | }; | 323 | }; |
272 | 324 | ||
273 | 325 | ||
326 | /* | ||
327 | * LEDs ... these could all be PWM-driven, for variable brightness | ||
328 | */ | ||
329 | static struct gpio_led ek_leds[] = { | ||
330 | { /* "left" led, green, userled1, pwm1 */ | ||
331 | .name = "ds1", | ||
332 | .gpio = AT91_PIN_PB8, | ||
333 | .active_low = 1, | ||
334 | .default_trigger = "mmc0", | ||
335 | }, | ||
336 | { /* "right" led, green, userled2, pwm2 */ | ||
337 | .name = "ds2", | ||
338 | .gpio = AT91_PIN_PC29, | ||
339 | .active_low = 1, | ||
340 | .default_trigger = "nand-disk", | ||
341 | }, | ||
342 | { /* "power" led, yellow, pwm0 */ | ||
343 | .name = "ds3", | ||
344 | .gpio = AT91_PIN_PB7, | ||
345 | .default_trigger = "heartbeat", | ||
346 | }, | ||
347 | }; | ||
348 | |||
349 | |||
274 | static void __init ek_board_init(void) | 350 | static void __init ek_board_init(void) |
275 | { | 351 | { |
276 | /* Serial */ | 352 | /* Serial */ |
@@ -294,8 +370,12 @@ static void __init ek_board_init(void) | |||
294 | at91_add_device_i2c(NULL, 0); | 370 | at91_add_device_i2c(NULL, 0); |
295 | /* LCD Controller */ | 371 | /* LCD Controller */ |
296 | at91_add_device_lcdc(&ek_lcdc_data); | 372 | at91_add_device_lcdc(&ek_lcdc_data); |
373 | /* Push Buttons */ | ||
374 | ek_add_device_buttons(); | ||
297 | /* AC97 */ | 375 | /* AC97 */ |
298 | at91_add_device_ac97(&ek_ac97_data); | 376 | at91_add_device_ac97(&ek_ac97_data); |
377 | /* LEDs */ | ||
378 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); | ||
299 | } | 379 | } |
300 | 380 | ||
301 | MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK") | 381 | MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK") |