diff options
| author | Tomeu Vizoso <tomeu.vizoso@collabora.com> | 2015-03-17 05:36:14 -0400 |
|---|---|---|
| committer | MyungJoo Ham <myungjoo.ham@samsung.com> | 2015-03-31 00:17:13 -0400 |
| commit | c70eea739f5e765b5d6aadf9621cbdeb024dfbd6 (patch) | |
| tree | 1393dcd85f821cb1916bf8ea35b1d08de9df1916 /drivers/devfreq | |
| parent | 11573e9132ae40239195fe5162d48caf2b7d85bb (diff) | |
PM / devfreq: tegra: Use clock rate constraints
Now that we have per-user clocks and the possibility to set constraints
in a clock, set a floor constraint on the EMC clock.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'drivers/devfreq')
| -rw-r--r-- | drivers/devfreq/tegra-devfreq.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/devfreq/tegra-devfreq.c b/drivers/devfreq/tegra-devfreq.c index d2f4d5ecaefd..ea6158bb76fa 100644 --- a/drivers/devfreq/tegra-devfreq.c +++ b/drivers/devfreq/tegra-devfreq.c | |||
| @@ -497,10 +497,8 @@ static int tegra_devfreq_target(struct device *dev, unsigned long *freq, | |||
| 497 | rate = dev_pm_opp_get_freq(opp); | 497 | rate = dev_pm_opp_get_freq(opp); |
| 498 | rcu_read_unlock(); | 498 | rcu_read_unlock(); |
| 499 | 499 | ||
| 500 | /* TODO: Once we have per-user clk constraints, set a floor */ | 500 | clk_set_min_rate(tegra->emc_clock, rate); |
| 501 | clk_set_rate(tegra->emc_clock, rate); | 501 | clk_set_rate(tegra->emc_clock, 0); |
| 502 | |||
| 503 | /* TODO: Set voltage as well */ | ||
| 504 | 502 | ||
| 505 | return 0; | 503 | return 0; |
| 506 | } | 504 | } |
| @@ -619,7 +617,6 @@ static int tegra_devfreq_probe(struct platform_device *pdev) | |||
| 619 | struct tegra_devfreq *tegra; | 617 | struct tegra_devfreq *tegra; |
| 620 | struct tegra_devfreq_device *dev; | 618 | struct tegra_devfreq_device *dev; |
| 621 | struct resource *res; | 619 | struct resource *res; |
| 622 | unsigned long max_freq; | ||
| 623 | unsigned int i; | 620 | unsigned int i; |
| 624 | int irq; | 621 | int irq; |
| 625 | int err; | 622 | int err; |
| @@ -658,6 +655,8 @@ static int tegra_devfreq_probe(struct platform_device *pdev) | |||
| 658 | return err; | 655 | return err; |
| 659 | } | 656 | } |
| 660 | 657 | ||
| 658 | clk_set_rate(tegra->emc_clock, ULONG_MAX); | ||
| 659 | |||
| 661 | tegra->rate_change_nb.notifier_call = tegra_actmon_rate_notify_cb; | 660 | tegra->rate_change_nb.notifier_call = tegra_actmon_rate_notify_cb; |
| 662 | err = clk_notifier_register(tegra->emc_clock, &tegra->rate_change_nb); | 661 | err = clk_notifier_register(tegra->emc_clock, &tegra->rate_change_nb); |
| 663 | if (err) { | 662 | if (err) { |
| @@ -677,11 +676,7 @@ static int tegra_devfreq_probe(struct platform_device *pdev) | |||
| 677 | 676 | ||
| 678 | reset_control_deassert(tegra->reset); | 677 | reset_control_deassert(tegra->reset); |
| 679 | 678 | ||
| 680 | max_freq = clk_round_rate(tegra->emc_clock, ULONG_MAX); | 679 | tegra->max_freq = clk_round_rate(tegra->emc_clock, ULONG_MAX) / KHZ; |
| 681 | tegra->max_freq = max_freq / KHZ; | ||
| 682 | |||
| 683 | clk_set_rate(tegra->emc_clock, max_freq); | ||
| 684 | |||
| 685 | tegra->cur_freq = clk_get_rate(tegra->emc_clock) / KHZ; | 680 | tegra->cur_freq = clk_get_rate(tegra->emc_clock) / KHZ; |
| 686 | 681 | ||
| 687 | actmon_writel(tegra, ACTMON_SAMPLING_PERIOD - 1, | 682 | actmon_writel(tegra, ACTMON_SAMPLING_PERIOD - 1, |
