From: Benjamin Bara <bbara93@gmail.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
support.opensource@diasemi.com
Cc: DLG-Adam.Ward.opensource@dm.renesas.com,
linux-kernel@vger.kernel.org,
Matti Vaittinen <mazziesaccount@gmail.com>,
Benjamin Bara <benjamin.bara@skidata.com>
Subject: [PATCH RFC v2 0/2] regulator: dynamic voltage monitoring support
Date: Fri, 21 Apr 2023 11:13:05 +0200 [thread overview]
Message-ID: <20230419-dynamic-vmon-v2-0-c303bcc75ebc@skidata.com> (raw)
Hi!
This series targets the "automatic" state handling of voltage monitors
when the state of the monitored regulator is changed. This is e.g.
necessary for the da9063, which reaches an invalid state (!PWR_OK) if
the voltage monitor is not disabled before the regulator is disabled.
The problem could also be tackled inside of the driver's "state change
ops" (.enable(), .disable(), ...) but I thought it might be a good idea
to have a "common framework" independent of the driver's implementation.
For now, 1/2 adds "disable monitor properties" to the regulator's desc,
which indicate on which actions the monitors should be disabled.
2/2 depends on [1], which implements (static) voltage monitoring for the
da9063. It disables the monitors while the regulator is disabled.
The monitors are only enabled after the ramp-delay, to ensure that the
regulator is already in a valid state.
Possible next step:
"regulators-{uv,ov}-{warn,error,protection}-enable" dt property on chip
level, with either 1 or 0, to en-/disable the dynamic voltage monitoring
for every regulator of the chip. This would require the regulator's
set_{over,under}_voltage_protection() to work with limit = 1.
I added some TODOs (basically about error handling) and still have to do
some testing, but I wanted to share the "direction" of this series,
therefore the v2. Thank you, Mark and Matti, for the input!
Thanks & best regards,
Benjamin
[1] https://lore.kernel.org/all/20230403-da9063-disable-unused-v3-0-cc4dc698864c@skidata.com/
---
Changes in v2:
1/2:
- move from board-specific (machine.h) to driver-specific (driver.h)
- move from own struct to fields/properties in regulator_desc
- handle modes as one "unsupported modes" field
- factor out new monitors_set_state() to handle all (activated) monitors
- move re-enabling of monitor after ramp-delay
- add TODOs for error handling when the action fails (return error from
actual action instead, return state of monitoring to pre-action).
- reword commit message
2/2:
- adapting change to the properties approach
Link to v1: https://lore.kernel.org/r/20230419-dynamic-vmon-v1-0-f48b7438e891@skidata.com
---
Benjamin Bara (2):
regulator: add properties to disable monitoring on actions
regulator: da9063: disable monitoring while regulator is off
drivers/regulator/core.c | 64 ++++++++++++++++++++++++++++++++----
drivers/regulator/da9063-regulator.c | 2 ++
include/linux/regulator/driver.h | 10 ++++++
3 files changed, 70 insertions(+), 6 deletions(-)
---
base-commit: 6a8f57ae2eb07ab39a6f0ccad60c760743051026
change-id: 20230419-dynamic-vmon-e08daa0ac7ad
Best regards,
--
Benjamin Bara <benjamin.bara@skidata.com>
next reply other threads:[~2023-04-21 9:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-21 9:13 Benjamin Bara [this message]
2023-04-21 9:13 ` [PATCH RFC v2 1/2] regulator: add properties to disable monitoring on actions Benjamin Bara
2023-04-24 13:30 ` Matti Vaittinen
2023-04-21 9:13 ` [PATCH RFC v2 2/2] regulator: da9063: disable monitoring while regulator is off Benjamin Bara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230419-dynamic-vmon-v2-0-c303bcc75ebc@skidata.com \
--to=bbara93@gmail.com \
--cc=DLG-Adam.Ward.opensource@dm.renesas.com \
--cc=benjamin.bara@skidata.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mazziesaccount@gmail.com \
--cc=support.opensource@diasemi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®