[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YXFnIPXwPuNWM4XG@sirena.org.uk>
Date: Thu, 21 Oct 2021 14:12:00 +0100
From: Mark Brown <broonie@...nel.org>
To: Dmitry Osipenko <digetx@...il.com>
Cc: Thierry Reding <treding@...dia.com>,
Jonathan Hunter <jonathanh@...dia.com>,
linux-kernel@...r.kernel.org, linux-tegra@...r.kernel.org
Subject: Re: [PATCH v1] regulator: Don't error out fixed regulator in
regulator_sync_voltage()
On Thu, Oct 21, 2021 at 02:07:07PM +0300, Dmitry Osipenko wrote:
> Fixed regulator can't change voltage and regulator_sync_voltage() returns
> -EINVAL in this case. Make regulator_sync_voltage() to succeed for a fixed
> regulator.
> +++ b/drivers/regulator/core.c
> @@ -4249,6 +4249,9 @@ int regulator_sync_voltage(struct regulator *regulator)
> struct regulator_voltage *voltage = ®ulator->voltage[PM_SUSPEND_ON];
> int ret, min_uV, max_uV;
>
> + if (rdev->desc->fixed_uV && rdev->desc->n_voltages == 1)
> + return 0;
> +
> regulator_lock(rdev);
It's unclear why this is checking both fixed_uV and n_voltages. TBH
this feels like a higher level issue - with normal voltage configuration
we would have noticed that our constraints prevent the voltage changing
and not go as far as trying to actually apply a new configuration. I
would expect a similar thing to be happening here.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists