Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpufreq: ti-cpufreq: omap36xx use "cpu0","vbb" if run in multi_regulator mode

In preparation for using the multi_regulator capability of
this driver for handling the ABB LDO for OPP1G of the omap36xx
we have to take care that the (legacy) vdd-supply name is
cpu0-supply = <&vcc>;

To do this we add another field to the SoC description table which
optionally can specify a list of regulator names.

For omap36xx we define "cpu0-supply" and "vbb-supply".

The default remains "vdd-supply" and "vbb-supply".

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Rob Herring <robh@kernel.org>
Tested-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

authored by

H. Nikolaus Schaller and committed by
Viresh Kumar
42e52616 6ddf6c91

+15 -3
+5 -1
Documentation/devicetree/bindings/cpufreq/ti-cpufreq.txt
··· 15 15 16 16 In 'operating-points-v2' table: 17 17 - compatible: Should be 18 - - 'operating-points-v2-ti-cpu' for am335x, am43xx, and dra7xx/am57xx SoCs 18 + - 'operating-points-v2-ti-cpu' for am335x, am43xx, and dra7xx/am57xx, 19 + omap34xx, omap36xx and am3517 SoCs 19 20 - syscon: A phandle pointing to a syscon node representing the control module 20 21 register space of the SoC. 21 22 22 23 Optional properties: 23 24 -------------------- 25 + - "vdd-supply", "vbb-supply": to define two regulators for dra7xx 26 + - "cpu0-supply", "vbb-supply": to define two regulators for omap36xx 27 + 24 28 For each opp entry in 'operating-points-v2' table: 25 29 - opp-supported-hw: Two bitfields indicating: 26 30 1. Which revision of the SoC the OPP is supported by
+10 -2
drivers/cpufreq/ti-cpufreq.c
··· 41 41 struct ti_cpufreq_data; 42 42 43 43 struct ti_cpufreq_soc_data { 44 + const char * const *reg_names; 44 45 unsigned long (*efuse_xlate)(struct ti_cpufreq_data *opp_data, 45 46 unsigned long efuse); 46 47 unsigned long efuse_fallback; ··· 166 165 * seems to always read as 0). 167 166 */ 168 167 168 + static const char * const omap3_reg_names[] = {"cpu0", "vbb"}; 169 + 169 170 static struct ti_cpufreq_soc_data omap36xx_soc_data = { 171 + .reg_names = omap3_reg_names, 170 172 .efuse_xlate = omap3_efuse_xlate, 171 173 .efuse_offset = OMAP3_CONTROL_DEVICE_STATUS - OMAP3_SYSCON_BASE, 172 174 .efuse_shift = 9, ··· 303 299 const struct of_device_id *match; 304 300 struct opp_table *ti_opp_table; 305 301 struct ti_cpufreq_data *opp_data; 306 - const char * const reg_names[] = {"vdd", "vbb"}; 302 + const char * const default_reg_names[] = {"vdd", "vbb"}; 307 303 int ret; 308 304 309 305 match = dev_get_platdata(&pdev->dev); ··· 359 355 opp_data->opp_table = ti_opp_table; 360 356 361 357 if (opp_data->soc_data->multi_regulator) { 358 + const char * const *reg_names = default_reg_names; 359 + 360 + if (opp_data->soc_data->reg_names) 361 + reg_names = opp_data->soc_data->reg_names; 362 362 ti_opp_table = dev_pm_opp_set_regulators(opp_data->cpu_dev, 363 363 reg_names, 364 - ARRAY_SIZE(reg_names)); 364 + ARRAY_SIZE(default_reg_names)); 365 365 if (IS_ERR(ti_opp_table)) { 366 366 dev_pm_opp_put_supported_hw(opp_data->opp_table); 367 367 ret = PTR_ERR(ti_opp_table);