All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Konrad Dybcio <konrad.dybcio@somainline.org>,
	Stephen Boyd <sboyd@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Taniya Das <quic_tdas@quicinc.com>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-phy@lists.infradead.org, Johan Hovold <johan@kernel.org>
Subject: Re: [PATCH v3 1/3] clk: asm9260: use new helper for fixed rate clock creation
Date: Tue, 30 Aug 2022 10:55:25 +0530	[thread overview]
Message-ID: <Yw2fRVsnkHYhcmSy@matsya> (raw)
In-Reply-To: <20220708135450.2845810-2-dmitry.baryshkov@linaro.org>

On 08-07-22, 16:54, Dmitry Baryshkov wrote:
> The __clk_hw_register_fixed_rate() is an internal API, which is better
> not to be called directly. Add new helper to create fixed rate clocks
> using parent clock accuracy.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>  drivers/clk/clk-asm9260.c    |  6 ++----
>  include/linux/clk-provider.h | 14 ++++++++++++++
>  2 files changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/clk/clk-asm9260.c b/drivers/clk/clk-asm9260.c
> index bacebd457e6f..0609b661ff5a 100644
> --- a/drivers/clk/clk-asm9260.c
> +++ b/drivers/clk/clk-asm9260.c
> @@ -276,10 +276,8 @@ static void __init asm9260_acc_init(struct device_node *np)
>  
>  	/* TODO: Convert to DT parent scheme */
>  	ref_clk = of_clk_get_parent_name(np, 0);
> -	hw = __clk_hw_register_fixed_rate(NULL, NULL, pll_clk,
> -			ref_clk, NULL, NULL, 0, rate, 0,
> -			CLK_FIXED_RATE_PARENT_ACCURACY);
> -
> +	hw = clk_hw_register_fixed_rate_parent_accuracy(NULL, pll_clk, ref_clk,
> +							0, rate);

Should this not be described in DT instead, resolve the todo :-)

>  	if (IS_ERR(hw))
>  		panic("%pOFn: can't register REFCLK. Check DT!", np);
>  
> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
> index 72d937c03a3e..659ef5a77246 100644
> --- a/include/linux/clk-provider.h
> +++ b/include/linux/clk-provider.h
> @@ -439,6 +439,20 @@ struct clk *clk_register_fixed_rate(struct device *dev, const char *name,
>  	__clk_hw_register_fixed_rate((dev), NULL, (name), NULL, NULL,	      \
>  				     (parent_data), NULL, (flags),	      \
>  				     (fixed_rate), (fixed_accuracy), 0)
> +/**
> + * clk_hw_register_fixed_rate_parent_accuracy - register fixed-rate clock with
> + * the clock framework
> + * @dev: device that is registering this clock
> + * @name: name of this clock
> + * @parent_name: name of clock's parent
> + * @flags: framework-specific flags
> + * @fixed_rate: non-adjustable clock rate
> + */
> +#define clk_hw_register_fixed_rate_parent_accuracy(dev, name, parent_name,    \
> +						   flags, fixed_rate)	      \
> +	__clk_hw_register_fixed_rate((dev), NULL, (name), (parent_name),      \
> +				     NULL, NULL, (flags), (fixed_rate), 0,    \
> +				     CLK_FIXED_RATE_PARENT_ACCURACY)
>  
>  void clk_unregister_fixed_rate(struct clk *clk);
>  void clk_hw_unregister_fixed_rate(struct clk_hw *hw);
> -- 
> 2.35.1

-- 
~Vinod

WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vkoul@kernel.org>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Konrad Dybcio <konrad.dybcio@somainline.org>,
	Stephen Boyd <sboyd@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Taniya Das <quic_tdas@quicinc.com>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-phy@lists.infradead.org, Johan Hovold <johan@kernel.org>
Subject: Re: [PATCH v3 1/3] clk: asm9260: use new helper for fixed rate clock creation
Date: Tue, 30 Aug 2022 10:55:25 +0530	[thread overview]
Message-ID: <Yw2fRVsnkHYhcmSy@matsya> (raw)
In-Reply-To: <20220708135450.2845810-2-dmitry.baryshkov@linaro.org>

On 08-07-22, 16:54, Dmitry Baryshkov wrote:
> The __clk_hw_register_fixed_rate() is an internal API, which is better
> not to be called directly. Add new helper to create fixed rate clocks
> using parent clock accuracy.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>  drivers/clk/clk-asm9260.c    |  6 ++----
>  include/linux/clk-provider.h | 14 ++++++++++++++
>  2 files changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/clk/clk-asm9260.c b/drivers/clk/clk-asm9260.c
> index bacebd457e6f..0609b661ff5a 100644
> --- a/drivers/clk/clk-asm9260.c
> +++ b/drivers/clk/clk-asm9260.c
> @@ -276,10 +276,8 @@ static void __init asm9260_acc_init(struct device_node *np)
>  
>  	/* TODO: Convert to DT parent scheme */
>  	ref_clk = of_clk_get_parent_name(np, 0);
> -	hw = __clk_hw_register_fixed_rate(NULL, NULL, pll_clk,
> -			ref_clk, NULL, NULL, 0, rate, 0,
> -			CLK_FIXED_RATE_PARENT_ACCURACY);
> -
> +	hw = clk_hw_register_fixed_rate_parent_accuracy(NULL, pll_clk, ref_clk,
> +							0, rate);

Should this not be described in DT instead, resolve the todo :-)

>  	if (IS_ERR(hw))
>  		panic("%pOFn: can't register REFCLK. Check DT!", np);
>  
> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
> index 72d937c03a3e..659ef5a77246 100644
> --- a/include/linux/clk-provider.h
> +++ b/include/linux/clk-provider.h
> @@ -439,6 +439,20 @@ struct clk *clk_register_fixed_rate(struct device *dev, const char *name,
>  	__clk_hw_register_fixed_rate((dev), NULL, (name), NULL, NULL,	      \
>  				     (parent_data), NULL, (flags),	      \
>  				     (fixed_rate), (fixed_accuracy), 0)
> +/**
> + * clk_hw_register_fixed_rate_parent_accuracy - register fixed-rate clock with
> + * the clock framework
> + * @dev: device that is registering this clock
> + * @name: name of this clock
> + * @parent_name: name of clock's parent
> + * @flags: framework-specific flags
> + * @fixed_rate: non-adjustable clock rate
> + */
> +#define clk_hw_register_fixed_rate_parent_accuracy(dev, name, parent_name,    \
> +						   flags, fixed_rate)	      \
> +	__clk_hw_register_fixed_rate((dev), NULL, (name), (parent_name),      \
> +				     NULL, NULL, (flags), (fixed_rate), 0,    \
> +				     CLK_FIXED_RATE_PARENT_ACCURACY)
>  
>  void clk_unregister_fixed_rate(struct clk *clk);
>  void clk_hw_unregister_fixed_rate(struct clk_hw *hw);
> -- 
> 2.35.1

-- 
~Vinod

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  reply	other threads:[~2022-08-30  5:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-08 13:54 [PATCH v3 0/3] phy: qcom-qmp-ufs: add symbol clocks support Dmitry Baryshkov
2022-07-08 13:54 ` Dmitry Baryshkov
2022-07-08 13:54 ` [PATCH v3 1/3] clk: asm9260: use new helper for fixed rate clock creation Dmitry Baryshkov
2022-07-08 13:54   ` Dmitry Baryshkov
2022-08-30  5:25   ` Vinod Koul [this message]
2022-08-30  5:25     ` Vinod Koul
2022-09-16  6:13     ` Dmitry Baryshkov
2022-09-16  6:13       ` Dmitry Baryshkov
2022-07-08 13:54 ` [PATCH v3 2/3] clk: fixed-rate: add devm_clk_hw_register_fixed_rate Dmitry Baryshkov
2022-07-08 13:54   ` Dmitry Baryshkov
2022-07-08 13:54 ` [PATCH v3 3/3] phy: qcom-qmp-ufs: provide symbol clocks Dmitry Baryshkov
2022-07-08 13:54   ` Dmitry Baryshkov

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=Yw2fRVsnkHYhcmSy@matsya \
    --to=vkoul@kernel.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=johan@kernel.org \
    --cc=kishon@ti.com \
    --cc=konrad.dybcio@somainline.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=mturquette@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    --cc=quic_tdas@quicinc.com \
    --cc=sboyd@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.