aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/sh_mipi_dsi.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2011-11-08 23:35:27 -0500
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-11-21 18:43:22 -0500
commita2e6297153f8fc7185d119c59d8eed1ee7d4c74f (patch)
tree8f1cff478291576509c5c057ea8e8ea665f92213 /drivers/video/sh_mipi_dsi.c
parent5e47431aabf716c9ad9eacf1a966e1fc1469c809 (diff)
fbdev: sh_mipi_dsi: add HSxxCLK support
SH MIPI manual explains the calculation method of HBP/HFP. it is based on HSbyteCLK settings. SH73a0 chip can use HS6divCLK/HS4divCLK for it. This patch has compatibility to SH7372 mipi Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/sh_mipi_dsi.c')
-rw-r--r--drivers/video/sh_mipi_dsi.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
index 77743f4388a0..b8aea8c60bc7 100644
--- a/drivers/video/sh_mipi_dsi.c
+++ b/drivers/video/sh_mipi_dsi.c
@@ -153,7 +153,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
153 void __iomem *base = mipi->base; 153 void __iomem *base = mipi->base;
154 struct sh_mobile_lcdc_chan_cfg *ch = pdata->lcd_chan; 154 struct sh_mobile_lcdc_chan_cfg *ch = pdata->lcd_chan;
155 u32 pctype, datatype, pixfmt, linelength, vmctr2; 155 u32 pctype, datatype, pixfmt, linelength, vmctr2;
156 u32 tmp, top, bottom, delay; 156 u32 tmp, top, bottom, delay, div;
157 bool yuv; 157 bool yuv;
158 int bpp; 158 int bpp;
159 159
@@ -364,17 +364,23 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
364 bottom = 0x00000001; 364 bottom = 0x00000001;
365 delay = 0; 365 delay = 0;
366 366
367 div = 1; /* HSbyteCLK is calculation base
368 * HS4divCLK = HSbyteCLK/2
369 * HS6divCLK is not supported for now */
370 if (pdata->flags & SH_MIPI_DSI_HS4divCLK)
371 div = 2;
372
367 if (pdata->flags & SH_MIPI_DSI_HFPBM) { /* HBPLEN */ 373 if (pdata->flags & SH_MIPI_DSI_HFPBM) { /* HBPLEN */
368 top = ch->lcd_cfg[0].hsync_len + ch->lcd_cfg[0].left_margin; 374 top = ch->lcd_cfg[0].hsync_len + ch->lcd_cfg[0].left_margin;
369 top = ((pdata->lane * top) - 10) << 16; 375 top = ((pdata->lane * top / div) - 10) << 16;
370 } 376 }
371 if (pdata->flags & SH_MIPI_DSI_HBPBM) { /* HFPLEN */ 377 if (pdata->flags & SH_MIPI_DSI_HBPBM) { /* HFPLEN */
372 bottom = ch->lcd_cfg[0].right_margin; 378 bottom = ch->lcd_cfg[0].right_margin;
373 bottom = (pdata->lane * bottom) - 12; 379 bottom = (pdata->lane * bottom / div) - 12;
374 } 380 }
375 381
376 bpp = linelength / ch->lcd_cfg[0].xres; /* byte / pixel */ 382 bpp = linelength / ch->lcd_cfg[0].xres; /* byte / pixel */
377 if (pdata->lane > bpp) { 383 if ((pdata->lane / div) > bpp) {
378 tmp = ch->lcd_cfg[0].xres / bpp; /* output cycle */ 384 tmp = ch->lcd_cfg[0].xres / bpp; /* output cycle */
379 tmp = ch->lcd_cfg[0].xres - tmp; /* (input - output) cycle */ 385 tmp = ch->lcd_cfg[0].xres - tmp; /* (input - output) cycle */
380 delay = (pdata->lane * tmp); 386 delay = (pdata->lane * tmp);