archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <>
To: Tony Lindgren <>
Cc: kernel list <>,
	linux-arm-kernel <>,,,,,,,,,
	Carl Philipp Klemm <>
Subject: Re: Droid 4 charging
Date: Fri, 19 Feb 2021 22:57:53 +0100	[thread overview]
Message-ID: <20210219215752.GA31435@amd> (raw)
In-Reply-To: <>

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


> > (I'm using Leste 5.10 kernel here).
> > 
> > When battery is full, green light is off and 0.00A being drawn from
> > USB.
> > 
> > But that means that phone is now powered from battery, discharging
> > it... And soon charging starts again. (Pretty much immediately, for me)
> > 
> > That's bad ... right? It wears the battery out.
> Well maintenance charging at 4.2V sure is better for the battery than
> what android is doing charging it at 4.31V contantly..

Well, 4.2 is better than 4.3, but I'm not sure about the rest.

> > If I turn off charging with echo 0 > input_current_limit, 0.2 to 0.4A
> > is drawn from USB, and battery is not discharged:
> > 
> > root@devuan-droid4:/sys/class/power_supply/usb# echo 0 >  input_current_limit
> > root@devuan-droid4:/sys/class/power_supply/usb# cat current_now
> > 0
> Hmm so have you measured that setting the current limit to 0 actually
> draws something from the USB?

Yes, it does, if I do the echo when charge is done. (I have small USB
passthrough with volt and amp meters). It has been behaving weirdly in
other cases.p

> I recall clearing the ichrgr bits stops the vbus draw completely, but
> I could be wrong.
> > Is that a better way to handle full battery?
> We could experiment with switching over to usb power when the battery is
> full. Looking at the docs for mc1378 it might be possible that setting
> battery is full disables charging but still keep drawing power from
> the usb. I'd assume the current limit still needs to be nonzero there
> too? Totally untested..

I may be able to test patches...

> And switching back to battery power on usb disconnect will potentially
> only give us very little time based on the different line length for
> vbus and ground pins compared to data pins on the usb connector.. And
> uvos had some concerns about the battery capacity putting it back online,
> so adding him to Cc also.

You mean, we'd have to take interrupt and switch registers in order to
switch back to battery power, and system would crash if we did not
make it in time?

> Maybe just clearing ichrgr does all this already though and is enough.
> It should be measured on the vbus line.

It works for me... measuring current at the usb connector.

> And then we still need to restart the charger at some point, but that
> could happen based on much longer timeouts that what we currently have.

Li-ion batteries are very slow to self-discharge. This could timeout
could be week... or maybe a year.

Best regards,

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

  reply	other threads:[~2021-02-19 21:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-06 13:14 Pavel Machek
2021-02-15  4:35 ` Tony Lindgren
2021-02-19 21:57   ` Pavel Machek [this message]
2021-02-21 20:56     ` Sebastian Reichel
2021-02-22  7:56     ` 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:

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

  git send-email \
    --in-reply-to=20210219215752.GA31435@amd \ \ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: Droid 4 charging' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox