mfd:rk616:vif:fix dual lvds support
authoryxj <yxj@rock-chips.com>
Fri, 3 May 2013 04:22:54 +0000 (12:22 +0800)
committeryxj <yxj@rock-chips.com>
Tue, 7 May 2013 08:05:50 +0000 (16:05 +0800)
drivers/video/display/transmitter/rk616_vif.c
include/linux/mfd/rk616.h

index 6eb96ab315affabe571d457dfca85a6beda2537c..1130712b731c51dd6996f22ad9bc4b0afbfa7ca6 100644 (file)
@@ -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");
index ff72bf2df62b01626660ab7157c6faba3ac6dcff..c277ae4b902f979cc134e32bd518e479acef6b31 100644 (file)
 #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)