mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RFC v3 0/5] regulator: dynamic voltage monitoring support
@ 2023-05-21 11:39 Benjamin Bara
  2023-05-21 11:39 ` [PATCH RFC v3 1/5] regulator: move monitor handling into own function Benjamin Bara
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Benjamin Bara @ 2023-05-21 11:39 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown
  Cc: support.opensource, DLG-Adam.Ward.opensource, linux-kernel,
	Matti Vaittinen, Benjamin Bara

Hi!

This series targets the "automatic" state handling of 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.
The new approach takes Matti's feedback regarding the bd718x7 into
account.

1/5 factors out the current monitor handling, to be able to re-use it
during the state changes.
2/5 disables monitoring of disabled regulators, also something mentioned
by Matti as a "requirement" of the bd718x7 driver.
3/5 adds a new op to get the active monitors/protections of a regulator,
which should help users to add enabled protections to their device-tree.
4/5 adds new properties to let the core know on which state changes the
monitors of a regulator need to be en-/disabled.
5/5 is an example how the bd718x7 could be converted to use the new
property (untested, as no hw available).

Thanks & best regards,
Benjamin

---
Changes in v3:
- rebase to v6.4-rc2, to get voltage monitoring of da9063
- re-use the existing monitor handling
- set initial monitoring state to regulator state
- disable monitoring before disabling regulators (if protection is
  activated in dt)
- add new op to get the active protections of a regulator
- distinguish between switching to higher or lower voltage
- re-activate old monitoring state if regulator's state change fails
- convert bd718x7 monitor handling to use the state change property

Link to v2: https://lore.kernel.org/r/20230419-dynamic-vmon-v2-0-c303bcc75ebc@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 (5):
      regulator: move monitor handling into own function
      regulator: disable monitors when regulator is disabled
      regulator: add getter for active monitors
      regulator: add properties to handle monitoring on state change
      regulator: bd718x7: let the core handle the monitors

 drivers/regulator/bd718x7-regulator.c | 206 ++++++++++---------------------
 drivers/regulator/core.c              | 224 ++++++++++++++++++++++++++--------
 include/linux/regulator/driver.h      |  22 ++++
 3 files changed, 262 insertions(+), 190 deletions(-)
---
base-commit: f1fcbaa18b28dec10281551dfe6ed3a3ed80e3d6
change-id: 20230419-dynamic-vmon-e08daa0ac7ad

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


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

end of thread, other threads:[~2023-06-13  7:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-21 11:39 [PATCH RFC v3 0/5] regulator: dynamic voltage monitoring support Benjamin Bara
2023-05-21 11:39 ` [PATCH RFC v3 1/5] regulator: move monitor handling into own function Benjamin Bara
2023-05-23  9:46   ` Matti Vaittinen
2023-05-23 11:51     ` Benjamin Bara
2023-05-24  7:28       ` Matti Vaittinen
2023-05-24 10:47         ` Mark Brown
2023-06-13  7:33         ` Benjamin Bara
2023-05-21 11:39 ` [PATCH RFC v3 2/5] regulator: disable monitors when regulator is disabled Benjamin Bara
2023-05-21 11:39 ` [PATCH RFC v3 3/5] regulator: add getter for active monitors Benjamin Bara
2023-05-21 11:39 ` [PATCH RFC v3 4/5] regulator: add properties to handle monitoring on state change Benjamin Bara
2023-05-21 11:39 ` [PATCH RFC v3 5/5] regulator: bd718x7: let the core handle the monitors Benjamin Bara

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®