Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235255
b: refs/heads/master
c: 1be3d05
h: refs/heads/master
i:
  235253: 6b5aa90
  235251: 90ebd78
  235247: 2a2f600
v: v3
  • Loading branch information
Colin Cross committed Feb 22, 2011
1 parent fe9fe5a commit d67cbde
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 421186e71000c067c2687baeffde62954a80cdcc
refs/heads/master: 1be3d0537516fa42825406b4bc1291b77ed62614
25 changes: 25 additions & 0 deletions trunk/arch/arm/mach-tegra/tegra2_clocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,9 +946,14 @@ static void tegra2_periph_clk_init(struct clk *c)
}

c->state = ON;

if (!c->u.periph.clk_num)
return;

if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) &
PERIPH_CLK_TO_ENB_BIT(c)))
c->state = OFF;

if (!(c->flags & PERIPH_NO_RESET))
if (clk_readl(RST_DEVICES + PERIPH_CLK_TO_ENB_REG(c)) &
PERIPH_CLK_TO_ENB_BIT(c))
Expand All @@ -962,6 +967,9 @@ static int tegra2_periph_clk_enable(struct clk *c)
int refcount;
pr_debug("%s on clock %s\n", __func__, c->name);

if (!c->u.periph.clk_num)
return 0;

spin_lock_irqsave(&clock_register_lock, flags);

refcount = tegra_periph_clk_enable_refcount[c->u.periph.clk_num]++;
Expand Down Expand Up @@ -994,6 +1002,9 @@ static void tegra2_periph_clk_disable(struct clk *c)

pr_debug("%s on clock %s\n", __func__, c->name);

if (!c->u.periph.clk_num)
return;

spin_lock_irqsave(&clock_register_lock, flags);

if (c->refcnt)
Expand All @@ -1012,6 +1023,9 @@ static void tegra2_periph_clk_reset(struct clk *c, bool assert)

pr_debug("%s %s on clock %s\n", __func__,
assert ? "assert" : "deassert", c->name);

BUG_ON(!c->u.periph.clk_num);

if (!(c->flags & PERIPH_NO_RESET))
clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
base + PERIPH_CLK_TO_ENB_SET_REG(c));
Expand Down Expand Up @@ -1182,6 +1196,10 @@ static void tegra2_clk_double_init(struct clk *c)
c->mul = 2;
c->div = 1;
c->state = ON;

if (!c->u.periph.clk_num)
return;

if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) &
PERIPH_CLK_TO_ENB_BIT(c)))
c->state = OFF;
Expand Down Expand Up @@ -1269,20 +1287,27 @@ static void tegra2_cdev_clk_init(struct clk *c)
/* We could un-tristate the cdev1 or cdev2 pingroup here; this is
* currently done in the pinmux code. */
c->state = ON;

BUG_ON(!c->u.periph.clk_num);

if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) &
PERIPH_CLK_TO_ENB_BIT(c)))
c->state = OFF;
}

static int tegra2_cdev_clk_enable(struct clk *c)
{
BUG_ON(!c->u.periph.clk_num);

clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
CLK_OUT_ENB_SET + PERIPH_CLK_TO_ENB_SET_REG(c));
return 0;
}

static void tegra2_cdev_clk_disable(struct clk *c)
{
BUG_ON(!c->u.periph.clk_num);

clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
CLK_OUT_ENB_CLR + PERIPH_CLK_TO_ENB_SET_REG(c));
}
Expand Down

0 comments on commit d67cbde

Please sign in to comment.