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

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

Merge "cpufreq: Check current frequency in device driver"

parents 81db37da 492ff02a
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -1957,15 +1957,6 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
	pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n",
		 policy->cpu, target_freq, relation, old_target_freq);

	/*
	 * This might look like a redundant call as we are checking it again
	 * after finding index. But it is left intentionally for cases where
	 * exactly same freq is called again and so we can save on few function
	 * calls.
	 */
	if (target_freq == policy->cur)
		return 0;

	/* Save last value to restore later on errors */
	policy->restore_freq = policy->cur;

+15 −5
Original line number Diff line number Diff line
@@ -71,12 +71,15 @@ static int msm_cpufreq_target(struct cpufreq_policy *policy,
				unsigned int target_freq,
				unsigned int relation)
{
	int ret = -EFAULT;
	int ret = 0;
	int index;
	struct cpufreq_frequency_table *table;

	mutex_lock(&per_cpu(suspend_data, policy->cpu).suspend_mutex);

	if (target_freq == policy->cur)
		goto done;

	if (per_cpu(suspend_data, policy->cpu).device_suspended) {
		pr_debug("cpufreq: cpu%d scheduling frequency change in suspend\n",
			 policy->cpu);
@@ -349,7 +352,7 @@ static int msm_cpufreq_probe(struct platform_device *pdev)
	char clk_name[] = "cpu??_clk";
	char tbl_name[] = "qcom,cpufreq-table-??";
	struct clk *c;
	int cpu;
	int cpu, ret;
	struct cpufreq_frequency_table *ftbl;

	l2_clk = devm_clk_get(dev, "l2_clk");
@@ -416,7 +419,15 @@ static int msm_cpufreq_probe(struct platform_device *pdev)
		per_cpu(freq_table, cpu) = ftbl;
	}

	return 0;
	ret = register_pm_notifier(&msm_cpufreq_pm_notifier);
	if (ret)
		return ret;

	ret = cpufreq_register_driver(&msm_cpufreq_driver);
	if (ret)
		unregister_pm_notifier(&msm_cpufreq_pm_notifier);

	return ret;
}

static const struct of_device_id msm_cpufreq_match_table[] = {
@@ -452,8 +463,7 @@ static int __init msm_cpufreq_register(void)
		return rc;
	}

	register_pm_notifier(&msm_cpufreq_pm_notifier);
	return cpufreq_register_driver(&msm_cpufreq_driver);
	return 0;
}

subsys_initcall(msm_cpufreq_register);