0001 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/hwmon/adi,ltc2947.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006
0007 title: Analog Devices LTC2947 high precision power and energy monitor
0008
0009 maintainers:
0010 - Nuno Sá <nuno.sa@analog.com>
0011
0012 description: |
0013 Analog Devices LTC2947 high precision power and energy monitor over SPI or I2C.
0014
0015 https://www.analog.com/media/en/technical-documentation/data-sheets/LTC2947.pdf
0016
0017 properties:
0018 compatible:
0019 enum:
0020 - adi,ltc2947
0021
0022 reg:
0023 maxItems: 1
0024
0025 clocks:
0026 description:
0027 The LTC2947 uses either a trimmed internal oscillator or an external clock
0028 as the time base for determining the integration period to represent time,
0029 charge and energy. When an external clock is used, this property must be
0030 set accordingly.
0031 maxItems: 1
0032
0033 adi,accumulator-ctl-pol:
0034 description:
0035 This property controls the polarity of current that is accumulated to
0036 calculate charge and energy so that, they can be only accumulated for
0037 positive current for example. Since there are two sets of registers for
0038 the accumulated values, this entry can also have two items which sets
0039 energy1/charge1 and energy2/charger2 respectively. Check table 12 of the
0040 datasheet for more information on the supported options.
0041 $ref: /schemas/types.yaml#/definitions/uint32-array
0042 minItems: 2
0043 maxItems: 2
0044 items:
0045 enum: [0, 1, 2, 3]
0046 default: 0
0047
0048 adi,accumulation-deadband-microamp:
0049 description:
0050 This property controls the Accumulation Dead band which allows to set the
0051 level of current below which no accumulation takes place.
0052 maximum: 255
0053 default: 0
0054
0055 adi,gpio-out-pol:
0056 description:
0057 This property controls the GPIO polarity. Setting it to one makes the GPIO
0058 active high, setting it to zero makets it active low. When this property
0059 is present, the GPIO is automatically configured as output and set to
0060 control a fan as a function of measured temperature.
0061 $ref: /schemas/types.yaml#/definitions/uint32
0062 enum: [0, 1]
0063 default: 0
0064
0065 adi,gpio-in-accum:
0066 description:
0067 When set, this property sets the GPIO as input. It is then used to control
0068 the accumulation of charge, energy and time. This function can be
0069 enabled/configured separately for each of the two sets of accumulation
0070 registers. Check table 13 of the datasheet for more information on the
0071 supported options. This property cannot be used together with
0072 adi,gpio-out-pol.
0073 $ref: /schemas/types.yaml#/definitions/uint32-array
0074 minItems: 2
0075 maxItems: 2
0076 items:
0077 enum: [0, 1, 2]
0078 default: 0
0079
0080 required:
0081 - compatible
0082 - reg
0083
0084
0085 additionalProperties: false
0086
0087 examples:
0088 - |
0089 spi {
0090 #address-cells = <1>;
0091 #size-cells = <0>;
0092
0093 ltc2947_spi: ltc2947@0 {
0094 compatible = "adi,ltc2947";
0095 reg = <0>;
0096 /* accumulation takes place always for energ1/charge1. */
0097 /* accumulation only on positive current for energy2/charge2. */
0098 adi,accumulator-ctl-pol = <0 1>;
0099 };
0100 };
0101 ...