[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0c374c1d-cf98-993b-67d6-555222a0a3cb@gmail.com>
Date: Mon, 3 Jul 2023 13:49:46 +0300
From: Matti Vaittinen <mazziesaccount@...il.com>
To: Benjamin Bara <bbara93@...il.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>
Cc: support.opensource@...semi.com,
DLG-Adam.Ward.opensource@...renesas.com,
Martin Fuzzey <martin.fuzzey@...wbird.group>,
linux-kernel@...r.kernel.org,
Benjamin Bara <benjamin.bara@...data.com>
Subject: Re: [PATCH RFC v4 11/13] regulator: implement
mon_unsupported_reg_modes
On 6/20/23 23:03, Benjamin Bara wrote:
> From: Benjamin Bara <benjamin.bara@...data.com>
>
> The mon_unsupported_reg_modes property disables all dt-enabled monitors
How do you feel about
mon_disable_when/if/at_unsupported_mode (or unsupported_*_reg_mode)? Or
is it again getting too long?
This is not a point I would like to stress though :) So,
Reviewed-by: Matti Vaittinen <mazziesaccount@...il.com>
> when the mode of the regulator is changed to an "unsupported" one.
>
> Signed-off-by: Benjamin Bara <benjamin.bara@...data.com>
> ---
> drivers/regulator/core.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
> index 74b9c12d38e9..ca768d0ddb1e 100644
> --- a/drivers/regulator/core.c
> +++ b/drivers/regulator/core.c
> @@ -4816,8 +4816,21 @@ int regulator_set_mode(struct regulator *regulator, unsigned int mode)
> if (ret < 0)
> goto out;
>
> + if (mode & rdev->desc->mon_unsupported_reg_modes) {
> + ret = monitors_disable(rdev, REGULATOR_MONITOR_ALL);
> + if (ret)
> + goto out;
> + }
> +
> ret = rdev->desc->ops->set_mode(rdev, mode);
> +
> out:
> + /* if changing mode failed, ignore monitoring error. */
> + if (ret)
> + monitors_reenable(rdev, REGULATOR_MONITOR_ALL);
> + else
> + ret = monitors_reenable(rdev, REGULATOR_MONITOR_ALL);
> +
> regulator_unlock(rdev);
> return ret;
> }
>
--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland
~~ When things go utterly wrong vim users can always type :help! ~~
Powered by blists - more mailing lists