diff options
| -rw-r--r-- | arch/arm/mach-omap2/board-igep0020.c | 54 |
1 files changed, 36 insertions, 18 deletions
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index 4f1accf7f7f3..3c7789d45051 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #include <linux/clk.h> | 16 | #include <linux/clk.h> |
| 17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
| 18 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
| 19 | #include <linux/leds.h> | ||
| 20 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
| 21 | 20 | ||
| 22 | #include <linux/regulator/machine.h> | 21 | #include <linux/regulator/machine.h> |
| @@ -39,8 +38,8 @@ | |||
| 39 | #define IGEP2_SMSC911X_CS 5 | 38 | #define IGEP2_SMSC911X_CS 5 |
| 40 | #define IGEP2_SMSC911X_GPIO 176 | 39 | #define IGEP2_SMSC911X_GPIO 176 |
| 41 | #define IGEP2_GPIO_USBH_NRESET 24 | 40 | #define IGEP2_GPIO_USBH_NRESET 24 |
| 42 | #define IGEP2_GPIO_LED0_RED 26 | 41 | #define IGEP2_GPIO_LED0_GREEN 26 |
| 43 | #define IGEP2_GPIO_LED0_GREEN 27 | 42 | #define IGEP2_GPIO_LED0_RED 27 |
| 44 | #define IGEP2_GPIO_LED1_RED 28 | 43 | #define IGEP2_GPIO_LED1_RED 28 |
| 45 | #define IGEP2_GPIO_DVI_PUP 170 | 44 | #define IGEP2_GPIO_DVI_PUP 170 |
| 46 | #define IGEP2_GPIO_WIFI_NPD 94 | 45 | #define IGEP2_GPIO_WIFI_NPD 94 |
| @@ -355,34 +354,50 @@ static void __init igep2_display_init(void) | |||
| 355 | gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1)) | 354 | gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1)) |
| 356 | pr_err("IGEP v2: Could not obtain gpio GPIO_DVI_PUP\n"); | 355 | pr_err("IGEP v2: Could not obtain gpio GPIO_DVI_PUP\n"); |
| 357 | } | 356 | } |
| 358 | #ifdef CONFIG_LEDS_TRIGGERS | 357 | |
| 359 | static struct gpio_led gpio_leds[] = { | 358 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) |
| 359 | #include <linux/leds.h> | ||
| 360 | |||
| 361 | static struct gpio_led igep2_gpio_leds[] = { | ||
| 360 | { | 362 | { |
| 361 | .name = "GPIO_LED1_RED", | 363 | .name = "led0:red", |
| 364 | .gpio = IGEP2_GPIO_LED0_RED, | ||
| 365 | }, | ||
| 366 | { | ||
| 367 | .name = "led0:green", | ||
| 362 | .default_trigger = "heartbeat", | 368 | .default_trigger = "heartbeat", |
| 369 | .gpio = IGEP2_GPIO_LED0_GREEN, | ||
| 370 | }, | ||
| 371 | { | ||
| 372 | .name = "led1:red", | ||
| 363 | .gpio = IGEP2_GPIO_LED1_RED, | 373 | .gpio = IGEP2_GPIO_LED1_RED, |
| 364 | }, | 374 | }, |
| 365 | }; | 375 | }; |
| 366 | 376 | ||
| 367 | static struct gpio_led_platform_data gpio_leds_info = { | 377 | static struct gpio_led_platform_data igep2_led_pdata = { |
| 368 | .leds = gpio_leds, | 378 | .leds = igep2_gpio_leds, |
| 369 | .num_leds = ARRAY_SIZE(gpio_leds), | 379 | .num_leds = ARRAY_SIZE(igep2_gpio_leds), |
| 370 | }; | 380 | }; |
| 371 | 381 | ||
| 372 | static struct platform_device leds_gpio = { | 382 | static struct platform_device igep2_led_device = { |
| 373 | .name = "leds-gpio", | 383 | .name = "leds-gpio", |
| 374 | .id = -1, | 384 | .id = -1, |
| 375 | .dev = { | 385 | .dev = { |
| 376 | .platform_data = &gpio_leds_info, | 386 | .platform_data = &igep2_led_pdata, |
| 377 | }, | 387 | }, |
| 378 | }; | 388 | }; |
| 389 | |||
| 390 | static void __init igep2_init_led(void) | ||
| 391 | { | ||
| 392 | platform_device_register(&igep2_led_device); | ||
| 393 | } | ||
| 394 | |||
| 395 | #else | ||
| 396 | static inline void igep2_init_led(void) {} | ||
| 379 | #endif | 397 | #endif |
| 380 | 398 | ||
| 381 | static struct platform_device *igep2_devices[] __initdata = { | 399 | static struct platform_device *igep2_devices[] __initdata = { |
| 382 | &igep2_dss_device, | 400 | &igep2_dss_device, |
| 383 | #ifdef CONFIG_LEDS_TRIGGERS | ||
| 384 | &leds_gpio, | ||
| 385 | #endif | ||
| 386 | }; | 401 | }; |
| 387 | 402 | ||
| 388 | static void __init igep2_init_irq(void) | 403 | static void __init igep2_init_irq(void) |
| @@ -471,31 +486,34 @@ static void __init igep2_init(void) | |||
| 471 | usb_ehci_init(&ehci_pdata); | 486 | usb_ehci_init(&ehci_pdata); |
| 472 | 487 | ||
| 473 | igep2_flash_init(); | 488 | igep2_flash_init(); |
| 489 | igep2_init_led(); | ||
| 474 | igep2_display_init(); | 490 | igep2_display_init(); |
| 475 | igep2_init_smsc911x(); | 491 | igep2_init_smsc911x(); |
| 476 | 492 | ||
| 477 | /* GPIO userspace leds */ | 493 | /* GPIO userspace leds */ |
| 478 | if ((gpio_request(IGEP2_GPIO_LED0_RED, "GPIO_LED0_RED") == 0) && | 494 | #if !defined(CONFIG_LEDS_GPIO) && !defined(CONFIG_LEDS_GPIO_MODULE) |
| 495 | if ((gpio_request(IGEP2_GPIO_LED0_RED, "led0:red") == 0) && | ||
| 479 | (gpio_direction_output(IGEP2_GPIO_LED0_RED, 1) == 0)) { | 496 | (gpio_direction_output(IGEP2_GPIO_LED0_RED, 1) == 0)) { |
| 480 | gpio_export(IGEP2_GPIO_LED0_RED, 0); | 497 | gpio_export(IGEP2_GPIO_LED0_RED, 0); |
| 481 | gpio_set_value(IGEP2_GPIO_LED0_RED, 0); | 498 | gpio_set_value(IGEP2_GPIO_LED0_RED, 0); |
| 482 | } else | 499 | } else |
| 483 | pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_RED\n"); | 500 | pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_RED\n"); |
| 484 | 501 | ||
| 485 | if ((gpio_request(IGEP2_GPIO_LED0_GREEN, "GPIO_LED0_GREEN") == 0) && | 502 | if ((gpio_request(IGEP2_GPIO_LED0_GREEN, "led0:green") == 0) && |
| 486 | (gpio_direction_output(IGEP2_GPIO_LED0_GREEN, 1) == 0)) { | 503 | (gpio_direction_output(IGEP2_GPIO_LED0_GREEN, 1) == 0)) { |
| 487 | gpio_export(IGEP2_GPIO_LED0_GREEN, 0); | 504 | gpio_export(IGEP2_GPIO_LED0_GREEN, 0); |
| 488 | gpio_set_value(IGEP2_GPIO_LED0_GREEN, 0); | 505 | gpio_set_value(IGEP2_GPIO_LED0_GREEN, 0); |
| 489 | } else | 506 | } else |
| 490 | pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_GREEN\n"); | 507 | pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_GREEN\n"); |
| 491 | #ifndef CONFIG_LEDS_TRIGGERS | 508 | |
| 492 | if ((gpio_request(IGEP2_GPIO_LED1_RED, "GPIO_LED1_RED") == 0) && | 509 | if ((gpio_request(IGEP2_GPIO_LED1_RED, "led1:red") == 0) && |
| 493 | (gpio_direction_output(IGEP2_GPIO_LED1_RED, 1) == 0)) { | 510 | (gpio_direction_output(IGEP2_GPIO_LED1_RED, 1) == 0)) { |
| 494 | gpio_export(IGEP2_GPIO_LED1_RED, 0); | 511 | gpio_export(IGEP2_GPIO_LED1_RED, 0); |
| 495 | gpio_set_value(IGEP2_GPIO_LED1_RED, 0); | 512 | gpio_set_value(IGEP2_GPIO_LED1_RED, 0); |
| 496 | } else | 513 | } else |
| 497 | pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_RED\n"); | 514 | pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_RED\n"); |
| 498 | #endif | 515 | #endif |
| 516 | |||
| 499 | /* GPIO W-LAN + Bluetooth combo module */ | 517 | /* GPIO W-LAN + Bluetooth combo module */ |
| 500 | if ((gpio_request(IGEP2_GPIO_WIFI_NPD, "GPIO_WIFI_NPD") == 0) && | 518 | if ((gpio_request(IGEP2_GPIO_WIFI_NPD, "GPIO_WIFI_NPD") == 0) && |
| 501 | (gpio_direction_output(IGEP2_GPIO_WIFI_NPD, 1) == 0)) { | 519 | (gpio_direction_output(IGEP2_GPIO_WIFI_NPD, 1) == 0)) { |
