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