fbdev: sh_mipi_dsi: add lane control support
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 9 Nov 2011 04:34:43 +0000 (20:34 -0800)
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Mon, 21 Nov 2011 23:43:21 +0000 (23:43 +0000)
SH MIPI DSI can use 0-4 lane

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>
arch/arm/mach-shmobile/board-ag5evm.c
arch/arm/mach-shmobile/board-ap4evb.c
drivers/video/sh_mipi_dsi.c
include/video/sh_mipi_dsi.h

index b862e9f81e3e557935f13df5ec6fa29128b4d86c..e969fe91e50507caf9c269b5606ae00d4660495f 100644 (file)
@@ -324,6 +324,7 @@ static struct resource mipidsi0_resources[] = {
 static struct sh_mipi_dsi_info mipidsi0_info = {
        .data_format    = MIPI_RGB888,
        .lcd_chan       = &lcdc0_info.ch[0],
+       .lane           = 2,
        .vsynw_offset   = 20,
        .clksrc         = 1,
        .flags          = SH_MIPI_DSI_HSABM,
index 4c865ece9ac4e9dc14aa4612ce7a780e59fed690..b7d006fd046165fbdf4d5a0c0d608ec5c18a9f53 100644 (file)
@@ -580,6 +580,7 @@ static struct resource mipidsi0_resources[] = {
 static struct sh_mipi_dsi_info mipidsi0_info = {
        .data_format    = MIPI_RGB888,
        .lcd_chan       = &lcdc_info.ch[0],
+       .lane           = 2,
        .vsynw_offset   = 17,
 };
 
index dfd51541e24c855420ba9feb9db0e86329bca6f8..af6bec24effb86e1de603444d6bd57054691412b 100644 (file)
@@ -8,6 +8,7 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/bitmap.h>
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/init.h>
@@ -153,6 +154,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
        struct sh_mobile_lcdc_chan_cfg *ch = pdata->lcd_chan;
        u32 pctype, datatype, pixfmt, linelength, vmctr2 = 0x00e00000;
        bool yuv;
+       u32 tmp;
 
        /*
         * Select data format. MIPI DSI is not hot-pluggable, so, we just use
@@ -253,6 +255,9 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
            (!yuv && ch->interface_type != RGB24))
                return -EINVAL;
 
+       if (!pdata->lane)
+               return -EINVAL;
+
        /* reset DSI link */
        iowrite32(0x00000001, base + SYSCTRL);
        /* Hold reset for 100 cycles of the slowest of bus, HS byte and LP clock */
@@ -269,7 +274,10 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
         *      ECC check enable
         * additionally enable first two lanes
         */
-       iowrite32(0x00003703, base + SYSCONF);
+       bitmap_fill((unsigned long *)&tmp, pdata->lane);
+       tmp |= 0x00003700;
+       iowrite32(tmp, base + SYSCONF);
+
        /*
         * T_wakeup = 0x7000
         * T_hs-trail = 3
index 58b78f8c0abd229678cc4306b4b2786eceeaf72a..3d0ec500d8963fe7f0801c73a08daee9d57d4a32 100644 (file)
@@ -35,6 +35,7 @@ struct sh_mobile_lcdc_chan_cfg;
 struct sh_mipi_dsi_info {
        enum sh_mipi_dsi_data_fmt       data_format;
        struct sh_mobile_lcdc_chan_cfg  *lcd_chan;
+       int                             lane;
        unsigned long                   flags;
        u32                             clksrc;
        unsigned int                    vsynw_offset;