aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/board-armadillo800eva.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-07-16 06:32:05 -0400
committerSimon Horman <horms+renesas@verge.net.au>2013-07-18 22:22:46 -0400
commitd58226a21a7b84a3f82265821f24ce2aad267f1c (patch)
treec7ce20517e0336eed75b6fac5a35d402ae62bb1c /arch/arm/mach-shmobile/board-armadillo800eva.c
parentad81f0545ef01ea651886dddac4bef6cec930092 (diff)
ARM: shmobile: armadillo800eva: Add backlight support
The flat panel backlight on the Armadillo 800 EVA board is driven by the TPU PWM output. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Tested-by: Simon Horman <horms@verge.net.au> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile/board-armadillo800eva.c')
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c54
1 files changed, 52 insertions, 2 deletions
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index e115f6742107..9457c763b797 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 */
393static struct resource pwm_resources[] = {
394 [0] = {
395 .start = 0xe6600000,
396 .end = 0xe66000ff,
397 .flags = IORESOURCE_MEM,
398 },
399};
400
401static struct tpu_pwm_platform_data pwm_device_data = {
402 .channels[2] = {
403 .polarity = PWM_POLARITY_INVERSED,
404 }
405};
406
407static 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
417static struct pwm_lookup pwm_lookup[] = {
418 PWM_LOOKUP("renesas-tpu-pwm", 2, "pwm-backlight.0", NULL),
419};
420
421/* LCDC and backlight */
422static 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
429static struct platform_device pwm_backlight_device = {
430 .name = "pwm-backlight",
431 .dev = {
432 .platform_data = &pwm_backlight_data,
433 },
434};
435
391static struct fb_videomode lcdc0_mode = { 436static struct fb_videomode lcdc0_mode = {
392 .name = "AMPIER/AM-800480", 437 .name = "AMPIER/AM-800480",
393 .xres = 800, 438 .xres = 800,
@@ -1030,6 +1075,8 @@ static struct i2c_board_info i2c2_devices[] = {
1030 */ 1075 */
1031static struct platform_device *eva_devices[] __initdata = { 1076static struct platform_device *eva_devices[] __initdata = {
1032 &lcdc0_device, 1077 &lcdc0_device,
1078 &pwm_device,
1079 &pwm_backlight_device,
1033 &gpio_keys_device, 1080 &gpio_keys_device,
1034 &sh_eth_device, 1081 &sh_eth_device,
1035 &vcc_sdhi0, 1082 &vcc_sdhi0,
@@ -1101,6 +1148,9 @@ static const struct pinctrl_map eva_pinctrl_map[] = {
1101 /* ST1232 */ 1148 /* ST1232 */
1102 PIN_MAP_MUX_GROUP_DEFAULT("0-0055", "pfc-r8a7740", 1149 PIN_MAP_MUX_GROUP_DEFAULT("0-0055", "pfc-r8a7740",
1103 "intc_irq10", "intc"), 1150 "intc_irq10", "intc"),
1151 /* TPU0 */
1152 PIN_MAP_MUX_GROUP_DEFAULT("renesas-tpu-pwm", "pfc-r8a7740",
1153 "tpu0_to2_1", "tpu0"),
1104 /* USBHS */ 1154 /* USBHS */
1105 PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", "pfc-r8a7740", 1155 PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", "pfc-r8a7740",
1106 "intc_irq7_1", "intc"), 1156 "intc_irq7_1", "intc"),
@@ -1154,13 +1204,13 @@ static void __init eva_init(void)
1154 ARRAY_SIZE(fixed3v3_power_consumers), 3300000); 1204 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
1155 1205
1156 pinctrl_register_mappings(eva_pinctrl_map, ARRAY_SIZE(eva_pinctrl_map)); 1206 pinctrl_register_mappings(eva_pinctrl_map, ARRAY_SIZE(eva_pinctrl_map));
1207 pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup));
1157 1208
1158 r8a7740_pinmux_init(); 1209 r8a7740_pinmux_init();
1159 r8a7740_meram_workaround(); 1210 r8a7740_meram_workaround();
1160 1211
1161 /* LCDC0 */ 1212 /* LCDC0 */
1162 gpio_request_one(61, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */ 1213 gpio_request_one(61, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
1163 gpio_request_one(202, GPIOF_OUT_INIT_LOW, NULL); /* LCD0_LED_CONT */
1164 1214
1165 /* Touchscreen */ 1215 /* Touchscreen */
1166 gpio_request_one(166, GPIOF_OUT_INIT_HIGH, NULL); /* TP_RST_B */ 1216 gpio_request_one(166, GPIOF_OUT_INIT_HIGH, NULL); /* TP_RST_B */