Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5117329pxv; Tue, 20 Jul 2021 20:15:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWLSQjGhqMSJjJl+nOXYZD8BOMokxI0mIQ8KnLOlcSOeNZkHGBMrVV2XsB1osNbZAFapzi X-Received: by 2002:a05:6402:1347:: with SMTP id y7mr45742465edw.87.1626837341616; Tue, 20 Jul 2021 20:15:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626837341; cv=none; d=google.com; s=arc-20160816; b=qBru5PLJLuMmM0X7KW7Vciqk+J+mG6mHSVpFChzO420cJr2hz9vZM0uGetmYsA3d8Y OeinIev+Bdu53HO69rzmWmcpkpdArPHYgL0uc7+Pgje85gq01sKgiQWRl/cmra9ukcZB 00C2pC2gKbI68gOckAACv2BtBXHnwkWzWEat6Ph2goj79i8W1nF+AKX87emHhIA73Mf2 C1z8d97MBL6IhEX0DUX0s8d8hNMOGTnXdXVi3Mqw7plS1vxR+hR7UAhiyuhdMABPb5o1 NTM1jLqVTpOcL3P22jz3lsawOsMUXCW/DjxWdqoI6qY5aY8ww8N22Vj3b575kVuhrT4Z IuCg== 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=GBxLtWhEZsYL5lfe8/wLjcrrsUgudlTtucyNHZMYMQk=; b=PGGV48AoK8mvBvZpvEiR3rOD4/1zQR/iz2E0aatqjoHAJU9gJ2Rh1iXxqnPeucvaqR pJI2PDcl/CVfIZZ5Fjra9G9mKDhvHXhmIzAifUkX5iU7SBy3Rm7bAc9XUJs6x6A9tvDu Ek5TZ1qIAuUGa82KJQwXg6bQDBVL1TO4H50H4Emyt3Q1fq4UBZYrG6RJN6NvTBgvsgGm XMpiGs/S4wq3W6DNi6FVlajsTSeHiZNX8afvj2U6UHN5cNvm7gNGcYEP1reiYZp6vy34 uQQuBsKRArA4QTJnXqj1GkuYdRbausZQpXV7BUF1XgnwgpyEvH0wXiVnjrebrZEVI5i3 cH+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fOaY69lb; 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 f17si24619804edv.266.2021.07.20.20.15.18; Tue, 20 Jul 2021 20:15:41 -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=fOaY69lb; 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 S231802AbhGUCdQ (ORCPT + 99 others); Tue, 20 Jul 2021 22:33:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231756AbhGUC0k (ORCPT ); Tue, 20 Jul 2021 22:26:40 -0400 Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0807AC0613E0; Tue, 20 Jul 2021 20:07:13 -0700 (PDT) Received: by mail-qk1-x731.google.com with SMTP id s193so872332qke.4; 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=GBxLtWhEZsYL5lfe8/wLjcrrsUgudlTtucyNHZMYMQk=; b=fOaY69lbuts10kKaqZ0eocvUPYPzq+XmHmkus9YUsrdpL+EC9m3xmrTkEPmpGkc1Wt 327EKfhyimv2Mv/Ie05WzHvPeL2jZ70DADMv8rgCApFcZWh72DjDpYUiFcYJ/94HzT+R xOYV0E//WvXXNgnCvQ8sScO39cfhYlmXSfAwylpHZ6bAKdnPgRW+79xO4EgkDHlTFfJW QHufIZn/ghYZ9tCMTgarIwe3uK5cxMLihsN6r/SD8ivfddQTAQe4LQIilYH1uWmEMuOG yfxW7T12u349fRI9haOgFHe2NMn4s+pqvII17RG1L4UsqGkT6OISiTOplsvCB6mhvBRV f5XQ== 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=GBxLtWhEZsYL5lfe8/wLjcrrsUgudlTtucyNHZMYMQk=; b=p6PVBD53T+MMgLSxW4F3PfaNQ+4FGKJ6hQ0O6busVn8r6N5qY0wkd/chRVO7sAxGPR q77U81WiE/a223kK8SZsEhn8e9On43ZD+7s0QpDKUIRInpzgPSn6KQipYbC/wPyFpQte rGRxalE/8qHTOnx6ivM+YiKXY68uDqcT8xtDkRVhpU+ihO3mxUE6I34JoCokk/B52Ap3 pW0cZLY1h67vZRpbnKZkVLBaVb4mgo7hn4hatsjhbrJ9Qm/aDkF6BxErqCRLirayqddo of7BL3gNDEL8hXu8YrXC9LKiFGKYGPpSebzRDr+YzrOzDoIM/2kFTU4FVuVPOZ8KSto2 ZUow== X-Gm-Message-State: AOAM5332SeaC76QSN9Z5Z4w3DDvkT/h0EiySmw6sQw4zHt3jfxIKdr5S ob8riuTVIB0jMndTD4uFfZs= X-Received: by 2002:ae9:f805:: with SMTP id x5mr32483942qkh.373.1626836832254; Tue, 20 Jul 2021 20:07:12 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jul 2021 20:07:11 -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 13/13] dt-bindings: iio: afe: add bindings for temperature transducers Date: Tue, 20 Jul 2021 23:06:13 -0400 Message-Id: <20210721030613.3105327-14-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 a temperature transducer (either voltage or current). Signed-off-by: Liam Beguin --- .../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.30.1.489.g328c10930387