linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Nishanth Menon <nm@ti.com>
Cc: Felipe Balbi <balbi@ti.com>,
	Russell King <linux@arm.linux.org.uk>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	dbaryshkov@gmail.com,
	Linux OMAP Mailing List <linux-omap@vger.kernel.org>,
	dwmw2@infradead.org,
	Linux ARM Kernel Mailing List
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] power: twl4030_charger: clear IRQs after handling them
Date: Thu, 8 May 2014 18:03:12 -0700	[thread overview]
Message-ID: <20140509010312.GK2198@atomide.com> (raw)
In-Reply-To: <20140507002421.GA19711@kahuna>

* Nishanth Menon <nm@ti.com> [140506 17:25]:
> Subject: [PATCH] power: twl4030_charger: detect battery presence prior to
>  enabling charger
> 
> TWL4030's Battery Charger seems to be designed for non-hotpluggable
> batteries.
> 
> If battery is not present in the system, BATSTS is always set with the
> expectation that software will take actions to move to a required safe
> state (could be power down or disable various charger paths).
> 
> It does not seem possible even by manipulating the edge detection
> of the event (using BCIEDR2 register) to have a consistent hotplug
> handling. This seems to be the result of BATSTS interrupt generated
> when the thermistor of the battery pack is disconnected from the
> dedicated ADIN1 pin. Clearing the status just results in the status
> being regenerated by the monitoring ADC(MADC) and disabling the
> edges of event just makes hotplug no longer function. The only
> other option is to disable the detection of the MADC by disabling
> BCIMFEN4::BATSTSMCHGEN (battery presence detector) - but then, we can
> never again detect battery reconnection.
> 
> So, detect battery presence based on precharge(which is hardware
> automatic state) or default main charger configuration at the time of
> probe and enable charger logic only if battery was present.
> 
> Reported-by: Russell King <linux@arm.linux.org.uk>
> Signed-off-by: Nishanth Menon <nm@ti.com>

Gets rid of the errors for me if CONFIG_CHARGER_TWL4030=y.
Looks like we don't have that enabled by default in
omap2plus_defconfig which explain why it's taken so long to
notice this one:

Tested-by: Tony Lindgren <tony@atomide.com>

  reply	other threads:[~2014-05-09  1:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16 15:14 [PATCH] power: twl4030_charger: clear IRQs after handling them Felipe Balbi
2014-04-16 16:35 ` Tony Lindgren
2014-04-25 20:58   ` Nishanth Menon
2014-04-25 21:00     ` Felipe Balbi
2014-05-07  0:24       ` Nishanth Menon
2014-05-09  1:03         ` Tony Lindgren [this message]
2014-05-09 12:39           ` Nishanth Menon

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=20140509010312.GK2198@atomide.com \
    --to=tony@atomide.com \
    --cc=balbi@ti.com \
    --cc=dbaryshkov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=nm@ti.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;
as well as URLs for NNTP newsgroup(s).