aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnson Huang <b20788@freescale.com>2014-05-06 02:03:12 -0400
committerAnson Huang <b20788@freescale.com>2014-05-08 02:36:38 -0400
commit7cf791243f88792ce8a8e3363980c02eb1d0c1fc (patch)
tree6898c1a73d40ffcbad638368421475c18ae9944b
parent01efa96c7d4d578525098b42abc0ea1ce983084c (diff)
ENGR00311992-2 cpufreq: imx6: remove pu regulator dependency
PU regulator is not a necessary regulator for cpufreq, not all i.MX6 SoCs have PU regulator, so remove the dependency to support i.MX6SX which has NO PU regulator. Signed-off-by: Anson Huang <b20788@freescale.com>
-rw-r--r--drivers/cpufreq/cpufreq-imx6.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/cpufreq/cpufreq-imx6.c b/drivers/cpufreq/cpufreq-imx6.c
index eb7baacf6fdf..c49c8eff8e79 100644
--- a/drivers/cpufreq/cpufreq-imx6.c
+++ b/drivers/cpufreq/cpufreq-imx6.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2013 Freescale Semiconductor, Inc. 2 * Copyright (C) 2013-2014 Freescale Semiconductor, Inc.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
@@ -122,7 +122,7 @@ static int imx6_set_target(struct cpufreq_policy *policy,
122 122
123 /* scaling up? scale voltage before frequency */ 123 /* scaling up? scale voltage before frequency */
124 if (freqs.new > freqs.old) { 124 if (freqs.new > freqs.old) {
125 if (regulator_is_enabled(pu_reg)) { 125 if (!IS_ERR(pu_reg) && regulator_is_enabled(pu_reg)) {
126 ret = regulator_set_voltage_tol(pu_reg, 126 ret = regulator_set_voltage_tol(pu_reg,
127 imx6_soc_opp[soc_opp_index].soc_volt, 127 imx6_soc_opp[soc_opp_index].soc_volt,
128 0); 128 0);
@@ -187,7 +187,7 @@ static int imx6_set_target(struct cpufreq_policy *policy,
187 goto err1; 187 goto err1;
188 } 188 }
189 189
190 if (regulator_is_enabled(pu_reg)) { 190 if (!IS_ERR(pu_reg) && regulator_is_enabled(pu_reg)) {
191 ret = regulator_set_voltage_tol(pu_reg, 191 ret = regulator_set_voltage_tol(pu_reg,
192 imx6_soc_opp[soc_opp_index].soc_volt, 192 imx6_soc_opp[soc_opp_index].soc_volt,
193 0); 193 0);
@@ -325,7 +325,7 @@ static int imx6_cpufreq_probe(struct platform_device *pdev)
325 arm_reg = devm_regulator_get(cpu_dev, "arm"); 325 arm_reg = devm_regulator_get(cpu_dev, "arm");
326 pu_reg = devm_regulator_get(cpu_dev, "pu"); 326 pu_reg = devm_regulator_get(cpu_dev, "pu");
327 soc_reg = devm_regulator_get(cpu_dev, "soc"); 327 soc_reg = devm_regulator_get(cpu_dev, "soc");
328 if (IS_ERR(arm_reg) || IS_ERR(pu_reg) || IS_ERR(soc_reg)) { 328 if (IS_ERR(arm_reg) || IS_ERR(soc_reg)) {
329 dev_err(cpu_dev, "failed to get regulators\n"); 329 dev_err(cpu_dev, "failed to get regulators\n");
330 ret = -ENOENT; 330 ret = -ENOENT;
331 goto put_node; 331 goto put_node;
@@ -420,9 +420,11 @@ static int imx6_cpufreq_probe(struct platform_device *pdev)
420 if (ret > 0) 420 if (ret > 0)
421 transition_latency += ret * 1000; 421 transition_latency += ret * 1000;
422 422
423 ret = regulator_set_voltage_time(pu_reg, min_volt, max_volt); 423 if (!IS_ERR(pu_reg)) {
424 if (ret > 0) 424 ret = regulator_set_voltage_time(pu_reg, min_volt, max_volt);
425 transition_latency += ret * 1000; 425 if (ret > 0)
426 transition_latency += ret * 1000;
427 }
426 428
427 /* 429 /*
428 * OPP is maintained in order of increasing frequency, and 430 * OPP is maintained in order of increasing frequency, and