From patchwork Tue Feb 8 02:04:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liam Beguin X-Patchwork-Id: 12738101 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 861A9C4167D for ; Tue, 8 Feb 2022 02:40:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345399AbiBHCJH (ORCPT ); Mon, 7 Feb 2022 21:09:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345440AbiBHCFB (ORCPT ); Mon, 7 Feb 2022 21:05:01 -0500 Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A676C061355; Mon, 7 Feb 2022 18:05:00 -0800 (PST) Received: by mail-qv1-xf30.google.com with SMTP id g3so8328815qvb.8; Mon, 07 Feb 2022 18:05:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QJ4snz0cur4JK5tD6GVF0n87Yz4vTpK9iTHizeDj3iE=; b=L0wRbH7Uwc/sRu0vXoICLt5omtZ5lBc+QgBAEuGEXNU5O6E+dxsM7IwvfPXhw3/2dJ xT6VG28FHURrt/VwUaZcu6DBJkVITDd1JzLtzwrwFYWB6bvtsoCEdDkxoc0/LAAnsTpO 2OQSES+lb8qwJ6f/BY6S4V0PcjtGd/01jOhKyifadF0LeJmsXBojPEbpGxY3cx9qh7fV kdjmgDCxse1pkQy+sOgX9Jb1xPEKrdYNDodCIY+3NFv0NarlsNzG8NjOQZPPU9rc+AwB AD+McFFt+wXce0r1Oh5lV7O5RR0NMZqLdErpDk0evS7Xbz/uWXk1uJLHZ8GuhDN5luJ4 oVPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QJ4snz0cur4JK5tD6GVF0n87Yz4vTpK9iTHizeDj3iE=; b=B7M9Y84Opp7yDUTXqc8F2ApQ8N119Ee8or/N9lR3Me2ibwenk5/eMl1SOh9LUcwJhG 8qc3/Bfkhha6RjR+gM3UOsHv6HZVbsDo7VXJZ2aeFdeZn9zYlQvPVh+7cahat5w6J08O DIwQyYn2+HSdqJIMfgyR6Znpvr0IYDjokkAb4vnKVaWS5LVf3ivwoaAjjU1z0U6iADst jvjrqroapRbY7CbONTWvWRIO3fUTBSQaZ+ZrleoCFIdtnf72HDbztn7QBuZuoV61mmCk zS/9joZi53Wlcju1QCaOyfRX0WwPfXhWG7OZAFojMHuF+V8CoQ3NlZyOHTjFEWzyk966 eXGg== X-Gm-Message-State: AOAM533QboUwoZq2hqcidMVBecGCCSPMkCbbb65flpZU7IWIBxicMZ11 jVmXQEfpU0vd0EgrKQuBNq0= X-Google-Smtp-Source: ABdhPJyThlm/sDXXRznW7Ix7lmYnOUWfGj++ZzQMOFLCmprbbPy92fDJE1ReHLw9Fw4XHHghnVsDAg== X-Received: by 2002:a05:6214:29e5:: with SMTP id jv5mr1709294qvb.64.1644285899487; Mon, 07 Feb 2022 18:04:59 -0800 (PST) Received: from shaak.. (modemcable055.92-163-184.mc.videotron.ca. [184.163.92.55]) by smtp.gmail.com with ESMTPSA id u9sm1416055qko.130.2022.02.07.18.04.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 18:04:58 -0800 (PST) From: Liam Beguin To: liambeguin@gmail.com, peda@axentia.se, jic23@kernel.org, andy.shevchenko@gmail.com, lars@metafoo.de Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org Subject: [PATCH v14 10/11] dt-bindings: iio: afe: add bindings for temperature-sense-rtd Date: Mon, 7 Feb 2022 21:04:40 -0500 Message-Id: <20220208020441.3081162-11-liambeguin@gmail.com> X-Mailer: git-send-email 2.35.1.4.g5d01301f2b86 In-Reply-To: <20220208020441.3081162-1-liambeguin@gmail.com> References: <20220208020441.3081162-1-liambeguin@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 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 Reviewed-by: Peter Rosin --- .../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>; + }; +...