From: yxj Date: Fri, 3 May 2013 04:22:54 +0000 (+0800) Subject: mfd:rk616:vif:fix dual lvds support X-Git-Tag: firefly_0821_release~7145 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=baaaae0f0c5be3430de3b49e7b13cf46e9e7657e;p=firefly-linux-kernel-4.4.55.git mfd:rk616:vif:fix dual lvds support --- diff --git a/drivers/video/display/transmitter/rk616_vif.c b/drivers/video/display/transmitter/rk616_vif.c index 6eb96ab315af..1130712b731c 100644 --- a/drivers/video/display/transmitter/rk616_vif.c +++ b/drivers/video/display/transmitter/rk616_vif.c @@ -536,6 +536,7 @@ static int rk616_lvds_cfg(struct mfd_rk616 *rk616,rk_screen *screen) struct rk616_route *route = &rk616->route; u32 val = 0; int ret; + int odd = (screen->left_margin&0x01)?0:1; if(!route->lvds_en) //lvds port is not used ,power down lvds { @@ -559,12 +560,14 @@ static int rk616_lvds_cfg(struct mfd_rk616 *rk616,rk_screen *screen) if(route->lvds_ch_nr == 2) //dual lvds channel { - val &= ~(LVDS_CH0TTL_EN | LVDS_CH1TTL_EN); - val = (LVDS_DCLK_INV) | (LVDS_CH1_PWR_EN) |(LVDS_CH0_PWR_EN) | + val = 0; + val &= ~(LVDS_CH0TTL_EN | LVDS_CH1TTL_EN | LVDS_PLL_PWR_DN); + val = (LVDS_DCLK_INV)|(LVDS_CH1_PWR_EN) |(LVDS_CH0_PWR_EN) | LVDS_HBP_ODD(odd) | (LVDS_CBG_PWR_EN) | (LVDS_CH_SEL) | (LVDS_OUT_FORMAT(screen->hw_format)) | (LVDS_CH0TTL_EN << 16) | (LVDS_CH1TTL_EN << 16) |(LVDS_CH1_PWR_EN << 16) | (LVDS_CH0_PWR_EN << 16) | (LVDS_CBG_PWR_EN << 16) | (LVDS_CH_SEL << 16) | - (LVDS_OUT_FORMAT_MASK); + (LVDS_OUT_FORMAT_MASK) | (LVDS_DCLK_INV << 16) | (LVDS_PLL_PWR_DN << 16) | + (LVDS_HBP_ODD_MASK); ret = rk616->write_dev(rk616,CRU_LVDS_CON0,&val); dev_info(rk616->dev,"rk616 use dual lvds channel.......\n"); diff --git a/include/linux/mfd/rk616.h b/include/linux/mfd/rk616.h index ff72bf2df62b..c277ae4b902f 100644 --- a/include/linux/mfd/rk616.h +++ b/include/linux/mfd/rk616.h @@ -157,8 +157,9 @@ #define CRU_I2C_CON0 0x0080 #define CRU_LVDS_CON0 0x0084 +#define LVDS_HBP_ODD_MASK (0x1<<30) #define LVDS_OUT_FORMAT_MASK (3<<16) -#define LVDS_CON_ST_PHASE (1<<14) +#define LVDS_HBP_ODD(x) (((x)&1)<<14) #define LVDS_DCLK_INV (1<<13) #define LVDS_CH1_LOAD (1<<12) #define LVDS_CH0_LOAD (1<<11)