Version 2 with thanks to Sam Ravnborg, Mariusz Kozlowski, David Brownelland Laura Lawrence for their comments.

This patch series provides a generic framework to allow device driversto control voltage and current regulators on SoC based devices (e.g.phones, gps, media players).

The intention is to allow systems to dynamically control regulatoroutput in order to save power and prolong battery life. This applies toboth voltage regulators (where voltage output is controllable) andcurrent sinks (where current output is controllable).

The framework is designed around SoC based devices but may also berelevant to non SoC devices. It's also been designed against two PowerManagement ICs (PMICs) currently on the market - namely the FreescaleMC13783 and the Wolfson WM8350. However it is quite generic and shouldapply to all PMICs.

The framework provides several interfaces :-

1. Client or Consumer driver API.

This uses a similar API to the kernel clock interface in that clientor consumer drivers can get and put a regulator (like they can withclocks atm) and get/set voltage, current, mode, enable and disable. Thisshould allow clients complete control over their supply voltage andcurrent. This API also compiles out if not in use so drivers can bereused in systems with no PMIC power control.

2. Regulator driver API.

This allows regulator drivers to register their regulators and provideoperations to the core. It also has a notifier call chain forpropagating regulator events to clients.

3. Platform API.

This API is for platform/device specific code and allows the creationof voltage/current domains (with constraints) for each regulator. It canprovide regulator constraints that will prevent device damage throughover voltage or over current caused by buggy client drivers. It alsoallows the creation of a regulator tree whereby some regulators aresupplied by others (similar to a clock tree).

4. Userspace.

The framework also exports a lot of useful voltage/current data touserspace via sysfs. This could be used to monitor device and regulatorpower and status.