All of lore.kernel.org
 help / color / mirror / Atom feed
From: Quentin Schulz <quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Liam Breck <liam-RYWXG+zxWwBdeoIcmNTgJF6hYfS7NtTn@public.gmane.org>
Cc: Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v4 01/18] dt-bindings: power: battery: add constant-charge-current property
Date: Wed, 29 Mar 2017 09:09:29 +0200	[thread overview]
Message-ID: <659fb6a3-d49d-5429-8770-88917e4fd0b3@free-electrons.com> (raw)
In-Reply-To: <CAKvHMgRtEnNbokYReu2vEs9UKH6qZnncdyQD=1JMDTZeN+aYCA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Liam,

On 29/03/2017 08:55, Liam Breck wrote:
> Hi Quentin,
> 
> On Thu, Mar 16, 2017 at 12:42 AM, Liam Breck <liam-RYWXG+zxWwBdeoIcmNTgJF6hYfS7NtTn@public.gmane.org> wrote:
>> On Thu, Mar 16, 2017 at 12:03 AM, Quentin Schulz
>> <quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote:
>>> Hi Liam,
>>>
>>> On 16/03/2017 07:27, Liam Breck wrote:
>>>> Hi Rob,
>>>>
>>>> On Wed, Mar 15, 2017 at 6:10 AM, Quentin Schulz
>>>> <quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote:
>>>>> Hi Liam,
>>>>>
>>>>> On 15/03/2017 13:08, Liam Breck wrote:
>>>>>> I dropped most of the CCs, pls re-add anyone essential. Use Cc lines
>>>>>> in patch description to direct a patch to interested parties and
>>>>>> relevant lists. I don't want to see all 19 patches in this series.
>>>>>>
>>>>>> On Wed, Mar 15, 2017 at 3:55 AM, Quentin Schulz
>>>>>> <quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> wrote:
>>>>>>> This adds the constant-charge-current property to the list of optional
>>>>>>> properties of the battery.
>>>>>>>
>>>>>>> The constant charge current is critical for batteries as they can't
>>>>>>> handle all charge currents.
>>>>>>>
>>>>>>> Signed-off-by: Quentin Schulz <quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
>>>>>>> Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>>>>>>> ---
>>>>>>>
>>>>>>> v4:
>>>>>>>  - switch from constant-charge-current-microamp to constant-charge-microamp,
>>>>
>>>> Sebastian is on record supporting name alignment between DT:battery
>>>> properties and enum power_supply_property.
>>>>
>>>> Could you OK a change back to constant-charge-current-microamp in this patch?
>>>>
>>>> Note that the following could appear in DT:battery in future:
>>>>
>>>> constant-charge-current-microamp
>>>> constant-charge-current-max-microamp
>>>
>>> OK. I am actually setting max constant charge current and constant
>>> current charge with the same DT property so I might need to adapt my
>>> patches.
>>
>> I suspect you should set battery:*-current-max with DT, as -current is
>> "programmed by charger" so seems to be a stat, not a fixed
>> characteristic.
> 
> Did you resolve this issue?
> 

Sorry, completely missed your first mail.

Constant charge current is actually what I set in the PMIC. The maximum
constant charge current is completely PMIC-agnostic in my driver as it
is used to tell the user that (s)he shouldn't really have a constant
charge current over the maximum limit as the battery might not be able
to handle such high current.

What I suggest is to have both properties in DT. I'll set the maximum as
I do today and we can give the user the ability to set a "default"
constant charge current (below maximum constant charge current) in the
DT. Maybe we do not want to recharge your battery with the maximum value
by default?

> Rob & Sebastian want me to merge all items for
> bindings/power/supply/battery.txt. If I do that I'll also roll up
> their counterparts in power_supply_core.c and submit a patchset for
> those two files.
> 

I guess that adding the two properties make sense, don't you think?

Also, could you Cc me on your next version of your patches? So I know
when to rebase and slightly rework my patches once your patch series is
merged.

Thanks,
Quentin

>> You may program your charger's -current with the battery's
>> -current-max, of course.
>>
>> Note that your charger also has a -current-max characteristic, likely
>> different than your battery. You may not need that in DT tho.
>>
>>>> constant-charge-voltage-microvolt
>>>> constant-charge-voltage-max-microvolt
>>>>
>>>> Thanks!
>>>>
>>>>>> Must be constant-charge-current-microamp for the reasons discussed in
>>>>>> battery.txt - consistency with sysfs names.
>>>>>>
>>>>>
>>>>> Hum. Just nitpicking, but I disagree with the use of 'must'. IIRC there
>>>>> is nothing in the code that would require the property to be named after
>>>>> a property from the enum power_supply_property.
>>>>>
>>>>> I would say that you _want_ it to be named like that because it
>>>>> underlines the relation between the DT property and the actual impacted
>>>>> property in the power supply subsystem. I'm fine with this reason but in
>>>>> the end, the maintainer's opinion prevails (if (s)he does not want it,
>>>>> (s)he will not take it). So, basically, I actually don't mind either
>>>>> option and I see arguments on each side.
>>>>>
>>>>> So, just waiting for maintainer's opinion to make the final version of
>>>>> this patch.
>>>>>
>>>>> Thanks,
>>>>> Quentin
>>>>>
>>>>>> Also applies to power_supply_core.c patch.
>>>>>>
>>>>>> Rob: enum power_supply_property also lists constant-charge-voltage,
>>>>>> hence the -current
>>>>>>
>>>>>>
>>>>>>> added in v3
>>>>>>>
>>>>>>>  Documentation/devicetree/bindings/power/supply/battery.txt | 2 ++
>>>>>>>  1 file changed, 2 insertions(+)
>>>>>>>
>>>>>>> diff --git a/Documentation/devicetree/bindings/power/supply/battery.txt b/Documentation/devicetree/bindings/power/supply/battery.txt
>>>>>>> index 0278617..9594e1e 100644
>>>>>>> --- a/Documentation/devicetree/bindings/power/supply/battery.txt
>>>>>>> +++ b/Documentation/devicetree/bindings/power/supply/battery.txt
>>>>>>> @@ -7,6 +7,7 @@ Optional Properties:
>>>>>>>   - voltage-min-design-microvolt: drained battery voltage
>>>>>>>   - energy-full-design-microwatt-hours: battery design energy
>>>>>>>   - charge-full-design-microamp-hours: battery design capacity
>>>>>>> + - constant-charge-microamp: battery constant charge current
>>>>>>>
>>>>>>>  Because drivers surface properties in sysfs using names derived
>>>>>>>  from enum power_supply_property, e.g.
>>>>>>> @@ -30,6 +31,7 @@ Example:
>>>>>>>                 voltage-min-design-microvolt = <3200000>;
>>>>>>>                 energy-full-design-microwatt-hours = <5290000>;
>>>>>>>                 charge-full-design-microamp-hours = <1430000>;
>>>>>>> +               constant-charge-microamp = <300000>;
>>>>>>>         };
>>>>>>>
>>>>>>>         charger: charger@11 {
>>>>>>> --
>>>>>>> 2.9.3
>>>>>>>
>>>>>
>>>>> --
>>>>> Quentin Schulz, Free Electrons
>>>>> Embedded Linux and Kernel engineering
>>>>> http://free-electrons.com
>>>
>>> --
>>> Quentin Schulz, Free Electrons
>>> Embedded Linux and Kernel engineering
>>> http://free-electrons.com

-- 
Quentin Schulz, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-03-29  7:09 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-15 10:55 [PATCH v4 00/18] add support for AXP20X and AXP22X power supply drivers Quentin Schulz
2017-03-15 10:55 ` Quentin Schulz
2017-03-15 10:55 ` Quentin Schulz
2017-03-15 10:55 ` [PATCH v4 01/18] dt-bindings: power: battery: add constant-charge-current property Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 12:08   ` Liam Breck
     [not found]     ` <CAKvHMgSnyPPMEZ1o70Ed2oBHGcMho=-jjFhfXGn4t+2bdALEew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-15 13:10       ` Quentin Schulz
     [not found]         ` <ce6f2ddb-f875-0370-ca45-293397d97495-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2017-03-15 22:23           ` Sebastian Reichel
2017-03-16  6:27           ` Liam Breck
     [not found]             ` <CAKvHMgR58sDnB-nn386Bd-H0Duevkeoc8eEfz=otLAumc8FD+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-16  7:03               ` Quentin Schulz
2017-03-16  7:42                 ` Liam Breck
     [not found]                   ` <CAKvHMgRKroPFDdNMb=F=bA4bTwg9bYMAR-5Z4DKLzHJtCYz3_Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-29  6:55                     ` Liam Breck
     [not found]                       ` <CAKvHMgRtEnNbokYReu2vEs9UKH6qZnncdyQD=1JMDTZeN+aYCA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-29  7:09                         ` Quentin Schulz [this message]
2017-03-29  7:39                           ` Liam Breck
2017-03-29  7:54                             ` Quentin Schulz
2017-03-29  9:26                               ` Liam Breck
     [not found]                                 ` <CAKvHMgQf=Zod-F9SMPDDj5Eq3v=JHGh7uns-T_=ynQM0dMtEvw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-30  6:41                                   ` Quentin Schulz
2017-03-30  7:30                                     ` Liam Breck
2017-03-15 22:45         ` Liam Breck
2017-03-15 10:55 ` [PATCH v4 02/18] power: supply: power_supply_core: add constant-charge-current optional property Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 22:24   ` Sebastian Reichel
2017-03-15 22:24     ` Sebastian Reichel
2017-03-15 22:24     ` Sebastian Reichel
2017-03-15 10:55 ` [PATCH v4 03/18] mfd: axp20x: correct name of temperature data ADC registers Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55 ` [PATCH v4 04/18] iio: adc: add support for X-Powers AXP20X and AXP22X PMICs ADCs Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55 ` [PATCH v4 05/18] mfd: axp20x: add ADC cells for AXP20X and AXP22X PMICs Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55 ` [PATCH v4 06/18] mfd: axp20x: add AC power supply cells for " Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55 ` [PATCH v4 07/18] ARM: dtsi: axp209: add AC power supply subnode Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55 ` [PATCH v4 08/18] ARM: dtsi: axp22x: " Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55 ` [PATCH v4 09/18] ARM: dts: sun8i: sina33: enable ACIN " Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55 ` [PATCH v4 10/18] ARM: sun5i: chip: " Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55 ` [PATCH v4 11/18] dt-bindings: power: supply: add AXP20X/AXP22X battery DT binding Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 22:28   ` Sebastian Reichel
2017-03-15 22:28     ` Sebastian Reichel
2017-03-15 22:28     ` Sebastian Reichel
2017-03-15 22:41     ` Quentin Schulz
2017-03-15 22:41       ` Quentin Schulz
2017-03-15 22:41       ` Quentin Schulz
2017-03-15 23:02       ` Sebastian Reichel
2017-03-15 23:02         ` Sebastian Reichel
2017-03-15 23:02         ` Sebastian Reichel
2017-03-15 10:55 ` [PATCH v4 12/18] mfd: axp20x: add CHRG_CTRL1/2/3 to writeable regs for AXP20X/AXP22X Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55 ` [PATCH v4 13/18] power: supply: add battery driver for AXP20X and AXP22X PMICs Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 22:38   ` Sebastian Reichel
2017-03-15 22:38     ` Sebastian Reichel
2017-03-15 22:38     ` Sebastian Reichel
2017-03-15 10:55 ` [PATCH v4 14/18] mfd: axp20x: add MFD cells for AXP20X and AXP22X battery driver Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55 ` [PATCH v4 15/18] ARM: dtsi: axp209: add battery power supply subnode Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55 ` [PATCH v4 16/18] ARM: dtsi: axp22x: " Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55 ` [PATCH v4 17/18] ARM: dts: sun8i: sina33: enable " Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55 ` [PATCH v4 18/18] ARM: sun5i: chip: " Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 10:55   ` Quentin Schulz
2017-03-15 12:14 ` [PATCH v4 00/18] add support for AXP20X and AXP22X power supply drivers Lee Jones
2017-03-15 12:14   ` Lee Jones
2017-03-15 12:14   ` Lee Jones
2017-03-15 13:18   ` Quentin Schulz
2017-03-15 13:18     ` Quentin Schulz
2017-03-15 13:18     ` Quentin Schulz
2017-03-15 22:46     ` Sebastian Reichel
2017-03-15 22:46       ` Sebastian Reichel
2017-03-15 22:46       ` Sebastian Reichel
2017-03-20 11:34       ` Quentin Schulz
2017-03-20 11:34         ` Quentin Schulz
2017-03-20 11:34         ` Quentin Schulz
2017-03-20 19:11         ` Sebastian Reichel
2017-03-20 19:11           ` Sebastian Reichel
2017-03-20 19:11           ` 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=659fb6a3-d49d-5429-8770-88917e4fd0b3@free-electrons.com \
    --to=quentin.schulz-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=liam-RYWXG+zxWwBdeoIcmNTgJF6hYfS7NtTn@public.gmane.org \
    --cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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 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.