xref: /freebsd/sys/contrib/device-tree/Bindings/hwmon/adi,ltc2947.yaml (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*c66ec88fSEmmanuel Vadot%YAML 1.2
3*c66ec88fSEmmanuel Vadot---
4*c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/hwmon/adi,ltc2947.yaml#
5*c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*c66ec88fSEmmanuel Vadot
7*c66ec88fSEmmanuel Vadottitle: Analog Devices LTC2947 high precision power and energy monitor
8*c66ec88fSEmmanuel Vadot
9*c66ec88fSEmmanuel Vadotmaintainers:
10*c66ec88fSEmmanuel Vadot  - Nuno Sá <nuno.sa@analog.com>
11*c66ec88fSEmmanuel Vadot
12*c66ec88fSEmmanuel Vadotdescription: |
13*c66ec88fSEmmanuel Vadot  Analog Devices LTC2947 high precision power and energy monitor over SPI or I2C.
14*c66ec88fSEmmanuel Vadot
15*c66ec88fSEmmanuel Vadot  https://www.analog.com/media/en/technical-documentation/data-sheets/LTC2947.pdf
16*c66ec88fSEmmanuel Vadot
17*c66ec88fSEmmanuel Vadotproperties:
18*c66ec88fSEmmanuel Vadot  compatible:
19*c66ec88fSEmmanuel Vadot    enum:
20*c66ec88fSEmmanuel Vadot      - adi,ltc2947
21*c66ec88fSEmmanuel Vadot
22*c66ec88fSEmmanuel Vadot  reg:
23*c66ec88fSEmmanuel Vadot    maxItems: 1
24*c66ec88fSEmmanuel Vadot
25*c66ec88fSEmmanuel Vadot  clocks:
26*c66ec88fSEmmanuel Vadot    description:
27*c66ec88fSEmmanuel Vadot      The LTC2947 uses either a trimmed internal oscillator or an external clock
28*c66ec88fSEmmanuel Vadot      as the time base for determining the integration period to represent time,
29*c66ec88fSEmmanuel Vadot      charge and energy. When an external clock is used, this property must be
30*c66ec88fSEmmanuel Vadot      set accordingly.
31*c66ec88fSEmmanuel Vadot    maxItems: 1
32*c66ec88fSEmmanuel Vadot
33*c66ec88fSEmmanuel Vadot  adi,accumulator-ctl-pol:
34*c66ec88fSEmmanuel Vadot    description:
35*c66ec88fSEmmanuel Vadot      This property controls the polarity of current that is accumulated to
36*c66ec88fSEmmanuel Vadot      calculate charge and energy so that, they can be only accumulated for
37*c66ec88fSEmmanuel Vadot      positive current for example. Since there are two sets of registers for
38*c66ec88fSEmmanuel Vadot      the accumulated values, this entry can also have two items which sets
39*c66ec88fSEmmanuel Vadot      energy1/charge1 and energy2/charger2 respectively. Check table 12 of the
40*c66ec88fSEmmanuel Vadot      datasheet for more information on the supported options.
41*c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-array
42*c66ec88fSEmmanuel Vadot    minItems: 2
43*c66ec88fSEmmanuel Vadot    maxItems: 2
44*c66ec88fSEmmanuel Vadot    items:
45*c66ec88fSEmmanuel Vadot      enum: [0, 1, 2, 3]
46*c66ec88fSEmmanuel Vadot      default: 0
47*c66ec88fSEmmanuel Vadot
48*c66ec88fSEmmanuel Vadot  adi,accumulation-deadband-microamp:
49*c66ec88fSEmmanuel Vadot    description:
50*c66ec88fSEmmanuel Vadot      This property controls the Accumulation Dead band which allows to set the
51*c66ec88fSEmmanuel Vadot      level of current below which no accumulation takes place.
52*c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
53*c66ec88fSEmmanuel Vadot    maximum: 255
54*c66ec88fSEmmanuel Vadot    default: 0
55*c66ec88fSEmmanuel Vadot
56*c66ec88fSEmmanuel Vadot  adi,gpio-out-pol:
57*c66ec88fSEmmanuel Vadot    description:
58*c66ec88fSEmmanuel Vadot      This property controls the GPIO polarity. Setting it to one makes the GPIO
59*c66ec88fSEmmanuel Vadot      active high, setting it to zero makets it active low. When this property
60*c66ec88fSEmmanuel Vadot      is present, the GPIO is automatically configured as output and set to
61*c66ec88fSEmmanuel Vadot      control a fan as a function of measured temperature.
62*c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
63*c66ec88fSEmmanuel Vadot    enum: [0, 1]
64*c66ec88fSEmmanuel Vadot    default: 0
65*c66ec88fSEmmanuel Vadot
66*c66ec88fSEmmanuel Vadot  adi,gpio-in-accum:
67*c66ec88fSEmmanuel Vadot    description:
68*c66ec88fSEmmanuel Vadot      When set, this property sets the GPIO as input. It is then used to control
69*c66ec88fSEmmanuel Vadot      the accumulation of charge, energy and time. This function can be
70*c66ec88fSEmmanuel Vadot      enabled/configured separately for each of the two sets of accumulation
71*c66ec88fSEmmanuel Vadot      registers. Check table 13 of the datasheet for more information on the
72*c66ec88fSEmmanuel Vadot      supported options. This property cannot be used together with
73*c66ec88fSEmmanuel Vadot      adi,gpio-out-pol.
74*c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-array
75*c66ec88fSEmmanuel Vadot    minItems: 2
76*c66ec88fSEmmanuel Vadot    maxItems: 2
77*c66ec88fSEmmanuel Vadot    items:
78*c66ec88fSEmmanuel Vadot      enum: [0, 1, 2]
79*c66ec88fSEmmanuel Vadot      default: 0
80*c66ec88fSEmmanuel Vadot
81*c66ec88fSEmmanuel Vadotrequired:
82*c66ec88fSEmmanuel Vadot  - compatible
83*c66ec88fSEmmanuel Vadot  - reg
84*c66ec88fSEmmanuel Vadot
85*c66ec88fSEmmanuel Vadot
86*c66ec88fSEmmanuel VadotadditionalProperties: false
87*c66ec88fSEmmanuel Vadot
88*c66ec88fSEmmanuel Vadotexamples:
89*c66ec88fSEmmanuel Vadot  - |
90*c66ec88fSEmmanuel Vadot    spi {
91*c66ec88fSEmmanuel Vadot           #address-cells = <1>;
92*c66ec88fSEmmanuel Vadot           #size-cells = <0>;
93*c66ec88fSEmmanuel Vadot
94*c66ec88fSEmmanuel Vadot           ltc2947_spi: ltc2947@0 {
95*c66ec88fSEmmanuel Vadot                   compatible = "adi,ltc2947";
96*c66ec88fSEmmanuel Vadot                   reg = <0>;
97*c66ec88fSEmmanuel Vadot                   /* accumulation takes place always for energ1/charge1. */
98*c66ec88fSEmmanuel Vadot                   /* accumulation only on positive current for energy2/charge2. */
99*c66ec88fSEmmanuel Vadot                   adi,accumulator-ctl-pol = <0 1>;
100*c66ec88fSEmmanuel Vadot           };
101*c66ec88fSEmmanuel Vadot    };
102*c66ec88fSEmmanuel Vadot...
103