162306a36Sopenharmony_ci# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 262306a36Sopenharmony_ci%YAML 1.2 362306a36Sopenharmony_ci--- 462306a36Sopenharmony_ci$id: http://devicetree.org/schemas/hwmon/adi,ltc2947.yaml# 562306a36Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml# 662306a36Sopenharmony_ci 762306a36Sopenharmony_cititle: Analog Devices LTC2947 high precision power and energy monitor 862306a36Sopenharmony_ci 962306a36Sopenharmony_cimaintainers: 1062306a36Sopenharmony_ci - Nuno Sá <nuno.sa@analog.com> 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_cidescription: | 1362306a36Sopenharmony_ci Analog Devices LTC2947 high precision power and energy monitor over SPI or I2C. 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ci https://www.analog.com/media/en/technical-documentation/data-sheets/LTC2947.pdf 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ciproperties: 1862306a36Sopenharmony_ci compatible: 1962306a36Sopenharmony_ci enum: 2062306a36Sopenharmony_ci - adi,ltc2947 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci reg: 2362306a36Sopenharmony_ci maxItems: 1 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ci clocks: 2662306a36Sopenharmony_ci description: 2762306a36Sopenharmony_ci The LTC2947 uses either a trimmed internal oscillator or an external clock 2862306a36Sopenharmony_ci as the time base for determining the integration period to represent time, 2962306a36Sopenharmony_ci charge and energy. When an external clock is used, this property must be 3062306a36Sopenharmony_ci set accordingly. 3162306a36Sopenharmony_ci maxItems: 1 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci adi,accumulator-ctl-pol: 3462306a36Sopenharmony_ci description: 3562306a36Sopenharmony_ci This property controls the polarity of current that is accumulated to 3662306a36Sopenharmony_ci calculate charge and energy so that, they can be only accumulated for 3762306a36Sopenharmony_ci positive current for example. Since there are two sets of registers for 3862306a36Sopenharmony_ci the accumulated values, this entry can also have two items which sets 3962306a36Sopenharmony_ci energy1/charge1 and energy2/charger2 respectively. Check table 12 of the 4062306a36Sopenharmony_ci datasheet for more information on the supported options. 4162306a36Sopenharmony_ci $ref: /schemas/types.yaml#/definitions/uint32-array 4262306a36Sopenharmony_ci minItems: 2 4362306a36Sopenharmony_ci maxItems: 2 4462306a36Sopenharmony_ci items: 4562306a36Sopenharmony_ci enum: [0, 1, 2, 3] 4662306a36Sopenharmony_ci default: 0 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ci adi,accumulation-deadband-microamp: 4962306a36Sopenharmony_ci description: 5062306a36Sopenharmony_ci This property controls the Accumulation Dead band which allows to set the 5162306a36Sopenharmony_ci level of current below which no accumulation takes place. 5262306a36Sopenharmony_ci maximum: 255 5362306a36Sopenharmony_ci default: 0 5462306a36Sopenharmony_ci 5562306a36Sopenharmony_ci adi,gpio-out-pol: 5662306a36Sopenharmony_ci description: 5762306a36Sopenharmony_ci This property controls the GPIO polarity. Setting it to one makes the GPIO 5862306a36Sopenharmony_ci active high, setting it to zero makets it active low. When this property 5962306a36Sopenharmony_ci is present, the GPIO is automatically configured as output and set to 6062306a36Sopenharmony_ci control a fan as a function of measured temperature. 6162306a36Sopenharmony_ci $ref: /schemas/types.yaml#/definitions/uint32 6262306a36Sopenharmony_ci enum: [0, 1] 6362306a36Sopenharmony_ci default: 0 6462306a36Sopenharmony_ci 6562306a36Sopenharmony_ci adi,gpio-in-accum: 6662306a36Sopenharmony_ci description: 6762306a36Sopenharmony_ci When set, this property sets the GPIO as input. It is then used to control 6862306a36Sopenharmony_ci the accumulation of charge, energy and time. This function can be 6962306a36Sopenharmony_ci enabled/configured separately for each of the two sets of accumulation 7062306a36Sopenharmony_ci registers. Check table 13 of the datasheet for more information on the 7162306a36Sopenharmony_ci supported options. This property cannot be used together with 7262306a36Sopenharmony_ci adi,gpio-out-pol. 7362306a36Sopenharmony_ci $ref: /schemas/types.yaml#/definitions/uint32-array 7462306a36Sopenharmony_ci minItems: 2 7562306a36Sopenharmony_ci maxItems: 2 7662306a36Sopenharmony_ci items: 7762306a36Sopenharmony_ci enum: [0, 1, 2] 7862306a36Sopenharmony_ci default: 0 7962306a36Sopenharmony_ci 8062306a36Sopenharmony_cirequired: 8162306a36Sopenharmony_ci - compatible 8262306a36Sopenharmony_ci - reg 8362306a36Sopenharmony_ci 8462306a36Sopenharmony_ci 8562306a36Sopenharmony_ciadditionalProperties: false 8662306a36Sopenharmony_ci 8762306a36Sopenharmony_ciexamples: 8862306a36Sopenharmony_ci - | 8962306a36Sopenharmony_ci spi { 9062306a36Sopenharmony_ci #address-cells = <1>; 9162306a36Sopenharmony_ci #size-cells = <0>; 9262306a36Sopenharmony_ci 9362306a36Sopenharmony_ci ltc2947_spi: ltc2947@0 { 9462306a36Sopenharmony_ci compatible = "adi,ltc2947"; 9562306a36Sopenharmony_ci reg = <0>; 9662306a36Sopenharmony_ci /* accumulation takes place always for energ1/charge1. */ 9762306a36Sopenharmony_ci /* accumulation only on positive current for energy2/charge2. */ 9862306a36Sopenharmony_ci adi,accumulator-ctl-pol = <0 1>; 9962306a36Sopenharmony_ci }; 10062306a36Sopenharmony_ci }; 10162306a36Sopenharmony_ci... 102