linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Tony Lindgren <tony@atomide.com>
Cc: Sebastian Reichel <sre@kernel.org>,
	linux-pm@vger.kernel.org, linux-omap@vger.kernel.org,
	Merlijn Wajer <merlijn@wizzup.org>
Subject: Re: [PATCH 2/2] power: supply: cpcap-charger: Allow changing constant charge voltage
Date: Sun, 13 Oct 2019 13:31:11 +0200	[thread overview]
Message-ID: <20191013113111.GD5653@amd> (raw)
In-Reply-To: <20191009210141.10037-3-tony@atomide.com>

[-- Attachment #1: Type: text/plain, Size: 1464 bytes --]

Hi!

> Let's allow reconfiguring the cpcap-charger max charge voltage and
> default to 4.2V that should be safe for the known users.
> 
> 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.
> 
> Some pieces of the property setting code is based on an earlier patch
> from Pavel Machek <pavel@ucw.cz> but limited to configuring the charge
> voltage for now.
> 
> Cc: Merlijn Wajer <merlijn@wizzup.org>
> Cc: Pavel Machek <pavel@ucw.cz>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

> @@ -259,6 +263,83 @@ static int cpcap_charger_get_property(struct power_supply *psy,
>  	return 0;
>  }
>  
> +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 <pavel@ucw.cz>

Best regards,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2019-10-13 11:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-09 21:01 [PATCHv2 0/2] cpcap charger and battery changes to deal with dropped voltage Tony Lindgren
2019-10-09 21:01 ` [PATCH 1/2] power: supply: cpcap-battery: Fix handling of lowered charger voltage Tony Lindgren
2019-10-13 11:30   ` Pavel Machek
2019-10-16 22:36     ` Tony Lindgren
2019-10-09 21:01 ` [PATCH 2/2] power: supply: cpcap-charger: Allow changing constant charge voltage Tony Lindgren
2019-10-13 11:31   ` Pavel Machek [this message]
2019-10-16 22:38     ` Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2019-10-16 22:41 [PATCHv3 0/2] cpcap charger and battery changes to deal with dropped voltage Tony Lindgren
2019-10-16 22:41 ` [PATCH 2/2] power: supply: cpcap-charger: Allow changing constant charge voltage Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191013113111.GD5653@amd \
    --to=pavel@ucw.cz \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=merlijn@wizzup.org \
    --cc=sre@kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).