Back to home page

OSCL-LXR

 
 

    


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-tm5.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: Qualcomm's SPMI PMIC ADC Thermal Monitoring
0008 maintainers:
0009   - Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
0010 
0011 properties:
0012   compatible:
0013     enum:
0014       - qcom,spmi-adc-tm5
0015       - qcom,spmi-adc-tm5-gen2
0016 
0017   reg:
0018     maxItems: 1
0019 
0020   interrupts:
0021     maxItems: 1
0022 
0023   "#thermal-sensor-cells":
0024     const: 1
0025     description:
0026       Number of cells required to uniquely identify the thermal sensors. Since
0027       we have multiple sensors this is set to 1
0028 
0029   "#address-cells":
0030     const: 1
0031 
0032   "#size-cells":
0033     const: 0
0034 
0035   qcom,avg-samples:
0036     $ref: /schemas/types.yaml#/definitions/uint32
0037     description: Number of samples to be used for measurement.
0038             Not applicable for Gen2 ADC_TM peripheral.
0039     enum:
0040       - 1
0041       - 2
0042       - 4
0043       - 8
0044       - 16
0045     default: 1
0046 
0047   qcom,decimation:
0048     $ref: /schemas/types.yaml#/definitions/uint32
0049     description: This parameter is used to decrease ADC sampling rate.
0050             Quicker measurements can be made by reducing decimation ratio.
0051             Not applicable for Gen2 ADC_TM peripheral.
0052     enum:
0053       - 250
0054       - 420
0055       - 840
0056     default: 840
0057 
0058 patternProperties:
0059   "^([-a-z0-9]*)@[0-7]$":
0060     type: object
0061     description:
0062       Represent one thermal sensor.
0063 
0064     properties:
0065       reg:
0066         description: Specify the sensor channel. There are 8 channels in PMIC5's ADC TM
0067         minimum: 0
0068         maximum: 7
0069 
0070       io-channels:
0071         description:
0072           From common IIO binding. Used to pipe PMIC ADC channel to thermal monitor
0073 
0074       qcom,ratiometric:
0075         $ref: /schemas/types.yaml#/definitions/flag
0076         description:
0077           Channel calibration type.
0078           If this property is specified VADC will use the VDD reference
0079           (1.875V) and GND for channel calibration. If property is not found,
0080           channel will be calibrated with 0V and 1.25V reference channels,
0081           also known as absolute calibration.
0082 
0083       qcom,hw-settle-time-us:
0084         description: Time between AMUX getting configured and the ADC starting conversion.
0085         enum: [15, 100, 200, 300, 400, 500, 600, 700, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 128000]
0086 
0087       qcom,pre-scaling:
0088         $ref: /schemas/types.yaml#/definitions/uint32-array
0089         description: Used for scaling the channel input signal before the
0090           signal is fed to VADC. The configuration for this node is to know the
0091           pre-determined ratio and use it for post scaling. It is a pair of
0092           integers, denoting the numerator and denominator of the fraction by
0093           which input signal is multiplied. For example, <1 3> indicates the
0094           signal is scaled down to 1/3 of its value before ADC measurement.  If
0095           property is not found default value depending on chip will be used.
0096         items:
0097           - const: 1
0098           - enum: [ 1, 3, 4, 6, 20, 8, 10 ]
0099 
0100       qcom,avg-samples:
0101         $ref: /schemas/types.yaml#/definitions/uint32
0102         description: Number of samples to be used for measurement.
0103           This property in child node is applicable only for Gen2 ADC_TM peripheral.
0104         enum:
0105           - 1
0106           - 2
0107           - 4
0108           - 8
0109           - 16
0110         default: 1
0111 
0112       qcom,decimation:
0113         $ref: /schemas/types.yaml#/definitions/uint32
0114         description: This parameter is used to decrease ADC sampling rate.
0115           Quicker measurements can be made by reducing decimation ratio.
0116           This property in child node is applicable only for Gen2 ADC_TM peripheral.
0117         enum:
0118           - 85
0119           - 340
0120           - 1360
0121         default: 1360
0122 
0123     required:
0124       - reg
0125       - io-channels
0126 
0127     additionalProperties:
0128       false
0129 
0130 allOf:
0131   - if:
0132       properties:
0133         compatible:
0134           contains:
0135             const: qcom,spmi-adc-tm5
0136 
0137     then:
0138       patternProperties:
0139         "^([-a-z0-9]*)@[0-7]$":
0140           properties:
0141             qcom,decimation: false
0142             qcom,avg-samples: false
0143 
0144   - if:
0145       properties:
0146         compatible:
0147           contains:
0148             const: qcom,spmi-adc-tm5-gen2
0149 
0150     then:
0151       properties:
0152         qcom,avg-samples: false
0153         qcom,decimation: false
0154 
0155 required:
0156   - compatible
0157   - reg
0158   - interrupts
0159   - "#address-cells"
0160   - "#size-cells"
0161   - "#thermal-sensor-cells"
0162 
0163 additionalProperties: false
0164 
0165 examples:
0166   - |
0167     #include <dt-bindings/iio/qcom,spmi-vadc.h>
0168     #include <dt-bindings/interrupt-controller/irq.h>
0169     spmi_bus {
0170         #address-cells = <1>;
0171         #size-cells = <0>;
0172         pm8150b_adc: adc@3100 {
0173             reg = <0x3100>;
0174             compatible = "qcom,spmi-adc5";
0175             #address-cells = <1>;
0176             #size-cells = <0>;
0177             #io-channel-cells = <1>;
0178 
0179             /* Other properties are omitted */
0180             conn-therm@4f {
0181                 reg = <ADC5_AMUX_THM3_100K_PU>;
0182                 qcom,ratiometric;
0183                 qcom,hw-settle-time = <200>;
0184             };
0185         };
0186 
0187         pm8150b_adc_tm: adc-tm@3500 {
0188             compatible = "qcom,spmi-adc-tm5";
0189             reg = <0x3500>;
0190             interrupts = <0x2 0x35 0x0 IRQ_TYPE_EDGE_RISING>;
0191             #thermal-sensor-cells = <1>;
0192             #address-cells = <1>;
0193             #size-cells = <0>;
0194 
0195             conn-therm@0 {
0196                 reg = <0>;
0197                 io-channels = <&pm8150b_adc ADC5_AMUX_THM3_100K_PU>;
0198                 qcom,ratiometric;
0199                 qcom,hw-settle-time-us = <200>;
0200             };
0201         };
0202     };
0203 
0204   - |
0205     #include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h>
0206     #include <dt-bindings/iio/qcom,spmi-adc7-pm8350.h>
0207     #include <dt-bindings/interrupt-controller/irq.h>
0208     spmi_bus {
0209         #address-cells = <1>;
0210         #size-cells = <0>;
0211         pmk8350_vadc: adc@3100 {
0212             reg = <0x3100>;
0213             compatible = "qcom,spmi-adc7";
0214             #address-cells = <1>;
0215             #size-cells = <0>;
0216             #io-channel-cells = <1>;
0217 
0218             /* Other properties are omitted */
0219             xo-therm@44 {
0220                 reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;
0221                 qcom,ratiometric;
0222                 qcom,hw-settle-time = <200>;
0223             };
0224 
0225             conn-therm@47 {
0226                 reg = <PM8350_ADC7_AMUX_THM4_100K_PU>;
0227                 qcom,ratiometric;
0228                 qcom,hw-settle-time = <200>;
0229             };
0230         };
0231 
0232         pmk8350_adc_tm: adc-tm@3400 {
0233             compatible = "qcom,spmi-adc-tm5-gen2";
0234             reg = <0x3400>;
0235             interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>;
0236             #thermal-sensor-cells = <1>;
0237             #address-cells = <1>;
0238             #size-cells = <0>;
0239 
0240             pmk8350-xo-therm@0 {
0241                 reg = <0>;
0242                 io-channels = <&pmk8350_vadc PMK8350_ADC7_AMUX_THM1_100K_PU>;
0243                 qcom,decimation = <340>;
0244                 qcom,ratiometric;
0245                 qcom,hw-settle-time-us = <200>;
0246             };
0247 
0248             conn-therm@1 {
0249                 reg = <1>;
0250                 io-channels = <&pmk8350_vadc PM8350_ADC7_AMUX_THM4_100K_PU>;
0251                 qcom,avg-samples = <2>;
0252                 qcom,ratiometric;
0253                 qcom,hw-settle-time-us = <200>;
0254             };
0255         };
0256     };
0257 ...