Skip to content

Commit db03874

Browse files
anderssondlezcano
authored andcommitted
dt-bindings: thermal: qcom: add HC variant of adc-thermal monitor bindings
The HC generation of the ADC Thermal Monitor is quite similar to the 5th generation, but differs in valid values for a few properties. Create a new binding for the HC version of the hardware, rather than sprinkle conditionals throughout the existing binding. Signed-off-by: Bjorn Andersson <[email protected]> Reviewed-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]>
1 parent fc656fa commit db03874

File tree

1 file changed

+149
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)