Lines Matching refs:opp_data

48 	unsigned long (*efuse_xlate)(struct ti_cpufreq_data *opp_data,
66 static unsigned long amx3_efuse_xlate(struct ti_cpufreq_data *opp_data, in amx3_efuse_xlate() argument
70 efuse = opp_data->soc_data->efuse_fallback; in amx3_efuse_xlate()
75 static unsigned long dra7_efuse_xlate(struct ti_cpufreq_data *opp_data, in dra7_efuse_xlate() argument
101 static unsigned long omap3_efuse_xlate(struct ti_cpufreq_data *opp_data, in omap3_efuse_xlate() argument
210 static int ti_cpufreq_get_efuse(struct ti_cpufreq_data *opp_data, in ti_cpufreq_get_efuse() argument
213 struct device *dev = opp_data->cpu_dev; in ti_cpufreq_get_efuse()
217 ret = regmap_read(opp_data->syscon, opp_data->soc_data->efuse_offset, in ti_cpufreq_get_efuse()
222 opp_data->soc_data->efuse_offset, 4); in ti_cpufreq_get_efuse()
236 efuse = (efuse & opp_data->soc_data->efuse_mask); in ti_cpufreq_get_efuse()
237 efuse >>= opp_data->soc_data->efuse_shift; in ti_cpufreq_get_efuse()
239 *efuse_value = opp_data->soc_data->efuse_xlate(opp_data, efuse); in ti_cpufreq_get_efuse()
251 static int ti_cpufreq_get_rev(struct ti_cpufreq_data *opp_data, in ti_cpufreq_get_rev() argument
254 struct device *dev = opp_data->cpu_dev; in ti_cpufreq_get_rev()
258 ret = regmap_read(opp_data->syscon, opp_data->soc_data->rev_offset, in ti_cpufreq_get_rev()
263 opp_data->soc_data->rev_offset, 4); in ti_cpufreq_get_rev()
282 static int ti_cpufreq_setup_syscon_register(struct ti_cpufreq_data *opp_data) in ti_cpufreq_setup_syscon_register() argument
284 struct device *dev = opp_data->cpu_dev; in ti_cpufreq_setup_syscon_register()
285 struct device_node *np = opp_data->opp_node; in ti_cpufreq_setup_syscon_register()
287 opp_data->syscon = syscon_regmap_lookup_by_phandle(np, in ti_cpufreq_setup_syscon_register()
289 if (IS_ERR(opp_data->syscon)) { in ti_cpufreq_setup_syscon_register()
292 return PTR_ERR(opp_data->syscon); in ti_cpufreq_setup_syscon_register()
328 struct ti_cpufreq_data *opp_data; in ti_cpufreq_probe() local
336 opp_data = devm_kzalloc(&pdev->dev, sizeof(*opp_data), GFP_KERNEL); in ti_cpufreq_probe()
337 if (!opp_data) in ti_cpufreq_probe()
340 opp_data->soc_data = match->data; in ti_cpufreq_probe()
342 opp_data->cpu_dev = get_cpu_device(0); in ti_cpufreq_probe()
343 if (!opp_data->cpu_dev) { in ti_cpufreq_probe()
348 opp_data->opp_node = dev_pm_opp_of_get_opp_desc_node(opp_data->cpu_dev); in ti_cpufreq_probe()
349 if (!opp_data->opp_node) { in ti_cpufreq_probe()
350 dev_info(opp_data->cpu_dev, in ti_cpufreq_probe()
355 ret = ti_cpufreq_setup_syscon_register(opp_data); in ti_cpufreq_probe()
365 ret = ti_cpufreq_get_rev(opp_data, &version[0]); in ti_cpufreq_probe()
369 ret = ti_cpufreq_get_efuse(opp_data, &version[1]); in ti_cpufreq_probe()
373 ti_opp_table = dev_pm_opp_set_supported_hw(opp_data->cpu_dev, in ti_cpufreq_probe()
376 dev_err(opp_data->cpu_dev, in ti_cpufreq_probe()
382 opp_data->opp_table = ti_opp_table; in ti_cpufreq_probe()
384 if (opp_data->soc_data->multi_regulator) { in ti_cpufreq_probe()
387 if (opp_data->soc_data->reg_names) in ti_cpufreq_probe()
388 reg_names = opp_data->soc_data->reg_names; in ti_cpufreq_probe()
389 ti_opp_table = dev_pm_opp_set_regulators(opp_data->cpu_dev, in ti_cpufreq_probe()
393 dev_pm_opp_put_supported_hw(opp_data->opp_table); in ti_cpufreq_probe()
399 of_node_put(opp_data->opp_node); in ti_cpufreq_probe()
406 of_node_put(opp_data->opp_node); in ti_cpufreq_probe()