aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/gpu/drm/mediatek/mtk_disp_color.c
diff options
context:
space:
mode:
authorCK Hu <ck.hu@mediatek.com>2020-10-12 11:50:47 +0800
committerChun-Kuang Hu <chunkuang.hu@kernel.org>2021-01-07 06:28:16 +0800
commit1d33f13a1be32915f25c63f13100938cb9de4c63 (patch)
tree12fdb080dd1e604259de6b291e92be05b4ce3f64 /drivers/gpu/drm/mediatek/mtk_disp_color.c
parentdrm/mediatek: Register vblank callback function (diff)
downloadwireguard-linux-1d33f13a1be32915f25c63f13100938cb9de4c63.tar.xz
wireguard-linux-1d33f13a1be32915f25c63f13100938cb9de4c63.zip
drm/mediatek: DRM driver directly refer to sub driver's function
Some ddp component exist in both display path and other path, so sub driver should not directly call DRM driver's function. Let DRM driver directly refer to sub driver's function so that sub driver need not register these function to DRM driver. 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_disp_color.c')
-rw-r--r--drivers/gpu/drm/mediatek/mtk_disp_color.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_disp_color.c b/drivers/gpu/drm/mediatek/mtk_disp_color.c
index dc2fdde1951c..d28c06d02286 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_color.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_color.c
@@ -11,6 +11,7 @@
#include <linux/platform_device.h>
#include <linux/soc/mediatek/mtk-cmdq.h>
+#include "mtk_disp_drv.h"
#include "mtk_drm_crtc.h"
#include "mtk_drm_ddp_comp.h"
@@ -44,23 +45,23 @@ struct mtk_disp_color {
const struct mtk_disp_color_data *data;
};
-static int mtk_color_clk_enable(struct device *dev)
+int mtk_color_clk_enable(struct device *dev)
{
struct mtk_disp_color *color = dev_get_drvdata(dev);
return clk_prepare_enable(color->clk);
}
-static void mtk_color_clk_disable(struct device *dev)
+void mtk_color_clk_disable(struct device *dev)
{
struct mtk_disp_color *color = dev_get_drvdata(dev);
clk_disable_unprepare(color->clk);
}
-static void mtk_color_config(struct device *dev, unsigned int w,
- unsigned int h, unsigned int vrefresh,
- unsigned int bpc, struct cmdq_pkt *cmdq_pkt)
+void mtk_color_config(struct device *dev, unsigned int w,
+ unsigned int h, unsigned int vrefresh,
+ unsigned int bpc, struct cmdq_pkt *cmdq_pkt)
{
struct mtk_disp_color *color = dev_get_drvdata(dev);
@@ -68,7 +69,7 @@ static void mtk_color_config(struct device *dev, unsigned int w,
mtk_ddp_write(cmdq_pkt, h, &color->cmdq_reg, color->regs, DISP_COLOR_HEIGHT(color));
}
-static void mtk_color_start(struct device *dev)
+void mtk_color_start(struct device *dev)
{
struct mtk_disp_color *color = dev_get_drvdata(dev);
@@ -77,13 +78,6 @@ static void mtk_color_start(struct device *dev)
writel(0x1, color->regs + DISP_COLOR_START(color));
}
-static const struct mtk_ddp_comp_funcs mtk_disp_color_funcs = {
- .clk_enable = mtk_color_clk_enable,
- .clk_disable = mtk_color_clk_disable,
- .config = mtk_color_config,
- .start = mtk_color_start,
-};
-
static int mtk_disp_color_bind(struct device *dev, struct device *master,
void *data)
{
@@ -151,8 +145,7 @@ static int mtk_disp_color_probe(struct platform_device *pdev)
return comp_id;
}
- ret = mtk_ddp_comp_init(dev->of_node, &priv->ddp_comp, comp_id,
- &mtk_disp_color_funcs);
+ ret = mtk_ddp_comp_init(dev->of_node, &priv->ddp_comp, comp_id);
if (ret) {
if (ret != -EPROBE_DEFER)
dev_err(dev, "Failed to initialize component: %d\n",