Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e56d42df authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drivers: thermal: cpu_cooling: Use platform ops callback for min state" into msm-4.9

parents f0b609e2 23b2db44
Loading
Loading
Loading
Loading
+21 −3
Original line number Diff line number Diff line
@@ -548,11 +548,29 @@ static int cpufreq_set_min_state(struct thermal_cooling_device *cdev,
	if (cpufreq_device->cpufreq_floor_state == state)
		return 0;

	floor_freq = cpufreq_device->freq_table[state];
	cpufreq_device->cpufreq_floor_state = state;
	cpufreq_device->floor_freq = floor_freq;

	/*
	 * Check if the device has a platform mitigation function that
	 * can handle the CPU freq mitigation, if not, notify cpufreq
	 * framework.
	 */
	if (cpufreq_device->plat_ops &&
		cpufreq_device->plat_ops->floor_limit) {
		/*
		 * Last level is core isolation so use the frequency
		 * of previous state.
		 */
		if (state == cpufreq_device->max_level)
			state--;
		floor_freq = cpufreq_device->freq_table[state];
		cpufreq_device->floor_freq = floor_freq;
		cpufreq_device->plat_ops->floor_limit(cpu, floor_freq);
	} else {
		floor_freq = cpufreq_device->freq_table[state];
		cpufreq_device->floor_freq = floor_freq;
		cpufreq_update_policy(cpu);
	}

	return 0;
}