From 0adc053831679031035b8325c96a64cd3df81b5a Mon Sep 17 00:00:00 2001 From: Huang Jiachai Date: Fri, 15 Jul 2016 11:58:40 +0800 Subject: [PATCH] video: rockchip: vop: 3399: fix polarity config error Change-Id: I136d602e384a6e73278e30be3c3bb6d58086285c Signed-off-by: Huang Jiachai --- drivers/video/rockchip/lcdc/rk322x_lcdc.c | 30 ++++++++++++++++++----- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/drivers/video/rockchip/lcdc/rk322x_lcdc.c b/drivers/video/rockchip/lcdc/rk322x_lcdc.c index 8e5c4ece9cc8..53e61871071b 100644 --- a/drivers/video/rockchip/lcdc/rk322x_lcdc.c +++ b/drivers/video/rockchip/lcdc/rk322x_lcdc.c @@ -1998,6 +1998,12 @@ static int vop_load_screen(struct rk_lcdc_driver *dev_drv, bool initscreen) } val = V_HDMI_OUT_EN(1) | V_SW_UV_OFFSET_EN(0); vop_msk_reg(vop_dev, SYS_CTRL, val); + val = V_HDMI_HSYNC_POL(screen->pin_hsync) | + V_HDMI_VSYNC_POL(screen->pin_vsync) | + V_HDMI_DEN_POL(screen->pin_den) | + V_HDMI_DCLK_POL(screen->pin_dclk); + /*hsync vsync den dclk polo,dither */ + vop_msk_reg(vop_dev, DSP_CTRL1, val); break; case SCREEN_RGB: case SCREEN_LVDS: @@ -2007,10 +2013,22 @@ static int vop_load_screen(struct rk_lcdc_driver *dev_drv, bool initscreen) case SCREEN_MIPI: val = V_MIPI_OUT_EN(1); vop_msk_reg(vop_dev, SYS_CTRL, val); + val = V_MIPI_HSYNC_POL(screen->pin_hsync) | + V_MIPI_VSYNC_POL(screen->pin_vsync) | + V_MIPI_DEN_POL(screen->pin_den) | + V_MIPI_DCLK_POL(screen->pin_dclk); + /*hsync vsync den dclk polo,dither */ + vop_msk_reg(vop_dev, DSP_CTRL1, val); break; case SCREEN_DUAL_MIPI: val = V_MIPI_OUT_EN(1) | V_MIPI_DUAL_CHANNEL_EN(1); vop_msk_reg(vop_dev, SYS_CTRL, val); + val = V_MIPI_HSYNC_POL(screen->pin_hsync) | + V_MIPI_VSYNC_POL(screen->pin_vsync) | + V_MIPI_DEN_POL(screen->pin_den) | + V_MIPI_DCLK_POL(screen->pin_dclk); + /*hsync vsync den dclk polo,dither */ + vop_msk_reg(vop_dev, DSP_CTRL1, val); break; case SCREEN_EDP: if ((VOP_CHIP(vop_dev) == VOP_RK3399) && @@ -2018,18 +2036,18 @@ static int vop_load_screen(struct rk_lcdc_driver *dev_drv, bool initscreen) face = OUT_P101010; val = V_EDP_OUT_EN(1); vop_msk_reg(vop_dev, SYS_CTRL, val); + val = V_EDP_HSYNC_POL(screen->pin_hsync) | + V_EDP_VSYNC_POL(screen->pin_vsync) | + V_EDP_DEN_POL(screen->pin_den) | + V_EDP_DCLK_POL(screen->pin_dclk); + /*hsync vsync den dclk polo,dither */ + vop_msk_reg(vop_dev, DSP_CTRL1, val); break; default: dev_err(vop_dev->dev, "un supported interface[%d]!\n", screen->type); break; } - val = V_HDMI_HSYNC_POL(screen->pin_hsync) | - V_HDMI_VSYNC_POL(screen->pin_vsync) | - V_HDMI_DEN_POL(screen->pin_den) | - V_HDMI_DCLK_POL(screen->pin_dclk); - /*hsync vsync den dclk polo,dither */ - vop_msk_reg(vop_dev, DSP_CTRL1, val); if (screen->color_mode == COLOR_RGB) dev_drv->overlay_mode = VOP_RGB_DOMAIN; -- 2.34.1