aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-omap1/clock.c6
-rw-r--r--arch/arm/mach-omap2/clock.c6
-rw-r--r--arch/arm/mach-omap2/clock24xx.c6
-rw-r--r--arch/arm/mach-omap2/clock24xx.h4
-rw-r--r--arch/arm/mach-omap2/clock34xx.c5
-rw-r--r--arch/arm/mach-omap2/clock34xx.h10
-rw-r--r--arch/arm/plat-omap/clock.c14
7 files changed, 11 insertions, 40 deletions
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 80a58e9dbba3..be500014dcb8 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -244,9 +244,6 @@ static void omap1_ckctl_recalc(struct clk * clk)
244 if (unlikely(clk->rate == clk->parent->rate / dsor)) 244 if (unlikely(clk->rate == clk->parent->rate / dsor))
245 return; /* No change, quick exit */ 245 return; /* No change, quick exit */
246 clk->rate = clk->parent->rate / dsor; 246 clk->rate = clk->parent->rate / dsor;
247
248 if (unlikely(clk->flags & RATE_PROPAGATES))
249 propagate_rate(clk);
250} 247}
251 248
252static void omap1_ckctl_recalc_dsp_domain(struct clk * clk) 249static void omap1_ckctl_recalc_dsp_domain(struct clk * clk)
@@ -267,9 +264,6 @@ static void omap1_ckctl_recalc_dsp_domain(struct clk * clk)
267 if (unlikely(clk->rate == clk->parent->rate / dsor)) 264 if (unlikely(clk->rate == clk->parent->rate / dsor))
268 return; /* No change, quick exit */ 265 return; /* No change, quick exit */
269 clk->rate = clk->parent->rate / dsor; 266 clk->rate = clk->parent->rate / dsor;
270
271 if (unlikely(clk->flags & RATE_PROPAGATES))
272 propagate_rate(clk);
273} 267}
274 268
275/* MPU virtual clock functions */ 269/* MPU virtual clock functions */
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 7a1d56af9e47..53fda9977d55 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -167,9 +167,6 @@ void omap2_fixed_divisor_recalc(struct clk *clk)
167 WARN_ON(!clk->fixed_div); 167 WARN_ON(!clk->fixed_div);
168 168
169 clk->rate = clk->parent->rate / clk->fixed_div; 169 clk->rate = clk->parent->rate / clk->fixed_div;
170
171 if (clk->flags & RATE_PROPAGATES)
172 propagate_rate(clk);
173} 170}
174 171
175/** 172/**
@@ -392,9 +389,6 @@ void omap2_clksel_recalc(struct clk *clk)
392 clk->rate = clk->parent->rate / div; 389 clk->rate = clk->parent->rate / div;
393 390
394 pr_debug("clock: new clock rate is %ld (div %d)\n", clk->rate, div); 391 pr_debug("clock: new clock rate is %ld (div %d)\n", clk->rate, div);
395
396 if (unlikely(clk->flags & RATE_PROPAGATES))
397 propagate_rate(clk);
398} 392}
399 393
400/** 394/**
diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
index 866a618c4d8d..3a0a1b8aa0bb 100644
--- a/arch/arm/mach-omap2/clock24xx.c
+++ b/arch/arm/mach-omap2/clock24xx.c
@@ -199,8 +199,6 @@ long omap2_dpllcore_round_rate(unsigned long target_rate)
199static void omap2_dpllcore_recalc(struct clk *clk) 199static void omap2_dpllcore_recalc(struct clk *clk)
200{ 200{
201 clk->rate = omap2_get_dpll_rate_24xx(clk); 201 clk->rate = omap2_get_dpll_rate_24xx(clk);
202
203 propagate_rate(clk);
204} 202}
205 203
206static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate) 204static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate)
@@ -442,13 +440,11 @@ static u32 omap2_get_sysclkdiv(void)
442static void omap2_osc_clk_recalc(struct clk *clk) 440static void omap2_osc_clk_recalc(struct clk *clk)
443{ 441{
444 clk->rate = omap2_get_apll_clkin() * omap2_get_sysclkdiv(); 442 clk->rate = omap2_get_apll_clkin() * omap2_get_sysclkdiv();
445 propagate_rate(clk);
446} 443}
447 444
448static void omap2_sys_clk_recalc(struct clk *clk) 445static void omap2_sys_clk_recalc(struct clk *clk)
449{ 446{
450 clk->rate = clk->parent->rate / omap2_get_sysclkdiv(); 447 clk->rate = clk->parent->rate / omap2_get_sysclkdiv();
451 propagate_rate(clk);
452} 448}
453 449
454/* 450/*
@@ -502,7 +498,9 @@ int __init omap2_clk_init(void)
502 clk_init(&omap2_clk_functions); 498 clk_init(&omap2_clk_functions);
503 499
504 omap2_osc_clk_recalc(&osc_ck); 500 omap2_osc_clk_recalc(&osc_ck);
501 propagate_rate(&osc_ck);
505 omap2_sys_clk_recalc(&sys_ck); 502 omap2_sys_clk_recalc(&sys_ck);
503 propagate_rate(&sys_ck);
506 504
507 for (clkp = onchip_24xx_clks; 505 for (clkp = onchip_24xx_clks;
508 clkp < onchip_24xx_clks + ARRAY_SIZE(onchip_24xx_clks); 506 clkp < onchip_24xx_clks + ARRAY_SIZE(onchip_24xx_clks);
diff --git a/arch/arm/mach-omap2/clock24xx.h b/arch/arm/mach-omap2/clock24xx.h
index 486fd80143e4..e07dcba4b3e9 100644
--- a/arch/arm/mach-omap2/clock24xx.h
+++ b/arch/arm/mach-omap2/clock24xx.h
@@ -624,7 +624,6 @@ static struct clk func_32k_ck = {
624 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 624 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
625 RATE_FIXED | RATE_PROPAGATES, 625 RATE_FIXED | RATE_PROPAGATES,
626 .clkdm_name = "wkup_clkdm", 626 .clkdm_name = "wkup_clkdm",
627 .recalc = &propagate_rate,
628}; 627};
629 628
630/* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */ 629/* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */
@@ -655,7 +654,6 @@ static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */
655 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 654 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
656 RATE_FIXED | RATE_PROPAGATES, 655 RATE_FIXED | RATE_PROPAGATES,
657 .clkdm_name = "wkup_clkdm", 656 .clkdm_name = "wkup_clkdm",
658 .recalc = &propagate_rate,
659}; 657};
660 658
661/* 659/*
@@ -702,7 +700,6 @@ static struct clk apll96_ck = {
702 .clkdm_name = "wkup_clkdm", 700 .clkdm_name = "wkup_clkdm",
703 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), 701 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
704 .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT, 702 .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT,
705 .recalc = &propagate_rate,
706}; 703};
707 704
708static struct clk apll54_ck = { 705static struct clk apll54_ck = {
@@ -715,7 +712,6 @@ static struct clk apll54_ck = {
715 .clkdm_name = "wkup_clkdm", 712 .clkdm_name = "wkup_clkdm",
716 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), 713 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
717 .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT, 714 .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT,
718 .recalc = &propagate_rate,
719}; 715};
720 716
721/* 717/*
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index 2f2d43db2dd8..52698fb4fd04 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -57,8 +57,6 @@ static const struct clkops clkops_noncore_dpll_ops;
57static void omap3_dpll_recalc(struct clk *clk) 57static void omap3_dpll_recalc(struct clk *clk)
58{ 58{
59 clk->rate = omap2_get_dpll_rate(clk); 59 clk->rate = omap2_get_dpll_rate(clk);
60
61 propagate_rate(clk);
62} 60}
63 61
64/* _omap3_dpll_write_clken - write clken_bits arg to a DPLL's enable bits */ 62/* _omap3_dpll_write_clken - write clken_bits arg to a DPLL's enable bits */
@@ -388,9 +386,6 @@ static void omap3_clkoutx2_recalc(struct clk *clk)
388 clk->rate = clk->parent->rate; 386 clk->rate = clk->parent->rate;
389 else 387 else
390 clk->rate = clk->parent->rate * 2; 388 clk->rate = clk->parent->rate * 2;
391
392 if (clk->flags & RATE_PROPAGATES)
393 propagate_rate(clk);
394} 389}
395 390
396/* Common clock code */ 391/* Common clock code */
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h
index 335ef88ada55..dcacec84f8ca 100644
--- a/arch/arm/mach-omap2/clock34xx.h
+++ b/arch/arm/mach-omap2/clock34xx.h
@@ -58,7 +58,6 @@ static struct clk omap_32k_fck = {
58 .ops = &clkops_null, 58 .ops = &clkops_null,
59 .rate = 32768, 59 .rate = 32768,
60 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES, 60 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES,
61 .recalc = &propagate_rate,
62}; 61};
63 62
64static struct clk secure_32k_fck = { 63static struct clk secure_32k_fck = {
@@ -66,7 +65,6 @@ static struct clk secure_32k_fck = {
66 .ops = &clkops_null, 65 .ops = &clkops_null,
67 .rate = 32768, 66 .rate = 32768,
68 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES, 67 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES,
69 .recalc = &propagate_rate,
70}; 68};
71 69
72/* Virtual source clocks for osc_sys_ck */ 70/* Virtual source clocks for osc_sys_ck */
@@ -75,7 +73,6 @@ static struct clk virt_12m_ck = {
75 .ops = &clkops_null, 73 .ops = &clkops_null,
76 .rate = 12000000, 74 .rate = 12000000,
77 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES, 75 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES,
78 .recalc = &propagate_rate,
79}; 76};
80 77
81static struct clk virt_13m_ck = { 78static struct clk virt_13m_ck = {
@@ -83,7 +80,6 @@ static struct clk virt_13m_ck = {
83 .ops = &clkops_null, 80 .ops = &clkops_null,
84 .rate = 13000000, 81 .rate = 13000000,
85 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES, 82 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES,
86 .recalc = &propagate_rate,
87}; 83};
88 84
89static struct clk virt_16_8m_ck = { 85static struct clk virt_16_8m_ck = {
@@ -91,7 +87,6 @@ static struct clk virt_16_8m_ck = {
91 .ops = &clkops_null, 87 .ops = &clkops_null,
92 .rate = 16800000, 88 .rate = 16800000,
93 .flags = CLOCK_IN_OMAP3430ES2 | RATE_FIXED | RATE_PROPAGATES, 89 .flags = CLOCK_IN_OMAP3430ES2 | RATE_FIXED | RATE_PROPAGATES,
94 .recalc = &propagate_rate,
95}; 90};
96 91
97static struct clk virt_19_2m_ck = { 92static struct clk virt_19_2m_ck = {
@@ -99,7 +94,6 @@ static struct clk virt_19_2m_ck = {
99 .ops = &clkops_null, 94 .ops = &clkops_null,
100 .rate = 19200000, 95 .rate = 19200000,
101 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES, 96 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES,
102 .recalc = &propagate_rate,
103}; 97};
104 98
105static struct clk virt_26m_ck = { 99static struct clk virt_26m_ck = {
@@ -107,7 +101,6 @@ static struct clk virt_26m_ck = {
107 .ops = &clkops_null, 101 .ops = &clkops_null,
108 .rate = 26000000, 102 .rate = 26000000,
109 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES, 103 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES,
110 .recalc = &propagate_rate,
111}; 104};
112 105
113static struct clk virt_38_4m_ck = { 106static struct clk virt_38_4m_ck = {
@@ -115,7 +108,6 @@ static struct clk virt_38_4m_ck = {
115 .ops = &clkops_null, 108 .ops = &clkops_null,
116 .rate = 38400000, 109 .rate = 38400000,
117 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES, 110 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES,
118 .recalc = &propagate_rate,
119}; 111};
120 112
121static const struct clksel_rate osc_sys_12m_rates[] = { 113static const struct clksel_rate osc_sys_12m_rates[] = {
@@ -201,7 +193,6 @@ static struct clk sys_altclk = {
201 .name = "sys_altclk", 193 .name = "sys_altclk",
202 .ops = &clkops_null, 194 .ops = &clkops_null,
203 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES, 195 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES,
204 .recalc = &propagate_rate,
205}; 196};
206 197
207/* Optional external clock input for some McBSPs */ 198/* Optional external clock input for some McBSPs */
@@ -209,7 +200,6 @@ static struct clk mcbsp_clks = {
209 .name = "mcbsp_clks", 200 .name = "mcbsp_clks",
210 .ops = &clkops_null, 201 .ops = &clkops_null,
211 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES, 202 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES,
212 .recalc = &propagate_rate,
213}; 203};
214 204
215/* PRM EXTERNAL CLOCK OUTPUT */ 205/* PRM EXTERNAL CLOCK OUTPUT */
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index b7137c560db4..df58f5d9a5ab 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -246,8 +246,6 @@ void followparent_recalc(struct clk *clk)
246 return; 246 return;
247 247
248 clk->rate = clk->parent->rate; 248 clk->rate = clk->parent->rate;
249 if (unlikely(clk->flags & RATE_PROPAGATES))
250 propagate_rate(clk);
251} 249}
252 250
253/* Propagate rate to children */ 251/* Propagate rate to children */
@@ -261,8 +259,10 @@ void propagate_rate(struct clk * tclk)
261 list_for_each_entry(clkp, &clocks, node) { 259 list_for_each_entry(clkp, &clocks, node) {
262 if (likely(clkp->parent != tclk)) 260 if (likely(clkp->parent != tclk))
263 continue; 261 continue;
264 if (likely((u32)clkp->recalc)) 262 if (clkp->recalc)
265 clkp->recalc(clkp); 263 clkp->recalc(clkp);
264 if (clkp->flags & RATE_PROPAGATES)
265 propagate_rate(clkp);
266 } 266 }
267} 267}
268 268
@@ -278,8 +278,12 @@ void recalculate_root_clocks(void)
278 struct clk *clkp; 278 struct clk *clkp;
279 279
280 list_for_each_entry(clkp, &clocks, node) { 280 list_for_each_entry(clkp, &clocks, node) {
281 if (unlikely(!clkp->parent) && likely((u32)clkp->recalc)) 281 if (!clkp->parent) {
282 clkp->recalc(clkp); 282 if (clkp->recalc)
283 clkp->recalc(clkp);
284 if (clkp->flags & RATE_PROPAGATES)
285 propagate_rate(clkp);
286 }
283 } 287 }
284} 288}
285 289