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