Linux Power Management development
 help / color / mirror / Atom feed
From: "Andrew F. Davis" <afd@ti.com>
To: Liam Breck <liam@networkimprov.net>, Rob Herring <robh@kernel.org>
Cc: Sebastian Reichel <sre@kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Liam Breck <kernel@networkimprov.net>
Subject: Re: [PATCH v8 1/9] devicetree: power: Add battery.txt
Date: Thu, 16 Mar 2017 08:31:52 -0500	[thread overview]
Message-ID: <bb0928ce-6d29-3d09-2c5b-f4a084fe06e9@ti.com> (raw)
In-Reply-To: <CAKvHMgQujE4uYNt0vPkt6qUOtVqdvzXs0zXTkDVRq9YLNvunBQ@mail.gmail.com>

On 03/16/2017 01:45 AM, Liam Breck wrote:
> On Wed, Mar 15, 2017 at 4:50 PM, Rob Herring <robh@kernel.org> wrote:
>> On Wed, Mar 15, 2017 at 5:04 PM, Liam Breck <liam@networkimprov.net> wrote:
>>> On Wed, Mar 15, 2017 at 1:10 PM, Rob Herring <robh@kernel.org> wrote:
>>>> On Thu, Mar 2, 2017 at 12:31 PM, Liam Breck <liam@networkimprov.net> wrote:
>>>>> Hi Rob,
>>>>>
>>>>> On Thu, Mar 2, 2017 at 7:14 AM, Rob Herring <robh@kernel.org> wrote:
>>>>>> On Sun, Feb 26, 2017 at 11:11:09PM -0800, Liam Breck wrote:
>>>>>>> From: Liam Breck <kernel@networkimprov.net>
>>>>>>>
>>>>>>> Documentation of static battery characteristics that can be defined
>>>>>>> for batteries which cannot self-identify. This information is required
>>>>>>> by fuel-gauge and charger chips for proper handling of the battery.
>>>>>>>
>>>>>>> Cc: Rob Herring <robh@kernel.org>
>>>>>>> Cc: devicetree@vger.kernel.org
>>>>>>> Signed-off-by: Matt Ranostay <matt@ranostay.consulting>
>>>>>>> Signed-off-by: Liam Breck <kernel@networkimprov.net>
>>>>>>> ---
>>>>>>>  .../devicetree/bindings/power/supply/battery.txt   | 42 ++++++++++++++++++++++
>>>>>>>  1 file changed, 42 insertions(+)
>>>>>>>  create mode 100644 Documentation/devicetree/bindings/power/supply/battery.txt
>>>>>>>
>>>>>>> diff --git a/Documentation/devicetree/bindings/power/supply/battery.txt b/Documentation/devicetree/bindings/power/supply/battery.txt
>>>>>>> new file mode 100644
>>>>>>> index 0000000..3d916bd
>>>>>>> --- /dev/null
>>>>>>> +++ b/Documentation/devicetree/bindings/power/supply/battery.txt
>>>>>>> @@ -0,0 +1,42 @@
>>>>>>> +Battery Characteristics
>>>>>>> +
>>>>>>> +Required Properties:
>>>>>>> + - compatible: Must be "fixed-battery"
>>>>>>
>>>>>> Still not liking this name, but I don't have a better suggestion. Please
>>>>>> describe here what is and isn't a "fixed battery".
>>>>>
>>>>> Sebastian...?
>>>>>
>>>>>>> +
>>>>>>> +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
>>>>>>> +
>>>>>>> +Future Properties must be named for the corresponding elements in
>>>>>>> +enum power_supply_property, defined in include/linux/power_supply.h.
>>>>>>
>>>>>> Um, no. That's exactly not how DT bindings should be done.
>>>>>
>>>>> Power supply components surface stats in sysfs using the names in enum
>>>>> power_supply_property. For example,
>>>>> /sys/class/power_supply/.../voltage_min_design. Matching input (DT)
>>>>> and output (sysfs) names is sensible. The above comment is already
>>>>> attached to struct power_supply_battery_info, which is the initial
>>>>> destination for the above DT properties.
>>>>>
>>>>> Shall I mention sysfs in the above comment?
>>>>
>>>> Absolutely not. Bindings should not reference Linux.
>>>>
>>>> While sometimes things can align, there is no guarantee that they
>>>> will. DT is h/w description. sysfs is user configuration.
>>>
>>> sysfs for power_supply also provides fixed hw characteristics.
>>>
>>> Sebastian proposed DT:battery specifically to be consumed by
>>> power_supply_core. Allowing names in DT:battery and
>>> power_supply_property to diverge would cause confusion and wasted
>>> time, for no particular benefit. As there is no rationale to
>>> reconsider the names of these fields for DT:battery, let's write that
>>> into the docs.
>>
>> Write it into the Linux docs then. The DT docs need to stand on their
>> own for the standalone DT tree[1] that other projects import.
> 
> We will document it on the Linux side. But referencing a Linux header
> file as the origin of property names in DT;battery does not create a
> Linux dependency for standalone DT. It merely clarifies the naming
> scheme.
> 
> Also a huge number of DT bindings are Linux-specific, as they are
> implemented by some kernel driver. Do you plan to rip those out of
> devicetree-rebasing?
> 

Being implemented by a Linux kernel driver does not mean they can *only*
every be implemented by a Linux kernel driver, U-Boot for instance takes
drivers from Linux and so the DTs work mostly unchanged.

Also the biggest thing to remember is that doing something wrong before,
doesn't justify continuing to do it wrong.

>> [1] https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/

  reply	other threads:[~2017-03-16 13:34 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-27  7:11 [PATCH v8 0/9] devicetree battery support and client bq27xxx_battery Liam Breck
2017-02-27  7:11 ` [PATCH v8 2/9] devicetree: property-units: Add uWh and uAh units Liam Breck
     [not found] ` <20170227071117.18934-1-liam-RYWXG+zxWwBdeoIcmNTgJF6hYfS7NtTn@public.gmane.org>
2017-02-27  7:11   ` [PATCH v8 1/9] devicetree: power: Add battery.txt Liam Breck
     [not found]     ` <20170227071117.18934-2-liam-RYWXG+zxWwBdeoIcmNTgJF6hYfS7NtTn@public.gmane.org>
2017-03-02 15:14       ` Rob Herring
2017-03-02 18:31         ` Liam Breck
2017-03-15 20:10           ` Rob Herring
     [not found]             ` <CAL_Jsq+8Y=GtyjVZA-suZLH+ySDshaoU9qh96BF+PeUYK3FZxg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-15 22:04               ` Liam Breck
2017-03-15 23:50                 ` Rob Herring
     [not found]                   ` <CAL_JsqJOFUSRY_KPzwNWrx4FF1_F6XNK8OfkqhqgBpxH9WrZeQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-16  6:45                     ` Liam Breck
2017-03-16 13:31                       ` Andrew F. Davis [this message]
     [not found]                         ` <bb0928ce-6d29-3d09-2c5b-f4a084fe06e9-l0cyMroinI0@public.gmane.org>
2017-03-16 14:07                           ` Liam Breck
     [not found]                       ` <CAKvHMgQujE4uYNt0vPkt6qUOtVqdvzXs0zXTkDVRq9YLNvunBQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-18 20:34                         ` Rob Herring
2017-02-27  7:11   ` [PATCH v8 3/9] devicetree: power: bq27xxx: Add monitored-battery documentation Liam Breck
     [not found]     ` <20170227071117.18934-4-liam-RYWXG+zxWwBdeoIcmNTgJF6hYfS7NtTn@public.gmane.org>
2017-03-02 15:16       ` Rob Herring
2017-02-27  7:11 ` [PATCH v8 4/9] power: power_supply: Add power_supply_battery_info and API Liam Breck
2017-02-27  7:11 ` [PATCH v8 5/9] power: bq27xxx_battery: Define access methods to write chip registers Liam Breck
2017-02-27  7:11 ` [PATCH v8 6/9] power: bq27xxx_battery: Add BQ27425 chip id Liam Breck
2017-02-27 16:28   ` Andrew F. Davis
2017-02-27  7:11 ` [PATCH v8 7/9] power: bq27xxx_battery: Add power_supply_battery_info support Liam Breck
2017-02-27 18:06   ` Andrew F. Davis
2017-02-27 20:05     ` Liam Breck
2017-02-27 21:21       ` Andrew F. Davis
2017-02-27 21:35         ` Liam Breck
2017-02-27 21:47           ` Andrew F. Davis
2017-02-27 22:14             ` Liam Breck
2017-02-27 22:37               ` Liam Breck
2017-03-01 23:09                 ` Liam Breck
2017-03-03 21:36   ` Liam Breck
2017-03-03 21:51     ` Andrew F. Davis
2017-03-03 22:04       ` Liam Breck
2017-03-03 22:07         ` Andrew F. Davis
2017-03-03 22:13           ` Liam Breck
2017-03-06 16:42             ` Andrew F. Davis
2017-03-06 20:14               ` Liam Breck
2017-02-27  7:11 ` [PATCH v8 8/9] power: bq27xxx_battery: Add print_dm_blocks() to log chip memory Liam Breck
2017-02-27 18:07   ` Andrew F. Davis
2017-02-27  7:11 ` [PATCH v8 9/9] power: bq27xxx_battery_i2c: Add I2C bulk read/write functions Liam Breck

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=bb0928ce-6d29-3d09-2c5b-f4a084fe06e9@ti.com \
    --to=afd@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@networkimprov.net \
    --cc=liam@networkimprov.net \
    --cc=linux-pm@vger.kernel.org \
    --cc=robh@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