From patchwork Sat Nov 11 22:17:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Palus X-Patchwork-Id: 743310 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D146C4332F for ; Sat, 11 Nov 2023 22:17:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229599AbjKKWRy (ORCPT ); Sat, 11 Nov 2023 17:17:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjKKWRx (ORCPT ); Sat, 11 Nov 2023 17:17:53 -0500 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A57030D6; Sat, 11 Nov 2023 14:17:50 -0800 (PST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id AF6453200902; Sat, 11 Nov 2023 17:17:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sat, 11 Nov 2023 17:17:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm3; t=1699741067; x=1699827467; bh=c48DBOfgVp eDa3sB5YGp5kIVd2kfZONDSWIzOlaX3HU=; b=Vkj+5/h87hSL4lrSt4zApn/c6Z j3oB5AtWOgDYukeunId0KJQDy+KFsYTWQiqBdDl4uagEkpMDEHST5cskt7coFTNq sMra/BLpz4RGY48jR/xuuGfg72Ntj1C0KtA4W1B6eFdQttkHXJSrWO+mqP86x9qx XpkBJVNFQKBkdO4Y5HU7r1jNzyIRuA2D8wv79YbS+ZYGtgMme/QV12c69up+jF1H XWbFdEBWBosnHcdFIpUapoppmnBpn4677NlnhouHYawjo6q+l2U0P8ZRK6byT623 sGyVWmujrPq6M+hGFocbj+BKOKHrKNvIzDsz15r7/vNtKxbJv03BX0epO4lQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1699741067; x=1699827467; bh=c48DBOfgVpeDa 3sB5YGp5kIVd2kfZONDSWIzOlaX3HU=; b=tHSFGYDd+9bDWgTQFirVYFqvv4GJF DiXHjYKTOMSUKzQa7JH7cHebbYjp0hvFKGDrO1FdZnnHOOPDeEjnVn1yQB8w1DcZ X58dpMm9zMBHiMhE4fu3OEDBiLu8uHD8AdGpts7YpaRu+f0uftN1w8y2NKce5w4Z 5hKEJxHvjH0ISxQ5gdbUuJH7pdNNJJzBVhhX79JQ9HsIT0C2DyzQDuvCej/Rctz9 yPECcuhqmMg2IvCe99ru9r7lZHGJnxttajrlBmNf2an+IDnXC+dfO4773ldEkkxS QGRdgCbxR96RX+CuYetMYFshvV9wqn9v/rsfejf3SqFevjYkoky3zkNsw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddvhedgudehlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeflrghnucfr rghluhhsuceojhhprghluhhssehfrghsthhmrghilhdrtghomheqnecuggftrfgrthhtvg hrnhephfekvddvgeekhfejudeiveeuiefhudekheejhfelheduhffhleeggfettdetuedt necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhprg hluhhssehfrghsthhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: i01894241:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 11 Nov 2023 17:17:46 -0500 (EST) From: Jan Palus To: Tobias Schrammm , Sebastian Reichel , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jan Palus Subject: [PATCH] power: supply: cw2015: correct time_to_empty units in sysfs Date: Sat, 11 Nov 2023 23:17:04 +0100 Message-ID: <20231111221704.5579-1-jpalus@fastmail.com> X-Mailer: git-send-email 2.42.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org RRT_ALRT register holds remaining battery time in minutes therefore it needs to be scaled accordingly when exposing TIME_TO_EMPTY via sysfs expressed in seconds Fixes: b4c7715c10c1 ("power: supply: add CellWise cw2015 fuel gauge driver") Signed-off-by: Jan Palus --- drivers/power/supply/cw2015_battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/supply/cw2015_battery.c b/drivers/power/supply/cw2015_battery.c index bb29e9ebd24a..99f3ccdc30a6 100644 --- a/drivers/power/supply/cw2015_battery.c +++ b/drivers/power/supply/cw2015_battery.c @@ -491,7 +491,7 @@ static int cw_battery_get_property(struct power_supply *psy, case POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW: if (cw_battery_valid_time_to_empty(cw_bat)) - val->intval = cw_bat->time_to_empty; + val->intval = cw_bat->time_to_empty * 60; else val->intval = 0; break;