Skip to content

Commit a6e44d5

Browse files
finley1226rkhuangtao
authored andcommitted
cpufreq: rockchip: Add support to adjust bin according to customer demand
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com> Change-Id: Ic180fa265cfc4c6cde1bef5ef56b1a0bc103bb7d
1 parent 87a3db6 commit a6e44d5

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

drivers/cpufreq/rockchip-cpufreq.c

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ static int rk3399_get_soc_info(struct device *dev, struct device_node *np,
152152
int ret = 0, value = -EINVAL;
153153

154154
if (!bin)
155-
goto out;
155+
return 0;
156+
156157
if (of_property_match_string(np, "nvmem-cell-names",
157158
"specification_serial_number") >= 0) {
158159
ret = rockchip_get_efuse_value(np,
@@ -163,16 +164,33 @@ static int rk3399_get_soc_info(struct device *dev, struct device_node *np,
163164
"Failed to get specification_serial_number\n");
164165
goto out;
165166
}
166-
if (value == 0xb)
167+
168+
if (value == 0xb) {
167169
*bin = 0;
168-
else
170+
} else if (value == 0x1) {
171+
if (of_property_match_string(np, "nvmem-cell-names",
172+
"customer_demand") >= 0) {
173+
ret = rockchip_get_efuse_value(np,
174+
"customer_demand",
175+
&value);
176+
if (ret) {
177+
dev_err(dev, "Failed to get customer_demand\n");
178+
goto out;
179+
}
180+
if (value == 0x0)
181+
*bin = 0;
182+
else
183+
*bin = 1;
184+
}
185+
} else if (value == 0x10) {
169186
*bin = 1;
187+
}
170188
}
171189

190+
out:
172191
if (*bin >= 0)
173192
dev_info(dev, "bin=%d\n", *bin);
174193

175-
out:
176194
return ret;
177195
}
178196
static const struct of_device_id rockchip_cpufreq_of_match[] = {

0 commit comments

Comments
 (0)