Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1540649pxb; Tue, 8 Feb 2022 21:37:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQK1zeJ+ssexTLdavwXPYRseh4Bh5JgzRsCTDexbYpK++8eTwN5XX8A4mCKu8SBvXFGXuw X-Received: by 2002:a05:6a00:23d3:: with SMTP id g19mr619173pfc.27.1644385077892; Tue, 08 Feb 2022 21:37:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644385077; cv=none; d=google.com; s=arc-20160816; b=KtjX1+XYujXvO41Ie8VacK+TSb/eu8SKZqjnWtmey5Uwr5doWcxJxGaXNQ7lIisU6P mHObO1l701TYzC9VBDJhVXgAQhoVkR+xfo/STzwueImexiFkIpkt3Z7rKtwAaHz8qmtO otK9uc2NK+g+oH86oax0/FmmoGjzPOJJuBxPCw87hZrpFu8v0wJD8OzFv7WThVXZ+AfF zsQEOU8jUr7+eNbxRg6yMhq+f6rExWtXkFB7OaFks9AV6chYi4CWV7hkxnPJOE+6W3ST hnfSbXouJ/J4plgjXJ6W+xvP+rE0z4kqGx/VJhfXrmpF4wELbuEIXcpQ/YEh1ofid7Ib GffQ== 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=VfEtaR82yaFWsYCMvvszZ2TFtPIq7bhL1B7cZlyXegGyVR5AZXQS/egt+rVuhVZYU8 KZ/goF6PYZvkrjubpymSMwhEv/Z8rz6Jezqtyu4WfTRTy0aPPkalGuyxZHRE0/m/7wDL aC+S7GOgAP4IKr+GQHr2unyeq1kU2NPdspzHzi/mwC0n/Otk2Loz0tUUCyfTxoHxYeyc Yq03cw1KtXDTlmZb66jYC/EVa7M7Ko3a6JQj8sYqnP+JWQBrlI2VSH2r56HHRzVpbLYb Yyz4JmmZeB0X+6Ii2ijN07ZKItBWW6WFYufsuAjSnTzu19X+nW7bsSPLpELK98gLRCHc MaOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ndyROLy6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id me15si4699713pjb.98.2022.02.08.21.37.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 21:37:57 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ndyROLy6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DA9DEC0302F1; Tue, 8 Feb 2022 21:34:35 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345843AbiBHCJO (ORCPT + 99 others); Mon, 7 Feb 2022 21:09:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345447AbiBHCFC (ORCPT ); Mon, 7 Feb 2022 21:05:02 -0500 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 647F3C061355; Mon, 7 Feb 2022 18:05:01 -0800 (PST) Received: by mail-qt1-x82f.google.com with SMTP id o3so13611551qtm.12; Mon, 07 Feb 2022 18:05:01 -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=ndyROLy6GbL/8bzB4QYIlDvtD25Ac3AGNLI9bPBauHLoYN7WjxwWmaYVq/14CAkNv/ GFV8h+3L+w6sbrf7GmAzjJC2CImxmi/eXL8FVl5T6pHeK4JkISsGwKwa/3ZzsGGcs5pU 8xD/nKk3OC6J73McVTzFa3PnE/bFFqNFAxEormtKUcJDYSmE6lAj72QjlXn52n0JHbAw KxzzVUKFQfDg9IwR6vIQqC+lsDIei/g6SxNLtOeZmoox0qStJJJvnJuqWF2rkQ22GD8t NG6fKtLm05zGO5ES6nw4j9DlNxrzvcEwISjjVcY7z7Z4tcdn6bIvmoJBfGmwtesWisDU MHkw== 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=BmWWeN+qKmu6XF4W7Q/Y0kj+gaQtjmfR0GFFUewXYkFvAmqFRQG0Lo1sEQHdUd9YwH ItuTnzwo0+kBRnlLrELUuskM2nERziWQFnc4sACyXomLOIuErS7Hk0z+57VgrPFxWUOB g9PBzkN4y0HfVVEYcFUXEAfvy0fnzoAKcyBoI0bxeHm19x9089UTPrJ9UNKZ3JipZUFB 0p4FwuZsSh8Ne5/JYfRjRBHta7zNxocesGAoCIeVnDuzM29lPlq1jj8gFdzaebt6iNa3 4vZ30V4cx+JHdVc2VI/DEHvKfF/g7W+XC6yshN+Ps4F8+qpZflaKdSnpbpEIsa4wOA0Q BpzA== X-Gm-Message-State: AOAM533d9kSeT2ys29HgqnRRl8ydtVz1ijKWxrVswxxufbPtHd5Csj/l jUjfNOcER6bRyLgtn75N0AMX3qAm7eE= X-Received: by 2002:ac8:7619:: with SMTP id t25mr1687748qtq.456.1644285900545; Mon, 07 Feb 2022 18:05:00 -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.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 18:05:00 -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 11/11] dt-bindings: iio: afe: add bindings for temperature transducers Date: Mon, 7 Feb 2022 21:04:41 -0500 Message-Id: <20220208020441.3081162-12-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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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