Commit b36ee724 authored by Russell King's avatar Russell King Committed by Russell King

[ARM] omap: add default .ops to all remaining OMAP2 clocks

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 57137181
...@@ -264,16 +264,10 @@ static void omap2_clk_wait_ready(struct clk *clk) ...@@ -264,16 +264,10 @@ static void omap2_clk_wait_ready(struct clk *clk)
omap2_wait_clock_ready(st_reg, bit, clk->name); omap2_wait_clock_ready(st_reg, bit, clk->name);
} }
/* Enables clock without considering parent dependencies or use count static int omap2_dflt_clk_enable_wait(struct clk *clk)
* REVISIT: Maybe change this to use clk->enable like on omap1?
*/
int _omap2_clk_enable(struct clk *clk)
{ {
u32 regval32; u32 regval32;
if (clk->ops && clk->ops->enable)
return clk->ops->enable(clk);
if (unlikely(clk->enable_reg == NULL)) { if (unlikely(clk->enable_reg == NULL)) {
printk(KERN_ERR "clock.c: Enable for %s without enable code\n", printk(KERN_ERR "clock.c: Enable for %s without enable code\n",
clk->name); clk->name);
...@@ -293,16 +287,10 @@ int _omap2_clk_enable(struct clk *clk) ...@@ -293,16 +287,10 @@ int _omap2_clk_enable(struct clk *clk)
return 0; return 0;
} }
/* Disables clock without considering parent dependencies or use count */ static void omap2_dflt_clk_disable(struct clk *clk)
void _omap2_clk_disable(struct clk *clk)
{ {
u32 regval32; u32 regval32;
if (clk->ops && clk->ops->disable) {
clk->ops->disable(clk);
return;
}
if (clk->enable_reg == NULL) { if (clk->enable_reg == NULL) {
/* /*
* 'Independent' here refers to a clock which is not * 'Independent' here refers to a clock which is not
...@@ -322,6 +310,25 @@ void _omap2_clk_disable(struct clk *clk) ...@@ -322,6 +310,25 @@ void _omap2_clk_disable(struct clk *clk)
wmb(); wmb();
} }
const struct clkops clkops_omap2_dflt_wait = {
.enable = omap2_dflt_clk_enable_wait,
.disable = omap2_dflt_clk_disable,
};
/* Enables clock without considering parent dependencies or use count
* REVISIT: Maybe change this to use clk->enable like on omap1?
*/
static int _omap2_clk_enable(struct clk *clk)
{
return clk->ops->enable(clk);
}
/* Disables clock without considering parent dependencies or use count */
static void _omap2_clk_disable(struct clk *clk)
{
clk->ops->disable(clk);
}
void omap2_clk_disable(struct clk *clk) void omap2_clk_disable(struct clk *clk)
{ {
if (clk->usecount > 0 && !(--clk->usecount)) { if (clk->usecount > 0 && !(--clk->usecount)) {
......
...@@ -51,6 +51,8 @@ u32 omap2_get_dpll_rate(struct clk *clk); ...@@ -51,6 +51,8 @@ u32 omap2_get_dpll_rate(struct clk *clk);
int omap2_wait_clock_ready(void __iomem *reg, u32 cval, const char *name); int omap2_wait_clock_ready(void __iomem *reg, u32 cval, const char *name);
void omap2_clk_prepare_for_reboot(void); void omap2_clk_prepare_for_reboot(void);
extern const struct clkops clkops_omap2_dflt_wait;
extern u8 cpu_mask; extern u8 cpu_mask;
/* clksel_rate data common to 24xx/343x */ /* clksel_rate data common to 24xx/343x */
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment