Re: [PATCH v2 3/5] power: regulator: Exit from regulator_set_suspend_value on poorly described regulators

Marek Vasut <[email protected]>
Newsgroups io.groups.u-boot-amlogic,org.u-boot-project.lists.u-boot
Message-ID <[email protected]>
On 9/25/24 8:29 AM, Jonas Karlman wrote:
> Hi Marek,

Hi,

> On 2024-09-25 04:21, Marek Vasut wrote:
>> In case the DT regulator node does not contain 'regulator-max-microvolt'
>> property and does not contain 'regulator-state-mem' subnode (like the
>> test.dts regul1_scmi: reg@1 {} regulator node), then regulator_pre_probe()
>> will parse this regulator node and set uc_pdata->suspend_on = true and
>> uc_pdata->suspend_uV = uc_pdata->max_uV, where uc_pdata->max_uV is set
>> to -ENODATA because "regulator-max-microvolt" is missing, and therefore
>> uc_pdata->suspend_uV is also -ENODATA. In case regulator_autoset() is
>> used afterward, it will attempt to call regulator_set_suspend_value()
>> with uV = uc_pdata->suspend_uV = -ENODATA and fail with -EINVAL. Check
>> for this case in regulator_set_suspend_value() and immediately return 0,
>> because there is no way to set meaningful suspend voltage, so do nothing
>> and retain the existing settings of the regulator.
> 
> I sent a different fix for this some time ago, please check it out:
> 
> https://patchwork.ozlabs.org/patch/1964571/
That one will work too, yes.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.