cpufreq: rockchip: Implement get_soc_info() for rv1126 SoCs

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ie56cf08706db7ffcf1d5821e7f43b61a7677e253
This commit is contained in:
Finley Xiao
2021-01-18 18:41:49 +08:00
committed by Tao Huang
parent 7426087ac0
commit 64f51c86a8

View File

@@ -184,6 +184,29 @@ out:
return ret;
}
static int rv1126_get_soc_info(struct device *dev, struct device_node *np,
int *bin, int *process)
{
int ret = 0, value = -EINVAL;
if (of_property_match_string(np, "nvmem-cell-names", "performance") >= 0) {
ret = rockchip_get_efuse_value(np, "performance", &value);
if (ret) {
dev_err(dev, "Failed to get soc performance value\n");
return ret;
}
if (value == 0x1)
*bin = 1;
else
*bin = 0;
}
if (*bin >= 0)
dev_info(dev, "bin=%d\n", *bin);
return ret;
}
static const struct of_device_id rockchip_cpufreq_of_match[] = {
{
.compatible = "rockchip,px30",
@@ -205,6 +228,14 @@ static const struct of_device_id rockchip_cpufreq_of_match[] = {
.compatible = "rockchip,rk3399",
.data = (void *)&rk3399_get_soc_info,
},
{
.compatible = "rockchip,rv1109",
.data = (void *)&rv1126_get_soc_info,
},
{
.compatible = "rockchip,rv1126",
.data = (void *)&rv1126_get_soc_info,
},
{},
};