aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.c5
-rw-r--r--drivers/clk/clk-nomadik.c45
-rw-r--r--include/linux/platform_data/clk-nomadik.h2
3 files changed, 17 insertions, 35 deletions
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c
index 0fcb14966d5a..2be38a00a3d9 100644
--- a/arch/arm/mach-nomadik/cpu-8815.c
+++ b/arch/arm/mach-nomadik/cpu-8815.c
@@ -25,7 +25,7 @@
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/irq.h> 26#include <linux/irq.h>
27#include <linux/dma-mapping.h> 27#include <linux/dma-mapping.h>
28#include <linux/platform_data/clk-nomadik.h> 28#include <linux/clk-provider.h>
29#include <linux/clocksource.h> 29#include <linux/clocksource.h>
30#include <linux/of_irq.h> 30#include <linux/of_irq.h>
31#include <linux/of_gpio.h> 31#include <linux/of_gpio.h>
@@ -115,8 +115,7 @@ static void cpu8815_restart(enum reboot_mode mode, const char *cmd)
115 115
116static void __init cpu8815_timer_init_of(void) 116static void __init cpu8815_timer_init_of(void)
117{ 117{
118 /* We need this to be up now */ 118 of_clk_init(NULL);
119 nomadik_clk_init();
120 clocksource_of_init(); 119 clocksource_of_init();
121} 120}
122 121
diff --git a/drivers/clk/clk-nomadik.c b/drivers/clk/clk-nomadik.c
index 06b29c264dbe..ce2d6b32e3f5 100644
--- a/drivers/clk/clk-nomadik.c
+++ b/drivers/clk/clk-nomadik.c
@@ -512,6 +512,9 @@ static void __init of_nomadik_pll_setup(struct device_node *np)
512 const char *parent_name; 512 const char *parent_name;
513 u32 pll_id; 513 u32 pll_id;
514 514
515 if (!src_base)
516 nomadik_src_init();
517
515 if (of_property_read_u32(np, "pll-id", &pll_id)) { 518 if (of_property_read_u32(np, "pll-id", &pll_id)) {
516 pr_err("%s: PLL \"%s\" missing pll-id property\n", 519 pr_err("%s: PLL \"%s\" missing pll-id property\n",
517 __func__, clk_name); 520 __func__, clk_name);
@@ -522,6 +525,8 @@ static void __init of_nomadik_pll_setup(struct device_node *np)
522 if (!IS_ERR(clk)) 525 if (!IS_ERR(clk))
523 of_clk_add_provider(np, of_clk_src_simple_get, clk); 526 of_clk_add_provider(np, of_clk_src_simple_get, clk);
524} 527}
528CLK_OF_DECLARE(nomadik_pll_clk,
529 "st,nomadik-pll-clock", of_nomadik_pll_setup);
525 530
526static void __init of_nomadik_hclk_setup(struct device_node *np) 531static void __init of_nomadik_hclk_setup(struct device_node *np)
527{ 532{
@@ -529,6 +534,9 @@ static void __init of_nomadik_hclk_setup(struct device_node *np)
529 const char *clk_name = np->name; 534 const char *clk_name = np->name;
530 const char *parent_name; 535 const char *parent_name;
531 536
537 if (!src_base)
538 nomadik_src_init();
539
532 parent_name = of_clk_get_parent_name(np, 0); 540 parent_name = of_clk_get_parent_name(np, 0);
533 /* 541 /*
534 * The HCLK divides PLL1 with 1 (passthru), 2, 3 or 4. 542 * The HCLK divides PLL1 with 1 (passthru), 2, 3 or 4.
@@ -541,6 +549,8 @@ static void __init of_nomadik_hclk_setup(struct device_node *np)
541 if (!IS_ERR(clk)) 549 if (!IS_ERR(clk))
542 of_clk_add_provider(np, of_clk_src_simple_get, clk); 550 of_clk_add_provider(np, of_clk_src_simple_get, clk);
543} 551}
552CLK_OF_DECLARE(nomadik_hclk_clk,
553 "st,nomadik-hclk-clock", of_nomadik_hclk_setup);
544 554
545static void __init of_nomadik_src_clk_setup(struct device_node *np) 555static void __init of_nomadik_src_clk_setup(struct device_node *np)
546{ 556{
@@ -549,6 +559,9 @@ static void __init of_nomadik_src_clk_setup(struct device_node *np)
549 const char *parent_name; 559 const char *parent_name;
550 u32 clk_id; 560 u32 clk_id;
551 561
562 if (!src_base)
563 nomadik_src_init();
564
552 if (of_property_read_u32(np, "clock-id", &clk_id)) { 565 if (of_property_read_u32(np, "clock-id", &clk_id)) {
553 pr_err("%s: SRC clock \"%s\" missing clock-id property\n", 566 pr_err("%s: SRC clock \"%s\" missing clock-id property\n",
554 __func__, clk_name); 567 __func__, clk_name);
@@ -559,33 +572,5 @@ static void __init of_nomadik_src_clk_setup(struct device_node *np)
559 if (!IS_ERR(clk)) 572 if (!IS_ERR(clk))
560 of_clk_add_provider(np, of_clk_src_simple_get, clk); 573 of_clk_add_provider(np, of_clk_src_simple_get, clk);
561} 574}
562 575CLK_OF_DECLARE(nomadik_src_clk,
563static const struct of_device_id nomadik_src_clk_match[] __initconst = { 576 "st,nomadik-src-clock", of_nomadik_src_clk_setup);
564 {
565 .compatible = "fixed-clock",
566 .data = of_fixed_clk_setup,
567 },
568 {
569 .compatible = "fixed-factor-clock",
570 .data = of_fixed_factor_clk_setup,
571 },
572 {
573 .compatible = "st,nomadik-pll-clock",
574 .data = of_nomadik_pll_setup,
575 },
576 {
577 .compatible = "st,nomadik-hclk-clock",
578 .data = of_nomadik_hclk_setup,
579 },
580 {
581 .compatible = "st,nomadik-src-clock",
582 .data = of_nomadik_src_clk_setup,
583 },
584 { /* sentinel */ }
585};
586
587void __init nomadik_clk_init(void)
588{
589 nomadik_src_init();
590 of_clk_init(nomadik_src_clk_match);
591}
diff --git a/include/linux/platform_data/clk-nomadik.h b/include/linux/platform_data/clk-nomadik.h
deleted file mode 100644
index 5713c87b2477..000000000000
--- a/include/linux/platform_data/clk-nomadik.h
+++ /dev/null
@@ -1,2 +0,0 @@
1/* Minimal platform data header */
2void nomadik_clk_init(void);