LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [UPDATED v3][PATCH 0/7] regulator: voltage and current regulator framework
@ 2008-03-06 18:10 Liam Girdwood
  2008-06-14 12:34 ` Krzysztof Helt
  0 siblings, 1 reply; 2+ messages in thread
From: Liam Girdwood @ 2008-03-06 18:10 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-arm-kernel, linux-kernel, Mark Brown

Updated with comments received from v2. I've also added more in code
comments to hopefully make the review a little easier to read through.

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

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

The framework is designed around SoC based devices but may also be
relevant to non SoC devices. It's also been designed against two Power
Management ICs (PMICs) currently on the market - namely the Freescale
MC13783 and the Wolfson WM8350. However it is quite generic and should
apply 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 client
or consumer drivers can get and put a regulator (like they can with
clocks atm) and get/set voltage, current, mode, enable and disable. This
should allow clients complete control over their supply voltage and
current. This API also compiles out if not in use so drivers can be
reused in systems with no PMIC power control.

 2. Regulator driver API.

  This allows regulator drivers to register their regulators and provide
operations to the core. It also has a notifier call chain for
propagating regulator events to clients.

 3. Platform API.

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

 4. Userspace.

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

Fwiw, there is a project page here :-

http://opensource.wolfsonmicro.com/node/15

and code in our public git tree that currently shows this API
in use:-

http://opensource.wolfsonmicro.com/cgi-bin/gitweb.cgi?p=linux-2.6-audioplus.git;a=shortlog;h=imx31

Patch follows.

Liam


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

* Re: [UPDATED v3][PATCH 0/7] regulator: voltage and current regulator framework
  2008-03-06 18:10 [UPDATED v3][PATCH 0/7] regulator: voltage and current regulator framework Liam Girdwood
@ 2008-06-14 12:34 ` Krzysztof Helt
  0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Helt @ 2008-06-14 12:34 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: Andrew Morton, linux-arm-kernel, linux-kernel

On Thu, 06 Mar 2008 18:10:30 +0000
Liam Girdwood <lg@opensource.wolfsonmicro.com> wrote:

> Updated with comments received from v2. I've also added more in code
> comments to hopefully make the review a little easier to read through.
> 
> This patch series provides a generic framework to allow device drivers
> to control voltage and current regulators on SoC based devices (e.g.
> phones, gps, media players).
> 

>  4. Userspace.
> 
>   The framework also exports a lot of useful voltage/current data to
> userspace via sysfs. This could be used to monitor device and regulator
> power and status.
> 

IMO, this work should be merged into kernel hwmon project. The hwmon
project has already sysfs API to read voltages and currents. Hwmon guys should
be able to extend the API to cover also possibility to change (set) voltages
and currents (as they do currently with fans).

The advantage is that monitoring of regulators (reading voltages and currents)
would be instantially supported by all existing lm-sensors tool.

You should send your patches to kernel hwmon list: lm-sensors@lm-sensors.org

Kind regards,
Krzysztof

----------------------------------------------------------------------
Gdzie warto jechac na urlop? Sprawdz!
kliknij >>> http://link.interia.pl/f1e32


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

end of thread, other threads:[~2008-06-14 12:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-06 18:10 [UPDATED v3][PATCH 0/7] regulator: voltage and current regulator framework Liam Girdwood
2008-06-14 12:34 ` Krzysztof Helt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).