Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1150397pxj; Sat, 8 May 2021 09:02:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzd8h0RiO5NVblsldBCDtR0oobBqUgApOPnTYDdu7GjCPZpw4G5yLF0gTdUGl3V77DcvOn+ X-Received: by 2002:a17:906:a51:: with SMTP id x17mr16304708ejf.25.1620489734278; Sat, 08 May 2021 09:02:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620489734; cv=none; d=google.com; s=arc-20160816; b=ir4ysaFlCHE5yAFlINa3vbVSxohlR2J4xeoMk8+lj/ZKcQeWnX09N3K92THdgjsDRa 9TlbYrkLo+YcpaBSS2GQaHSGhOJyKLNQVsDazi0ZcuipcaxaZmvozLCIIuInRDbwb9Nd dUFXuqkdy9n4fDqQM/TPM4eW/QTi7iV0nupa6Ep4JKYQjF5FPp+5qd++3XAY4wxupAeO BVrjX0zY3/vwLUEy3DRjIZgOjn8+iFIbZq2EZzdVjAN4cPweyF1ZwCbqJPqIVeQCPZJf 3adUD9qJkpWMP0pXlH//rYtiwSRA9ygTi5+ekVMYd+KFLVk6U0SWXfMYvutvB+9Q1MHd O4xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=UiJSPP/LEs680b+yJBMoFuRapnH04u27F2mKGK61usk=; b=Awj9uB/FW/kUQ/FMWOVZvVuUSoovAIv/uRQ7JCEGA/Mnaa25wk7zq4aAzGJS/PsXE8 M7JLGarouxbZBkVFbYuEGMFf0dkLij9Bcjeusdbwgijw0yMYOKjBmYhKoMYxg5Pa3ZCE onr7Cqjwxtleo/0GKP03RmB0/aLqT8c8Q0nyHfcJZgy6HKY1ixhAYV7p71cnu7dmlOJT 3a1BHiQKwI8yJPdeGOv2hDUkqbnr7xyHNwI4oLhTn6UhlW2UsTR1D7PlH+zN+iCwvYIC 3BfzDBEIUOoTuEHesz9ysCwpPYbIHz6N2Pg1D85XzL/P94B2sPvZjXNlrmef0PeMqe5E /6hw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n2si8015692edv.130.2021.05.08.09.01.50; Sat, 08 May 2021 09:02:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229666AbhEHP7u (ORCPT + 99 others); Sat, 8 May 2021 11:59:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:47010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbhEHP7t (ORCPT ); Sat, 8 May 2021 11:59:49 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DE5C660FE9; Sat, 8 May 2021 15:58:45 +0000 (UTC) Date: Sat, 8 May 2021 16:59:44 +0100 From: Jonathan Cameron To: Peter Rosin Cc: Krzysztof Kozlowski , Lars-Peter Clausen , Rob Herring , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dt-bindings: iio: afe: current-sense-shunt: add io-channel-cells Message-ID: <20210508165944.2e3d8d91@jic23-huawei> In-Reply-To: <0e68ca18-7d8c-12ab-59b1-56404b29be77@axentia.se> References: <20210506150637.35288-1-krzysztof.kozlowski@canonical.com> <0e68ca18-7d8c-12ab-59b1-56404b29be77@axentia.se> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 8 May 2021 00:44:58 +0200 Peter Rosin wrote: > Hi! > > On 2021-05-06 17:06, Krzysztof Kozlowski wrote: > > The current-sense-shunt is an IIO provider thus can be referenced by IIO > > consumers (via "io-channels" property in consumer device node). > > Such provider is required to describe number of cells used in phandle > > lookup with "io-channel-cells" property. This also fixes dtbs_check > > warnings like: > > > > arch/arm/boot/dts/s5pv210-fascinate4g.dt.yaml: current-sense-shunt: > > '#io-channel-cells' does not match any of the regexes: 'pinctrl-[0-9]+' > > > > Fixes: ce66e52b6c16 ("dt-bindings:iio:afe:current-sense-shunt: txt to yaml conversion.") > > Signed-off-by: Krzysztof Kozlowski > > --- > > .../devicetree/bindings/iio/afe/current-sense-shunt.yaml | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml b/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml > > index 90439a8dc785..05166d8a3124 100644 > > --- a/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml > > +++ b/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml > > @@ -24,12 +24,16 @@ properties: > > description: | > > Channel node of a voltage io-channel. > > > > + "#io-channel-cells": > > + const: 0 > > + > > shunt-resistor-micro-ohms: > > description: The shunt resistance. > > > > required: > > - compatible > > - io-channels > > + - "#io-channel-cells" > > - shunt-resistor-micro-ohms > > I know I'm listed as maintainer and all, but I have not kept up with the yaml > conversion. Sorry. So, given that I might very well fundamentally misunderstand > something, it does not sound correct that #io-channel-cells is now "required". > I regard it as optional, and only needed if some other in-kernel driver is > consuming the sensed current. What am I missing? > Agreed. This should be optional and I have deliberately not introduced it into all the bindings that could in theory support being used as providers. So far I've not pushed it out in a blanket fashion into existing bindings even as optional. > Also, whatever is done in this binding should preferably also be done in the > two "sister" afe bindings, i.e. current-sense-amplifier and voltage-divider. This particular case is squashing an error, so whilst I'm happy to have those gain the binding addition, I would like to see them in a separate patch as less likely they'd get back ported. If Kryysztof is fine with me just dropping the required I can pick up this patch. Thanks, Jonathan > > Cheers, > Peter > > > additionalProperties: false > > @@ -57,6 +61,7 @@ examples: > > sysi { > > compatible = "current-sense-shunt"; > > io-channels = <&tiadc 0>; > > + #io-channel-cells = <0>; > > > > /* Divide the voltage by 3300000/1000000 (or 3.3) for the current. */ > > shunt-resistor-micro-ohms = <3300000>; > >