aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2010-09-03 03:20:04 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-09-14 04:22:38 -0400
commit44432407d9f5e4b2e56c7eccb65d98cad4bba191 (patch)
treefdd88fc9bd5a1473e611e87958d2115b02631ac8 /arch/arm/mach-shmobile
parent01ac25b59f08c0bb56dd301f024eabd542205a42 (diff)
fbdev: sh_mobile_lcdcfb: Support multiple video modes in platform data
This is a preparation for HDMI hotplug support. This patch just moves all platform defined video modes for the sh_mobile_lcdcfb driver to separate arrays and switches all users to use element 0 of that array, so, this patch doesn't introduce any functional changes and as such should not cause any regressions. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c98
1 files changed, 57 insertions, 41 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 31e5b28ab9b4..4e883e0fb01b 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -375,10 +375,40 @@ static struct platform_device usb1_host_device = {
375 .resource = usb1_host_resources, 375 .resource = usb1_host_resources,
376}; 376};
377 377
378const static struct fb_videomode ap4evb_lcdc_modes[] = {
379 {
380#ifdef CONFIG_AP4EVB_QHD
381 .name = "R63302(QHD)",
382 .xres = 544,
383 .yres = 961,
384 .left_margin = 72,
385 .right_margin = 600,
386 .hsync_len = 16,
387 .upper_margin = 8,
388 .lower_margin = 8,
389 .vsync_len = 2,
390 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
391#else
392 .name = "WVGA Panel",
393 .xres = 800,
394 .yres = 480,
395 .left_margin = 220,
396 .right_margin = 110,
397 .hsync_len = 70,
398 .upper_margin = 20,
399 .lower_margin = 5,
400 .vsync_len = 5,
401 .sync = 0,
402#endif
403 },
404};
405
378static struct sh_mobile_lcdc_info lcdc_info = { 406static struct sh_mobile_lcdc_info lcdc_info = {
379 .ch[0] = { 407 .ch[0] = {
380 .chan = LCDC_CHAN_MAINLCD, 408 .chan = LCDC_CHAN_MAINLCD,
381 .bpp = 16, 409 .bpp = 16,
410 .lcd_cfg = ap4evb_lcdc_modes,
411 .num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes),
382 } 412 }
383}; 413};
384 414
@@ -569,6 +599,31 @@ static struct platform_device fsi_device = {
569 }, 599 },
570}; 600};
571 601
602const static struct fb_videomode ap4evb_hdmi_modes[] = {
603 {
604 .name = "HDMI 720p",
605 .xres = 1280,
606 .yres = 720,
607
608 /*
609 * If left and right margins are not multiples of 8,
610 * LDHAJR will be adjusted accordingly by the LCDC
611 * driver. Until we start using EDID, these values
612 * might have to be adjusted for different monitors.
613 */
614 .left_margin = 200,
615 .right_margin = 88,
616 .hsync_len = 48,
617
618 .upper_margin = 20,
619 .lower_margin = 5,
620 .vsync_len = 5,
621
622 .pixclock = 13468,
623 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
624 },
625};
626
572static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = { 627static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = {
573 .clock_source = LCDC_CLK_EXTERNAL, 628 .clock_source = LCDC_CLK_EXTERNAL,
574 .ch[0] = { 629 .ch[0] = {
@@ -577,26 +632,8 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = {
577 .interface_type = RGB24, 632 .interface_type = RGB24,
578 .clock_divider = 1, 633 .clock_divider = 1,
579 .flags = LCDC_FLAGS_DWPOL, 634 .flags = LCDC_FLAGS_DWPOL,
580 .lcd_cfg = { 635 .lcd_cfg = ap4evb_hdmi_modes,
581 .name = "HDMI", 636 .num_cfg = ARRAY_SIZE(ap4evb_hdmi_modes),
582 /* So far only 720p is supported */
583 .xres = 1280,
584 .yres = 720,
585 /*
586 * If left and right margins are not multiples of 8,
587 * LDHAJR will be adjusted accordingly by the LCDC
588 * driver. Until we start using EDID, these values
589 * might have to be adjusted for different monitors.
590 */
591 .left_margin = 200,
592 .right_margin = 88,
593 .hsync_len = 48,
594 .upper_margin = 20,
595 .lower_margin = 5,
596 .vsync_len = 5,
597 .pixclock = 13468,
598 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
599 },
600 } 637 }
601}; 638};
602 639
@@ -960,17 +997,6 @@ static void __init ap4evb_init(void)
960 lcdc_info.ch[0].interface_type = RGB24; 997 lcdc_info.ch[0].interface_type = RGB24;
961 lcdc_info.ch[0].clock_divider = 1; 998 lcdc_info.ch[0].clock_divider = 1;
962 lcdc_info.ch[0].flags = LCDC_FLAGS_DWPOL; 999 lcdc_info.ch[0].flags = LCDC_FLAGS_DWPOL;
963 lcdc_info.ch[0].lcd_cfg.name = "R63302(QHD)";
964 lcdc_info.ch[0].lcd_cfg.xres = 544;
965 lcdc_info.ch[0].lcd_cfg.yres = 961;
966 lcdc_info.ch[0].lcd_cfg.left_margin = 72;
967 lcdc_info.ch[0].lcd_cfg.right_margin = 600;
968 lcdc_info.ch[0].lcd_cfg.hsync_len = 16;
969 lcdc_info.ch[0].lcd_cfg.upper_margin = 8;
970 lcdc_info.ch[0].lcd_cfg.lower_margin = 8;
971 lcdc_info.ch[0].lcd_cfg.vsync_len = 2;
972 lcdc_info.ch[0].lcd_cfg.sync = FB_SYNC_VERT_HIGH_ACT |
973 FB_SYNC_HOR_HIGH_ACT;
974 lcdc_info.ch[0].lcd_size_cfg.width = 44; 1000 lcdc_info.ch[0].lcd_size_cfg.width = 44;
975 lcdc_info.ch[0].lcd_size_cfg.height = 79; 1001 lcdc_info.ch[0].lcd_size_cfg.height = 79;
976 1002
@@ -1013,16 +1039,6 @@ static void __init ap4evb_init(void)
1013 lcdc_info.ch[0].interface_type = RGB18; 1039 lcdc_info.ch[0].interface_type = RGB18;
1014 lcdc_info.ch[0].clock_divider = 2; 1040 lcdc_info.ch[0].clock_divider = 2;
1015 lcdc_info.ch[0].flags = 0; 1041 lcdc_info.ch[0].flags = 0;
1016 lcdc_info.ch[0].lcd_cfg.name = "WVGA Panel";
1017 lcdc_info.ch[0].lcd_cfg.xres = 800;
1018 lcdc_info.ch[0].lcd_cfg.yres = 480;
1019 lcdc_info.ch[0].lcd_cfg.left_margin = 220;
1020 lcdc_info.ch[0].lcd_cfg.right_margin = 110;
1021 lcdc_info.ch[0].lcd_cfg.hsync_len = 70;
1022 lcdc_info.ch[0].lcd_cfg.upper_margin = 20;
1023 lcdc_info.ch[0].lcd_cfg.lower_margin = 5;
1024 lcdc_info.ch[0].lcd_cfg.vsync_len = 5;
1025 lcdc_info.ch[0].lcd_cfg.sync = 0;
1026 lcdc_info.ch[0].lcd_size_cfg.width = 152; 1042 lcdc_info.ch[0].lcd_size_cfg.width = 152;
1027 lcdc_info.ch[0].lcd_size_cfg.height = 91; 1043 lcdc_info.ch[0].lcd_size_cfg.height = 91;
1028 1044