public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* regulators: creating a regulator device for the AC/USB/BAT/charge component of a PMIC?
@ 2012-07-26 18:02 Stephen Warren
  2012-07-26 21:01 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Warren @ 2012-07-26 18:02 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: Laxman Dewangan, linux-kernel@vger.kernel.org

Mark, Liam,

A couple of the regulators I'm looking at (I guess many/most in fact)
are structured as:

Battery, AC, USB, ... -> PMIC -> main output (unregulated?)

main output -> PMIC input pins for some of the SW-controllable
regulators. This is an external connection on the board.

Should this "main output" be represented as a regulator itself?

In more graphical/concrete terms, take the TPS6586x:

        +---------------+
        |               |
AC  --> | \             |
USB --> |  |------> SYS | >---\
BAT --> | /             |     |
        |       VIN_SM0 | <---/
        |         v     |
        |       SM0 OUT | ---> other devices
        ...

... where SM0 is one of the regulators the driver already exposes.

I assume SYS should be an explicit regulator device, because all the
other regulators within the PMIC can be set up to require that a supply
be specified (in the DT, a vin-sm0-supply property is mandatory for the
TPS6586x driver), so some regulator object must exist and be provided as
the supply.

The alternative would be to this would be to ignore this aspect of the
PMIC, and just create a standalone fixed regulator to act as the supply
for the SM0 regulator. However, this doesn't seem like an accurate model
of the HW.

However, some of the regulators in the TPS6586x at least are fed
directly from the SYS output by an internal connection within the PMIC
(e.g. LDO5). Currently, the driver sets up these regulators as having no
supply, which seems wrong too. Presumably the PMIC driver should
internally hook up its SYS as LDO5's supply without needing any platform
data or DT ldo5-supply property to do this?

What are your thoughts here?

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

* Re: regulators: creating a regulator device for the AC/USB/BAT/charge component of a PMIC?
  2012-07-26 18:02 regulators: creating a regulator device for the AC/USB/BAT/charge component of a PMIC? Stephen Warren
@ 2012-07-26 21:01 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2012-07-26 21:01 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Liam Girdwood, Laxman Dewangan, linux-kernel@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]

On Thu, Jul 26, 2012 at 12:02:31PM -0600, Stephen Warren wrote:

> A couple of the regulators I'm looking at (I guess many/most in fact)
> are structured as:

> Battery, AC, USB, ... -> PMIC -> main output (unregulated?)

Yes, that's very normal.

> Should this "main output" be represented as a regulator itself?

It can be if you like - most things will be depending on it, often what
people call the battery supply is actually the main power rail in the
schematic.  Having it there certainly won't do any harm and may be
useful.

> However, some of the regulators in the TPS6586x at least are fed
> directly from the SYS output by an internal connection within the PMIC
> (e.g. LDO5). Currently, the driver sets up these regulators as having no
> supply, which seems wrong too. Presumably the PMIC driver should
> internally hook up its SYS as LDO5's supply without needing any platform
> data or DT ldo5-supply property to do this?

Yes, I think if we're going to represent such supplies the driver should
just do it and not force everyone to cut'n'paste.  Though to be honest
if it's a supply that's purely internal to the primary PMIC there's no
real need, if the system core rail gets turned off software really isn't
an issue any more.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2012-07-26 21:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-26 18:02 regulators: creating a regulator device for the AC/USB/BAT/charge component of a PMIC? Stephen Warren
2012-07-26 21:01 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox