All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Tony Lindgren <tony@atomide.com>
Cc: kernel list <linux-kernel@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	linux-omap@vger.kernel.org, sre@kernel.org, nekit1000@gmail.com,
	mpartap@gmx.net, merlijn@wizzup.org
Subject: Re: Motorola Droid 4 progress, power consumption
Date: Thu, 3 May 2018 11:06:11 +0200	[thread overview]
Message-ID: <20180503090611.GA14451@amd> (raw)
In-Reply-To: <20180502144158.GJ98604@atomide.com>

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

Hi!

> > Anyway, >5.5hours of standby with screen off, GSM on is already
> > usable.
> 
> Just to rub that in, you do mean GSM usable for voice calls and
> SMS with your unicsy_demo with mainline kernel plus the pending
> LCD related patches, right? :)
> 
> > This is the core of code I'm using.
> > 
> > https://github.com/pavelmachek/unicsy_demo
> > 
> > Battery graphs are attached. I'm not sure if the battery was really
> > close to empty at that point -- voltage curve should have different
> > shape if that was the case. 
> 
> Cool. BTW, the value for POWER_SUPPLY_POWER_AVG should be quite
> accurate for the whole device power consumption.
> 
> It comes from the shunt resistor measured by the PMIC. Sorry I don't
> remember how often it needs to be polled but I'm guessing polling it
> once a minute or so should be plenty.

I'd like current_avg more, but if I cat it manually, it changes on
order of seconds, and quite significantly... which suggest shorter
polling interval would be needed.

user@devuan:/sys/class/power_supply/battery$ date; cat current_now
current_avg
Thu May  3 09:33:05 CEST 2018
-71000
-218408
user@devuan:/sys/class/power_supply/battery$ date; cat current_now
current_avg
Thu May  3 09:33:06 CEST 2018
-61000
-200238
user@devuan:/sys/class/power_supply/battery$ date; cat current_now
current_avg
Thu May  3 09:33:06 CEST 2018
-51000
-209879
user@devuan:/sys/class/power_supply/battery$ date; cat current_now
current_avg
Thu May  3 09:33:07 CEST 2018
-56000
-72308
user@devuan:/sys/class/power_supply/battery$ date; cat current_now
current_avg
Thu May  3 09:33:08 CEST 2018
-37000
-211362

> Hmm oh and the POWER_SUPPLY_CHARGE_COUNTER value should be monitored
> by your libbattery and it's low value and high value should be saved
> to a file. Low should be saved when we get the battery low interrupt
> and battery state changes to POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL.
> High value should be saved on POWER_SUPPLY_CAPACITY_LEVEL_FULL.
> 
> Then when you know the high value and low value, you can calculate
> the remaining capacity based on the current value and
> POWER_SUPPLY_POWER_AVG.

I'll look into that... but probably will do experiments with python,
first.

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 --]

WARNING: multiple messages have this Message-ID (diff)
From: pavel@ucw.cz (Pavel Machek)
To: linux-arm-kernel@lists.infradead.org
Subject: Motorola Droid 4 progress, power consumption
Date: Thu, 3 May 2018 11:06:11 +0200	[thread overview]
Message-ID: <20180503090611.GA14451@amd> (raw)
In-Reply-To: <20180502144158.GJ98604@atomide.com>

Hi!

> > Anyway, >5.5hours of standby with screen off, GSM on is already
> > usable.
> 
> Just to rub that in, you do mean GSM usable for voice calls and
> SMS with your unicsy_demo with mainline kernel plus the pending
> LCD related patches, right? :)
> 
> > This is the core of code I'm using.
> > 
> > https://github.com/pavelmachek/unicsy_demo
> > 
> > Battery graphs are attached. I'm not sure if the battery was really
> > close to empty at that point -- voltage curve should have different
> > shape if that was the case. 
> 
> Cool. BTW, the value for POWER_SUPPLY_POWER_AVG should be quite
> accurate for the whole device power consumption.
> 
> It comes from the shunt resistor measured by the PMIC. Sorry I don't
> remember how often it needs to be polled but I'm guessing polling it
> once a minute or so should be plenty.

I'd like current_avg more, but if I cat it manually, it changes on
order of seconds, and quite significantly... which suggest shorter
polling interval would be needed.

user at devuan:/sys/class/power_supply/battery$ date; cat current_now
current_avg
Thu May  3 09:33:05 CEST 2018
-71000
-218408
user at devuan:/sys/class/power_supply/battery$ date; cat current_now
current_avg
Thu May  3 09:33:06 CEST 2018
-61000
-200238
user at devuan:/sys/class/power_supply/battery$ date; cat current_now
current_avg
Thu May  3 09:33:06 CEST 2018
-51000
-209879
user at devuan:/sys/class/power_supply/battery$ date; cat current_now
current_avg
Thu May  3 09:33:07 CEST 2018
-56000
-72308
user at devuan:/sys/class/power_supply/battery$ date; cat current_now
current_avg
Thu May  3 09:33:08 CEST 2018
-37000
-211362

> Hmm oh and the POWER_SUPPLY_CHARGE_COUNTER value should be monitored
> by your libbattery and it's low value and high value should be saved
> to a file. Low should be saved when we get the battery low interrupt
> and battery state changes to POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL.
> High value should be saved on POWER_SUPPLY_CAPACITY_LEVEL_FULL.
> 
> Then when you know the high value and low value, you can calculate
> the remaining capacity based on the current value and
> POWER_SUPPLY_POWER_AVG.

I'll look into that... but probably will do experiments with python,
first.

Best regards,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180503/5bccc8c0/attachment.sig>

  parent reply	other threads:[~2018-05-03  9:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-01 18:31 Motorola Droid 4 progress, power consumption Pavel Machek
2018-05-02 14:41 ` Tony Lindgren
2018-05-02 14:41   ` Tony Lindgren
2018-05-02 19:10   ` Pavel Machek
2018-05-02 19:10     ` Pavel Machek
2018-05-02 19:42     ` Tony Lindgren
2018-05-02 19:42       ` Tony Lindgren
2018-05-02 21:32       ` Pavel Machek
2018-05-02 21:32         ` Pavel Machek
2018-05-03  9:06   ` Pavel Machek [this message]
2018-05-03  9:06     ` Pavel Machek
2018-05-03 14:22     ` Tony Lindgren
2018-05-03 14:22       ` Tony Lindgren
2018-05-04 20:20       ` Pavel Machek
2018-05-04 20:20         ` Pavel Machek
2018-05-04 20:38         ` Tony Lindgren
2018-05-04 20:38           ` Tony Lindgren
2018-05-04 21:47           ` Pavel Machek
2018-05-04 21:47             ` Pavel Machek
2018-05-05 19:44             ` Tony Lindgren
2018-05-05 19:44               ` 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=20180503090611.GA14451@amd \
    --to=pavel@ucw.cz \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=merlijn@wizzup.org \
    --cc=mpartap@gmx.net \
    --cc=nekit1000@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.