xref: /freebsd/sys/contrib/device-tree/Bindings/power/supply/ingenic,battery.yaml (revision 8bab661a3316d8bd9b9fbd11a3b4371b91507bd2)
16be33864SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
26be33864SEmmanuel Vadot# Copyright 2019-2020 Artur Rojek
36be33864SEmmanuel Vadot%YAML 1.2
46be33864SEmmanuel Vadot---
5b97ee269SEmmanuel Vadot$id: http://devicetree.org/schemas/power/supply/ingenic,battery.yaml#
6b97ee269SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
76be33864SEmmanuel Vadot
8*8bab661aSEmmanuel Vadottitle: Ingenic JZ47xx battery
96be33864SEmmanuel Vadot
106be33864SEmmanuel Vadotmaintainers:
116be33864SEmmanuel Vadot  - Artur Rojek <contact@artur-rojek.eu>
126be33864SEmmanuel Vadot
13*8bab661aSEmmanuel Vadot$ref: power-supply.yaml#
14*8bab661aSEmmanuel Vadot
156be33864SEmmanuel Vadotproperties:
166be33864SEmmanuel Vadot  compatible:
176be33864SEmmanuel Vadot    oneOf:
186be33864SEmmanuel Vadot      - const: ingenic,jz4740-battery
196be33864SEmmanuel Vadot      - items:
206be33864SEmmanuel Vadot          - enum:
216be33864SEmmanuel Vadot              - ingenic,jz4725b-battery
226be33864SEmmanuel Vadot              - ingenic,jz4770-battery
236be33864SEmmanuel Vadot          - const: ingenic,jz4740-battery
246be33864SEmmanuel Vadot
256be33864SEmmanuel Vadot  io-channels:
266be33864SEmmanuel Vadot    maxItems: 1
276be33864SEmmanuel Vadot
286be33864SEmmanuel Vadot  io-channel-names:
296be33864SEmmanuel Vadot    const: battery
306be33864SEmmanuel Vadot
316be33864SEmmanuel Vadot  monitored-battery:
326be33864SEmmanuel Vadot    description: >
336be33864SEmmanuel Vadot      This property must be a phandle to a node using the format described
346be33864SEmmanuel Vadot      in battery.yaml, with the following properties being required:
356be33864SEmmanuel Vadot      - voltage-min-design-microvolt: drained battery voltage,
366be33864SEmmanuel Vadot      - voltage-max-design-microvolt: fully charged battery voltage.
376be33864SEmmanuel Vadot
386be33864SEmmanuel Vadotrequired:
396be33864SEmmanuel Vadot  - compatible
406be33864SEmmanuel Vadot  - io-channels
416be33864SEmmanuel Vadot  - io-channel-names
426be33864SEmmanuel Vadot  - monitored-battery
436be33864SEmmanuel Vadot
446be33864SEmmanuel VadotadditionalProperties: false
456be33864SEmmanuel Vadot
466be33864SEmmanuel Vadotexamples:
476be33864SEmmanuel Vadot  - |
486be33864SEmmanuel Vadot    #include <dt-bindings/iio/adc/ingenic,adc.h>
496be33864SEmmanuel Vadot
506be33864SEmmanuel Vadot    simple_battery: battery {
516be33864SEmmanuel Vadot            compatible = "simple-battery";
526be33864SEmmanuel Vadot            voltage-min-design-microvolt = <3600000>;
536be33864SEmmanuel Vadot            voltage-max-design-microvolt = <4200000>;
546be33864SEmmanuel Vadot    };
556be33864SEmmanuel Vadot
566be33864SEmmanuel Vadot    ingenic-battery {
576be33864SEmmanuel Vadot            compatible = "ingenic,jz4740-battery";
586be33864SEmmanuel Vadot            io-channels = <&adc INGENIC_ADC_BATTERY>;
596be33864SEmmanuel Vadot            io-channel-names = "battery";
606be33864SEmmanuel Vadot            monitored-battery = <&simple_battery>;
616be33864SEmmanuel Vadot    };
62