18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
28c2ecf20Sopenharmony_ci%YAML 1.2
38c2ecf20Sopenharmony_ci---
48c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/hwmon/adi,ltc2947.yaml#
58c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cititle: Analog Devices LTC2947 high precision power and energy monitor
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cimaintainers:
108c2ecf20Sopenharmony_ci  - Nuno Sá <nuno.sa@analog.com>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_cidescription: |
138c2ecf20Sopenharmony_ci  Analog Devices LTC2947 high precision power and energy monitor over SPI or I2C.
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci  https://www.analog.com/media/en/technical-documentation/data-sheets/LTC2947.pdf
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ciproperties:
188c2ecf20Sopenharmony_ci  compatible:
198c2ecf20Sopenharmony_ci    enum:
208c2ecf20Sopenharmony_ci      - adi,ltc2947
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci  reg:
238c2ecf20Sopenharmony_ci    maxItems: 1
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci  clocks:
268c2ecf20Sopenharmony_ci    description:
278c2ecf20Sopenharmony_ci      The LTC2947 uses either a trimmed internal oscillator or an external clock
288c2ecf20Sopenharmony_ci      as the time base for determining the integration period to represent time,
298c2ecf20Sopenharmony_ci      charge and energy. When an external clock is used, this property must be
308c2ecf20Sopenharmony_ci      set accordingly.
318c2ecf20Sopenharmony_ci    maxItems: 1
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci  adi,accumulator-ctl-pol:
348c2ecf20Sopenharmony_ci    description:
358c2ecf20Sopenharmony_ci      This property controls the polarity of current that is accumulated to
368c2ecf20Sopenharmony_ci      calculate charge and energy so that, they can be only accumulated for
378c2ecf20Sopenharmony_ci      positive current for example. Since there are two sets of registers for
388c2ecf20Sopenharmony_ci      the accumulated values, this entry can also have two items which sets
398c2ecf20Sopenharmony_ci      energy1/charge1 and energy2/charger2 respectively. Check table 12 of the
408c2ecf20Sopenharmony_ci      datasheet for more information on the supported options.
418c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32-array
428c2ecf20Sopenharmony_ci    minItems: 2
438c2ecf20Sopenharmony_ci    maxItems: 2
448c2ecf20Sopenharmony_ci    items:
458c2ecf20Sopenharmony_ci      enum: [0, 1, 2, 3]
468c2ecf20Sopenharmony_ci      default: 0
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci  adi,accumulation-deadband-microamp:
498c2ecf20Sopenharmony_ci    description:
508c2ecf20Sopenharmony_ci      This property controls the Accumulation Dead band which allows to set the
518c2ecf20Sopenharmony_ci      level of current below which no accumulation takes place.
528c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
538c2ecf20Sopenharmony_ci    maximum: 255
548c2ecf20Sopenharmony_ci    default: 0
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci  adi,gpio-out-pol:
578c2ecf20Sopenharmony_ci    description:
588c2ecf20Sopenharmony_ci      This property controls the GPIO polarity. Setting it to one makes the GPIO
598c2ecf20Sopenharmony_ci      active high, setting it to zero makets it active low. When this property
608c2ecf20Sopenharmony_ci      is present, the GPIO is automatically configured as output and set to
618c2ecf20Sopenharmony_ci      control a fan as a function of measured temperature.
628c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
638c2ecf20Sopenharmony_ci    enum: [0, 1]
648c2ecf20Sopenharmony_ci    default: 0
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci  adi,gpio-in-accum:
678c2ecf20Sopenharmony_ci    description:
688c2ecf20Sopenharmony_ci      When set, this property sets the GPIO as input. It is then used to control
698c2ecf20Sopenharmony_ci      the accumulation of charge, energy and time. This function can be
708c2ecf20Sopenharmony_ci      enabled/configured separately for each of the two sets of accumulation
718c2ecf20Sopenharmony_ci      registers. Check table 13 of the datasheet for more information on the
728c2ecf20Sopenharmony_ci      supported options. This property cannot be used together with
738c2ecf20Sopenharmony_ci      adi,gpio-out-pol.
748c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32-array
758c2ecf20Sopenharmony_ci    minItems: 2
768c2ecf20Sopenharmony_ci    maxItems: 2
778c2ecf20Sopenharmony_ci    items:
788c2ecf20Sopenharmony_ci      enum: [0, 1, 2]
798c2ecf20Sopenharmony_ci      default: 0
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_cirequired:
828c2ecf20Sopenharmony_ci  - compatible
838c2ecf20Sopenharmony_ci  - reg
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ciadditionalProperties: false
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ciexamples:
898c2ecf20Sopenharmony_ci  - |
908c2ecf20Sopenharmony_ci    spi {
918c2ecf20Sopenharmony_ci           #address-cells = <1>;
928c2ecf20Sopenharmony_ci           #size-cells = <0>;
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci           ltc2947_spi: ltc2947@0 {
958c2ecf20Sopenharmony_ci                   compatible = "adi,ltc2947";
968c2ecf20Sopenharmony_ci                   reg = <0>;
978c2ecf20Sopenharmony_ci                   /* accumulation takes place always for energ1/charge1. */
988c2ecf20Sopenharmony_ci                   /* accumulation only on positive current for energy2/charge2. */
998c2ecf20Sopenharmony_ci                   adi,accumulator-ctl-pol = <0 1>;
1008c2ecf20Sopenharmony_ci           };
1018c2ecf20Sopenharmony_ci    };
1028c2ecf20Sopenharmony_ci...
103