From: Sebastian Reichel <sre@ring0.de>
To: Thomas Elste <thomas.elste@imms.de>
Cc: linux-pm@vger.kernel.org
Subject: Re: [PATCH] power: bq24190_charger: Change first_time flag reset condition
Date: Fri, 29 May 2015 04:34:40 +0200 [thread overview]
Message-ID: <20150529023439.GA17735@earth> (raw)
In-Reply-To: <1432803932-5315-2-git-send-email-thomas.elste@imms.de>
[-- Attachment #1: Type: text/plain, Size: 1508 bytes --]
Hi,
On Thu, May 28, 2015 at 11:05:32AM +0200, Thomas Elste wrote:
> The initial register reset of BQ24190 generates a charger status change
> whose propagation via power_supply_changed is prevented using a flag.
> This flag gets never reset so all following events are ignored as well
> leading for example to userspace not detecting charger connects/disconnects.
>
> Therefor change the reset condition of first_time flag, so only the
> propagation of the first charger status change is prevented.
>
> Signed-off-by: Thomas Elste <thomas.elste@imms.de>
> ---
> drivers/power/bq24190_charger.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/power/bq24190_charger.c b/drivers/power/bq24190_charger.c
> index 407c4af..052db78 100644
> --- a/drivers/power/bq24190_charger.c
> +++ b/drivers/power/bq24190_charger.c
> @@ -1258,10 +1258,13 @@ static irqreturn_t bq24190_irq_handler_thread(int irq, void *data)
> * register reset so we should ignore that one (the very first
> * interrupt received).
> */
> - if (alert_userspace && !bdi->first_time) {
> - power_supply_changed(bdi->charger);
> - power_supply_changed(bdi->battery);
> - bdi->first_time = false;
> + if (alert_userspace) {
> + if (!bdi->first_time) {
> + power_supply_changed(bdi->charger);
> + power_supply_changed(bdi->battery);
> + } else {
> + bdi->first_time = false;
> + }
> }
>
> out:
Thanks, queued for 4.2.
-- Sebastian
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2015-05-29 2:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-28 9:05 bq24190_charger: no status updates Thomas Elste
2015-05-28 9:05 ` [PATCH] power: bq24190_charger: Change first_time flag reset condition Thomas Elste
2015-05-29 2:34 ` Sebastian Reichel [this message]
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=20150529023439.GA17735@earth \
--to=sre@ring0.de \
--cc=linux-pm@vger.kernel.org \
--cc=thomas.elste@imms.de \
/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).