brintos

brintos / linux-shallow public Read only

0
0
Text · 7.2 KiB · 4470a59 Raw
264 lines · yaml
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)2%YAML 1.23---4$id: http://devicetree.org/schemas/thermal/qcom-spmi-adc-tm5.yaml#5$schema: http://devicetree.org/meta-schemas/core.yaml#6 7title: Qualcomm's SPMI PMIC ADC Thermal Monitoring8maintainers:9  - Dmitry Baryshkov <dmitry.baryshkov@linaro.org>10 11$ref: thermal-sensor.yaml#12 13properties:14  compatible:15    enum:16      - qcom,spmi-adc-tm517      - qcom,spmi-adc-tm5-gen218      - qcom,adc-tm7 # Incomplete / subject to change19 20  reg:21    maxItems: 122 23  interrupts:24    maxItems: 125 26  "#thermal-sensor-cells":27    const: 128 29  "#address-cells":30    const: 131 32  "#size-cells":33    const: 034 35  qcom,avg-samples:36    $ref: /schemas/types.yaml#/definitions/uint3237    description: Number of samples to be used for measurement.38            Not applicable for Gen2 ADC_TM peripheral.39    enum:40      - 141      - 242      - 443      - 844      - 1645    default: 146 47  qcom,decimation:48    $ref: /schemas/types.yaml#/definitions/uint3249    description: This parameter is used to decrease ADC sampling rate.50            Quicker measurements can be made by reducing decimation ratio.51            Not applicable for Gen2 ADC_TM peripheral.52    enum:53      - 25054      - 42055      - 84056    default: 84057 58patternProperties:59  "^([-a-z0-9]*)@[0-7]$":60    type: object61    description:62      Represent one thermal sensor.63 64    properties:65      reg:66        description: Specify the sensor channel. There are 8 channels in PMIC5's ADC TM67        minimum: 068        maximum: 769 70      io-channels:71        description:72          From common IIO binding. Used to pipe PMIC ADC channel to thermal monitor73 74      qcom,ratiometric:75        $ref: /schemas/types.yaml#/definitions/flag76        description:77          Channel calibration type.78          If this property is specified VADC will use the VDD reference79          (1.875V) and GND for channel calibration. If property is not found,80          channel will be calibrated with 0V and 1.25V reference channels,81          also known as absolute calibration.82 83      qcom,hw-settle-time-us:84        description: Time between AMUX getting configured and the ADC starting conversion.85        enum: [15, 100, 200, 300, 400, 500, 600, 700, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 128000]86 87      qcom,pre-scaling:88        $ref: /schemas/types.yaml#/definitions/uint32-array89        description: Used for scaling the channel input signal before the90          signal is fed to VADC. The configuration for this node is to know the91          pre-determined ratio and use it for post scaling. It is a pair of92          integers, denoting the numerator and denominator of the fraction by93          which input signal is multiplied. For example, <1 3> indicates the94          signal is scaled down to 1/3 of its value before ADC measurement.  If95          property is not found default value depending on chip will be used.96        items:97          - const: 198          - enum: [ 1, 3, 4, 6, 20, 8, 10 ]99 100      qcom,avg-samples:101        $ref: /schemas/types.yaml#/definitions/uint32102        description: Number of samples to be used for measurement.103          This property in child node is applicable only for Gen2 ADC_TM peripheral.104        enum:105          - 1106          - 2107          - 4108          - 8109          - 16110        default: 1111 112      qcom,decimation:113        $ref: /schemas/types.yaml#/definitions/uint32114        description: This parameter is used to decrease ADC sampling rate.115          Quicker measurements can be made by reducing decimation ratio.116          This property in child node is applicable only for Gen2 ADC_TM peripheral.117        enum:118          - 85119          - 340120          - 1360121        default: 1360122 123    required:124      - reg125      - io-channels126 127    additionalProperties:128      false129 130allOf:131  - if:132      properties:133        compatible:134          contains:135            const: qcom,spmi-adc-tm5136 137    then:138      patternProperties:139        "^([-a-z0-9]*)@[0-7]$":140          properties:141            qcom,decimation: false142            qcom,avg-samples: false143 144  - if:145      properties:146        compatible:147          contains:148            const: qcom,spmi-adc-tm5-gen2149 150    then:151      properties:152        qcom,avg-samples: false153        qcom,decimation: false154 155required:156  - compatible157  - reg158  - interrupts159  - "#address-cells"160  - "#size-cells"161 162unevaluatedProperties: false163 164examples:165  - |166    #include <dt-bindings/iio/qcom,spmi-vadc.h>167    #include <dt-bindings/interrupt-controller/irq.h>168 169    pmic {170        #address-cells = <1>;171        #size-cells = <0>;172 173        pm8150b_adc: adc@3100 {174            compatible = "qcom,spmi-adc5";175            reg = <0x3100>;176            #address-cells = <1>;177            #size-cells = <0>;178            #io-channel-cells = <1>;179 180            /* Other properties are omitted */181            channel@4f {182                reg = <ADC5_AMUX_THM3_100K_PU>;183                qcom,ratiometric;184                qcom,hw-settle-time = <200>;185                label = "conn_therm";186            };187        };188 189        adc-tm@3500 {190            compatible = "qcom,spmi-adc-tm5";191            reg = <0x3500>;192            interrupts = <0x2 0x35 0x0 IRQ_TYPE_EDGE_RISING>;193            #thermal-sensor-cells = <1>;194            #address-cells = <1>;195            #size-cells = <0>;196 197            conn-therm@0 {198                reg = <0>;199                io-channels = <&pm8150b_adc ADC5_AMUX_THM3_100K_PU>;200                qcom,ratiometric;201                qcom,hw-settle-time-us = <200>;202            };203        };204    };205 206  - |207    #include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h>208    #include <dt-bindings/iio/qcom,spmi-adc7-pm8350.h>209    #include <dt-bindings/interrupt-controller/irq.h>210 211    pmic {212        #address-cells = <1>;213        #size-cells = <0>;214 215        pmk8350_vadc: adc@3100 {216            compatible = "qcom,spmi-adc7";217            reg = <0x3100>;218            #address-cells = <1>;219            #size-cells = <0>;220            #io-channel-cells = <1>;221 222            /* Other properties are omitted */223            channel@44 {224                reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;225                qcom,ratiometric;226                qcom,hw-settle-time = <200>;227                label = "xo_therm";228            };229 230            channel@147 {231                reg = <PM8350_ADC7_AMUX_THM4_100K_PU(1)>;232                qcom,ratiometric;233                qcom,hw-settle-time = <200>;234                label = "conn_therm";235            };236        };237 238        adc-tm@3400 {239            compatible = "qcom,spmi-adc-tm5-gen2";240            reg = <0x3400>;241            interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>;242            #thermal-sensor-cells = <1>;243            #address-cells = <1>;244            #size-cells = <0>;245 246            pmk8350-xo-therm@0 {247                reg = <0>;248                io-channels = <&pmk8350_vadc PMK8350_ADC7_AMUX_THM1_100K_PU>;249                qcom,decimation = <340>;250                qcom,ratiometric;251                qcom,hw-settle-time-us = <200>;252            };253 254            conn-therm@1 {255                reg = <1>;256                io-channels = <&pmk8350_vadc PM8350_ADC7_AMUX_THM4_100K_PU(1)>;257                qcom,avg-samples = <2>;258                qcom,ratiometric;259                qcom,hw-settle-time-us = <200>;260            };261        };262    };263...264