xref: /linux/Documentation/devicetree/bindings/iio/adc/qcom,spmi-iadc.yaml (revision 06d07429858317ded2db7986113a9e0129cd599b)
1a4e6bf69SJonathan Cameron# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2a4e6bf69SJonathan Cameron%YAML 1.2
3a4e6bf69SJonathan Cameron---
4a4e6bf69SJonathan Cameron$id: http://devicetree.org/schemas/iio/adc/qcom,spmi-iadc.yaml#
5a4e6bf69SJonathan Cameron$schema: http://devicetree.org/meta-schemas/core.yaml#
6a4e6bf69SJonathan Cameron
7a4e6bf69SJonathan Camerontitle: Qualcomm's SPMI PMIC current ADC
8a4e6bf69SJonathan Cameron
9a4e6bf69SJonathan Cameronmaintainers:
10a4e6bf69SJonathan Cameron  - Jonathan Cameron <jic23@kernel.org>
11a4e6bf69SJonathan Cameron
12a4e6bf69SJonathan Camerondescription: |
13a4e6bf69SJonathan Cameron  QPNP PMIC current ADC (IADC) provides interface to clients to read current.
14a4e6bf69SJonathan Cameron  A 16 bit ADC is used for current measurements. IADC can measure the current
15a4e6bf69SJonathan Cameron  through an external resistor (channel 1) or internal (built-in) resistor
16a4e6bf69SJonathan Cameron  (channel 0). When using an external resistor it is to be described by
17a4e6bf69SJonathan Cameron  qcom,external-resistor-micro-ohms property.
18a4e6bf69SJonathan Cameron
19a4e6bf69SJonathan Cameronproperties:
20a4e6bf69SJonathan Cameron  compatible:
2158ae95f9SLuca Weiss    items:
2258ae95f9SLuca Weiss      - enum:
23471a444fSRayyan Ansari          - qcom,pm8226-iadc
2458ae95f9SLuca Weiss          - qcom,pm8941-iadc
2558ae95f9SLuca Weiss      - const: qcom,spmi-iadc
26a4e6bf69SJonathan Cameron
27a4e6bf69SJonathan Cameron  reg:
28a163854aSJohan Hovold    description: IADC base address in the SPMI PMIC register map
29a4e6bf69SJonathan Cameron    maxItems: 1
30a4e6bf69SJonathan Cameron
31a4e6bf69SJonathan Cameron  qcom,external-resistor-micro-ohms:
32a4e6bf69SJonathan Cameron    description:
33a4e6bf69SJonathan Cameron      Sensor resistor value. If not defined value of 10000 micro Ohms
34a4e6bf69SJonathan Cameron      will be used.
35a4e6bf69SJonathan Cameron
36a4e6bf69SJonathan Cameron  interrupts:
37a4e6bf69SJonathan Cameron    maxItems: 1
38a4e6bf69SJonathan Cameron    description:
39a4e6bf69SJonathan Cameron      End of conversion interrupt.
40a4e6bf69SJonathan Cameron
41a4e6bf69SJonathan Cameron  "#io-channel-cells":
42a4e6bf69SJonathan Cameron    const: 1
43a4e6bf69SJonathan Cameron
44a4e6bf69SJonathan Cameronrequired:
45a4e6bf69SJonathan Cameron  - compatible
46a4e6bf69SJonathan Cameron  - reg
47a4e6bf69SJonathan Cameron
48a4e6bf69SJonathan CameronadditionalProperties: false
49a4e6bf69SJonathan Cameron
50a4e6bf69SJonathan Cameronexamples:
51a4e6bf69SJonathan Cameron  - |
52a4e6bf69SJonathan Cameron    #include <dt-bindings/interrupt-controller/irq.h>
539751b00dSJohan Hovold
549751b00dSJohan Hovold    pmic {
55a4e6bf69SJonathan Cameron        #address-cells = <1>;
56a4e6bf69SJonathan Cameron        #size-cells = <0>;
57*9b2b96a0SJohan Hovold
58*9b2b96a0SJohan Hovold        adc@3600 {
5958ae95f9SLuca Weiss            compatible = "qcom,pm8941-iadc", "qcom,spmi-iadc";
60de645b27SRob Herring            reg = <0x3600>;
61a4e6bf69SJonathan Cameron            interrupts = <0x0 0x36 0x0 IRQ_TYPE_EDGE_RISING>;
62a4e6bf69SJonathan Cameron            qcom,external-resistor-micro-ohms = <10000>;
63a4e6bf69SJonathan Cameron            #io-channel-cells = <1>;
64a4e6bf69SJonathan Cameron        };
65a4e6bf69SJonathan Cameron    };
66a4e6bf69SJonathan Cameron...
67