mbox series

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

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

Message

Vinod Koul Aug. 22, 2019, 5:01 p.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 v3:
 - Add reviewed-by from Bjorn
 - Update the parent name as xo_board
 - Fix style issue

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(-)

Comments

Bjorn Andersson Aug. 24, 2019, 6:31 a.m. UTC | #1
On Thu 22 Aug 10:01 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..0bced7326a20 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_board",		\
> +					.name = "xo_board",		\

Iiuc .name here refers to the global clock namespace and .fw_name refers
to the device_node local name space. As such I really prefer this to be:

  .fw_name = "xo",
  .name = "xo_board",

This ensures the backwards compatibility (when using global lookup),
without complicating the node-local naming.

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_board",		\
> +					.name = "xo_board",		\
> +			},						\
>  			.num_parents = 1,				\
>  		},							\
>  	}
> -- 
> 2.20.1
>
Vinod Koul Aug. 26, 2019, 6:21 a.m. UTC | #2
On 23-08-19, 23:31, Bjorn Andersson wrote:
> On Thu 22 Aug 10:01 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..0bced7326a20 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_board",		\
> > +					.name = "xo_board",		\
> 
> Iiuc .name here refers to the global clock namespace and .fw_name refers
> to the device_node local name space. As such I really prefer this to be:
> 
>   .fw_name = "xo",
>   .name = "xo_board",
> 
> This ensures the backwards compatibility (when using global lookup),
> without complicating the node-local naming.

Sure, while thinking more on this, should we finalize the name as xo or
cxo, I see latter being also used at few places. It would be great to
get a name and stick to it for longer time :)
Stephen Boyd Sept. 9, 2019, 11:26 a.m. UTC | #3
Quoting Vinod Koul (2019-08-25 23:21:27)
> On 23-08-19, 23:31, Bjorn Andersson wrote:
> > On Thu 22 Aug 10:01 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..0bced7326a20 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_board",          \
> > > +                                   .name = "xo_board",             \
> > 
> > Iiuc .name here refers to the global clock namespace and .fw_name refers
> > to the device_node local name space. As such I really prefer this to be:
> > 
> >   .fw_name = "xo",
> >   .name = "xo_board",
> > 
> > This ensures the backwards compatibility (when using global lookup),
> > without complicating the node-local naming.
> 
> Sure, while thinking more on this, should we finalize the name as xo or
> cxo, I see latter being also used at few places. It would be great to
> get a name and stick to it for longer time :)
> -- 

I would name it 'cxo' because that's the pin name on this platform.