* [PATCH v2 1/2] clk: Hi3660: change to register crgctrl clock with CLK_OF_DECLARE_DRIVER
@ 2017-05-18 1:50 ` Leo Yan
0 siblings, 0 replies; 15+ messages in thread
From: Leo Yan @ 2017-05-18 1:50 UTC (permalink / raw)
To: linux-arm-kernel
The timer will register into system at very early phase at kernel boot;
if timer needs to use clock, the clock should be get ready in function
of_clk_init() so later the timer driver probe can retrieve clock
successfully. This is finished in below flow on arm64:
start_kernel()
`-> time_init()
`-> of_clk_init(NULL) => register timer's clock
`-> clocksource_probe() => register timer
On Hi3660 the sp804 timer uses clock "osc32k", this clock is registered
as platform driver rather than CLK_OF_DECLARE_DRIVER method. As result,
sp804 timer probe returns failure due if cannot bind clock properly.
To fix the failure, this patch is to change crgctrl clock registration
from platform driver to CLK_OF_DECLARE_DRIVER method so the clocks can
be registered ahead with function of_clk_init() and then timer driver
can use it.
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
drivers/clk/hisilicon/clk-hi3660.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/hisilicon/clk-hi3660.c b/drivers/clk/hisilicon/clk-hi3660.c
index fd5ce7f..4e5713b 100644
--- a/drivers/clk/hisilicon/clk-hi3660.c
+++ b/drivers/clk/hisilicon/clk-hi3660.c
@@ -547,10 +547,10 @@ static void hi3660_clk_crgctrl_init(struct device_node *np)
ARRAY_SIZE(hi3660_crgctrl_divider_clks),
clk_data);
}
+CLK_OF_DECLARE_DRIVER(hi3660_clk_crgctrl, "hisilicon,hi3660-crgctrl",
+ hi3660_clk_crgctrl_init);
static const struct of_device_id hi3660_clk_match_table[] = {
- { .compatible = "hisilicon,hi3660-crgctrl",
- .data = hi3660_clk_crgctrl_init },
{ .compatible = "hisilicon,hi3660-pctrl",
.data = hi3660_clk_pctrl_init },
{ .compatible = "hisilicon,hi3660-pmuctrl",
--
1.9.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 1/2] clk: Hi3660: change to register crgctrl clock with CLK_OF_DECLARE_DRIVER
2017-05-18 1:50 ` Leo Yan
@ 2017-05-18 9:32 ` Daniel Lezcano
-1 siblings, 0 replies; 15+ messages in thread
From: Daniel Lezcano @ 2017-05-18 9:32 UTC (permalink / raw)
To: Leo Yan
Cc: Wei Xu, Rob Herring, Mark Rutland, Catalin Marinas, Will Deacon,
Michael Turquette, Stephen Boyd, Guodong Xu, Zhong Kaihua,
Chen Jun, Zhangfei Gao, linux-arm-kernel, devicetree,
linux-kernel, linux-clk
On Thu, May 18, 2017 at 09:50:46AM +0800, Leo Yan wrote:
> The timer will register into system at very early phase at kernel boot;
> if timer needs to use clock, the clock should be get ready in function
> of_clk_init() so later the timer driver probe can retrieve clock
> successfully. This is finished in below flow on arm64:
>
> start_kernel()
> `-> time_init()
> `-> of_clk_init(NULL) => register timer's clock
> `-> clocksource_probe() => register timer
>
> On Hi3660 the sp804 timer uses clock "osc32k", this clock is registered
> as platform driver rather than CLK_OF_DECLARE_DRIVER method. As result,
> sp804 timer probe returns failure due if cannot bind clock properly.
> To fix the failure, this patch is to change crgctrl clock registration
> from platform driver to CLK_OF_DECLARE_DRIVER method so the clocks can
> be registered ahead with function of_clk_init() and then timer driver
> can use it.
>
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> ---
> drivers/clk/hisilicon/clk-hi3660.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/hisilicon/clk-hi3660.c b/drivers/clk/hisilicon/clk-hi3660.c
> index fd5ce7f..4e5713b 100644
> --- a/drivers/clk/hisilicon/clk-hi3660.c
> +++ b/drivers/clk/hisilicon/clk-hi3660.c
> @@ -547,10 +547,10 @@ static void hi3660_clk_crgctrl_init(struct device_node *np)
> ARRAY_SIZE(hi3660_crgctrl_divider_clks),
> clk_data);
> }
> +CLK_OF_DECLARE_DRIVER(hi3660_clk_crgctrl, "hisilicon,hi3660-crgctrl",
> + hi3660_clk_crgctrl_init);
>
> static const struct of_device_id hi3660_clk_match_table[] = {
> - { .compatible = "hisilicon,hi3660-crgctrl",
> - .data = hi3660_clk_crgctrl_init },
> { .compatible = "hisilicon,hi3660-pctrl",
> .data = hi3660_clk_pctrl_init },
> { .compatible = "hisilicon,hi3660-pmuctrl",
Why not do the change for all the clocks and remove the
hi3660_clk_match_table[]? and all the related platform driver code?
That will be consistent with the other clk-hi* drivers.
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v2 1/2] clk: Hi3660: change to register crgctrl clock with CLK_OF_DECLARE_DRIVER
@ 2017-05-18 9:32 ` Daniel Lezcano
0 siblings, 0 replies; 15+ messages in thread
From: Daniel Lezcano @ 2017-05-18 9:32 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, May 18, 2017 at 09:50:46AM +0800, Leo Yan wrote:
> The timer will register into system at very early phase at kernel boot;
> if timer needs to use clock, the clock should be get ready in function
> of_clk_init() so later the timer driver probe can retrieve clock
> successfully. This is finished in below flow on arm64:
>
> start_kernel()
> `-> time_init()
> `-> of_clk_init(NULL) => register timer's clock
> `-> clocksource_probe() => register timer
>
> On Hi3660 the sp804 timer uses clock "osc32k", this clock is registered
> as platform driver rather than CLK_OF_DECLARE_DRIVER method. As result,
> sp804 timer probe returns failure due if cannot bind clock properly.
> To fix the failure, this patch is to change crgctrl clock registration
> from platform driver to CLK_OF_DECLARE_DRIVER method so the clocks can
> be registered ahead with function of_clk_init() and then timer driver
> can use it.
>
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> ---
> drivers/clk/hisilicon/clk-hi3660.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/hisilicon/clk-hi3660.c b/drivers/clk/hisilicon/clk-hi3660.c
> index fd5ce7f..4e5713b 100644
> --- a/drivers/clk/hisilicon/clk-hi3660.c
> +++ b/drivers/clk/hisilicon/clk-hi3660.c
> @@ -547,10 +547,10 @@ static void hi3660_clk_crgctrl_init(struct device_node *np)
> ARRAY_SIZE(hi3660_crgctrl_divider_clks),
> clk_data);
> }
> +CLK_OF_DECLARE_DRIVER(hi3660_clk_crgctrl, "hisilicon,hi3660-crgctrl",
> + hi3660_clk_crgctrl_init);
>
> static const struct of_device_id hi3660_clk_match_table[] = {
> - { .compatible = "hisilicon,hi3660-crgctrl",
> - .data = hi3660_clk_crgctrl_init },
> { .compatible = "hisilicon,hi3660-pctrl",
> .data = hi3660_clk_pctrl_init },
> { .compatible = "hisilicon,hi3660-pmuctrl",
Why not do the change for all the clocks and remove the
hi3660_clk_match_table[]? and all the related platform driver code?
That will be consistent with the other clk-hi* drivers.
--
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v2 1/2] clk: Hi3660: change to register crgctrl clock with CLK_OF_DECLARE_DRIVER
2017-05-18 9:32 ` Daniel Lezcano
@ 2017-05-18 9:48 ` Leo Yan
-1 siblings, 0 replies; 15+ messages in thread
From: Leo Yan @ 2017-05-18 9:48 UTC (permalink / raw)
To: Daniel Lezcano
Cc: Wei Xu, Rob Herring, Mark Rutland, Catalin Marinas, Will Deacon,
Michael Turquette, Stephen Boyd, Guodong Xu, Zhong Kaihua,
Chen Jun, Zhangfei Gao, linux-arm-kernel, devicetree,
linux-kernel, linux-clk
Hi Daniel,
On Thu, May 18, 2017 at 11:32:26AM +0200, Daniel Lezcano wrote:
> On Thu, May 18, 2017 at 09:50:46AM +0800, Leo Yan wrote:
> > The timer will register into system at very early phase at kernel boot;
> > if timer needs to use clock, the clock should be get ready in function
> > of_clk_init() so later the timer driver probe can retrieve clock
> > successfully. This is finished in below flow on arm64:
> >
> > start_kernel()
> > `-> time_init()
> > `-> of_clk_init(NULL) => register timer's clock
> > `-> clocksource_probe() => register timer
> >
> > On Hi3660 the sp804 timer uses clock "osc32k", this clock is registered
> > as platform driver rather than CLK_OF_DECLARE_DRIVER method. As result,
> > sp804 timer probe returns failure due if cannot bind clock properly.
> > To fix the failure, this patch is to change crgctrl clock registration
> > from platform driver to CLK_OF_DECLARE_DRIVER method so the clocks can
> > be registered ahead with function of_clk_init() and then timer driver
> > can use it.
> >
> > Signed-off-by: Leo Yan <leo.yan@linaro.org>
> > ---
> > drivers/clk/hisilicon/clk-hi3660.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/clk/hisilicon/clk-hi3660.c b/drivers/clk/hisilicon/clk-hi3660.c
> > index fd5ce7f..4e5713b 100644
> > --- a/drivers/clk/hisilicon/clk-hi3660.c
> > +++ b/drivers/clk/hisilicon/clk-hi3660.c
> > @@ -547,10 +547,10 @@ static void hi3660_clk_crgctrl_init(struct device_node *np)
> > ARRAY_SIZE(hi3660_crgctrl_divider_clks),
> > clk_data);
> > }
> > +CLK_OF_DECLARE_DRIVER(hi3660_clk_crgctrl, "hisilicon,hi3660-crgctrl",
> > + hi3660_clk_crgctrl_init);
> >
> > static const struct of_device_id hi3660_clk_match_table[] = {
> > - { .compatible = "hisilicon,hi3660-crgctrl",
> > - .data = hi3660_clk_crgctrl_init },
> > { .compatible = "hisilicon,hi3660-pctrl",
> > .data = hi3660_clk_pctrl_init },
> > { .compatible = "hisilicon,hi3660-pmuctrl",
>
> Why not do the change for all the clocks and remove the
> hi3660_clk_match_table[]? and all the related platform driver code?
>
> That will be consistent with the other clk-hi* drivers.
I checked a bit with Stephen on IRC, follow the suggestion to 'split
the clks are registsered between CLK_OF_DECLARE_DRIVER() and driver
probe so that the ones you need really early are done through the
CLK_OF path and the other ones are done through regular driver probe'.
Also checked for mainline kernel, now there have some examples,
like: drivers/clk/mediatek/clk-mt2701.c.
Thanks,
Leo Yan
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v2 1/2] clk: Hi3660: change to register crgctrl clock with CLK_OF_DECLARE_DRIVER
@ 2017-05-18 9:48 ` Leo Yan
0 siblings, 0 replies; 15+ messages in thread
From: Leo Yan @ 2017-05-18 9:48 UTC (permalink / raw)
To: linux-arm-kernel
Hi Daniel,
On Thu, May 18, 2017 at 11:32:26AM +0200, Daniel Lezcano wrote:
> On Thu, May 18, 2017 at 09:50:46AM +0800, Leo Yan wrote:
> > The timer will register into system at very early phase at kernel boot;
> > if timer needs to use clock, the clock should be get ready in function
> > of_clk_init() so later the timer driver probe can retrieve clock
> > successfully. This is finished in below flow on arm64:
> >
> > start_kernel()
> > `-> time_init()
> > `-> of_clk_init(NULL) => register timer's clock
> > `-> clocksource_probe() => register timer
> >
> > On Hi3660 the sp804 timer uses clock "osc32k", this clock is registered
> > as platform driver rather than CLK_OF_DECLARE_DRIVER method. As result,
> > sp804 timer probe returns failure due if cannot bind clock properly.
> > To fix the failure, this patch is to change crgctrl clock registration
> > from platform driver to CLK_OF_DECLARE_DRIVER method so the clocks can
> > be registered ahead with function of_clk_init() and then timer driver
> > can use it.
> >
> > Signed-off-by: Leo Yan <leo.yan@linaro.org>
> > ---
> > drivers/clk/hisilicon/clk-hi3660.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/clk/hisilicon/clk-hi3660.c b/drivers/clk/hisilicon/clk-hi3660.c
> > index fd5ce7f..4e5713b 100644
> > --- a/drivers/clk/hisilicon/clk-hi3660.c
> > +++ b/drivers/clk/hisilicon/clk-hi3660.c
> > @@ -547,10 +547,10 @@ static void hi3660_clk_crgctrl_init(struct device_node *np)
> > ARRAY_SIZE(hi3660_crgctrl_divider_clks),
> > clk_data);
> > }
> > +CLK_OF_DECLARE_DRIVER(hi3660_clk_crgctrl, "hisilicon,hi3660-crgctrl",
> > + hi3660_clk_crgctrl_init);
> >
> > static const struct of_device_id hi3660_clk_match_table[] = {
> > - { .compatible = "hisilicon,hi3660-crgctrl",
> > - .data = hi3660_clk_crgctrl_init },
> > { .compatible = "hisilicon,hi3660-pctrl",
> > .data = hi3660_clk_pctrl_init },
> > { .compatible = "hisilicon,hi3660-pmuctrl",
>
> Why not do the change for all the clocks and remove the
> hi3660_clk_match_table[]? and all the related platform driver code?
>
> That will be consistent with the other clk-hi* drivers.
I checked a bit with Stephen on IRC, follow the suggestion to 'split
the clks are registsered between CLK_OF_DECLARE_DRIVER() and driver
probe so that the ones you need really early are done through the
CLK_OF path and the other ones are done through regular driver probe'.
Also checked for mainline kernel, now there have some examples,
like: drivers/clk/mediatek/clk-mt2701.c.
Thanks,
Leo Yan
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 1/2] clk: Hi3660: change to register crgctrl clock with CLK_OF_DECLARE_DRIVER
2017-05-18 1:50 ` Leo Yan
(?)
@ 2017-05-19 1:51 ` Stephen Boyd
-1 siblings, 0 replies; 15+ messages in thread
From: Stephen Boyd @ 2017-05-19 1:51 UTC (permalink / raw)
To: Leo Yan
Cc: Wei Xu, Rob Herring, Mark Rutland, Catalin Marinas, Will Deacon,
Michael Turquette, Guodong Xu, Zhong Kaihua, Chen Jun,
Zhangfei Gao, linux-arm-kernel, devicetree, linux-kernel,
linux-clk, Daniel Lezcano
On 05/18, Leo Yan wrote:
> diff --git a/drivers/clk/hisilicon/clk-hi3660.c b/drivers/clk/hisilicon/clk-hi3660.c
> index fd5ce7f..4e5713b 100644
> --- a/drivers/clk/hisilicon/clk-hi3660.c
> +++ b/drivers/clk/hisilicon/clk-hi3660.c
> @@ -547,10 +547,10 @@ static void hi3660_clk_crgctrl_init(struct device_node *np)
> ARRAY_SIZE(hi3660_crgctrl_divider_clks),
> clk_data);
> }
> +CLK_OF_DECLARE_DRIVER(hi3660_clk_crgctrl, "hisilicon,hi3660-crgctrl",
> + hi3660_clk_crgctrl_init);
>
> static const struct of_device_id hi3660_clk_match_table[] = {
> - { .compatible = "hisilicon,hi3660-crgctrl",
> - .data = hi3660_clk_crgctrl_init },
I'm slightly confused. CLK_OF_DECLARE_DRIVER is for when a
platform driver _and_ CLK_OF_DELARE need to "probe" the same
device node. But in this patch, the compatible string is being
deleted from the driver's match table. Also, are all the
registered in hi3660_clk_crgctrl_init() actually needed for the
timer? If only a subset, then I would expect to split the code
and have the CLK_OF_DECLARE_DRIVER() path register just the clks
that matter for the timer, and then leave the rest of the clks to
be registered by the probe of the platform driver.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v2 1/2] clk: Hi3660: change to register crgctrl clock with CLK_OF_DECLARE_DRIVER
@ 2017-05-19 1:51 ` Stephen Boyd
0 siblings, 0 replies; 15+ messages in thread
From: Stephen Boyd @ 2017-05-19 1:51 UTC (permalink / raw)
To: Leo Yan
Cc: Wei Xu, Rob Herring, Mark Rutland, Catalin Marinas, Will Deacon,
Michael Turquette, Guodong Xu, Zhong Kaihua, Chen Jun,
Zhangfei Gao, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-clk-u79uwXL29TY76Z2rM5mHXA, Daniel Lezcano
On 05/18, Leo Yan wrote:
> diff --git a/drivers/clk/hisilicon/clk-hi3660.c b/drivers/clk/hisilicon/clk-hi3660.c
> index fd5ce7f..4e5713b 100644
> --- a/drivers/clk/hisilicon/clk-hi3660.c
> +++ b/drivers/clk/hisilicon/clk-hi3660.c
> @@ -547,10 +547,10 @@ static void hi3660_clk_crgctrl_init(struct device_node *np)
> ARRAY_SIZE(hi3660_crgctrl_divider_clks),
> clk_data);
> }
> +CLK_OF_DECLARE_DRIVER(hi3660_clk_crgctrl, "hisilicon,hi3660-crgctrl",
> + hi3660_clk_crgctrl_init);
>
> static const struct of_device_id hi3660_clk_match_table[] = {
> - { .compatible = "hisilicon,hi3660-crgctrl",
> - .data = hi3660_clk_crgctrl_init },
I'm slightly confused. CLK_OF_DECLARE_DRIVER is for when a
platform driver _and_ CLK_OF_DELARE need to "probe" the same
device node. But in this patch, the compatible string is being
deleted from the driver's match table. Also, are all the
registered in hi3660_clk_crgctrl_init() actually needed for the
timer? If only a subset, then I would expect to split the code
and have the CLK_OF_DECLARE_DRIVER() path register just the clks
that matter for the timer, and then leave the rest of the clks to
be registered by the probe of the platform driver.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v2 1/2] clk: Hi3660: change to register crgctrl clock with CLK_OF_DECLARE_DRIVER
@ 2017-05-19 1:51 ` Stephen Boyd
0 siblings, 0 replies; 15+ messages in thread
From: Stephen Boyd @ 2017-05-19 1:51 UTC (permalink / raw)
To: linux-arm-kernel
On 05/18, Leo Yan wrote:
> diff --git a/drivers/clk/hisilicon/clk-hi3660.c b/drivers/clk/hisilicon/clk-hi3660.c
> index fd5ce7f..4e5713b 100644
> --- a/drivers/clk/hisilicon/clk-hi3660.c
> +++ b/drivers/clk/hisilicon/clk-hi3660.c
> @@ -547,10 +547,10 @@ static void hi3660_clk_crgctrl_init(struct device_node *np)
> ARRAY_SIZE(hi3660_crgctrl_divider_clks),
> clk_data);
> }
> +CLK_OF_DECLARE_DRIVER(hi3660_clk_crgctrl, "hisilicon,hi3660-crgctrl",
> + hi3660_clk_crgctrl_init);
>
> static const struct of_device_id hi3660_clk_match_table[] = {
> - { .compatible = "hisilicon,hi3660-crgctrl",
> - .data = hi3660_clk_crgctrl_init },
I'm slightly confused. CLK_OF_DECLARE_DRIVER is for when a
platform driver _and_ CLK_OF_DELARE need to "probe" the same
device node. But in this patch, the compatible string is being
deleted from the driver's match table. Also, are all the
registered in hi3660_clk_crgctrl_init() actually needed for the
timer? If only a subset, then I would expect to split the code
and have the CLK_OF_DECLARE_DRIVER() path register just the clks
that matter for the timer, and then leave the rest of the clks to
be registered by the probe of the platform driver.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v2 1/2] clk: Hi3660: change to register crgctrl clock with CLK_OF_DECLARE_DRIVER
2017-05-19 1:51 ` Stephen Boyd
@ 2017-05-19 2:01 ` Leo Yan
-1 siblings, 0 replies; 15+ messages in thread
From: Leo Yan @ 2017-05-19 2:01 UTC (permalink / raw)
To: Stephen Boyd
Cc: Wei Xu, Rob Herring, Mark Rutland, Catalin Marinas, Will Deacon,
Michael Turquette, Guodong Xu, Zhong Kaihua, Chen Jun,
Zhangfei Gao, linux-arm-kernel, devicetree, linux-kernel,
linux-clk, Daniel Lezcano
On Thu, May 18, 2017 at 06:51:37PM -0700, Stephen Boyd wrote:
> On 05/18, Leo Yan wrote:
> > diff --git a/drivers/clk/hisilicon/clk-hi3660.c b/drivers/clk/hisilicon/clk-hi3660.c
> > index fd5ce7f..4e5713b 100644
> > --- a/drivers/clk/hisilicon/clk-hi3660.c
> > +++ b/drivers/clk/hisilicon/clk-hi3660.c
> > @@ -547,10 +547,10 @@ static void hi3660_clk_crgctrl_init(struct device_node *np)
> > ARRAY_SIZE(hi3660_crgctrl_divider_clks),
> > clk_data);
> > }
> > +CLK_OF_DECLARE_DRIVER(hi3660_clk_crgctrl, "hisilicon,hi3660-crgctrl",
> > + hi3660_clk_crgctrl_init);
> >
> > static const struct of_device_id hi3660_clk_match_table[] = {
> > - { .compatible = "hisilicon,hi3660-crgctrl",
> > - .data = hi3660_clk_crgctrl_init },
>
> I'm slightly confused. CLK_OF_DECLARE_DRIVER is for when a
> platform driver _and_ CLK_OF_DELARE need to "probe" the same
> device node. But in this patch, the compatible string is being
> deleted from the driver's match table. Also, are all the
> registered in hi3660_clk_crgctrl_init() actually needed for the
> timer?
No.
> If only a subset, then I would expect to split the code
> and have the CLK_OF_DECLARE_DRIVER() path register just the clks
> that matter for the timer, and then leave the rest of the clks to
> be registered by the probe of the platform driver.
I'm also puzzled if need divide crgctrl clock into two parts. Thanks
for suggestion, will do this.
Thanks,
Leo Yan
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v2 1/2] clk: Hi3660: change to register crgctrl clock with CLK_OF_DECLARE_DRIVER
@ 2017-05-19 2:01 ` Leo Yan
0 siblings, 0 replies; 15+ messages in thread
From: Leo Yan @ 2017-05-19 2:01 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, May 18, 2017 at 06:51:37PM -0700, Stephen Boyd wrote:
> On 05/18, Leo Yan wrote:
> > diff --git a/drivers/clk/hisilicon/clk-hi3660.c b/drivers/clk/hisilicon/clk-hi3660.c
> > index fd5ce7f..4e5713b 100644
> > --- a/drivers/clk/hisilicon/clk-hi3660.c
> > +++ b/drivers/clk/hisilicon/clk-hi3660.c
> > @@ -547,10 +547,10 @@ static void hi3660_clk_crgctrl_init(struct device_node *np)
> > ARRAY_SIZE(hi3660_crgctrl_divider_clks),
> > clk_data);
> > }
> > +CLK_OF_DECLARE_DRIVER(hi3660_clk_crgctrl, "hisilicon,hi3660-crgctrl",
> > + hi3660_clk_crgctrl_init);
> >
> > static const struct of_device_id hi3660_clk_match_table[] = {
> > - { .compatible = "hisilicon,hi3660-crgctrl",
> > - .data = hi3660_clk_crgctrl_init },
>
> I'm slightly confused. CLK_OF_DECLARE_DRIVER is for when a
> platform driver _and_ CLK_OF_DELARE need to "probe" the same
> device node. But in this patch, the compatible string is being
> deleted from the driver's match table. Also, are all the
> registered in hi3660_clk_crgctrl_init() actually needed for the
> timer?
No.
> If only a subset, then I would expect to split the code
> and have the CLK_OF_DECLARE_DRIVER() path register just the clks
> that matter for the timer, and then leave the rest of the clks to
> be registered by the probe of the platform driver.
I'm also puzzled if need divide crgctrl clock into two parts. Thanks
for suggestion, will do this.
Thanks,
Leo Yan
^ permalink raw reply [flat|nested] 15+ messages in thread