rockchip: video: Add LVDS support in vop driver
authorJacob Chen <jacob-chen@iotwrt.com>
Mon, 14 Mar 2016 03:20:18 +0000 (11:20 +0800)
committerAnatolij Gustschin <agust@denx.de>
Mon, 14 Mar 2016 21:24:10 +0000 (22:24 +0100)
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>
arch/arm/include/asm/arch-rockchip/vop_rk3288.h
drivers/video/rockchip/rk_vop.c

index 0104ba3f2a391f04e145ae53518c18aec8aab79f..0ce3d6746f32aafd92b78bca14ef2a0390ee6a2d 100644 (file)
@@ -89,6 +89,7 @@ enum {
 enum vop_modes {
        VOP_MODE_EDP = 0,
        VOP_MODE_HDMI,
+       VOP_MODE_LVDS,
        VOP_MODE_NONE,
        VOP_MODE_AUTO_DETECT,
        VOP_MODE_UNKNOWN,
index adbc68f93694a71c9bb1f5c37f64ed870d8671ce..a54af172ec066dbdd9262ec50b97a8a525216ca5 100644 (file)
@@ -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(&regs->sys_ctrl, M_ALL_OUT_EN,
                                V_EDP_OUT_EN(1));
                break;
+       case VOP_MODE_LVDS:
+               clrsetbits_le32(&regs->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) {