From: Mark Yao Date: Wed, 22 Mar 2017 02:10:32 +0000 (+0800) Subject: video/rockchip: rga2: enable rga power when read rga version X-Git-Tag: firefly_0821_release~262 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=830239e9c93392b60eb5d955f74224820a076418;p=firefly-linux-kernel-4.4.55.git video/rockchip: rga2: enable rga power when read rga version Change-Id: Ib2a704b8f75f4b792dc5a70ed58c0b9306c2793c Signed-off-by: Mark Yao --- diff --git a/drivers/video/rockchip/rga2/rga2_drv.c b/drivers/video/rockchip/rga2/rga2_drv.c index 7030a55c0153..05c927518f17 100644 --- a/drivers/video/rockchip/rga2/rga2_drv.c +++ b/drivers/video/rockchip/rga2/rga2_drv.c @@ -159,8 +159,22 @@ static inline int rga2_init_version(void) pr_err("rga2_drvdata is null\n"); return -EINVAL; } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) + pm_runtime_get_sync(rga2_drvdata->dev); +#endif + + clk_prepare_enable(rga2_drvdata->aclk_rga2); + clk_prepare_enable(rga2_drvdata->hclk_rga2); reg_version = rga2_read(0x028); + + clk_disable_unprepare(rga2_drvdata->aclk_rga2); + clk_disable_unprepare(rga2_drvdata->hclk_rga2); + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) + pm_runtime_put(rga2_drvdata->dev); +#endif + major_version = (reg_version & RGA2_MAJOR_VERSION_MASK) >> 24; minor_version = (reg_version & RGA2_MINOR_VERSION_MASK) >> 20;