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

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

Merge "clk: qcom: clk-cpu-osm: Add the fast_switch cpufreq callback"

parents 2f1b1d2a 49514829
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -535,6 +535,21 @@ osm_cpufreq_target_index(struct cpufreq_policy *policy, unsigned int index)
	return 0;
}

static unsigned int
osm_cpufreq_fast_switch(struct cpufreq_policy *policy, unsigned int target_freq)
{
	int index;

	index = cpufreq_frequency_table_target(policy, target_freq,
							CPUFREQ_RELATION_L);
	if (index < 0)
		return 0;

	osm_cpufreq_target_index(policy, index);

	return policy->freq_table[index].frequency;
}

static unsigned int osm_cpufreq_get(unsigned int cpu)
{
	struct cpufreq_policy *policy = cpufreq_cpu_get_raw(cpu);
@@ -616,6 +631,7 @@ static int osm_cpufreq_cpu_init(struct cpufreq_policy *policy)
	}

	policy->dvfs_possible_from_any_cpu = true;
	policy->fast_switch_possible = true;
	policy->driver_data = c;
	return 0;

@@ -645,6 +661,7 @@ static struct cpufreq_driver qcom_osm_cpufreq_driver = {
	.get		= osm_cpufreq_get,
	.init		= osm_cpufreq_cpu_init,
	.exit		= osm_cpufreq_cpu_exit,
	.fast_switch	= osm_cpufreq_fast_switch,
	.name		= "osm-cpufreq",
	.attr		= osm_cpufreq_attr,
	.boost_enabled	= true,