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:
That one will work too, yes.