From 90f3f1627eb604214fcf7e5ee3f932a571eeeba6 Mon Sep 17 00:00:00 2001 From: xubilv Date: Thu, 20 Oct 2016 11:38:11 +0800 Subject: [PATCH] video: rockchip: edp: Solve the problem of write grf register failure Change-Id: Ia5fa679f4cda5e0c62cf40f2079735c01d0817bc Signed-off-by: xubilv --- arch/arm64/boot/dts/rockchip/rk3399-android.dtsi | 4 ++-- drivers/video/rockchip/transmitter/rk32_dp.c | 10 ++++++++++ drivers/video/rockchip/transmitter/rk32_dp.h | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-android.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-android.dtsi index 83ed035d4b41..260427d127c0 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-android.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399-android.dtsi @@ -498,8 +498,8 @@ reg = <0x0 0xff970000 0x0 0x8000>; rockchip,grf = <&grf>; interrupts = ; - clocks = <&cru PCLK_EDP>, <&cru PCLK_EDP_CTRL>; - clock-names = "clk_edp", "pclk_edp"; + clocks = <&cru PCLK_EDP>, <&cru PCLK_EDP_CTRL>, <&cru PCLK_VIO_GRF>; + clock-names = "clk_edp", "pclk_edp", "clk_grf"; resets = <&cru SRST_P_EDP_CTRL>; reset-names = "edp_apb"; status = "disabled"; diff --git a/drivers/video/rockchip/transmitter/rk32_dp.c b/drivers/video/rockchip/transmitter/rk32_dp.c index 1f665551bc39..6d386bc0e383 100755 --- a/drivers/video/rockchip/transmitter/rk32_dp.c +++ b/drivers/video/rockchip/transmitter/rk32_dp.c @@ -144,7 +144,9 @@ static int rk32_edp_init_edp(struct rk32_edp *edp) val = EDP_SEL_VOP_LIT | (EDP_SEL_VOP_LIT << 16); else val = EDP_SEL_VOP_LIT << 16; + clk_prepare_enable(edp->grf_clk); regmap_write(edp->grf, RK3399_GRF_SOC_CON20, val); + clk_disable_unprepare(edp->grf_clk); } rk32_edp_reset(edp); @@ -1778,6 +1780,14 @@ static int rk32_edp_probe(struct platform_device *pdev) return PTR_ERR(edp->grf); } + if (edp->soctype == SOC_RK3399) { + edp->grf_clk = devm_clk_get(&pdev->dev, "clk_grf"); + if (IS_ERR(edp->grf_clk)) { + dev_err(&pdev->dev, "cannot get grf clk\n"); + return PTR_ERR(edp->grf_clk); + } + } + edp->pd = devm_clk_get(&pdev->dev, "pd_edp"); if (IS_ERR(edp->pd)) { dev_err(&pdev->dev, "cannot get pd\n"); diff --git a/drivers/video/rockchip/transmitter/rk32_dp.h b/drivers/video/rockchip/transmitter/rk32_dp.h index c51bcff0bcc3..2dc41c6b2ec5 100755 --- a/drivers/video/rockchip/transmitter/rk32_dp.h +++ b/drivers/video/rockchip/transmitter/rk32_dp.h @@ -556,6 +556,7 @@ struct rk32_edp { void __iomem *regs; struct regmap *grf; unsigned int irq; + struct clk *grf_clk; struct clk *pd; struct clk *clk_edp; /*clk for edp controller*/ struct clk *clk_24m; /*clk for edp phy*/ @@ -667,4 +668,4 @@ int rk32_edp_wait_hw_lt_done(struct rk32_edp *edp); enum dp_irq_type rk32_edp_get_irq_type(struct rk32_edp *edp); void rk32_edp_clear_hotplug_interrupts(struct rk32_edp *edp); -#endif \ No newline at end of file +#endif -- 2.34.1