Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8741092rwp; Wed, 19 Jul 2023 14:47:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlFYcQb24EwfB4II6UmzPnvW/mRqMjyvGBxYYAaEDp6HQZKpNEynJ/3NqQIXY37FEuF/5FWE X-Received: by 2002:a17:90a:6c01:b0:262:e439:5013 with SMTP id x1-20020a17090a6c0100b00262e4395013mr16096157pjj.9.1689803241643; Wed, 19 Jul 2023 14:47:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689803241; cv=none; d=google.com; s=arc-20160816; b=FuHOcjk/JxpSMijTvePaann5hVtv9evMqKm1YxsZmqC9m8XeczK9iPGarEeS7NeXM3 GXQQzBZ3Q4ckcGrnpQBfMKUzi8oeVWIYldxibAQH2wMS86CMm3I0UaLF25UCGcVGBO8E dma3NTNE58zBcsOiU3qhg7cbOFwk2IWRGTZR0Tz0u4Jrs0y7e/GJEDsgxwSaVp1fb9RL mqnoAOoUGrsvBEgq1KilwTZ+T+GaS5/2XnOzojo/+41sCgs9f3oWvIPJSZ/bCS+MJP/l +xYxfEb2BtbqkoWZ8Fzvah/9qLTybIxC5bQwZ0SmM3XB2SeO223ICEDmCOKxZcwimI34 c3MA== 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=BO6oYUqdU7rROrh7DtuzdEm/zEiLy4ltYBzLQDCA3b0=; fh=XsEryi+SbP/2rCD6HsOBh16sUcrbDQZ7IPYoN1ILmVw=; b=qwKiT/HZY/vjDbhF9KbaHw3F8gWYTIawBtxsIsb5rWam6O0o2Wkq++ZN9Ywkd+ix07 USB3GGhgbKoj9xW8gaHTkPHzfk18knXR00ezs/zFlSp2ld0Ut2yvTtLNXgo32uRaFGlm a1/o0IXMn6BbF7JOMnJBoPrDT4r1LzRqDSv3gKF5/oJddAIeHDbq1zfJVP56/bxsHHef KcT8GK7NHS6ToKc3lix/AaFiEhdBnyIXKRvwuTW4NDUEzBNljDbq8Of4UcqHRoWcsTvf pIJDsGCt15EWb3C0eOIpEYvwhkZPdBWd0pWP0GbFZQgxGI6AUhzzlD9ONVOHtuEmZ6eN FKHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Bso5CMvA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u61-20020a17090a51c300b002532c9b252asi2075009pjh.73.2023.07.19.14.47.09; Wed, 19 Jul 2023 14:47:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Bso5CMvA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230022AbjGSU7d (ORCPT + 99 others); Wed, 19 Jul 2023 16:59:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbjGSU7c (ORCPT ); Wed, 19 Jul 2023 16:59:32 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 708041B9; Wed, 19 Jul 2023 13:59:31 -0700 (PDT) Received: from mercury (unknown [185.209.196.239]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sre) by madras.collabora.co.uk (Postfix) with ESMTPSA id 37BC3660707B; Wed, 19 Jul 2023 21:59:30 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1689800370; bh=cXRYIzQdseRHmaYd1OD7u2mYqJ0lfpwzolfl9iDjYCg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Bso5CMvAutuxB+K6shilAFIjHVoB/0W8tzBGg0L77Jz4HpY6K1JWihPgWWAy78/sx H4rvlCGz1CWwIjs4w2IRTRnhgz0jDwBNntcsO/3vUo96SSNaG6GzsKQg+DTr8T4AS9 Qwo8hWuIMOVpCQosuAvT/8rshDGGP16xA+3yEe739pUMeNA5m6Uq8+tn4DC1INXQGt 95uZ3cPB/MCdCGEtXL5NQ8qM9cOPbdJgfC0koqH6KPG+nfagplJCKyozE0C9iccLKE ptJV36VAkkw3LmXsYURZZ1r0Azalr6oV3uN6jLAM3DiSGLx2E4M8krNZ7jeNhOrDqW f0fEwhS720u2A== Received: by mercury (Postfix, from userid 1000) id 6A41D1061387; Wed, 19 Jul 2023 22:59:27 +0200 (CEST) Date: Wed, 19 Jul 2023 22:59:27 +0200 From: Sebastian Reichel To: Ricardo Rivera-Matos Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, David Rhodes Subject: Re: [PATCH] power: supply: bq24190: Considers FORCE_20PCT when getting IPRECHG Message-ID: <20230719205927.5gdxmwsj4tgeckwq@mercury.elektranox.org> References: <20230714174529.287045-1-rriveram@opensource.cirrus.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dg2nkogywbg63pik" Content-Disposition: inline In-Reply-To: <20230714174529.287045-1-rriveram@opensource.cirrus.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --dg2nkogywbg63pik Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Fri, Jul 14, 2023 at 12:45:29PM -0500, Ricardo Rivera-Matos wrote: > Adds a check of the FORCE_20PCT bit when getting the precharge > current value. >=20 > According to the bit description for the FORCE_20PCT bit, when > FORCE_20PCT is true, the precharge current target is 50% of > what is configured in the IPRECHG bit field. >=20 > Signed-off-by: Ricardo Rivera-Matos > Reviewed-by: David Rhodes > --- Thanks, queued. -- Sebastian > drivers/power/supply/bq24190_charger.c | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/suppl= y/bq24190_charger.c > index ef8235848f56..3f99cb9590ba 100644 > --- a/drivers/power/supply/bq24190_charger.c > +++ b/drivers/power/supply/bq24190_charger.c > @@ -965,7 +965,7 @@ static int bq24190_charger_get_precharge(struct bq241= 90_dev_info *bdi, > union power_supply_propval *val) > { > u8 v; > - int ret; > + int curr, ret; > =20 > ret =3D bq24190_read_mask(bdi, BQ24190_REG_PCTCC, > BQ24190_REG_PCTCC_IPRECHG_MASK, > @@ -973,7 +973,20 @@ static int bq24190_charger_get_precharge(struct bq24= 190_dev_info *bdi, > if (ret < 0) > return ret; > =20 > - val->intval =3D ++v * 128 * 1000; > + curr =3D ++v * 128 * 1000; > + > + ret =3D bq24190_read_mask(bdi, BQ24190_REG_CCC, > + BQ24190_REG_CCC_FORCE_20PCT_MASK, > + BQ24190_REG_CCC_FORCE_20PCT_SHIFT, &v); > + if (ret < 0) > + return ret; > + > + /* If FORCE_20PCT is enabled, then current is 50% of IPRECHG value */ > + if (v) > + curr /=3D 2; > + > + val->intval =3D curr; > + > return 0; > } > =20 > --=20 > 2.34.1 >=20 --dg2nkogywbg63pik Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmS4Tq8ACgkQ2O7X88g7 +ppWcQ/8DAiXQiXRfk+oNyczvgd0/Pp5Vtz0VPPWthWX9CkPR1fs19Y2vTcAyO0B utjPHuCaOyPoqzeb9idcJrsO6GOpOMGkMMBMlJnQvrRiK+Ygj/mmXncfks6Hub4N OJwU6bZnX8syy8i1BB7VI0gY8uxw9IAYtd9nzhdx4NC9c2oW+07bCltMv9hXVfx3 FaaKUYjG/rHldjO1yrQNy8JGkejP0u/CiRm+WGTVakKHWRPjWLXqY0/a75M+FrA/ tOiJaWdhVTU4PGhMQ8slhi7UpEB3eK3y/lKgonVGw3qCLt1xakQAfDME9WhthqQR mGPxINxZfRLyLqvPb3WkcvTpXXOM3C2VinjaNACF9MzanJN+2yT3TkUd1NS3EWBH R3prTVaAGMk29NGAwtWpZeDUVzBbfmAhwfdiZ0s5j2A+YjI2sNumGPgdD3SeftZY nYEVjcSDvyWOa/u+g7Y1MEcJh8vdQkchIN9y8h4/lQzYph9EUp5J4r0aQMXMrenx J0FTOdp5xn7Qyx+X/JT2EAmtvo+1sEXcY+VPjmBpvupLSp6IXNpNC6UqqMIwIgq8 5sTDhab5/B8jv6WnT8d+QHxudnEbrCV70CLITJcPlkjhS/BjhrOyPELXTXxAxiCf pbeGFRTxYpRfTmbi+4k1OSzDbw7FVSj6yLLpC6HLzzv97+aaKfI= =eIi4 -----END PGP SIGNATURE----- --dg2nkogywbg63pik--