Lines Matching +full:speed +full:- +full:bin

1 // SPDX-License-Identifier: GPL-2.0
5 * The sun50i-cpufreq-nvmem driver reads the efuse value from the SoC to
13 #include <linux/arm-smccc.h>
16 #include <linux/nvmem-consumer.h>
42 * the slowest bin. Expected efuse values are 1-3, slowest in sun50i_h6_efuse_xlate()
46 return efuse_value - 1; in sun50i_h6_efuse_xlate()
79 * returned speedbin index is 4 -> 0/2 -> 3 -> 1, from worst to best.
118 pr_warn("sun50i-cpufreq-nvmem: unknown speed bin 0x%x, using default bin 0\n", in sun50i_h616_efuse_xlate()
140 { .compatible = "allwinner,sun50i-h6-operating-points",
143 { .compatible = "allwinner,sun50i-a100-operating-points",
146 { .compatible = "allwinner,sun50i-h616-operating-points",
153 * dt_has_supported_hw() - Check if any OPPs use opp-supported-hw
155 * If we ask the cpufreq framework to use the opp-supported-hw feature, it
159 * Returns true if we have at least one OPP with the opp-supported-hw property.
176 if (of_property_present(opp, "opp-supported-hw")) { in dt_has_supported_hw()
186 * sun50i_cpufreq_get_efuse() - Determine speed grade from efuse value
188 * Returns non-negative speed bin index on success, a negative error
204 return -ENODEV; in sun50i_cpufreq_get_efuse()
209 return -ENOENT; in sun50i_cpufreq_get_efuse()
213 return -ENOENT; in sun50i_cpufreq_get_efuse()
215 opp_data = match->data; in sun50i_cpufreq_get_efuse()
231 ret = opp_data->efuse_xlate(speedbin); in sun50i_cpufreq_get_efuse()
244 int speed; in sun50i_cpufreq_nvmem_probe() local
250 return -ENOMEM; in sun50i_cpufreq_nvmem_probe()
252 speed = sun50i_cpufreq_get_efuse(); in sun50i_cpufreq_nvmem_probe()
253 if (speed < 0) { in sun50i_cpufreq_nvmem_probe()
255 return speed; in sun50i_cpufreq_nvmem_probe()
259 * We need at least one OPP with the "opp-supported-hw" property, in sun50i_cpufreq_nvmem_probe()
263 supported_hw = 1U << speed; in sun50i_cpufreq_nvmem_probe()
268 snprintf(name, sizeof(name), "speed%d", speed); in sun50i_cpufreq_nvmem_probe()
275 ret = -ENODEV; in sun50i_cpufreq_nvmem_probe()
286 cpufreq_dt_pdev = platform_device_register_simple("cpufreq-dt", -1, in sun50i_cpufreq_nvmem_probe()
321 .name = "sun50i-cpufreq-nvmem",
326 { .compatible = "allwinner,sun50i-h6" },
327 { .compatible = "allwinner,sun50i-a100" },
328 { .compatible = "allwinner,sun50i-h616" },
329 { .compatible = "allwinner,sun50i-h618" },
330 { .compatible = "allwinner,sun50i-h700" },
354 return -ENODEV; in sun50i_cpufreq_init()
361 platform_device_register_simple("sun50i-cpufreq-nvmem", in sun50i_cpufreq_init()
362 -1, NULL, 0); in sun50i_cpufreq_init()
379 MODULE_DESCRIPTION("Sun50i-h6 cpufreq driver");