Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp426195pxb; Tue, 1 Feb 2022 03:03:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyTyUIxnKmjurd7ziX3NJ+78+WuzL/7LXDLNHMz9HpUgtdro6KoAKSJaHugVBf4AqpbBq+p X-Received: by 2002:a05:6402:35d5:: with SMTP id z21mr25023864edc.262.1643713411206; Tue, 01 Feb 2022 03:03:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643713411; cv=none; d=google.com; s=arc-20160816; b=H2FBdNY4E4vcT4RDPFskIEbnNhr41wVfDuNFRSDsPc7R2EOnapm/z8n2DYuz88F5ho XI9/WUuoSbPl7sqs9zV1B1LxmB2aNn6bccVtjScooYrcoups7wKHGssGCwRFLa4kJHAf qrCArx/z6zL65HovdzYmLlBhEg0pzryx7DTnA3WH8hHwPZDDV4xXHUHXPRX9szfmtovG H1IEmD6TjFm+4BYBhF5Jat+v+TL1ICaBYP0p3CdziwTQA5rQBveTy0JRMaUWl6G/eZd5 J25T057+kXFpv1WyVd+8SJrWrHkoeUz9YWtiveMXDTsRIh/rZPv4pm6RITFkIWEx8rqk 79aw== 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=4lFaVXaOEQ0S/iYKidAfI8kJNzQK67M6VoIAHTd3OhI=; b=QmpqaEX03LZe0RTrdsqqgyswKQ9AOkgyaL2jc7JhQIxhUexG22bqIUXmLTK466plqa 198xUaGg9jqKBhtg7u/kMhHU70TQzZ7+3s2SsUzXV06+hwPZmjgioAVH6mZDO5U7mg2A +vHVNcM0T+yqurJVMeaRwtktfnNpM3GWtM6tkvEPIq339hRl1TLKDXeIa+5E+vz7ipcz 0fM7A6oL0hs2u0kQqSBCagEeNu4DTq+hhfxwhAf4cwmNbJ8yfawk8PhJnAO9IbRkP0tl GVQJ1Dr2QeJSYeXP3ovSCjRcWOkhbvq9vWyeT6ZUAP3JjwdQSt6r58hblaq/WKQ0elqS Cygw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=blvLuomH; 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 v17si9280143edx.78.2022.02.01.03.03.06; Tue, 01 Feb 2022 03:03:31 -0800 (PST) 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=20210112 header.b=blvLuomH; 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 S1355618AbiA3QLu (ORCPT + 99 others); Sun, 30 Jan 2022 11:11:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355560AbiA3QLf (ORCPT ); Sun, 30 Jan 2022 11:11:35 -0500 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 388E9C061741; Sun, 30 Jan 2022 08:11:33 -0800 (PST) Received: by mail-qk1-x72b.google.com with SMTP id j24so7639153qkk.10; Sun, 30 Jan 2022 08:11:33 -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=4lFaVXaOEQ0S/iYKidAfI8kJNzQK67M6VoIAHTd3OhI=; b=blvLuomHXutojSzN7Hciy5cDOiGlu+FsMCueduasXH+G9K9IMJA5LaRUWZTXjw25K9 hn85XP7QEUUQGNPK3uU8xdMYsz6S05WnMXkPD4ZIQQI7gSwmft7kOIlojWO98KTG2Mkg Dp3Cyejp3ObE12mz8HzVLC8Ul3eDTZ6/NvA6FE1Fq4BjGgdqioBoPOxuggK+WobWsXCh 07o8jWgD0dH/dp2PbHEQYdndglrlLAq6VEoAezALy6cwAHTmbxlMwbAE/GM5+Sxw1b1w KC0+t1+TD692QUpeUMsfWkYJM0FtB4jVCyH704JGPf6WXhM4NX9DGQJl0VZ6wmVjhaph 41cQ== 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=4lFaVXaOEQ0S/iYKidAfI8kJNzQK67M6VoIAHTd3OhI=; b=h3azUkW9WverG1Zh4U01WdtsiIjvAtXJWcm4aW5FecaGHKHrjHWmbMWgbn2GBWPZay VA0rCbaJWFkg+MPeeIhkgYG6mzfnHUa98y+WM54qQ00fUPXQzAX4lBLwW8UR72pTWNKq K5ugjaS9ROuY2n2mjqMFGRwGwKCSJPGSSa+EITGDw7DiYeWFDfS79NiDgE9h6sk6h/HO t/7HmUZnEcdKQDoZNZxWVkEwX3xmIEOjUvYaDoKpAqeixKSEd3aMWIvAtzJ1dQYICoGT cD2Jrl+Vx5UszUBYe7Q+b+7Pk/3foOz/yqW23dt6rj2ZdEu83AzBw0MMdP43lsTjCJ1I zlwA== X-Gm-Message-State: AOAM530BeCArz/hZGQSIPW/btHS0PH0ZX9NlOMwL8Rve3kodOl90xLnG PYugL5bbmg0ye4j0K1jkslo= X-Received: by 2002:a05:620a:4251:: with SMTP id w17mr10789288qko.284.1643559092398; Sun, 30 Jan 2022 08:11:32 -0800 (PST) Received: from shaak.. (modemcable055.92-163-184.mc.videotron.ca. [184.163.92.55]) by smtp.gmail.com with ESMTPSA id v73sm6906148qkb.51.2022.01.30.08.11.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jan 2022 08:11:31 -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 v13 11/11] dt-bindings: iio: afe: add bindings for temperature transducers Date: Sun, 30 Jan 2022 11:11:01 -0500 Message-Id: <20220130161101.1067691-12-liambeguin@gmail.com> X-Mailer: git-send-email 2.35.1.4.g5d01301f2b86 In-Reply-To: <20220130161101.1067691-1-liambeguin@gmail.com> References: <20220130161101.1067691-1-liambeguin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org An ADC is often used to measure other quantities indirectly. This binding describe one case, the measurement of a temperature through a temperature transducer (either voltage or current). Signed-off-by: Liam Beguin Reviewed-by: Rob Herring Reviewed-by: Peter Rosin --- .../iio/afe/temperature-transducer.yaml | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/afe/temperature-transducer.yaml diff --git a/Documentation/devicetree/bindings/iio/afe/temperature-transducer.yaml b/Documentation/devicetree/bindings/iio/afe/temperature-transducer.yaml new file mode 100644 index 000000000000..cfbf5350db27 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/afe/temperature-transducer.yaml @@ -0,0 +1,114 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/afe/temperature-transducer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Temperature Transducer + +maintainers: + - Liam Beguin + +description: | + A temperature transducer is a device that converts a thermal quantity + into any other physical quantity. This binding applies to temperature to + voltage (like the LTC2997), and temperature to current (like the AD590) + linear transducers. + In both cases these are assumed to be connected to a voltage ADC. + + When an io-channel measures the output voltage of a temperature analog front + end such as a temperature transducer, 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(T) = Rsense * Isense(T) + T = (Isense(T) / alpha) + offset + T = 1 / (Rsense * alpha) * (V + offset * Rsense * alpha) + + When using a temperature to voltage transducer, Rsense is set to 1. + + The following circuits show a temperature to current and a temperature to + voltage transducer that can be used with this binding. + + VCC + ----- + | + +---+---+ + | AD590 | VCC + +---+---+ ----- + | | + V proportional to T +----+----+ + | D+ --+ | + +---- Vout | LTC2997 +--- Vout + | D- --+ | + +---+----+ +---------+ + | Rsense | | + +---+----+ ----- + | GND + ----- + GND + +properties: + compatible: + const: temperature-transducer + + io-channels: + maxItems: 1 + description: | + Channel node of a voltage io-channel. + + '#io-channel-cells': + const: 0 + + sense-offset-millicelsius: + description: | + Temperature offset. + This offset is commonly used to convert from Kelvins to degrees Celsius. + In that case, sense-offset-millicelsius would be set to <(-273150)>. + default: 0 + + sense-resistor-ohms: + description: | + The sense resistor. + By default sense-resistor-ohms cancels out the resistor making the + circuit behave like a temperature transducer. + default: 1 + + alpha-ppm-per-celsius: + description: | + Sometimes referred to as output gain, slope, or temperature coefficient. + + alpha is expressed in parts per million which can be micro-amps per + degrees Celsius or micro-volts per degrees Celsius. The is the main + characteristic of a temperature transducer and should be stated in the + datasheet. + +additionalProperties: false + +required: + - compatible + - io-channels + - alpha-ppm-per-celsius + +examples: + - | + ad950: temperature-sensor-0 { + compatible = "temperature-transducer"; + #io-channel-cells = <0>; + io-channels = <&temp_adc 3>; + + sense-offset-millicelsius = <(-273150)>; /* Kelvin to degrees Celsius */ + sense-resistor-ohms = <8060>; + alpha-ppm-per-celsius = <1>; /* 1 uA/K */ + }; + - | + znq_tmp: temperature-sensor-1 { + compatible = "temperature-transducer"; + #io-channel-cells = <0>; + io-channels = <&temp_adc 2>; + + sense-offset-millicelsius = <(-273150)>; /* Kelvin to degrees Celsius */ + alpha-ppm-per-celsius = <4000>; /* 4 mV/K */ + }; +... -- 2.35.1.4.g5d01301f2b86