Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5117274pxv; Tue, 20 Jul 2021 20:15:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdiZJbQbEiQTdNyNRB/kCYHhu3g4gfjcCtV4Xr4RTFWZZyCH7ensYcLye1JR8wCaC/0GmI X-Received: by 2002:a17:907:986e:: with SMTP id ko14mr36370808ejc.219.1626837334907; Tue, 20 Jul 2021 20:15:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626837334; cv=none; d=google.com; s=arc-20160816; b=gVQfsFFXNnhHQy+O7PP0J66V9mlnNpFxM17VL0FgH8LITh3Wkq0YGTKxeT/tkTsP+v r4rgGQ+TgEJDY3qjYu+dbhN8C3Rv698ZlP2ns2fM2xsBCAu6+s0KlbVJnkCxcRW7F3Eu s+9ZzBA3Gqkg2PkV5wheKPS9Gfst9leQolgYJCuXF8xANhxFWBJgYWcG+VMLZtmMEZ8y 23nWJmXPjl3HQsrYjjQvhf8M8IFof2ZuGY3El4KngV2wGc/BgnIIdn5BLov0BE+KMW0T MRZw5YYi0ef19THibOJJScKAvpvyk4IzWIYUjNaFyv66+NXaNj8f9qpQ5c6iDjzn5OWk GjnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=R5EJ5Gnotkd7ffF8IJqFhFOyVW3BEMA9J80b/3joIJo=; b=jOI3i8t03XPXrEnXwewCBZTmzgWjgaqU+OTt7KVewZCFAsZOcIQxYBHlIbVPG8/Bfp 2ZkyW/D8BeDdiqoEkJWMLOYDfacBXWFwjTfR2+6W//cZaBUh2yD2yReFOvSdPFA4H2DL mf9eS9qZx73z/4PDi3GmGCuVwLYO09k0QRfDIX2GPtiFQDGfCvTj0k6n4yyIxhwfg8FC WH3T7olxg5s8eHQ6oDD6Qj6it5GHTNSDMpsRg43ieG2lbm2AVHpkIpkPycZMzdeSLghI sSMbPiVnAGO0Q/Y0nBxH3lcS/Tb6TCBmDysBHqyTrx7TQUSLtOs8LuhrvB4KOXgB/QBJ kmWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E9dvB3pf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bh6si1491193ejb.691.2021.07.20.20.15.11; Tue, 20 Jul 2021 20:15:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E9dvB3pf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231499AbhGUCdN (ORCPT + 99 others); Tue, 20 Jul 2021 22:33:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231607AbhGUC0f (ORCPT ); Tue, 20 Jul 2021 22:26:35 -0400 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CCC2C0613DB; Tue, 20 Jul 2021 20:07:12 -0700 (PDT) Received: by mail-qk1-x72f.google.com with SMTP id m3so838333qkm.10; Tue, 20 Jul 2021 20:07:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R5EJ5Gnotkd7ffF8IJqFhFOyVW3BEMA9J80b/3joIJo=; b=E9dvB3pf/ikUebET2VoanuLsWWmhGzXGFwouYFkDPR76b/Ub8evqYxPAbY3ymTdQ0E nXlAsEenQic5ODsrO604NYkAQl0mhoMGcG4xDtWCeevw3R58uIJ3svHICrbHzkWb2fZZ prmwC4HqR8mHkekOUU4NobL0YIqwZqbGlkB63551W2GuCVgM96TXBL7KVjVOydauzrNl U/tTnovBtLtXO7p5T6/6o+gvgg2bNYIKV/Lxq1U9as6GzXTliBV/+mNtMqeLNVfiGp6t ngclELuh2jGUJHYwMNLx74OMOo8eXJ4Hi1W+kQ7NwyzkyASuTH94HmQ//n/CnY4/RSA/ LQpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R5EJ5Gnotkd7ffF8IJqFhFOyVW3BEMA9J80b/3joIJo=; b=mkOxKmGo+owfHWRt3aHyqSK16JeQdUXDzu+HnUizOYOpOl3A1ioMzJLZ62evRxZvPC /hTe6aRvJ+Vw26MSe7wIn0M7I1Kimnhl7LxNOxK3jQrpI0ZzqYVXF2XEhhynmZforj6V 4hbq38xzpeNGnpPIVylzsX4R1eigApbL+ZNqSyoW/moQNe2cgrPKAnFjKoSGoDl7CVGV P8Fz/mQ8hRkn6si2umyCsbGUy1XcHhBGqMtVlWrnuK6bgM9IDvFKetAB48LySAgy8CG9 uElr8wdJc2nidi0G54/YvmZGAGHNGFlXFYBleZ5k2s6ISy5whjostWRu4tWtlb6oKVIu o8WQ== X-Gm-Message-State: AOAM5301CTUwGsmcr0LKIPzd+pBsQlR5SJIYCk59KiFlraqXpVTK6kWm B0iqfgLpft8XcVds32RQEB4= X-Received: by 2002:ae9:ec03:: with SMTP id h3mr18188589qkg.116.1626836831331; Tue, 20 Jul 2021 20:07:11 -0700 (PDT) Received: from shaak.xiphos.ca (198-48-202-89.cpe.pppoe.ca. [198.48.202.89]) by smtp.gmail.com with ESMTPSA id g76sm10561024qke.127.2021.07.20.20.07.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jul 2021 20:07:10 -0700 (PDT) From: Liam Beguin To: liambeguin@gmail.com, peda@axentia.se, jic23@kernel.org, lars@metafoo.de, pmeerw@pmeerw.net Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org Subject: [PATCH v6 12/13] dt-bindings: iio: afe: add bindings for temperature-sense-rtd Date: Tue, 20 Jul 2021 23:06:12 -0400 Message-Id: <20210721030613.3105327-13-liambeguin@gmail.com> X-Mailer: git-send-email 2.30.1.489.g328c10930387 In-Reply-To: <20210721030613.3105327-1-liambeguin@gmail.com> References: <20210721030613.3105327-1-liambeguin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Liam Beguin An ADC is often used to measure other quantities indirectly. This binding describe one case, the measurement of a temperature through the voltage across an RTD resistor such as a PT1000. Signed-off-by: Liam Beguin Reviewed-by: Rob Herring --- .../iio/afe/temperature-sense-rtd.yaml | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/afe/temperature-sense-rtd.yaml diff --git a/Documentation/devicetree/bindings/iio/afe/temperature-sense-rtd.yaml b/Documentation/devicetree/bindings/iio/afe/temperature-sense-rtd.yaml new file mode 100644 index 000000000000..336ce96371db --- /dev/null +++ b/Documentation/devicetree/bindings/iio/afe/temperature-sense-rtd.yaml @@ -0,0 +1,101 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/afe/temperature-sense-rtd.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Temperature Sense RTD + +maintainers: + - Liam Beguin + +description: | + RTDs (Resistance Temperature Detectors) are a kind of temperature sensors + used to get a linear voltage to temperature reading within a give range + (usually 0 to 100 degrees Celsius). + + When an io-channel measures the output voltage across an RTD such as a + PT1000, the interesting measurement is almost always the corresponding + temperature, not the voltage output. This binding describes such a circuit. + + The general transfer function here is (using SI units) + + V = R(T) * iexc + R(T) = r0 * (1 + alpha * T) + T = 1 / (alpha * r0 * iexc) * (V - r0 * iexc) + + The following circuit matches what's in the examples section. + + 5V0 + ----- + | + +---+----+ + | R 5k | + +---+----+ + | + V 1mA + | + +---- Vout + | + +---+----+ + | PT1000 | + +---+----+ + | + ----- + GND + +properties: + compatible: + const: temperature-sense-rtd + + io-channels: + maxItems: 1 + description: | + Channel node of a voltage io-channel. + + '#io-channel-cells': + const: 0 + + excitation-current-microamp: + description: The current fed through the RTD sensor. + + alpha-ppm-per-celsius: + description: | + alpha can also be expressed in micro-ohms per ohm Celsius. It's a linear + approximation of the resistance versus temperature relationship + between 0 and 100 degrees Celsius. + + alpha = (R_100 - R_0) / (100 * R_0) + + Where, R_100 is the resistance of the sensor at 100 degrees Celsius, and + R_0 (or r-naught-ohms) is the resistance of the sensor at 0 degrees + Celsius. + + Pure platinum has an alpha of 3925. Industry standards such as IEC60751 + and ASTM E-1137 specify an alpha of 3850. + + r-naught-ohms: + description: | + Resistance of the sensor at 0 degrees Celsius. + Common values are 100 for PT100, 500 for PT500, and 1000 for PT1000 + +additionalProperties: false +required: + - compatible + - io-channels + - excitation-current-microamp + - alpha-ppm-per-celsius + - r-naught-ohms + +examples: + - | + pt1000_1: temperature-sensor0 { + compatible = "temperature-sense-rtd"; + #io-channel-cells = <0>; + io-channels = <&temp_adc1 0>; + + excitation-current-microamp = <1000>; /* i = U/R = 5 / 5000 */ + alpha-ppm-per-celsius = <3908>; + r-naught-ohms = <1000>; + }; +... -- 2.30.1.489.g328c10930387