Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9121861pxu; Mon, 28 Dec 2020 07:10:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxv1ZKCbxpSXYJNngKa1WT9KgcNDocKkUy05H12GVIcmxFw9+0u2n47HBPjlW6PIFELDZji X-Received: by 2002:a17:906:15c7:: with SMTP id l7mr42620468ejd.226.1609168201432; Mon, 28 Dec 2020 07:10:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609168201; cv=none; d=google.com; s=arc-20160816; b=xGzEPCnKCfeLR1SA0z0FMugpSRwCxmVwU3VrwetryW9DaMVAF7/osbzOLlPnke4/2L 0oh9NJBCmpdy/hXTc4htZ/bedYnk68EDQt6u/kC5X5FNyBs+NgRMnO3RSNvsDHzrdhIH xb2F/bVm15ONnTWhxXyHp3DOyhKG51B0SpY5+4mIjH7aMeToosV/Vh0BpXyHi3hwnL+J rqvRAIMlJd9jpJREMDc4FSMtaoRRZaYktmFd7hgKcPIOk5q7SDZkyNO1Go3mzRPXt6MS UceUO2rNJ1F7u1KUUiW9aYqL6xXTzDW+tRxUKF26+RsCojhOQOO7bvS4q0ugz5cg/hc8 y3gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YuYEJM7sCJY5Wn/4G7rzBZM5S46++z4//TOJ2DUKdVY=; b=v2EpOOpIdg2i2eKvpwbNLQ6+JlrZRPAVSY0sufX/P+mw0Iq4xlZOOzZZuomly6xupN y5D9ihyYZoO3ajgOIofvxkTbNkFtviwtVu4ADt8iIuIbwAua+6fiKin+jG2H2HHAFqyE jRZCnmgHF8qkc7NMKQ4EvyTMT7jFQouiEbxLucsXQ4EIAqlIMV1nnoVVXmJj0k4b+yly YmR9CBbms/AUVKFxlTCOcVCmMylItAXIA6h2eLCwiWNIZGBsviKtfaAMneY2iTAcxuPx DsMPTPcFYLIxv4XTZN259mJjOHlt6fJpd44kICrKAtOOe4mFDNIDk7qLaz8YAG0gzRcn Lrvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o412OZWk; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u7si20937055edb.213.2020.12.28.07.09.38; Mon, 28 Dec 2020 07:10:01 -0800 (PST) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o412OZWk; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439014AbgL1PFo (ORCPT + 99 others); Mon, 28 Dec 2020 10:05:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:45022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439059AbgL1OKh (ORCPT ); Mon, 28 Dec 2020 09:10:37 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E341920791; Mon, 28 Dec 2020 14:09:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164596; bh=7Ft/XUMKKsohRnffoVmtAMZzEzvC8B567WmWQE2bDs0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o412OZWkXXBlEUzTYvROxgpGYNEjqkxWFQX/3zAJYzrM4dR2Y/qqk+YyRX1a/UOKH merO+pyaiZQfXmr0O8QM+zH/vZKMZOcrdqwffiTshWHsJB9qOJrM+cz9bgDfl7cqc3 117GEyuP6ypL6uKoXSDYxElcRTVGcs58QweMz99s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Timon Baetz , Sebastian Krzyszkowiak , Sebastian Reichel , Sasha Levin Subject: [PATCH 5.10 230/717] power: supply: max17042_battery: Fix current_{avg,now} hiding with no current sense Date: Mon, 28 Dec 2020 13:43:48 +0100 Message-Id: <20201228125032.007643995@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sebastian Krzyszkowiak [ Upstream commit 4b0a56e692503692da6555337a697c17feabbb3e ] When current sense is disabled, max17042_no_current_sense_psy_desc gets used which ignores two last properties from the list. Fixes: 21b01cc879cc ("power: supply: max17042_battery: Add support for the TTE_NOW prop") Reported-by: Timon Baetz Signed-off-by: Sebastian Krzyszkowiak Signed-off-by: Sebastian Reichel Signed-off-by: Sasha Levin --- drivers/power/supply/max17042_battery.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c index f284547913d6f..2e9672fe4df1f 100644 --- a/drivers/power/supply/max17042_battery.c +++ b/drivers/power/supply/max17042_battery.c @@ -85,9 +85,10 @@ static enum power_supply_property max17042_battery_props[] = { POWER_SUPPLY_PROP_TEMP_MAX, POWER_SUPPLY_PROP_HEALTH, POWER_SUPPLY_PROP_SCOPE, + POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW, + // these two have to be at the end on the list POWER_SUPPLY_PROP_CURRENT_NOW, POWER_SUPPLY_PROP_CURRENT_AVG, - POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW, }; static int max17042_get_temperature(struct max17042_chip *chip, int *temp) -- 2.27.0