diff mbox

[2/7] clk: tegra: Use common of_clk_init() function

Message ID 1357282858-2112-2-git-send-email-pgaikwad@nvidia.com (mailing list archive)
State New, archived
Headers show

Commit Message

Prashant Gaikwad Jan. 4, 2013, 7 a.m. UTC
Use common of_clk_init() function for clocks initialization.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
---
 arch/arm/mach-tegra/common.c    |    4 ++--
 drivers/clk/tegra/clk-tegra20.c |    3 ++-
 drivers/clk/tegra/clk-tegra30.c |    3 ++-
 drivers/clk/tegra/clk.c         |   11 -----------
 drivers/clk/tegra/clk.h         |   12 ------------
 include/linux/clk/tegra.h       |    1 -
 6 files changed, 6 insertions(+), 28 deletions(-)

Comments

Stephen Warren Jan. 4, 2013, 4:30 p.m. UTC | #1
On 01/04/2013 12:00 AM, Prashant Gaikwad wrote:
> Use common of_clk_init() function for clocks initialization.

>  drivers/clk/tegra/clk-tegra20.c |    3 ++-
>  drivers/clk/tegra/clk-tegra30.c |    3 ++-

Oh, so this series is written assuming that the Tegra CCF rework is
already applied then? That makes the dependencies quite painful, since I
think we'll end up with the following order being needed:

1) clk: Add composite clock type
   -> This would usually go through the clk tree.
2) The Tegra CCF rework series
   -> This must go through the Tegra tree due to lots of dependencies
   and merge conflicts with other Tegra patches.
3) This series
   -> This would usually go through the clk tree.

Is it possible to re-order the dependencies as (1) (3) (2), so that Mike
can apply (1) and (3) to the clock tree, then I can use the clk tree as
the basis for a branch in the Tegra tree to apply (2) and all the other
Tegra patches that will conflict with (2)?
Prashant Gaikwad Jan. 5, 2013, 2:44 a.m. UTC | #2
On Friday 04 January 2013 10:00 PM, Stephen Warren wrote:
> On 01/04/2013 12:00 AM, Prashant Gaikwad wrote:
>> Use common of_clk_init() function for clocks initialization.
>>   drivers/clk/tegra/clk-tegra20.c |    3 ++-
>>   drivers/clk/tegra/clk-tegra30.c |    3 ++-
> Oh, so this series is written assuming that the Tegra CCF rework is
> already applied then? That makes the dependencies quite painful, since I
> think we'll end up with the following order being needed:
>
> 1) clk: Add composite clock type
>     -> This would usually go through the clk tree.
> 2) The Tegra CCF rework series
>     -> This must go through the Tegra tree due to lots of dependencies
>     and merge conflicts with other Tegra patches.
> 3) This series
>     -> This would usually go through the clk tree.
>
> Is it possible to re-order the dependencies as (1) (3) (2), so that Mike
> can apply (1) and (3) to the clock tree, then I can use the clk tree as
> the basis for a branch in the Tegra tree to apply (2) and all the other
> Tegra patches that will conflict with (2)?

If Mike approves the concept and implementation in (1) and (3) then I 
will repost (2) and (3) with dependencies re-ordered.
Mike Turquette Jan. 24, 2013, 7:20 p.m. UTC | #3
Quoting Prashant Gaikwad (2013-01-04 18:44:48)
> On Friday 04 January 2013 10:00 PM, Stephen Warren wrote:
> > On 01/04/2013 12:00 AM, Prashant Gaikwad wrote:
> >> Use common of_clk_init() function for clocks initialization.
> >>   drivers/clk/tegra/clk-tegra20.c |    3 ++-
> >>   drivers/clk/tegra/clk-tegra30.c |    3 ++-
> > Oh, so this series is written assuming that the Tegra CCF rework is
> > already applied then? That makes the dependencies quite painful, since I
> > think we'll end up with the following order being needed:
> >
> > 1) clk: Add composite clock type
> >     -> This would usually go through the clk tree.
> > 2) The Tegra CCF rework series
> >     -> This must go through the Tegra tree due to lots of dependencies
> >     and merge conflicts with other Tegra patches.
> > 3) This series
> >     -> This would usually go through the clk tree.
> >
> > Is it possible to re-order the dependencies as (1) (3) (2), so that Mike
> > can apply (1) and (3) to the clock tree, then I can use the clk tree as
> > the basis for a branch in the Tegra tree to apply (2) and all the other
> > Tegra patches that will conflict with (2)?
> 
> If Mike approves the concept and implementation in (1) and (3) then I 
> will repost (2) and (3) with dependencies re-ordered.

Patch (1) still has some unaddressed comments, and is not a real
dependency for this series.  Since all of the patches have received their
Tested-by's then I propose to merge all patches from this series into
clk-next, which exception of patch 2/7 (the Tegra patch).

This reduces your Tegra CCF conversion dependencies and you can role the
necessary of_clk_init change into your Tegra CCF conversion branch (it
has my implicit Ack and can be taken through your tree).

Let me know if this is OK for you.

Thanks,
Mike
Stephen Warren Jan. 24, 2013, 7:32 p.m. UTC | #4
On 01/24/2013 11:20 AM, Mike Turquette wrote:
> Quoting Prashant Gaikwad (2013-01-04 18:44:48)
>> On Friday 04 January 2013 10:00 PM, Stephen Warren wrote:
>>> On 01/04/2013 12:00 AM, Prashant Gaikwad wrote:
>>>> Use common of_clk_init() function for clocks initialization.
>>>>   drivers/clk/tegra/clk-tegra20.c |    3 ++-
>>>>   drivers/clk/tegra/clk-tegra30.c |    3 ++-
>>> Oh, so this series is written assuming that the Tegra CCF rework is
>>> already applied then? That makes the dependencies quite painful, since I
>>> think we'll end up with the following order being needed:
>>>
>>> 1) clk: Add composite clock type
>>>     -> This would usually go through the clk tree.
>>> 2) The Tegra CCF rework series
>>>     -> This must go through the Tegra tree due to lots of dependencies
>>>     and merge conflicts with other Tegra patches.
>>> 3) This series
>>>     -> This would usually go through the clk tree.
>>>
>>> Is it possible to re-order the dependencies as (1) (3) (2), so that Mike
>>> can apply (1) and (3) to the clock tree, then I can use the clk tree as
>>> the basis for a branch in the Tegra tree to apply (2) and all the other
>>> Tegra patches that will conflict with (2)?
>>
>> If Mike approves the concept and implementation in (1) and (3) then I 
>> will repost (2) and (3) with dependencies re-ordered.
> 
> Patch (1) still has some unaddressed comments, and is not a real
> dependency for this series.

I assume "Patch (1)" refers to the list of series a couple emails above,
not the first patch in the series you're replying to; that threw me for
a moment.

> Since all of the patches have received their
> Tested-by's then I propose to merge all patches from this series into
> clk-next, which exception of patch 2/7 (the Tegra patch).
> 
> This reduces your Tegra CCF conversion dependencies and you can role the
> necessary of_clk_init change into your Tegra CCF conversion branch (it
> has my implicit Ack and can be taken through your tree).
> 
> Let me know if this is OK for you.

OK, I'm happy to merge your clock tree into the Tegra tree and then
apply 2/7 on top of the Tegra CCF work.
Stephen Warren Jan. 25, 2013, 4:44 a.m. UTC | #5
On 01/24/2013 04:57 PM, Mike Turquette wrote:
> Quoting Stephen Warren (2013-01-24 11:32:37)
>> On 01/24/2013 11:20 AM, Mike Turquette wrote:
>>> Quoting Prashant Gaikwad (2013-01-04 18:44:48)
>>>> On Friday 04 January 2013 10:00 PM, Stephen Warren wrote:
>>>>> On 01/04/2013 12:00 AM, Prashant Gaikwad wrote:
>>>>>> Use common of_clk_init() function for clocks initialization.
>>>>>>   drivers/clk/tegra/clk-tegra20.c |    3 ++-
>>>>>>   drivers/clk/tegra/clk-tegra30.c |    3 ++-
>>>>> Oh, so this series is written assuming that the Tegra CCF rework is
>>>>> already applied then? That makes the dependencies quite painful, since I
>>>>> think we'll end up with the following order being needed:
>>>>>
>>>>> 1) clk: Add composite clock type
>>>>>     -> This would usually go through the clk tree.
>>>>> 2) The Tegra CCF rework series
>>>>>     -> This must go through the Tegra tree due to lots of dependencies
>>>>>     and merge conflicts with other Tegra patches.
>>>>> 3) This series
>>>>>     -> This would usually go through the clk tree.
>>>>>
>>>>> Is it possible to re-order the dependencies as (1) (3) (2), so that Mike
>>>>> can apply (1) and (3) to the clock tree, then I can use the clk tree as
>>>>> the basis for a branch in the Tegra tree to apply (2) and all the other
>>>>> Tegra patches that will conflict with (2)?
>>>>
>>>> If Mike approves the concept and implementation in (1) and (3) then I 
>>>> will repost (2) and (3) with dependencies re-ordered.
>>>
>>> Patch (1) still has some unaddressed comments, and is not a real
>>> dependency for this series.
>>
>> I assume "Patch (1)" refers to the list of series a couple emails above,
>> not the first patch in the series you're replying to; that threw me for
>> a moment.
>>
>>> Since all of the patches have received their
>>> Tested-by's then I propose to merge all patches from this series into
>>> clk-next, which exception of patch 2/7 (the Tegra patch).
>>>
>>> This reduces your Tegra CCF conversion dependencies and you can role the
>>> necessary of_clk_init change into your Tegra CCF conversion branch (it
>>> has my implicit Ack and can be taken through your tree).
>>>
>>> Let me know if this is OK for you.
>>
>> OK, I'm happy to merge your clock tree into the Tegra tree and then
>> apply 2/7 on top of the Tegra CCF work.
> 
> Hmm, maybe the clk tree needs to be a dependency branch of arm-soc
> again, as it has in the past.  Would that help with any Tegra merge
> pain?

Yes, I think that's what would end up happening if I merge the clk tree
into the Tegra tree anyway.
Prashant Gaikwad Feb. 1, 2013, 4:49 a.m. UTC | #6
On Friday 25 January 2013 10:14 AM, Stephen Warren wrote:
> On 01/24/2013 04:57 PM, Mike Turquette wrote:
>> Quoting Stephen Warren (2013-01-24 11:32:37)
>>> On 01/24/2013 11:20 AM, Mike Turquette wrote:
>>>> Quoting Prashant Gaikwad (2013-01-04 18:44:48)
>>>>> On Friday 04 January 2013 10:00 PM, Stephen Warren wrote:
>>>>>> On 01/04/2013 12:00 AM, Prashant Gaikwad wrote:
>>>>>>> Use common of_clk_init() function for clocks initialization.
>>>>>>>    drivers/clk/tegra/clk-tegra20.c |    3 ++-
>>>>>>>    drivers/clk/tegra/clk-tegra30.c |    3 ++-
>>>>>> Oh, so this series is written assuming that the Tegra CCF rework is
>>>>>> already applied then? That makes the dependencies quite painful, since I
>>>>>> think we'll end up with the following order being needed:
>>>>>>
>>>>>> 1) clk: Add composite clock type
>>>>>>      -> This would usually go through the clk tree.
>>>>>> 2) The Tegra CCF rework series
>>>>>>      -> This must go through the Tegra tree due to lots of dependencies
>>>>>>      and merge conflicts with other Tegra patches.
>>>>>> 3) This series
>>>>>>      -> This would usually go through the clk tree.
>>>>>>
>>>>>> Is it possible to re-order the dependencies as (1) (3) (2), so that Mike
>>>>>> can apply (1) and (3) to the clock tree, then I can use the clk tree as
>>>>>> the basis for a branch in the Tegra tree to apply (2) and all the other
>>>>>> Tegra patches that will conflict with (2)?
>>>>> If Mike approves the concept and implementation in (1) and (3) then I
>>>>> will repost (2) and (3) with dependencies re-ordered.
>>>> Patch (1) still has some unaddressed comments, and is not a real
>>>> dependency for this series.
>>> I assume "Patch (1)" refers to the list of series a couple emails above,
>>> not the first patch in the series you're replying to; that threw me for
>>> a moment.
>>>
>>>> Since all of the patches have received their
>>>> Tested-by's then I propose to merge all patches from this series into
>>>> clk-next, which exception of patch 2/7 (the Tegra patch).
>>>>
>>>> This reduces your Tegra CCF conversion dependencies and you can role the
>>>> necessary of_clk_init change into your Tegra CCF conversion branch (it
>>>> has my implicit Ack and can be taken through your tree).
>>>>
>>>> Let me know if this is OK for you.
>>> OK, I'm happy to merge your clock tree into the Tegra tree and then
>>> apply 2/7 on top of the Tegra CCF work.
>> Hmm, maybe the clk tree needs to be a dependency branch of arm-soc
>> again, as it has in the past.  Would that help with any Tegra merge
>> pain?
> Yes, I think that's what would end up happening if I merge the clk tree
> into the Tegra tree anyway.

Hi Mike,

Have you merged these patches for 3.9?
Mike Turquette Feb. 1, 2013, 10:53 p.m. UTC | #7
Quoting Prashant Gaikwad (2013-01-31 20:49:47)
> On Friday 25 January 2013 10:14 AM, Stephen Warren wrote:
> > On 01/24/2013 04:57 PM, Mike Turquette wrote:
> >> Quoting Stephen Warren (2013-01-24 11:32:37)
> >>> On 01/24/2013 11:20 AM, Mike Turquette wrote:
> >>>> Quoting Prashant Gaikwad (2013-01-04 18:44:48)
> >>>>> On Friday 04 January 2013 10:00 PM, Stephen Warren wrote:
> >>>>>> On 01/04/2013 12:00 AM, Prashant Gaikwad wrote:
> >>>>>>> Use common of_clk_init() function for clocks initialization.
> >>>>>>>    drivers/clk/tegra/clk-tegra20.c |    3 ++-
> >>>>>>>    drivers/clk/tegra/clk-tegra30.c |    3 ++-
> >>>>>> Oh, so this series is written assuming that the Tegra CCF rework is
> >>>>>> already applied then? That makes the dependencies quite painful, since I
> >>>>>> think we'll end up with the following order being needed:
> >>>>>>
> >>>>>> 1) clk: Add composite clock type
> >>>>>>      -> This would usually go through the clk tree.
> >>>>>> 2) The Tegra CCF rework series
> >>>>>>      -> This must go through the Tegra tree due to lots of dependencies
> >>>>>>      and merge conflicts with other Tegra patches.
> >>>>>> 3) This series
> >>>>>>      -> This would usually go through the clk tree.
> >>>>>>
> >>>>>> Is it possible to re-order the dependencies as (1) (3) (2), so that Mike
> >>>>>> can apply (1) and (3) to the clock tree, then I can use the clk tree as
> >>>>>> the basis for a branch in the Tegra tree to apply (2) and all the other
> >>>>>> Tegra patches that will conflict with (2)?
> >>>>> If Mike approves the concept and implementation in (1) and (3) then I
> >>>>> will repost (2) and (3) with dependencies re-ordered.
> >>>> Patch (1) still has some unaddressed comments, and is not a real
> >>>> dependency for this series.
> >>> I assume "Patch (1)" refers to the list of series a couple emails above,
> >>> not the first patch in the series you're replying to; that threw me for
> >>> a moment.
> >>>
> >>>> Since all of the patches have received their
> >>>> Tested-by's then I propose to merge all patches from this series into
> >>>> clk-next, which exception of patch 2/7 (the Tegra patch).
> >>>>
> >>>> This reduces your Tegra CCF conversion dependencies and you can role the
> >>>> necessary of_clk_init change into your Tegra CCF conversion branch (it
> >>>> has my implicit Ack and can be taken through your tree).
> >>>>
> >>>> Let me know if this is OK for you.
> >>> OK, I'm happy to merge your clock tree into the Tegra tree and then
> >>> apply 2/7 on top of the Tegra CCF work.
> >> Hmm, maybe the clk tree needs to be a dependency branch of arm-soc
> >> again, as it has in the past.  Would that help with any Tegra merge
> >> pain?
> > Yes, I think that's what would end up happening if I merge the clk tree
> > into the Tegra tree anyway.
> 
> Hi Mike,
> 
> Have you merged these patches for 3.9?

Yes, these have been sitting in clk-next for a few days now.

Regards,
Mike
diff mbox

Patch

diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 3a7280d..4fde6a9 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -22,7 +22,7 @@ 
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/of_irq.h>
-#include <linux/clk/tegra.h>
+#include <linux/clk-provider.h>
 
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/hardware/gic.h>
@@ -64,7 +64,7 @@  static const struct of_device_id tegra_dt_irq_match[] __initconst = {
 
 void __init tegra_dt_init_irq(void)
 {
-	tegra_clocks_init();
+	of_clk_init(NULL);
 	tegra_init_irq();
 	of_irq_init(tegra_dt_irq_match);
 }
diff --git a/drivers/clk/tegra/clk-tegra20.c b/drivers/clk/tegra/clk-tegra20.c
index 32a3d81..3436ad9 100644
--- a/drivers/clk/tegra/clk-tegra20.c
+++ b/drivers/clk/tegra/clk-tegra20.c
@@ -1193,7 +1193,7 @@  static const struct of_device_id apb_match[] __initconst = {
 	{},
 };
 
-void __init tegra20_clock_init(struct device_node *np)
+static void __init tegra20_clock_init(struct device_node *np)
 {
 	int i;
 	struct device_node *node;
@@ -1253,3 +1253,4 @@  void __init tegra20_clock_init(struct device_node *np)
 
 	tegra_cpu_car_ops = &tegra20_cpu_car_ops;
 }
+CLK_OF_DECLARE(tegra20, "nvidia,tegra20-car", tegra20_clock_init);
diff --git a/drivers/clk/tegra/clk-tegra30.c b/drivers/clk/tegra/clk-tegra30.c
index 30fb743..f17e857 100644
--- a/drivers/clk/tegra/clk-tegra30.c
+++ b/drivers/clk/tegra/clk-tegra30.c
@@ -1971,7 +1971,7 @@  static const struct of_device_id apb_match[] __initconst = {
 	{},
 };
 
-void __init tegra30_clock_init(struct device_node *np)
+static void __init tegra30_clock_init(struct device_node *np)
 {
 	struct device_node *node;
 	int i;
@@ -2031,3 +2031,4 @@  void __init tegra30_clock_init(struct device_node *np)
 
 	tegra_cpu_car_ops = &tegra30_cpu_car_ops;
 }
+CLK_OF_DECLARE(tegra30, "nvidia,tegra30-car", tegra30_clock_init);
diff --git a/drivers/clk/tegra/clk.c b/drivers/clk/tegra/clk.c
index a603b9a..ce4441a 100644
--- a/drivers/clk/tegra/clk.c
+++ b/drivers/clk/tegra/clk.c
@@ -72,14 +72,3 @@  void __init tegra_init_from_table(struct tegra_clk_init_table *tbl,
 			}
 	}
 }
-
-static const struct of_device_id tegra_dt_clk_match[] = {
-	{ .compatible = "nvidia,tegra20-car", .data = tegra20_clock_init },
-	{ .compatible = "nvidia,tegra30-car", .data = tegra30_clock_init },
-	{ }
-};
-
-void __init tegra_clocks_init(void)
-{
-	of_clk_init(tegra_dt_clk_match);
-}
diff --git a/drivers/clk/tegra/clk.h b/drivers/clk/tegra/clk.h
index f1ed1d0..7fdf8e6 100644
--- a/drivers/clk/tegra/clk.h
+++ b/drivers/clk/tegra/clk.h
@@ -476,16 +476,4 @@  void tegra_init_from_table(struct tegra_clk_init_table *tbl,
 void tegra_init_dup_clks(struct tegra_clk_duplicate *dup_list,
 				struct clk *clks[], int clk_max);
 
-#ifdef CONFIG_ARCH_TEGRA_2x_SOC
-void tegra20_clock_init(struct device_node *np);
-#else
-static inline void tegra20_clock_init(struct device_node *np) {}
-#endif /* CONFIG_ARCH_TEGRA_2x_SOC */
-
-#ifdef CONFIG_ARCH_TEGRA_3x_SOC
-void tegra30_clock_init(struct device_node *np);
-#else
-static inline void tegra30_clock_init(struct device_node *np) {}
-#endif /* CONFIG_ARCH_TEGRA_3x_SOC */
-
 #endif /* TEGRA_CLK_H */
diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h
index 404d6f9..2e8b399 100644
--- a/include/linux/clk/tegra.h
+++ b/include/linux/clk/tegra.h
@@ -122,6 +122,5 @@  static inline void tegra_cpu_clock_resume(void)
 
 void tegra_periph_reset_deassert(struct clk *c);
 void tegra_periph_reset_assert(struct clk *c);
-void tegra_clocks_init(void);
 
 #endif /* __LINUX_CLK_TEGRA_H_ */