linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: shmobile: clk-mstp: change to using clock-indices
@ 2014-04-15 16:06 Ben Dooks
  2014-04-15 16:11 ` Geert Uytterhoeven
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ben Dooks @ 2014-04-15 16:06 UTC (permalink / raw)
  To: linux-arm-kernel

With the addition of clock-indices, we need to change the renesas
clock implementation to use these instead of the local definition
of "renesas,clock-indices".

Since this will break booting with older device trees, we add a
simple auto-detection of which properties are present.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 .../devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt        | 2 +-
 drivers/clk/shmobile/clk-mstp.c                                  | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
index 5992dce..02a25d9 100644
--- a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
+++ b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
@@ -43,7 +43,7 @@ Example
 		clock-output-names =
 			"tpu0", "mmcif1", "sdhi3", "sdhi2",
 			 "sdhi1", "sdhi0", "mmcif0";
-		renesas,clock-indices = <
+		clock-indices = <
 			R8A7790_CLK_TPU0 R8A7790_CLK_MMCIF1 R8A7790_CLK_SDHI3
 			R8A7790_CLK_SDHI2 R8A7790_CLK_SDHI1 R8A7790_CLK_SDHI0
 			R8A7790_CLK_MMCIF0
diff --git a/drivers/clk/shmobile/clk-mstp.c b/drivers/clk/shmobile/clk-mstp.c
index 2e5810c..1f6324e 100644
--- a/drivers/clk/shmobile/clk-mstp.c
+++ b/drivers/clk/shmobile/clk-mstp.c
@@ -156,6 +156,7 @@ cpg_mstp_clock_register(const char *name, const char *parent_name,
 static void __init cpg_mstp_clocks_init(struct device_node *np)
 {
 	struct mstp_clock_group *group;
+	const char *idxname;
 	struct clk **clks;
 	unsigned int i;
 
@@ -184,6 +185,11 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
 	for (i = 0; i < MSTP_MAX_CLOCKS; ++i)
 		clks[i] = ERR_PTR(-ENOENT);
 
+	if (of_find_property(np, "clock-indices", &i))
+		idxname = "clock-indices";
+	else
+		idxname = "renesas,clock-indices";
+
 	for (i = 0; i < MSTP_MAX_CLOCKS; ++i) {
 		const char *parent_name;
 		const char *name;
@@ -197,8 +203,7 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
 			continue;
 
 		parent_name = of_clk_get_parent_name(np, i);
-		ret = of_property_read_u32_index(np, "renesas,clock-indices", i,
-						 &clkidx);
+		ret = of_property_read_u32_index(np, idxname, i, &clkidx);
 		if (parent_name == NULL || ret < 0)
 			break;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] clk: shmobile: clk-mstp: change to using clock-indices
  2014-04-15 16:06 [PATCH] clk: shmobile: clk-mstp: change to using clock-indices Ben Dooks
@ 2014-04-15 16:11 ` Geert Uytterhoeven
  2014-04-28 13:26 ` Wolfram Sang
  2014-05-05 22:50 ` Mike Turquette
  2 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2014-04-15 16:11 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Ben,

On Tue, Apr 15, 2014 at 6:06 PM, Ben Dooks <ben.dooks@codethink.co.uk> wrote:
> With the addition of clock-indices, we need to change the renesas
> clock implementation to use these instead of the local definition
> of "renesas,clock-indices".
>
> Since this will break booting with older device trees, we add a
> simple auto-detection of which properties are present.

Thanks for your patch!

> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] clk: shmobile: clk-mstp: change to using clock-indices
  2014-04-15 16:06 [PATCH] clk: shmobile: clk-mstp: change to using clock-indices Ben Dooks
  2014-04-15 16:11 ` Geert Uytterhoeven
@ 2014-04-28 13:26 ` Wolfram Sang
  2014-04-28 15:03   ` Geert Uytterhoeven
  2014-05-05 22:50 ` Mike Turquette
  2 siblings, 1 reply; 8+ messages in thread
From: Wolfram Sang @ 2014-04-28 13:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 15, 2014 at 05:06:34PM +0100, Ben Dooks wrote:
> With the addition of clock-indices, we need to change the renesas
> clock implementation to use these instead of the local definition
> of "renesas,clock-indices".
> 
> Since this will break booting with older device trees, we add a
> simple auto-detection of which properties are present.
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
>  .../devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt        | 2 +-
>  drivers/clk/shmobile/clk-mstp.c                                  | 9 +++++++--
>  2 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
> index 5992dce..02a25d9 100644
> --- a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
> +++ b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt

What about mentioning the old binding as deprecated in this file...

>  
> +	if (of_find_property(np, "clock-indices", &i))
> +		idxname = "clock-indices";
> +	else
> +		idxname = "renesas,clock-indices";

...and here in the code? It might also be a tad more intuitive to check
for the depracted binding, and if not found, use the new one as default,
i.e. switch the logic of the if block. Very minor nit, though.

But in general,

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140428/cc9f5c3c/attachment.sig>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] clk: shmobile: clk-mstp: change to using clock-indices
  2014-04-28 13:26 ` Wolfram Sang
@ 2014-04-28 15:03   ` Geert Uytterhoeven
  0 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2014-04-28 15:03 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Wolfram,

On Mon, Apr 28, 2014 at 3:26 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
>> +     if (of_find_property(np, "clock-indices", &i))
>> +             idxname = "clock-indices";
>> +     else
>> +             idxname = "renesas,clock-indices";
>
> ...and here in the code? It might also be a tad more intuitive to check

Thanks, a comment never hurts.

> for the depracted binding, and if not found, use the new one as default,
> i.e. switch the logic of the if block. Very minor nit, though.

I think checking for the new one first is the right thing to do.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus TorvaldsH

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] clk: shmobile: clk-mstp: change to using clock-indices
  2014-04-15 16:06 [PATCH] clk: shmobile: clk-mstp: change to using clock-indices Ben Dooks
  2014-04-15 16:11 ` Geert Uytterhoeven
  2014-04-28 13:26 ` Wolfram Sang
@ 2014-05-05 22:50 ` Mike Turquette
  2014-05-06 11:43   ` Geert Uytterhoeven
  2 siblings, 1 reply; 8+ messages in thread
From: Mike Turquette @ 2014-05-05 22:50 UTC (permalink / raw)
  To: linux-arm-kernel

Quoting Ben Dooks (2014-04-15 09:06:34)
> With the addition of clock-indices, we need to change the renesas
> clock implementation to use these instead of the local definition
> of "renesas,clock-indices".
> 
> Since this will break booting with older device trees, we add a
> simple auto-detection of which properties are present.
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>

I'm fine to take this into clk-fixes, destined for 3.15-rc5. Does that
solve the issues on your end? Do you still need me to host a stable
topic branch for you? I'm happy to do that if needed.

Regards,
Mike

> ---
>  .../devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt        | 2 +-
>  drivers/clk/shmobile/clk-mstp.c                                  | 9 +++++++--
>  2 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
> index 5992dce..02a25d9 100644
> --- a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
> +++ b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
> @@ -43,7 +43,7 @@ Example
>                 clock-output-names =
>                         "tpu0", "mmcif1", "sdhi3", "sdhi2",
>                          "sdhi1", "sdhi0", "mmcif0";
> -               renesas,clock-indices = <
> +               clock-indices = <
>                         R8A7790_CLK_TPU0 R8A7790_CLK_MMCIF1 R8A7790_CLK_SDHI3
>                         R8A7790_CLK_SDHI2 R8A7790_CLK_SDHI1 R8A7790_CLK_SDHI0
>                         R8A7790_CLK_MMCIF0
> diff --git a/drivers/clk/shmobile/clk-mstp.c b/drivers/clk/shmobile/clk-mstp.c
> index 2e5810c..1f6324e 100644
> --- a/drivers/clk/shmobile/clk-mstp.c
> +++ b/drivers/clk/shmobile/clk-mstp.c
> @@ -156,6 +156,7 @@ cpg_mstp_clock_register(const char *name, const char *parent_name,
>  static void __init cpg_mstp_clocks_init(struct device_node *np)
>  {
>         struct mstp_clock_group *group;
> +       const char *idxname;
>         struct clk **clks;
>         unsigned int i;
>  
> @@ -184,6 +185,11 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
>         for (i = 0; i < MSTP_MAX_CLOCKS; ++i)
>                 clks[i] = ERR_PTR(-ENOENT);
>  
> +       if (of_find_property(np, "clock-indices", &i))
> +               idxname = "clock-indices";
> +       else
> +               idxname = "renesas,clock-indices";
> +
>         for (i = 0; i < MSTP_MAX_CLOCKS; ++i) {
>                 const char *parent_name;
>                 const char *name;
> @@ -197,8 +203,7 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
>                         continue;
>  
>                 parent_name = of_clk_get_parent_name(np, i);
> -               ret = of_property_read_u32_index(np, "renesas,clock-indices", i,
> -                                                &clkidx);
> +               ret = of_property_read_u32_index(np, idxname, i, &clkidx);
>                 if (parent_name == NULL || ret < 0)
>                         break;
>  
> -- 
> 1.9.1
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] clk: shmobile: clk-mstp: change to using clock-indices
  2014-05-05 22:50 ` Mike Turquette
@ 2014-05-06 11:43   ` Geert Uytterhoeven
  2014-05-12  8:31     ` Geert Uytterhoeven
  0 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2014-05-06 11:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Mike,

On Tue, May 6, 2014 at 12:50 AM, Mike Turquette <mturquette@linaro.org> wrote:
> Quoting Ben Dooks (2014-04-15 09:06:34)
>> With the addition of clock-indices, we need to change the renesas
>> clock implementation to use these instead of the local definition
>> of "renesas,clock-indices".
>>
>> Since this will break booting with older device trees, we add a
>> simple auto-detection of which properties are present.
>>
>> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
>
> I'm fine to take this into clk-fixes, destined for 3.15-rc5. Does that

Thanks!

> solve the issues on your end? Do you still need me to host a stable
> topic branch for you? I'm happy to do that if needed.

As Simon will be on holidays until rc5, I think he can just use rc5 as the
stable base for further fixes.

Thanks again!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] clk: shmobile: clk-mstp: change to using clock-indices
  2014-05-06 11:43   ` Geert Uytterhoeven
@ 2014-05-12  8:31     ` Geert Uytterhoeven
  2014-05-12 23:55       ` Mike Turquette
  0 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2014-05-12  8:31 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Mike,

On Tue, May 6, 2014 at 1:43 PM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Tue, May 6, 2014 at 12:50 AM, Mike Turquette <mturquette@linaro.org> wrote:
>> Quoting Ben Dooks (2014-04-15 09:06:34)
>>> With the addition of clock-indices, we need to change the renesas
>>> clock implementation to use these instead of the local definition
>>> of "renesas,clock-indices".
>>>
>>> Since this will break booting with older device trees, we add a
>>> simple auto-detection of which properties are present.
>>>
>>> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
>>
>> I'm fine to take this into clk-fixes, destined for 3.15-rc5. Does that
>
> Thanks!

It seems this missed rc5?
Can you please submit for rc6?

Thanks again!

>> solve the issues on your end? Do you still need me to host a stable
>> topic branch for you? I'm happy to do that if needed.
>
> As Simon will be on holidays until rc5, I think he can just use rc5 as the
> stable base for further fixes.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] clk: shmobile: clk-mstp: change to using clock-indices
  2014-05-12  8:31     ` Geert Uytterhoeven
@ 2014-05-12 23:55       ` Mike Turquette
  0 siblings, 0 replies; 8+ messages in thread
From: Mike Turquette @ 2014-05-12 23:55 UTC (permalink / raw)
  To: linux-arm-kernel

Quoting Geert Uytterhoeven (2014-05-12 01:31:41)
> Hi Mike,
> 
> On Tue, May 6, 2014 at 1:43 PM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > On Tue, May 6, 2014 at 12:50 AM, Mike Turquette <mturquette@linaro.org> wrote:
> >> Quoting Ben Dooks (2014-04-15 09:06:34)
> >>> With the addition of clock-indices, we need to change the renesas
> >>> clock implementation to use these instead of the local definition
> >>> of "renesas,clock-indices".
> >>>
> >>> Since this will break booting with older device trees, we add a
> >>> simple auto-detection of which properties are present.
> >>>
> >>> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> >>
> >> I'm fine to take this into clk-fixes, destined for 3.15-rc5. Does that
> >
> > Thanks!
> 
> It seems this missed rc5?
> Can you please submit for rc6?

Yes, I will send out the PR for that today. This fix has already landed
in clk-next as I merge the clk-fixes branch into clk-next regularly.

Regards,
Mike

> 
> Thanks again!
> 
> >> solve the issues on your end? Do you still need me to host a stable
> >> topic branch for you? I'm happy to do that if needed.
> >
> > As Simon will be on holidays until rc5, I think he can just use rc5 as the
> > stable base for further fixes.
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-05-12 23:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-15 16:06 [PATCH] clk: shmobile: clk-mstp: change to using clock-indices Ben Dooks
2014-04-15 16:11 ` Geert Uytterhoeven
2014-04-28 13:26 ` Wolfram Sang
2014-04-28 15:03   ` Geert Uytterhoeven
2014-05-05 22:50 ` Mike Turquette
2014-05-06 11:43   ` Geert Uytterhoeven
2014-05-12  8:31     ` Geert Uytterhoeven
2014-05-12 23:55       ` Mike Turquette

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