Re: [PATCH v4 2/8] devicetree: power: add battery state machine documentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Sun, Jan 29, 2017 at 6:30 PM, Sebastian Reichel <sre@xxxxxxxxxx> wrote:
> Hi,
>
> On Sun, Jan 29, 2017 at 03:22:31PM -0800, Liam Breck wrote:
>> On Sun, Jan 29, 2017 at 9:20 AM, Sebastian Reichel <sre@xxxxxxxxxx> wrote:
>> > On Wed, Jan 25, 2017 at 11:02:03PM -0800, Matt Ranostay wrote:
>> >> On Wed, Jan 25, 2017 at 10:19 PM, Liam Breck <liam@xxxxxxxxxxxxxxxxx> wrote:
>> >> > On Sun, Jan 22, 2017 at 2:22 PM, Liam Breck <liam@xxxxxxxxxxxxxxxxx> wrote:
>> >> >
>> >> >> diff --git a/Documentation/devicetree/bindings/power/supply/battery.txt b/Documentation/devicetree/bindings/power/supply/battery.txt
>> >> >> new file mode 100644
>> >> >> index 000000000000..398b4d622883
>> >> >> --- /dev/null
>> >> >> +++ b/Documentation/devicetree/bindings/power/supply/battery.txt
>> >> >> @@ -0,0 +1,34 @@
>> >> >> +Battery Characteristics
>> >> >> +
>> >> >> +Required Properties:
>> >> >> + - compatible: Must be "fixed-battery"
>> >> >> +
>> >> >> +Optional Properties:
>> >> >> + - termination-microvolt: dead battery voltage
>> >> >> + - design-microwatt-hours: battery design energy
>> >> >> + - design-microamp-hours: battery design capacity
>> >> >
>> >> > Also I suspect the members of struct power_supply_battery_info should
>> >> > use the same names as appear in dts:
>> >>
>> >> These are internal and we can't be thinking just device tree.. ACPI
>> >> and platform data is also an option.
>> >
>> > well platform data just uses the struct. ACPI is probably not
>> > relevant, since in ACPI world one usually has smart batteries.
>> > But yes, the names can be different.
>> >
>> > The important part is, that the API is used correctly, so it
>> > should be clear what each property is used for. For example
>> > termination_microvolt is not clear: Is this charge termination
>> > voltage or system shutdown voltage? Also we do not need to add
>> > "micro", since the power-supply subsystem always uses micro
>> > based units.
>>
>> It's the min battery voltage. So...
>> drained_voltage, depleted_voltage, sapped_voltage, spent_voltage...
>
> This is often called EOD (end of discharge) voltage, so let's use
> end_of_discharge_voltage.

How's this?

Optional Properties:
  - end-of-discharge-microvolt: dead battery voltage
  - design-microwatt-hours: battery design energy
  - design-microamp-hours: battery design capacity

struct power_supply_battery_info {
   int design_energy_uwh;  /* microWatt-hours */
   int design_current_uah;  /* microAmp-hours */
   int end_of_discharge_uv; /* microVolts */
};

Default value for unset DT properties will be -EINVAL, since 0 is
valid for design_* on the chips.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux