From: zwl Date: Mon, 11 Aug 2014 02:40:56 +0000 (+0800) Subject: rk312x lcdc: add config the sclk for dual disp X-Git-Tag: firefly_0821_release~4916^2~16 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=72559a81ac849b2fb4c443809d545391a9eeb335;p=firefly-linux-kernel-4.4.55.git rk312x lcdc: add config the sclk for dual disp --- diff --git a/arch/arm/boot/dts/rk312x.dtsi b/arch/arm/boot/dts/rk312x.dtsi index 99501b2e488c..04e51f2ee1d8 100755 --- a/arch/arm/boot/dts/rk312x.dtsi +++ b/arch/arm/boot/dts/rk312x.dtsi @@ -650,7 +650,7 @@ reg = <0x1010e000 0x2000>; interrupts = ; clocks = <&clk_gates6 0>, <&dclk_lcdc0>, <&clk_gates6 1>, <&sclk_lcdc0>; - clock-names = "aclk_lcdc", "dclk_lcdc", "hclk_lcdc", "sclk"; + clock-names = "aclk_lcdc", "dclk_lcdc", "hclk_lcdc", "sclk_lcdc"; rockchip,iommu-enabled = <1>; status = "disabled"; }; diff --git a/drivers/video/rockchip/lcdc/rk312x_lcdc.c b/drivers/video/rockchip/lcdc/rk312x_lcdc.c index cf3e44b9cbcf..8c9f5242a58a 100755 --- a/drivers/video/rockchip/lcdc/rk312x_lcdc.c +++ b/drivers/video/rockchip/lcdc/rk312x_lcdc.c @@ -512,6 +512,7 @@ static int rk312x_lcdc_pre_init(struct rk_lcdc_driver *dev_drv) lcdc_dev->hclk = devm_clk_get(lcdc_dev->dev, "hclk_lcdc"); lcdc_dev->aclk = devm_clk_get(lcdc_dev->dev, "aclk_lcdc"); lcdc_dev->dclk = devm_clk_get(lcdc_dev->dev, "dclk_lcdc"); + lcdc_dev->sclk = devm_clk_get(lcdc_dev->dev, "sclk_lcdc"); // lcdc_dev->pd = devm_clk_get(lcdc_dev->dev, "pd_lcdc"); if ( /*IS_ERR(lcdc_dev->pd) || */ (IS_ERR(lcdc_dev->aclk)) || @@ -672,6 +673,7 @@ static int rk312x_lcdc_set_scaler(struct rk_lcdc_driver *dev_drv, return 0; if(!enable) { + clk_disable_unprepare(lcdc_dev->sclk); dev_info(lcdc_dev->dev, "%s: disable\n", __func__); return 0; } @@ -688,6 +690,7 @@ static int rk312x_lcdc_set_scaler(struct rk_lcdc_driver *dev_drv, src = dst_screen->ext_screen; + clk_prepare_enable(lcdc_dev->sclk); lcdc_dev->s_pixclock = calc_sclk(src, dst); clk_set_rate(lcdc_dev->sclk, lcdc_dev->s_pixclock);