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

Commit 23b2db44 authored by Ram Chandrasekar's avatar Ram Chandrasekar
Browse files

drivers: thermal: cpu_cooling: Use platform ops callback for min state



CPU cooling device notifies the cpufreq driver if it has a new min
frequency floor request. CPU cooling device right now ignores the
platform specific callback to set the min state.

Use the platform specific min frequency callback to place the min
frequency request.

Change-Id: I5c62ec27db325bc59b557e690f678dcfe987c355
Signed-off-by: default avatarRam Chandrasekar <rkumbako@codeaurora.org>
parent 04e66676
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;
}