提交 26c3d7ac 编写于 作者: K Kuninori Morimoto 提交者: Florian Tobias Schandinat

fbdev: sh_mipi_dsi: add lane control support

SH MIPI DSI can use 0-4 lane
Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: NMagnus Damm <damm@opensource.se>
Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
上级 d07a9d2a
...@@ -324,6 +324,7 @@ static struct resource mipidsi0_resources[] = { ...@@ -324,6 +324,7 @@ static struct resource mipidsi0_resources[] = {
static struct sh_mipi_dsi_info mipidsi0_info = { static struct sh_mipi_dsi_info mipidsi0_info = {
.data_format = MIPI_RGB888, .data_format = MIPI_RGB888,
.lcd_chan = &lcdc0_info.ch[0], .lcd_chan = &lcdc0_info.ch[0],
.lane = 2,
.vsynw_offset = 20, .vsynw_offset = 20,
.clksrc = 1, .clksrc = 1,
.flags = SH_MIPI_DSI_HSABM, .flags = SH_MIPI_DSI_HSABM,
......
...@@ -580,6 +580,7 @@ static struct resource mipidsi0_resources[] = { ...@@ -580,6 +580,7 @@ static struct resource mipidsi0_resources[] = {
static struct sh_mipi_dsi_info mipidsi0_info = { static struct sh_mipi_dsi_info mipidsi0_info = {
.data_format = MIPI_RGB888, .data_format = MIPI_RGB888,
.lcd_chan = &lcdc_info.ch[0], .lcd_chan = &lcdc_info.ch[0],
.lane = 2,
.vsynw_offset = 17, .vsynw_offset = 17,
}; };
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#include <linux/bitmap.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -153,6 +154,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi, ...@@ -153,6 +154,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
struct sh_mobile_lcdc_chan_cfg *ch = pdata->lcd_chan; struct sh_mobile_lcdc_chan_cfg *ch = pdata->lcd_chan;
u32 pctype, datatype, pixfmt, linelength, vmctr2 = 0x00e00000; u32 pctype, datatype, pixfmt, linelength, vmctr2 = 0x00e00000;
bool yuv; bool yuv;
u32 tmp;
/* /*
* Select data format. MIPI DSI is not hot-pluggable, so, we just use * 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, ...@@ -253,6 +255,9 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
(!yuv && ch->interface_type != RGB24)) (!yuv && ch->interface_type != RGB24))
return -EINVAL; return -EINVAL;
if (!pdata->lane)
return -EINVAL;
/* reset DSI link */ /* reset DSI link */
iowrite32(0x00000001, base + SYSCTRL); iowrite32(0x00000001, base + SYSCTRL);
/* Hold reset for 100 cycles of the slowest of bus, HS byte and LP clock */ /* 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, ...@@ -269,7 +274,10 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
* ECC check enable * ECC check enable
* additionally enable first two lanes * 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_wakeup = 0x7000
* T_hs-trail = 3 * T_hs-trail = 3
......
...@@ -35,6 +35,7 @@ struct sh_mobile_lcdc_chan_cfg; ...@@ -35,6 +35,7 @@ struct sh_mobile_lcdc_chan_cfg;
struct sh_mipi_dsi_info { struct sh_mipi_dsi_info {
enum sh_mipi_dsi_data_fmt data_format; enum sh_mipi_dsi_data_fmt data_format;
struct sh_mobile_lcdc_chan_cfg *lcd_chan; struct sh_mobile_lcdc_chan_cfg *lcd_chan;
int lane;
unsigned long flags; unsigned long flags;
u32 clksrc; u32 clksrc;
unsigned int vsynw_offset; unsigned int vsynw_offset;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册