aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/board-ap4evb.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-shmobile/board-ap4evb.c')
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index d2e7b73aa9b6..aab0a349f759 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -491,7 +491,7 @@ static struct sh_mobile_lcdc_info lcdc_info = {
491 .meram_dev = &meram_info, 491 .meram_dev = &meram_info,
492 .ch[0] = { 492 .ch[0] = {
493 .chan = LCDC_CHAN_MAINLCD, 493 .chan = LCDC_CHAN_MAINLCD,
494 .bpp = 16, 494 .fourcc = V4L2_PIX_FMT_RGB565,
495 .lcd_cfg = ap4evb_lcdc_modes, 495 .lcd_cfg = ap4evb_lcdc_modes,
496 .num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes), 496 .num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes),
497 .meram_cfg = &lcd_meram_cfg, 497 .meram_cfg = &lcd_meram_cfg,
@@ -564,6 +564,30 @@ static struct platform_device keysc_device = {
564}; 564};
565 565
566/* MIPI-DSI */ 566/* MIPI-DSI */
567#define PHYCTRL 0x0070
568static int sh_mipi_set_dot_clock(struct platform_device *pdev,
569 void __iomem *base,
570 int enable)
571{
572 struct clk *pck = clk_get(&pdev->dev, "dsip_clk");
573 void __iomem *phy = base + PHYCTRL;
574
575 if (IS_ERR(pck))
576 return PTR_ERR(pck);
577
578 if (enable) {
579 clk_set_rate(pck, clk_round_rate(pck, 24000000));
580 iowrite32(ioread32(phy) | (0xb << 8), phy);
581 clk_enable(pck);
582 } else {
583 clk_disable(pck);
584 }
585
586 clk_put(pck);
587
588 return 0;
589}
590
567static struct resource mipidsi0_resources[] = { 591static struct resource mipidsi0_resources[] = {
568 [0] = { 592 [0] = {
569 .start = 0xffc60000, 593 .start = 0xffc60000,
@@ -580,7 +604,11 @@ static struct resource mipidsi0_resources[] = {
580static struct sh_mipi_dsi_info mipidsi0_info = { 604static struct sh_mipi_dsi_info mipidsi0_info = {
581 .data_format = MIPI_RGB888, 605 .data_format = MIPI_RGB888,
582 .lcd_chan = &lcdc_info.ch[0], 606 .lcd_chan = &lcdc_info.ch[0],
607 .lane = 2,
583 .vsynw_offset = 17, 608 .vsynw_offset = 17,
609 .flags = SH_MIPI_DSI_SYNC_PULSES_MODE |
610 SH_MIPI_DSI_HSbyteCLK,
611 .set_dot_clock = sh_mipi_set_dot_clock,
584}; 612};
585 613
586static struct platform_device mipidsi0_device = { 614static struct platform_device mipidsi0_device = {
@@ -798,7 +826,7 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = {
798 .meram_dev = &meram_info, 826 .meram_dev = &meram_info,
799 .ch[0] = { 827 .ch[0] = {
800 .chan = LCDC_CHAN_MAINLCD, 828 .chan = LCDC_CHAN_MAINLCD,
801 .bpp = 16, 829 .fourcc = V4L2_PIX_FMT_RGB565,
802 .interface_type = RGB24, 830 .interface_type = RGB24,
803 .clock_divider = 1, 831 .clock_divider = 1,
804 .flags = LCDC_FLAGS_DWPOL, 832 .flags = LCDC_FLAGS_DWPOL,