devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthias Kaehlcke <mka@chromium.org>
To: Stephen Boyd <swboyd@chromium.org>
Cc: Andy Gross <andy.gross@linaro.org>,
	David Airlie <airlied@linux.ie>,
	David Brown <david.brown@linaro.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Rob Clark <robdclark@gmail.com>, Rob Herring <robh+dt@kernel.org>,
	Archit Taneja <architt@codeaurora.org>,
	Sean Paul <seanpaul@chromium.org>,
	Rajesh Yadav <ryadav@codeaurora.org>,
	Douglas Anderson <dianders@chromium.org>,
	Jeykumar Sankaran <jsanka@codeaurora.org>,
	linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/8] drm/msm/dsi: 28nm 8960 PHY: Get ref clock from the DT
Date: Tue, 4 Dec 2018 09:35:49 -0800	[thread overview]
Message-ID: <20181204173549.GB14307@google.com> (raw)
In-Reply-To: <154394184065.88331.4558186365546696323@swboyd.mtv.corp.google.com>

On Tue, Dec 04, 2018 at 08:44:00AM -0800, Stephen Boyd wrote:
> Quoting Matthias Kaehlcke (2018-11-30 16:52:48)
> > Get the ref clock of the PHY from the device tree instead of
> > hardcoding its name and rate. Use default values if the ref
> > clock is not specified.
> > 
> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> > ---
> > Changes in v3:
> > - use default name and rate if the ref clock is not specified
> >   in the DT
> > - store vco_ref_clk_name instead of vco_ref_clk
> > - fixed check for EPROBE_DEFER
> > - renamed VCO_REF_CLK_RATE to VCO_REF_CLK_DEFAULT_RATE
> > 
> > Changes in v2:
> > - patch added to the series
> > ---
> >  .../gpu/drm/msm/dsi/pll/dsi_pll_28nm_8960.c   | 28 +++++++++++++++----
> >  1 file changed, 23 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/msm/dsi/pll/dsi_pll_28nm_8960.c b/drivers/gpu/drm/msm/dsi/pll/dsi_pll_28nm_8960.c
> > index 49008451085b8..3af678d3317f6 100644
> > --- a/drivers/gpu/drm/msm/dsi/pll/dsi_pll_28nm_8960.c
> > +++ b/drivers/gpu/drm/msm/dsi/pll/dsi_pll_28nm_8960.c
> > @@ -47,9 +47,9 @@
> >  
> >  #define NUM_PROVIDED_CLKS      2
> >  
> > -#define VCO_REF_CLK_RATE       27000000
> > -#define VCO_MIN_RATE           600000000
> > -#define VCO_MAX_RATE           1200000000
> > +#define VCO_REF_CLK_DEFAULT_RATE       27000000
> > +#define VCO_MIN_RATE                   600000000
> > +#define VCO_MAX_RATE                   1200000000
> >  
> >  #define DSI_BYTE_PLL_CLK       0
> >  #define DSI_PIXEL_PLL_CLK      1
> > @@ -75,6 +75,8 @@ struct dsi_pll_28nm {
> >         struct platform_device *pdev;
> >         void __iomem *mmio;
> >  
> > +       const char *vco_ref_clk_name;
> 
> Can this be passed around during clk registration so we don't have to
> store it away in the structure?

makes sense, will do

> > +
> >         /* custom byte clock divider */
> >         struct clk_bytediv *bytediv;
> >  
> > @@ -125,7 +127,10 @@ static int dsi_pll_28nm_clk_set_rate(struct clk_hw *hw, unsigned long rate,
> >         DBG("rate=%lu, parent's=%lu", rate, parent_rate);
> >  
> >         temp = rate / 10;
> > -       val = VCO_REF_CLK_RATE / 10;
> > +       if (parent_rate)
> > +               val = parent_rate / 10;
> > +       else
> > +               val = VCO_REF_CLK_DEFAULT_RATE / 10;
> 
> Is the clk not properly hooked up to a parent sometimes so parent_rate
> is 0? That sounds odd given the fact that it used to be 'pxo' and that
> has always existed on the system as 27 MHz. So I'd remove this and just
> use parent_rate all the time.

I wondered about this, but since I don't have hardware for testing I
kept the previous hardcoded rate. If we know for sure that 'pxo'
always exists it should indeed be fine to use the parent rate.

  reply	other threads:[~2018-12-04 17:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-01  0:52 [PATCH v3 0/8] drm/msm/dsi: Get PHY ref clocks from the DT Matthias Kaehlcke
     [not found] ` <20181201005254.139908-1-mka-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-12-01  0:52   ` [PATCH v3 1/8] dt-bindings: msm/dsi: Add ref clock for PHYs Matthias Kaehlcke
2018-12-04 16:37     ` Stephen Boyd
     [not found]     ` <20181201005254.139908-2-mka-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-12-04 17:15       ` Doug Anderson
2018-12-01  0:52   ` [PATCH v3 2/8] drm/msm/dsi: 28nm 8960 PHY: Get ref clock from the DT Matthias Kaehlcke
2018-12-04 16:44     ` Stephen Boyd
2018-12-04 17:35       ` Matthias Kaehlcke [this message]
2018-12-04 18:26         ` Stephen Boyd
2018-12-01  0:52   ` [PATCH v3 3/8] drm/msm/dsi: 28nm " Matthias Kaehlcke
2018-12-04 16:45     ` Stephen Boyd
2018-12-01  0:52   ` [PATCH v3 4/8] drm/msm/dsi: 14nm " Matthias Kaehlcke
2018-12-01  0:52   ` [PATCH v3 5/8] drm/msm/dsi: 10nm " Matthias Kaehlcke
2018-12-01  0:52   ` [PATCH v3 7/8] arm64: dts: sdm845: Set 'bi_tcxo' as ref clock of the DSI PHYs Matthias Kaehlcke
2018-12-04 16:47     ` Stephen Boyd
2018-12-01  0:52 ` [PATCH v3 6/8] arm64: dts: qcom: msm8916: Set 'xo_board' as ref clock of the DSI PHY Matthias Kaehlcke
2018-12-04 16:46   ` Stephen Boyd
2018-12-01  0:52 ` [PATCH v3 8/8] ARM: dts: qcom-apq8064: " Matthias Kaehlcke
     [not found]   ` <20181201005254.139908-9-mka-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2018-12-04 16:48     ` Stephen Boyd
2018-12-04 17:16       ` Matthias Kaehlcke

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=20181204173549.GB14307@google.com \
    --to=mka@chromium.org \
    --cc=airlied@linux.ie \
    --cc=andy.gross@linaro.org \
    --cc=architt@codeaurora.org \
    --cc=david.brown@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jsanka@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robdclark@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=ryadav@codeaurora.org \
    --cc=seanpaul@chromium.org \
    --cc=swboyd@chromium.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).