[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAOTY_-wEzu6JavEAyRo8njOLRMq3i3wEcemNsuMaK00W9QqpQ@mail.gmail.com>
Date: Mon, 13 Mar 2023 23:21:08 +0800
From: Chun-Kuang Hu <chunkuang.hu@...nel.org>
To: Alexandre Mergnat <amergnat@...libre.com>
Cc: Daniel Vetter <daniel@...ll.ch>, CK Hu <ck.hu@...iatek.com>,
Jitao Shi <jitao.shi@...iatek.com>,
Thierry Reding <thierry.reding@...il.com>,
Philipp Zabel <p.zabel@...gutronix.de>,
Sam Ravnborg <sam@...nborg.org>,
Rob Herring <robh+dt@...nel.org>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Chun-Kuang Hu <chunkuang.hu@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
David Airlie <airlied@...il.com>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Xinlei Lee <xinlei.lee@...iatek.com>,
Guillaume La Roque <glaroque@...libre.com>,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org,
dri-devel@...ts.freedesktop.org,
Fabien Parent <fparent@...libre.com>,
Neil Armstrong <neil.armstrong@...aro.org>,
linux-pwm@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 19/21] drm/mediatek: dpi: add support for dpi clock
Hi, Alexandre:
Alexandre Mergnat <amergnat@...libre.com> 於 2023年3月9日 週四 下午10:23寫道:
>
> From: Fabien Parent <fparent@...libre.com>
>
> MT8365 requires an additional clock for DPI. Add support for that
> additional clock.
>
> Signed-off-by: Fabien Parent <fparent@...libre.com>
> Signed-off-by: Alexandre Mergnat <amergnat@...libre.com>
> ---
> drivers/gpu/drm/mediatek/mtk_dpi.c | 18 +++++++++++++++++-
> 1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
> index 4317595a15d1..474c6e5bbf04 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dpi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
> @@ -68,6 +68,7 @@ struct mtk_dpi {
> struct device *dev;
> struct clk *engine_clk;
> struct clk *pixel_clk;
> + struct clk *dpi_clk;
> struct clk *tvd_clk;
> int irq;
> struct drm_display_mode mode;
> @@ -464,6 +465,7 @@ static void mtk_dpi_power_off(struct mtk_dpi *dpi)
> mtk_dpi_disable(dpi);
> clk_disable_unprepare(dpi->pixel_clk);
> clk_disable_unprepare(dpi->engine_clk);
> + clk_disable_unprepare(dpi->dpi_clk);
> }
>
> static int mtk_dpi_power_on(struct mtk_dpi *dpi)
> @@ -473,10 +475,16 @@ static int mtk_dpi_power_on(struct mtk_dpi *dpi)
> if (++dpi->refcount != 1)
> return 0;
>
> + ret = clk_prepare_enable(dpi->dpi_clk);
> + if (ret) {
> + dev_err(dpi->dev, "failed to enable dpi clock: %d\n", ret);
> + goto err_refcount;
> + }
> +
> ret = clk_prepare_enable(dpi->engine_clk);
> if (ret) {
> dev_err(dpi->dev, "Failed to enable engine clock: %d\n", ret);
> - goto err_refcount;
> + goto err_engine;
> }
>
> ret = clk_prepare_enable(dpi->pixel_clk);
> @@ -489,6 +497,8 @@ static int mtk_dpi_power_on(struct mtk_dpi *dpi)
>
> err_pixel:
> clk_disable_unprepare(dpi->engine_clk);
> +err_engine:
> + clk_disable_unprepare(dpi->dpi_clk);
> err_refcount:
> dpi->refcount--;
> return ret;
> @@ -1044,6 +1054,12 @@ static int mtk_dpi_probe(struct platform_device *pdev)
> return ret;
> }
>
> + dpi->dpi_clk = devm_clk_get_optional(dev, "dpi");
For MT8365, DPI clock is not optional, so make sure that MT8365 DPI
should have this clock.
Regards,
Chun-Kuang.
> + if (IS_ERR(dpi->dpi_clk)) {
> + return dev_err_probe(dev, ret, "Failed to get dpi clock: %p\n",
> + dpi->dpi_clk);
> + }
> +
> dpi->irq = platform_get_irq(pdev, 0);
> if (dpi->irq <= 0)
> return -EINVAL;
>
> --
> b4 0.10.1
Powered by blists - more mailing lists