From: Andrzej Hajda Date: Wed, 23 Mar 2016 13:25:58 +0000 (+0100) Subject: drm/exynos: add support for pipeline clock to the framework X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f26b9343f582f44ec920474d71b4b2220b1ed9a8;p=linux-beck.git drm/exynos: add support for pipeline clock to the framework Components belonging to the same pipeline often requires synchronized clocks. Such clocks are sometimes provided by external clock controller, but they can be also provided by pipeline components. In latter case there should be a way to access them from another component belonging to the same pipeline. This is the case of: - DECON,FIMD -> HDMI and HDMI-PHY clock, - FIMD -> DP and DP clock in FIMD. The latter case has been solved by clock_enable callback in exynos_drm_crtc_ops. This solutin will not work with HDMI path as in this case clock is provided by encoder. This patch provides more generic solution allowing to register pipeline clock during initialization in exynos_drm_crtc structure. This way the clock will be easily accessible from both components. Signed-off-by: Andrzej Hajda Signed-off-by: Inki Dae --- diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 481b6022c707..7d84835a8cdf 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -154,6 +154,10 @@ struct exynos_drm_crtc_ops { void (*clock_enable)(struct exynos_drm_crtc *crtc, bool enable); }; +struct exynos_drm_clk { + void (*enable)(struct exynos_drm_clk *clk, bool enable); +}; + /* * Exynos specific crtc structure. * @@ -182,8 +186,16 @@ struct exynos_drm_crtc { atomic_t pending_update; const struct exynos_drm_crtc_ops *ops; void *ctx; + struct exynos_drm_clk *pipe_clk; }; +static inline void exynos_drm_pipe_clk_enable(struct exynos_drm_crtc *crtc, + bool enable) +{ + if (crtc->pipe_clk) + crtc->pipe_clk->enable(crtc->pipe_clk, enable); +} + struct exynos_drm_g2d_private { struct device *dev; struct list_head inuse_cmdlist;