Commit 2482bc31 authored by Sudeep Holla's avatar Sudeep Holla Committed by Rafael J. Wysocki

cpufreq: st: enable selective initialization based on the platform

The sti-cpufreq does unconditional registration of the cpufreq-dt driver
which causes issue on an multi-platform build. For example, on Vexpress
TC2 platform, we get the following error on boot:

cpu cpu0: OPP-v2 not supported
cpu cpu0: Not doing voltage scaling
cpu: dev_pm_opp_of_cpumask_add_table: couldn't find opp table
	for cpu:0, -19
cpu cpu0: dev_pm_opp_get_max_volt_latency: Invalid regulator (-6)
...
arm_big_little: bL_cpufreq_register: Failed registering platform driver:
		vexpress-spc, err: -17

The actual driver fails to initialise as cpufreq-dt is probed
successfully, which is incorrect. This issue can happen to any platform
not using cpufreq-dt in a multi-platform build.

This patch adds a check to do selective initialization of the driver.

Fixes: ab0ea257 (cpufreq: st: Provide runtime initialised driver for ST's platforms)
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Acked-by: default avatarLee Jones <lee.jones@linaro.org>
Cc: 4.5+ <stable@vger.kernel.org> # 4.5+
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 1becf035
...@@ -259,6 +259,10 @@ static int sti_cpufreq_init(void) ...@@ -259,6 +259,10 @@ static int sti_cpufreq_init(void)
{ {
int ret; int ret;
if ((!of_machine_is_compatible("st,stih407")) &&
(!of_machine_is_compatible("st,stih410")))
return -ENODEV;
ddata.cpu = get_cpu_device(0); ddata.cpu = get_cpu_device(0);
if (!ddata.cpu) { if (!ddata.cpu) {
dev_err(ddata.cpu, "Failed to get device for CPU0\n"); dev_err(ddata.cpu, "Failed to get device for CPU0\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment