Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184646
b: refs/heads/master
c: 4b1f76e
h: refs/heads/master
v: v3
  • Loading branch information
Paul Walmsley committed Jan 27, 2010
1 parent eaf2d8e commit 8c46a61
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 43 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: df791b3ebf181b3eece9c770565fcf0844bbd7cb
refs/heads/master: 4b1f76ed4f8012929494261eb6923b3c98554a9a
88 changes: 46 additions & 42 deletions trunk/arch/arm/mach-omap2/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,51 @@ u8 cpu_mask;
* OMAP2/3/4 specific clock functions
*-------------------------------------------------------------------------*/

/* Private functions */

/**
* _omap2_module_wait_ready - wait for an OMAP module to leave IDLE
* @clk: struct clk * belonging to the module
*
* If the necessary clocks for the OMAP hardware IP block that
* corresponds to clock @clk are enabled, then wait for the module to
* indicate readiness (i.e., to leave IDLE). This code does not
* belong in the clock code and will be moved in the medium term to
* module-dependent code. No return value.
*/
static void _omap2_module_wait_ready(struct clk *clk)
{
void __iomem *companion_reg, *idlest_reg;
u8 other_bit, idlest_bit;

/* Not all modules have multiple clocks that their IDLEST depends on */
if (clk->ops->find_companion) {
clk->ops->find_companion(clk, &companion_reg, &other_bit);
if (!(__raw_readl(companion_reg) & (1 << other_bit)))
return;
}

clk->ops->find_idlest(clk, &idlest_reg, &idlest_bit);

omap2_cm_wait_idlest(idlest_reg, (1 << idlest_bit), clk->name);
}

/* 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);
}

/* Public functions */

/**
* omap2xxx_clk_commit - commit clock parent/rate changes in hardware
* @clk: struct clk *
Expand Down Expand Up @@ -149,33 +194,6 @@ void omap2_clk_dflt_find_idlest(struct clk *clk, void __iomem **idlest_reg,
*idlest_bit = clk->enable_bit;
}

/**
* omap2_module_wait_ready - wait for an OMAP module to leave IDLE
* @clk: struct clk * belonging to the module
*
* If the necessary clocks for the OMAP hardware IP block that
* corresponds to clock @clk are enabled, then wait for the module to
* indicate readiness (i.e., to leave IDLE). This code does not
* belong in the clock code and will be moved in the medium term to
* module-dependent code. No return value.
*/
static void omap2_module_wait_ready(struct clk *clk)
{
void __iomem *companion_reg, *idlest_reg;
u8 other_bit, idlest_bit;

/* Not all modules have multiple clocks that their IDLEST depends on */
if (clk->ops->find_companion) {
clk->ops->find_companion(clk, &companion_reg, &other_bit);
if (!(__raw_readl(companion_reg) & (1 << other_bit)))
return;
}

clk->ops->find_idlest(clk, &idlest_reg, &idlest_bit);

omap2_cm_wait_idlest(idlest_reg, (1 << idlest_bit), clk->name);
}

int omap2_dflt_clk_enable(struct clk *clk)
{
u32 v;
Expand All @@ -195,7 +213,7 @@ int omap2_dflt_clk_enable(struct clk *clk)
v = __raw_readl(clk->enable_reg); /* OCP barrier */

if (clk->ops->find_idlest)
omap2_module_wait_ready(clk);
_omap2_module_wait_ready(clk);

return 0;
}
Expand Down Expand Up @@ -235,20 +253,6 @@ const struct clkops clkops_omap2_dflt = {
.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)
{
if (clk->usecount > 0 && !(--clk->usecount)) {
Expand Down

0 comments on commit 8c46a61

Please sign in to comment.