xref: /linux/Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm-hc.yaml (revision 4bddb0cdfad9148a08b2bda7c3d479b1da715929)
1db03874bSBjorn Andersson# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2db03874bSBjorn Andersson%YAML 1.2
3db03874bSBjorn Andersson---
4db03874bSBjorn Andersson$id: http://devicetree.org/schemas/thermal/qcom-spmi-adc-tm-hc.yaml#
5db03874bSBjorn Andersson$schema: http://devicetree.org/meta-schemas/core.yaml#
6db03874bSBjorn Andersson
7db03874bSBjorn Anderssontitle: Qualcomm's SPMI PMIC ADC HC Thermal Monitoring
8db03874bSBjorn Anderssonmaintainers:
9db03874bSBjorn Andersson  - Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
10db03874bSBjorn Andersson
11db03874bSBjorn Anderssonproperties:
12db03874bSBjorn Andersson  compatible:
13db03874bSBjorn Andersson    const: qcom,spmi-adc-tm-hc
14db03874bSBjorn Andersson
15db03874bSBjorn Andersson  reg:
16db03874bSBjorn Andersson    maxItems: 1
17db03874bSBjorn Andersson
18db03874bSBjorn Andersson  interrupts:
19db03874bSBjorn Andersson    maxItems: 1
20db03874bSBjorn Andersson
21db03874bSBjorn Andersson  "#thermal-sensor-cells":
22db03874bSBjorn Andersson    const: 1
23db03874bSBjorn Andersson    description:
24db03874bSBjorn Andersson      Number of cells required to uniquely identify the thermal sensors. Since
25db03874bSBjorn Andersson      we have multiple sensors this is set to 1
26db03874bSBjorn Andersson
27db03874bSBjorn Andersson  "#address-cells":
28db03874bSBjorn Andersson    const: 1
29db03874bSBjorn Andersson
30db03874bSBjorn Andersson  "#size-cells":
31db03874bSBjorn Andersson    const: 0
32db03874bSBjorn Andersson
33db03874bSBjorn Andersson  qcom,avg-samples:
34db03874bSBjorn Andersson    $ref: /schemas/types.yaml#/definitions/uint32
35db03874bSBjorn Andersson    description: Number of samples to be used for measurement.
36db03874bSBjorn Andersson    enum:
37db03874bSBjorn Andersson      - 1
38db03874bSBjorn Andersson      - 2
39db03874bSBjorn Andersson      - 4
40db03874bSBjorn Andersson      - 8
41db03874bSBjorn Andersson      - 16
42db03874bSBjorn Andersson    default: 1
43db03874bSBjorn Andersson
44db03874bSBjorn Andersson  qcom,decimation:
45db03874bSBjorn Andersson    $ref: /schemas/types.yaml#/definitions/uint32
46db03874bSBjorn Andersson    description: This parameter is used to decrease ADC sampling rate.
47db03874bSBjorn Andersson            Quicker measurements can be made by reducing decimation ratio.
48db03874bSBjorn Andersson    enum:
49db03874bSBjorn Andersson      - 256
50db03874bSBjorn Andersson      - 512
51db03874bSBjorn Andersson      - 1024
52db03874bSBjorn Andersson    default: 1024
53db03874bSBjorn Andersson
54db03874bSBjorn AnderssonpatternProperties:
55db03874bSBjorn Andersson  "^([-a-z0-9]*)@[0-7]$":
56db03874bSBjorn Andersson    type: object
57db03874bSBjorn Andersson    description:
58db03874bSBjorn Andersson      Represent one thermal sensor.
59db03874bSBjorn Andersson
60db03874bSBjorn Andersson    properties:
61db03874bSBjorn Andersson      reg:
62db03874bSBjorn Andersson        description: Specify the sensor channel. There are 8 channels in PMIC5's ADC TM
63db03874bSBjorn Andersson        minimum: 0
64db03874bSBjorn Andersson        maximum: 7
65db03874bSBjorn Andersson
66db03874bSBjorn Andersson      io-channels:
67db03874bSBjorn Andersson        description:
68db03874bSBjorn Andersson          From common IIO binding. Used to pipe PMIC ADC channel to thermal monitor
69db03874bSBjorn Andersson
70db03874bSBjorn Andersson      qcom,ratiometric:
71db03874bSBjorn Andersson        $ref: /schemas/types.yaml#/definitions/flag
72db03874bSBjorn Andersson        description:
73db03874bSBjorn Andersson          Channel calibration type.
74db03874bSBjorn Andersson          If this property is specified VADC will use the VDD reference
75db03874bSBjorn Andersson          (1.875V) and GND for channel calibration. If property is not found,
76db03874bSBjorn Andersson          channel will be calibrated with 0V and 1.25V reference channels,
77db03874bSBjorn Andersson          also known as absolute calibration.
78db03874bSBjorn Andersson
79db03874bSBjorn Andersson      qcom,hw-settle-time-us:
80db03874bSBjorn Andersson        description: Time between AMUX getting configured and the ADC starting conversion.
81db03874bSBjorn Andersson        enum: [0, 100, 200, 300, 400, 500, 600, 700, 1000, 2000, 4000, 6000, 8000, 10000]
82db03874bSBjorn Andersson
83db03874bSBjorn Andersson      qcom,pre-scaling:
84db03874bSBjorn Andersson        $ref: /schemas/types.yaml#/definitions/uint32-array
85db03874bSBjorn Andersson        description: Used for scaling the channel input signal before the
86db03874bSBjorn Andersson          signal is fed to VADC. The configuration for this node is to know the
87db03874bSBjorn Andersson          pre-determined ratio and use it for post scaling. It is a pair of
88db03874bSBjorn Andersson          integers, denoting the numerator and denominator of the fraction by
89db03874bSBjorn Andersson          which input signal is multiplied. For example, <1 3> indicates the
90db03874bSBjorn Andersson          signal is scaled down to 1/3 of its value before ADC measurement.  If
91db03874bSBjorn Andersson          property is not found default value depending on chip will be used.
92db03874bSBjorn Andersson        items:
93db03874bSBjorn Andersson          - const: 1
94db03874bSBjorn Andersson          - enum: [ 1, 3, 4, 6, 20, 8, 10 ]
95db03874bSBjorn Andersson
96db03874bSBjorn Andersson    required:
97db03874bSBjorn Andersson      - reg
98db03874bSBjorn Andersson      - io-channels
99db03874bSBjorn Andersson
100db03874bSBjorn Andersson    additionalProperties:
101db03874bSBjorn Andersson      false
102db03874bSBjorn Andersson
103db03874bSBjorn Anderssonrequired:
104db03874bSBjorn Andersson  - compatible
105db03874bSBjorn Andersson  - reg
106db03874bSBjorn Andersson  - interrupts
107db03874bSBjorn Andersson  - "#address-cells"
108db03874bSBjorn Andersson  - "#size-cells"
109db03874bSBjorn Andersson  - "#thermal-sensor-cells"
110db03874bSBjorn Andersson
111db03874bSBjorn AnderssonadditionalProperties: false
112db03874bSBjorn Andersson
113db03874bSBjorn Anderssonexamples:
114db03874bSBjorn Andersson  - |
115db03874bSBjorn Andersson    #include <dt-bindings/iio/qcom,spmi-vadc.h>
116db03874bSBjorn Andersson    #include <dt-bindings/interrupt-controller/irq.h>
1177ec597baSJohan Hovold
1187ec597baSJohan Hovold    pmic {
119db03874bSBjorn Andersson        #address-cells = <1>;
120db03874bSBjorn Andersson        #size-cells = <0>;
121*4bddb0cdSJohan Hovold
122db03874bSBjorn Andersson        pm8998_adc: adc@3100 {
123db03874bSBjorn Andersson            compatible = "qcom,spmi-adc-rev2";
124*4bddb0cdSJohan Hovold            reg = <0x3100>;
125db03874bSBjorn Andersson            #address-cells = <1>;
126db03874bSBjorn Andersson            #size-cells = <0>;
127db03874bSBjorn Andersson            #io-channel-cells = <1>;
128db03874bSBjorn Andersson
129d9f7eeafSMarijn Suijten            /* Other properties are omitted */
130d9f7eeafSMarijn Suijten            channel@4c {
131db03874bSBjorn Andersson                reg = <ADC5_XO_THERM_100K_PU>;
132db03874bSBjorn Andersson            };
133db03874bSBjorn Andersson        };
134db03874bSBjorn Andersson
135*4bddb0cdSJohan Hovold        adc-tm@3400 {
136db03874bSBjorn Andersson            compatible = "qcom,spmi-adc-tm-hc";
137db03874bSBjorn Andersson            reg = <0x3400>;
138db03874bSBjorn Andersson            interrupts = <0x2 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
139db03874bSBjorn Andersson            #thermal-sensor-cells = <1>;
140db03874bSBjorn Andersson            #address-cells = <1>;
141db03874bSBjorn Andersson            #size-cells = <0>;
142db03874bSBjorn Andersson
143db03874bSBjorn Andersson            thermistor@1 {
144db03874bSBjorn Andersson                reg = <1>;
145db03874bSBjorn Andersson                io-channels = <&pm8998_adc ADC5_XO_THERM_100K_PU>;
146db03874bSBjorn Andersson                qcom,ratiometric;
147db03874bSBjorn Andersson                qcom,hw-settle-time-us = <200>;
148db03874bSBjorn Andersson            };
149db03874bSBjorn Andersson        };
150db03874bSBjorn Andersson    };
151db03874bSBjorn Andersson...
152