From patchwork Thu Nov 3 13:00:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cosmin Tanislav X-Patchwork-Id: 13029957 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 250D7C43219 for ; Thu, 3 Nov 2022 13:01:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231557AbiKCNBJ (ORCPT ); Thu, 3 Nov 2022 09:01:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230481AbiKCNBG (ORCPT ); Thu, 3 Nov 2022 09:01:06 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5727511C27; Thu, 3 Nov 2022 06:01:05 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id d26so4939766eje.10; Thu, 03 Nov 2022 06:01:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dkllNL0GpBnoMQ1ygISVBZa6WEvqeNfaI6WJdu1D4w4=; b=VAhuxo/HphVdvzXuW55OopJQAiksaZpXvmCmywuzIHtLKBLEmdBd6Txc8PU79JITD9 hj4n6jiF1vPKzEvbfPTys3wEsYuaOrIExll7fIIwIMyfSNa4MS6oNN7by7GHPai0D4SD LZkPaOFaaP4Nf2BYXcX9n8qjxrB8PlnDc6xqJoMkCiS8IuGXg7xXAqZ0QZiJW6ZXqbMD nDJJ//X6ysGLLATOw4F2Ac6u0LB/vYhlP/tma3R9wj/AdjlRlYuruEfEeNnAo/zCiLxm paTr+7ZfDvdFj1Z8wgQcDnQu8earV2Vhxafjxda9uPAANx2kSpCp3vZLFkEcrN+5Zhro YqhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dkllNL0GpBnoMQ1ygISVBZa6WEvqeNfaI6WJdu1D4w4=; b=EbNO9hmv/dBQt1yF10dLk6xlcC21aI15tZzuCI0ysTUutK/KScRsUhUtYIy2uKgVNu GvS/oDxGwlyxKrq2A/on47es2DtnuUWxOAaITNKV31E5DIdQ3wQSFvTczwcGQ6IK+qq5 BBlyK8L4Psd5Cr33j9TkxK5R5JuM0jQd7cFGHSMhF49mawrYG6XxDbWmh7HUJfbGwm+b 0Xl1dbY+7Hn/IoQcktkGf53hXjEKKqPOxpaYitKh0Ah1m41H94t5YPjZAoIDrxQOHsKV zgNXFLA8+1t50lkZyTuNkCuhN72WVNp7rj0xH8MkAnl4wWp+eYnKgw+i9P0VfK/x9gIB wjlA== X-Gm-Message-State: ACrzQf0hd95lZXdNpISqaHFH+Aj13B6e4DsCNnI75ho9x6bWm36G6Dsd grv+nnryaKnp3Bi4THFkwrs= X-Google-Smtp-Source: AMsMyM7g3IAber1AkZaVhWDf8v66sbnzYi0hRpK71LFU68OctnyILSiTweb3Yz7CMnRNVLpZj+XCeA== X-Received: by 2002:a17:906:8469:b0:7ad:dd13:571c with SMTP id hx9-20020a170906846900b007addd13571cmr18956805ejc.141.1667480464365; Thu, 03 Nov 2022 06:01:04 -0700 (PDT) Received: from localhost.localdomain ([5.2.194.157]) by smtp.gmail.com with ESMTPSA id q12-20020a17090676cc00b00779a605c777sm451829ejn.192.2022.11.03.06.01.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 06:01:03 -0700 (PDT) From: Cosmin Tanislav Cc: Lars-Peter Clausen , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v4 01/13] iio: temperature: ltc2983: make bulk write buffer DMA-safe Date: Thu, 3 Nov 2022 15:00:29 +0200 Message-Id: <20221103130041.2153295-2-demonsingur@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103130041.2153295-1-demonsingur@gmail.com> References: <20221103130041.2153295-1-demonsingur@gmail.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Cosmin Tanislav regmap_bulk_write() does not guarantee implicit DMA-safety, even though the current implementation duplicates the given buffer. Do not rely on it. Fixes: f110f3188e56 ("iio: temperature: Add support for LTC2983") Signed-off-by: Cosmin Tanislav --- drivers/iio/temperature/ltc2983.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c index b652d2b39bcf..ca1bb5f48988 100644 --- a/drivers/iio/temperature/ltc2983.c +++ b/drivers/iio/temperature/ltc2983.c @@ -209,6 +209,7 @@ struct ltc2983_data { * Holds the converted temperature */ __be32 temp __aligned(IIO_DMA_MINALIGN); + __be32 chan_val; }; struct ltc2983_sensor { @@ -313,19 +314,18 @@ static int __ltc2983_fault_handler(const struct ltc2983_data *st, return 0; } -static int __ltc2983_chan_assign_common(const struct ltc2983_data *st, +static int __ltc2983_chan_assign_common(struct ltc2983_data *st, const struct ltc2983_sensor *sensor, u32 chan_val) { u32 reg = LTC2983_CHAN_START_ADDR(sensor->chan); - __be32 __chan_val; chan_val |= LTC2983_CHAN_TYPE(sensor->type); dev_dbg(&st->spi->dev, "Assign reg:0x%04X, val:0x%08X\n", reg, chan_val); - __chan_val = cpu_to_be32(chan_val); - return regmap_bulk_write(st->regmap, reg, &__chan_val, - sizeof(__chan_val)); + st->chan_val = cpu_to_be32(chan_val); + return regmap_bulk_write(st->regmap, reg, &st->chan_val, + sizeof(st->chan_val)); } static int __ltc2983_chan_custom_sensor_assign(struct ltc2983_data *st, From patchwork Thu Nov 3 13:00:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cosmin Tanislav X-Patchwork-Id: 13029958 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 860CEC4332F for ; Thu, 3 Nov 2022 13:01:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231584AbiKCNBM (ORCPT ); Thu, 3 Nov 2022 09:01:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231571AbiKCNBK (ORCPT ); Thu, 3 Nov 2022 09:01:10 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C00AB11C3B; Thu, 3 Nov 2022 06:01:09 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id t25so4959617ejb.8; Thu, 03 Nov 2022 06:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6jP3J9plPDooyKZLUAyrWRWPPQKz9UGS5zDe2H3qftM=; b=qO6z56/TPubFq3qhOmYFRhAs+SaRv1kQLkMq+HgDfKTh5VyAri4rsXd+CJtMZRgWRM 895YVwl4G/pMDz10OsDrSq8MTXMxYkOsz0fsnWcN9RI+PF5j0lEzOmF+CWp4tgm96Avl YM2tblBLoLz/x0N9pkLdravCF13nsKJzTof983sJXxxhWea0cwhFMjgUBlHvhN36y1UJ NVoLEFC9gumNCZMN3tcEPZYFjFhMSkJy7ZobPOiVqrD5/m9dWuUPmDTiJgi1jxMwRZZF pmPZTRyS2mJ69h49Jz7qsKvKl5liEKobx0GG8DLE62tR2WO4b6sRwGYAwWHn3uCPkMdd 3c4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6jP3J9plPDooyKZLUAyrWRWPPQKz9UGS5zDe2H3qftM=; b=npVd086G3/z8VTUwZSlxyTt/7cTjZQ9sD+ytkirE9Ra0i6Sc/ne8L/Ekg6274IbxTJ Sth4veYRIHIrKJguO5+kSKEoHag5BGpEB1UodbM/eV2/C1i9G0x8Jq2ij3IDvInX9NEF u7PjALX/roIDRC7zPhL0pX5ttM+Qkes9bJoPZyDc+JmbCgW11dsHTiIeK0atOUHOc4CN FJSj6b0fRCAak09hMHclLu+/N0lug2M8aPSlsoj6lMYfvtjACdwP0VojQbD1CBohU0XU 8LEGC7UddpYoyJywdeEbXE54G/YksQLnFWS3DZWclXGx92dVc4iczZiK6ek4+IIduun/ g6vg== X-Gm-Message-State: ACrzQf2xB6loRJrnBQ7Vnj9TFP2ihntrOoMg/Fko+yJTZNGcFwAmzlXr fee4U+WborPR1dg99Uxc+WE= X-Google-Smtp-Source: AMsMyM52gWX8ne0nbzQO6bDlX7crGGYRjfTDGI2xPAQgPqVpQxTxxAW53WyCQG8bG3xJ3F8oE3Y66A== X-Received: by 2002:a17:907:2c74:b0:7a1:d333:f214 with SMTP id ib20-20020a1709072c7400b007a1d333f214mr29597833ejc.14.1667480468352; Thu, 03 Nov 2022 06:01:08 -0700 (PDT) Received: from localhost.localdomain ([5.2.194.157]) by smtp.gmail.com with ESMTPSA id q12-20020a17090676cc00b00779a605c777sm451829ejn.192.2022.11.03.06.01.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 06:01:08 -0700 (PDT) From: Cosmin Tanislav Cc: Lars-Peter Clausen , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v4 02/13] dt-bindings: iio: temperature: ltc2983: add default values Date: Thu, 3 Nov 2022 15:00:30 +0200 Message-Id: <20221103130041.2153295-3-demonsingur@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103130041.2153295-1-demonsingur@gmail.com> References: <20221103130041.2153295-1-demonsingur@gmail.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Cosmin Tanislav Binding properties should have default values to let the reader know if they should change it. Add them based on driver logic. Signed-off-by: Cosmin Tanislav Reviewed-by: Rob Herring --- .../devicetree/bindings/iio/temperature/adi,ltc2983.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml index 722781aa4697..82667adc85b1 100644 --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml @@ -34,6 +34,7 @@ properties: cases. An extra delay can be configured using this property. The value is rounded to nearest 100us. maximum: 255 + default: 0 adi,filter-notch-freq: description: @@ -45,6 +46,7 @@ properties: $ref: /schemas/types.yaml#/definitions/uint32 minimum: 0 maximum: 2 + default: 0 '#address-cells': const: 1 @@ -104,6 +106,7 @@ patternProperties: This property set's the pulsed current value applied during open-circuit detect. enum: [10, 100, 500, 1000] + default: 10 adi,cold-junction-handle: description: @@ -163,6 +166,7 @@ patternProperties: cycles, this property will assume different predefined values on each cycle. Just set the value of the first cycle (1l). enum: [10, 20, 40, 80] + default: 10 adi,ideal-factor-value: description: @@ -170,6 +174,7 @@ patternProperties: be multiplied by 1000000 to remove the fractional part. For more information look at table 20 of the datasheet. $ref: /schemas/types.yaml#/definitions/uint32 + default: 0 "^rtd@": type: object @@ -207,6 +212,7 @@ patternProperties: property to 5 means 4 wires with Kelvin Rsense. $ref: /schemas/types.yaml#/definitions/uint32 enum: [2, 3, 4, 5] + default: 2 adi,rsense-share: description: @@ -226,6 +232,7 @@ patternProperties: This property controls the magnitude of the excitation current applied to the RTD. enum: [5, 10, 25, 50, 100, 250, 500, 1000] + default: 5 adi,rtd-curve: description: @@ -234,6 +241,7 @@ patternProperties: $ref: /schemas/types.yaml#/definitions/uint32 minimum: 0 maximum: 3 + default: 0 adi,custom-rtd: description: @@ -308,6 +316,7 @@ patternProperties: $ref: /schemas/types.yaml#/definitions/uint32 enum: [0, 250, 500, 1000, 5000, 10000, 25000, 50000, 100000, 250000, 500000, 1000000] + default: 0 adi,custom-thermistor: description: From patchwork Thu Nov 3 13:00:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cosmin Tanislav X-Patchwork-Id: 13029959 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 491DEC4332F for ; Thu, 3 Nov 2022 13:01:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231689AbiKCNB3 (ORCPT ); Thu, 3 Nov 2022 09:01:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231608AbiKCNBQ (ORCPT ); Thu, 3 Nov 2022 09:01:16 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 145E611C3B; Thu, 3 Nov 2022 06:01:15 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id kt23so4978627ejc.7; Thu, 03 Nov 2022 06:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RaTZtDR0TYFCz7i+1pOBqesyuPZfqn64Er9UEoziVtg=; b=Ezpvi8ir/iAl/l0UWjUGjFxvoDYtTYfDLrLQjPzHycAsdKbPTBMo4JtT+FqOLebh2y rconcgFXudbDyB0bmfXpp1splmpzNSVKAx3ZZ61NCEgc42D3bEVunct/w7Y1gh3/m+zV I0idt/ErkjAcxkZaqpIuRIQIRfSXpimtfvQmxDpeVV8Dg6MPR20oXd+bwnapFKbK+Ci9 K6pndCroMYZcNfiw/Dt/gPsTkgfk+HoXGscbxcAYM2I4WGOPa4RFIpvSO+BPfc/xBEyR W6QNPJ2j9bWpsgb5QIS0YulgNvHZEVIW8OwGhWAGvN5Q0WFJw5lyvQenAtszZaSsUJ7Z 96Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RaTZtDR0TYFCz7i+1pOBqesyuPZfqn64Er9UEoziVtg=; b=IDuiDQKgJlZ02Zcb3lMT0RC/50XMr3eWpRRg3AZzdUmg4doXP2JjVEpQPykVjXrCEM cTRrz0fn5wFGJD2BKHFCVEsLZsHetzfNhsQ1tgQzOW2r724fShmBq2n13bzWVGC2Rk6i w0BJlB33Ruo6WWIN8xf0OiNmkTa+PGj4ywsST33eWwJ70vcVrXs7Rd3R+kgx5g7NaMCs Xp+EEJpzFG1aF8O3/7QmCMlK1J3+YC2HJr2fiFffoRxXgjdls78f3kJeu3ERbVbm/cXQ VB5Ngy4ib3iyzY9o34+RnMR5ZOwaZbfTUPox2gtr8Jt5SGcnmt8Y6la6uNh1wkld/Y/H tmPg== X-Gm-Message-State: ACrzQf1sPq353K2EgsyFY3VfUMuyIkHqBz5xNfbyaoqbWRefwh7PbNqD 7GpGszzb7696dNIAQGpu4FM= X-Google-Smtp-Source: AMsMyM7G0RbtkISeuBtn/3YASTT52UYNxSNN2HXZ0S3fvyEXliezJISNv1KVxXiiEnkv/ZeAjuEPgw== X-Received: by 2002:a17:907:6e0d:b0:7ae:2277:9fc9 with SMTP id sd13-20020a1709076e0d00b007ae22779fc9mr1536983ejc.334.1667480471896; Thu, 03 Nov 2022 06:01:11 -0700 (PDT) Received: from localhost.localdomain ([5.2.194.157]) by smtp.gmail.com with ESMTPSA id q12-20020a17090676cc00b00779a605c777sm451829ejn.192.2022.11.03.06.01.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 06:01:11 -0700 (PDT) From: Cosmin Tanislav Cc: Lars-Peter Clausen , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v4 03/13] dt-bindings: iio: temperature: ltc2983: use hex for sensor address Date: Thu, 3 Nov 2022 15:00:31 +0200 Message-Id: <20221103130041.2153295-4-demonsingur@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103130041.2153295-1-demonsingur@gmail.com> References: <20221103130041.2153295-1-demonsingur@gmail.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Cosmin Tanislav Addresses should be in hex, fix it. Although the driver initially specified 1-20, it can be made free-range since the address is supposed to match reg, onto which we can impose restrictions based on the compatible property value. Signed-off-by: Cosmin Tanislav Acked-by: Rob Herring --- .../devicetree/bindings/iio/temperature/adi,ltc2983.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml index 82667adc85b1..29f6fa5e2529 100644 --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml @@ -55,7 +55,7 @@ properties: const: 0 patternProperties: - "@([1-9]|1[0-9]|20)$": + "@([0-9a-f]+)$": type: object properties: From patchwork Thu Nov 3 13:00:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cosmin Tanislav X-Patchwork-Id: 13029960 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 6FBEDC4332F for ; Thu, 3 Nov 2022 13:01:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231246AbiKCNBi (ORCPT ); Thu, 3 Nov 2022 09:01:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230209AbiKCNB1 (ORCPT ); Thu, 3 Nov 2022 09:01:27 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B96B51408F; Thu, 3 Nov 2022 06:01:17 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id f7so2866887edc.6; Thu, 03 Nov 2022 06:01:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W9sx36prwxLbye8vg1FZsE+HqNZsZkJYCt0cI8Qm494=; b=KTiaba50N29jX2UkZnmaka1xRvjrcNtTCGvO3h91tgkH3BhhNk0oyZ6V37fdBIqEoZ plMlJjWQGcfusNqMaPDp5x5FMjoyvADXYq1G8ibCspG4W+M26v2dD1vPqDPPz3mYRk+3 REAtdTfrM98hIwqld8A0Rk2pYA/SAqctrMOXLwLhMxC5FQg1RRndW94RAphXBoLB6azU DRrF0Et2P7Oh86ZG+609nNg5n9iVHduxTxOV4k5w7uqrniiw1G5Y653rJcJeCUDU4ILE f8E83PR8pWVoGmBcM0ZYCYzeRw1+RVx3+/tsxnIZUbp3tQL3g4dglcMjfnc+NoMvXxq0 qn1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W9sx36prwxLbye8vg1FZsE+HqNZsZkJYCt0cI8Qm494=; b=DEhXRS7in24pMvs6t2XKQSbeO+n7C295Tf2TMR1Oft62WPY8a5UBFOKc/mcOf65EsT TFSkx8dy39S+tI6bmlgqtG+5FOcJy1XnhGV3Obl8tXQcx2eY5dD/kh8me1ZyQZHvf/15 Ed61+CfDIddJph16AHfM/Ige3VzEFBmUpLChDK7Fr2FH5aL9Pucq7v3xsmP9rwVjHp6A qs3U7LFlsc3HSFS+BkOoNa/l/3zoiAScITtnnT//CmgtFPKjMAuKOtqLb7PZnznbTmDa rMx0nvUpd+erMDmqWdSfN/0B+POOty1guU7IgQpC8036DbCmo7VSuCxMTQVp/++uPOhA NzEA== X-Gm-Message-State: ACrzQf2dkVDT7h2FlRHhjJspSJXa3+peBkm225L2KJAo2I5hGs0ySuaI 8mcDBCyhd3Yjis8/Y9UDpTQ= X-Google-Smtp-Source: AMsMyM4544HZ76Tphf61ukxzTc2C9Oij+slH/HIi1GJQHThrY/UDu9jklvdIez5gXI4jvYq4dSKCqA== X-Received: by 2002:a50:ec0a:0:b0:461:c0ca:a0bc with SMTP id g10-20020a50ec0a000000b00461c0caa0bcmr30078641edr.306.1667480475556; Thu, 03 Nov 2022 06:01:15 -0700 (PDT) Received: from localhost.localdomain ([5.2.194.157]) by smtp.gmail.com with ESMTPSA id q12-20020a17090676cc00b00779a605c777sm451829ejn.192.2022.11.03.06.01.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 06:01:15 -0700 (PDT) From: Cosmin Tanislav Cc: Lars-Peter Clausen , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v4 04/13] dt-bindings: iio: temperature: ltc2983: remove qutations from phandle ref Date: Thu, 3 Nov 2022 15:00:32 +0200 Message-Id: <20221103130041.2153295-5-demonsingur@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103130041.2153295-1-demonsingur@gmail.com> References: <20221103130041.2153295-1-demonsingur@gmail.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Cosmin Tanislav Not needed, so why have them? Signed-off-by: Cosmin Tanislav Acked-by: Rob Herring --- .../devicetree/bindings/iio/temperature/adi,ltc2983.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml index 29f6fa5e2529..6b3a20448f78 100644 --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml @@ -112,7 +112,7 @@ patternProperties: description: Phandle which points to a sensor object responsible for measuring the thermocouple cold junction temperature. - $ref: "/schemas/types.yaml#/definitions/phandle" + $ref: /schemas/types.yaml#/definitions/phandle adi,custom-thermocouple: description: @@ -204,7 +204,7 @@ patternProperties: adi,rsense-handle: description: Phandle pointing to a rsense object associated with this RTD. - $ref: "/schemas/types.yaml#/definitions/phandle" + $ref: /schemas/types.yaml#/definitions/phandle adi,number-of-wires: description: @@ -288,7 +288,7 @@ patternProperties: description: Phandle pointing to a rsense object associated with this thermistor. - $ref: "/schemas/types.yaml#/definitions/phandle" + $ref: /schemas/types.yaml#/definitions/phandle adi,single-ended: description: From patchwork Thu Nov 3 13:00:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cosmin Tanislav X-Patchwork-Id: 13029964 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 AC527C4332F for ; Thu, 3 Nov 2022 13:01:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231631AbiKCNBx (ORCPT ); Thu, 3 Nov 2022 09:01:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231679AbiKCNB2 (ORCPT ); Thu, 3 Nov 2022 09:01:28 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E45901409E; Thu, 3 Nov 2022 06:01:18 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id 13so5033616ejn.3; Thu, 03 Nov 2022 06:01:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jneUenFAcWaeUzGS8zwAmnQ28hpu+G2lRJYvSOqR+rA=; b=FQoGpcoO6SNTCG7a4PT8aZFLsJq6p2rpARp1dFtrfHtREnC0ZfYFjxHX1eRT8lmjD5 02P2Nd8wKtBEcvYGHdUk/FUAtQpTcN9Y/v7MNNaJLKV0OSTVYOt27op9Xg3/empK9DX/ 5l9i/2C8c8cQRvQxp54gq2n0S8+QkPPik2DTUguCTfeiU9ZbeCWDUl5vYeQAjjl9DtrX VoVklDtBlPzQFeWmfuKhBHzXCGdqO3VBmDuSHYtPLd1Km4HLysV70o6YQU8KLGGqJ7nQ sCo721AYojF5tCdBrczQdvkRys2/1Wx3SrpXxrhGMTY2bJQqV6fU9jQA0Lk5eVqbHUhV +smA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jneUenFAcWaeUzGS8zwAmnQ28hpu+G2lRJYvSOqR+rA=; b=LAmYSHj42hqT2QQpTIAMAChKIUDHKXMxMzH2rZfvZWpyd+pRvBoM8tJsMBujNVlaBf JiWL/fNGMoccrTJOeKmvecp8ldSm4SAawyS8MfzlK0zmsdZpeAMtOG9fYYqDHFibN2ab TLLKlVeldMprgCwjknf1JFaG8vQiZeF5iQ7mvcjyWdhp6WTk3knqQccONC/ZcsdNEtO1 Kt39tarXX99kpYtdt7rP2DtjsgE/gDMacdSasqJFBCwXFJ+rm1DwDaWAbJVQ56I1X9p3 gof/jCqguC21eb30FDlFcyY4ieUgPX/+AfIPonNAIfplmZQVAAtKVTu7EmyPjg5QQbX5 Tzxg== X-Gm-Message-State: ACrzQf3P7YfXC3DeQ7OaaW89fwi99v+pqeNqP3gNeuiBUxQP+DGcmqJL 0G85GeXfO3tQ5uGKEe6tyl8= X-Google-Smtp-Source: AMsMyM7sZgPXG4IfYApBR7EtWm56vMwYw+9gZ74/U1dAieQgpn552B8x7OLbD0GgH4DDtyjmJ5ockA== X-Received: by 2002:a17:906:5a6b:b0:7ad:bc80:bffe with SMTP id my43-20020a1709065a6b00b007adbc80bffemr23790198ejc.578.1667480477442; Thu, 03 Nov 2022 06:01:17 -0700 (PDT) Received: from localhost.localdomain ([5.2.194.157]) by smtp.gmail.com with ESMTPSA id q12-20020a17090676cc00b00779a605c777sm451829ejn.192.2022.11.03.06.01.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 06:01:17 -0700 (PDT) From: Cosmin Tanislav Cc: Lars-Peter Clausen , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v4 05/13] dt-bindings: iio: temperature: ltc2983: describe matrix items Date: Thu, 3 Nov 2022 15:00:33 +0200 Message-Id: <20221103130041.2153295-6-demonsingur@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103130041.2153295-1-demonsingur@gmail.com> References: <20221103130041.2153295-1-demonsingur@gmail.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Cosmin Tanislav Give a little bit of information on what each item in the matrix is supposed to be. Also, some matrices put the 'minItems' and 'maxItems' keywords in the wrong level. They should be on the same level as the 'items' keyword. Fix it. Signed-off-by: Cosmin Tanislav Reviewed-by: Rob Herring --- .../bindings/iio/temperature/adi,ltc2983.yaml | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml index 6b3a20448f78..4f26b337c957 100644 --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml @@ -126,8 +126,9 @@ patternProperties: minItems: 3 maxItems: 64 items: - minItems: 2 - maxItems: 2 + items: + - description: Voltage point in nV, signed. + - description: Temperature point in uK. "^diode@": type: object @@ -249,12 +250,12 @@ patternProperties: resistance(ohm)-temperature(K). The entries added here are in uohm and uK. For more details values look at table 74 and 75. $ref: /schemas/types.yaml#/definitions/uint64-matrix + minItems: 3 + maxItems: 64 items: - minItems: 3 - maxItems: 64 items: - minItems: 2 - maxItems: 2 + - description: Resistance point in uOhms. + - description: Temperature point in uK. required: - adi,rsense-handle @@ -328,8 +329,9 @@ patternProperties: minItems: 3 maxItems: 64 items: - minItems: 2 - maxItems: 2 + items: + - description: Resistance point in uOhms. + - description: Temperature point in uK. adi,custom-steinhart: description: @@ -338,9 +340,8 @@ patternProperties: Steinhart sensors the coefficients are given in the raw format. Look at table 82 for more information. $ref: /schemas/types.yaml#/definitions/uint32-array - items: - minItems: 6 - maxItems: 6 + minItems: 6 + maxItems: 6 required: - adi,rsense-handle From patchwork Thu Nov 3 13:00:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cosmin Tanislav X-Patchwork-Id: 13029965 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 775EEC43219 for ; Thu, 3 Nov 2022 13:01:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231827AbiKCNBz (ORCPT ); Thu, 3 Nov 2022 09:01:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231740AbiKCNBh (ORCPT ); Thu, 3 Nov 2022 09:01:37 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5CF714D08; Thu, 3 Nov 2022 06:01:21 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id a5so2834830edb.11; Thu, 03 Nov 2022 06:01:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Zzx2/3zXVy+XSamreVFgLFmkVq8rfCdvsS38b4AXRWY=; b=X1CPalRZEolGGCg7hNs9GpAz8NcvoKOm73Glkl6rdeCTYeNycT8nGqnS4slOaXXcUP sQHQcKYJiArOGahmozpOM/uq3pjz0CracaSSKah4t6XDy6W8NzHSuGdbJ2C/ah4tezPO jfPnX8gO6pt1IKhFQA6swYZM2UQjqREJzy7/SshzvXSKP8AsR8AzGcyRNzex9pAycfGW dd5DA71qJv+QL8MBGppz3JG+qejX96opwqOIdyhyL+ngT+87YCORC3zCxtuKzLRRvm5I MYzySPiHaDehn95AGczZe0oZxouHGQUecRo6MKht7i4U7j7NnuRtA7s13fZCXUQjLhD1 aSEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Zzx2/3zXVy+XSamreVFgLFmkVq8rfCdvsS38b4AXRWY=; b=jpQZXjdSbj7vlPFMwwjx4ITUhgSMnJO/0Sjj9n/kbea4+wWwMikP7HGMHSEpzIPj0/ XKvx66hMOlCvhmxOGC6zTdDJ+xUL/E6asmOFFuxgc3cha/6ixLKh1C+Qq2TLJ+zv8xvQ PeOgoe2hSCZKaSh9hqWOovtEMuKFAQbajGXCtC6xB66Zi5QeQ2OJngjSblk/qnTxkp1U M7iEm0Eypu4xcbFITd5BXOj+DiJDcsRkv267z2aBesiHP3RqPwPQpAbyLBwatSFLbC69 af1pSPDN9VNR+pQqc5JWA/xt8uNiEh3n+e89nBtmoGUpfzr7yyrMOWjyMthmsbu1CY3+ u2dA== X-Gm-Message-State: ACrzQf3QAMC4rbHThG6z2xHOnVAw9d5moHAhEW9CzHDyEojarcBV0Tcl 5IfkEx487hFOuaNbuE2bDpI= X-Google-Smtp-Source: AMsMyM6DsMozimHmhUJyME6ejc3SLsFmDriKX9DT06PElS5EWi1V+J1RouazjREIIwXK17XrSeXo1Q== X-Received: by 2002:a05:6402:5107:b0:462:3014:3d73 with SMTP id m7-20020a056402510700b0046230143d73mr30160511edd.177.1667480480236; Thu, 03 Nov 2022 06:01:20 -0700 (PDT) Received: from localhost.localdomain ([5.2.194.157]) by smtp.gmail.com with ESMTPSA id q12-20020a17090676cc00b00779a605c777sm451829ejn.192.2022.11.03.06.01.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 06:01:20 -0700 (PDT) From: Cosmin Tanislav Cc: Lars-Peter Clausen , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v4 06/13] dt-bindings: iio: temperature: ltc2983: require custom sensor tables Date: Thu, 3 Nov 2022 15:00:34 +0200 Message-Id: <20221103130041.2153295-7-demonsingur@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103130041.2153295-1-demonsingur@gmail.com> References: <20221103130041.2153295-1-demonsingur@gmail.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Cosmin Tanislav The driver will error out when a custom sensor type is used but a custom sensor table is not provided. Require it in the binding too. Signed-off-by: Cosmin Tanislav Reviewed-by: Rob Herring --- .../bindings/iio/temperature/adi,ltc2983.yaml | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml index 4f26b337c957..bbac5f5cfbb3 100644 --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml @@ -130,6 +130,15 @@ patternProperties: - description: Voltage point in nV, signed. - description: Temperature point in uK. + allOf: + - if: + properties: + adi,sensor-type: + const: 9 + then: + required: + - adi,custom-thermocouple + "^diode@": type: object description: @@ -263,6 +272,15 @@ patternProperties: dependencies: adi,current-rotate: [ "adi,rsense-share" ] + allOf: + - if: + properties: + adi,sensor-type: + const: 18 + then: + required: + - adi,custom-rtd + "^thermistor@": type: object description: @@ -349,6 +367,22 @@ patternProperties: dependencies: adi,current-rotate: [ "adi,rsense-share" ] + allOf: + - if: + properties: + adi,sensor-type: + const: 26 + then: + required: + - adi,custom-steinhart + - if: + properties: + adi,sensor-type: + const: 27 + then: + required: + - adi,custom-thermistor + "^adc@": type: object description: Represents a channel which is being used as a direct adc. From patchwork Thu Nov 3 13:00:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cosmin Tanislav X-Patchwork-Id: 13029966 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 6450CC4332F for ; Thu, 3 Nov 2022 13:01:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231830AbiKCNB6 (ORCPT ); Thu, 3 Nov 2022 09:01:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231778AbiKCNBv (ORCPT ); Thu, 3 Nov 2022 09:01:51 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80F56140B7; Thu, 3 Nov 2022 06:01:23 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id f27so5048996eje.1; Thu, 03 Nov 2022 06:01:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Wl5YV1yuldlFg2w/72zvpuZsJu+kXHIm+tqTSmy2/d8=; b=CPONfOgiGcvco/Rskk0DdFbIZ6HfBYRnFSFdPUAnHEC+XwcCXJCsupfbw3rVgS3WNv BaS1aWtcXN6CYybLmhEOjR+zwsqQmER5EQZb4WwjGlJwUD3uKQKaU7y6raDhT5HKa12G SNyARbOgA/gLJkgyoe7Yp/poxlzsPLjmK2XlYmtmqgZ4yE8u2etgLAdQl2YEZJzJGYU8 1Bg/Eqc63Xs+Qa6K7xfCwZ8OeUZzyCLTyiUnU2J5ngw/bn/GJksblf7OAZXriwGgmagC BQWpu6cqpULKzsIISCWL1+yzx2Ou+axpQNFD6XLQsVLaw972Z/n4+eSHoT77VG2ab0Mc OQpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Wl5YV1yuldlFg2w/72zvpuZsJu+kXHIm+tqTSmy2/d8=; b=7z2TEYa7f9NCiHUioV13N2whYO057UsoNHppPkXESXVX6yrUEfceIh/0a0iYcFRT6H TPVa/ijNLSZK9Qo+BOKVQs0AwFHTfze7Wvmr6BfcwPgAVrggDhs8ryAJKUFHswvho4TA IQQ1VrGI0gC4Rt6ungR08jDufrwBFuuOYsKKeZ7BIrxHUJPHfc0wDJqGUrHxYJfkwuzW 2HVqVr669iYO8KBHt+jWbZWDWYsvgazatOtz1ysEbAJAj9V9KGYeG1rJpXg0aY8Uzn+A f/4UIzy9EokN79qAt9BjcSYjjNaYFIcTsNh0eW3zssFjyLika1IvCOdbqD/vxnWZG9ln NNng== X-Gm-Message-State: ACrzQf2rhuM55+O+fDFVLSOcTBVc2Wf4oS/NwDi9sL8ou7AdVNxaEoxS 5GKFxCzhJcC9e2W88YW9gCQ= X-Google-Smtp-Source: AMsMyM7gPXzJcckBUMqFFsZth/J4/WP/0PALvoZxooUDuYJmORo94PSzkWl3TrmVl08Shg3SeMiOHg== X-Received: by 2002:a17:907:7617:b0:7ad:c0d5:bdf1 with SMTP id jx23-20020a170907761700b007adc0d5bdf1mr23207559ejc.211.1667480481889; Thu, 03 Nov 2022 06:01:21 -0700 (PDT) Received: from localhost.localdomain ([5.2.194.157]) by smtp.gmail.com with ESMTPSA id q12-20020a17090676cc00b00779a605c777sm451829ejn.192.2022.11.03.06.01.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 06:01:21 -0700 (PDT) From: Cosmin Tanislav Cc: Lars-Peter Clausen , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v4 07/13] dt-bindings: iio: temperature: ltc2983: require 4 wire rtd for current rotate Date: Thu, 3 Nov 2022 15:00:35 +0200 Message-Id: <20221103130041.2153295-8-demonsingur@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103130041.2153295-1-demonsingur@gmail.com> References: <20221103130041.2153295-1-demonsingur@gmail.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Cosmin Tanislav The driver will error out when current rotation is enabled but the RTD is not 4-wire. Require it in the binding too. Signed-off-by: Cosmin Tanislav Reviewed-by: Rob Herring --- .../bindings/iio/temperature/adi,ltc2983.yaml | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml index bbac5f5cfbb3..b603219fb0c9 100644 --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml @@ -230,13 +230,6 @@ patternProperties: resistor is used for multiple 2-, 3-, and/or 4-wire RTDs. type: boolean - adi,current-rotate: - description: - Boolean property which enables excitation current rotation to - automatically remove parasitic thermocouple effects. Note that - this property is not allowed for 2- and 3-wire RTDs. - type: boolean - adi,excitation-current-microamp: description: This property controls the magnitude of the excitation current @@ -269,10 +262,22 @@ patternProperties: required: - adi,rsense-handle - dependencies: - adi,current-rotate: [ "adi,rsense-share" ] - allOf: + - if: + properties: + adi,number-of-wires: + const: 4 + then: + properties: + adi,current-rotate: + description: + Whether to enable excitation current rotation to automatically + remove parasitic thermocouple effects. + type: boolean + + dependencies: + adi,current-rotate: [ "adi,rsense-share" ] + - if: properties: adi,sensor-type: From patchwork Thu Nov 3 13:00:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cosmin Tanislav X-Patchwork-Id: 13029967 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 09738C433FE for ; Thu, 3 Nov 2022 13:02:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231673AbiKCNCQ (ORCPT ); Thu, 3 Nov 2022 09:02:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231664AbiKCNBx (ORCPT ); Thu, 3 Nov 2022 09:01:53 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5276D1573C; Thu, 3 Nov 2022 06:01:27 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id a13so2948604edj.0; Thu, 03 Nov 2022 06:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=04P2tRolwIvSbGhfQHq/FrE12nmgNU3RtNHs+uPtM2g=; b=dnHmCO97bGIC+Jyy8IQWvR4BsWXIVI7TyKHdjynNho/G131BVkZyxhiXxiUXhtg6qZ WlWB+5jSWuYufmxwacrxsXL8AV0st9h0CPq4juKwfK4dZi0vuYNaJcMt7hGCTdLoxJzK TaRP+Zc2sMXdW4jEp7urqTPOTIIZ9v+romaTT9dJQSW92ek+9dWp5fUNIb00yW7kjLAd pjgBXIrAgtCDrHm7Ay8ug+e189LJgyIqCnm95ZRFEHMIYmk+YXYJHV8YI4oWBA0A2EKl RemBWGE/x0AUa7GvXgrydHuR0W3skmdDOGSY17J6xrFz7yX1g3SzR+lfoqLI7Dm6suRw kgSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=04P2tRolwIvSbGhfQHq/FrE12nmgNU3RtNHs+uPtM2g=; b=ouHCspE9eXU3xGhibx64XAp3myQwHddVeamIyefz5YFvFPqvejYCFffSHEtUkUm8zb EpYYvUCUiXwHuXukEa9bVsaXuvBqFQMYK//qUgxnd2khzPQ7bYr/CGlQ8tAFxwgRJX+3 wREAmRp1RX+tW/jAA+gddgNSj0xGvDGKyIPX7chfCz12C6l+iwcR8GdKJItCNrPAqVbu Z84xpVRxV1v7/wX7bYKhCjumn247BgV90C186g0qxCG5Gx7olVBfF0WLlFcfWUT8Zyfs W2JBtFIr17NRudbsgNRvNF3TxlidVvmqIKK/yZTwCPtXxFDYhjfXhZb3jmwYSZotwWJW HszQ== X-Gm-Message-State: ACrzQf17CO7NvlJ9tbjXTqqwOnyd5OgEu7r4G4GZlUyERPFmbrO6nFe0 tIpPk41xmfuhhGpJP9nhE2g= X-Google-Smtp-Source: AMsMyM6p8HJee76lS+w8VExqd223CIGj17t8m0B1NxMkBiW+5H7HtValuPZRh2P23VIrm2VWOb4Mag== X-Received: by 2002:a05:6402:2994:b0:453:4c5c:d31c with SMTP id eq20-20020a056402299400b004534c5cd31cmr29918522edb.412.1667480485718; Thu, 03 Nov 2022 06:01:25 -0700 (PDT) Received: from localhost.localdomain ([5.2.194.157]) by smtp.gmail.com with ESMTPSA id q12-20020a17090676cc00b00779a605c777sm451829ejn.192.2022.11.03.06.01.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 06:01:25 -0700 (PDT) From: Cosmin Tanislav Cc: Lars-Peter Clausen , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v4 08/13] dt-bindings: iio: temperature: ltc2983: change default excitation for custom thermistors Date: Thu, 3 Nov 2022 15:00:36 +0200 Message-Id: <20221103130041.2153295-9-demonsingur@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103130041.2153295-1-demonsingur@gmail.com> References: <20221103130041.2153295-1-demonsingur@gmail.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Cosmin Tanislav Excitation cannot be set to auto-range when using a custom thermistor or Steinhart sensor type. Default it to 1000nA to match the driver and remove the auto-range value from the enum. Signed-off-by: Cosmin Tanislav Reviewed-by: Rob Herring --- .../bindings/iio/temperature/adi,ltc2983.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml index b603219fb0c9..1b6a11f2aa9d 100644 --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml @@ -378,6 +378,11 @@ patternProperties: adi,sensor-type: const: 26 then: + properties: + adi,excitation-current-nanoamp: + enum: [250, 500, 1000, 5000, 10000, 25000, 50000, 100000, + 250000, 500000, 1000000] + default: 1000 required: - adi,custom-steinhart - if: @@ -385,6 +390,11 @@ patternProperties: adi,sensor-type: const: 27 then: + properties: + adi,excitation-current-nanoamp: + enum: [250, 500, 1000, 5000, 10000, 25000, 50000, 100000, + 250000, 500000, 1000000] + default: 1000 required: - adi,custom-thermistor From patchwork Thu Nov 3 13:00:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cosmin Tanislav X-Patchwork-Id: 13029968 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 854DFC433FE for ; Thu, 3 Nov 2022 13:02:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231638AbiKCNCT (ORCPT ); Thu, 3 Nov 2022 09:02:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231725AbiKCNBy (ORCPT ); Thu, 3 Nov 2022 09:01:54 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBF0715806; Thu, 3 Nov 2022 06:01:28 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id 13so5035228ejn.3; Thu, 03 Nov 2022 06:01:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Aii7ZeFVsJKah3Sp1J2uui+q3nkwmdgQ+YvTSehqSzc=; b=foSOXFNXe0tDxIeWovWmnUYJyzccoRGAA3m643QrB01+h4F8gX1WqP8C9LGHIHtuQU A33s36L2tdxo15u474lNxpo/+i4G5/QXlv/3ugUKSF9vRJvlgpMRW2Z0s9gET5emClnM qeqomrOJNMT3VPUFsjd1y+UTxuWgN742JJj6zhgSqLNrzDX9oLe9+6XL94FlDCse8WL2 XIeMj4uvhKYS28RUh5Pckqh/M3IwYYQey0GZkmiDNvGDsRi0cUGDaKgp9xGlH4rYoHaZ OXBvVyGF+WzvqAjyRD56hKEloJlcLSZIKFP8ynTPuTWI3YmcFLgUNZ7hEZ8Z0spJ8VDj LziA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Aii7ZeFVsJKah3Sp1J2uui+q3nkwmdgQ+YvTSehqSzc=; b=JWl4k76aFcRo3nL8T3ECySmp44Ns4GN2AmS7XgUb08c4hpx6OhcPa7e8PhbzYHDwHf Y+kx5N5qM/JoH/8rK7X7RMJhb8efCdSBtOk7V+g48o1DhwAFkxuPkD2LLPJgbaug6FYo YEXKzJB8jzxpebi+imT2dslyn+2oo8jEqe6E7h+7lkj02Ynlf9pWM12WIhpLEBvqY0og PlAXnN2InmJOot8eKx9SU3dpa/u/QUPR0WnGHgicmvvTEn3+s1VeUP/pMyBHg78anhYl xQKloAF+E4K76P6EChO7f0SZcTRhSERYGG+KUR44cC9cBpPGxLDKXKc6pJ8/OTdzVtBA 3xSA== X-Gm-Message-State: ACrzQf1+qyaEqvddfOQ2WecM6GyS88v1vl5ORGpR7AvU1OrRYmRTkC52 6erOGGwVzYRlm7lh6/yNB5c= X-Google-Smtp-Source: AMsMyM6KXL/vxgfv18y021zmoX6eg+glIvwxyIYLQ1YnlPcf6BEouAvee3bSf8Pl8HqKXjK/MB1h6A== X-Received: by 2002:a17:907:aa1:b0:7ad:b286:fa25 with SMTP id bz1-20020a1709070aa100b007adb286fa25mr28460756ejc.106.1667480488148; Thu, 03 Nov 2022 06:01:28 -0700 (PDT) Received: from localhost.localdomain ([5.2.194.157]) by smtp.gmail.com with ESMTPSA id q12-20020a17090676cc00b00779a605c777sm451829ejn.192.2022.11.03.06.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 06:01:27 -0700 (PDT) From: Cosmin Tanislav Cc: Lars-Peter Clausen , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v4 09/13] dt-bindings: iio: temperature: ltc2983: refine descriptions Date: Thu, 3 Nov 2022 15:00:37 +0200 Message-Id: <20221103130041.2153295-10-demonsingur@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103130041.2153295-1-demonsingur@gmail.com> References: <20221103130041.2153295-1-demonsingur@gmail.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Cosmin Tanislav Some descriptions are too verbose, while others are too succint. Rewrite them all. Signed-off-by: Cosmin Tanislav Reviewed-by: Rob Herring --- .../bindings/iio/temperature/adi,ltc2983.yaml | 163 +++++++----------- 1 file changed, 65 insertions(+), 98 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml index 1b6a11f2aa9d..676801b036cf 100644 --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml @@ -25,21 +25,16 @@ properties: maxItems: 1 adi,mux-delay-config-us: - description: - The LTC2983 performs 2 or 3 internal conversion cycles per temperature - result. Each conversion cycle is performed with different excitation and - input multiplexer configurations. Prior to each conversion, these - excitation circuits and input switch configurations are changed and an - internal 1ms delay ensures settling prior to the conversion cycle in most - cases. An extra delay can be configured using this property. The value is - rounded to nearest 100us. + description: | + Extra delay prior to each conversion, in addition to the internal 1ms + delay, for the multiplexer to switch input configurations and + excitation values. maximum: 255 default: 0 adi,filter-notch-freq: description: - Set's the default setting of the digital filter. The default is - simultaneous 50/60Hz rejection. + Notch frequency of the digital filter. 0 - 50/60Hz rejection 1 - 60Hz rejection 2 - 50Hz rejection @@ -57,17 +52,18 @@ properties: patternProperties: "@([0-9a-f]+)$": type: object + description: Sensor. properties: reg: description: - The channel number. It can be connected to one of the 20 channels of - the device. + Channel number. Connects the sensor to the channel with this number + of the device. minimum: 1 maximum: 20 adi,sensor-type: - description: Identifies the type of sensor connected to the device. + description: Type of sensor connected to the device. $ref: /schemas/types.yaml#/definitions/uint32 required: @@ -76,9 +72,7 @@ patternProperties: "^thermocouple@": type: object - description: - Represents a thermocouple sensor which is connected to one of the device - channels. + description: Thermocouple sensor. properties: adi,sensor-type: @@ -97,31 +91,24 @@ patternProperties: maximum: 9 adi,single-ended: - description: - Boolean property which set's the thermocouple as single-ended. + description: Whether the sensor is single-ended. type: boolean adi,sensor-oc-current-microamp: - description: - This property set's the pulsed current value applied during - open-circuit detect. + description: Pulsed current value applied during open-circuit detect. enum: [10, 100, 500, 1000] default: 10 adi,cold-junction-handle: description: - Phandle which points to a sensor object responsible for measuring - the thermocouple cold junction temperature. + Sensor responsible for measuring the thermocouple cold junction + temperature. $ref: /schemas/types.yaml#/definitions/phandle adi,custom-thermocouple: description: - This is a table, where each entry should be a pair of - voltage(mv)-temperature(K). The entries must be given in nv and uK - so that, the original values must be multiplied by 1000000. For - more details look at table 69 and 70. - Note should be signed, but dtc doesn't currently maintain the - sign. + Used for digitizing custom thermocouples. + See Page 59 of the datasheet. $ref: /schemas/types.yaml#/definitions/uint64-matrix minItems: 3 maxItems: 64 @@ -141,55 +128,50 @@ patternProperties: "^diode@": type: object - description: - Represents a diode sensor which is connected to one of the device - channels. + description: Diode sensor. properties: adi,sensor-type: - description: Identifies the sensor as a diode. + description: Sensor type for diodes. $ref: /schemas/types.yaml#/definitions/uint32 const: 28 adi,single-ended: - description: Boolean property which set's the diode as single-ended. + description: Whether the sensor is single-ended. type: boolean adi,three-conversion-cycles: description: - Boolean property which set's three conversion cycles removing - parasitic resistance effects between the LTC2983 and the diode. + Whether to use three conversion cycles to remove parasitic + resistance between the device and the diode. type: boolean adi,average-on: description: - Boolean property which enables a running average of the diode - temperature reading. This reduces the noise when the diode is used - as a cold junction temperature element on an isothermal block - where temperatures change slowly. + Whether to use a running average of the diode temperature + reading to reduce the noise when the diode is used as a cold + junction temperature element on an isothermal block where + temperatures change slowly. type: boolean adi,excitation-current-microamp: description: - This property controls the magnitude of the excitation current - applied to the diode. Depending on the number of conversions - cycles, this property will assume different predefined values on - each cycle. Just set the value of the first cycle (1l). + Magnitude of the 1l excitation current applied to the diode. + 4l excitation current will be 4 times this value, and 8l + excitation current will be 8 times value. enum: [10, 20, 40, 80] default: 10 adi,ideal-factor-value: description: - This property sets the diode ideality factor. The real value must - be multiplied by 1000000 to remove the fractional part. For more - information look at table 20 of the datasheet. + Diode ideality factor. + Set this property to 1000000 times the real value. $ref: /schemas/types.yaml#/definitions/uint32 default: 0 "^rtd@": type: object - description: - Represents a rtd sensor which is connected to one of the device channels. + description: RTD sensor. properties: reg: @@ -212,35 +194,35 @@ patternProperties: maximum: 18 adi,rsense-handle: - description: - Phandle pointing to a rsense object associated with this RTD. + description: Associated sense resistor sensor. $ref: /schemas/types.yaml#/definitions/phandle adi,number-of-wires: description: - Identifies the number of wires used by the RTD. Setting this - property to 5 means 4 wires with Kelvin Rsense. + Number of wires used by the RTD. + 5 means 4 wires with Kelvin sense resistor. $ref: /schemas/types.yaml#/definitions/uint32 enum: [2, 3, 4, 5] default: 2 adi,rsense-share: description: - Boolean property which enables Rsense sharing, where one sense - resistor is used for multiple 2-, 3-, and/or 4-wire RTDs. + Whether to enable sense resistor sharing, where one sense + resistor is used by multiple sensors. type: boolean adi,excitation-current-microamp: - description: - This property controls the magnitude of the excitation current - applied to the RTD. + description: Excitation current applied to the RTD. enum: [5, 10, 25, 50, 100, 250, 500, 1000] default: 5 adi,rtd-curve: - description: - This property set the RTD curve used and the corresponding - Callendar-VanDusen constants. Look at table 30 of the datasheet. + description: | + RTD curve and the corresponding Callendar-VanDusen constants. + 0 - European + 1 - American + 2 - Japanese + 3 - ITS-90 $ref: /schemas/types.yaml#/definitions/uint32 minimum: 0 maximum: 3 @@ -248,9 +230,8 @@ patternProperties: adi,custom-rtd: description: - This is a table, where each entry should be a pair of - resistance(ohm)-temperature(K). The entries added here are in uohm - and uK. For more details values look at table 74 and 75. + Used for digitizing custom RTDs. + See Page 62 of the datasheet. $ref: /schemas/types.yaml#/definitions/uint64-matrix minItems: 3 maxItems: 64 @@ -288,9 +269,7 @@ patternProperties: "^thermistor@": type: object - description: - Represents a thermistor sensor which is connected to one of the device - channels. + description: Thermistor sensor. properties: adi,sensor-type: @@ -309,34 +288,29 @@ patternProperties: maximum: 27 adi,rsense-handle: - description: - Phandle pointing to a rsense object associated with this - thermistor. + description: Associated sense resistor sensor. $ref: /schemas/types.yaml#/definitions/phandle adi,single-ended: - description: - Boolean property which set's the thermistor as single-ended. + description: Whether the sensor is single-ended. type: boolean adi,rsense-share: description: - Boolean property which enables Rsense sharing, where one sense - resistor is used for multiple thermistors. Note that this property - is ignored if adi,single-ended is set. + Whether to enable sense resistor sharing, where one sense + resistor is used by multiple sensors. type: boolean adi,current-rotate: description: - Boolean property which enables excitation current rotation to - automatically remove parasitic thermocouple effects. + Whether to enable excitation current rotation to automatically + remove parasitic thermocouple effects. type: boolean adi,excitation-current-nanoamp: description: - This property controls the magnitude of the excitation current - applied to the thermistor. Value 0 set's the sensor in auto-range - mode. + Excitation current applied to the thermistor. + 0 sets the sensor in auto-range mode. $ref: /schemas/types.yaml#/definitions/uint32 enum: [0, 250, 500, 1000, 5000, 10000, 25000, 50000, 100000, 250000, 500000, 1000000] @@ -344,10 +318,8 @@ patternProperties: adi,custom-thermistor: description: - This is a table, where each entry should be a pair of - resistance(ohm)-temperature(K). The entries added here are in uohm - and uK only for custom thermistors. For more details look at table - 78 and 79. + Used for digitizing custom thermistors. + See Page 65 of the datasheet. $ref: /schemas/types.yaml#/definitions/uint64-matrix minItems: 3 maxItems: 64 @@ -358,10 +330,9 @@ patternProperties: adi,custom-steinhart: description: - Steinhart-Hart coefficients are also supported and can - be programmed into the device memory using this property. For - Steinhart sensors the coefficients are given in the raw - format. Look at table 82 for more information. + Steinhart-Hart coefficients in raw format, used for digitizing + custom thermistors. + See Page 68 of the datasheet. $ref: /schemas/types.yaml#/definitions/uint32-array minItems: 6 maxItems: 6 @@ -400,23 +371,21 @@ patternProperties: "^adc@": type: object - description: Represents a channel which is being used as a direct adc. + description: Direct ADC sensor. properties: adi,sensor-type: - description: Identifies the sensor as a direct adc. + description: Sensor type for direct ADC sensors. $ref: /schemas/types.yaml#/definitions/uint32 const: 30 adi,single-ended: - description: Boolean property which set's the adc as single-ended. + description: Whether the sensor is single-ended. type: boolean "^rsense@": type: object - description: - Represents a rsense which is connected to one of the device channels. - Rsense are used by thermistors and RTD's. + description: Sense resistor sensor. properties: reg: @@ -424,14 +393,12 @@ patternProperties: maximum: 20 adi,sensor-type: - description: Identifies the sensor as a rsense. + description: Sensor type sense resistor sensors. $ref: /schemas/types.yaml#/definitions/uint32 const: 29 adi,rsense-val-milli-ohms: - description: - Sets the value of the sense resistor. Look at table 20 of the - datasheet for information. + description: Value of the sense resistor. required: - adi,rsense-val-milli-ohms From patchwork Thu Nov 3 13:00:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cosmin Tanislav X-Patchwork-Id: 13029969 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 EB697C4321E for ; Thu, 3 Nov 2022 13:02:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231869AbiKCNCW (ORCPT ); Thu, 3 Nov 2022 09:02:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231825AbiKCNBz (ORCPT ); Thu, 3 Nov 2022 09:01:55 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C9D8165B9; Thu, 3 Nov 2022 06:01:32 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id n12so4929301eja.11; Thu, 03 Nov 2022 06:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TUBAY9RkKGfldJzKkUPMH+SpSXldSNu9mGfTJqOMhzI=; b=HM+HRemRtj8TCpc5AYAzgpc3h1lY5Okl9tDXClUzQIGUDpIWJh+40NxIw13C/icSOy VGF6he2ELBdMytqEQTqxlH0KDUrbGUUI2YhlS+HTLJV37LJmXZcyi0E0lzrEVZ7DyJ22 6UevGqiXn98Kec8O7E996LD2s1wMmPKl+YegFnlxLJwPpU+AVaYHHETDZat5I2hd+THr u/LP8tWIFVowUAPlEKHEId6LypVexoIUVlpNSyTJryS68v3VeVomijWkPjcZcTU3DFWw zCnKa7b3ZN+Bf1ai8qFG4h5T7Sb2/USVFucecd4G76QciMeymNOxMJ0anQPIGS9olPdC R9uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TUBAY9RkKGfldJzKkUPMH+SpSXldSNu9mGfTJqOMhzI=; b=F8y0hKFe6eMg6RJ1EX8wpP2vS3WPUHy0I1vtcIWxW0DJx3QvbEoGBV5IvU1kJU7nXE nk+8VQ2p1296ad+NA/53wsk3f8RIC85nJBxmxRYQ5tfiqFiZY8lKYeaUq7KlVpFyIYf6 MxHreIOWBcnVN3YI+Ta+LaaUox/06q5OGpYwtommBsb87Nr84BJPDWqKuCYtEUofjv92 B8I7peixytK9hRSZXa79yeAB1fRbDLseKsCypK+bUER5XQEhqSUj0dnVPfe+lGjOPOZp a7snWUzZA06dDJlPqpXW3c88/9/jjaUVGMwNbDUELFtAqyvxDYSbTQjUWJrBjPp+syZW F7Xg== X-Gm-Message-State: ACrzQf0YUSySTJsmnk66Ze9WGMLSZDPdlhIeyzfZdpB2oGmPxXXUr7+h rCcTxGR/pt+jJ8Kfk8SGkZ8= X-Google-Smtp-Source: AMsMyM6tnZSsywLu2mBZdD3detCeb9zm853u0hF8RP5rwYXHbl8dGx/FNg381+YbN3ghDfOtKa2f+Q== X-Received: by 2002:a17:907:720b:b0:78e:c0e:a434 with SMTP id dr11-20020a170907720b00b0078e0c0ea434mr29407004ejc.741.1667480490539; Thu, 03 Nov 2022 06:01:30 -0700 (PDT) Received: from localhost.localdomain ([5.2.194.157]) by smtp.gmail.com with ESMTPSA id q12-20020a17090676cc00b00779a605c777sm451829ejn.192.2022.11.03.06.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 06:01:30 -0700 (PDT) From: Cosmin Tanislav Cc: Lars-Peter Clausen , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v4 10/13] dt-bindings: iio: temperature: ltc2983: describe broken mux delay property Date: Thu, 3 Nov 2022 15:00:38 +0200 Message-Id: <20221103130041.2153295-11-demonsingur@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103130041.2153295-1-demonsingur@gmail.com> References: <20221103130041.2153295-1-demonsingur@gmail.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Cosmin Tanislav The 'adi,mux-delay-config-us' property is broken. It was supposed to be in us, but the value is actually written directly to the register. Describe the fact that it is broken and how it actually works. Signed-off-by: Cosmin Tanislav Reviewed-by: Rob Herring --- .../devicetree/bindings/iio/temperature/adi,ltc2983.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml index 676801b036cf..467e165e9b0b 100644 --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml @@ -29,6 +29,9 @@ properties: Extra delay prior to each conversion, in addition to the internal 1ms delay, for the multiplexer to switch input configurations and excitation values. + + This property is supposed to be in microseconds, but to maintain + compatibility, this value will be multiplied by 100 before usage. maximum: 255 default: 0 From patchwork Thu Nov 3 13:00:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cosmin Tanislav X-Patchwork-Id: 13029970 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 89851C4321E for ; Thu, 3 Nov 2022 13:02:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231828AbiKCNC0 (ORCPT ); Thu, 3 Nov 2022 09:02:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231841AbiKCNB6 (ORCPT ); Thu, 3 Nov 2022 09:01:58 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 925281740D; Thu, 3 Nov 2022 06:01:35 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id u24so2820997edd.13; Thu, 03 Nov 2022 06:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vijEGVxtJuuSzGLY9yn/4Hcsl6Bo59fqju4xVlM6UoM=; b=X4WtkQQbvCyXAbepVUilqzUNnrMIKg8ualCt8xz9J/6oe5WuAzw67cZ+ELtLXiiNrs wrLJBqHxRuvFGQSYAjloChLjFtebdoPZ6d84hOadIC/apJpYNIk5dkBqcSc50AZuBlnn z3oYEMB4gGHOmREbOWGcfpghwdMtdKhmZbhd3EkUnx9fJvZtqrYlUL5It71n/nS+fMDO d7Di1j3reDirFsfBPRJKRkwDWlJQdzl/VcPfRAlNtblO8XiLGGHAgFp8KoN73YzAzKiC 59rPPYqB7AR2noEG1sdN7CvUDajk2m7ONtcx2WV9EvWKkTg76KXQ/ltZ6JXUSjLxV0TY NPnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vijEGVxtJuuSzGLY9yn/4Hcsl6Bo59fqju4xVlM6UoM=; b=Y+wgus8U6M9wzc10nqG8dwUPbITbyk+A71NUPXwmGraTrOG7IhWLmQGeJeddGhSg3a tgKvkpD2HiSDh4Ucu+Ki4GhuZYGPM1rzo2jhV47IyflR8sT6KhvqE5MaqzMK/Azkh7sB 3H3aQdEsSqmpGh+iHK9f7AQTwSUMglB+/V7nXVFUETHN6saOX87vkD2YUHaUMf08ArYr w/uA7fJsjJzxpf9XGPazb1MHT2dC228y3xm6TclRVuFEjiNBUZSleETBtxyqkY9rWIXb jU4z+tYkK3BzwLL+BUENqHFgLfWTfGobQdyffC2se9cuhN6fCJbbxJQhv3Ksshwyhg2U /lZg== X-Gm-Message-State: ACrzQf1ME3Z6w05Z7ZJHUvUFIJaLt/g0qBDuSXEssQUXquVeYjA500pd GPgw3vE5H/Qsk5V1JqJaSdnHzfS16rsHhA== X-Google-Smtp-Source: AMsMyM7riczyqaNPV3bfZqHqRj3FIzx4oHsOXwBUWZ5CWfTladmDf5xTU1k74lRrgl8jSKiqDS+OZA== X-Received: by 2002:a05:6402:2947:b0:451:32a:2222 with SMTP id ed7-20020a056402294700b00451032a2222mr29167999edb.376.1667480494116; Thu, 03 Nov 2022 06:01:34 -0700 (PDT) Received: from localhost.localdomain ([5.2.194.157]) by smtp.gmail.com with ESMTPSA id q12-20020a17090676cc00b00779a605c777sm451829ejn.192.2022.11.03.06.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 06:01:33 -0700 (PDT) From: Cosmin Tanislav Cc: Lars-Peter Clausen , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v4 11/13] dt-bindings: iio: temperature: ltc2983: use generic node name in example Date: Thu, 3 Nov 2022 15:00:39 +0200 Message-Id: <20221103130041.2153295-12-demonsingur@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103130041.2153295-1-demonsingur@gmail.com> References: <20221103130041.2153295-1-demonsingur@gmail.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Cosmin Tanislav Examples should use the generic IIO node name. Fix it. Signed-off-by: Cosmin Tanislav --- .../devicetree/bindings/iio/temperature/adi,ltc2983.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml index 467e165e9b0b..bd357ff28e65 100644 --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml @@ -420,7 +420,7 @@ examples: #address-cells = <1>; #size-cells = <0>; - sensor_ltc2983: ltc2983@0 { + temp@0 { compatible = "adi,ltc2983"; reg = <0>; From patchwork Thu Nov 3 13:00:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cosmin Tanislav X-Patchwork-Id: 13029971 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 E05DEC4332F for ; Thu, 3 Nov 2022 13:02:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231691AbiKCNCp (ORCPT ); Thu, 3 Nov 2022 09:02:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231778AbiKCNCH (ORCPT ); Thu, 3 Nov 2022 09:02:07 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BE79140B3; Thu, 3 Nov 2022 06:01:39 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id y69so2870761ede.5; Thu, 03 Nov 2022 06:01:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PZWrkx//J0EsJcOiPtQ2AzCqMEINB9X17hPf/F/cMpo=; b=qqI83zYHLBlYxE6D3VsxMCkiYu4kqRLp5lrdMH2UNv85xZbjcVE3jb3tvfPnLH9+QT WA3jox4ILcz2Mgzd4F7UdwKE7oHK219VgnA0/IRn2hbxtdf73UIYdQ1om7iUBJCzPoXy SX/+z4hVjd3ub6AQXv4D3BJZYsZL0uR92Waw49MdRzNxJXj0B+VPUx81cpVXgXoToHvx AOwFqW9NiUi0t7aQ3d9QR50sAN6/jMVvYDOqJ/qVd9NNU6D97yeAj1r27meQGqMews72 6N6U+lvg8oHY/mpw662HtyzXT1POJoA6zWMpE8VAPj7/APyuw+JkvVDVRto0GpQJh9Ii O+uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PZWrkx//J0EsJcOiPtQ2AzCqMEINB9X17hPf/F/cMpo=; b=AMDIFQ3rZ+6ZRTvkQ9aYPFlV7TwLtNFCeFDVj/Y6BW7Q20Fn7MhyT4UMoBsCn4d/ce cbBI1Fw1Hr4piFko8yXfD3uc8SbNga239LFiicGUmeMzQv5zvL8TZYCosS7loWWvhz5D VJClEAoPWIkyOe7TR/TWxl7S6zS426h2nfzglF7kvCCoFnCZ9kgDpuo9KgzPvOlDmfLQ R27codKUvChvgi/cLNp6zl8y4tWLBOr2MGLtsugNQRqFTruzk4Ui2y37kSiHor1NHlDh 2mfM2tA+ym5pUQ2uBDyBCOn4pyAhKf9N8Y1jM8bfKMusskumUzviKfOluCiFEh/SV5Dl stAA== X-Gm-Message-State: ACrzQf3Tc9V73+YUXW3krncXQq+eztcKjWBaH2tbThbRD/pv8mo5W4Jl Pen5cU35D6TPZIdnmEG/g9o= X-Google-Smtp-Source: AMsMyM6m6YVsfZa6PSWykA5X/tB7/u42jhsxSh0gNWTLK+s6BEjsWwxY8qdWV+BdG07uuadScN5EuA== X-Received: by 2002:aa7:cc13:0:b0:453:52dc:1bbf with SMTP id q19-20020aa7cc13000000b0045352dc1bbfmr30403160edt.30.1667480497446; Thu, 03 Nov 2022 06:01:37 -0700 (PDT) Received: from localhost.localdomain ([5.2.194.157]) by smtp.gmail.com with ESMTPSA id q12-20020a17090676cc00b00779a605c777sm451829ejn.192.2022.11.03.06.01.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 06:01:37 -0700 (PDT) From: Cosmin Tanislav Cc: Lars-Peter Clausen , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav , Rob Herring Subject: [PATCH v4 12/13] dt-bindings: iio: temperature: ltc2983: support more parts Date: Thu, 3 Nov 2022 15:00:40 +0200 Message-Id: <20221103130041.2153295-13-demonsingur@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103130041.2153295-1-demonsingur@gmail.com> References: <20221103130041.2153295-1-demonsingur@gmail.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Cosmin Tanislav Add support for the following parts: * LTC2984 * LTC2986 * LTM2985 The LTC2984 is a variant of the LTC2983 with EEPROM. The LTC2986 is a variant of the LTC2983 with only 10 channels, EEPROM and support for active analog temperature sensors. The LTM2985 is software-compatible with the LTC2986. Signed-off-by: Cosmin Tanislav Reviewed-by: Rob Herring --- .../bindings/iio/temperature/adi,ltc2983.yaml | 60 +++++++++++++++++-- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml index bd357ff28e65..ccab94b20b24 100644 --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml @@ -4,19 +4,30 @@ $id: http://devicetree.org/schemas/iio/temperature/adi,ltc2983.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Analog Devices LTC2983 Multi-sensor Temperature system +title: Analog Devices LTC2983, LTC2986, LTM2985 Multi-sensor Temperature system maintainers: - Nuno Sá description: | - Analog Devices LTC2983 Multi-Sensor Digital Temperature Measurement System + Analog Devices LTC2983, LTC2984, LTC2986, LTM2985 Multi-Sensor Digital + Temperature Measurement Systems + https://www.analog.com/media/en/technical-documentation/data-sheets/2983fc.pdf + https://www.analog.com/media/en/technical-documentation/data-sheets/2984fb.pdf + https://www.analog.com/media/en/technical-documentation/data-sheets/29861fa.pdf + https://www.analog.com/media/en/technical-documentation/data-sheets/ltm2985.pdf properties: compatible: - enum: - - adi,ltc2983 + oneOf: + - enum: + - adi,ltc2983 + - adi,ltc2986 + - adi,ltm2985 + - items: + - const: adi,ltc2984 + - const: adi,ltc2983 reg: maxItems: 1 @@ -386,6 +397,35 @@ patternProperties: description: Whether the sensor is single-ended. type: boolean + "^temp@": + type: object + description: Active analog temperature sensor. + + properties: + adi,sensor-type: + description: Sensor type for active analog temperature sensors. + $ref: /schemas/types.yaml#/definitions/uint32 + const: 31 + + adi,single-ended: + description: Whether the sensor is single-ended. + type: boolean + + adi,custom-temp: + description: + Used for digitizing active analog temperature sensors. + See Page 67 of the LTM2985 datasheet. + $ref: /schemas/types.yaml#/definitions/uint64-matrix + minItems: 3 + maxItems: 64 + items: + items: + - description: Voltage point in nV, signed. + - description: Temperature point in uK. + + required: + - adi,custom-temp + "^rsense@": type: object description: Sense resistor sensor. @@ -413,6 +453,18 @@ required: additionalProperties: false +allOf: + - if: + properties: + compatible: + contains: + enum: + - adi,ltc2983 + - adi,ltc2984 + then: + patternProperties: + "^temp@": false + examples: - | #include From patchwork Thu Nov 3 13:00:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cosmin Tanislav X-Patchwork-Id: 13029972 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 478C5C4332F for ; Thu, 3 Nov 2022 13:02:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231801AbiKCNCt (ORCPT ); Thu, 3 Nov 2022 09:02:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231847AbiKCNCP (ORCPT ); Thu, 3 Nov 2022 09:02:15 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4364165B6; Thu, 3 Nov 2022 06:01:44 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id bj12so4911509ejb.13; Thu, 03 Nov 2022 06:01:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4d2UbvO3FSNARetdP9i+wj+MMgnS/Oph7AohVHZYBmU=; b=ko+OdfHBGEDfcT16wi3KKd9Nqm9C9uoY9DbXU8/h9W62U4RWI6TOHcbteRZh2aE2oE X/v3xnZlb/pa23EpK5moMP/XdPpKRRcUwPVc+9GB9wGz5K28up07E62K0UYV3NU7BpWS TOsBhHPWYs5d0qNhbP2QSiuX1MKvhqYI+p9vUbflZD93HOan/EOqB6IhPgW3SwhhJ5wW ISAtJp/YhkGbZ9zuv4CdFGIqL49RhTaBmgeN18EF+5N2UG2PDCaXwVPfs8mOFmajFNLU 464nDpHELa7UhBgFwf6tK6NlU6CnANqMx29Ce/dumZbeIPLhVI8Prbm1n9qNqnGOal8I AIJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4d2UbvO3FSNARetdP9i+wj+MMgnS/Oph7AohVHZYBmU=; b=3mp2KPJSjXCdLjWePLgZJTAkBsNaJ++a1A2HhQqJ/Nk+EYmSqNQDIVrfCf+NyQfDHM E+BgtGfngBJPO1n3sogtp3I/rEq/ZMnHcoqqZlw3kWF//CGOQTbL9svNl93bOa4jJS2X 4fbx5YArBASuLOekygl6W+HuW98YZMeA5tOsMbI4mqvltkWEA4y1lMoYjCeCC+vyfZfD +iSuSfXJ54HAiGJzxVETzZd3o2k0lY/vjbcTGUEcfzUx2zVW7cTOI8Kq9akfmKa1TbCs EB2oHvjn/tMf1cVrlZSPlJ2wsN+NyJhXDkXFpaJlLsFxgmZcbkaQOHr2Ax3E6LyJAJ7I iTug== X-Gm-Message-State: ACrzQf0T2OTDzD20Rz9/TIek/HDUaoOKZL9IH/1yvqRlg/bXSwWcOV9H LOLLFaotVX4D26ECxwsXLFpx8CnYFhDDAQ== X-Google-Smtp-Source: AMsMyM74n72Nlci46iChnQXEwZxTnh0a9UwY3AYnPwRgJURrTplxidjvpmkSW8uDrbISzxG7T7H+DQ== X-Received: by 2002:a17:907:d2a:b0:7ad:e0c5:4bd7 with SMTP id gn42-20020a1709070d2a00b007ade0c54bd7mr17739808ejc.177.1667480500362; Thu, 03 Nov 2022 06:01:40 -0700 (PDT) Received: from localhost.localdomain ([5.2.194.157]) by smtp.gmail.com with ESMTPSA id q12-20020a17090676cc00b00779a605c777sm451829ejn.192.2022.11.03.06.01.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 06:01:39 -0700 (PDT) From: Cosmin Tanislav Cc: Lars-Peter Clausen , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v4 13/13] iio: temperature: ltc2983: support more parts Date: Thu, 3 Nov 2022 15:00:41 +0200 Message-Id: <20221103130041.2153295-14-demonsingur@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103130041.2153295-1-demonsingur@gmail.com> References: <20221103130041.2153295-1-demonsingur@gmail.com> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Cosmin Tanislav Add support for the following parts: * LTC2984 * LTC2986 * LTM2985 The LTC2984 is a variant of the LTC2983 with EEPROM. The LTC2986 is a variant of the LTC2983 with only 10 channels, EEPROM and support for active analog temperature sensors. The LTM2985 is software-compatible with the LTC2986. Signed-off-by: Cosmin Tanislav --- drivers/iio/temperature/ltc2983.c | 183 ++++++++++++++++++++++++++++-- 1 file changed, 176 insertions(+), 7 deletions(-) diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c index ca1bb5f48988..72c052e4c7bc 100644 --- a/drivers/iio/temperature/ltc2983.c +++ b/drivers/iio/temperature/ltc2983.c @@ -25,9 +25,12 @@ #define LTC2983_STATUS_REG 0x0000 #define LTC2983_TEMP_RES_START_REG 0x0010 #define LTC2983_TEMP_RES_END_REG 0x005F +#define LTC2983_EEPROM_KEY_REG 0x00B0 +#define LTC2983_EEPROM_READ_STATUS_REG 0x00D0 #define LTC2983_GLOBAL_CONFIG_REG 0x00F0 #define LTC2983_MULT_CHANNEL_START_REG 0x00F4 #define LTC2983_MULT_CHANNEL_END_REG 0x00F7 +#define LTC2986_EEPROM_STATUS_REG 0x00F9 #define LTC2983_MUX_CONFIG_REG 0x00FF #define LTC2983_CHAN_ASSIGN_START_REG 0x0200 #define LTC2983_CHAN_ASSIGN_END_REG 0x024F @@ -35,13 +38,21 @@ #define LTC2983_CUST_SENS_TBL_END_REG 0x03CF #define LTC2983_DIFFERENTIAL_CHAN_MIN 2 -#define LTC2983_MAX_CHANNELS_NR 20 #define LTC2983_MIN_CHANNELS_NR 1 #define LTC2983_SLEEP 0x97 #define LTC2983_CUSTOM_STEINHART_SIZE 24 #define LTC2983_CUSTOM_SENSOR_ENTRY_SZ 6 #define LTC2983_CUSTOM_STEINHART_ENTRY_SZ 4 +#define LTC2983_EEPROM_KEY 0xA53C0F5A +#define LTC2983_EEPROM_WRITE_CMD 0x15 +#define LTC2983_EEPROM_READ_CMD 0x16 +#define LTC2983_EEPROM_STATUS_FAILURE_MASK GENMASK(3, 1) +#define LTC2983_EEPROM_READ_FAILURE_MASK GENMASK(7, 0) + +#define LTC2983_EEPROM_WRITE_TIME_MS 2600 +#define LTC2983_EEPROM_READ_TIME_MS 20 + #define LTC2983_CHAN_START_ADDR(chan) \ (((chan - 1) * 4) + LTC2983_CHAN_ASSIGN_START_REG) #define LTC2983_CHAN_RES_ADDR(chan) \ @@ -171,6 +182,7 @@ enum { LTC2983_SENSOR_DIODE = 28, LTC2983_SENSOR_SENSE_RESISTOR = 29, LTC2983_SENSOR_DIRECT_ADC = 30, + LTC2983_SENSOR_ACTIVE_TEMP = 31, }; #define to_thermocouple(_sensor) \ @@ -191,7 +203,17 @@ enum { #define to_adc(_sensor) \ container_of(_sensor, struct ltc2983_adc, sensor) +#define to_temp(_sensor) \ + container_of(_sensor, struct ltc2983_temp, sensor) + +struct ltc2983_chip_info { + unsigned int max_channels_nr; + bool has_temp; + bool has_eeprom; +}; + struct ltc2983_data { + const struct ltc2983_chip_info *info; struct regmap *regmap; struct spi_device *spi; struct mutex lock; @@ -210,6 +232,7 @@ struct ltc2983_data { */ __be32 temp __aligned(IIO_DMA_MINALIGN); __be32 chan_val; + __be32 eeprom_key; }; struct ltc2983_sensor { @@ -272,6 +295,12 @@ struct ltc2983_adc { bool single_ended; }; +struct ltc2983_temp { + struct ltc2983_sensor sensor; + struct ltc2983_custom_sensor *custom; + bool single_ended; +}; + /* * Convert to Q format numbers. These number's are integers where * the number of integer and fractional bits are specified. The resolution @@ -606,6 +635,22 @@ static int ltc2983_adc_assign_chan(struct ltc2983_data *st, return __ltc2983_chan_assign_common(st, sensor, chan_val); } +static int ltc2983_temp_assign_chan(struct ltc2983_data *st, + const struct ltc2983_sensor *sensor) +{ + struct ltc2983_temp *temp = to_temp(sensor); + u32 chan_val; + int ret; + + chan_val = LTC2983_ADC_SINGLE_ENDED(temp->single_ended); + + ret = __ltc2983_chan_custom_sensor_assign(st, temp->custom, &chan_val); + if (ret) + return ret; + + return __ltc2983_chan_assign_common(st, sensor, chan_val); +} + static struct ltc2983_sensor * ltc2983_thermocouple_new(const struct fwnode_handle *child, struct ltc2983_data *st, const struct ltc2983_sensor *sensor) @@ -771,10 +816,10 @@ ltc2983_rtd_new(const struct fwnode_handle *child, struct ltc2983_data *st, if (rtd->sensor_config & LTC2983_RTD_4_WIRE_MASK) { /* 4-wire */ u8 min = LTC2983_DIFFERENTIAL_CHAN_MIN, - max = LTC2983_MAX_CHANNELS_NR; + max = st->info->max_channels_nr; if (rtd->sensor_config & LTC2983_RTD_ROTATION_MASK) - max = LTC2983_MAX_CHANNELS_NR - 1; + max = st->info->max_channels_nr - 1; if (((rtd->sensor_config & LTC2983_RTD_KELVIN_R_SENSE_MASK) == LTC2983_RTD_KELVIN_R_SENSE_MASK) && @@ -1143,6 +1188,38 @@ static struct ltc2983_sensor *ltc2983_adc_new(struct fwnode_handle *child, return &adc->sensor; } +static struct ltc2983_sensor *ltc2983_temp_new(struct fwnode_handle *child, + struct ltc2983_data *st, + const struct ltc2983_sensor *sensor) +{ + struct ltc2983_temp *temp; + + temp = devm_kzalloc(&st->spi->dev, sizeof(*temp), GFP_KERNEL); + if (!temp) + return ERR_PTR(-ENOMEM); + + if (fwnode_property_read_bool(child, "adi,single-ended")) + temp->single_ended = true; + + if (!temp->single_ended && + sensor->chan < LTC2983_DIFFERENTIAL_CHAN_MIN) { + dev_err(&st->spi->dev, "Invalid chan:%d for differential temp\n", + sensor->chan); + return ERR_PTR(-EINVAL); + } + + temp->custom = __ltc2983_custom_sensor_new(st, child, "adi,custom-temp", + false, 4096, true); + if (IS_ERR(temp->custom)) + return ERR_CAST(temp->custom); + + /* set common parameters */ + temp->sensor.assign_chan = ltc2983_temp_assign_chan; + temp->sensor.fault_handler = ltc2983_common_fault_handler; + + return &temp->sensor; +} + static int ltc2983_chan_read(struct ltc2983_data *st, const struct ltc2983_sensor *sensor, int *val) { @@ -1302,10 +1379,10 @@ static int ltc2983_parse_dt(struct ltc2983_data *st) /* check if we have a valid channel */ if (sensor.chan < LTC2983_MIN_CHANNELS_NR || - sensor.chan > LTC2983_MAX_CHANNELS_NR) { + sensor.chan > st->info->max_channels_nr) { ret = -EINVAL; dev_err(dev, "chan:%d must be from %u to %u\n", sensor.chan, - LTC2983_MIN_CHANNELS_NR, LTC2983_MAX_CHANNELS_NR); + LTC2983_MIN_CHANNELS_NR, st->info->max_channels_nr); goto put_child; } else if (channel_avail_mask & BIT(sensor.chan)) { ret = -EINVAL; @@ -1345,6 +1422,9 @@ static int ltc2983_parse_dt(struct ltc2983_data *st) st->iio_channels--; } else if (sensor.type == LTC2983_SENSOR_DIRECT_ADC) { st->sensors[chan] = ltc2983_adc_new(child, st, &sensor); + } else if (st->info->has_temp && + sensor.type == LTC2983_SENSOR_ACTIVE_TEMP) { + st->sensors[chan] = ltc2983_temp_new(child, st, &sensor); } else { dev_err(dev, "Unknown sensor type %d\n", sensor.type); ret = -EINVAL; @@ -1371,6 +1451,45 @@ static int ltc2983_parse_dt(struct ltc2983_data *st) return ret; } +static int ltc2983_eeprom_cmd(struct ltc2983_data *st, unsigned int cmd, + unsigned int wait_time, unsigned int status_reg, + unsigned long status_fail_mask) +{ + unsigned long time; + unsigned int val; + int ret; + + ret = regmap_bulk_write(st->regmap, LTC2983_EEPROM_KEY_REG, + &st->eeprom_key, sizeof(st->eeprom_key)); + if (ret) + return ret; + + reinit_completion(&st->completion); + + ret = regmap_write(st->regmap, LTC2983_STATUS_REG, + LTC2983_STATUS_START(true) | cmd); + if (ret) + return ret; + + time = wait_for_completion_timeout(&st->completion, + msecs_to_jiffies(wait_time)); + if (!time) { + dev_err(&st->spi->dev, "EEPROM command timed out\n"); + return -ETIMEDOUT; + } + + ret = regmap_read(st->regmap, status_reg, &val); + if (ret) + return ret; + + if (val & status_fail_mask) { + dev_err(&st->spi->dev, "EEPROM command failed: 0x%02X\n", val); + return -EINVAL; + } + + return 0; +} + static int ltc2983_setup(struct ltc2983_data *st, bool assign_iio) { u32 iio_chan_t = 0, iio_chan_v = 0, chan, iio_idx = 0, status; @@ -1403,6 +1522,15 @@ static int ltc2983_setup(struct ltc2983_data *st, bool assign_iio) if (ret) return ret; + if (st->info->has_eeprom && !assign_iio) { + ret = ltc2983_eeprom_cmd(st, LTC2983_EEPROM_READ_CMD, + LTC2983_EEPROM_READ_TIME_MS, + LTC2983_EEPROM_READ_STATUS_REG, + LTC2983_EEPROM_READ_FAILURE_MASK); + if (!ret) + return 0; + } + for (chan = 0; chan < st->num_channels; chan++) { u32 chan_type = 0, *iio_chan; @@ -1442,9 +1570,13 @@ static int ltc2983_setup(struct ltc2983_data *st, bool assign_iio) static const struct regmap_range ltc2983_reg_ranges[] = { regmap_reg_range(LTC2983_STATUS_REG, LTC2983_STATUS_REG), regmap_reg_range(LTC2983_TEMP_RES_START_REG, LTC2983_TEMP_RES_END_REG), + regmap_reg_range(LTC2983_EEPROM_KEY_REG, LTC2983_EEPROM_KEY_REG), + regmap_reg_range(LTC2983_EEPROM_READ_STATUS_REG, + LTC2983_EEPROM_READ_STATUS_REG), regmap_reg_range(LTC2983_GLOBAL_CONFIG_REG, LTC2983_GLOBAL_CONFIG_REG), regmap_reg_range(LTC2983_MULT_CHANNEL_START_REG, LTC2983_MULT_CHANNEL_END_REG), + regmap_reg_range(LTC2986_EEPROM_STATUS_REG, LTC2986_EEPROM_STATUS_REG), regmap_reg_range(LTC2983_MUX_CONFIG_REG, LTC2983_MUX_CONFIG_REG), regmap_reg_range(LTC2983_CHAN_ASSIGN_START_REG, LTC2983_CHAN_ASSIGN_END_REG), @@ -1489,6 +1621,12 @@ static int ltc2983_probe(struct spi_device *spi) st = iio_priv(indio_dev); + st->info = device_get_match_data(&spi->dev); + if (!st->info) + st->info = (void *)spi_get_device_id(spi)->driver_data; + if (!st->info) + return -ENODEV; + st->regmap = devm_regmap_init_spi(spi, <c2983_regmap_config); if (IS_ERR(st->regmap)) { dev_err(&spi->dev, "Failed to initialize regmap\n"); @@ -1498,6 +1636,7 @@ static int ltc2983_probe(struct spi_device *spi) mutex_init(&st->lock); init_completion(&st->completion); st->spi = spi; + st->eeprom_key = cpu_to_be32(LTC2983_EEPROM_KEY); spi_set_drvdata(spi, st); ret = ltc2983_parse_dt(st); @@ -1525,6 +1664,15 @@ static int ltc2983_probe(struct spi_device *spi) return ret; } + if (st->info->has_eeprom) { + ret = ltc2983_eeprom_cmd(st, LTC2983_EEPROM_WRITE_CMD, + LTC2983_EEPROM_WRITE_TIME_MS, + LTC2986_EEPROM_STATUS_REG, + LTC2983_EEPROM_STATUS_FAILURE_MASK); + if (ret) + return ret; + } + indio_dev->name = name; indio_dev->num_channels = st->iio_channels; indio_dev->channels = st->iio_chan; @@ -1555,14 +1703,35 @@ static int ltc2983_suspend(struct device *dev) static DEFINE_SIMPLE_DEV_PM_OPS(ltc2983_pm_ops, ltc2983_suspend, ltc2983_resume); +static const struct ltc2983_chip_info ltc2983_chip_info_data = { + .max_channels_nr = 20, +}; + +static const struct ltc2983_chip_info ltc2984_chip_info_data = { + .max_channels_nr = 20, + .has_eeprom = true, +}; + +static const struct ltc2983_chip_info ltc2986_chip_info_data = { + .max_channels_nr = 10, + .has_temp = true, + .has_eeprom = true, +}; + static const struct spi_device_id ltc2983_id_table[] = { - { "ltc2983" }, + { "ltc2983", (kernel_ulong_t)<c2983_chip_info_data }, + { "ltc2984", (kernel_ulong_t)<c2984_chip_info_data }, + { "ltc2986", (kernel_ulong_t)<c2986_chip_info_data }, + { "ltm2985", (kernel_ulong_t)<c2986_chip_info_data }, {}, }; MODULE_DEVICE_TABLE(spi, ltc2983_id_table); static const struct of_device_id ltc2983_of_match[] = { - { .compatible = "adi,ltc2983" }, + { .compatible = "adi,ltc2983", .data = <c2983_chip_info_data }, + { .compatible = "adi,ltc2984", .data = <c2984_chip_info_data }, + { .compatible = "adi,ltc2986", .data = <c2986_chip_info_data }, + { .compatible = "adi,ltm2985", .data = <c2986_chip_info_data }, {}, }; MODULE_DEVICE_TABLE(of, ltc2983_of_match);