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