All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Sebastian Reichel <sre@kernel.org>
Cc: Nishanth Menon <nm@ti.com>,
	dbaryshkov@gmail.com, balbi@ti.com, linux@arm.linux.org.uk,
	dwmw2@infradead.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH V2 1/2] power: twl4030_charger: detect battery presence prior to enabling charger
Date: Wed, 23 Jul 2014 23:32:51 -0700	[thread overview]
Message-ID: <20140724063250.GG22006@atomide.com> (raw)
In-Reply-To: <20140723120326.GA18172@earth.universe>

* Sebastian Reichel <sre@kernel.org> [140723 05:05]:
> On Wed, Jul 23, 2014 at 02:24:20AM -0700, Tony Lindgren wrote:
> > * Nishanth Menon <nm@ti.com> [140528 14:48]:
> > > 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>
> > > Tested-by: Tony Lindgren <tony@atomide.com>
> > > Signed-off-by: Nishanth Menon <nm@ti.com>
> > 
> > Dmitry, can we please get this first patch merged? This is needed
> > on some omap3 platforms for DT based booting when no battery is
> > present.
> > 
> > Only the second patch in this series is still being discussed AFAIK.
> 
> applied to battery-2.6.git:
> 
> http://git.infradead.org/battery-2.6.git/commit/61a7784efd3c89ffb6242f29bcee170dd7f55e6b

Thanks!

Tony

WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 1/2] power: twl4030_charger: detect battery presence prior to enabling charger
Date: Wed, 23 Jul 2014 23:32:51 -0700	[thread overview]
Message-ID: <20140724063250.GG22006@atomide.com> (raw)
In-Reply-To: <20140723120326.GA18172@earth.universe>

* Sebastian Reichel <sre@kernel.org> [140723 05:05]:
> On Wed, Jul 23, 2014 at 02:24:20AM -0700, Tony Lindgren wrote:
> > * Nishanth Menon <nm@ti.com> [140528 14:48]:
> > > 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>
> > > Tested-by: Tony Lindgren <tony@atomide.com>
> > > Signed-off-by: Nishanth Menon <nm@ti.com>
> > 
> > Dmitry, can we please get this first patch merged? This is needed
> > on some omap3 platforms for DT based booting when no battery is
> > present.
> > 
> > Only the second patch in this series is still being discussed AFAIK.
> 
> applied to battery-2.6.git:
> 
> http://git.infradead.org/battery-2.6.git/commit/61a7784efd3c89ffb6242f29bcee170dd7f55e6b

Thanks!

Tony

  reply	other threads:[~2014-07-24  6:32 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-28 21:46 [PATCH V2 0/2] power: twl4030_charger: cleanup to handle various battery handling error conditions Nishanth Menon
2014-05-28 21:46 ` Nishanth Menon
2014-05-28 21:46 ` Nishanth Menon
2014-05-28 21:46 ` [PATCH V2 1/2] power: twl4030_charger: detect battery presence prior to enabling charger Nishanth Menon
2014-05-28 21:46   ` Nishanth Menon
2014-05-28 21:46   ` Nishanth Menon
2014-07-23  9:24   ` Tony Lindgren
2014-07-23  9:24     ` Tony Lindgren
2014-07-23 12:03     ` Sebastian Reichel
2014-07-23 12:03       ` Sebastian Reichel
2014-07-24  6:32       ` Tony Lindgren [this message]
2014-07-24  6:32         ` Tony Lindgren
2014-05-28 21:46 ` [PATCH V2 2/2] power: twl4030_charger: attempt to power off in case of critical events Nishanth Menon
2014-05-28 21:46   ` Nishanth Menon
2014-05-28 21:46   ` Nishanth Menon
2014-06-04 10:04   ` Grazvydas Ignotas
2014-06-04 10:04     ` Grazvydas Ignotas
2014-06-04 13:01     ` Nishanth Menon
2014-06-04 13:01       ` Nishanth Menon
2014-06-04 13:01       ` Nishanth Menon
2014-06-04 22:30       ` Grazvydas Ignotas
2014-06-04 22:30         ` Grazvydas Ignotas
2014-06-05 17:06         ` Nishanth Menon
2014-06-05 17:06           ` Nishanth Menon
2014-06-05 17:06           ` Nishanth Menon
2014-06-14 22:26         ` Pavel Machek
2014-06-14 22:26           ` Pavel Machek
2014-06-14 22:21   ` Pavel Machek
2014-06-14 22:21     ` Pavel Machek
2014-06-14 22:28     ` Nishanth Menon
2014-06-14 22:28       ` 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=20140724063250.GG22006@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 \
    --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 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.