ARM: OMAP: 1/4 Fix clock framework to use clk_enable/disable
This patch fixes OMAP clock framework to use clk_enable/disable instead of clk_use/unuse as specified in include/linux/clk.h. Instances of clk_use/unuse are renamed to clk_enable/disable, and references clk_use/unuse are removed. Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:
@@ -34,7 +34,7 @@ DEFINE_SPINLOCK(clockfw_lock);
|
|||||||
static struct clk_functions *arch_clock;
|
static struct clk_functions *arch_clock;
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
* Standard clock functions defined in asm/hardware/clock.h
|
* Standard clock functions defined in include/linux/clk.h
|
||||||
*-------------------------------------------------------------------------*/
|
*-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
struct clk * clk_get(struct device *dev, const char *id)
|
struct clk * clk_get(struct device *dev, const char *id)
|
||||||
@@ -60,12 +60,8 @@ int clk_enable(struct clk *clk)
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
spin_lock_irqsave(&clockfw_lock, flags);
|
spin_lock_irqsave(&clockfw_lock, flags);
|
||||||
if (clk->enable)
|
if (arch_clock->clk_enable)
|
||||||
ret = clk->enable(clk);
|
|
||||||
else if (arch_clock->clk_enable)
|
|
||||||
ret = arch_clock->clk_enable(clk);
|
ret = arch_clock->clk_enable(clk);
|
||||||
else
|
|
||||||
printk(KERN_ERR "Could not enable clock %s\n", clk->name);
|
|
||||||
spin_unlock_irqrestore(&clockfw_lock, flags);
|
spin_unlock_irqrestore(&clockfw_lock, flags);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@@ -77,41 +73,12 @@ void clk_disable(struct clk *clk)
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
spin_lock_irqsave(&clockfw_lock, flags);
|
spin_lock_irqsave(&clockfw_lock, flags);
|
||||||
if (clk->disable)
|
if (arch_clock->clk_disable)
|
||||||
clk->disable(clk);
|
|
||||||
else if (arch_clock->clk_disable)
|
|
||||||
arch_clock->clk_disable(clk);
|
arch_clock->clk_disable(clk);
|
||||||
else
|
|
||||||
printk(KERN_ERR "Could not disable clock %s\n", clk->name);
|
|
||||||
spin_unlock_irqrestore(&clockfw_lock, flags);
|
spin_unlock_irqrestore(&clockfw_lock, flags);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(clk_disable);
|
EXPORT_SYMBOL(clk_disable);
|
||||||
|
|
||||||
int clk_use(struct clk *clk)
|
|
||||||
{
|
|
||||||
unsigned long flags;
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
spin_lock_irqsave(&clockfw_lock, flags);
|
|
||||||
if (arch_clock->clk_use)
|
|
||||||
ret = arch_clock->clk_use(clk);
|
|
||||||
spin_unlock_irqrestore(&clockfw_lock, flags);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(clk_use);
|
|
||||||
|
|
||||||
void clk_unuse(struct clk *clk)
|
|
||||||
{
|
|
||||||
unsigned long flags;
|
|
||||||
|
|
||||||
spin_lock_irqsave(&clockfw_lock, flags);
|
|
||||||
if (arch_clock->clk_unuse)
|
|
||||||
arch_clock->clk_unuse(clk);
|
|
||||||
spin_unlock_irqrestore(&clockfw_lock, flags);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(clk_unuse);
|
|
||||||
|
|
||||||
int clk_get_usecount(struct clk *clk)
|
int clk_get_usecount(struct clk *clk)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
@@ -146,7 +113,7 @@ void clk_put(struct clk *clk)
|
|||||||
EXPORT_SYMBOL(clk_put);
|
EXPORT_SYMBOL(clk_put);
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
* Optional clock functions defined in asm/hardware/clock.h
|
* Optional clock functions defined in include/linux/clk.h
|
||||||
*-------------------------------------------------------------------------*/
|
*-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
long clk_round_rate(struct clk *clk, unsigned long rate)
|
long clk_round_rate(struct clk *clk, unsigned long rate)
|
||||||
|
@@ -38,8 +38,6 @@ struct clk {
|
|||||||
struct clk_functions {
|
struct clk_functions {
|
||||||
int (*clk_enable)(struct clk *clk);
|
int (*clk_enable)(struct clk *clk);
|
||||||
void (*clk_disable)(struct clk *clk);
|
void (*clk_disable)(struct clk *clk);
|
||||||
int (*clk_use)(struct clk *clk);
|
|
||||||
void (*clk_unuse)(struct clk *clk);
|
|
||||||
long (*clk_round_rate)(struct clk *clk, unsigned long rate);
|
long (*clk_round_rate)(struct clk *clk, unsigned long rate);
|
||||||
int (*clk_set_rate)(struct clk *clk, unsigned long rate);
|
int (*clk_set_rate)(struct clk *clk, unsigned long rate);
|
||||||
int (*clk_set_parent)(struct clk *clk, struct clk *parent);
|
int (*clk_set_parent)(struct clk *clk, struct clk *parent);
|
||||||
|
Reference in New Issue
Block a user