From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757160AbaGWMDe (ORCPT ); Wed, 23 Jul 2014 08:03:34 -0400 Received: from mail.kernel.org ([198.145.19.201]:38377 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753413AbaGWMDd (ORCPT ); Wed, 23 Jul 2014 08:03:33 -0400 Date: Wed, 23 Jul 2014 14:03:26 +0200 From: Sebastian Reichel To: Tony Lindgren Cc: Nishanth Menon , 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 Message-ID: <20140723120326.GA18172@earth.universe> References: <1401313610-14252-1-git-send-email-nm@ti.com> <1401313610-14252-2-git-send-email-nm@ti.com> <20140723092420.GE22006@atomide.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="liOOAslEiF7prFVr" Content-Disposition: inline In-Reply-To: <20140723092420.GE22006@atomide.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 23, 2014 at 02:24:20AM -0700, Tony Lindgren wrote: > * Nishanth Menon [140528 14:48]: > > TWL4030's Battery Charger seems to be designed for non-hotpluggable > > batteries. > >=20 > > 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). > >=20 > > 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. > >=20 > > 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. > >=20 > > Reported-by: Russell King > > Tested-by: Tony Lindgren > > Signed-off-by: Nishanth Menon >=20 > 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. >=20 > 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/61a7784efd3c89ffb6242f29bce= e170dd7f55e6b -- Sebastian --liOOAslEiF7prFVr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJTz6SNAAoJENju1/PIO/qaHJkP/jIQ5vuKGdmU/31Rs09nPP06 aEHNQh1NTP80NgP0o/B3M3VOKxd3hA/2/CA5vld/RsxXoq70VYCv5wg+pF/AhtMs qBDnTqyRwxhzsGEgUvXBC/66mivljyzpT6yCjvIH8jblAZSqGomH/2195dA3WaIv 55NmZYpFrYFR04GgV+WwDEy9zjyZWDf00aEvgU0epJGsaWs1llGdsQK2/rht1Gxh UyswKHYNiY9tTKeY6+J6mi7Vd6Jfw7QaHXfFpw0dwc5CBXBXS26qC43qDbt6QhSz 98bWv7kD8boUci2O0xbCiuTcSoCkCbrn5RTtHBhWq5gUaSnUoEngkUzTXtnL6NBR EyxIml5RCqDgy31DbvzC4XM2Cr0eoqp8L0KnxRYheRJ8k+L6s2aVQngfOjrMJ/yX XnXQg0NOWOpBYe3pwV5H7Dv4EEafnJImkCh2omOkXMYipzUbYTzNzbSEUp9NQNTJ Uf2ytipj4mSFeFW4Ii+LQmCras2HOhiNqOqd1Sow2H2YOUUwxvSc00+LqlaDSQyq jz0QQTLAKG0fbmVq/z08a1vlbIpBQwvRBhltNTtb6SFVuffBe3d9wsNWPyI2X96R oT/QGsefrVlGaJVRB7dc32Q25CJBNHfzL+wHgX2P0OocSMudEnoVqWqzDyL4Tzd6 bt9B8Fi4GTEJt/Aydm2n =gvF8 -----END PGP SIGNATURE----- --liOOAslEiF7prFVr--