From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Brian Swetland <swetland@google.com>,
Anton Vorontsov <cbou@mail.ru>,
David Woodhouse <dwmw2@infradead.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: power_supply class/framework question
Date: Mon, 10 Aug 2009 19:28:25 +0400 [thread overview]
Message-ID: <20090810152825.GA4624@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20090810150011.GA1471@ucw.cz>
On Mon, Aug 10, 2009 at 05:00:11PM +0200, Pavel Machek wrote:
> Hi!
>
> > (feel free to redirect me to a different mailing list if there's a
> > more appropriate place to ask this question)
> >
> > I'm working on cleaning up some code to more correctly use the power
> > supply framework (have the battery driver receive notification from
> > the wall/usb power supplies, etc), and ran into a slight snag. For
> > mobile usb powered devices, we need to know how much current can
> > safely be consumed by the charge circuit -- generally this is one of:
> > none, <500mA or 1000mA, which correspond to "no power supply", "usb
> > power supply", or "wall power supply".
>
> Actuallly, it is one of 'none', 100mA (min power USB has to supplly),
> 500mA (max powe USB can supply by spec), 1A (wall).
>
> For example sharp zaurus can only supply cca 300mA out of its port.
>
> > I can use power_supply_am_i_supplied() to determine if I'm receiving
> > power, but there's no way to determine either how much (if I have one
> > power supply that indicates max current available) or which supply (if
> > I define a separate "ac" and "usb" power supply).
>
> Should am_i_supplied() just return miliamps?
Or enum power_supply_type, with the following priority:
mains (wall), usb, battery?
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
next prev parent reply other threads:[~2009-08-10 15:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-08 2:19 power_supply class/framework question Brian Swetland
2009-08-10 15:00 ` Pavel Machek
2009-08-10 15:28 ` Anton Vorontsov [this message]
2009-08-10 16:14 ` Brian Swetland
2009-08-10 16:35 ` Mark Brown
2009-08-10 16:53 ` Brian Swetland
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090810152825.GA4624@oksana.dev.rtsoft.ru \
--to=avorontsov@ru.mvista.com \
--cc=cbou@mail.ru \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=swetland@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.