diff options
Diffstat (limited to 'arch/arm/mach-shmobile/board-armadillo800eva.c')
-rw-r--r-- | arch/arm/mach-shmobile/board-armadillo800eva.c | 63 |
1 files changed, 52 insertions, 11 deletions
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c index c5be60d85e4b..5eb884d4324f 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva.c | |||
@@ -31,6 +31,8 @@ | |||
31 | #include <linux/gpio_keys.h> | 31 | #include <linux/gpio_keys.h> |
32 | #include <linux/regulator/driver.h> | 32 | #include <linux/regulator/driver.h> |
33 | #include <linux/pinctrl/machine.h> | 33 | #include <linux/pinctrl/machine.h> |
34 | #include <linux/platform_data/pwm-renesas-tpu.h> | ||
35 | #include <linux/pwm_backlight.h> | ||
34 | #include <linux/regulator/fixed.h> | 36 | #include <linux/regulator/fixed.h> |
35 | #include <linux/regulator/gpio-regulator.h> | 37 | #include <linux/regulator/gpio-regulator.h> |
36 | #include <linux/regulator/machine.h> | 38 | #include <linux/regulator/machine.h> |
@@ -387,7 +389,50 @@ static struct platform_device sh_eth_device = { | |||
387 | .num_resources = ARRAY_SIZE(sh_eth_resources), | 389 | .num_resources = ARRAY_SIZE(sh_eth_resources), |
388 | }; | 390 | }; |
389 | 391 | ||
390 | /* LCDC */ | 392 | /* PWM */ |
393 | static struct resource pwm_resources[] = { | ||
394 | [0] = { | ||
395 | .start = 0xe6600000, | ||
396 | .end = 0xe66000ff, | ||
397 | .flags = IORESOURCE_MEM, | ||
398 | }, | ||
399 | }; | ||
400 | |||
401 | static struct tpu_pwm_platform_data pwm_device_data = { | ||
402 | .channels[2] = { | ||
403 | .polarity = PWM_POLARITY_INVERSED, | ||
404 | } | ||
405 | }; | ||
406 | |||
407 | static struct platform_device pwm_device = { | ||
408 | .name = "renesas-tpu-pwm", | ||
409 | .id = -1, | ||
410 | .dev = { | ||
411 | .platform_data = &pwm_device_data, | ||
412 | }, | ||
413 | .num_resources = ARRAY_SIZE(pwm_resources), | ||
414 | .resource = pwm_resources, | ||
415 | }; | ||
416 | |||
417 | static struct pwm_lookup pwm_lookup[] = { | ||
418 | PWM_LOOKUP("renesas-tpu-pwm", 2, "pwm-backlight.0", NULL), | ||
419 | }; | ||
420 | |||
421 | /* LCDC and backlight */ | ||
422 | static struct platform_pwm_backlight_data pwm_backlight_data = { | ||
423 | .lth_brightness = 50, | ||
424 | .max_brightness = 255, | ||
425 | .dft_brightness = 255, | ||
426 | .pwm_period_ns = 33333, /* 30kHz */ | ||
427 | }; | ||
428 | |||
429 | static struct platform_device pwm_backlight_device = { | ||
430 | .name = "pwm-backlight", | ||
431 | .dev = { | ||
432 | .platform_data = &pwm_backlight_data, | ||
433 | }, | ||
434 | }; | ||
435 | |||
391 | static struct fb_videomode lcdc0_mode = { | 436 | static struct fb_videomode lcdc0_mode = { |
392 | .name = "AMPIER/AM-800480", | 437 | .name = "AMPIER/AM-800480", |
393 | .xres = 800, | 438 | .xres = 800, |
@@ -679,15 +724,6 @@ static struct platform_device vcc_sdhi1 = { | |||
679 | }; | 724 | }; |
680 | 725 | ||
681 | /* SDHI0 */ | 726 | /* SDHI0 */ |
682 | /* | ||
683 | * FIXME | ||
684 | * | ||
685 | * It use polling mode here, since | ||
686 | * CD (= Card Detect) pin is not connected to SDHI0_CD. | ||
687 | * We can use IRQ31 as card detect irq, | ||
688 | * but it needs chattering removal operation | ||
689 | */ | ||
690 | #define IRQ31 irq_pin(31) | ||
691 | static struct sh_mobile_sdhi_info sdhi0_info = { | 727 | static struct sh_mobile_sdhi_info sdhi0_info = { |
692 | .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, | 728 | .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, |
693 | .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, | 729 | .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, |
@@ -1030,6 +1066,8 @@ static struct i2c_board_info i2c2_devices[] = { | |||
1030 | */ | 1066 | */ |
1031 | static struct platform_device *eva_devices[] __initdata = { | 1067 | static struct platform_device *eva_devices[] __initdata = { |
1032 | &lcdc0_device, | 1068 | &lcdc0_device, |
1069 | &pwm_device, | ||
1070 | &pwm_backlight_device, | ||
1033 | &gpio_keys_device, | 1071 | &gpio_keys_device, |
1034 | &sh_eth_device, | 1072 | &sh_eth_device, |
1035 | &vcc_sdhi0, | 1073 | &vcc_sdhi0, |
@@ -1101,6 +1139,9 @@ static const struct pinctrl_map eva_pinctrl_map[] = { | |||
1101 | /* ST1232 */ | 1139 | /* ST1232 */ |
1102 | PIN_MAP_MUX_GROUP_DEFAULT("0-0055", "pfc-r8a7740", | 1140 | PIN_MAP_MUX_GROUP_DEFAULT("0-0055", "pfc-r8a7740", |
1103 | "intc_irq10", "intc"), | 1141 | "intc_irq10", "intc"), |
1142 | /* TPU0 */ | ||
1143 | PIN_MAP_MUX_GROUP_DEFAULT("renesas-tpu-pwm", "pfc-r8a7740", | ||
1144 | "tpu0_to2_1", "tpu0"), | ||
1104 | /* USBHS */ | 1145 | /* USBHS */ |
1105 | PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", "pfc-r8a7740", | 1146 | PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", "pfc-r8a7740", |
1106 | "intc_irq7_1", "intc"), | 1147 | "intc_irq7_1", "intc"), |
@@ -1154,13 +1195,13 @@ static void __init eva_init(void) | |||
1154 | ARRAY_SIZE(fixed3v3_power_consumers), 3300000); | 1195 | ARRAY_SIZE(fixed3v3_power_consumers), 3300000); |
1155 | 1196 | ||
1156 | pinctrl_register_mappings(eva_pinctrl_map, ARRAY_SIZE(eva_pinctrl_map)); | 1197 | pinctrl_register_mappings(eva_pinctrl_map, ARRAY_SIZE(eva_pinctrl_map)); |
1198 | pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup)); | ||
1157 | 1199 | ||
1158 | r8a7740_pinmux_init(); | 1200 | r8a7740_pinmux_init(); |
1159 | r8a7740_meram_workaround(); | 1201 | r8a7740_meram_workaround(); |
1160 | 1202 | ||
1161 | /* LCDC0 */ | 1203 | /* LCDC0 */ |
1162 | gpio_request_one(61, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */ | 1204 | gpio_request_one(61, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */ |
1163 | gpio_request_one(202, GPIOF_OUT_INIT_LOW, NULL); /* LCD0_LED_CONT */ | ||
1164 | 1205 | ||
1165 | /* GETHER */ | 1206 | /* GETHER */ |
1166 | gpio_request_one(18, GPIOF_OUT_INIT_HIGH, NULL); /* PHY_RST */ | 1207 | gpio_request_one(18, GPIOF_OUT_INIT_HIGH, NULL); /* PHY_RST */ |