From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: cbouatmailru@gmail.com, sameo@openedhand.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] power_supply: Add support for WM8350 PMU
Date: Tue, 11 Nov 2008 13:11:16 +0000 [thread overview]
Message-ID: <20081111131116.GA23180@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <20081110154330.f95ec239.akpm@linux-foundation.org>
On Mon, Nov 10, 2008 at 03:43:30PM -0800, Andrew Morton wrote:
> Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
> An idle question...
[Reordered for conveninece in replying.]
> The above constitutes a sort-of userspace interface. A number of the
> things which are being reported there are fairly common to the
> technology and other drivers will be able to report them.
> But afaict this interface is unique to this particular driver. Has any
> thought been given to standardising this interface across all similar
> drivers? Too messy?
I've got several answers...
> > + supply = "Battery";
> > + supply = "USB";
> > + supply = "Line";
> > + supply = "Battery and USB";
This sysfs file is just redundant and could be removed.
> > + charge = "Charger Off";
> > + charge = "Trickle Charging";
> > + charge = "Fast Charging";
There's some support for this already (which implemented in the driver)
but it doesn't distinguish between fast and trickle charging. It's
useful to know for debugging systems but I wasn't able to convince
myself it was generically useful enough to add to the class ABI,
especially given the existing boolean reporting.
> > + dev_err(wm8350->dev, "battery too hot\n");
> > + dev_err(wm8350->dev, "battery too cold\n");
> > + dev_err(wm8350->dev, "battery failed\n");
> > + dev_err(wm8350->dev, "charger timeout\n");
These are a bit tricky with the WM8350 since the chip gives latched edge
notifications of errors but doesn't provide the current status directly.
There is some generic battery health status reporting in the interface
(though not quite so specific) but I wasn't comfortable supporting it
without being able to read back the current status.
> > + dev_dbg(wm8350->dev, "charger stopped\n");
> > + dev_dbg(wm8350->dev, "charger started\n");
> > + dev_dbg(wm8350->dev, "fast charger ready\n");
On a closer look it appears that started and stopped are already
notified to user space - the driver should be calling
power_supply_changed() when these happen. Reporting the fast charger
ready status would fall out if a standard interface for polling this
status were implemented.
> > + dev_warn(wm8350->dev, "battery < 3.9V\n");
> > + dev_warn(wm8350->dev, "battery < 3.1V\n");
> > + dev_warn(wm8350->dev, "battery < 2.85V\n");
I'm ambivalent on these ones, especially given that none of the other
health issues are being reported.
next prev parent reply other threads:[~2008-11-11 13:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-06 15:15 [PATCH] power_supply: Add support for WM8350 PMU Mark Brown
2008-11-10 23:43 ` Andrew Morton
2008-11-11 13:11 ` Mark Brown [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-11-11 15:08 Mark Brown
2008-11-12 16:47 ` Samuel Ortiz
2008-11-12 16:49 ` Mark Brown
2008-11-12 16:57 ` Samuel Ortiz
2008-11-14 1:20 ` Anton Vorontsov
2008-11-16 22:31 ` Samuel Ortiz
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=20081111131116.GA23180@rakim.wolfsonmicro.main \
--to=broonie@opensource.wolfsonmicro.com \
--cc=akpm@linux-foundation.org \
--cc=cbouatmailru@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sameo@openedhand.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox