15def4c47SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 25def4c47SEmmanuel Vadot%YAML 1.2 35def4c47SEmmanuel Vadot--- 45def4c47SEmmanuel Vadot$id: http://devicetree.org/schemas/thermal/qcom-spmi-adc-tm5.yaml# 55def4c47SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 65def4c47SEmmanuel Vadot 75def4c47SEmmanuel Vadottitle: Qualcomm's SPMI PMIC ADC Thermal Monitoring 85def4c47SEmmanuel Vadotmaintainers: 95def4c47SEmmanuel Vadot - Dmitry Baryshkov <dmitry.baryshkov@linaro.org> 105def4c47SEmmanuel Vadot 11*0e8011faSEmmanuel Vadot$ref: thermal-sensor.yaml# 12*0e8011faSEmmanuel Vadot 135def4c47SEmmanuel Vadotproperties: 145def4c47SEmmanuel Vadot compatible: 15d5b0e70fSEmmanuel Vadot enum: 16d5b0e70fSEmmanuel Vadot - qcom,spmi-adc-tm5 17d5b0e70fSEmmanuel Vadot - qcom,spmi-adc-tm5-gen2 18cb7aa33aSEmmanuel Vadot - qcom,adc-tm7 # Incomplete / subject to change 195def4c47SEmmanuel Vadot 205def4c47SEmmanuel Vadot reg: 215def4c47SEmmanuel Vadot maxItems: 1 225def4c47SEmmanuel Vadot 235def4c47SEmmanuel Vadot interrupts: 245def4c47SEmmanuel Vadot maxItems: 1 255def4c47SEmmanuel Vadot 265def4c47SEmmanuel Vadot "#thermal-sensor-cells": 275def4c47SEmmanuel Vadot const: 1 285def4c47SEmmanuel Vadot 295def4c47SEmmanuel Vadot "#address-cells": 305def4c47SEmmanuel Vadot const: 1 315def4c47SEmmanuel Vadot 325def4c47SEmmanuel Vadot "#size-cells": 335def4c47SEmmanuel Vadot const: 0 345def4c47SEmmanuel Vadot 355def4c47SEmmanuel Vadot qcom,avg-samples: 365def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 375def4c47SEmmanuel Vadot description: Number of samples to be used for measurement. 38d5b0e70fSEmmanuel Vadot Not applicable for Gen2 ADC_TM peripheral. 395def4c47SEmmanuel Vadot enum: 405def4c47SEmmanuel Vadot - 1 415def4c47SEmmanuel Vadot - 2 425def4c47SEmmanuel Vadot - 4 435def4c47SEmmanuel Vadot - 8 445def4c47SEmmanuel Vadot - 16 455def4c47SEmmanuel Vadot default: 1 465def4c47SEmmanuel Vadot 475def4c47SEmmanuel Vadot qcom,decimation: 485def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 495def4c47SEmmanuel Vadot description: This parameter is used to decrease ADC sampling rate. 505def4c47SEmmanuel Vadot Quicker measurements can be made by reducing decimation ratio. 51d5b0e70fSEmmanuel Vadot Not applicable for Gen2 ADC_TM peripheral. 525def4c47SEmmanuel Vadot enum: 535def4c47SEmmanuel Vadot - 250 545def4c47SEmmanuel Vadot - 420 555def4c47SEmmanuel Vadot - 840 565def4c47SEmmanuel Vadot default: 840 575def4c47SEmmanuel Vadot 585def4c47SEmmanuel VadotpatternProperties: 595def4c47SEmmanuel Vadot "^([-a-z0-9]*)@[0-7]$": 605def4c47SEmmanuel Vadot type: object 615def4c47SEmmanuel Vadot description: 625def4c47SEmmanuel Vadot Represent one thermal sensor. 635def4c47SEmmanuel Vadot 645def4c47SEmmanuel Vadot properties: 655def4c47SEmmanuel Vadot reg: 665def4c47SEmmanuel Vadot description: Specify the sensor channel. There are 8 channels in PMIC5's ADC TM 675def4c47SEmmanuel Vadot minimum: 0 685def4c47SEmmanuel Vadot maximum: 7 695def4c47SEmmanuel Vadot 705def4c47SEmmanuel Vadot io-channels: 715def4c47SEmmanuel Vadot description: 725def4c47SEmmanuel Vadot From common IIO binding. Used to pipe PMIC ADC channel to thermal monitor 735def4c47SEmmanuel Vadot 745def4c47SEmmanuel Vadot qcom,ratiometric: 755def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/flag 765def4c47SEmmanuel Vadot description: 775def4c47SEmmanuel Vadot Channel calibration type. 785def4c47SEmmanuel Vadot If this property is specified VADC will use the VDD reference 795def4c47SEmmanuel Vadot (1.875V) and GND for channel calibration. If property is not found, 805def4c47SEmmanuel Vadot channel will be calibrated with 0V and 1.25V reference channels, 815def4c47SEmmanuel Vadot also known as absolute calibration. 825def4c47SEmmanuel Vadot 835def4c47SEmmanuel Vadot qcom,hw-settle-time-us: 845def4c47SEmmanuel Vadot description: Time between AMUX getting configured and the ADC starting conversion. 855def4c47SEmmanuel Vadot enum: [15, 100, 200, 300, 400, 500, 600, 700, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 128000] 865def4c47SEmmanuel Vadot 875def4c47SEmmanuel Vadot qcom,pre-scaling: 885def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32-array 895def4c47SEmmanuel Vadot description: Used for scaling the channel input signal before the 905def4c47SEmmanuel Vadot signal is fed to VADC. The configuration for this node is to know the 915def4c47SEmmanuel Vadot pre-determined ratio and use it for post scaling. It is a pair of 925def4c47SEmmanuel Vadot integers, denoting the numerator and denominator of the fraction by 935def4c47SEmmanuel Vadot which input signal is multiplied. For example, <1 3> indicates the 945def4c47SEmmanuel Vadot signal is scaled down to 1/3 of its value before ADC measurement. If 955def4c47SEmmanuel Vadot property is not found default value depending on chip will be used. 965def4c47SEmmanuel Vadot items: 975def4c47SEmmanuel Vadot - const: 1 985def4c47SEmmanuel Vadot - enum: [ 1, 3, 4, 6, 20, 8, 10 ] 995def4c47SEmmanuel Vadot 100d5b0e70fSEmmanuel Vadot qcom,avg-samples: 101d5b0e70fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 102d5b0e70fSEmmanuel Vadot description: Number of samples to be used for measurement. 103d5b0e70fSEmmanuel Vadot This property in child node is applicable only for Gen2 ADC_TM peripheral. 104d5b0e70fSEmmanuel Vadot enum: 105d5b0e70fSEmmanuel Vadot - 1 106d5b0e70fSEmmanuel Vadot - 2 107d5b0e70fSEmmanuel Vadot - 4 108d5b0e70fSEmmanuel Vadot - 8 109d5b0e70fSEmmanuel Vadot - 16 110d5b0e70fSEmmanuel Vadot default: 1 111d5b0e70fSEmmanuel Vadot 112d5b0e70fSEmmanuel Vadot qcom,decimation: 113d5b0e70fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 114d5b0e70fSEmmanuel Vadot description: This parameter is used to decrease ADC sampling rate. 115d5b0e70fSEmmanuel Vadot Quicker measurements can be made by reducing decimation ratio. 116d5b0e70fSEmmanuel Vadot This property in child node is applicable only for Gen2 ADC_TM peripheral. 117d5b0e70fSEmmanuel Vadot enum: 118d5b0e70fSEmmanuel Vadot - 85 119d5b0e70fSEmmanuel Vadot - 340 120d5b0e70fSEmmanuel Vadot - 1360 121d5b0e70fSEmmanuel Vadot default: 1360 122d5b0e70fSEmmanuel Vadot 1235def4c47SEmmanuel Vadot required: 1245def4c47SEmmanuel Vadot - reg 1255def4c47SEmmanuel Vadot - io-channels 1265def4c47SEmmanuel Vadot 1275def4c47SEmmanuel Vadot additionalProperties: 1285def4c47SEmmanuel Vadot false 1295def4c47SEmmanuel Vadot 130d5b0e70fSEmmanuel VadotallOf: 131d5b0e70fSEmmanuel Vadot - if: 132d5b0e70fSEmmanuel Vadot properties: 133d5b0e70fSEmmanuel Vadot compatible: 134d5b0e70fSEmmanuel Vadot contains: 135d5b0e70fSEmmanuel Vadot const: qcom,spmi-adc-tm5 136d5b0e70fSEmmanuel Vadot 137d5b0e70fSEmmanuel Vadot then: 138d5b0e70fSEmmanuel Vadot patternProperties: 139d5b0e70fSEmmanuel Vadot "^([-a-z0-9]*)@[0-7]$": 140d5b0e70fSEmmanuel Vadot properties: 141d5b0e70fSEmmanuel Vadot qcom,decimation: false 142d5b0e70fSEmmanuel Vadot qcom,avg-samples: false 143d5b0e70fSEmmanuel Vadot 144d5b0e70fSEmmanuel Vadot - if: 145d5b0e70fSEmmanuel Vadot properties: 146d5b0e70fSEmmanuel Vadot compatible: 147d5b0e70fSEmmanuel Vadot contains: 148d5b0e70fSEmmanuel Vadot const: qcom,spmi-adc-tm5-gen2 149d5b0e70fSEmmanuel Vadot 150d5b0e70fSEmmanuel Vadot then: 151d5b0e70fSEmmanuel Vadot properties: 152d5b0e70fSEmmanuel Vadot qcom,avg-samples: false 153d5b0e70fSEmmanuel Vadot qcom,decimation: false 154d5b0e70fSEmmanuel Vadot 1555def4c47SEmmanuel Vadotrequired: 1565def4c47SEmmanuel Vadot - compatible 1575def4c47SEmmanuel Vadot - reg 1585def4c47SEmmanuel Vadot - interrupts 1595def4c47SEmmanuel Vadot - "#address-cells" 1605def4c47SEmmanuel Vadot - "#size-cells" 1615def4c47SEmmanuel Vadot 162*0e8011faSEmmanuel VadotunevaluatedProperties: false 1635def4c47SEmmanuel Vadot 1645def4c47SEmmanuel Vadotexamples: 1655def4c47SEmmanuel Vadot - | 1665def4c47SEmmanuel Vadot #include <dt-bindings/iio/qcom,spmi-vadc.h> 1675def4c47SEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 1688d13bc63SEmmanuel Vadot 1698d13bc63SEmmanuel Vadot pmic { 1705def4c47SEmmanuel Vadot #address-cells = <1>; 1715def4c47SEmmanuel Vadot #size-cells = <0>; 1728d13bc63SEmmanuel Vadot 1735def4c47SEmmanuel Vadot pm8150b_adc: adc@3100 { 1745def4c47SEmmanuel Vadot compatible = "qcom,spmi-adc5"; 1758d13bc63SEmmanuel Vadot reg = <0x3100>; 1765def4c47SEmmanuel Vadot #address-cells = <1>; 1775def4c47SEmmanuel Vadot #size-cells = <0>; 1785def4c47SEmmanuel Vadot #io-channel-cells = <1>; 1795def4c47SEmmanuel Vadot 180d5b0e70fSEmmanuel Vadot /* Other properties are omitted */ 181fac71e4eSEmmanuel Vadot channel@4f { 1825def4c47SEmmanuel Vadot reg = <ADC5_AMUX_THM3_100K_PU>; 1835def4c47SEmmanuel Vadot qcom,ratiometric; 1845def4c47SEmmanuel Vadot qcom,hw-settle-time = <200>; 185fac71e4eSEmmanuel Vadot label = "conn_therm"; 1865def4c47SEmmanuel Vadot }; 1875def4c47SEmmanuel Vadot }; 1885def4c47SEmmanuel Vadot 1898d13bc63SEmmanuel Vadot adc-tm@3500 { 1905def4c47SEmmanuel Vadot compatible = "qcom,spmi-adc-tm5"; 1915def4c47SEmmanuel Vadot reg = <0x3500>; 1925def4c47SEmmanuel Vadot interrupts = <0x2 0x35 0x0 IRQ_TYPE_EDGE_RISING>; 1935def4c47SEmmanuel Vadot #thermal-sensor-cells = <1>; 1945def4c47SEmmanuel Vadot #address-cells = <1>; 1955def4c47SEmmanuel Vadot #size-cells = <0>; 1965def4c47SEmmanuel Vadot 1975def4c47SEmmanuel Vadot conn-therm@0 { 1985def4c47SEmmanuel Vadot reg = <0>; 1995def4c47SEmmanuel Vadot io-channels = <&pm8150b_adc ADC5_AMUX_THM3_100K_PU>; 2005def4c47SEmmanuel Vadot qcom,ratiometric; 2015def4c47SEmmanuel Vadot qcom,hw-settle-time-us = <200>; 2025def4c47SEmmanuel Vadot }; 2035def4c47SEmmanuel Vadot }; 2045def4c47SEmmanuel Vadot }; 205d5b0e70fSEmmanuel Vadot 206d5b0e70fSEmmanuel Vadot - | 207d5b0e70fSEmmanuel Vadot #include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h> 208d5b0e70fSEmmanuel Vadot #include <dt-bindings/iio/qcom,spmi-adc7-pm8350.h> 209d5b0e70fSEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 2108d13bc63SEmmanuel Vadot 2118d13bc63SEmmanuel Vadot pmic { 212d5b0e70fSEmmanuel Vadot #address-cells = <1>; 213d5b0e70fSEmmanuel Vadot #size-cells = <0>; 2148d13bc63SEmmanuel Vadot 215d5b0e70fSEmmanuel Vadot pmk8350_vadc: adc@3100 { 216d5b0e70fSEmmanuel Vadot compatible = "qcom,spmi-adc7"; 2178d13bc63SEmmanuel Vadot reg = <0x3100>; 218d5b0e70fSEmmanuel Vadot #address-cells = <1>; 219d5b0e70fSEmmanuel Vadot #size-cells = <0>; 220d5b0e70fSEmmanuel Vadot #io-channel-cells = <1>; 221d5b0e70fSEmmanuel Vadot 222d5b0e70fSEmmanuel Vadot /* Other properties are omitted */ 223fac71e4eSEmmanuel Vadot channel@44 { 224d5b0e70fSEmmanuel Vadot reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>; 225d5b0e70fSEmmanuel Vadot qcom,ratiometric; 226d5b0e70fSEmmanuel Vadot qcom,hw-settle-time = <200>; 227fac71e4eSEmmanuel Vadot label = "xo_therm"; 228d5b0e70fSEmmanuel Vadot }; 229d5b0e70fSEmmanuel Vadot 230fac71e4eSEmmanuel Vadot channel@147 { 2318bab661aSEmmanuel Vadot reg = <PM8350_ADC7_AMUX_THM4_100K_PU(1)>; 232d5b0e70fSEmmanuel Vadot qcom,ratiometric; 233d5b0e70fSEmmanuel Vadot qcom,hw-settle-time = <200>; 234fac71e4eSEmmanuel Vadot label = "conn_therm"; 235d5b0e70fSEmmanuel Vadot }; 236d5b0e70fSEmmanuel Vadot }; 237d5b0e70fSEmmanuel Vadot 2388d13bc63SEmmanuel Vadot adc-tm@3400 { 239d5b0e70fSEmmanuel Vadot compatible = "qcom,spmi-adc-tm5-gen2"; 240d5b0e70fSEmmanuel Vadot reg = <0x3400>; 241d5b0e70fSEmmanuel Vadot interrupts = <0x0 0x34 0x0 IRQ_TYPE_EDGE_RISING>; 242d5b0e70fSEmmanuel Vadot #thermal-sensor-cells = <1>; 243d5b0e70fSEmmanuel Vadot #address-cells = <1>; 244d5b0e70fSEmmanuel Vadot #size-cells = <0>; 245d5b0e70fSEmmanuel Vadot 246d5b0e70fSEmmanuel Vadot pmk8350-xo-therm@0 { 247d5b0e70fSEmmanuel Vadot reg = <0>; 248d5b0e70fSEmmanuel Vadot io-channels = <&pmk8350_vadc PMK8350_ADC7_AMUX_THM1_100K_PU>; 249d5b0e70fSEmmanuel Vadot qcom,decimation = <340>; 250d5b0e70fSEmmanuel Vadot qcom,ratiometric; 251d5b0e70fSEmmanuel Vadot qcom,hw-settle-time-us = <200>; 252d5b0e70fSEmmanuel Vadot }; 253d5b0e70fSEmmanuel Vadot 254d5b0e70fSEmmanuel Vadot conn-therm@1 { 255d5b0e70fSEmmanuel Vadot reg = <1>; 2568bab661aSEmmanuel Vadot io-channels = <&pmk8350_vadc PM8350_ADC7_AMUX_THM4_100K_PU(1)>; 257d5b0e70fSEmmanuel Vadot qcom,avg-samples = <2>; 258d5b0e70fSEmmanuel Vadot qcom,ratiometric; 259d5b0e70fSEmmanuel Vadot qcom,hw-settle-time-us = <200>; 260d5b0e70fSEmmanuel Vadot }; 261d5b0e70fSEmmanuel Vadot }; 262d5b0e70fSEmmanuel Vadot }; 2635def4c47SEmmanuel Vadot... 264