0001 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/thermal/qcom-spmi-adc-tm-hc.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006
0007 title: Qualcomm's SPMI PMIC ADC HC Thermal Monitoring
0008 maintainers:
0009 - Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
0010
0011 properties:
0012 compatible:
0013 const: qcom,spmi-adc-tm-hc
0014
0015 reg:
0016 maxItems: 1
0017
0018 interrupts:
0019 maxItems: 1
0020
0021 "#thermal-sensor-cells":
0022 const: 1
0023 description:
0024 Number of cells required to uniquely identify the thermal sensors. Since
0025 we have multiple sensors this is set to 1
0026
0027 "#address-cells":
0028 const: 1
0029
0030 "#size-cells":
0031 const: 0
0032
0033 qcom,avg-samples:
0034 $ref: /schemas/types.yaml#/definitions/uint32
0035 description: Number of samples to be used for measurement.
0036 enum:
0037 - 1
0038 - 2
0039 - 4
0040 - 8
0041 - 16
0042 default: 1
0043
0044 qcom,decimation:
0045 $ref: /schemas/types.yaml#/definitions/uint32
0046 description: This parameter is used to decrease ADC sampling rate.
0047 Quicker measurements can be made by reducing decimation ratio.
0048 enum:
0049 - 256
0050 - 512
0051 - 1024
0052 default: 1024
0053
0054 patternProperties:
0055 "^([-a-z0-9]*)@[0-7]$":
0056 type: object
0057 description:
0058 Represent one thermal sensor.
0059
0060 properties:
0061 reg:
0062 description: Specify the sensor channel. There are 8 channels in PMIC5's ADC TM
0063 minimum: 0
0064 maximum: 7
0065
0066 io-channels:
0067 description:
0068 From common IIO binding. Used to pipe PMIC ADC channel to thermal monitor
0069
0070 qcom,ratiometric:
0071 $ref: /schemas/types.yaml#/definitions/flag
0072 description:
0073 Channel calibration type.
0074 If this property is specified VADC will use the VDD reference
0075 (1.875V) and GND for channel calibration. If property is not found,
0076 channel will be calibrated with 0V and 1.25V reference channels,
0077 also known as absolute calibration.
0078
0079 qcom,hw-settle-time-us:
0080 description: Time between AMUX getting configured and the ADC starting conversion.
0081 enum: [0, 100, 200, 300, 400, 500, 600, 700, 1000, 2000, 4000, 6000, 8000, 10000]
0082
0083 qcom,pre-scaling:
0084 $ref: /schemas/types.yaml#/definitions/uint32-array
0085 description: Used for scaling the channel input signal before the
0086 signal is fed to VADC. The configuration for this node is to know the
0087 pre-determined ratio and use it for post scaling. It is a pair of
0088 integers, denoting the numerator and denominator of the fraction by
0089 which input signal is multiplied. For example, <1 3> indicates the
0090 signal is scaled down to 1/3 of its value before ADC measurement. If
0091 property is not found default value depending on chip will be used.
0092 items:
0093 - const: 1
0094 - enum: [ 1, 3, 4, 6, 20, 8, 10 ]
0095
0096 required:
0097 - reg
0098 - io-channels
0099
0100 additionalProperties:
0101 false
0102
0103 required:
0104 - compatible
0105 - reg
0106 - interrupts
0107 - "#address-cells"
0108 - "#size-cells"
0109 - "#thermal-sensor-cells"
0110
0111 additionalProperties: false
0112
0113 examples:
0114 - |
0115 #include <dt-bindings/iio/qcom,spmi-vadc.h>
0116 #include <dt-bindings/interrupt-controller/irq.h>
0117 spmi_bus {
0118 #address-cells = <1>;
0119 #size-cells = <0>;
0120 pm8998_adc: adc@3100 {
0121 reg = <0x3100>;
0122 compatible = "qcom,spmi-adc-rev2";
0123 #address-cells = <1>;
0124 #size-cells = <0>;
0125 #io-channel-cells = <1>;
0126
0127 /* Other propreties are omitted */
0128 adc-chan@4c {
0129 reg = <ADC5_XO_THERM_100K_PU>;
0130 };
0131 };
0132
0133 pm8998_adc_tm: adc-tm@3400 {
0134 compatible = "qcom,spmi-adc-tm-hc";
0135 reg = <0x3400>;
0136 interrupts = <0x2 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
0137 #thermal-sensor-cells = <1>;
0138 #address-cells = <1>;
0139 #size-cells = <0>;
0140
0141 thermistor@1 {
0142 reg = <1>;
0143 io-channels = <&pm8998_adc ADC5_XO_THERM_100K_PU>;
0144 qcom,ratiometric;
0145 qcom,hw-settle-time-us = <200>;
0146 };
0147 };
0148 };
0149 ...