Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235235
b: refs/heads/master
c: 2b84cb4
h: refs/heads/master
i:
  235233: 0f24aac
  235231: 632b140
v: v3
  • Loading branch information
Dima Zavin authored and Colin Cross committed Feb 21, 2011
1 parent 8a3c2b3 commit 617eef1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 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: 375b19cd34ea9b1ab338deac20b4bd2c553bf57b
refs/heads/master: 2b84cb4faab698b1708ce841c554546b1c9b2261
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-tegra/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ struct clk_ops {
int (*set_parent)(struct clk *, struct clk *);
int (*set_rate)(struct clk *, unsigned long);
long (*round_rate)(struct clk *, unsigned long);
void (*reset)(struct clk *, bool);
};

enum clk_state {
Expand Down
29 changes: 18 additions & 11 deletions trunk/arch/arm/mach-tegra/tegra2_clocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,18 @@ static struct clk_ops tegra_clk_m_ops = {
.disable = tegra2_clk_m_disable,
};

void tegra2_periph_reset_assert(struct clk *c)
{
BUG_ON(!c->ops->reset);
c->ops->reset(c, true);
}

void tegra2_periph_reset_deassert(struct clk *c)
{
BUG_ON(!c->ops->reset);
c->ops->reset(c, false);
}

/* super clock functions */
/* "super clocks" on tegra have two-stage muxes and a clock skipping
* super divider. We will ignore the clock skipping divider, since we
Expand Down Expand Up @@ -895,23 +907,17 @@ static void tegra2_periph_clk_disable(struct clk *c)
CLK_OUT_ENB_CLR + PERIPH_CLK_TO_ENB_SET_REG(c));
}

void tegra2_periph_reset_deassert(struct clk *c)
static void tegra2_periph_clk_reset(struct clk *c, bool assert)
{
pr_debug("%s on clock %s\n", __func__, c->name);
if (!(c->flags & PERIPH_NO_RESET))
clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
RST_DEVICES_CLR + PERIPH_CLK_TO_ENB_SET_REG(c));
}
unsigned long base = assert ? RST_DEVICES_SET : RST_DEVICES_CLR;

void tegra2_periph_reset_assert(struct clk *c)
{
pr_debug("%s on clock %s\n", __func__, c->name);
pr_debug("%s %s on clock %s\n", __func__,
assert ? "assert" : "deassert", c->name);
if (!(c->flags & PERIPH_NO_RESET))
clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
RST_DEVICES_SET + PERIPH_CLK_TO_ENB_SET_REG(c));
base + PERIPH_CLK_TO_ENB_SET_REG(c));
}


static int tegra2_periph_clk_set_parent(struct clk *c, struct clk *p)
{
u32 val;
Expand Down Expand Up @@ -1002,6 +1008,7 @@ static struct clk_ops tegra_periph_clk_ops = {
.set_parent = &tegra2_periph_clk_set_parent,
.set_rate = &tegra2_periph_clk_set_rate,
.round_rate = &tegra2_periph_clk_round_rate,
.reset = &tegra2_periph_clk_reset,
};

/* Clock doubler ops */
Expand Down

0 comments on commit 617eef1

Please sign in to comment.