Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
0002 ---
0003 $id: http://devicetree.org/schemas/hwmon/ntc-thermistor.yaml#
0004 $schema: http://devicetree.org/meta-schemas/core.yaml#
0005 
0006 title: NTC thermistor temperature sensors
0007 
0008 maintainers:
0009   - Naveen Krishna Chatradhi <ch.naveen@samsung.com>
0010   - Linus Walleij <linus.walleij@linaro.org>
0011 
0012 description: |
0013   Thermistors with negative temperature coefficient (NTC) are resistors that
0014   vary in resistance in an often non-linear way in relation to temperature.
0015   The negative temperature coefficient means that the resistance decreases
0016   as the temperature rises. Since the relationship between resistance and
0017   temperature is non-linear, software drivers most often need to use a look
0018   up table and interpolation to get from resistance to temperature.
0019 
0020   When used in practice, a thermistor is often connected between ground, a
0021   pull-up resistor or/and a pull-down resistor and a fixed voltage like this:
0022 
0023       + e.g. 5V = pull-up voltage (puv)
0024       |
0025      +-+
0026      | |
0027      | | Pull-up resistor
0028      | | (puo)
0029      +-+
0030       |-------------------------o
0031      +-+ |                      ^
0032      | |/                       |
0033      | /                        |
0034      |/| Thermistor             | Measured voltage (mv)
0035      / |                        | "connected ground"
0036     /| |                        |
0037      +-+                        |
0038       |-------------------------o
0039      +-+                        ^
0040      | |                        |
0041      | | Pull-down resistor     | Measured voltage (mv)
0042      | | (pdo)                  | "connected positive"
0043      +-+                        |
0044       |                         |
0045       |                         v
0046       + GND                     GND
0047 
0048   The arrangements of where we measure the voltage over the thermistor are
0049   called "connected ground" and "connected positive" and shall be understood as
0050   the cases when either pull-up or pull-down resistance is zero.
0051 
0052   If the pull-up resistance is 0 one end of the thermistor is connected to the
0053   positive voltage and we get the thermistor on top of a pull-down resistor
0054   and we take the measure between the thermistor and the pull-down resistor.
0055 
0056   Conversely if the pull-down resistance is zero, one end of the thermistor is
0057   connected to ground and we get the thermistor under the pull-up resistor
0058   and we take the measure between the pull-up resistor and the thermistor.
0059 
0060   We can use both pull-up and pull-down resistors at the same time, and then
0061   the figure illustrates where the voltage will be measured for the "connected
0062   ground" and "connected positive" cases.
0063 
0064 properties:
0065   $nodename:
0066     pattern: "^thermistor(.*)?$"
0067 
0068   compatible:
0069     oneOf:
0070       - const: epcos,b57330v2103
0071       - const: epcos,b57891s0103
0072       - const: murata,ncp15wb473
0073       - const: murata,ncp18wb473
0074       - const: murata,ncp21wb473
0075       - const: murata,ncp03wb473
0076       - const: murata,ncp15wl333
0077       - const: murata,ncp03wf104
0078       - const: murata,ncp15xh103
0079       - const: samsung,1404-001221
0080       # Deprecated "ntp," compatible strings
0081       - const: ntc,ncp15wb473
0082         deprecated: true
0083       - const: ntc,ncp18wb473
0084         deprecated: true
0085       - const: ntc,ncp21wb473
0086         deprecated: true
0087       - const: ntc,ncp03wb473
0088         deprecated: true
0089       - const: ntc,ncp15wl333
0090         deprecated: true
0091 
0092   "#thermal-sensor-cells":
0093     description: Thermal sensor cells if used for thermal sensoring.
0094     const: 0
0095 
0096   pullup-uv:
0097     $ref: /schemas/types.yaml#/definitions/uint32
0098     description: Pull-up voltage in micro volts. Must always be specified.
0099 
0100   pullup-ohm:
0101     $ref: /schemas/types.yaml#/definitions/uint32
0102     description: Pull-up resistance in ohms. Must always be specified, even
0103       if zero.
0104 
0105   pulldown-ohm:
0106     $ref: /schemas/types.yaml#/definitions/uint32
0107     description: Pull-down resistance in ohms. Must always be specified, even
0108       if zero.
0109 
0110   connected-positive:
0111     $ref: /schemas/types.yaml#/definitions/flag
0112     description: Indicates how the thermistor is connected in series with
0113       a pull-up and/or a pull-down resistor. See the description above for
0114       an illustration. If this flag is NOT specified, the thermistor is assumed
0115       to be connected-ground, which usually means a pull-down resistance of
0116       zero but complex arrangements are possible.
0117 
0118   # See /schemas/iio/adc/adc.yaml
0119   io-channels:
0120     maxItems: 1
0121     description: IIO ADC channel to read the voltage over the resistor. Must
0122       always be specified.
0123 
0124 required:
0125   - compatible
0126   - pullup-uv
0127   - pullup-ohm
0128   - pulldown-ohm
0129   - io-channels
0130 
0131 additionalProperties: false
0132 
0133 examples:
0134   - |
0135     thermistor0 {
0136       compatible = "murata,ncp18wb473";
0137       io-channels = <&gpadc 0x06>;
0138       pullup-uv = <1800000>;
0139       pullup-ohm = <220000>;
0140       pulldown-ohm = <0>;
0141       #thermal-sensor-cells = <0>;
0142     };