aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/board-ap4evb.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-22 23:43:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-22 23:43:40 -0400
commit437538267b672f9320833907f1b5acbb2605f4be (patch)
treed10173b35a5b86bc037bb2ece1b406d5575a2094 /arch/arm/mach-shmobile/board-ap4evb.c
parent9586c959bfc917695893bef0102433a7d0675691 (diff)
parent6bff98b455cf3e666fd0e3d0d908eba874de0eee (diff)
Merge tag 'fbdev-updates-for-3.4' of git://github.com/schandinat/linux-2.6
Pull fbdev updates for 3.4 from Florian Tobias Schandinat: - drivers for Samsung Exynos MIPI DSI and display port - i740fb to support those old Intel chips - large updates to OMAP, viafb and sh_mobile_lcdcfb - some updates to s3c-fb and udlfb, few patches to others Fix up conflicts in drivers/video/udlfb.c due to Key Sievers' fix making it in twice. * tag 'fbdev-updates-for-3.4' of git://github.com/schandinat/linux-2.6: (156 commits) Revert "video:uvesafb: Fix oops that uvesafb try to execute NX-protected page" OMAPDSS: register dss drivers in module init video: pxafb: add clk_prepare/clk_unprepare calls fbdev: bfin_adv7393fb: Drop needless include fbdev: sh_mipi_dsi: add extra phyctrl for sh_mipi_dsi_info fbdev: remove dependency of FB_SH_MOBILE_MERAM from FB_SH_MOBILE_LCDC Revert "MAINTAINERS: add entry for exynos mipi display drivers" fbdev: da8xx: add support for SP10Q010 display fbdev: da8xx:: fix reporting of the display timing info drivers/video/pvr2fb.c: ensure arguments to request_irq and free_irq are compatible OMAPDSS: APPLY: fix clearing shadow dirty flag with manual update fbdev: sh_mobile_meram: Implement system suspend/resume fbdev: sh_mobile_meram: Remove unneeded sanity checks fbdev: sh_mobile_meram: Don't perform update in register operation arm: mach-shmobile: Constify sh_mobile_meram_cfg structures fbdev: sh_mobile_lcdc: Don't store copy of platform data fbdev: sh_mobile_meram: Remove unused sh_mobile_meram_icb_cfg fields arm: mach-shmobile: Don't set MERAM ICB numbers in platform data fbdev: sh_mobile_meram: Allocate ICBs automatically fbdev: sh_mobile_meram: Use genalloc to manage MERAM allocation ...
Diffstat (limited to 'arch/arm/mach-shmobile/board-ap4evb.c')
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c302
1 files changed, 154 insertions, 148 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 8f6da7f134b3..f90ba5b850a3 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -258,10 +258,16 @@ static struct sh_mobile_meram_info meram_info = {
258 258
259static struct resource meram_resources[] = { 259static struct resource meram_resources[] = {
260 [0] = { 260 [0] = {
261 .name = "MERAM", 261 .name = "regs",
262 .start = 0xe8000000, 262 .start = 0xe8000000,
263 .end = 0xe81fffff, 263 .end = 0xe807ffff,
264 .flags = IORESOURCE_MEM, 264 .flags = IORESOURCE_MEM,
265 },
266 [1] = {
267 .name = "meram",
268 .start = 0xe8080000,
269 .end = 0xe81fffff,
270 .flags = IORESOURCE_MEM,
265 }, 271 },
266}; 272};
267 273
@@ -437,82 +443,6 @@ static struct platform_device usb1_host_device = {
437 .resource = usb1_host_resources, 443 .resource = usb1_host_resources,
438}; 444};
439 445
440static const struct fb_videomode ap4evb_lcdc_modes[] = {
441 {
442#ifdef CONFIG_AP4EVB_QHD
443 .name = "R63302(QHD)",
444 .xres = 544,
445 .yres = 961,
446 .left_margin = 72,
447 .right_margin = 600,
448 .hsync_len = 16,
449 .upper_margin = 8,
450 .lower_margin = 8,
451 .vsync_len = 2,
452 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
453#else
454 .name = "WVGA Panel",
455 .xres = 800,
456 .yres = 480,
457 .left_margin = 220,
458 .right_margin = 110,
459 .hsync_len = 70,
460 .upper_margin = 20,
461 .lower_margin = 5,
462 .vsync_len = 5,
463 .sync = 0,
464#endif
465 },
466};
467static struct sh_mobile_meram_cfg lcd_meram_cfg = {
468 .icb[0] = {
469 .marker_icb = 28,
470 .cache_icb = 24,
471 .meram_offset = 0x0,
472 .meram_size = 0x40,
473 },
474 .icb[1] = {
475 .marker_icb = 29,
476 .cache_icb = 25,
477 .meram_offset = 0x40,
478 .meram_size = 0x40,
479 },
480};
481
482static struct sh_mobile_lcdc_info lcdc_info = {
483 .meram_dev = &meram_info,
484 .ch[0] = {
485 .chan = LCDC_CHAN_MAINLCD,
486 .fourcc = V4L2_PIX_FMT_RGB565,
487 .lcd_cfg = ap4evb_lcdc_modes,
488 .num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes),
489 .meram_cfg = &lcd_meram_cfg,
490 }
491};
492
493static struct resource lcdc_resources[] = {
494 [0] = {
495 .name = "LCDC",
496 .start = 0xfe940000, /* P4-only space */
497 .end = 0xfe943fff,
498 .flags = IORESOURCE_MEM,
499 },
500 [1] = {
501 .start = intcs_evt2irq(0x580),
502 .flags = IORESOURCE_IRQ,
503 },
504};
505
506static struct platform_device lcdc_device = {
507 .name = "sh_mobile_lcdc_fb",
508 .num_resources = ARRAY_SIZE(lcdc_resources),
509 .resource = lcdc_resources,
510 .dev = {
511 .platform_data = &lcdc_info,
512 .coherent_dma_mask = ~0,
513 },
514};
515
516/* 446/*
517 * QHD display 447 * QHD display
518 */ 448 */
@@ -556,20 +486,25 @@ static struct platform_device keysc_device = {
556}; 486};
557 487
558/* MIPI-DSI */ 488/* MIPI-DSI */
559#define PHYCTRL 0x0070
560static int sh_mipi_set_dot_clock(struct platform_device *pdev, 489static int sh_mipi_set_dot_clock(struct platform_device *pdev,
561 void __iomem *base, 490 void __iomem *base,
562 int enable) 491 int enable)
563{ 492{
564 struct clk *pck = clk_get(&pdev->dev, "dsip_clk"); 493 struct clk *pck = clk_get(&pdev->dev, "dsip_clk");
565 void __iomem *phy = base + PHYCTRL;
566 494
567 if (IS_ERR(pck)) 495 if (IS_ERR(pck))
568 return PTR_ERR(pck); 496 return PTR_ERR(pck);
569 497
570 if (enable) { 498 if (enable) {
499 /*
500 * DSIPCLK = 24MHz
501 * D-PHY = DSIPCLK * ((0x6*2)+1) = 312MHz (see .phyctrl)
502 * HsByteCLK = D-PHY/8 = 39MHz
503 *
504 * X * Y * FPS =
505 * (544+72+600+16) * (961+8+8+2) * 30 = 36.1MHz
506 */
571 clk_set_rate(pck, clk_round_rate(pck, 24000000)); 507 clk_set_rate(pck, clk_round_rate(pck, 24000000));
572 iowrite32(ioread32(phy) | (0xb << 8), phy);
573 clk_enable(pck); 508 clk_enable(pck);
574 } else { 509 } else {
575 clk_disable(pck); 510 clk_disable(pck);
@@ -593,11 +528,14 @@ static struct resource mipidsi0_resources[] = {
593 }, 528 },
594}; 529};
595 530
531static struct sh_mobile_lcdc_info lcdc_info;
532
596static struct sh_mipi_dsi_info mipidsi0_info = { 533static struct sh_mipi_dsi_info mipidsi0_info = {
597 .data_format = MIPI_RGB888, 534 .data_format = MIPI_RGB888,
598 .lcd_chan = &lcdc_info.ch[0], 535 .lcd_chan = &lcdc_info.ch[0],
599 .lane = 2, 536 .lane = 2,
600 .vsynw_offset = 17, 537 .vsynw_offset = 17,
538 .phyctrl = 0x6 << 8,
601 .flags = SH_MIPI_DSI_SYNC_PULSES_MODE | 539 .flags = SH_MIPI_DSI_SYNC_PULSES_MODE |
602 SH_MIPI_DSI_HSbyteCLK, 540 SH_MIPI_DSI_HSbyteCLK,
603 .set_dot_clock = sh_mipi_set_dot_clock, 541 .set_dot_clock = sh_mipi_set_dot_clock,
@@ -619,6 +557,81 @@ static struct platform_device *qhd_devices[] __initdata = {
619}; 557};
620#endif /* CONFIG_AP4EVB_QHD */ 558#endif /* CONFIG_AP4EVB_QHD */
621 559
560/* LCDC0 */
561static const struct fb_videomode ap4evb_lcdc_modes[] = {
562 {
563#ifdef CONFIG_AP4EVB_QHD
564 .name = "R63302(QHD)",
565 .xres = 544,
566 .yres = 961,
567 .left_margin = 72,
568 .right_margin = 600,
569 .hsync_len = 16,
570 .upper_margin = 8,
571 .lower_margin = 8,
572 .vsync_len = 2,
573 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
574#else
575 .name = "WVGA Panel",
576 .xres = 800,
577 .yres = 480,
578 .left_margin = 220,
579 .right_margin = 110,
580 .hsync_len = 70,
581 .upper_margin = 20,
582 .lower_margin = 5,
583 .vsync_len = 5,
584 .sync = 0,
585#endif
586 },
587};
588
589static const struct sh_mobile_meram_cfg lcd_meram_cfg = {
590 .icb[0] = {
591 .meram_size = 0x40,
592 },
593 .icb[1] = {
594 .meram_size = 0x40,
595 },
596};
597
598static struct sh_mobile_lcdc_info lcdc_info = {
599 .meram_dev = &meram_info,
600 .ch[0] = {
601 .chan = LCDC_CHAN_MAINLCD,
602 .fourcc = V4L2_PIX_FMT_RGB565,
603 .lcd_modes = ap4evb_lcdc_modes,
604 .num_modes = ARRAY_SIZE(ap4evb_lcdc_modes),
605 .meram_cfg = &lcd_meram_cfg,
606#ifdef CONFIG_AP4EVB_QHD
607 .tx_dev = &mipidsi0_device,
608#endif
609 }
610};
611
612static struct resource lcdc_resources[] = {
613 [0] = {
614 .name = "LCDC",
615 .start = 0xfe940000, /* P4-only space */
616 .end = 0xfe943fff,
617 .flags = IORESOURCE_MEM,
618 },
619 [1] = {
620 .start = intcs_evt2irq(0x580),
621 .flags = IORESOURCE_IRQ,
622 },
623};
624
625static struct platform_device lcdc_device = {
626 .name = "sh_mobile_lcdc_fb",
627 .num_resources = ARRAY_SIZE(lcdc_resources),
628 .resource = lcdc_resources,
629 .dev = {
630 .platform_data = &lcdc_info,
631 .coherent_dma_mask = ~0,
632 },
633};
634
622/* FSI */ 635/* FSI */
623#define IRQ_FSI evt2irq(0x1840) 636#define IRQ_FSI evt2irq(0x1840)
624static int __fsi_set_rate(struct clk *clk, long rate, int enable) 637static int __fsi_set_rate(struct clk *clk, long rate, int enable)
@@ -790,65 +803,11 @@ static struct platform_device fsi_ak4643_device = {
790 }, 803 },
791}; 804};
792 805
793static struct sh_mobile_meram_cfg hdmi_meram_cfg = { 806/* LCDC1 */
794 .icb[0] = {
795 .marker_icb = 30,
796 .cache_icb = 26,
797 .meram_offset = 0x80,
798 .meram_size = 0x100,
799 },
800 .icb[1] = {
801 .marker_icb = 31,
802 .cache_icb = 27,
803 .meram_offset = 0x180,
804 .meram_size = 0x100,
805 },
806};
807
808static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = {
809 .clock_source = LCDC_CLK_EXTERNAL,
810 .meram_dev = &meram_info,
811 .ch[0] = {
812 .chan = LCDC_CHAN_MAINLCD,
813 .fourcc = V4L2_PIX_FMT_RGB565,
814 .interface_type = RGB24,
815 .clock_divider = 1,
816 .flags = LCDC_FLAGS_DWPOL,
817 .meram_cfg = &hdmi_meram_cfg,
818 }
819};
820
821static struct resource lcdc1_resources[] = {
822 [0] = {
823 .name = "LCDC1",
824 .start = 0xfe944000,
825 .end = 0xfe947fff,
826 .flags = IORESOURCE_MEM,
827 },
828 [1] = {
829 .start = intcs_evt2irq(0x1780),
830 .flags = IORESOURCE_IRQ,
831 },
832};
833
834static struct platform_device lcdc1_device = {
835 .name = "sh_mobile_lcdc_fb",
836 .num_resources = ARRAY_SIZE(lcdc1_resources),
837 .resource = lcdc1_resources,
838 .id = 1,
839 .dev = {
840 .platform_data = &sh_mobile_lcdc1_info,
841 .coherent_dma_mask = ~0,
842 },
843};
844
845static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq, 807static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq,
846 unsigned long *parent_freq); 808 unsigned long *parent_freq);
847 809
848
849static struct sh_mobile_hdmi_info hdmi_info = { 810static struct sh_mobile_hdmi_info hdmi_info = {
850 .lcd_chan = &sh_mobile_lcdc1_info.ch[0],
851 .lcd_dev = &lcdc1_device.dev,
852 .flags = HDMI_SND_SRC_SPDIF, 811 .flags = HDMI_SND_SRC_SPDIF,
853 .clk_optimize_parent = ap4evb_clk_optimize, 812 .clk_optimize_parent = ap4evb_clk_optimize,
854}; 813};
@@ -877,10 +836,6 @@ static struct platform_device hdmi_device = {
877 }, 836 },
878}; 837};
879 838
880static struct platform_device fsi_hdmi_device = {
881 .name = "sh_fsi2_b_hdmi",
882};
883
884static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq, 839static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq,
885 unsigned long *parent_freq) 840 unsigned long *parent_freq)
886{ 841{
@@ -900,6 +855,57 @@ static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq,
900 return error; 855 return error;
901} 856}
902 857
858static const struct sh_mobile_meram_cfg hdmi_meram_cfg = {
859 .icb[0] = {
860 .meram_size = 0x100,
861 },
862 .icb[1] = {
863 .meram_size = 0x100,
864 },
865};
866
867static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = {
868 .clock_source = LCDC_CLK_EXTERNAL,
869 .meram_dev = &meram_info,
870 .ch[0] = {
871 .chan = LCDC_CHAN_MAINLCD,
872 .fourcc = V4L2_PIX_FMT_RGB565,
873 .interface_type = RGB24,
874 .clock_divider = 1,
875 .flags = LCDC_FLAGS_DWPOL,
876 .meram_cfg = &hdmi_meram_cfg,
877 .tx_dev = &hdmi_device,
878 }
879};
880
881static struct resource lcdc1_resources[] = {
882 [0] = {
883 .name = "LCDC1",
884 .start = 0xfe944000,
885 .end = 0xfe947fff,
886 .flags = IORESOURCE_MEM,
887 },
888 [1] = {
889 .start = intcs_evt2irq(0x1780),
890 .flags = IORESOURCE_IRQ,
891 },
892};
893
894static struct platform_device lcdc1_device = {
895 .name = "sh_mobile_lcdc_fb",
896 .num_resources = ARRAY_SIZE(lcdc1_resources),
897 .resource = lcdc1_resources,
898 .id = 1,
899 .dev = {
900 .platform_data = &sh_mobile_lcdc1_info,
901 .coherent_dma_mask = ~0,
902 },
903};
904
905static struct platform_device fsi_hdmi_device = {
906 .name = "sh_fsi2_b_hdmi",
907};
908
903static struct gpio_led ap4evb_leds[] = { 909static struct gpio_led ap4evb_leds[] = {
904 { 910 {
905 .name = "led4", 911 .name = "led4",
@@ -1034,9 +1040,9 @@ static struct platform_device *ap4evb_devices[] __initdata = {
1034 &fsi_ak4643_device, 1040 &fsi_ak4643_device,
1035 &fsi_hdmi_device, 1041 &fsi_hdmi_device,
1036 &sh_mmcif_device, 1042 &sh_mmcif_device,
1037 &lcdc1_device,
1038 &lcdc_device,
1039 &hdmi_device, 1043 &hdmi_device,
1044 &lcdc_device,
1045 &lcdc1_device,
1040 &ceu_device, 1046 &ceu_device,
1041 &ap4evb_camera, 1047 &ap4evb_camera,
1042 &meram_device, 1048 &meram_device,
@@ -1347,8 +1353,8 @@ static void __init ap4evb_init(void)
1347 lcdc_info.ch[0].interface_type = RGB24; 1353 lcdc_info.ch[0].interface_type = RGB24;
1348 lcdc_info.ch[0].clock_divider = 1; 1354 lcdc_info.ch[0].clock_divider = 1;
1349 lcdc_info.ch[0].flags = LCDC_FLAGS_DWPOL; 1355 lcdc_info.ch[0].flags = LCDC_FLAGS_DWPOL;
1350 lcdc_info.ch[0].lcd_size_cfg.width = 44; 1356 lcdc_info.ch[0].panel_cfg.width = 44;
1351 lcdc_info.ch[0].lcd_size_cfg.height = 79; 1357 lcdc_info.ch[0].panel_cfg.height = 79;
1352 1358
1353 platform_add_devices(qhd_devices, ARRAY_SIZE(qhd_devices)); 1359 platform_add_devices(qhd_devices, ARRAY_SIZE(qhd_devices));
1354 1360
@@ -1389,8 +1395,8 @@ static void __init ap4evb_init(void)
1389 lcdc_info.ch[0].interface_type = RGB18; 1395 lcdc_info.ch[0].interface_type = RGB18;
1390 lcdc_info.ch[0].clock_divider = 3; 1396 lcdc_info.ch[0].clock_divider = 3;
1391 lcdc_info.ch[0].flags = 0; 1397 lcdc_info.ch[0].flags = 0;
1392 lcdc_info.ch[0].lcd_size_cfg.width = 152; 1398 lcdc_info.ch[0].panel_cfg.width = 152;
1393 lcdc_info.ch[0].lcd_size_cfg.height = 91; 1399 lcdc_info.ch[0].panel_cfg.height = 91;
1394 1400
1395 /* enable TouchScreen */ 1401 /* enable TouchScreen */
1396 irq_set_irq_type(IRQ7, IRQ_TYPE_LEVEL_LOW); 1402 irq_set_irq_type(IRQ7, IRQ_TYPE_LEVEL_LOW);