diff options
author | Jacob Chen <jacob-chen@iotwrt.com> | 2016-03-14 11:20:18 +0800 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2016-03-14 22:24:10 +0100 |
commit | 8530783594f6de14ec6d4b7bf804437d6e1a4f5f (patch) | |
tree | 3a909a995fa2c38aef10d2fde6677ab85baed622 /drivers/video/rockchip | |
parent | cfd9794115a46aaf00266f21d8e8d8555d921b70 (diff) |
rockchip: video: Add LVDS support in vop driver
LVDS have a different display out mode, add code to get right flag.
The vop_ip decide display device and the remote_vop_id decide which
vop was being used. So we should use the remote_vop_id to set DCLK_VOP.
Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/video/rockchip')
-rw-r--r-- | drivers/video/rockchip/rk_vop.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/video/rockchip/rk_vop.c b/drivers/video/rockchip/rk_vop.c index adbc68f9369..a54af172ec0 100644 --- a/drivers/video/rockchip/rk_vop.c +++ b/drivers/video/rockchip/rk_vop.c @@ -102,6 +102,7 @@ void rkvop_mode_set(struct rk3288_vop *regs, u32 hfront_porch = edid->hfront_porch.typ; u32 vfront_porch = edid->vfront_porch.typ; uint flags; + int mode_flags; switch (mode) { case VOP_MODE_HDMI: @@ -113,9 +114,20 @@ void rkvop_mode_set(struct rk3288_vop *regs, clrsetbits_le32(®s->sys_ctrl, M_ALL_OUT_EN, V_EDP_OUT_EN(1)); break; + case VOP_MODE_LVDS: + clrsetbits_le32(®s->sys_ctrl, M_ALL_OUT_EN, + V_RGB_OUT_EN(1)); + break; } - flags = V_DSP_OUT_MODE(15) | + if (mode == VOP_MODE_HDMI || mode == VOP_MODE_EDP) + /* RGBaaa */ + mode_flags = 15; + else + /* RGB888 */ + mode_flags = 0; + + flags = V_DSP_OUT_MODE(mode_flags) | V_DSP_HSYNC_POL(!!(edid->flags & DISPLAY_FLAGS_HSYNC_HIGH)) | V_DSP_VSYNC_POL(!!(edid->flags & DISPLAY_FLAGS_VSYNC_HIGH)); @@ -227,7 +239,7 @@ int rk_display_init(struct udevice *dev, ulong fbbase, ret = rkclk_get_clk(CLK_NEW, &clk); if (!ret) { - ret = clk_set_periph_rate(clk, DCLK_VOP0 + vop_id, + ret = clk_set_periph_rate(clk, DCLK_VOP0 + remote_vop_id, timing.pixelclock.typ); } if (ret) { |