Skip to content

regulator: Send events on over current condition

[email protected] linux-devicetree lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3regulator: core: Add over current changed eventinclude/linux/regulator/consumer.h+2 -07 replies
2/3regulator: fixed: Handle optional overcurrent pindrivers/regulator/fixed.c include/linux/regulator/fixed.h+50 -00 replies
3/3regulator: fixed: dt: Allow an optional over current pinDocumentation/devicetree/bindings/regulator/fixed-regulator.txt drivers/regulator/fixed.c+12 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] regulator: Send events on over current condition

From: Axel Haslam <[email protected]>

Some usb drivers rely on external power switches/regulators to handle the port vbus. Some of these drivers currently are still using gpios for the enable pin and also the over current indicator.

We would like to move these drivers to use a regulator instead, because it makes the driver generic allowing to use in the future any type of regulator (maybe i2c based), And also it helps removing some code making DT migration simpler and avoiding to add new bindings each time.

Vbus control is easy enough as the infrastructure to handle this is in place using a fixed regulator for the simple gpio case.

Handling of the over current pin, however, needs some modifications to the regulator framework, to be able to transmit the over current pin status to the usb driver.

This is an attempt to extend the fixed regulator to handle the over current pin, and send the status via a notification with minimal framework changes, avoiding to use get_status which would have to be exported to consumers or get_mode which is not supposed to be used for this purpose.

Axel Haslam (3):
regulator: core: Add over current changed event
regulator: fixed: Handle optional overcurrent pin
regulator: fixed: dt: Allow an optional over current pin

 .../bindings/regulator/fixed-regulator.txt         |  4 ++
 drivers/regulator/fixed.c                          | 55 ++++++++++++++++++++++
 include/linux/regulator/consumer.h                 |  2 +
 include/linux/regulator/fixed.h                    |  3 ++
 4 files changed, 64 insertions(+)
Signature · 1 line
1.9.1