From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E328C4360C for ; Sun, 13 Oct 2019 11:31:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 44ED22085B for ; Sun, 13 Oct 2019 11:31:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728903AbfJMLbR (ORCPT ); Sun, 13 Oct 2019 07:31:17 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:41151 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728620AbfJMLbR (ORCPT ); Sun, 13 Oct 2019 07:31:17 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id E7AE480249; Sun, 13 Oct 2019 13:30:59 +0200 (CEST) Date: Sun, 13 Oct 2019 13:31:11 +0200 From: Pavel Machek To: Tony Lindgren Cc: Sebastian Reichel , linux-pm@vger.kernel.org, linux-omap@vger.kernel.org, Merlijn Wajer Subject: Re: [PATCH 2/2] power: supply: cpcap-charger: Allow changing constant charge voltage Message-ID: <20191013113111.GD5653@amd> References: <20191009210141.10037-1-tony@atomide.com> <20191009210141.10037-3-tony@atomide.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9UV9rz0O2dU/yYYn" Content-Disposition: inline In-Reply-To: <20191009210141.10037-3-tony@atomide.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org --9UV9rz0O2dU/yYYn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > Let's allow reconfiguring the cpcap-charger max charge voltage and > default to 4.2V that should be safe for the known users. >=20 > This allows the users to use 4.35V for the extra capacity if really > needed at a cost of probably shorter battery life. We check the > constant charge voltage limit set by the battery. >=20 > Some pieces of the property setting code is based on an earlier patch > from Pavel Machek but limited to configuring the charge > voltage for now. >=20 > Cc: Merlijn Wajer > Cc: Pavel Machek > Signed-off-by: Tony Lindgren > @@ -259,6 +263,83 @@ static int cpcap_charger_get_property(struct power_s= upply *psy, > return 0; > } > =20 > +static int cpcap_charger_match_voltage(int voltage) > +{ > + switch (voltage) { > + case 0 ... 4100000 - 1: return 3800000; Would it be better to return 0 for < 3.8V values? > + case 4100000 ... 4120000 - 1: return 4120000; I believe this should be 4100000. > + case 4120000 ... 4150000 - 1: return 4120000; > + case 4150000 ... 4170000 - 1: return 4150000; > + case 4170000 ... 4200000 - 1: return 4170000; > + case 4200000 ... 4230000 - 1: return 4200000; With that fixed, Acked-by: Pavel Machek Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --9UV9rz0O2dU/yYYn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl2jCv8ACgkQMOfwapXb+vIsqgCffXuGA63JaCsbY4hYDH+3HovA m6MAoLrdwLvgzK6OYD2B4Ykgms7dRMUr =Slai -----END PGP SIGNATURE----- --9UV9rz0O2dU/yYYn--