From d232832c9cb863d59e9e45d63140da80d0fd214f Mon Sep 17 00:00:00 2001 From: David Collins Date: Wed, 25 Jan 2023 15:42:14 -0800 Subject: [PATCH] dt-bindings: iio: adc: add Glink ADC bindings Add bindings for the PMIC Glink ADC device. This device provides a mechanism for software to read multiple ADC channels of Qualcomm Technologies, Inc. PMICs using the Glink interface to communicate with charger firmware. Change-Id: I805b13893f80ce993496e35767a89b09ae163254 Signed-off-by: David Collins --- bindings/iio/adc/qcom,glink-adc.yaml | 90 ++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 bindings/iio/adc/qcom,glink-adc.yaml diff --git a/bindings/iio/adc/qcom,glink-adc.yaml b/bindings/iio/adc/qcom,glink-adc.yaml new file mode 100644 index 00000000..c3cce54a --- /dev/null +++ b/bindings/iio/adc/qcom,glink-adc.yaml @@ -0,0 +1,90 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/qcom,glink-adc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Technologies, Inc. Glink PMIC ADC + +maintainers: + - David Collins + +description: | + This device provides a mechanism for software to read multiple ADC channels of + Qualcomm Technologies, Inc. PMICs using the Glink interface to communicate + with charger firmware. Channel value conversion is performed in firmware. + Both converted and raw ADC values can be read. This device is useful in + situations where a charger PMIC is connected via I2C and only accessible to + charger firmware. + +properties: + compatible: + const: qcom,glink-adc + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + + "#io-channel-cells": + const: 1 + +required: + - compatible + - "#address-cells" + - "#size-cells" + - "#io-channel-cells" + +additionalProperties: false + +patternProperties: + "@[0-9a-f]+$": + type: object + description: ADC channel node + + properties: + reg: + maxItems: 1 + description: | + ADC channel number of the form: + (bus_id << 16) | (pmic_id << 8) | adc_channel + where: + bus_id = which SPMI or I2C bus the PMIC is attached to + pmic_id = PMIC address on the bus + adc_channel = specific channel within the PMIC + + label: + $ref: /schemas/types.yaml#/definitions/string + description: ADC channel name + + required: + - reg + + additionalProperties: false + +examples: + - | + pmic_glink_log { + glink-adc { + compatible = "qcom,glink-adc"; + #address-cells = <1>; + #size-cells = <0>; + #io-channel-cells = <1>; + + smb1502_iin@1076801 { + reg = <0x1076801>; + label = "smb1502_iin"; + }; + + smb1502_ichg@1076802 { + reg = <0x1076802>; + label = "smb1502_ichg"; + }; + + smb1502_die_temp@1076803 { + reg = <0x1076803>; + label = "smb1502_die_temp"; + }; + }; + };