Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2958874pxf; Sun, 14 Mar 2021 19:05:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMv3JTjt8kg/6TswjQjrjoP+sI9ujU9sMKh5ieVKtflSnNum6YUuIFsLGNvnPJQ1YwvW6Z X-Received: by 2002:a05:6402:1d33:: with SMTP id dh19mr27074924edb.362.1615773911925; Sun, 14 Mar 2021 19:05:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615773911; cv=none; d=google.com; s=arc-20160816; b=Pt0cJvdfqVFYabtcQgprUFfC3Lp8OSEbfWgIrsKKkBwDWdLKl0pEWrjd34UJRC0rjn Gyeb1pnbYsR5HqGoLTtCLXWbFHjIDPRiozh/aEpbufeIf6CnOULLq/c6suKp6pOaVKJn bG+bOTZmmuOTZlim4DyzaWug546o3QwD8tSq1D2kdtasuFTDhJaSqk+5Z8QYGzNXQ1TS bdjCs0IcelGk5Yjg/+mezji3C3Js8/WBUK5aseuSV8D9x4SrreVTctW4Sl/mi4izyOZk pgeT4X61LX6U8V5ZE8SXAf9Rb0rA+ZvKCfwPn0jAnCud7XkE2a1cFAAX3ctk35VZr0Er Aifw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2VxrA7X6a00l3pDTKZ/fQDdTnKMoN70xIXMEOAtmL5w=; b=ffSPe8ADcFN9M46LZBnyYU+INDhFJPEK+t2AtpZ0FsQTEo4ZT93Svk/OFgzMLWQwz7 HQTMnu55X28LFSNl7U/OW3u+Er9EXgrUeJFcpqv2xQrUwkOSv4v2nKAG4sxJMktaAcQ8 xrzqFL4Z7iY/JSn5hpeiwTRARLOlZzr5tmEsl8Gjv0eZUuV5rqczbYjfeNjDVxB8spBZ qSdoEKAOOB6kci8w+42f1BY7OiMfOfRH7zXqzlsxJ+QHa75p0/uV2Ze+iuhuZkIqB9Ki EF/qndkJhN6gHvc/vQP+oI1o9DKyrR7wKKNEEvbaagWK0OWbGMxC85DXOeuRT5txVADv XhsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JjncW2uX; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o11si10349252ejb.453.2021.03.14.19.04.49; Sun, 14 Mar 2021 19:05:11 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JjncW2uX; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229764AbhCOBys (ORCPT + 99 others); Sun, 14 Mar 2021 21:54:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:41710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbhCOByj (ORCPT ); Sun, 14 Mar 2021 21:54:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 694E564E67; Mon, 15 Mar 2021 01:54:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615773279; bh=lXgcnPBVlamraWadB2YrJuA6DQw0vte++gFVcURPXbk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JjncW2uXz+eD1QSf5uKz3F3PKHK1WxWjMPMfVVBCBYVES0F7dbXs45BrEBCbEVaDm X7z1NupuUm0x5CjZDcs3llPElLrGUfHwYdpCrMusXgr4NAUmScgK92Aj+7sccLFFCU chnEyLM1ekNe1Ccuh5Szh0VhtkjZTKfLy/O0Bc3gV4ttGw+jN7CbWGlwaTK1EEDkvO hzHZ1l1cn0s0zytltGpGEY3eKYFb8JRmxfpj1aT7puQ3FwqQEaOnkPT5zo2Q2jaOo3 iGyUrlYsMm08DTMxzjK/RlyFQzK3OQT0lFjWxh+D21z8YJSV6GS5FzZg2IvNXnEk7L ZJV9Qak4UHFRA== Received: by earth.universe (Postfix, from userid 1000) id BC96A3C0C96; Mon, 15 Mar 2021 02:54:37 +0100 (CET) Date: Mon, 15 Mar 2021 02:54:37 +0100 From: Sebastian Reichel To: Matthias Schiffer Cc: Pali =?utf-8?B?Um9ow6Fy?= , Andreas Kemnade , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] power: supply: bq27xxx: fix sign of current_now for newer ICs Message-ID: <20210315015437.auc4smemdbxb4qlm@earth.universe> References: <20210303095420.29054-1-matthias.schiffer@ew.tq-group.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="iknjunzcwyyvba4y" Content-Disposition: inline In-Reply-To: <20210303095420.29054-1-matthias.schiffer@ew.tq-group.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --iknjunzcwyyvba4y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Wed, Mar 03, 2021 at 10:54:18AM +0100, Matthias Schiffer wrote: > Commit cd060b4d0868 ("power: supply: bq27xxx: fix polarity of current_now= ") > changed the sign of current_now for all bq27xxx variants, but on BQ28Z610 > I'm now seeing negated values *with* that patch. >=20 > The GTA04/Openmoko device that was used for testing uses a BQ27000 or > BQ27010 IC, so I assume only the BQ27XXX_O_ZERO code path was incorrect. > Revert the behaviour for newer ICs. >=20 > Fixes: cd060b4d0868 "power: supply: bq27xxx: fix polarity of current_now" > Signed-off-by: Matthias Schiffer > --- Thanks, queued. -- Sebastian >=20 > v2: no changes >=20 > drivers/power/supply/bq27xxx_battery.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/suppl= y/bq27xxx_battery.c > index 4c4a7b1c64c5..cb6ebd2f905e 100644 > --- a/drivers/power/supply/bq27xxx_battery.c > +++ b/drivers/power/supply/bq27xxx_battery.c > @@ -1827,7 +1827,7 @@ static int bq27xxx_battery_current(struct bq27xxx_d= evice_info *di, > val->intval =3D curr * BQ27XXX_CURRENT_CONSTANT / BQ27XXX_RS; > } else { > /* Other gauges return signed value */ > - val->intval =3D -(int)((s16)curr) * 1000; > + val->intval =3D (int)((s16)curr) * 1000; > } > =20 > return 0; > --=20 > 2.17.1 >=20 --iknjunzcwyyvba4y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmBOvlcACgkQ2O7X88g7 +pqqhA//RZ/DeLWE2E9PSJs0pMdGLDhMyVlsj06Pya2mJslVVS9+vZD4gEDcojww 7TAEbtsCOiDnEmnLkDy74wtSSAhS2DqHaR3wNXd8eRTT7pqG/7bfeZyaQsJIf27/ 1E2QMpgZHtRXObtqFa1aa7JJtgwYSJ2OmKj9jXVL9NjtxPGMxsh3MeJaddQOF2BI xw+jlxBhxwBvaWfZXbRGS03ZivzYKoYGRaqn/xYDrjxC961z7RPduKw6W4Wqs0Rl LGx1t17NTL7o1W1OnVSENCi4z6KAoTfPO3ivSR87QW68K8eKNt6g66mPoz7a7BT8 yqYEPF0xdVaV7YASJzvfrEX5wNmX0bmsbNIy5azu1wpgi1TJGvNMhSdFnas6L9GA KXGyYstfuVnzlKKDkFIurqZB4/tsRoN3bvqU80Is0uIEhgEV0451ZzHkCxVyYLfy IYr1vbsCyxpPuHlfvpfOBfsNyCDFpmDEGqe9SKpqxz4cfRJf8B254zKwx+U6sUO9 zu3X58qpUVZHxNEUuvyFJliS+3LFggg5CqOrGFjnWqg2a9hHqJF+PLW1fbRktvva 5WPan1gsX7Hd0JBKkbB4ga/ulyp/au3arJMUaJ3Ma/dlLCyoVydOWt7aQcBainqW 4b8GvfJOBAIIkf1uibTfS+2HNbvmNyT11AQJ16K8KqPGp+ahwkg= =IFpg -----END PGP SIGNATURE----- --iknjunzcwyyvba4y--