From 0b9aadfd542f7abcaec5d57ff90e98c77e5f85a4 Mon Sep 17 00:00:00 2001 From: Liang Chen Date: Tue, 26 Jun 2018 15:43:31 +0800 Subject: [PATCH] cpufreq: rockchip: implement get_soc_info() for px30/rk3326 SoCs Change-Id: I3569ce6447ebda3bef901c0430818090cd5058ca Signed-off-by: Liang Chen --- drivers/cpufreq/rockchip-cpufreq.c | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/cpufreq/rockchip-cpufreq.c b/drivers/cpufreq/rockchip-cpufreq.c index 00b9bd874ed3..7fde1331601f 100644 --- a/drivers/cpufreq/rockchip-cpufreq.c +++ b/drivers/cpufreq/rockchip-cpufreq.c @@ -54,6 +54,29 @@ struct cluster_info { }; static LIST_HEAD(cluster_info_list); +static int px30_get_soc_info(struct device *dev, struct device_node *np, + int *bin, int *process) +{ + int ret = 0, value = -EINVAL; + + if (!bin) + return 0; + + 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; + } + *bin = value; + } + if (*bin >= 0) + dev_info(dev, "bin=%d\n", *bin); + + return ret; +} + static int rk3288_get_soc_info(struct device *dev, struct device_node *np, int *bin, int *process) { @@ -114,6 +137,10 @@ out: } static const struct of_device_id rockchip_cpufreq_of_match[] = { + { + .compatible = "rockchip,px30", + .data = (void *)&px30_get_soc_info, + }, { .compatible = "rockchip,rk3288", .data = (void *)&rk3288_get_soc_info, @@ -122,6 +149,10 @@ static const struct of_device_id rockchip_cpufreq_of_match[] = { .compatible = "rockchip,rk3288w", .data = (void *)&rk3288_get_soc_info, }, + { + .compatible = "rockchip,rk3326", + .data = (void *)&px30_get_soc_info, + }, {}, };