aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJuha Yrjola <juha.yrjola@solidboot.com>2006-09-25 05:41:43 -0400
committerTony Lindgren <tony@atomide.com>2006-09-25 05:41:43 -0400
commitab0a2b9b9f536d860681dacbfb5784bd76e88a1e (patch)
tree88735e033544ec2836065fd3c39aa4ebbcbbb002 /arch
parent12583a70ac6b6641905e37fdd61a7f711fb4ce2b (diff)
ARM: OMAP: Add support for forcing osc_ck on
Some boards might use the oscillator clock for powering external peripherals. Add support for making sure osc_ck stays active even when trying to go to sleep. Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/clock.c18
-rw-r--r--arch/arm/mach-omap2/clock.h2
2 files changed, 19 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 302d5a796340..737aca4cff13 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -81,6 +81,14 @@ static void omap2_propagate_rate(struct clk * clk)
81 propagate_rate(clk); 81 propagate_rate(clk);
82} 82}
83 83
84static void omap2_set_osc_ck(int enable)
85{
86 if (enable)
87 PRCM_CLKSRC_CTRL &= ~(0x3 << 3);
88 else
89 PRCM_CLKSRC_CTRL |= 0x3 << 3;
90}
91
84/* Enable an APLL if off */ 92/* Enable an APLL if off */
85static void omap2_clk_fixed_enable(struct clk *clk) 93static void omap2_clk_fixed_enable(struct clk *clk)
86{ 94{
@@ -121,6 +129,11 @@ static int _omap2_clk_enable(struct clk * clk)
121 if (clk->flags & ALWAYS_ENABLED) 129 if (clk->flags & ALWAYS_ENABLED)
122 return 0; 130 return 0;
123 131
132 if (unlikely(clk == &osc_ck)) {
133 omap2_set_osc_ck(1);
134 return 0;
135 }
136
124 if (unlikely(clk->enable_reg == 0)) { 137 if (unlikely(clk->enable_reg == 0)) {
125 printk(KERN_ERR "clock.c: Enable for %s without enable code\n", 138 printk(KERN_ERR "clock.c: Enable for %s without enable code\n",
126 clk->name); 139 clk->name);
@@ -158,6 +171,11 @@ static void _omap2_clk_disable(struct clk *clk)
158{ 171{
159 u32 regval32; 172 u32 regval32;
160 173
174 if (unlikely(clk == &osc_ck)) {
175 omap2_set_osc_ck(0);
176 return;
177 }
178
161 if (clk->enable_reg == 0) 179 if (clk->enable_reg == 0)
162 return; 180 return;
163 181
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 2781dfbc5164..223152d9663f 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -560,7 +560,7 @@ static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */
560 .name = "osc_ck", 560 .name = "osc_ck",
561 .rate = 26000000, /* fixed up in clock init */ 561 .rate = 26000000, /* fixed up in clock init */
562 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 562 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
563 RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES, 563 RATE_FIXED | RATE_PROPAGATES,
564}; 564};
565 565
566/* With out modem likely 12MHz, with modem likely 13MHz */ 566/* With out modem likely 12MHz, with modem likely 13MHz */