xref: /openbmc/linux/Documentation/devicetree/bindings/hwmon/ntc-thermistor.yaml (revision 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e)
17bcc5a7aSLinus Walleij# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
27bcc5a7aSLinus Walleij---
37bcc5a7aSLinus Walleij$id: http://devicetree.org/schemas/hwmon/ntc-thermistor.yaml#
47bcc5a7aSLinus Walleij$schema: http://devicetree.org/meta-schemas/core.yaml#
57bcc5a7aSLinus Walleij
67bcc5a7aSLinus Walleijtitle: NTC thermistor temperature sensors
77bcc5a7aSLinus Walleij
87bcc5a7aSLinus Walleijmaintainers:
97bcc5a7aSLinus Walleij  - Linus Walleij <linus.walleij@linaro.org>
107bcc5a7aSLinus Walleij
117bcc5a7aSLinus Walleijdescription: |
127bcc5a7aSLinus Walleij  Thermistors with negative temperature coefficient (NTC) are resistors that
137bcc5a7aSLinus Walleij  vary in resistance in an often non-linear way in relation to temperature.
147bcc5a7aSLinus Walleij  The negative temperature coefficient means that the resistance decreases
157bcc5a7aSLinus Walleij  as the temperature rises. Since the relationship between resistance and
167bcc5a7aSLinus Walleij  temperature is non-linear, software drivers most often need to use a look
177bcc5a7aSLinus Walleij  up table and interpolation to get from resistance to temperature.
187bcc5a7aSLinus Walleij
197bcc5a7aSLinus Walleij  When used in practice, a thermistor is often connected between ground, a
207bcc5a7aSLinus Walleij  pull-up resistor or/and a pull-down resistor and a fixed voltage like this:
217bcc5a7aSLinus Walleij
227bcc5a7aSLinus Walleij      + e.g. 5V = pull-up voltage (puv)
237bcc5a7aSLinus Walleij      |
247bcc5a7aSLinus Walleij     +-+
257bcc5a7aSLinus Walleij     | |
267bcc5a7aSLinus Walleij     | | Pull-up resistor
277bcc5a7aSLinus Walleij     | | (puo)
287bcc5a7aSLinus Walleij     +-+
297bcc5a7aSLinus Walleij      |-------------------------o
307bcc5a7aSLinus Walleij     +-+ |                      ^
317bcc5a7aSLinus Walleij     | |/                       |
327bcc5a7aSLinus Walleij     | /                        |
337bcc5a7aSLinus Walleij     |/| Thermistor             | Measured voltage (mv)
347bcc5a7aSLinus Walleij     / |                        | "connected ground"
357bcc5a7aSLinus Walleij    /| |                        |
367bcc5a7aSLinus Walleij     +-+                        |
377bcc5a7aSLinus Walleij      |-------------------------o
387bcc5a7aSLinus Walleij     +-+                        ^
397bcc5a7aSLinus Walleij     | |                        |
407bcc5a7aSLinus Walleij     | | Pull-down resistor     | Measured voltage (mv)
417bcc5a7aSLinus Walleij     | | (pdo)                  | "connected positive"
427bcc5a7aSLinus Walleij     +-+                        |
437bcc5a7aSLinus Walleij      |                         |
447bcc5a7aSLinus Walleij      |                         v
457bcc5a7aSLinus Walleij      + GND                     GND
467bcc5a7aSLinus Walleij
477bcc5a7aSLinus Walleij  The arrangements of where we measure the voltage over the thermistor are
487bcc5a7aSLinus Walleij  called "connected ground" and "connected positive" and shall be understood as
497bcc5a7aSLinus Walleij  the cases when either pull-up or pull-down resistance is zero.
507bcc5a7aSLinus Walleij
517bcc5a7aSLinus Walleij  If the pull-up resistance is 0 one end of the thermistor is connected to the
527bcc5a7aSLinus Walleij  positive voltage and we get the thermistor on top of a pull-down resistor
537bcc5a7aSLinus Walleij  and we take the measure between the thermistor and the pull-down resistor.
547bcc5a7aSLinus Walleij
557bcc5a7aSLinus Walleij  Conversely if the pull-down resistance is zero, one end of the thermistor is
567bcc5a7aSLinus Walleij  connected to ground and we get the thermistor under the pull-up resistor
577bcc5a7aSLinus Walleij  and we take the measure between the pull-up resistor and the thermistor.
587bcc5a7aSLinus Walleij
597bcc5a7aSLinus Walleij  We can use both pull-up and pull-down resistors at the same time, and then
607bcc5a7aSLinus Walleij  the figure illustrates where the voltage will be measured for the "connected
617bcc5a7aSLinus Walleij  ground" and "connected positive" cases.
627bcc5a7aSLinus Walleij
637bcc5a7aSLinus Walleijproperties:
647bcc5a7aSLinus Walleij  $nodename:
657bcc5a7aSLinus Walleij    pattern: "^thermistor(.*)?$"
667bcc5a7aSLinus Walleij
677bcc5a7aSLinus Walleij  compatible:
687bcc5a7aSLinus Walleij    oneOf:
697bcc5a7aSLinus Walleij      - const: epcos,b57330v2103
707bcc5a7aSLinus Walleij      - const: epcos,b57891s0103
717bcc5a7aSLinus Walleij      - const: murata,ncp15wb473
727bcc5a7aSLinus Walleij      - const: murata,ncp18wb473
737bcc5a7aSLinus Walleij      - const: murata,ncp21wb473
747bcc5a7aSLinus Walleij      - const: murata,ncp03wb473
757bcc5a7aSLinus Walleij      - const: murata,ncp15wl333
767bcc5a7aSLinus Walleij      - const: murata,ncp03wf104
777bcc5a7aSLinus Walleij      - const: murata,ncp15xh103
78e13e979bSLinus Walleij      - const: samsung,1404-001221
797bcc5a7aSLinus Walleij      # Deprecated "ntp," compatible strings
807bcc5a7aSLinus Walleij      - const: ntc,ncp15wb473
817bcc5a7aSLinus Walleij        deprecated: true
827bcc5a7aSLinus Walleij      - const: ntc,ncp18wb473
837bcc5a7aSLinus Walleij        deprecated: true
847bcc5a7aSLinus Walleij      - const: ntc,ncp21wb473
857bcc5a7aSLinus Walleij        deprecated: true
867bcc5a7aSLinus Walleij      - const: ntc,ncp03wb473
877bcc5a7aSLinus Walleij        deprecated: true
887bcc5a7aSLinus Walleij      - const: ntc,ncp15wl333
897bcc5a7aSLinus Walleij        deprecated: true
907bcc5a7aSLinus Walleij
917bcc5a7aSLinus Walleij  "#thermal-sensor-cells":
927bcc5a7aSLinus Walleij    description: Thermal sensor cells if used for thermal sensoring.
937bcc5a7aSLinus Walleij    const: 0
947bcc5a7aSLinus Walleij
957bcc5a7aSLinus Walleij  pullup-uv:
967bcc5a7aSLinus Walleij    $ref: /schemas/types.yaml#/definitions/uint32
977bcc5a7aSLinus Walleij    description: Pull-up voltage in micro volts. Must always be specified.
987bcc5a7aSLinus Walleij
997bcc5a7aSLinus Walleij  pullup-ohm:
1007bcc5a7aSLinus Walleij    $ref: /schemas/types.yaml#/definitions/uint32
1017bcc5a7aSLinus Walleij    description: Pull-up resistance in ohms. Must always be specified, even
1027bcc5a7aSLinus Walleij      if zero.
1037bcc5a7aSLinus Walleij
1047bcc5a7aSLinus Walleij  pulldown-ohm:
1057bcc5a7aSLinus Walleij    $ref: /schemas/types.yaml#/definitions/uint32
1067bcc5a7aSLinus Walleij    description: Pull-down resistance in ohms. Must always be specified, even
1077bcc5a7aSLinus Walleij      if zero.
1087bcc5a7aSLinus Walleij
1097bcc5a7aSLinus Walleij  connected-positive:
1107bcc5a7aSLinus Walleij    $ref: /schemas/types.yaml#/definitions/flag
1117bcc5a7aSLinus Walleij    description: Indicates how the thermistor is connected in series with
1127bcc5a7aSLinus Walleij      a pull-up and/or a pull-down resistor. See the description above for
1137bcc5a7aSLinus Walleij      an illustration. If this flag is NOT specified, the thermistor is assumed
1147bcc5a7aSLinus Walleij      to be connected-ground, which usually means a pull-down resistance of
1157bcc5a7aSLinus Walleij      zero but complex arrangements are possible.
1167bcc5a7aSLinus Walleij
1177bcc5a7aSLinus Walleij  # See /schemas/iio/adc/adc.yaml
1187bcc5a7aSLinus Walleij  io-channels:
1197bcc5a7aSLinus Walleij    maxItems: 1
1207bcc5a7aSLinus Walleij    description: IIO ADC channel to read the voltage over the resistor. Must
1217bcc5a7aSLinus Walleij      always be specified.
1227bcc5a7aSLinus Walleij
1237bcc5a7aSLinus Walleijrequired:
1247bcc5a7aSLinus Walleij  - compatible
1257bcc5a7aSLinus Walleij  - pullup-uv
1267bcc5a7aSLinus Walleij  - pullup-ohm
1277bcc5a7aSLinus Walleij  - pulldown-ohm
1287bcc5a7aSLinus Walleij  - io-channels
1297bcc5a7aSLinus Walleij
1307bcc5a7aSLinus WalleijadditionalProperties: false
1317bcc5a7aSLinus Walleij
1327bcc5a7aSLinus Walleijexamples:
1337bcc5a7aSLinus Walleij  - |
134*08be4233SKrzysztof Kozlowski    thermistor {
1357bcc5a7aSLinus Walleij      compatible = "murata,ncp18wb473";
1367bcc5a7aSLinus Walleij      io-channels = <&gpadc 0x06>;
1377bcc5a7aSLinus Walleij      pullup-uv = <1800000>;
1387bcc5a7aSLinus Walleij      pullup-ohm = <220000>;
1397bcc5a7aSLinus Walleij      pulldown-ohm = <0>;
1407bcc5a7aSLinus Walleij      #thermal-sensor-cells = <0>;
1417bcc5a7aSLinus Walleij    };
142