Message ID | 20230421085245.302169-2-herve.codina@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp933222vqo; Fri, 21 Apr 2023 02:23:24 -0700 (PDT) X-Google-Smtp-Source: AKy350Z4i3nKKQXmp4Ul9XkL+9T9Rf/3Rvk/gNWT04XaEGUVXJTSJjQvheYL4NSTiNsyMHqTG0+b X-Received: by 2002:a05:6a20:86a2:b0:ef:1b1e:a024 with SMTP id k34-20020a056a2086a200b000ef1b1ea024mr4407870pze.59.1682069003700; Fri, 21 Apr 2023 02:23:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682069003; cv=none; d=google.com; s=arc-20160816; b=y750EjbTtJCIgtCDYroV0fQ802Z8O7XbSM4DFmIm/3CIflnWr45Cq5HZayYHSVO9Ru sx+pmNK6NwOPGF1dRBWkhSCpyjwUF3e3F7wfc/AwQS+guMkru8wEEy0PqKLZ7jaL538k wVrHJnCV57SqA0XlkW1Sz5+Naj6gJX3dKZwG+K2kUDSHBaQiX3auW55za7SMhGbfBBvn RzDjyp+xZh2jARqBrXwOvAbVV3kZfOXcN1KOdDqGTJIFPSdHN7JCQ4rnBqye+kxHN7ur bJXAJcxzlWZgv+c9F2CAwHBHNWGA9wVAhOs+Dy5sapgDYuy1f3ed5xO1prIeWq4uDTSB eCZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uf38X61eh5A/xDBb52sQbA/hpuTv3mViEcnHyYk1qZU=; b=M7ge/nqIcC+s1ge2mgwhb27col8aGvB6XEfO2QVKVtk0eG5bQQ8V52Nam0C3RF1Py/ ASB/GDT+UdGcI9pfedFV7Mqki+rmXcQGqYc/7t5Ls31d3DyZ14xAWfbI/1RIL37GJVv2 kZ0yWJmkpYctbSoRl2UlNqkYxiRgQmwt2FBi4UXH7xXG3V7K6bw70wY831UQIsvrl39F mMqWe3qDrGhySnRkP/dfutknj1V3oIzG5TneYhZ52KYD2VmJA6zjyXQ26m519Qeze/Um 0ExLm8bQOXrmVjTQboYev7TEAP9xu7G3VswAhK5wsAlouAoXg7iacN4+AdyPsBQofSbw UgDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=LDceoR3O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r25-20020a6560d9000000b004faf341b31asi3879445pgv.196.2023.04.21.02.23.09; Fri, 21 Apr 2023 02:23:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=LDceoR3O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231758AbjDUIxJ (ORCPT <rfc822;cjcooper78@gmail.com> + 99 others); Fri, 21 Apr 2023 04:53:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231653AbjDUIw5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 21 Apr 2023 04:52:57 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DE3F93E4; Fri, 21 Apr 2023 01:52:53 -0700 (PDT) Received: (Authenticated sender: herve.codina@bootlin.com) by mail.gandi.net (Postfix) with ESMTPA id 44F2A1BF209; Fri, 21 Apr 2023 08:52:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1682067172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uf38X61eh5A/xDBb52sQbA/hpuTv3mViEcnHyYk1qZU=; b=LDceoR3O7N+PXaD/tpqHc1XUJNqVA5lYU8ayDZ/6tKom/Yw5CEpowPhTzg6wu9CKXgHVpw NcL5f3cmPVALpHSvgUVVvVYn4Tz9tAZG1POtN9NkPWjUXaqGZ1K5+eLQ4Ej9CBL9+SbJS8 RLs6EFpsvHzgkwZ+ltUXBaS0cdV4oCTUY7oAHz4zTvJ6nlmpf5d/tZG4z4J506ePoaFynY n6ZctmpFm423ZIq+AkIzD6VyorBNy59gjpXe7nTYM0P1yxrD8nfpmrB9cjLTWuhYNW4Ust pnE/HCfH0nWxOj9rc8zQY/NGwdPUn9qHVwiizj9aiR8sZ9aw1CEL7mRXZWO0Vw== From: Herve Codina <herve.codina@bootlin.com> To: Herve Codina <herve.codina@bootlin.com>, Jonathan Cameron <jic23@kernel.org>, Lars-Peter Clausen <lars@metafoo.de>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Christophe Leroy <christophe.leroy@csgroup.eu>, Thomas Petazzoni <thomas.petazzoni@bootlin.com> Subject: [PATCH v3 1/3] dt-bindings: iio: potentiometer: Add the Renesas X9250 potentiometers Date: Fri, 21 Apr 2023 10:52:43 +0200 Message-Id: <20230421085245.302169-2-herve.codina@bootlin.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230421085245.302169-1-herve.codina@bootlin.com> References: <20230421085245.302169-1-herve.codina@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763777187448493517?= X-GMAIL-MSGID: =?utf-8?q?1763777187448493517?= |
Series |
Add the Renesas X9250 potentiometers IIO support
|
|
Commit Message
Herve Codina
April 21, 2023, 8:52 a.m. UTC
The Renesas X9250 is a quad digitally controlled potentiometers.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
.../iio/potentiometer/renesas,x9250.yaml | 54 +++++++++++++++++++
1 file changed, 54 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/potentiometer/renesas,x9250.yaml
Comments
On 21/04/2023 10:52, Herve Codina wrote: > The Renesas X9250 is a quad digitally controlled potentiometers. > > Signed-off-by: Herve Codina <herve.codina@bootlin.com> > --- > .../iio/potentiometer/renesas,x9250.yaml | 54 +++++++++++++++++++ > 1 file changed, 54 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/potentiometer/renesas,x9250.yaml > > diff --git a/Documentation/devicetree/bindings/iio/potentiometer/renesas,x9250.yaml b/Documentation/devicetree/bindings/iio/potentiometer/renesas,x9250.yaml > new file mode 100644 > index 000000000000..dfa36b23eb0d > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/potentiometer/renesas,x9250.yaml > @@ -0,0 +1,54 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/iio/potentiometer/renesas,x9250.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Renesas X9250 quad potentiometers > + > +maintainers: > + - Herve Codina <herve.codina@bootlin.com> > + > +description: > + The Renesas X9250 integrates four digitally controlled potentiometers. > + On each potentiometer, the X9250T has a 100 kOhms total resistance and the > + X9250U has a 50 kOhms total resistance. > + > +allOf: > + - $ref: /schemas/spi/spi-peripheral-props.yaml > + - $ref: /schemas/iio/iio.yaml Apologies, I missed it last time - you do not need iio.yaml. It's coming from core schema and is always selected. You won't find its usage anywhere in the kernel (git grep iio.yaml) With iio.yaml dropped: Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof
On Fri, 21 Apr 2023 10:52:43 +0200 Herve Codina <herve.codina@bootlin.com> wrote: > The Renesas X9250 is a quad digitally controlled potentiometers. > > Signed-off-by: Herve Codina <herve.codina@bootlin.com> Hi Herve, Historically we've been a bit lax in IIO bindings in always making sure the per supplies are included. As a result we frequently get them added later and it just makes things messier than they should be. So please add vcc-supply from the start. V+ and V- are a little trickier. I was expecting datasheet to say they should be symmetric about 0 but it doesn't. So they could be two independent supplies. Also make it required as my current understanding is that we should do that for supplies that are definitely present even if we could rely on the fallback to regulator stubs if they aren't supplied. So add the 3 supplies to required as well. Less of a requirement, but you might want to also provide an optional gpio for the not WP pin on basis someone might wire it up to the host processor. Beyond the comment Krzystof made on iio.yaml this otherwise looks good to me. Thanks, Jonathan > --- > .../iio/potentiometer/renesas,x9250.yaml | 54 +++++++++++++++++++ > 1 file changed, 54 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/potentiometer/renesas,x9250.yaml > > diff --git a/Documentation/devicetree/bindings/iio/potentiometer/renesas,x9250.yaml b/Documentation/devicetree/bindings/iio/potentiometer/renesas,x9250.yaml > new file mode 100644 > index 000000000000..dfa36b23eb0d > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/potentiometer/renesas,x9250.yaml > @@ -0,0 +1,54 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/iio/potentiometer/renesas,x9250.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Renesas X9250 quad potentiometers > + > +maintainers: > + - Herve Codina <herve.codina@bootlin.com> > + > +description: > + The Renesas X9250 integrates four digitally controlled potentiometers. > + On each potentiometer, the X9250T has a 100 kOhms total resistance and the > + X9250U has a 50 kOhms total resistance. > + > +allOf: > + - $ref: /schemas/spi/spi-peripheral-props.yaml > + - $ref: /schemas/iio/iio.yaml > + > +properties: > + compatible: > + enum: > + - renesas,x9250t > + - renesas,x9250u > + > + reg: > + maxItems: 1 > + > + '#io-channel-cells': > + const: 1 > + > + spi-max-frequency: > + maximum: 2000000 > + > +required: > + - compatible > + - reg > + - '#io-channel-cells' > + > +unevaluatedProperties: false > + > +examples: > + - | > + spi { > + #address-cells = <1>; > + #size-cells = <0>; > + potentiometer@0 { > + compatible = "renesas,x9250t"; > + reg = <0>; > + spi-max-frequency = <2000000>; > + #io-channel-cells = <1>; > + }; > + };
Hi Jonathan, Krzysztof, On Sat, 22 Apr 2023 17:18:07 +0100 Jonathan Cameron <jic23@kernel.org> wrote: > On Fri, 21 Apr 2023 10:52:43 +0200 > Herve Codina <herve.codina@bootlin.com> wrote: > > > The Renesas X9250 is a quad digitally controlled potentiometers. > > > > Signed-off-by: Herve Codina <herve.codina@bootlin.com> > > Hi Herve, > > Historically we've been a bit lax in IIO bindings in always making > sure the per supplies are included. As a result we frequently get > them added later and it just makes things messier than they should > be. > > So please add vcc-supply from the start. V+ and V- are a little trickier. > I was expecting datasheet to say they should be symmetric about 0 but it > doesn't. So they could be two independent supplies. > > Also make it required as my current understanding is that we should > do that for supplies that are definitely present even if we could > rely on the fallback to regulator stubs if they aren't supplied. > So add the 3 supplies to required as well. Yes, I will add the following supplies in the next iteration: - 'vcc-supply' for VCC - 'avp-supply' for the analog V+ - 'avn-supply' for the analog V- and add them in the required list of properties. Are the names correct for these power supplies (avp and avn) ? > > Less of a requirement, but you might want to also provide an optional > gpio for the not WP pin on basis someone might wire it up to the host processor. I will add the 'wp-gpios' property. > > Beyond the comment Krzystof made on iio.yaml this otherwise looks good to me. And for the Krzystof comment on iio.yaml, as he suggested, I will drop iio.yaml. Thanks for the review, Hervé > > > > > > --- > > .../iio/potentiometer/renesas,x9250.yaml | 54 +++++++++++++++++++ > > 1 file changed, 54 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/iio/potentiometer/renesas,x9250.yaml > > > > diff --git a/Documentation/devicetree/bindings/iio/potentiometer/renesas,x9250.yaml b/Documentation/devicetree/bindings/iio/potentiometer/renesas,x9250.yaml > > new file mode 100644 > > index 000000000000..dfa36b23eb0d > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/iio/potentiometer/renesas,x9250.yaml > > @@ -0,0 +1,54 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/iio/potentiometer/renesas,x9250.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Renesas X9250 quad potentiometers > > + > > +maintainers: > > + - Herve Codina <herve.codina@bootlin.com> > > + > > +description: > > + The Renesas X9250 integrates four digitally controlled potentiometers. > > + On each potentiometer, the X9250T has a 100 kOhms total resistance and the > > + X9250U has a 50 kOhms total resistance. > > + > > +allOf: > > + - $ref: /schemas/spi/spi-peripheral-props.yaml > > + - $ref: /schemas/iio/iio.yaml > > + > > +properties: > > + compatible: > > + enum: > > + - renesas,x9250t > > + - renesas,x9250u > > + > > + reg: > > + maxItems: 1 > > + > > + '#io-channel-cells': > > + const: 1 > > + > > + spi-max-frequency: > > + maximum: 2000000 > > + > > +required: > > + - compatible > > + - reg > > + - '#io-channel-cells' > > + > > +unevaluatedProperties: false > > + > > +examples: > > + - | > > + spi { > > + #address-cells = <1>; > > + #size-cells = <0>; > > + potentiometer@0 { > > + compatible = "renesas,x9250t"; > > + reg = <0>; > > + spi-max-frequency = <2000000>; > > + #io-channel-cells = <1>; > > + }; > > + }; >
On Mon, 24 Apr 2023 09:03:18 +0200 Herve Codina <herve.codina@bootlin.com> wrote: > Hi Jonathan, Krzysztof, > > On Sat, 22 Apr 2023 17:18:07 +0100 > Jonathan Cameron <jic23@kernel.org> wrote: > > > On Fri, 21 Apr 2023 10:52:43 +0200 > > Herve Codina <herve.codina@bootlin.com> wrote: > > > > > The Renesas X9250 is a quad digitally controlled potentiometers. > > > > > > Signed-off-by: Herve Codina <herve.codina@bootlin.com> > > > > Hi Herve, > > > > Historically we've been a bit lax in IIO bindings in always making > > sure the per supplies are included. As a result we frequently get > > them added later and it just makes things messier than they should > > be. > > > > So please add vcc-supply from the start. V+ and V- are a little trickier. > > I was expecting datasheet to say they should be symmetric about 0 but it > > doesn't. So they could be two independent supplies. > > > > Also make it required as my current understanding is that we should > > do that for supplies that are definitely present even if we could > > rely on the fallback to regulator stubs if they aren't supplied. > > So add the 3 supplies to required as well. > > Yes, I will add the following supplies in the next iteration: > - 'vcc-supply' for VCC > - 'avp-supply' for the analog V+ > - 'avn-supply' for the analog V- > > and add them in the required list of properties. > > Are the names correct for these power supplies (avp and avn) ? I think so. I'm not totally sure on how DT maintainers think we should deal with a two voltage level reference though. Perhaps add some description to make it very clear what is going on and we'll see what review comments we get! Jonathan
diff --git a/Documentation/devicetree/bindings/iio/potentiometer/renesas,x9250.yaml b/Documentation/devicetree/bindings/iio/potentiometer/renesas,x9250.yaml new file mode 100644 index 000000000000..dfa36b23eb0d --- /dev/null +++ b/Documentation/devicetree/bindings/iio/potentiometer/renesas,x9250.yaml @@ -0,0 +1,54 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/potentiometer/renesas,x9250.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Renesas X9250 quad potentiometers + +maintainers: + - Herve Codina <herve.codina@bootlin.com> + +description: + The Renesas X9250 integrates four digitally controlled potentiometers. + On each potentiometer, the X9250T has a 100 kOhms total resistance and the + X9250U has a 50 kOhms total resistance. + +allOf: + - $ref: /schemas/spi/spi-peripheral-props.yaml + - $ref: /schemas/iio/iio.yaml + +properties: + compatible: + enum: + - renesas,x9250t + - renesas,x9250u + + reg: + maxItems: 1 + + '#io-channel-cells': + const: 1 + + spi-max-frequency: + maximum: 2000000 + +required: + - compatible + - reg + - '#io-channel-cells' + +unevaluatedProperties: false + +examples: + - | + spi { + #address-cells = <1>; + #size-cells = <0>; + potentiometer@0 { + compatible = "renesas,x9250t"; + reg = <0>; + spi-max-frequency = <2000000>; + #io-channel-cells = <1>; + }; + };