142 lines · yaml
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)2---3$id: http://devicetree.org/schemas/hwmon/ntc-thermistor.yaml#4$schema: http://devicetree.org/meta-schemas/core.yaml#5 6title: NTC thermistor temperature sensors7 8maintainers:9 - Linus Walleij <linus.walleij@linaro.org>10 11description: |12 Thermistors with negative temperature coefficient (NTC) are resistors that13 vary in resistance in an often non-linear way in relation to temperature.14 The negative temperature coefficient means that the resistance decreases15 as the temperature rises. Since the relationship between resistance and16 temperature is non-linear, software drivers most often need to use a look17 up table and interpolation to get from resistance to temperature.18 19 When used in practice, a thermistor is often connected between ground, a20 pull-up resistor or/and a pull-down resistor and a fixed voltage like this:21 22 + e.g. 5V = pull-up voltage (puv)23 |24 +-+25 | |26 | | Pull-up resistor27 | | (puo)28 +-+29 |-------------------------o30 +-+ | ^31 | |/ |32 | / |33 |/| Thermistor | Measured voltage (mv)34 / | | "connected ground"35 /| | |36 +-+ |37 |-------------------------o38 +-+ ^39 | | |40 | | Pull-down resistor | Measured voltage (mv)41 | | (pdo) | "connected positive"42 +-+ |43 | |44 | v45 + GND GND46 47 The arrangements of where we measure the voltage over the thermistor are48 called "connected ground" and "connected positive" and shall be understood as49 the cases when either pull-up or pull-down resistance is zero.50 51 If the pull-up resistance is 0 one end of the thermistor is connected to the52 positive voltage and we get the thermistor on top of a pull-down resistor53 and we take the measure between the thermistor and the pull-down resistor.54 55 Conversely if the pull-down resistance is zero, one end of the thermistor is56 connected to ground and we get the thermistor under the pull-up resistor57 and we take the measure between the pull-up resistor and the thermistor.58 59 We can use both pull-up and pull-down resistors at the same time, and then60 the figure illustrates where the voltage will be measured for the "connected61 ground" and "connected positive" cases.62 63properties:64 $nodename:65 pattern: "^thermistor(.*)?$"66 67 compatible:68 oneOf:69 - const: epcos,b57330v210370 - const: epcos,b57891s010371 - const: murata,ncp15wb47372 - const: murata,ncp18wb47373 - const: murata,ncp21wb47374 - const: murata,ncp03wb47375 - const: murata,ncp15wl33376 - const: murata,ncp03wf10477 - const: murata,ncp15xh10378 - const: samsung,1404-00122179 # Deprecated "ntp," compatible strings80 - const: ntc,ncp15wb47381 deprecated: true82 - const: ntc,ncp18wb47383 deprecated: true84 - const: ntc,ncp21wb47385 deprecated: true86 - const: ntc,ncp03wb47387 deprecated: true88 - const: ntc,ncp15wl33389 deprecated: true90 91 "#thermal-sensor-cells":92 description: Thermal sensor cells if used for thermal sensoring.93 const: 094 95 pullup-uv:96 $ref: /schemas/types.yaml#/definitions/uint3297 description: Pull-up voltage in micro volts. Must always be specified.98 99 pullup-ohm:100 $ref: /schemas/types.yaml#/definitions/uint32101 description: Pull-up resistance in ohms. Must always be specified, even102 if zero.103 104 pulldown-ohm:105 $ref: /schemas/types.yaml#/definitions/uint32106 description: Pull-down resistance in ohms. Must always be specified, even107 if zero.108 109 connected-positive:110 $ref: /schemas/types.yaml#/definitions/flag111 description: Indicates how the thermistor is connected in series with112 a pull-up and/or a pull-down resistor. See the description above for113 an illustration. If this flag is NOT specified, the thermistor is assumed114 to be connected-ground, which usually means a pull-down resistance of115 zero but complex arrangements are possible.116 117 # See /schemas/iio/adc/adc.yaml118 io-channels:119 maxItems: 1120 description: IIO ADC channel to read the voltage over the resistor. Must121 always be specified.122 123required:124 - compatible125 - pullup-uv126 - pullup-ohm127 - pulldown-ohm128 - io-channels129 130additionalProperties: false131 132examples:133 - |134 thermistor {135 compatible = "murata,ncp18wb473";136 io-channels = <&gpadc 0x06>;137 pullup-uv = <1800000>;138 pullup-ohm = <220000>;139 pulldown-ohm = <0>;140 #thermal-sensor-cells = <0>;141 };142