Lines Matching +full:asv +full:- +full:bin
1 // SPDX-License-Identifier: GPL-2.0
19 #include <linux/soc/samsung/exynos-chipid.h>
21 #include "exynos-asv.h"
22 #include "exynos5422-asv.h"
26 static int exynos_asv_update_cpu_opps(struct exynos_asv *asv, in exynos_asv_update_cpu_opps() argument
34 for (i = 0; i < ARRAY_SIZE(asv->subsys); i++) { in exynos_asv_update_cpu_opps()
35 if (of_device_is_compatible(cpu->of_node, in exynos_asv_update_cpu_opps()
36 asv->subsys[i].cpu_dt_compat)) { in exynos_asv_update_cpu_opps()
37 subsys = &asv->subsys[i]; in exynos_asv_update_cpu_opps()
42 return -EINVAL; in exynos_asv_update_cpu_opps()
44 for (i = 0; i < subsys->table.num_rows; i++) { in exynos_asv_update_cpu_opps()
52 dev_info(asv->dev, "cpu%d opp%d, freq: %u missing\n", in exynos_asv_update_cpu_opps()
53 cpu->id, i, opp_freq); in exynos_asv_update_cpu_opps()
59 new_volt = asv->opp_get_voltage(subsys, i, volt); in exynos_asv_update_cpu_opps()
68 dev_err(asv->dev, in exynos_asv_update_cpu_opps()
70 opp_freq, new_volt, cpu->id); in exynos_asv_update_cpu_opps()
72 dev_dbg(asv->dev, in exynos_asv_update_cpu_opps()
73 "Adjusted OPP %u Hz/%u -> %u uV, cpu%d\n", in exynos_asv_update_cpu_opps()
74 opp_freq, volt, new_volt, cpu->id); in exynos_asv_update_cpu_opps()
80 static int exynos_asv_update_opps(struct exynos_asv *asv) in exynos_asv_update_opps() argument
100 ret = exynos_asv_update_cpu_opps(asv, cpu); in exynos_asv_update_opps()
108 dev_err(asv->dev, "Couldn't udate OPPs for cpu%d\n", in exynos_asv_update_opps()
121 int (*probe_func)(struct exynos_asv *asv); in exynos_asv_init()
122 struct exynos_asv *asv; in exynos_asv_init() local
127 asv = devm_kzalloc(dev, sizeof(*asv), GFP_KERNEL); in exynos_asv_init()
128 if (!asv) in exynos_asv_init()
129 return -ENOMEM; in exynos_asv_init()
131 asv->chipid_regmap = regmap; in exynos_asv_init()
132 asv->dev = dev; in exynos_asv_init()
133 ret = regmap_read(asv->chipid_regmap, EXYNOS_CHIPID_REG_PRO_ID, in exynos_asv_init()
137 return -ENODEV; in exynos_asv_init()
145 dev_dbg(dev, "No ASV support for this SoC\n"); in exynos_asv_init()
146 devm_kfree(dev, asv); in exynos_asv_init()
153 return -EPROBE_DEFER; in exynos_asv_init()
155 ret = of_property_read_u32(dev->of_node, "samsung,asv-bin", in exynos_asv_init()
156 &asv->of_bin); in exynos_asv_init()
158 asv->of_bin = -EINVAL; in exynos_asv_init()
160 for (i = 0; i < ARRAY_SIZE(asv->subsys); i++) in exynos_asv_init()
161 asv->subsys[i].asv = asv; in exynos_asv_init()
163 ret = probe_func(asv); in exynos_asv_init()
167 return exynos_asv_update_opps(asv); in exynos_asv_init()