[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6af179e2995ce2f4f2e7c72f10516afb0c1604a3.camel@mediatek.com>
Date: Tue, 21 Jun 2022 11:45:29 +0800
From: CK Hu <ck.hu@...iatek.com>
To: Rex-BC Chen <rex-bc.chen@...iatek.com>, <chunkuang.hu@...nel.org>,
<p.zabel@...gutronix.de>, <daniel@...ll.ch>, <robh+dt@...nel.org>,
<krzysztof.kozlowski+dt@...aro.org>, <matthias.bgg@...il.com>,
<airlied@...ux.ie>
CC: <msp@...libre.com>, <granquet@...libre.com>,
<jitao.shi@...iatek.com>, <wenst@...omium.org>,
<angelogioacchino.delregno@...labora.com>,
<dri-devel@...ts.freedesktop.org>,
<linux-mediatek@...ts.infradead.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<Project_Global_Chrome_Upstream_Group@...iatek.com>
Subject: Re: [PATCH v12 11/14] drm/mediatek: dpi: Add tvd_clk enable/disable
flow
On Tue, 2022-06-21 at 11:11 +0800, Rex-BC Chen wrote:
> On Tue, 2022-06-21 at 10:55 +0800, CK Hu wrote:
> > Hi, Bo-Chen:
> >
> > On Mon, 2022-06-20 at 20:10 +0800, Bo-Chen Chen wrote:
> > > We should enable/disable tvd_clk when power_on/power_off, so add
> > > this
> > > patch to do this.
> >
> > Without this patch, what would happen?
> > It seems this patch is redundant for these SoCs:
> >
> > static const struct of_device_id mtk_dpi_of_ids[] = {
> > { .compatible = "mediatek,mt2701-dpi",
> > .data = &mt2701_conf,
> > },
> > { .compatible = "mediatek,mt8173-dpi",
> > .data = &mt8173_conf,
> > },
> > { .compatible = "mediatek,mt8183-dpi",
> > .data = &mt8183_conf,
> > },
> > { .compatible = "mediatek,mt8192-dpi",
> > .data = &mt8192_conf,
> > },
> > { },
> > };
> >
> > Regards,
> > CK
> >
>
> Hello CK,
>
> IMO, this is a bug fix patch. From the usage of clock, if we want to
> use it, we should enable it . Therefore, I think we should add this
> and
> I will add a fix tag for this patch.
I think mt8173 chromebook use this driver for HDMI output. So mt8173
chromebook HDMI could not work normally?
Regards,
CK
>
> BRs,
> Bo-Chen
> >
> > >
> > > Signed-off-by: Bo-Chen Chen <rex-bc.chen@...iatek.com>
> > > ---
> > > drivers/gpu/drm/mediatek/mtk_dpi.c | 11 ++++++++++-
> > > 1 file changed, 10 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c
> > > b/drivers/gpu/drm/mediatek/mtk_dpi.c
> > > index 2717b1741b7a..f83ecb154457 100644
> > > --- a/drivers/gpu/drm/mediatek/mtk_dpi.c
> > > +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
> > > @@ -455,6 +455,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->tvd_clk);
> > > }
> > >
> > > static int mtk_dpi_power_on(struct mtk_dpi *dpi)
> > > @@ -464,10 +465,16 @@ static int mtk_dpi_power_on(struct mtk_dpi
> > > *dpi)
> > > if (++dpi->refcount != 1)
> > > return 0;
> > >
> > > + ret = clk_prepare_enable(dpi->tvd_clk);
> > > + if (ret) {
> > > + dev_err(dpi->dev, "Failed to enable tvd pll: %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);
> > > @@ -484,6 +491,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->tvd_clk);
> > > err_refcount:
> > > dpi->refcount--;
> > > return ret;
> >
> >
>
>
Powered by blists - more mailing lists