From: Karl-Heinz Schneider <karl-heinz@schneider-inet.de>
To: Rob Herring <robh@kernel.org>
Cc: Phil Reid <preid@electromag.com.au>,
mark.rutland@arm.com, sre@kernel.org, dbaryshkov@gmail.com,
dwmw2@infradead.org, devicetree@vger.kernel.org,
linux-pm@vger.kernel.org
Subject: Re: [PATCH 1/1] power: sbs-manager: Add interrupt support and battery detect gpios
Date: Wed, 27 Jul 2016 23:08:27 +0200 [thread overview]
Message-ID: <1469653707.27666.22.camel@amnesix> (raw)
In-Reply-To: <20160727144609.GA12462@rob-hp-laptop>
Am Mittwoch, den 27.07.2016, 09:46 -0500 schrieb Rob Herring:
> On Mon, Jul 25, 2016 at 03:50:03PM +0800, Phil Reid wrote:
> > This patch added irq support for the SMBALERT pin and notification of
> > the battery removal / insertion. The sbs manager would typically be
> > used with the corresponding sbs-battery driver that currently uses a
> > gpio input for battery presence and interrupt. To remain compatible with
> > that existing driver this patch implements GPIO inputs with interrupt
> > support. IRQ masking is performed in software as the hardware does not
> > support masking of notifications from each battery.
> > In addition a power_supply change notification is generated for the sbs
> > manager device when the AC present flag is changed.
> > Tested with LTC1760 and dual sbs compatible batteries.
>
> Please don't submit a binding and immediately turn around and add to it.
> While that is often preferred for drivers or kernel features, bindings
> should be complete as possible and not evolve. Combine this with your
> previous patch add sbs-mgr if that hasn't been accepted yet.
>
> IMO, the sbs-bat should just be a interrupt and making it and this
> binding a GPIO is overkill. Since batteries nodes using this will be
> new, there's no reason the driver can't be updated to support
> interrupts.
>
> Also, I'm not even convinced you need the sbs-mgr to be an
> interrupt-controller. Is this anything more that just wire-OR'ed
> interrupt lines which can be handled as shared irq? Does reading
> SBSM_CMD_BATSYSSTATE have a side effect for example?
Yes, according to the Datasheed it clears SMBALERT#.
>
> Rob
SMBALERT is electrically an active low line which is pulled down by one
or more devices needing attention, isn't it? The I2C host driver or some
other instance need to implement support for it, the device driver may
register some sort of handler function (e.g by implementing struct
i2c_driver.alert function)
That's my understanding of the SMBALERT.
I once tried to implement the alert function and see if it get's called.
It didn't. At that point I didn't investigate further.
So, do I miss something or is that part incomplete/broken? I can only
find lm90 and ipmi_ssif which implement the callback.
--
Karl-Heinz
next prev parent reply other threads:[~2016-07-27 21:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-25 7:50 [PATCH 0/1] power: sbs-manager: Add interrupt support and battery detect gpios Phil Reid
2016-07-25 7:50 ` [PATCH 1/1] " Phil Reid
2016-07-27 14:46 ` Rob Herring
2016-07-27 21:08 ` Karl-Heinz Schneider [this message]
2016-07-28 2:11 ` Phil Reid
2016-07-28 9:01 ` Phil Reid
2016-07-28 15:45 ` Rob Herring
2016-07-31 14:04 ` Karl-Heinz Schneider
[not found] ` <1469973873.5299.9.camel-X5L7DgJ4l23oE99TX8zNy7NAH6kLmebB@public.gmane.org>
2016-08-01 6:52 ` Phil Reid
[not found] ` <ade6f7b9-dbaf-fd45-fd82-c3d69125ca8c-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
2016-08-23 19:58 ` Karl-Heinz Schneider
[not found] ` <1471982300.5080.17.camel-X5L7DgJ4l23oE99TX8zNy7NAH6kLmebB@public.gmane.org>
2016-08-24 1:37 ` Phil Reid
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=1469653707.27666.22.camel@amnesix \
--to=karl-heinz@schneider-inet.de \
--cc=dbaryshkov@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dwmw2@infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=preid@electromag.com.au \
--cc=robh@kernel.org \
--cc=sre@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).