From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754941AbaEIBDU (ORCPT ); Thu, 8 May 2014 21:03:20 -0400 Received: from mho-03-ewr.mailhop.org ([204.13.248.66]:47848 "EHLO mho-01-ewr.mailhop.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751295AbaEIBDT (ORCPT ); Thu, 8 May 2014 21:03:19 -0400 X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 99.127.230.128 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/kEC5pJc0k3Qnn6I4H+4Cq Date: Thu, 8 May 2014 18:03:12 -0700 From: Tony Lindgren To: Nishanth Menon Cc: Felipe Balbi , Russell King , Linux Kernel Mailing List , dbaryshkov@gmail.com, Linux OMAP Mailing List , dwmw2@infradead.org, Linux ARM Kernel Mailing List Subject: Re: [PATCH] power: twl4030_charger: clear IRQs after handling them Message-ID: <20140509010312.GK2198@atomide.com> References: <1397661299-31342-1-git-send-email-balbi@ti.com> <20140416163526.GA3049@atomide.com> <535ACC62.102@ti.com> <20140425210036.GO29632@saruman.home> <20140507002421.GA19711@kahuna> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140507002421.GA19711@kahuna> 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 * Nishanth Menon [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 > Signed-off-by: Nishanth Menon 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