diff options
author | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2012-09-10 14:53:27 +0200 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2012-09-10 15:04:19 +0200 |
commit | d5bbf34613a877dbe3da847fa0432da8c6721e73 (patch) | |
tree | 902a90fd7eda61aad7abae9c35b0da2e7a786995 /arch/arm/mach-tegra/clock.c | |
parent | c6c1f7a2c194f1a2291a15c6691c0d6785f8976e (diff) | |
parent | 336961dd3cf9c39456dd9657e8f205718740c797 (diff) |
Merge branch 'l4t/l4t-r16' into colibri
Merge with latest NVIDIA L4T R16.
Only real conflict concerning inverted VBUS gpio support.
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) |