diff options
Diffstat (limited to 'arch/arm/mach-shmobile/board-ap4evb.c')
| -rw-r--r-- | arch/arm/mach-shmobile/board-ap4evb.c | 56 |
1 files changed, 41 insertions, 15 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index 23d472f9525e..95935c83c306 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
| 26 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
| 27 | #include <linux/mfd/sh_mobile_sdhi.h> | 27 | #include <linux/mfd/sh_mobile_sdhi.h> |
| 28 | #include <linux/mfd/tmio.h> | ||
| 28 | #include <linux/mmc/host.h> | 29 | #include <linux/mmc/host.h> |
| 29 | #include <linux/mtd/mtd.h> | 30 | #include <linux/mtd/mtd.h> |
| 30 | #include <linux/mtd/partitions.h> | 31 | #include <linux/mtd/partitions.h> |
| @@ -39,6 +40,7 @@ | |||
| 39 | #include <linux/sh_clk.h> | 40 | #include <linux/sh_clk.h> |
| 40 | #include <linux/gpio.h> | 41 | #include <linux/gpio.h> |
| 41 | #include <linux/input.h> | 42 | #include <linux/input.h> |
| 43 | #include <linux/leds.h> | ||
| 42 | #include <linux/input/sh_keysc.h> | 44 | #include <linux/input/sh_keysc.h> |
| 43 | #include <linux/usb/r8a66597.h> | 45 | #include <linux/usb/r8a66597.h> |
| 44 | 46 | ||
| @@ -307,6 +309,7 @@ static struct sh_mobile_sdhi_info sdhi1_info = { | |||
| 307 | .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX, | 309 | .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX, |
| 308 | .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX, | 310 | .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX, |
| 309 | .tmio_ocr_mask = MMC_VDD_165_195, | 311 | .tmio_ocr_mask = MMC_VDD_165_195, |
| 312 | .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE, | ||
| 310 | }; | 313 | }; |
| 311 | 314 | ||
| 312 | static struct resource sdhi1_resources[] = { | 315 | static struct resource sdhi1_resources[] = { |
| @@ -558,7 +561,7 @@ static struct resource fsi_resources[] = { | |||
| 558 | 561 | ||
| 559 | static struct platform_device fsi_device = { | 562 | static struct platform_device fsi_device = { |
| 560 | .name = "sh_fsi2", | 563 | .name = "sh_fsi2", |
| 561 | .id = 0, | 564 | .id = -1, |
| 562 | .num_resources = ARRAY_SIZE(fsi_resources), | 565 | .num_resources = ARRAY_SIZE(fsi_resources), |
| 563 | .resource = fsi_resources, | 566 | .resource = fsi_resources, |
| 564 | .dev = { | 567 | .dev = { |
| @@ -650,7 +653,44 @@ static struct platform_device hdmi_device = { | |||
| 650 | }, | 653 | }, |
| 651 | }; | 654 | }; |
| 652 | 655 | ||
| 656 | static struct gpio_led ap4evb_leds[] = { | ||
| 657 | { | ||
| 658 | .name = "led4", | ||
| 659 | .gpio = GPIO_PORT185, | ||
| 660 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
| 661 | }, | ||
| 662 | { | ||
| 663 | .name = "led2", | ||
| 664 | .gpio = GPIO_PORT186, | ||
| 665 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
| 666 | }, | ||
| 667 | { | ||
| 668 | .name = "led3", | ||
| 669 | .gpio = GPIO_PORT187, | ||
| 670 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
| 671 | }, | ||
| 672 | { | ||
| 673 | .name = "led1", | ||
| 674 | .gpio = GPIO_PORT188, | ||
| 675 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
| 676 | } | ||
| 677 | }; | ||
| 678 | |||
| 679 | static struct gpio_led_platform_data ap4evb_leds_pdata = { | ||
| 680 | .num_leds = ARRAY_SIZE(ap4evb_leds), | ||
| 681 | .leds = ap4evb_leds, | ||
| 682 | }; | ||
| 683 | |||
| 684 | static struct platform_device leds_device = { | ||
| 685 | .name = "leds-gpio", | ||
| 686 | .id = 0, | ||
| 687 | .dev = { | ||
| 688 | .platform_data = &ap4evb_leds_pdata, | ||
| 689 | }, | ||
| 690 | }; | ||
| 691 | |||
| 653 | static struct platform_device *ap4evb_devices[] __initdata = { | 692 | static struct platform_device *ap4evb_devices[] __initdata = { |
| 693 | &leds_device, | ||
| 654 | &nor_flash_device, | 694 | &nor_flash_device, |
| 655 | &smc911x_device, | 695 | &smc911x_device, |
| 656 | &sdhi0_device, | 696 | &sdhi0_device, |
| @@ -840,20 +880,6 @@ static void __init ap4evb_init(void) | |||
| 840 | gpio_request(GPIO_FN_CS5A, NULL); | 880 | gpio_request(GPIO_FN_CS5A, NULL); |
| 841 | gpio_request(GPIO_FN_IRQ6_39, NULL); | 881 | gpio_request(GPIO_FN_IRQ6_39, NULL); |
| 842 | 882 | ||
| 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) */ | 883 | /* enable Debug switch (S6) */ |
| 858 | gpio_request(GPIO_PORT32, NULL); | 884 | gpio_request(GPIO_PORT32, NULL); |
| 859 | gpio_request(GPIO_PORT33, NULL); | 885 | gpio_request(GPIO_PORT33, NULL); |
