Lines Matching +full:asv +full:- +full:bin

1 // SPDX-License-Identifier: GPL-2.0
18 #include <linux/soc/samsung/exynos-chipid.h>
20 #include "exynos-asv.h"
21 #include "exynos5422-asv.h"
25 static int exynos_asv_update_cpu_opps(struct exynos_asv *asv, in exynos_asv_update_cpu_opps() argument
33 for (i = 0; i < ARRAY_SIZE(asv->subsys); i++) { in exynos_asv_update_cpu_opps()
34 if (of_device_is_compatible(cpu->of_node, in exynos_asv_update_cpu_opps()
35 asv->subsys[i].cpu_dt_compat)) { in exynos_asv_update_cpu_opps()
36 subsys = &asv->subsys[i]; in exynos_asv_update_cpu_opps()
41 return -EINVAL; in exynos_asv_update_cpu_opps()
43 for (i = 0; i < subsys->table.num_rows; i++) { in exynos_asv_update_cpu_opps()
51 dev_info(asv->dev, "cpu%d opp%d, freq: %u missing\n", in exynos_asv_update_cpu_opps()
52 cpu->id, i, opp_freq); in exynos_asv_update_cpu_opps()
58 new_volt = asv->opp_get_voltage(subsys, i, volt); in exynos_asv_update_cpu_opps()
67 dev_err(asv->dev, in exynos_asv_update_cpu_opps()
69 opp_freq, new_volt, cpu->id); in exynos_asv_update_cpu_opps()
71 dev_dbg(asv->dev, in exynos_asv_update_cpu_opps()
72 "Adjusted OPP %u Hz/%u -> %u uV, cpu%d\n", in exynos_asv_update_cpu_opps()
73 opp_freq, volt, new_volt, cpu->id); in exynos_asv_update_cpu_opps()
79 static int exynos_asv_update_opps(struct exynos_asv *asv) in exynos_asv_update_opps() argument
99 ret = exynos_asv_update_cpu_opps(asv, cpu); in exynos_asv_update_opps()
101 dev_err(asv->dev, "Couldn't udate OPPs for cpu%d\n", in exynos_asv_update_opps()
113 int (*probe_func)(struct exynos_asv *asv); in exynos_asv_init()
114 struct exynos_asv *asv; in exynos_asv_init() local
119 asv = devm_kzalloc(dev, sizeof(*asv), GFP_KERNEL); in exynos_asv_init()
120 if (!asv) in exynos_asv_init()
121 return -ENOMEM; in exynos_asv_init()
123 asv->chipid_regmap = regmap; in exynos_asv_init()
124 asv->dev = dev; in exynos_asv_init()
125 ret = regmap_read(asv->chipid_regmap, EXYNOS_CHIPID_REG_PRO_ID, in exynos_asv_init()
129 return -ENODEV; in exynos_asv_init()
137 dev_dbg(dev, "No ASV support for this SoC\n"); in exynos_asv_init()
138 devm_kfree(dev, asv); in exynos_asv_init()
145 return -EPROBE_DEFER; in exynos_asv_init()
147 ret = of_property_read_u32(dev->of_node, "samsung,asv-bin", in exynos_asv_init()
148 &asv->of_bin); in exynos_asv_init()
150 asv->of_bin = -EINVAL; in exynos_asv_init()
152 for (i = 0; i < ARRAY_SIZE(asv->subsys); i++) in exynos_asv_init()
153 asv->subsys[i].asv = asv; in exynos_asv_init()
155 ret = probe_func(asv); in exynos_asv_init()
159 return exynos_asv_update_opps(asv); in exynos_asv_init()