diff options
| -rw-r--r-- | arch/arm/mach-shmobile/board-ap4evb.c | 52 |
1 files changed, 38 insertions, 14 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index 23d472f9525e..98c1cf76c2b4 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c | |||
| @@ -39,6 +39,7 @@ | |||
| 39 | #include <linux/sh_clk.h> | 39 | #include <linux/sh_clk.h> |
| 40 | #include <linux/gpio.h> | 40 | #include <linux/gpio.h> |
| 41 | #include <linux/input.h> | 41 | #include <linux/input.h> |
| 42 | #include <linux/leds.h> | ||
| 42 | #include <linux/input/sh_keysc.h> | 43 | #include <linux/input/sh_keysc.h> |
| 43 | #include <linux/usb/r8a66597.h> | 44 | #include <linux/usb/r8a66597.h> |
| 44 | 45 | ||
| @@ -650,7 +651,44 @@ static struct platform_device hdmi_device = { | |||
| 650 | }, | 651 | }, |
| 651 | }; | 652 | }; |
| 652 | 653 | ||
| 654 | static struct gpio_led ap4evb_leds[] = { | ||
| 655 | { | ||
| 656 | .name = "led4", | ||
| 657 | .gpio = GPIO_PORT185, | ||
| 658 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
| 659 | }, | ||
| 660 | { | ||
| 661 | .name = "led2", | ||
| 662 | .gpio = GPIO_PORT186, | ||
| 663 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
| 664 | }, | ||
| 665 | { | ||
| 666 | .name = "led3", | ||
| 667 | .gpio = GPIO_PORT187, | ||
| 668 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
| 669 | }, | ||
| 670 | { | ||
| 671 | .name = "led1", | ||
| 672 | .gpio = GPIO_PORT188, | ||
| 673 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
| 674 | } | ||
| 675 | }; | ||
| 676 | |||
| 677 | static struct gpio_led_platform_data ap4evb_leds_pdata = { | ||
| 678 | .num_leds = ARRAY_SIZE(ap4evb_leds), | ||
| 679 | .leds = &ap4evb_leds, | ||
| 680 | }; | ||
| 681 | |||
| 682 | static struct platform_device leds_device = { | ||
| 683 | .name = "leds-gpio", | ||
| 684 | .id = 0, | ||
| 685 | .dev = { | ||
| 686 | .platform_data = &ap4evb_leds_pdata, | ||
| 687 | }, | ||
| 688 | }; | ||
| 689 | |||
| 653 | static struct platform_device *ap4evb_devices[] __initdata = { | 690 | static struct platform_device *ap4evb_devices[] __initdata = { |
| 691 | &leds_device, | ||
| 654 | &nor_flash_device, | 692 | &nor_flash_device, |
| 655 | &smc911x_device, | 693 | &smc911x_device, |
| 656 | &sdhi0_device, | 694 | &sdhi0_device, |
| @@ -840,20 +878,6 @@ static void __init ap4evb_init(void) | |||
| 840 | gpio_request(GPIO_FN_CS5A, NULL); | 878 | gpio_request(GPIO_FN_CS5A, NULL); |
| 841 | gpio_request(GPIO_FN_IRQ6_39, NULL); | 879 | gpio_request(GPIO_FN_IRQ6_39, NULL); |
| 842 | 880 | ||
| 843 | /* enable LED 1 - 4 */ | ||
| 844 | gpio_request(GPIO_PORT185, NULL); | ||
| 845 | gpio_request(GPIO_PORT186, NULL); | ||
| 846 | gpio_request(GPIO_PORT187, NULL); | ||
| 847 | gpio_request(GPIO_PORT188, NULL); | ||
| 848 | gpio_direction_output(GPIO_PORT185, 1); | ||
| 849 | gpio_direction_output(GPIO_PORT186, 1); | ||
| 850 | gpio_direction_output(GPIO_PORT187, 1); | ||
| 851 | gpio_direction_output(GPIO_PORT188, 1); | ||
| 852 | gpio_export(GPIO_PORT185, 0); | ||
| 853 | gpio_export(GPIO_PORT186, 0); | ||
| 854 | gpio_export(GPIO_PORT187, 0); | ||
| 855 | gpio_export(GPIO_PORT188, 0); | ||
| 856 | |||
| 857 | /* enable Debug switch (S6) */ | 881 | /* enable Debug switch (S6) */ |
| 858 | gpio_request(GPIO_PORT32, NULL); | 882 | gpio_request(GPIO_PORT32, NULL); |
| 859 | gpio_request(GPIO_PORT33, NULL); | 883 | gpio_request(GPIO_PORT33, NULL); |
