From: "H. Nikolaus Schaller" <hns@goldelico.com>
To: Liam Breck <liam@networkimprov.net>
Cc: Sebastian Reichel <sre@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Discussions about the Letux Kernel
<letux-kernel@openphoenux.org>,
kernel@pyra-handheld.com
Subject: Re: dt-bindings: power: supply: bq27xxx: Add monitored-battery documentation
Date: Tue, 29 Aug 2017 22:09:39 +0200 [thread overview]
Message-ID: <12EEE9C8-4C5F-4A4B-AB5B-ABF28DF8D275@goldelico.com> (raw)
In-Reply-To: <CAKvHMgTaDZzjLgD3xvcG4g8z93PF1B9w-Hv9hYXtQL1eSQ7QDg@mail.gmail.com>
Hi,
> Am 29.08.2017 um 22:05 schrieb Liam Breck <liam@networkimprov.net>:
>
> Hi,
>
> On Tue, Aug 29, 2017 at 12:50 PM, H. Nikolaus Schaller
> <hns@goldelico.com> wrote:
>> Hi Liam,
>>
>>> Am 29.08.2017 um 20:18 schrieb Liam Breck <liam@networkimprov.net>:
>>>
>>> Hi Nikolaus, thanks for the testing report...
>>>
>>> On Tue, Aug 29, 2017 at 7:24 AM, H. Nikolaus Schaller <hns@goldelico.com> wrote:
>>>> Hi Liam,
>>>> seems to work as expected :)
>>>>
>>>> First boot:
>>>>
>>>> [ 6.096336] bq27xxx_battery_settings
>>>> [ 6.097987] bq27xxx_battery_set_config
>>>> [ 6.097990] bq27xxx_battery_unseal
>>>> [ 6.107987] bq27xxx-battery 1-0055: update design-capacity to 6000
>>>> [ 6.107992] bq27xxx-battery 1-0055: update design-energy to 22200
>>>> [ 6.107997] bq27xxx-battery 1-0055: terminate-voltage has 3200
>>>> [ 6.382048] bq27xxx-battery 1-0055: cfgupdate 0, retries 7
>>>> [ 6.382054] bq27xxx_battery_seal
>>>>
>>>> Second boot (w/o removing battery in between):
>>>>
>>>> [ 6.008883] bq27xxx_battery_settings
>>>> [ 6.013280] bq27xxx_battery_set_config
>>>> [ 6.018761] bq27xxx_battery_unseal
>>>> [ 6.050694] bq27xxx-battery 1-0055: design-capacity has 6000
>>>> [ 6.059913] bq27xxx-battery 1-0055: design-energy has 22200
>>>> [ 6.067113] bq27xxx-battery 1-0055: terminate-voltage has 3200
>>>> [ 6.075803] bq27xxx_battery_seal
>>>
>>> I'd be interested to hear what happens after poweroff & boot (ie does
>>> it retain config)?
>>
>> second boot was simple poweroff + reboot and it changes from "update design-capacity" to "design-capacity has"
>> which IMHO means that the bq27421 did retain settings and was therefore not reprogrammed.
>
> That implies that the board is keeping the battery gauge powered
> during poweroff.
Yes, that is how hardware is designed on this system.
> That's not a problem per se, but could indicate that
> other subsystems are also powered...
Well, the power controller (Palmas) stays powered to respond to the power-on-key...
Therefore I completely removed all power as well.
>
>>>
>>>> Third boot (with removing battery in between):
>>>>
>>>> [ 6.161085] bq27xxx_battery_settings
>>>> [ 6.161162] bq27xxx_battery_set_config
>>>> [ 6.161165] bq27xxx_battery_unseal
>>>> [ 6.177904] bq27xxx-battery 1-0055: update design-capacity to 6000
>>>> [ 6.177909] bq27xxx-battery 1-0055: update design-energy to 22200
>>>> [ 6.177914] bq27xxx-battery 1-0055: terminate-voltage has 3200
>>>> [ 6.440592] bq27xxx-battery 1-0055: cfgupdate 0, retries 7
>>>> [ 6.440597] bq27xxx_battery_seal
>>
>> this was with removing all power which makes the bq27421 loosing the settings.
>> And next reboot does another "update design-capacity".
>>
>>>>
>>>> (I have added some printk to trace seal/unseal etc.)
>>>>
>>>> Values match the 6000mAh specified by DT:
>>>>
>>>> bat: battery {
>>>> compatible = "simple-battery", "pyra-battery";
>>>> voltage-min-design-microvolt = <3200000>;
>>>> energy-full-design-microwatt-hours = <22200000>;
>>>> charge-full-design-microamp-hours = <6000000>;
>>>> };
>>>>
>>>> root@letux:~# cat /sys/class/power_supply/bq27421-0/uevent
>>>> POWER_SUPPLY_NAME=bq27421-0
>>>> POWER_SUPPLY_STATUS=Discharging
>>>> POWER_SUPPLY_PRESENT=1
>>>> POWER_SUPPLY_VOLTAGE_NOW=3943000
>>>> POWER_SUPPLY_CURRENT_NOW=-634000
>>>> POWER_SUPPLY_CAPACITY=82
>>>> POWER_SUPPLY_CAPACITY_LEVEL=Normal
>>>> POWER_SUPPLY_TEMP=319
>>>> POWER_SUPPLY_TECHNOLOGY=Li-ion
>>>> POWER_SUPPLY_CHARGE_FULL=5467000
>>>> POWER_SUPPLY_CHARGE_NOW=4611000
>>>> POWER_SUPPLY_CHARGE_FULL_DESIGN=6000000
>>>> POWER_SUPPLY_MANUFACTURER=Texas Instruments
>>>> root@letux:~#
>>>>
>>>> Anything else I should test?
>>>
>>> Could you also test voltage-min-design-microvolt at 3177 to make sure
>>> that's configurable too?
>>
>> Yes:
>>
>> bat: battery {
>> compatible = "simple-battery", "pyra-battery";
>> voltage-min-design-microvolt = <3177000>;
>> energy-full-design-microwatt-hours = <22200000>;
>> charge-full-design-microamp-hours = <6000000>;
>> };
>>
>> gives
>>
>> [ 6.241009] bq27xxx_battery_settings
>> [ 6.241055] bq27xxx_battery_set_config
>> [ 6.241058] bq27xxx_battery_unseal
>> [ 6.257073] bq27xxx-battery 1-0055: update design-capacity to 6000
>> [ 6.257078] bq27xxx-battery 1-0055: update design-energy to 22200
>> [ 6.257084] bq27xxx-battery 1-0055: update terminate-voltage to 3177
>> [ 6.379230] bq27xxx_battery_seal
>>
>> So it looks good.
>
> \o/
>
>>> Sebastian just queued my series to -next. Would you be inclined to
>>> submit a new patch enabling bq27421? If so, the sooner the better
>>> since merge window is imminent :-)
>>
>> I already have a patch for that...
>
> Peering eagerly at linux-pm for said patch...
Seems to have been lost on first attempt. Will resend in some minutes.
BR,
Nikolaus
next prev parent reply other threads:[~2017-08-29 20:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-29 9:43 H. Nikolaus Schaller
2017-08-29 10:40 ` Liam Breck
2017-08-29 14:24 ` H. Nikolaus Schaller
2017-08-29 18:18 ` Liam Breck
2017-08-29 19:50 ` H. Nikolaus Schaller
2017-08-29 20:05 ` Liam Breck
2017-08-29 20:09 ` H. Nikolaus Schaller [this message]
2017-09-10 20:50 ` Pavel Machek
[not found] ` <0AB88D4C-1F05-4B4A-909E-7DBBD6FD0B13@openpandora.org>
[not found] ` <295D5DC5-7385-425B-847B-5AF9F93F85F7@goldelico.com>
2017-08-29 17:31 ` Michael Mrozek
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=12EEE9C8-4C5F-4A4B-AB5B-ABF28DF8D275@goldelico.com \
--to=hns@goldelico.com \
--cc=kernel@pyra-handheld.com \
--cc=letux-kernel@openphoenux.org \
--cc=liam@networkimprov.net \
--cc=linux-kernel@vger.kernel.org \
--cc=sre@kernel.org \
/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
all inboxes | Powered by JetHome®