RFC regulator: dynamic voltage monitoring support
Get series with b4
b4 am [email protected] change-id 20230419-dynamic-vmon-e08daa0ac7adVersions newest first
- v4 RFC Latest13 patches 15 repliesIn review
- v3 RFC5 patches 5 repliesSuperseded
- v2 RFC2 patches 1 replySuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 RFC | 2 patches | 7 replies | Superseded |
Changes in v4 from the cover letter
- introduce helper to handle the monitor state according to the workarounds
- split up commits per workaround implementation
- don't disable monitors of disabled regulators anymore
- implement monitor getter for the da9063
- workarounds are now per-monitor instead of "global"
- require defined ops for workarounds
- ensure that active monitoring is known on regulators with workarounds
- re-enable monitors only if they were disabled
- Link to v3: https://lore.kernel.org/r/[email protected]
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/13 | regulator: da9063: fix null pointer deref with partial DT configdrivers/ | +6 | 0 replies | |
| 2/13 | regulator: add getter for active monitorsinclude/ | +10 | 2 replies | |
| 3/13 | regulator: da9063: implement get_active_protections()drivers/ | +20 | 0 replies | |
| 4/13 | regulator: bd718x7: implement get_active_protections()drivers/ | +60 | 1 reply | |
| 5/13 | regulator: introduce properties for monitoring workaroundsinclude/ | +18 | 1 reply | |
| 6/13 | regulator: set required ops for monitoring workaroundsdrivers/ | +34 | 1 reply | |
| 7/13 | regulator: find active protections during initializationdrivers/ | +41 | 4 replies | |
| 8/13 | regulator: move monitor handling into own functiondrivers/ | +178 | 1 reply | |
| 9/13 | regulator: implement mon_disable_reg_disableddrivers/ | +14 | 2 replies | |
| 10/13 | regulator: implement mon_disable_reg_set_{higher,lower}drivers/ | +37 | 1 reply | |
| 11/13 | regulator: implement mon_unsupported_reg_modesdrivers/ | +13 | 1 reply | |
| 12/13 | regulator: da9063: let the core handle the monitorsdrivers/ | +4 | 0 replies | |
| 13/13 | regulator: bd718x7: let the core handle the monitorsdrivers/ | +10 | 1 reply |
Reviews trailers per patch
6 of 13 patches have a Reviewed-by or Acked-by.
| Patch | Matti Vaittinen |
|---|---|
| 1/13 | |
| 2/13 | R-b |
| 3/13 | |
| 4/13 | R-b |
| 5/13 | R-b |
| 6/13 | R-b |
| 7/13 | |
| 8/13 | |
| 9/13 | |
| 10/13 | |
| 11/13 | R-b |
| 12/13 | |
| 13/13 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH RFC v4 00/13] regulator: dynamic voltage monitoring support
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.
After feedback from Matti, the new approach doesn't disable the monitors of disabled regulators anymore (except the respective workaround property is set). Additionally, the core differs between initialization and "workaround handling" when it comes to -EOPNOTSUPP.
1/13 is temporary implemented by me now and fixes a bug found by Martin
Fuzzey [1] which can be removed once a follow-up is received.
2/13 introduces a new op to read out the active monitors. 3/13 implements the new op for the da9063.
4/13 implements the new op for the bd718x7 (untested).
5/13 introduces the new "workaround properties".
6/13 ensure that the required regulator ops are implemented. 7/13 find all active regulator monitors the DT is not aware of. 8/13 factors out the existing monitor handling into an own function. {9,10,11}/13 implements the workaround properties in the core. 12/13 implements mon_disable_reg_disabled for da9063.
13/13 implements mon_disable_reg_set_higher for bd718x7 (untested).
As far as I could tell from the implementations, the other two PMICs with voltage protection support (max597x, bd9576) don't require workarounds.
Thanks & best regards,
Benjamin
[1] https://lore.kernel.org/all/[email protected]/
---
Changes in v4:
- introduce helper to handle the monitor state according to the workarounds
- split up commits per workaround implementation
- don't disable monitors of disabled regulators anymore
- implement monitor getter for the da9063
- workarounds are now per-monitor instead of "global"
- require defined ops for workarounds
- ensure that active monitoring is known on regulators with workarounds
- re-enable monitors only if they were disabled
- Link to v3: https://lore.kernel.org/r/[email protected]
---
Benjamin Bara (13):
regulator: da9063: fix null pointer deref with partial DT config
regulator: add getter for active monitors
regulator: da9063: implement get_active_protections()
regulator: bd718x7: implement get_active_protections()
regulator: introduce properties for monitoring workarounds
regulator: set required ops for monitoring workarounds
regulator: find active protections during initialization
regulator: move monitor handling into own function
regulator: implement mon_disable_reg_disabled
regulator: implement mon_disable_reg_set_{higher,lower}
regulator: implement mon_unsupported_reg_modes
regulator: da9063: let the core handle the monitors
regulator: bd718x7: let the core handle the monitors
drivers/regulator/bd718x7-regulator.c | 210 +++++++------------ drivers/regulator/core.c | 370 ++++++++++++++++++++++++++++------ drivers/regulator/da9063-regulator.c | 33 ++- include/linux/regulator/driver.h | 28 +++ 4 files changed, 439 insertions(+), 202 deletions(-)
---
base-commit: f1fcbaa18b28dec10281551dfe6ed3a3ed80e3d6
change-id: 20230419-dynamic-vmon-e08daa0ac7ad
Best regards,
Signature · 1 line
Benjamin Bara <[email protected]>