Message ID | 20240130115651.457800-1-naresh.solanki@9elements.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-44560-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1165271dyb; Tue, 30 Jan 2024 03:59:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IF7vUG80b1j+NkPeMu4zXzSE7DHFhp47Ga5Gj9+F3/pQPaH/Q0lHZmqsEtg3uv0JX/2eB7H X-Received: by 2002:a17:903:4cf:b0:1d7:8570:e53 with SMTP id jm15-20020a17090304cf00b001d785700e53mr1301849plb.38.1706615941698; Tue, 30 Jan 2024 03:59:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706615941; cv=pass; d=google.com; s=arc-20160816; b=PjVed3BEcZSqPuqR+QgXGed7oNYdMh9sXxfXFAg4K/r11DdjA6uQ29O1Z0rIaB9j+9 FX5NXbYH8ZDr2EYoieEtDCbJ50fopx6QsjOm5YIa+ccz7gn2tWMoZSX5XWFDKiOndVv6 gvPtHgd6IHttnh7kX7fPwPUVTyWc33DSmg8nwnkuGrCN/X8OWrJjmdZlrd/HWHmo6h/U 1IM/rJB93e+5zfO3AcTHYqK2mKfxDBeZQFnFPHa7aY+7oo2u3mkdUNbUh4JuQHrhHd1d Ldmv3Cq5T3U9Q+xGqNu02n9NlXpq/wY8pAxEc8Fs9k5vPr0GhWh6Swrv11p+fTdav7kW g4kQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=3UEGIekdyazfqo3T299WapeO9DNQtaZe4LTOdPjlFiU=; fh=IEjZ9w17WZpRC98xB7qDyUMQqzvac4vOEVeuv6ejdCI=; b=ob6+Fm26Qvb9lGvKUEq58riLB93qXoTN/g7EiM5SS7IuLFXtNjFAuYTNaG2IapGLAr o9zunXBHR7UpbYhdiu6929xfSPKZ4eUhD2MXFvB4yeFGkBkdvMFNNrWxX99v/bqBDbjY Kxj55RwVC0lxuyl9M33GITg2CT5Hq3emP5lgfksfj8ZxeRql1MJZRyQt9N/TL8x68IY2 PYflJoejsY0scun/w3uALFjAUbf7rRQk8UigceMozf3IDVOc3yU95ikIuPZr+ewDE0vf 6e9VVMTXZYi4ORfXFqczi5WGnauevfFyxORu8/s85mJFEP7USeSiRzkPglT93hx298B3 HNWQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=Ro76OJuV; arc=pass (i=1 spf=pass spfdomain=9elements.com dkim=pass dkdomain=9elements.com dmarc=pass fromdomain=9elements.com); spf=pass (google.com: domain of linux-kernel+bounces-44560-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44560-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d7-20020a170903230700b001d76501a1ecsi2577920plh.469.2024.01.30.03.59.01 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 03:59:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44560-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=Ro76OJuV; arc=pass (i=1 spf=pass spfdomain=9elements.com dkim=pass dkdomain=9elements.com dmarc=pass fromdomain=9elements.com); spf=pass (google.com: domain of linux-kernel+bounces-44560-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44560-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 164102858E5 for <ouuuleilei@gmail.com>; Tue, 30 Jan 2024 11:57:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B4D0679E1; Tue, 30 Jan 2024 11:57:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=9elements.com header.i=@9elements.com header.b="Ro76OJuV" Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 397C0679EC for <linux-kernel@vger.kernel.org>; Tue, 30 Jan 2024 11:56:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706615820; cv=none; b=IlspI1NWAn0r3q1M2Zhq1retBiqTAcyob3fXw4vkgBWxHKkPHhoN5pbL38xSbstEawx+CzzhGRyxwfOZGxqZnRvzkZv/3C+nH/OnPEy39Rm+fL8w3N9eNhDWcrNaqoKn+SDEqz7N3wSwBx2g9owyOhel11Wq6W+9htcnTbKHnD4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706615820; c=relaxed/simple; bh=5BNuu1x/bXsqnfMaHPtVjp+t6R/LjBZtMNHFrzbKhFM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=AYGeNGtvoZ12aSkudJIMKbxnYYpWgRNYfihHZRyaPy7h4M3143JT99JS/uDJcmTCsQNUIuAViPy3NSqDN8SPUw4Jir5r5GX68ya6b4hEn3d+jF5OvmJizzhic3SEoX95Pk7PVIMkyq7kdvv0Lp36nCoQgixp3cUjMppTdiepplk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=9elements.com; spf=pass smtp.mailfrom=9elements.com; dkim=pass (2048-bit key) header.d=9elements.com header.i=@9elements.com header.b=Ro76OJuV; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=9elements.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=9elements.com Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a28fb463a28so454127166b.3 for <linux-kernel@vger.kernel.org>; Tue, 30 Jan 2024 03:56:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1706615817; x=1707220617; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=3UEGIekdyazfqo3T299WapeO9DNQtaZe4LTOdPjlFiU=; b=Ro76OJuVzL7y/JZv3h/GVERlwMXQI2C1KqybMRAn5ru8BbOG4gLzTuWjTTtbk0YIQ3 MDIA1BUWK3T7Ep35GxdQXvsJaYD2CL9qCvVhaPOgDpxadCLT5I3+FgV6yH3wPa2jVJqb WzCwAzET2UmIzyZNRfVsAs+1iyYYaYZ8yhjv+KOCY2/yPDY9QheYCk2wXIhU6IiX6Ow9 hMfWbvY1MvyiJT+yz4tR+sQQsrTLWH/Gv8IfG6j9f9FmWGN5rY+RSdUZrufRfaFoB2Ve rbZASFgS2GroqggKNugTBDGrkahJHHTEW+WjK6rbWTWTh6A8cgnr3Q3AguQhMojPEAsq frlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706615817; x=1707220617; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3UEGIekdyazfqo3T299WapeO9DNQtaZe4LTOdPjlFiU=; b=S6dOHsStp5ahu/rQm3ZaS+z4zFpmjkgnmEGxKmHPYRcqJNuWz9E/yqwvfZmtPGSN3W un8Qnob4IqtyXEV9uCI2PZIFYm74MSuAPjsnvbMAjx390tYrTnZhJYdLvvS3XMRDoRHg pPAxmgYgsfablsHEbCJO2Je/hVfHys3sSNpP4KPFXvYc6Nwo7JM4HAt+usnSzkgiSgGI SMwo6jfXko07L9Mu/RdZqnwGmy3K+Qqu9wrdf/0y+bRCt1ZhKtEtEVmGn2LgSDb6N3BV /kO9XWNRDgKanioLFoA8gijYTlaIvhhso0vygV/Fwbo8+f6nUPYer/WIS4N8iEWRlyyZ /V1w== X-Gm-Message-State: AOJu0YzhdGPGuS3k48oVqOemmQwPhP/eJwJo2UpzwRSlspX8eNvG3IPw eFAlX4n11BprniPzCJzsaGBfP0T9M2sfK8V6hx64axJCSIODquHBkNSqiGZ4QKAt81aitjOAuih xpWg= X-Received: by 2002:a17:906:b846:b0:a36:4cb1:da77 with SMTP id ga6-20020a170906b84600b00a364cb1da77mr6163ejb.4.1706615817020; Tue, 30 Jan 2024 03:56:57 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCUcaKChEB2aRD4siN6rXcukPfd3nJzIXUuUSm9rdm9/ggYWDvMvxsLIUWlF/DDOJ0d/MIvZ72c+1A2erHOcqgmqAn9cr60DqaVsoNxayeTimhKui/aOuVODf9YXUBsS3BhlRvTuHXBAXzsxbhc0RHby98kvle7PMCcsyZGCrcC6Nqq5Yk/FAyiJ2x0v80qrm7D5ZLYr81HKhABXsjXXVT+zGd4+2h2Cncl6Ic+S9aGIHiDBJ5UuVMJVxBAAAPqR7MP2aQVwQzpZrrkmI8bnCDDYcX6RtoJpYIyzm9nYr7AWT/XQUyleXjQVBUpuplF0WxYIwJWlg7jYr9ltWpc1RnnwHENfvqP/0gxN2f9JZRgKaw== Received: from stroh80.sec.9e.network (ip-078-094-000-051.um19.pools.vodafone-ip.de. [78.94.0.51]) by smtp.gmail.com with ESMTPSA id tl19-20020a170907c31300b00a352a99b974sm4201641ejc.167.2024.01.30.03.56.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 03:56:56 -0800 (PST) From: Naresh Solanki <naresh.solanki@9elements.com> To: Peter Rosin <peda@axentia.se>, Jonathan Cameron <jic23@kernel.org>, Lars-Peter Clausen <lars@metafoo.de>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org> Cc: mazziesaccount@gmail.com, Naresh Solanki <naresh.solanki@9elements.com>, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] dt-bindings: iio: afe: voltage-divider: Add io-channel-cells Date: Tue, 30 Jan 2024 17:26:50 +0530 Message-ID: <20240130115651.457800-1-naresh.solanki@9elements.com> X-Mailer: git-send-email 2.42.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789514856373462761 X-GMAIL-MSGID: 1789516518081559237 |
Series |
[v3] dt-bindings: iio: afe: voltage-divider: Add io-channel-cells
|
|
Commit Message
Naresh Solanki
Jan. 30, 2024, 11:56 a.m. UTC
voltage-divider is always an iio consumer at the same time it is
optionally an iio provider.
Hence add #io-channel-cells
Also update example.
Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com>
---
.../bindings/iio/afe/voltage-divider.yaml | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
base-commit: 861c0981648f5b64c86fd028ee622096eb7af05a
Comments
Hey, On Tue, Jan 30, 2024 at 05:26:50PM +0530, Naresh Solanki wrote: > voltage-divider is always an iio consumer at the same time it is > optionally an iio provider. > Hence add #io-channel-cells > Also update example. > > Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com> > --- > .../bindings/iio/afe/voltage-divider.yaml | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml b/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml > index dddf97b50549..98fec8548cc3 100644 > --- a/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml > +++ b/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml > @@ -39,6 +39,13 @@ properties: > description: | > Channel node of a voltage io-channel. > > + '#io-channel-cells': > + description: > + In addition to consuming the measurement services of a voltage output > + channel the voltage divider can act as a provider of measurement > + services to other devices. Did you miss: https://lore.kernel.org/all/20240127165542.6eeb23e9@jic23-huawei/ Where I said that I would like to have an example of where this would be used in the description? Peter gave a good example that you can draw on. > + const: 1 > + > output-ohms: > description: > Resistance Rout over which the output voltage is measured. See full-ohms. > @@ -75,12 +82,17 @@ examples: > spi-max-frequency = <1000000>; > }; > }; > - sysv { > + p12v_vd: sysv { > compatible = "voltage-divider"; > io-channels = <&maxadc 1>; > + #io-channel-cells = <1>; > > /* Scale the system voltage by 22/222 to fit the ADC range. */ > output-ohms = <22>; > full-ohms = <222>; /* 200 + 22 */ > }; Blank line here please. Thanks, Conor. > + iio-hwmon { > + compatible = "iio-hwmon"; > + io-channels = <&p12v_vd 0>; > + }; > ... > > base-commit: 861c0981648f5b64c86fd028ee622096eb7af05a > -- > 2.42.0 >
On Wed, Jan 31, 2024 at 04:35:16PM +0000, Jonathan Cameron wrote: > On Wed, 31 Jan 2024 09:29:59 +0100 > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > > On 30/01/2024 12:56, Naresh Solanki wrote: > > > voltage-divider is always an iio consumer at the same time it is > > > optionally an iio provider. > > > Hence add #io-channel-cells > > > Also update example. > > > > > > > Fix > > wrapping > > and > > proper > > sentences. Each sentence finishes with full stop. > > > > ... > > > output-ohms: > > > description: > > > Resistance Rout over which the output voltage is measured. See full-ohms. > > > @@ -75,12 +82,17 @@ examples: > > > spi-max-frequency = <1000000>; > > > }; > > > }; > > > - sysv { > > > + p12v_vd: sysv { > > > > No, drop label. > > > > > compatible = "voltage-divider"; > > > io-channels = <&maxadc 1>; > > > + #io-channel-cells = <1>; > > > > > > /* Scale the system voltage by 22/222 to fit the ADC range. */ > > > output-ohms = <22>; > > > full-ohms = <222>; /* 200 + 22 */ > > > }; > > > + iio-hwmon { > > > + compatible = "iio-hwmon"; > > > + io-channels = <&p12v_vd 0>; > > > > The same question as for v2. Drop unrelated example. > > Conor requested an example of the device acting as a consumer and a provider. > Might have meant in the patch description? > > Conor? I wanted it in the property description to help with understanding when to use it. I don't think the extra example nodes actually help you understand what it is doing, only how to write one yourself once you know you need it. Thanks, Conor.
Hi! 2024-02-02 at 11:43, Naresh Solanki wrote: > Hi, > > > On Wed, 31 Jan 2024 at 22:24, Conor Dooley <conor@kernel.org> wrote: >> >> On Wed, Jan 31, 2024 at 04:35:16PM +0000, Jonathan Cameron wrote: >>> On Wed, 31 Jan 2024 09:29:59 +0100 >>> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: >>> >>>> On 30/01/2024 12:56, Naresh Solanki wrote: >>> Conor requested an example of the device acting as a consumer and a provider. >>> Might have meant in the patch description? >>> >>> Conor? >> >> I wanted it in the property description to help with understanding when >> to use it. I don't think the extra example nodes actually help you >> understand what it is doing, only how to write one yourself once you >> know you need it. > I'm not sure if I get it right but what I understood is that a > voltage-divider can > also be a provider to other devices & hence the property. > Also do you want me to put a complete example of it in description ? My understanding is the requested example in the description should not be exactly /how/ to hook up the voltage-divider as a provider, but instead have some words about why it is interesting to do so at all. And those words would also make it clear that is even possible. The latter is something which, to be honest, is perhaps not all that obvious. It has always been totally obvious to me of course, sorry for not being clearer when I wrote the binding... Cheers, Peter
On Fri, Feb 02, 2024 at 12:49:26PM +0100, Peter Rosin wrote: > 2024-02-02 at 11:43, Naresh Solanki wrote: > > On Wed, 31 Jan 2024 at 22:24, Conor Dooley <conor@kernel.org> wrote: > >> On Wed, Jan 31, 2024 at 04:35:16PM +0000, Jonathan Cameron wrote: > >>> On Wed, 31 Jan 2024 09:29:59 +0100 > >>> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > >>>> On 30/01/2024 12:56, Naresh Solanki wrote: > >>> Conor requested an example of the device acting as a consumer and a provider. > >>> Might have meant in the patch description? > >>> > >>> Conor? > >> > >> I wanted it in the property description to help with understanding when > >> to use it. I don't think the extra example nodes actually help you > >> understand what it is doing, only how to write one yourself once you > >> know you need it. > > > > I'm not sure if I get it right but what I understood is that a > > voltage-divider can > > also be a provider to other devices & hence the property. > > Also do you want me to put a complete example of it in description ? > > My understanding is the requested example in the description should not > be exactly /how/ to hook up the voltage-divider as a provider, but > instead have some words about why it is interesting to do so at all. And > those words would also make it clear that is even possible. The latter > is something which, to be honest, is perhaps not all that obvious. It > has always been totally obvious to me of course, sorry for not being > clearer when I wrote the binding... Yeah, you're right about what I was looking for Peter. In my original request, which I think I already linked to in this thread, I said that I would like an example like the one that Peter had used to explain to me the scenario in which someone would want to use this feature: https://lore.kernel.org/all/536971eb-51f0-40e5-d025-7c4c1d683d49@axentia.se/ Cheers, Conor.
Hi Conor, Peter, On Fri, 2 Feb 2024 at 18:39, Conor Dooley <conor.dooley@microchip.com> wrote: > > On Fri, Feb 02, 2024 at 12:49:26PM +0100, Peter Rosin wrote: > > 2024-02-02 at 11:43, Naresh Solanki wrote: > > > On Wed, 31 Jan 2024 at 22:24, Conor Dooley <conor@kernel.org> wrote: > > >> On Wed, Jan 31, 2024 at 04:35:16PM +0000, Jonathan Cameron wrote: > > >>> On Wed, 31 Jan 2024 09:29:59 +0100 > > >>> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > >>>> On 30/01/2024 12:56, Naresh Solanki wrote: > > >>> Conor requested an example of the device acting as a consumer and a provider. > > >>> Might have meant in the patch description? > > >>> > > >>> Conor? > > >> > > >> I wanted it in the property description to help with understanding when > > >> to use it. I don't think the extra example nodes actually help you > > >> understand what it is doing, only how to write one yourself once you > > >> know you need it. > > > > > > I'm not sure if I get it right but what I understood is that a > > > voltage-divider can > > > also be a provider to other devices & hence the property. > > > Also do you want me to put a complete example of it in description ? > > > > My understanding is the requested example in the description should not > > be exactly /how/ to hook up the voltage-divider as a provider, but > > instead have some words about why it is interesting to do so at all. And > > those words would also make it clear that is even possible. The latter > > is something which, to be honest, is perhaps not all that obvious. It > > has always been totally obvious to me of course, sorry for not being > > clearer when I wrote the binding... > > Yeah, you're right about what I was looking for Peter. > > In my original request, which I think I already linked to in this > thread, I said that I would like an example like the one that Peter had > used to explain to me the scenario in which someone would want to use > this feature: > https://lore.kernel.org/all/536971eb-51f0-40e5-d025-7c4c1d683d49@axentia.se/ ok. Based on my understanding, I'll update the property description with an example. description: In addition to consuming the measurement services of a voltage output channel the voltage divider can act as a provider of measurement services to other devices. This is particularly useful in scenarios wherein, ADC has analog frontend such as voltage divider then consuming its raw value isn't interesting. It is desired to get real voltage before voltage divider. Regards, Naresh > > Cheers, > Conor.
On Mon, Feb 05, 2024 at 07:24:07PM +0530, Naresh Solanki wrote: > Hi Conor, Peter, > > On Fri, 2 Feb 2024 at 18:39, Conor Dooley <conor.dooley@microchip.com> wrote: > > > > On Fri, Feb 02, 2024 at 12:49:26PM +0100, Peter Rosin wrote: > > > 2024-02-02 at 11:43, Naresh Solanki wrote: > > > > On Wed, 31 Jan 2024 at 22:24, Conor Dooley <conor@kernel.org> wrote: > > > >> On Wed, Jan 31, 2024 at 04:35:16PM +0000, Jonathan Cameron wrote: > > > >>> On Wed, 31 Jan 2024 09:29:59 +0100 > > > >>> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > > >>>> On 30/01/2024 12:56, Naresh Solanki wrote: > > > >>> Conor requested an example of the device acting as a consumer and a provider. > > > >>> Might have meant in the patch description? > > > >>> > > > >>> Conor? > > > >> > > > >> I wanted it in the property description to help with understanding when > > > >> to use it. I don't think the extra example nodes actually help you > > > >> understand what it is doing, only how to write one yourself once you > > > >> know you need it. > > > > > > > > I'm not sure if I get it right but what I understood is that a > > > > voltage-divider can > > > > also be a provider to other devices & hence the property. > > > > Also do you want me to put a complete example of it in description ? > > > > > > My understanding is the requested example in the description should not > > > be exactly /how/ to hook up the voltage-divider as a provider, but > > > instead have some words about why it is interesting to do so at all. And > > > those words would also make it clear that is even possible. The latter > > > is something which, to be honest, is perhaps not all that obvious. It > > > has always been totally obvious to me of course, sorry for not being > > > clearer when I wrote the binding... > > > > Yeah, you're right about what I was looking for Peter. > > > > In my original request, which I think I already linked to in this > > thread, I said that I would like an example like the one that Peter had > > used to explain to me the scenario in which someone would want to use > > this feature: > > https://lore.kernel.org/all/536971eb-51f0-40e5-d025-7c4c1d683d49@axentia.se/ > ok. Based on my understanding, I'll update the property description > with an example. > > description: > In addition to consuming the measurement services of a voltage output > channel the voltage divider can act as a provider of measurement > services to other devices. > This is particularly useful in scenarios wherein, > ADC has analog frontend such as voltage divider then consuming its raw > value isn't interesting. This sentence is structured pretty weirdly, it's missing articles and prepositions, but you have the right idea here, thanks. > It is desired to get real voltage before > voltage divider.
diff --git a/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml b/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml index dddf97b50549..98fec8548cc3 100644 --- a/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml +++ b/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml @@ -39,6 +39,13 @@ properties: description: | Channel node of a voltage io-channel. + '#io-channel-cells': + description: + In addition to consuming the measurement services of a voltage output + channel the voltage divider can act as a provider of measurement + services to other devices. + const: 1 + output-ohms: description: Resistance Rout over which the output voltage is measured. See full-ohms. @@ -75,12 +82,17 @@ examples: spi-max-frequency = <1000000>; }; }; - sysv { + p12v_vd: sysv { compatible = "voltage-divider"; io-channels = <&maxadc 1>; + #io-channel-cells = <1>; /* Scale the system voltage by 22/222 to fit the ADC range. */ output-ohms = <22>; full-ohms = <222>; /* 200 + 22 */ }; + iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&p12v_vd 0>; + }; ...