From: yxj Date: Tue, 7 May 2013 09:26:12 +0000 (+0800) Subject: mdf:rk616:vif:set mclk to 12M when vif on X-Git-Tag: firefly_0821_release~7140 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=89a2c8a5b53832979719bbbaef9bea95af96ba31;p=firefly-linux-kernel-4.4.55.git mdf:rk616:vif:set mclk to 12M when vif on --- diff --git a/drivers/mfd/rk616-core.c b/drivers/mfd/rk616-core.c index f8c0ec82e144..c5416aa68c99 100644 --- a/drivers/mfd/rk616-core.c +++ b/drivers/mfd/rk616-core.c @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include @@ -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); } diff --git a/drivers/video/display/transmitter/rk616_vif.c b/drivers/video/display/transmitter/rk616_vif.c index 3acaaa0e1bb4..7be4417de5b7 100644 --- a/drivers/video/display/transmitter/rk616_vif.c +++ b/drivers/video/display/transmitter/rk616_vif.c @@ -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)) { diff --git a/include/linux/mfd/rk616.h b/include/linux/mfd/rk616.h index 40b06ea42c2c..95a88ab0369b 100644 --- a/include/linux/mfd/rk616.h +++ b/include/linux/mfd/rk616.h @@ -4,6 +4,7 @@ #include #include #include +#include #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);