提交 c70eea73 编写于 作者: T Tomeu Vizoso 提交者: MyungJoo Ham

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: NTomeu Vizoso <tomeu.vizoso@collabora.com>
Acked-by: NMyungJoo Ham <myungjoo.ham@samsung.com>
上级 11573e91
无相关合并请求
...@@ -497,10 +497,8 @@ static int tegra_devfreq_target(struct device *dev, unsigned long *freq, ...@@ -497,10 +497,8 @@ static int tegra_devfreq_target(struct device *dev, unsigned long *freq,
rate = dev_pm_opp_get_freq(opp); rate = dev_pm_opp_get_freq(opp);
rcu_read_unlock(); rcu_read_unlock();
/* TODO: Once we have per-user clk constraints, set a floor */ clk_set_min_rate(tegra->emc_clock, rate);
clk_set_rate(tegra->emc_clock, rate); clk_set_rate(tegra->emc_clock, 0);
/* TODO: Set voltage as well */
return 0; return 0;
} }
...@@ -619,7 +617,6 @@ static int tegra_devfreq_probe(struct platform_device *pdev) ...@@ -619,7 +617,6 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
struct tegra_devfreq *tegra; struct tegra_devfreq *tegra;
struct tegra_devfreq_device *dev; struct tegra_devfreq_device *dev;
struct resource *res; struct resource *res;
unsigned long max_freq;
unsigned int i; unsigned int i;
int irq; int irq;
int err; int err;
...@@ -658,6 +655,8 @@ static int tegra_devfreq_probe(struct platform_device *pdev) ...@@ -658,6 +655,8 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
return err; return err;
} }
clk_set_rate(tegra->emc_clock, ULONG_MAX);
tegra->rate_change_nb.notifier_call = tegra_actmon_rate_notify_cb; tegra->rate_change_nb.notifier_call = tegra_actmon_rate_notify_cb;
err = clk_notifier_register(tegra->emc_clock, &tegra->rate_change_nb); err = clk_notifier_register(tegra->emc_clock, &tegra->rate_change_nb);
if (err) { if (err) {
...@@ -677,11 +676,7 @@ static int tegra_devfreq_probe(struct platform_device *pdev) ...@@ -677,11 +676,7 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
reset_control_deassert(tegra->reset); reset_control_deassert(tegra->reset);
max_freq = clk_round_rate(tegra->emc_clock, ULONG_MAX); tegra->max_freq = clk_round_rate(tegra->emc_clock, ULONG_MAX) / KHZ;
tegra->max_freq = max_freq / KHZ;
clk_set_rate(tegra->emc_clock, max_freq);
tegra->cur_freq = clk_get_rate(tegra->emc_clock) / KHZ; tegra->cur_freq = clk_get_rate(tegra->emc_clock) / KHZ;
actmon_writel(tegra, ACTMON_SAMPLING_PERIOD - 1, actmon_writel(tegra, ACTMON_SAMPLING_PERIOD - 1,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部