コード例 #1
0
void tegra_cpu_dvfs_alter(int edp_thermal_index, bool before_clk_update)
{
	bool enable = !edp_thermal_index;

	if (enable != before_clk_update) {
		int ret = tegra_dvfs_alt_freqs_set(cpu_dvfs, enable);
		WARN_ONCE(ret, "tegra dvfs: failed to set CPU alternative"
			       " frequency limits for cold temeperature\n");
	}
}
コード例 #2
0
void tegra_cpu_dvfs_alter(int edp_thermal_index, const cpumask_t *cpus,
			  bool before_clk_update)
{
	bool cpu_warm = !!edp_thermal_index;
	unsigned int n = cpumask_weight(cpus);
	unsigned long *alt_freqs = cpu_warm ?
		(n > 1 ? NULL : cpu_0_freqs) : cpu_cold_freqs;

	if (cpu_warm == before_clk_update) {
		int ret = tegra_dvfs_alt_freqs_set(cpu_dvfs, alt_freqs);
		WARN_ONCE(ret, "tegra dvfs: failed to update CPU alternative"
			       " frequency limits\n");
	}
}
コード例 #3
0
int tegra_cpu_dvfs_alter(int edp_thermal_index, const cpumask_t *cpus,
			  bool before_clk_update, int cpu_event)
{
	bool cpu_warm = !!edp_thermal_index;
	unsigned int n = cpumask_weight(cpus);
	unsigned long *alt_freqs = cpu_warm ? NULL : cpu_cold_freqs;

	if (cpu_event || (cpu_warm == before_clk_update)) {
		int ret = tegra_dvfs_alt_freqs_set(cpu_dvfs, alt_freqs);
		if (ret) {
			pr_err("tegra dvfs: failed to set alternative dvfs on "
			       "%u %s CPUs\n", n, cpu_warm ? "warm" : "cold");
			return ret;
		}
	}
	return 0;
}