devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: Marek Vasut <marex@denx.de>, Adam Ford <aford173@gmail.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	aford@beaconembedded.com, dri-devel@lists.freedesktop.org,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	m.szyprowski@samsung.com, Robert Foss <rfoss@kernel.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Jagan Teki <jagan@amarulasolutions.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	devicetree@vger.kernel.org, Jonas Karlman <jonas@kwiboo.se>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Rob Herring <robh+dt@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	Neil Armstrong <neil.armstrong@linaro.org>,
	linux-kernel@vger.kernel.org,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Shawn Guo <shawnguo@kernel.org>
Subject: Re: [PATCH 3/6] drm: bridge: samsung-dsim: Fetch pll-clock-frequency automatically
Date: Tue, 18 Apr 2023 10:47:07 +0200	[thread overview]
Message-ID: <426e901f14254cfcff87ba1747534f9b856ef738.camel@pengutronix.de> (raw)
In-Reply-To: <56085a0f-02f7-6f45-f351-1f9ee612b748@denx.de>

Am Dienstag, dem 18.04.2023 um 10:30 +0200 schrieb Marek Vasut:
> On 4/18/23 04:29, Adam Ford wrote:
> > On Sun, Apr 16, 2023 at 5:08 PM Marek Vasut <marex@denx.de> wrote:
> > > 
> > > On 4/15/23 12:41, Adam Ford wrote:
> > > > Fetch the clock rate of "sclk_mipi" (or "pll_clk") instead of
> > > > having an entry in the device tree for samsung,pll-clock-frequency.
> > > > 
> > > > Signed-off-by: Adam Ford <aford173@gmail.com>
> > > > ---
> > > >    drivers/gpu/drm/bridge/samsung-dsim.c | 12 ++++++------
> > > >    1 file changed, 6 insertions(+), 6 deletions(-)
> > > > 
> > > > diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c
> > > > index 9fec32b44e05..73f0c3fbbdf5 100644
> > > > --- a/drivers/gpu/drm/bridge/samsung-dsim.c
> > > > +++ b/drivers/gpu/drm/bridge/samsung-dsim.c
> > > > @@ -1744,11 +1744,6 @@ static int samsung_dsim_parse_dt(struct samsung_dsim *dsi)
> > > >        struct device_node *node = dev->of_node;
> > > >        int ret;
> > > > 
> > > > -     ret = samsung_dsim_of_read_u32(node, "samsung,pll-clock-frequency",
> > > > -                                    &dsi->pll_clk_rate);
> > > > -     if (ret < 0)
> > > > -             return ret;
> > > > -
> > > >        ret = samsung_dsim_of_read_u32(node, "samsung,burst-clock-frequency",
> > > >                                       &dsi->burst_clk_rate);
> > > >        if (ret < 0)
> > > 
> > > Does this break compatibility with old samsung DTs ?
> > 
> > My goal here was to declutter the device tree stuff and fetch data
> > automatically if possible. What if I changed this to make them
> > optional?  If they exist, we can use them, if they don't exist, we
> > could read the clock rate.  Would that be acceptable?
> 
> If you do not see any potential problem with ignoring the DT property 
> altogether, that would be better of course, but I think you cannot do 
> that with old DTs, so you should retain backward compatibility fallback, 
> yes. What do you think ?

I'm very much in favor of this patch, but I also think we shouldn't
risk breaking Samsung devices, where we don't now 100% that the input
clock rate provided by the clock driver is correct.

So I think the right approach is to use "samsung,pll-clock-frequency"
when present in DT and get it from the clock provider otherwise. Then
just remove the property from the DTs where we can validate that the
input clock rate is correct, i.e. all i.MX8M*.

Regards,
Lucas

  reply	other threads:[~2023-04-18  8:47 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-15 10:40 [PATCH 1/6] drm: bridge: samsung-dsim: Support multi-lane calculations Adam Ford
2023-04-15 10:40 ` [PATCH 2/6] drm: bridge: samsung-dsim: Fix PMS Calculator on imx8m[mnp] Adam Ford
2023-04-16 22:07   ` Marek Vasut
2023-04-16 22:31     ` Adam Ford
2023-04-17  7:00       ` Alexander Stein
2023-04-18 11:53         ` Adam Ford
2023-04-20 19:15           ` Adam Ford
2023-04-15 10:41 ` [PATCH 3/6] drm: bridge: samsung-dsim: Fetch pll-clock-frequency automatically Adam Ford
2023-04-16 22:08   ` Marek Vasut
2023-04-18  2:29     ` Adam Ford
2023-04-18  8:30       ` Marek Vasut
2023-04-18  8:47         ` Lucas Stach [this message]
2023-04-19 10:41           ` Adam Ford
2023-04-21 11:25   ` Marek Szyprowski
2023-04-21 11:44     ` Adam Ford
2023-04-15 10:41 ` [PATCH 4/6] drm: bridge: samsung-dsim: Dynamically configure DPHY timing Adam Ford
2023-04-16 22:12   ` Marek Vasut
2023-04-17  8:37   ` Lucas Stach
2023-04-17 11:53     ` Adam Ford
2023-04-18  2:43       ` Adam Ford
2023-04-15 10:41 ` [PATCH 5/6] drm: bridge: samsung-dsim: Support non-burst mode Adam Ford
2023-04-16 22:13   ` Marek Vasut
2023-04-17 11:57     ` Adam Ford
2023-04-17 20:07       ` Marek Vasut
2023-04-17 22:24         ` Adam Ford
2023-04-17 23:23           ` Marek Vasut
2023-04-20  2:24             ` Adam Ford
2023-04-15 10:41 ` [PATCH 6/6] arm64: dts: imx8mn: Fix video clock parents Adam Ford
2023-04-16 22:02 ` [PATCH 1/6] drm: bridge: samsung-dsim: Support multi-lane calculations Marek Vasut
2023-04-17  8:43 ` Lucas Stach
2023-04-17 11:55   ` Adam Ford
2023-04-19 10:47     ` Adam Ford
2023-04-20 13:06       ` Lucas Stach
2023-04-20 13:24         ` Adam Ford
2023-04-20 13:42           ` Lucas Stach
2023-04-20 21:51             ` Adam Ford
2023-04-21  8:40               ` Lucas Stach
2023-04-21 11:28                 ` Marek Szyprowski
2023-04-21 11:41                   ` Adam Ford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=426e901f14254cfcff87ba1747534f9b856ef738.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=aford173@gmail.com \
    --cc=aford@beaconembedded.com \
    --cc=andrzej.hajda@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jagan@amarulasolutions.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel@pengutronix.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=marex@denx.de \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).