2013-05-27 07:45:25

by Prashant Gaikwad

[permalink] [raw]
Subject: [PATCH v2] clk: tegra: Use common of_clk_init function

Use common of_clk_init() function for clocks initialization.

Signed-off-by: Prashant Gaikwad <[email protected]>
---

Included initialization for T114 in V2.

---
arch/arm/mach-tegra/common.c | 4 ++--
drivers/clk/tegra/clk-tegra114.c | 3 ++-
drivers/clk/tegra/clk-tegra20.c | 3 ++-
drivers/clk/tegra/clk-tegra30.c | 3 ++-
drivers/clk/tegra/clk.c | 12 ------------
drivers/clk/tegra/clk.h | 18 ------------------
include/linux/clk/tegra.h | 1 -
7 files changed, 8 insertions(+), 36 deletions(-)

diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 9f852c6..95ce2a0 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -23,7 +23,7 @@
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/irqchip.h>
-#include <linux/clk/tegra.h>
+#include <linux/clk-provider.h>

#include <asm/hardware/cache-l2x0.h>

@@ -59,7 +59,7 @@ u32 tegra_uart_config[4] = {
#ifdef CONFIG_OF
void __init tegra_dt_init_irq(void)
{
- tegra_clocks_init();
+ of_clk_init(NULL);
tegra_pmc_init();
tegra_init_irq();
irqchip_init();
diff --git a/drivers/clk/tegra/clk-tegra114.c b/drivers/clk/tegra/clk-tegra114.c
index d78e16e..e0ee077 100644
--- a/drivers/clk/tegra/clk-tegra114.c
+++ b/drivers/clk/tegra/clk-tegra114.c
@@ -2030,7 +2030,7 @@ static void __init tegra114_clock_apply_init_table(void)
tegra_init_from_table(init_table, clks, clk_max);
}

-void __init tegra114_clock_init(struct device_node *np)
+static void __init tegra114_clock_init(struct device_node *np)
{
struct device_node *node;
int i;
@@ -2083,3 +2083,4 @@ void __init tegra114_clock_init(struct device_node *np)

tegra_cpu_car_ops = &tegra114_cpu_car_ops;
}
+CLK_OF_DECLARE(tegra114, "nvidia,tegra114-car", tegra114_clock_init);
diff --git a/drivers/clk/tegra/clk-tegra20.c b/drivers/clk/tegra/clk-tegra20.c
index 8292a00..a25e07c 100644
--- a/drivers/clk/tegra/clk-tegra20.c
+++ b/drivers/clk/tegra/clk-tegra20.c
@@ -1282,7 +1282,7 @@ static const struct of_device_id pmc_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;
@@ -1334,3 +1334,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 c6921f5..985ad69 100644
--- a/drivers/clk/tegra/clk-tegra30.c
+++ b/drivers/clk/tegra/clk-tegra30.c
@@ -1953,7 +1953,7 @@ static const struct of_device_id pmc_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;
@@ -2004,3 +2004,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 923ca7e..86581ac 100644
--- a/drivers/clk/tegra/clk.c
+++ b/drivers/clk/tegra/clk.c
@@ -74,18 +74,6 @@ 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 },
- { .compatible = "nvidia,tegra114-car", .data = tegra114_clock_init },
- { }
-};
-
-void __init tegra_clocks_init(void)
-{
- of_clk_init(tegra_dt_clk_match);
-}
-
tegra_clk_apply_init_table_func tegra_clk_apply_init_table;

void __init tegra_clocks_apply_init_table(void)
diff --git a/drivers/clk/tegra/clk.h b/drivers/clk/tegra/clk.h
index e056562..11278a8 100644
--- a/drivers/clk/tegra/clk.h
+++ b/drivers/clk/tegra/clk.h
@@ -571,24 +571,6 @@ 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 */
-
-#ifdef CONFIG_ARCH_TEGRA_114_SOC
-void tegra114_clock_init(struct device_node *np);
-#else
-static inline void tegra114_clock_init(struct device_node *np) {}
-#endif /* CONFIG_ARCH_TEGRA114_SOC */
-
typedef void (*tegra_clk_apply_init_table_func)(void);
extern tegra_clk_apply_init_table_func tegra_clk_apply_init_table;

diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h
index 642789b..3670a4f 100644
--- a/include/linux/clk/tegra.h
+++ b/include/linux/clk/tegra.h
@@ -122,7 +122,6 @@ 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);
void tegra_clocks_apply_init_table(void);

#endif /* __LINUX_CLK_TEGRA_H_ */
--
1.7.4.1


2013-05-27 15:10:14

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH v2] clk: tegra: Use common of_clk_init function

On Mon, May 27, 2013 at 01:10:09PM +0530, Prashant Gaikwad wrote:
> Use common of_clk_init() function for clocks initialization.
>
> Signed-off-by: Prashant Gaikwad <[email protected]>

Reviewed-by: Thierry Reding <[email protected]>


Attachments:
(No filename) (244.00 B)
(No filename) (836.00 B)
Download all attachments

2013-05-28 15:17:01

by Stephen Warren

[permalink] [raw]
Subject: Re: [PATCH v2] clk: tegra: Use common of_clk_init function

On 05/27/2013 01:40 AM, Prashant Gaikwad wrote:
> Use common of_clk_init() function for clocks initialization.

Acked-by: Stephen Warren <[email protected]>

2013-06-11 07:19:10

by Prashant Gaikwad

[permalink] [raw]
Subject: Re: [PATCH v2] clk: tegra: Use common of_clk_init function

On Tuesday 28 May 2013 08:46 PM, Stephen Warren wrote:
> On 05/27/2013 01:40 AM, Prashant Gaikwad wrote:
>> Use common of_clk_init() function for clocks initialization.

Mike,

Please merge this patch in your tree.

Thanks,
PrashantG
> Acked-by: Stephen Warren <[email protected]>

2013-06-21 06:19:35

by Mike Turquette

[permalink] [raw]
Subject: Re: [PATCH v2] clk: tegra: Use common of_clk_init function

Quoting Prashant Gaikwad (2013-06-11 00:18:56)
> On Tuesday 28 May 2013 08:46 PM, Stephen Warren wrote:
> > On 05/27/2013 01:40 AM, Prashant Gaikwad wrote:
> >> Use common of_clk_init() function for clocks initialization.
>
> Mike,
>
> Please merge this patch in your tree.

Hi Prashant. I merged this one a long time ago:

Refs: v3.10-rc3-22-g061cec9
Author: Prashant Gaikwad <[email protected]>
AuthorDate: Mon May 27 13:10:09 2013 +0530
Commit: Mike Turquette <[email protected]>
CommitDate: Fri May 31 12:57:25 2013 -0700

Regards,
Mike

>
> Thanks,
> PrashantG
> > Acked-by: Stephen Warren <[email protected]>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> [email protected]
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel