diff options
Diffstat (limited to 'arch/arm/mach-tegra/clock.c')
-rw-r--r-- | arch/arm/mach-tegra/clock.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c index f31da0bf1494..66a954fb6696 100644 --- a/arch/arm/mach-tegra/clock.c +++ b/arch/arm/mach-tegra/clock.c @@ -238,16 +238,9 @@ void clk_init(struct clk *c) static int clk_enable_locked(struct clk *c) { int ret = 0; - int rate = clk_get_rate_locked(c); - bool set_rate = false; - - if (rate > c->max_rate) { - rate = c->max_rate; - set_rate = true; - } if (clk_is_auto_dvfs(c)) { - ret = tegra_dvfs_set_rate(c, rate); + ret = tegra_dvfs_set_rate(c, clk_get_rate_locked(c)); if (ret) return ret; } @@ -259,9 +252,6 @@ static int clk_enable_locked(struct clk *c) return ret; } - if (set_rate) - clk_set_rate_locked(c, rate); - if (c->ops && c->ops->enable) { ret = c->ops->enable(c); trace_clock_enable(c->name, 1, 0); @@ -525,13 +515,11 @@ unsigned long clk_get_rate_all_locked(struct clk *c) return rate; } -long clk_round_rate(struct clk *c, unsigned long rate) +long clk_round_rate_locked(struct clk *c, unsigned long rate) { - unsigned long flags, max_rate; + unsigned long max_rate; long ret; - clk_lock_save(c, &flags); - if (!c->ops || !c->ops->round_rate) { ret = -ENOSYS; goto out; @@ -544,6 +532,16 @@ long clk_round_rate(struct clk *c, unsigned long rate) ret = c->ops->round_rate(c, rate); out: + return ret; +} + +long clk_round_rate(struct clk *c, unsigned long rate) +{ + unsigned long flags; + long ret; + + clk_lock_save(c, &flags); + ret = clk_round_rate_locked(c, rate); clk_unlock_restore(c, &flags); return ret; } @@ -1299,6 +1297,10 @@ static int clk_debugfs_register_one(struct clk *c) if (!d) goto err_out; + d = debugfs_create_u32("min", S_IRUGO, c->dent, (u32 *)&c->min_rate); + if (!d) + goto err_out; + d = debugfs_create_file( "parent", parent_rate_mode, c->dent, c, &parent_fops); if (!d) |