mdf:rk616:vif:set mclk to 12M when vif on
authoryxj <yxj@rock-chips.com>
Tue, 7 May 2013 09:26:12 +0000 (17:26 +0800)
committeryxj <yxj@rock-chips.com>
Tue, 7 May 2013 09:26:44 +0000 (17:26 +0800)
drivers/mfd/rk616-core.c
drivers/video/display/transmitter/rk616_vif.c
include/linux/mfd/rk616.h

index f8c0ec82e1443313deff9662c69957c4f4b59c60..c5416aa68c99644036f614edf76875b21671c015 100644 (file)
@@ -5,7 +5,6 @@
 #include <linux/mfd/core.h>
 #include <linux/slab.h>
 #include <linux/mfd/rk616.h>
-#include <linux/clk.h>
 #include <mach/iomux.h>
 #include <linux/err.h>
 #include <linux/uaccess.h>
@@ -378,6 +377,8 @@ static int rk616_i2c_probe(struct i2c_client *client,const struct i2c_device_id
        }
        else
        {
+               rk616->mclk = iis_clk;
+               
                #if defined(CONFIG_ARCH_RK29)
                rk29_mux_api_set(GPIO2D0_I2S0CLK_MIIRXCLKIN_NAME, GPIO2H_I2S0_CLK);
                #else
@@ -385,7 +386,7 @@ static int rk616_i2c_probe(struct i2c_client *client,const struct i2c_device_id
                #endif
                clk_enable(iis_clk);
                clk_set_rate(iis_clk, 11289600);
-               clk_put(iis_clk);
+               //clk_put(iis_clk);
        }
 
        
index 3acaaa0e1bb4ad284f958b86bf43ac71f943a03d..7be4417de5b78c9c31799096b29cde7a4f6c5a40 100644 (file)
@@ -23,6 +23,7 @@ static int rk616_vif_cfg(struct mfd_rk616 *rk616,rk_screen *fscreen,int id)
                {
                        val = (VIF0_EN << 16); //disable vif0
                        ret = rk616->write_dev(rk616,VIF0_REG0,&val);
+                       clk_set_rate(rk616->mclk, 11289600);
                        return 0;
                }
                offset = 0;
@@ -38,6 +39,7 @@ static int rk616_vif_cfg(struct mfd_rk616 *rk616,rk_screen *fscreen,int id)
                {
                        val = (VIF0_EN << 16); //disabl VIF1
                        ret = rk616->write_dev(rk616,VIF1_REG0,&val);
+                       clk_set_rate(rk616->mclk, 11289600);
                        return 0;
                }
                offset = 0x18;
@@ -48,6 +50,10 @@ static int rk616_vif_cfg(struct mfd_rk616 *rk616,rk_screen *fscreen,int id)
                        pll_use_mclk12m = false;
        }
 
+       if(pll_use_mclk12m)
+       {
+               clk_set_rate(rk616->mclk, 12000000);
+       }
        screen = fscreen->ext_screen;
        if(!screen)
        {
@@ -712,7 +718,7 @@ int rk616_set_vif(rk_screen *screen,bool connect)
                pdata = rk616->pdata;
                lcd_screen->ext_screen = screen;
        }
-       
+
        if((pdata->lcd0_func == INPUT) && (pdata->lcd1_func == INPUT))
        {
                
index 40b06ea42c2c94678b7f9de454b45cabf8bdaa26..95a88ab0369b4b49d82308ffa4b6be1589426a96 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/types.h>
 #include <linux/i2c.h>
 #include <linux/rk_fb.h>
+#include <linux/clk.h>
 
 #define VIF0_REG0              0x0000
 #define VIF0_DDR_CLK_EN                (1<<3)
@@ -258,6 +259,7 @@ struct mfd_rk616 {
        struct rk616_platform_data *pdata;
        struct rk616_route route;  //display path router
        struct i2c_client *client;
+       struct clk *mclk;
        struct dentry *debugfs_dir;
        int (*read_dev)(struct mfd_rk616 *rk616,u16 reg,u32 *pval);
        int (*write_dev)(struct mfd_rk616 *rk616,u16 reg,u32 *pval);