diff options
| author | CK Hu <ck.hu@mediatek.com> | 2020-08-28 13:37:06 +0800 |
|---|---|---|
| committer | Chun-Kuang Hu <chunkuang.hu@kernel.org> | 2020-12-29 07:11:15 +0800 |
| commit | c0d36de868a6834f0124d248ac5c313d3c4d90bf (patch) | |
| tree | 8d4f8d87058ccfa2cae0db3a8996cef6e7f2d62b /drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h | |
| parent | 926df14ec571f6cdbf6d941a0f1be112bf7a7535 (diff) | |
drm/mediatek: Move clk info from struct mtk_ddp_comp to sub driver private data
Some ddp component exist in both display path and other path, so data
belonged to sub driver should be moved into sub driver private data so it
could be used for multiple path. clk info is one of sub driver data, so
move it.
Signed-off-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h')
| -rw-r--r-- | drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h index 6353f050fdf5..89308192a384 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h @@ -39,6 +39,8 @@ enum mtk_ddp_comp_type { struct mtk_ddp_comp; struct cmdq_pkt; struct mtk_ddp_comp_funcs { + int (*clk_enable)(struct device *dev); + void (*clk_disable)(struct device *dev); void (*config)(struct mtk_ddp_comp *comp, unsigned int w, unsigned int h, unsigned int vrefresh, unsigned int bpc, struct cmdq_pkt *cmdq_pkt); @@ -63,7 +65,7 @@ struct mtk_ddp_comp_funcs { }; struct mtk_ddp_comp { - struct clk *clk; + struct device *dev; void __iomem *regs; int irq; struct device *larb_dev; @@ -73,6 +75,20 @@ struct mtk_ddp_comp { u8 subsys; }; +static inline int mtk_ddp_comp_clk_enable(struct mtk_ddp_comp *comp) +{ + if (comp->funcs && comp->funcs->clk_enable) + return comp->funcs->clk_enable(comp->dev); + + return 0; +} + +static inline void mtk_ddp_comp_clk_disable(struct mtk_ddp_comp *comp) +{ + if (comp->funcs && comp->funcs->clk_disable) + comp->funcs->clk_disable(comp->dev); +} + static inline void mtk_ddp_comp_config(struct mtk_ddp_comp *comp, unsigned int w, unsigned int h, unsigned int vrefresh, unsigned int bpc, |
