From patchwork Sat Apr 1 20:25:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liam Breck X-Patchwork-Id: 9658281 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4352560353 for ; Sat, 1 Apr 2017 20:25:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3477D2845E for ; Sat, 1 Apr 2017 20:25:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 287462852B; Sat, 1 Apr 2017 20:25:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DD802845E for ; Sat, 1 Apr 2017 20:25:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751899AbdDAUZh (ORCPT ); Sat, 1 Apr 2017 16:25:37 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36806 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751882AbdDAUZg (ORCPT ); Sat, 1 Apr 2017 16:25:36 -0400 Received: by mail-pf0-f193.google.com with SMTP id r137so4771384pfr.3 for ; Sat, 01 Apr 2017 13:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=cLbxsO1kBuiglPGnblE90Sz6z1fu1mmeF4KhEZVPwS4=; b=qKukyqRTGky9z+P2UiQxzIpYg1fmQG7KOsaBIz45wZSgVCEqItO5JpztojfuDrJgLf t+hxAeWX7hgKc0OUBvLmxaEAxh3tEwLTZWFsfheBbE++TwZ4JMYNtIKcPDGqqIyEhNhg STESckGCkO0Y1GPkZHKhQlY2klaStVo62LoxAdZpJ2b3zx3vYTZVJJ37+2fGPVjHz9Uh RPz0iRlOGrd10wsKrhZIKUF1H3VLMIrxbCPtCaKX5Jz89cotn5PHqWphn+/plrociWxY KEdKz+/oo4l1h+nptax/il5sF9w7wssk3o3H95ZjUSAdsIOqH4jHUmSOUCpOYxX6YEKB 6keg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=cLbxsO1kBuiglPGnblE90Sz6z1fu1mmeF4KhEZVPwS4=; b=VM0Ojj920HyLrGqax9/QfqaaC95RBtTH2bBH9YijJz9aRzqGgqfvpDD20etU3kGGjh y22m44eFKnPsqNMg9IFWsZFcpWc0R7h8sKVQT+tGPj3Vjpo8g0RxquMnVOhydH/yohTN BexDb0djUvjSyXaWXXBTcW4B+htH4k4/ZXhyZxaS/q9lEy7SVUhcLF7+JunhqcxSEwNd RPoCtvXiiNMwqc4R25zMSgzzpOVhnapDvICxCe9fwIqYwrWXFR3AyMv2jvNDWslkUDYg cscJb/5Qh+KxC4Dq0Mm+s3ZQH6DDOMl7cwxLHSDuUWNQp4wmTGmH3symC/CuzqK1Hj2b 4Mhg== X-Gm-Message-State: AFeK/H0sf2r8AeJ5G/1xt2zIOoDra6tH3JRT9X+PpL7j7FZ/fpXlyAINcm2svgDat2Zqzw== X-Received: by 10.99.45.197 with SMTP id t188mr9607114pgt.209.1491078336259; Sat, 01 Apr 2017 13:25:36 -0700 (PDT) Received: from localhost.localdomain (c-73-223-93-234.hsd1.ca.comcast.net. [73.223.93.234]) by smtp.gmail.com with ESMTPSA id m20sm17575831pgd.32.2017.04.01.13.25.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Apr 2017 13:25:35 -0700 (PDT) From: Liam Breck To: Sebastian Reichel , linux-pm@vger.kernel.org Cc: Tony Lindgren , Hans de Goede , Liam Breck Subject: [PATCH v3 1/4] power: bq24190_charger: Limit over/under voltage fault logging Date: Sat, 1 Apr 2017 13:25:16 -0700 Message-Id: <20170401202519.16280-2-liam@networkimprov.net> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170401202519.16280-1-liam@networkimprov.net> References: <20170401202519.16280-1-liam@networkimprov.net> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Liam Breck If the charger is unplugged before the battery is full we may see an over/under voltage fault. Ignore this rather then emitting a message or uevent. This prevents messages like these getting logged on charger unplug/replug: bq24190-charger 15-006b: Fault: boost 0, charge 1, battery 0, ntc 0 bq24190-charger 15-006b: Fault: boost 0, charge 0, battery 0, ntc 0 Cc: Tony Lindgren Cc: Hans de Goede Signed-off-by: Liam Breck Acked-by: Tony Lindgren --- drivers/power/supply/bq24190_charger.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c index a699ad3..64a48b9 100644 --- a/drivers/power/supply/bq24190_charger.c +++ b/drivers/power/supply/bq24190_charger.c @@ -1222,8 +1222,13 @@ static void bq24190_check_status(struct bq24190_dev_info *bdi) } } while (f_reg && ++i < 2); + /* ignore over/under voltage fault after disconnect */ + if (f_reg == (1 << BQ24190_REG_F_CHRG_FAULT_SHIFT) && + !(ss_reg & BQ24190_REG_SS_PG_STAT_MASK)) + f_reg = 0; + if (f_reg != bdi->f_reg) { - dev_info(bdi->dev, + dev_warn(bdi->dev, "Fault: boost %d, charge %d, battery %d, ntc %d\n", !!(f_reg & BQ24190_REG_F_BOOST_FAULT_MASK), !!(f_reg & BQ24190_REG_F_CHRG_FAULT_MASK),