aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/board-osk.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1/board-osk.c')
-rw-r--r--arch/arm/mach-omap1/board-osk.c43
1 files changed, 35 insertions, 8 deletions
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index 3e766e49f7cc..ff9e67baa5c9 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -188,7 +188,8 @@ static struct gpio_led tps_leds[] = {
188 /* NOTE: D9 and D2 have hardware blink support. 188 /* NOTE: D9 and D2 have hardware blink support.
189 * Also, D9 requires non-battery power. 189 * Also, D9 requires non-battery power.
190 */ 190 */
191 { .gpio = OSK_TPS_GPIO_LED_D9, .name = "d9", }, 191 { .gpio = OSK_TPS_GPIO_LED_D9, .name = "d9",
192 .default_trigger = "ide-disk", },
192 { .gpio = OSK_TPS_GPIO_LED_D2, .name = "d2", }, 193 { .gpio = OSK_TPS_GPIO_LED_D2, .name = "d2", },
193 { .gpio = OSK_TPS_GPIO_LED_D3, .name = "d3", .active_low = 1, 194 { .gpio = OSK_TPS_GPIO_LED_D3, .name = "d3", .active_low = 1,
194 .default_trigger = "heartbeat", }, 195 .default_trigger = "heartbeat", },
@@ -260,7 +261,6 @@ static struct i2c_board_info __initdata osk_i2c_board_info[] = {
260 }, 261 },
261 /* TODO when driver support is ready: 262 /* TODO when driver support is ready:
262 * - aic23 audio chip at 0x1a 263 * - aic23 audio chip at 0x1a
263 * - on Mistral, 24c04 eeprom at 0x50
264 * - optionally on Mistral, ov9640 camera sensor at 0x30 264 * - optionally on Mistral, ov9640 camera sensor at 0x30
265 */ 265 */
266}; 266};
@@ -288,7 +288,7 @@ static void __init osk_init_cf(void)
288 return; 288 return;
289 } 289 }
290 /* the CF I/O IRQ is really active-low */ 290 /* the CF I/O IRQ is really active-low */
291 set_irq_type(OMAP_GPIO_IRQ(62), IRQ_TYPE_EDGE_FALLING); 291 set_irq_type(gpio_to_irq(62), IRQ_TYPE_EDGE_FALLING);
292} 292}
293 293
294static void __init osk_init_irq(void) 294static void __init osk_init_irq(void)
@@ -337,11 +337,28 @@ static struct omap_board_config_kernel osk_config[] __initdata = {
337#ifdef CONFIG_OMAP_OSK_MISTRAL 337#ifdef CONFIG_OMAP_OSK_MISTRAL
338 338
339#include <linux/input.h> 339#include <linux/input.h>
340#include <linux/i2c/at24.h>
340#include <linux/spi/spi.h> 341#include <linux/spi/spi.h>
341#include <linux/spi/ads7846.h> 342#include <linux/spi/ads7846.h>
342 343
343#include <mach/keypad.h> 344#include <mach/keypad.h>
344 345
346static struct at24_platform_data at24c04 = {
347 .byte_len = SZ_4K / 8,
348 .page_size = 16,
349};
350
351static struct i2c_board_info __initdata mistral_i2c_board_info[] = {
352 {
353 /* NOTE: powered from LCD supply */
354 I2C_BOARD_INFO("24c04", 0x50),
355 .platform_data = &at24c04,
356 },
357 /* TODO when driver support is ready:
358 * - optionally ov9640 camera sensor at 0x30
359 */
360};
361
345static const int osk_keymap[] = { 362static const int osk_keymap[] = {
346 /* KEY(col, row, code) */ 363 /* KEY(col, row, code) */
347 KEY(0, 0, KEY_F1), /* SW4 */ 364 KEY(0, 0, KEY_F1), /* SW4 */
@@ -483,23 +500,30 @@ static void __init osk_mistral_init(void)
483 omap_cfg_reg(P20_1610_GPIO4); /* PENIRQ */ 500 omap_cfg_reg(P20_1610_GPIO4); /* PENIRQ */
484 gpio_request(4, "ts_int"); 501 gpio_request(4, "ts_int");
485 gpio_direction_input(4); 502 gpio_direction_input(4);
486 set_irq_type(OMAP_GPIO_IRQ(4), IRQ_TYPE_EDGE_FALLING); 503 set_irq_type(gpio_to_irq(4), IRQ_TYPE_EDGE_FALLING);
487 504
488 spi_register_board_info(mistral_boardinfo, 505 spi_register_board_info(mistral_boardinfo,
489 ARRAY_SIZE(mistral_boardinfo)); 506 ARRAY_SIZE(mistral_boardinfo));
490 507
491 /* the sideways button (SW1) is for use as a "wakeup" button */ 508 /* the sideways button (SW1) is for use as a "wakeup" button
509 *
510 * NOTE: The Mistral board has the wakeup button (SW1) wired
511 * to the LCD 3.3V rail, which is powered down during suspend.
512 * To allow this button to wake up the omap, work around this
513 * HW bug by rewiring SW1 to use the main 3.3V rail.
514 */
492 omap_cfg_reg(N15_1610_MPUIO2); 515 omap_cfg_reg(N15_1610_MPUIO2);
493 if (gpio_request(OMAP_MPUIO(2), "wakeup") == 0) { 516 if (gpio_request(OMAP_MPUIO(2), "wakeup") == 0) {
494 int ret = 0; 517 int ret = 0;
518 int irq = gpio_to_irq(OMAP_MPUIO(2));
495 519
496 gpio_direction_input(OMAP_MPUIO(2)); 520 gpio_direction_input(OMAP_MPUIO(2));
497 set_irq_type(OMAP_GPIO_IRQ(OMAP_MPUIO(2)), IRQ_TYPE_EDGE_RISING); 521 set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
498#ifdef CONFIG_PM 522#ifdef CONFIG_PM
499 /* share the IRQ in case someone wants to use the 523 /* share the IRQ in case someone wants to use the
500 * button for more than wakeup from system sleep. 524 * button for more than wakeup from system sleep.
501 */ 525 */
502 ret = request_irq(OMAP_GPIO_IRQ(OMAP_MPUIO(2)), 526 ret = request_irq(irq,
503 &osk_mistral_wake_interrupt, 527 &osk_mistral_wake_interrupt,
504 IRQF_SHARED, "mistral_wakeup", 528 IRQF_SHARED, "mistral_wakeup",
505 &osk_mistral_wake_interrupt); 529 &osk_mistral_wake_interrupt);
@@ -508,7 +532,7 @@ static void __init osk_mistral_init(void)
508 printk(KERN_ERR "OSK+Mistral: no wakeup irq, %d?\n", 532 printk(KERN_ERR "OSK+Mistral: no wakeup irq, %d?\n",
509 ret); 533 ret);
510 } else 534 } else
511 enable_irq_wake(OMAP_GPIO_IRQ(OMAP_MPUIO(2))); 535 enable_irq_wake(irq);
512#endif 536#endif
513 } else 537 } else
514 printk(KERN_ERR "OSK+Mistral: wakeup button is awol\n"); 538 printk(KERN_ERR "OSK+Mistral: wakeup button is awol\n");
@@ -520,6 +544,9 @@ static void __init osk_mistral_init(void)
520 if (gpio_request(2, "lcd_pwr") == 0) 544 if (gpio_request(2, "lcd_pwr") == 0)
521 gpio_direction_output(2, 1); 545 gpio_direction_output(2, 1);
522 546
547 i2c_register_board_info(1, mistral_i2c_board_info,
548 ARRAY_SIZE(mistral_i2c_board_info));
549
523 platform_add_devices(mistral_devices, ARRAY_SIZE(mistral_devices)); 550 platform_add_devices(mistral_devices, ARRAY_SIZE(mistral_devices));
524} 551}
525#else 552#else