From patchwork Tue Sep 1 02:10:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Dannenberg X-Patchwork-Id: 7102421 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0FB92BF036 for ; Tue, 1 Sep 2015 02:11:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4A40720697 for ; Tue, 1 Sep 2015 02:11:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 65F0420696 for ; Tue, 1 Sep 2015 02:11:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754736AbbIACLX (ORCPT ); Mon, 31 Aug 2015 22:11:23 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:57518 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753606AbbIACLV (ORCPT ); Mon, 31 Aug 2015 22:11:21 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t812AtIo023211; Mon, 31 Aug 2015 21:10:55 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t812AtD2010354; Mon, 31 Aug 2015 21:10:55 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Mon, 31 Aug 2015 21:10:54 -0500 Received: from beast.tx.rr.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t812AkYT004175; Mon, 31 Aug 2015 21:10:52 -0500 From: Andreas Dannenberg To: Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , Laurentiu Palcu , Krzysztof Kozlowski CC: , , Andreas Dannenberg Subject: [PATCH 02/13] power: bq24257: Add dead battery reporting Date: Mon, 31 Aug 2015 21:10:24 -0500 Message-ID: <1441073435-12349-3-git-send-email-dannenberg@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441073435-12349-1-git-send-email-dannenberg@ti.com> References: <1441073435-12349-1-git-send-email-dannenberg@ti.com> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A missing/disconnected battery is now reported as dead rather than an unspecified failure via the charger's sysfs health property. $ cat health Dead Signed-off-by: Andreas Dannenberg --- drivers/power/bq24257_charger.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/power/bq24257_charger.c b/drivers/power/bq24257_charger.c index db81356..0b34528 100644 --- a/drivers/power/bq24257_charger.c +++ b/drivers/power/bq24257_charger.c @@ -274,6 +274,10 @@ static int bq24257_power_supply_get_property(struct power_supply *psy, val->intval = POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE; break; + case FAULT_NO_BAT: + val->intval = POWER_SUPPLY_HEALTH_DEAD; + break; + default: val->intval = POWER_SUPPLY_HEALTH_UNSPEC_FAILURE; break;