mbox series

[v2,0/4] clk: qcom: Add support for SM8150

Message ID 20190819073947.17258-1-vkoul@kernel.org
Headers show
Series clk: qcom: Add support for SM8150 | expand

Message

Vinod Koul Aug. 19, 2019, 7:39 a.m. UTC
Add support for rpm clock controller found in SM8150 and while at it update
the driver to support parent data clock scheme as suggested by Stephen.

Changes since v2:
 - Describe parent clocks for rpmhcc
 - Add support for parent data scheme for rpmhcc

Vinod Koul (4):
  dt-bindings: clock: Document the parent clocks
  clk: qcom: clk-rpmh: Convert to parent data scheme
  dt-bindings: clock: Document SM8150 rpmh-clock compatible
  clk: qcom: clk-rpmh: Add support for SM8150

 .../bindings/clock/qcom,rpmh-clk.txt          |  7 +++-
 drivers/clk/qcom/clk-rpmh.c                   | 37 ++++++++++++++++++-
 2 files changed, 41 insertions(+), 3 deletions(-)

-- 
2.20.1

Comments

Bjorn Andersson Aug. 20, 2019, 5:08 a.m. UTC | #1
On Mon 19 Aug 00:39 PDT 2019, Vinod Koul wrote:

> Convert the rpmh clock driver to use the new parent data scheme by

> specifying the parent data for board clock.

> 

> Signed-off-by: Vinod Koul <vkoul@kernel.org>

> ---

>  drivers/clk/qcom/clk-rpmh.c | 10 ++++++++--

>  1 file changed, 8 insertions(+), 2 deletions(-)

> 

> diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c

> index c3fd632af119..16d689e5bb3c 100644

> --- a/drivers/clk/qcom/clk-rpmh.c

> +++ b/drivers/clk/qcom/clk-rpmh.c

> @@ -95,7 +95,10 @@ static DEFINE_MUTEX(rpmh_clk_lock);

>  		.hw.init = &(struct clk_init_data){			\

>  			.ops = &clk_rpmh_ops,				\

>  			.name = #_name,					\

> -			.parent_names = (const char *[]){ "xo_board" },	\

> +			.parent_data =  &(const struct clk_parent_data){ \

> +					.fw_name = "xo",		\

> +					.name = "xo",		\


Shouldn't .name be "xo_board" to retain backwards compatibility?

Regards,
Bjorn

> +			},						\

>  			.num_parents = 1,				\

>  		},							\

>  	};								\

> @@ -110,7 +113,10 @@ static DEFINE_MUTEX(rpmh_clk_lock);

>  		.hw.init = &(struct clk_init_data){			\

>  			.ops = &clk_rpmh_ops,				\

>  			.name = #_name_active,				\

> -			.parent_names = (const char *[]){ "xo_board" },	\

> +			.parent_data =  &(const struct clk_parent_data){ \

> +					.fw_name = "xo",		\

> +					.name = "xo",		\

> +			},						\

>  			.num_parents = 1,				\

>  		},							\

>  	}

> -- 

> 2.20.1

>
Bjorn Andersson Aug. 20, 2019, 5:08 a.m. UTC | #2
On Mon 19 Aug 00:39 PDT 2019, Vinod Koul wrote:

> Document the SM8150 rpmh-clock compatible for rpmh clock controller

> found on SM8150 platforms.

> 

> Signed-off-by: Vinod Koul <vkoul@kernel.org>


Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>


> ---

>  Documentation/devicetree/bindings/clock/qcom,rpmh-clk.txt | 4 +++-

>  1 file changed, 3 insertions(+), 1 deletion(-)

> 

> diff --git a/Documentation/devicetree/bindings/clock/qcom,rpmh-clk.txt b/Documentation/devicetree/bindings/clock/qcom,rpmh-clk.txt

> index 8b97968f9c88..365bbde599b1 100644

> --- a/Documentation/devicetree/bindings/clock/qcom,rpmh-clk.txt

> +++ b/Documentation/devicetree/bindings/clock/qcom,rpmh-clk.txt

> @@ -6,7 +6,9 @@ some Qualcomm Technologies Inc. SoCs. It accepts clock requests from

>  other hardware subsystems via RSC to control clocks.

>  

>  Required properties :

> -- compatible : shall contain "qcom,sdm845-rpmh-clk"

> +- compatible : must be one of:

> +	       "qcom,sdm845-rpmh-clk"

> +	       "qcom,sm8150-rpmh-clk"

>  

>  - #clock-cells : must contain 1

>  - clocks: a list of phandles and clock-specifier pairs,

> -- 

> 2.20.1

>
Vinod Koul Aug. 22, 2019, 1:59 p.m. UTC | #3
On 19-08-19, 22:08, Bjorn Andersson wrote:
> On Mon 19 Aug 00:39 PDT 2019, Vinod Koul wrote:

> 

> > Convert the rpmh clock driver to use the new parent data scheme by

> > specifying the parent data for board clock.

> > 

> > Signed-off-by: Vinod Koul <vkoul@kernel.org>

> > ---

> >  drivers/clk/qcom/clk-rpmh.c | 10 ++++++++--

> >  1 file changed, 8 insertions(+), 2 deletions(-)

> > 

> > diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c

> > index c3fd632af119..16d689e5bb3c 100644

> > --- a/drivers/clk/qcom/clk-rpmh.c

> > +++ b/drivers/clk/qcom/clk-rpmh.c

> > @@ -95,7 +95,10 @@ static DEFINE_MUTEX(rpmh_clk_lock);

> >  		.hw.init = &(struct clk_init_data){			\

> >  			.ops = &clk_rpmh_ops,				\

> >  			.name = #_name,					\

> > -			.parent_names = (const char *[]){ "xo_board" },	\

> > +			.parent_data =  &(const struct clk_parent_data){ \

> > +					.fw_name = "xo",		\

> > +					.name = "xo",		\

> 

> Shouldn't .name be "xo_board" to retain backwards compatibility?


Yes I have updated that

Thanks
-- 
~Vinod
Vinod Koul Aug. 22, 2019, 2:01 p.m. UTC | #4
On 19-08-19, 22:09, Bjorn Andersson wrote:
> On Mon 19 Aug 00:39 PDT 2019, Vinod Koul wrote:

> > +static const struct clk_rpmh_desc clk_rpmh_sm8150 = {

> > +	.clks = sm8150_rpmh_clocks,

> > +	.num_clks = ARRAY_SIZE(sm8150_rpmh_clocks),

> > +};

> 

> Maybe an empty line here?


Sounds better

> 

> >  static struct clk_hw *of_clk_rpmh_hw_get(struct of_phandle_args *clkspec,

> >  					 void *data)

> >  {

> > @@ -453,6 +479,7 @@ static int clk_rpmh_probe(struct platform_device *pdev)

> >  

> >  static const struct of_device_id clk_rpmh_match_table[] = {

> >  	{ .compatible = "qcom,sdm845-rpmh-clk", .data = &clk_rpmh_sdm845},

> > +	{ .compatible = "qcom,sm8150-rpmh-clk", .data = &clk_rpmh_sm8150},

> >  	{ }

> >  };

> >  MODULE_DEVICE_TABLE(of, clk_rpmh_match_table);

> 

> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>


Thanks for the review, will send an update.

-- 
~Vinod