Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp814236ybk; Wed, 13 May 2020 13:55:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyezo0Q4dLMRzKf0bg5BjVatOnmV7Ohtk3UXcft+vbB7a3VQCWAPEqklH8/lLvS5FRbko0x X-Received: by 2002:a17:906:2dc8:: with SMTP id h8mr898469eji.108.1589403314221; Wed, 13 May 2020 13:55:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589403314; cv=none; d=google.com; s=arc-20160816; b=Mzm1JLqzyIqeTApV0jG1jwiCo0j8HwK2yNjm3t/sslZ4t7gwRtO6hOFGa0NvX3Ip6R d01aX5lYRwUehu0zmlWz5CsH1MJ3wPqaAGjBMN3TAkcHmlkD7WTLwJexTfvNEjQ0T6LX GrpTcqldby0qTdmtWt6iBaYArW62RLjD7yPXwIfnAr3XY2rTK9wJ15B7uAOCXp51VnJs 299eeNCnV77r0nwElCQycKFQUrC9k4+XKZjZnLl0Ex/rgayNWaNjmslA26fSM5Ykg0rr l3Nynt54dINabni5l0dIInLVMRHCD9qjVvdJbDmq0cFdjrmuMWHoHy6uDaOowu4krCt2 3wzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=r6Cph03AK34zepuuBMYEpgcbU+UwJEmueHdYMkIjRa0=; b=f/XjHK2di9SjCV19Edcipa1syd9hrtr94XkZh59UZnV30NVkC5eSr2ThgoZT527+mj f3a1cxEWCXfqHbRIoMHpPigF/oxQETolhoDLl84ucNgJoviTnDdmMz+2XGzzDgLB0RSk ajE2GU8XArt0D5g6JR3Ep2p3/IH1Bf/INigFyF+/t5yYePG4jw45HAk4nQyrCk8GmS/U SZT1rcmdG6aG8sI6aC44IfDLGi8Eqjzora8nx87BW8IKO2r2bF++GoQBJy1V0pCCXZH7 QrbQtrerlQkaBb4LhmmivtjEplPjle8M3CPKioItGCegENNTEcirLVE2vylZTFrUJkMe XIrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r1si494005eji.355.2020.05.13.13.54.51; Wed, 13 May 2020 13:55:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390543AbgEMS5y (ORCPT + 99 others); Wed, 13 May 2020 14:57:54 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:51886 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390068AbgEMS4e (ORCPT ); Wed, 13 May 2020 14:56:34 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id E38EE2A25D4 Received: by jupiter.universe (Postfix, from userid 1000) id 6F40C480102; Wed, 13 May 2020 20:56:29 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel , Rob Herring , Greg Kroah-Hartman , "Rafael J . Wysocki" Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Sebastian Reichel Subject: [PATCHv1 04/19] power: supply: core: add POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED Date: Wed, 13 May 2020 20:56:00 +0200 Message-Id: <20200513185615.508236-5-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200513185615.508236-1-sebastian.reichel@collabora.com> References: <20200513185615.508236-1-sebastian.reichel@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some battery fuel gauges know when the battery needs to be recalibrated before providing usable values. This should be reported via the health property. Signed-off-by: Sebastian Reichel --- Documentation/ABI/testing/sysfs-class-power | 2 +- drivers/power/supply/power_supply_sysfs.c | 1 + include/linux/power_supply.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/sysfs-class-power b/Documentation/ABI/testing/sysfs-class-power index e6d7348766b2..216d61a22f1e 100644 --- a/Documentation/ABI/testing/sysfs-class-power +++ b/Documentation/ABI/testing/sysfs-class-power @@ -205,7 +205,7 @@ Description: Valid values: "Unknown", "Good", "Overheat", "Dead", "Over voltage", "Unspecified failure", "Cold", "Watchdog timer expire", "Safety timer expire", - "Over current" + "Over current", "Calibration required" What: /sys/class/power_supply//precharge_current Date: June 2017 diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c index 78d5382e69f1..bc79560229b5 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -100,6 +100,7 @@ static const char * const POWER_SUPPLY_HEALTH_TEXT[] = { [POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE] = "Watchdog timer expire", [POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE] = "Safety timer expire", [POWER_SUPPLY_HEALTH_OVERCURRENT] = "Over current", + [POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED] = "Calibration required", }; static const char * const POWER_SUPPLY_TECHNOLOGY_TEXT[] = { diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 63ffe2a0a87b..ac1345a48ad0 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -61,6 +61,7 @@ enum { POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE, POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE, POWER_SUPPLY_HEALTH_OVERCURRENT, + POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED, }; enum { -- 2.26.2