public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/2] regulator: dynamic voltage monitoring support
@ 2023-04-20 10:29 Benjamin Bara
  2023-04-20 10:29 ` [PATCH RFC 1/2] regulator: introduce regulator monitoring constraints Benjamin Bara
  2023-04-20 10:29 ` [PATCH RFC 2/2] regulator: da9063: disable monitoring while regulator is off Benjamin Bara
  0 siblings, 2 replies; 10+ messages in thread
From: Benjamin Bara @ 2023-04-20 10:29 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, support.opensource
  Cc: DLG-Adam.Ward.opensource, linux-kernel, Matti Vaittinen,
	Benjamin Bara

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.
Not sure if a good idea, therefore RFC.

For now, 1/2 implements so-called "monitoring constraints", but for now
only for under- and overvoltage monitoring. 
2/2 depends on [1], which implements (static) voltage monitoring for the
da9063. It shows a basic example how to use these constraints.

What's not targeted (for now) are possibly required delay times between
monitor state change and regulator state change. For the da9063, these
are not required but I can imagine there are other regulators where they
might be needed?

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.

Thanks & best regards,
Benjamin

[1] https://lore.kernel.org/all/20230403-da9063-disable-unused-v3-0-cc4dc698864c@skidata.com/

---
Benjamin Bara (2):
      regulator: introduce regulator monitoring constraints
      regulator: da9063: disable monitoring while regulator is off

 drivers/regulator/core.c             | 155 +++++++++++++++++++++++++++++++----
 drivers/regulator/da9063-regulator.c |  17 +++-
 include/linux/regulator/machine.h    |  34 ++++++++
 3 files changed, 190 insertions(+), 16 deletions(-)
---
base-commit: 6a8f57ae2eb07ab39a6f0ccad60c760743051026
change-id: 20230419-dynamic-vmon-e08daa0ac7ad

Best regards,
-- 
Benjamin Bara <benjamin.bara@skidata.com>


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-04-20 14:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-20 10:29 [PATCH RFC 0/2] regulator: dynamic voltage monitoring support Benjamin Bara
2023-04-20 10:29 ` [PATCH RFC 1/2] regulator: introduce regulator monitoring constraints Benjamin Bara
2023-04-20 11:33   ` Matti Vaittinen
2023-04-20 14:29     ` Benjamin Bara
2023-04-20 14:50       ` Mark Brown
2023-04-20 12:17   ` Mark Brown
2023-04-20 14:30     ` Benjamin Bara
2023-04-20 14:37       ` Mark Brown
2023-04-20 14:54         ` Benjamin Bara
2023-04-20 10:29 ` [PATCH RFC 2/2] regulator: da9063: disable monitoring while regulator is off Benjamin Bara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox