LKML Archive on
help / color / mirror / Atom feed
From: David Brownell <>
To: Liam Girdwood <>
	Andrew Morton <>,
	linux-kernel <>
Subject: Re: [UPDATED v3][PATCH 1/7] regulator: consumer interface
Date: Fri, 7 Mar 2008 19:43:14 -0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <1204827056.15360.147.camel@a10323.wolfsonmicro.main>

On Thursday 06 March 2008, Liam Girdwood wrote:
> +static inline int uA_to_A(int uA) { return uA / 1000000; }

So:  999999 uA == 0A ... should DIV_ROUND_UP() or another
rounding function be involved in some of these conversions?
Or maybe the dividing conversions should not be provided, and
code should just be doing math in units that don't encourage
such problems to appear.  I don't think one rounding policy
can fit all (including truncation, as above).

> +struct regulator *__must_check regulator_get(struct device *dev,
> +                                            const char *id);

The semantics of "id" and "dev" are unspecified in this patch,
so this isn't a good definition of the consumer interface!

Plus, that works more like a "lookup" than a "get" ... the
usual convention is that "get" and "put" update refcounts.
But I think I see an assumption here that a regulator may
have only one user...

> +int regulator_set_voltage(struct regulator *regulator, int uV);

You described a mode where consumers could set ranges that
might overlap (e.g. 1.6 to 1.9V, 1.8 to 2.0) and the result
would be some compatible result.  But I don't see how that
could be achieved, since that's the only call to provide
a consumer's constraints.

Presumably one configures a voltage then enables it?  How
does one turn a voltage supply on or off?  I'm guessing
that zero volts doesn't equate to "off"...

Something that's lacking here is simple examples.  Like:  how
do I get the power supply associated with an MMC/SD card socket,
turn it on (to, say, 3V3), set it to supply a different voltage
(maybe 1V8), then turn it off?  How would I cope with that
voltage supply being shared by two sockets, with cards that may
support different voltage ranges and have different current
requirements?  (Configurations of interest include two cards
that can coexist at 1V8, and two that can't ... one might not
support 1V8, or it might demand too much power.  Also, zero
and one cards present.)

- Dave

  reply	other threads:[~2008-03-08  3:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-06 18:10 Liam Girdwood
2008-03-08  3:43 ` David Brownell [this message]
2008-03-09 11:10   ` Liam Girdwood
2008-03-11  0:39     ` David Brownell
2008-03-11 10:20       ` Liam Girdwood
2008-03-11 21:36         ` David Brownell
2008-03-11 22:25           ` David Brownell
2008-03-12  0:00             ` Mark Brown
2008-03-12  7:31               ` David Brownell
2008-03-12 13:02                 ` Mark Brown
2008-03-12 21:52                   ` David Brownell
2008-03-12 23:26                     ` ian
2008-03-13  4:39                       ` David Brownell
2008-03-12 23:57                     ` Mark Brown
2008-03-13  5:08                       ` David Brownell
2008-03-13 12:00                         ` Mark Brown
2008-03-11  2:00     ` David Brownell
2008-03-11 15:19       ` Liam Girdwood
2008-03-12  6:29         ` David Brownell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \
    --subject='Re: [UPDATED v3][PATCH 1/7] regulator: consumer interface' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).