summaryrefslogtreecommitdiff
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorLiang Chen <cl@rock-chips.com>2018-08-09 14:09:36 +0800
committerTao Huang <huangtao@rock-chips.com>2018-08-10 11:34:29 +0800
commit5b9455205727d281a2782712b5264b12951beefe (patch)
tree0167ed8057b760dd802dc842cca750628cec738b /drivers/cpufreq
parentf2e4ad355a92d447462ce46b6515153d274d4daf (diff)
cpufreq: rockchip: try old regulator name of cpu for PVTM
PVTM use "cpu-supply" as the name of regulator to get PVTM value to select opp level, but old dts use "cpu0-supply" as the name of cpu, so we need be compatible with the old regulator name of cpu. Change-Id: Id6dbb0b4a85e6154b9be38ffb373e7eab7199781 Signed-off-by: Liang Chen <cl@rock-chips.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/rockchip-cpufreq.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/cpufreq/rockchip-cpufreq.c b/drivers/cpufreq/rockchip-cpufreq.c
index 7fde1331601f..f77709ab3a86 100644
--- a/drivers/cpufreq/rockchip-cpufreq.c
+++ b/drivers/cpufreq/rockchip-cpufreq.c
@@ -126,7 +126,7 @@ next:
dev_err(dev, "Failed to get soc process version\n");
goto out;
}
- if (value == 0 || value == 1)
+ if (soc_is_rk3288() && (value == 0 || value == 1))
*process = 0;
}
if (*process >= 0)
@@ -281,7 +281,9 @@ EXPORT_SYMBOL_GPL(rockchip_cpufreq_update_cur_volt);
static int rockchip_cpufreq_cluster_init(int cpu, struct cluster_info *cluster)
{
struct device_node *np;
+ struct property *pp;
struct device *dev;
+ char *reg_name = NULL;
int ret = 0, bin = -EINVAL;
cluster->process = -EINVAL;
@@ -292,6 +294,17 @@ static int rockchip_cpufreq_cluster_init(int cpu, struct cluster_info *cluster)
if (!dev)
return -ENODEV;
+ pp = of_find_property(dev->of_node, "cpu-supply", NULL);
+ if (pp) {
+ reg_name = "cpu";
+ } else {
+ pp = of_find_property(dev->of_node, "cpu0-supply", NULL);
+ if (pp)
+ reg_name = "cpu0";
+ else
+ return -ENOENT;
+ }
+
np = of_parse_phandle(dev->of_node, "operating-points-v2", 0);
if (!np) {
dev_warn(dev, "OPP-v2 not supported\n");
@@ -313,7 +326,7 @@ static int rockchip_cpufreq_cluster_init(int cpu, struct cluster_info *cluster)
rockchip_get_soc_info(dev, rockchip_cpufreq_of_match,
&bin, &cluster->process);
- rockchip_get_scale_volt_sel(dev, "cpu_leakage", "cpu",
+ rockchip_get_scale_volt_sel(dev, "cpu_leakage", reg_name,
bin, cluster->process,
&cluster->scale, &cluster->volt_sel);
np_err: