Skip to content

Commit 473c33f

Browse files
AngeloGioacchino Del RegnoChun-Kuang Hu
authored andcommitted
drm/mediatek: mtk_dpi: Explicitly manage TVD clock in power on/off
In preparation for adding support for MT8195's HDMI reserved DPI, add calls to clk_prepare_enable() / clk_disable_unprepare() for the TVD clock: in this particular case, the aforementioned clock is not (and cannot be) parented to neither pixel or engine clocks hence it won't get enabled automatically by the clock framework. Please note that on all of the currently supported MediaTek platforms, the TVD clock is always a parent of either pixel or engine clocks, and this means that the common clock framework is already enabling this clock before the children. On such platforms, this commit will only increase the refcount of the TVD clock without any functional change. Reviewed-by: CK Hu <[email protected]> Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Link: https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/ Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent 6e1931e commit 473c33f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/gpu/drm/mediatek/mtk_dpi.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ static void mtk_dpi_power_off(struct mtk_dpi *dpi)
499499

500500
mtk_dpi_disable(dpi);
501501
clk_disable_unprepare(dpi->pixel_clk);
502+
clk_disable_unprepare(dpi->tvd_clk);
502503
clk_disable_unprepare(dpi->engine_clk);
503504
}
504505

@@ -515,6 +516,12 @@ static int mtk_dpi_power_on(struct mtk_dpi *dpi)
515516
goto err_refcount;
516517
}
517518

519+
ret = clk_prepare_enable(dpi->tvd_clk);
520+
if (ret) {
521+
dev_err(dpi->dev, "Failed to enable tvd pll: %d\n", ret);
522+
goto err_engine;
523+
}
524+
518525
ret = clk_prepare_enable(dpi->pixel_clk);
519526
if (ret) {
520527
dev_err(dpi->dev, "Failed to enable pixel clock: %d\n", ret);
@@ -524,6 +531,8 @@ static int mtk_dpi_power_on(struct mtk_dpi *dpi)
524531
return 0;
525532

526533
err_pixel:
534+
clk_disable_unprepare(dpi->tvd_clk);
535+
err_engine:
527536
clk_disable_unprepare(dpi->engine_clk);
528537
err_refcount:
529538
dpi->refcount--;

0 commit comments

Comments
 (0)