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