From: Hans de Goede <hdegoede@redhat.com>
To: Liam Breck <liam@networkimprov.net>
Cc: Sebastian Reichel <sre@kernel.org>,
linux-pm@vger.kernel.org, Tony Lindgren <tony@atomide.com>,
Liam Breck <kernel@networkimprov.net>
Subject: Re: [PATCH v1 1/1] power: bq24190_charger: Deprecate battery class and replicate its features in charger
Date: Tue, 18 Apr 2017 13:49:03 +0200 [thread overview]
Message-ID: <d143be31-1aaf-5007-baa3-c01b4818c626@redhat.com> (raw)
In-Reply-To: <CAKvHMgRRyAUvWdYvFMoNNDF6hAx1KqKoSLr+-_cW+3ZT7z3PGg@mail.gmail.com>
Hi,
On 18-04-17 12:27, Liam Breck wrote:
> On Tue, Apr 18, 2017 at 3:05 AM, Hans de Goede <hdegoede@redhat.com> wrote:
>> Hi,
>>
>> On 18-04-17 11:42, Liam Breck wrote:
>>>
>>> Hi Hans,
>>>
>>> On Tue, Apr 18, 2017 at 1:05 AM, Hans de Goede <hdegoede@redhat.com>
>>> wrote:
>>>>
>>>> Hi Liam,
>>>>
>>>> On 17-04-17 01:06, Liam Breck wrote:
>>>>>
>>>>>
>>>>> From: Liam Breck <kernel@networkimprov.net>
>>>>>
>>>>> The driver was registering two classes, bq24190-battery & -charger.
>>>>> Because the power supply framework cannot surface features from multiple
>>>>> drivers in a single class, a fuel gauge driver would create a third
>>>>> class,
>>>>> which some power management utilities cannot see.
>>>>>
>>>>> Deprecate the -battery class for future removal and replicate its
>>>>> features
>>>>> in -charger. Set /sys/class...-charger/online = pg_stat &&
>>>>> !batfet_disable.
>>>>> If device_property "omit-battery-class" is set, don't register -battery.
>>>>>
>>>>> Cc: Tony Lindgren <tony@atomide.com>
>>>>> Cc: Hans de Goede <hdegoede@redhat.com>
>>>>> Signed-off-by: Liam Breck <kernel@networkimprov.net>
>>>>
>>>>
>>>>
>>>> Thank you for writing this patch.
>>>
>>>
>>> Glad to help!
>>>
>>>> The patch looks good to me:
>>>
>>>
>>> Darn, I was hoping you'd see *something* amiss in all that clutter :-)
>>
>>
>> Wel, I did not find the forward declaration of bq24190_battery_set_online
>> and friends pretty, but I can understand why you did this and we can
>> clean that up when we remove the battery interface altogether later.
>
> Blame the C standards crew for that mess :-)
>
>>> Do you think charger-powered and battery-connected is the right
>>> definition of power_supply_prop_online?
>>
>>
>> Now that you specifically ask I've been thinking a bit more this,
>> but I still can't find anything wrong with that as definition :)
>
> The power_supply_class docs really should tell us how to define this.
>
>>> Sebastian had suggested surfacing the batfet as a regulator, but altho
>>> user settable, it's a binary widget.
>>
>>
>> Turning off the batfet typically will turn off the entire system,
>> I believe it is more of an emergency break style switch which gets
>> thrown by the charger under certain (very bad) conditions then
>> something which we would actually ever want to use / control from
>> within the kernel.
>
> It's supposed to be disabled at the factory prior to shipping to avoid
> depleting the battery before product reaches buyer. The same should
> also be done for storage. So it can be an end-user switch.
True.
Regards,
Hans
next prev parent reply other threads:[~2017-04-18 11:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-16 23:06 [PATCH v1 1/1] power: bq24190_charger: Deprecate battery class and replicate its features in charger Liam Breck
2017-04-18 8:05 ` Hans de Goede
2017-04-18 9:42 ` Liam Breck
2017-04-18 10:05 ` Hans de Goede
2017-04-18 10:27 ` Liam Breck
2017-04-18 11:49 ` Hans de Goede [this message]
2017-05-01 11:29 ` Sebastian Reichel
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=d143be31-1aaf-5007-baa3-c01b4818c626@redhat.com \
--to=hdegoede@redhat.com \
--cc=kernel@networkimprov.net \
--cc=liam@networkimprov.net \
--cc=linux-pm@vger.kernel.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