Message ID | 20231105193132.47009-3-alisadariana@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2276155vqu; Sun, 5 Nov 2023 11:33:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IEBE60gHM3q16XuuXjiNNNC/ufAvELOl0gZqbgpP2gczgOjuE0Fh3CQpuMW31OavlzUfQZc X-Received: by 2002:a05:6a21:798a:b0:181:1fc8:c5de with SMTP id bh10-20020a056a21798a00b001811fc8c5demr13893822pzc.43.1699212801233; Sun, 05 Nov 2023 11:33:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699212801; cv=none; d=google.com; s=arc-20160816; b=eUerx2LxYcR02py6Xk1RATOR2VcE3JfsoX4CLdvojFynddzP4lF3MCjWCdaEJaZYcL 0qdzvXFj3/BIurcIARpGT7ydsLpU7Xo3C5g3J6VNCH9B9bSZZO+oZUWfgxK0DuOZg2fa Hvyrogl/zkufyUcIvO9nl9HktK+iRx5PJNBsr/R/b9tWq3Q9ZHBCRiA3ccZgm/j43wA8 /T2LI6GJjVnpeZe0tvVOkMzNyus47JzROXmOe32vAdjB6neMUNGZyRquVWl893yJS+q/ QPIxZLLgos6CtwsxHYkby6Rg5M9BQcEOprHuj1/pXIRNava1SPyqB8Rkp0rynFdn6UBX Uy3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=agF7FmNdxJL43+j1iH0SmmU3n7HdFDcises4JFJGz6w=; fh=iUGTc4tHb702OK5lIaI6XrrQVU2FacpyFaGclMiiM5U=; b=zH6+jih6f2unhzJ3cOq6+3BVNm0soaEI61mVbwDIBlWtGdX4usTSeJpc99eC99ORuP oJv1rLtkZ4Yi4K1M+bo3jPkJQ9AJbL0A78fm/0Uqy5s1Op/LikDg2gL6DkMiPZIJrwdS rQ48gSWQrpBDTm3FAgLIv/eAGIr0a96aC2aRvq5WKUw9WsK+9sLBy1bjnLZlxZ7gfIDG 4quLiHuU3n/Zo9hGwyfowKjwbvJlwaj5lfikJ4og7nZ6zqKPBxrVEUfUbQagzSelLGEJ PIce5emi+Kx4S8Na1mGGniNuNBctiqRlUG1X9WdOQaHmlyA3UXEbvpE+anqs913moYVu XwdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20230601 header.b=jGwR9eYN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id i13-20020a170902e48d00b001c62161b18esi5959687ple.580.2023.11.05.11.33.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 11:33:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20230601 header.b=jGwR9eYN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id CCE6E805F41F; Sun, 5 Nov 2023 11:33:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229667AbjKETcc (ORCPT <rfc822;heyuhang3455@gmail.com> + 34 others); Sun, 5 Nov 2023 14:32:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbjKETca (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 5 Nov 2023 14:32:30 -0500 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 9483D112; Sun, 5 Nov 2023 11:32:26 -0800 (PST) Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-9ae2cc4d17eso577879766b.1; Sun, 05 Nov 2023 11:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699212745; x=1699817545; darn=vger.kernel.org; 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=agF7FmNdxJL43+j1iH0SmmU3n7HdFDcises4JFJGz6w=; b=jGwR9eYNOJDMOLKfx2jyA6SIiq9a77nOH8sGVHSeHK92DAgylbuf+wjmuFeHlk1PhV dF3SlS61l8klyZC+deN3gPAr/5JJ5lqB+g+fxPjCL5YtNUQeg4HpCAYprPemM4bFbOKk KfPGSEmODLU7ipKcjkxjbxBTZBzFC7dxBgMNcpaR4+kBn0B8ow74GOhcKmcpQTBNKQdL Gup5iiHTgQk54ji3zgWlNJ6YA1PAHn1L88iID4DO7zo4CtS+vKICArLJ8+IQfNP8MRFx e/mE4fTNw1adJuT4QMqudSscAwCStxtAvYsXttKSzFlHX6qOylAHnQsozfNnBEm7I9r/ YXWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699212745; x=1699817545; 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=agF7FmNdxJL43+j1iH0SmmU3n7HdFDcises4JFJGz6w=; b=tE5uvX95D2x+MSUqUjeJ+dYXtcVlrERCHamoH3wBoe0jYDuxlK8UwM0EBGIvgJp0xX Oe7TcuWL5cbnW+3zJVbdoSEnR4kMMd7YfmUOG9r2U3olG1teU1xjFU+tyIN7/skKlBw/ Fr8HNd/0nj6bw+T3PAmXSgTtszU/ZNd795a9yMmZUY7viMlZUje9eEk6NKQHqA5hoRXV rmXHo2404OZtH/EA/uV6Jc8C/1Qkwuzsnb+cbk0cgqVLjH3sdXhauEoVyQNKc6s4Nqzq OfwpW2Lc7YbDUgVPc5tSDQJkdsXGw1VFbBX81PtTOoqGqyi+fjHVAgwyoB4wNBFkcQUq vPUg== X-Gm-Message-State: AOJu0YyJfoTwh7g/glmy3zjMckHQ2AH9XCAXxFxCQAwqReff7SYOsWJ2 FTN7mYaKYc+sQ4cL5cHm+hQ= X-Received: by 2002:a17:907:1b22:b0:9c2:a072:78c4 with SMTP id mp34-20020a1709071b2200b009c2a07278c4mr11405087ejc.25.1699212744922; Sun, 05 Nov 2023 11:32:24 -0800 (PST) Received: from spiri.. ([5.14.137.80]) by smtp.gmail.com with ESMTPSA id d26-20020a1709064c5a00b009b947aacb4bsm3300259ejw.191.2023.11.05.11.32.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 11:32:24 -0800 (PST) From: alisadariana@gmail.com Cc: Alisa-Dariana Roman <alisa.roman@analog.com>, Lars-Peter Clausen <lars@metafoo.de>, Michael Hennerich <Michael.Hennerich@analog.com>, Alexandru Tachici <alexandru.tachici@analog.com>, Jonathan Cameron <jic23@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Maksim Kiselev <bigunclemax@gmail.com>, Arnd Bergmann <arnd@arndb.de>, Cosmin Tanislav <demonsingur@gmail.com>, Hugo Villeneuve <hvilleneuve@dimonoff.com>, Marius Cristea <marius.cristea@microchip.com>, Marcus Folkesson <marcus.folkesson@gmail.com>, Ibrahim Tilki <Ibrahim.Tilki@analog.com>, ChiaEn Wu <chiaen_wu@richtek.com>, Ivan Mikhaylov <fr0st61te@gmail.com>, Niklas Schnelle <schnelle@linux.ibm.com>, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] dt-bindings: iio: adc: ad7192: Add AD7194 support Date: Sun, 5 Nov 2023 21:31:30 +0200 Message-Id: <20231105193132.47009-3-alisadariana@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231105193132.47009-1-alisadariana@gmail.com> References: <20231105193132.47009-1-alisadariana@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.3 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sun, 05 Nov 2023 11:33:18 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781753762349715868 X-GMAIL-MSGID: 1781753762349715868 |
Series |
iio: adc: ad7192: Add support for AD7194
|
|
Commit Message
Alisa-Dariana Roman
Nov. 5, 2023, 7:31 p.m. UTC
From: Alisa-Dariana Roman <alisa.roman@analog.com> Unlike the other AD719Xs, AD7194 has configurable differential channels. The default configuration for these channels can be changed from the devicetree. Also add an example for AD7194 devicetree. Signed-off-by: Alisa-Dariana Roman <alisa.roman@analog.com> --- .../bindings/iio/adc/adi,ad7192.yaml | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+)
Comments
On 05/11/2023 20:31, alisadariana@gmail.com wrote: > From: Alisa-Dariana Roman <alisa.roman@analog.com> > > Unlike the other AD719Xs, AD7194 has configurable differential > channels. The default configuration for these channels can be changed > from the devicetree. > > Also add an example for AD7194 devicetree. > > Signed-off-by: Alisa-Dariana Roman <alisa.roman@analog.com> > --- > .../bindings/iio/adc/adi,ad7192.yaml | 69 +++++++++++++++++++ > 1 file changed, 69 insertions(+) > > diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml > index 16def2985ab4..b9a9f7b20670 100644 > --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml > +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml > @@ -21,8 +21,15 @@ properties: > - adi,ad7190 > - adi,ad7192 > - adi,ad7193 > + - adi,ad7194 > - adi,ad7195 > > + '#address-cells': > + const: 1 > + > + '#size-cells': > + const: 0 > + > reg: > maxItems: 1 > > @@ -96,6 +103,31 @@ required: > - spi-cpol > - spi-cpha > > +patternProperties: > + "^channel@([0-9a-f])$": > + type: object > + $ref: adc.yaml > + unevaluatedProperties: false > + > + properties: > + reg: > + description: The channel index. > + minimum: 0 > + maximum: 7 Your pattern a bit above is not correct then: [0-7] > + > + diff-channels: > + description: | > + The differential channel pair for Ad7194 configurable channels. The > + first channel is the positive input, the second channel is the > + negative input. > + items: > + minimum: 1 > + maximum: 16 > + > + required: > + - reg > + - diff-channels > + > allOf: > - $ref: /schemas/spi/spi-peripheral-props.yaml# > > @@ -127,3 +159,40 @@ examples: > adi,burnout-currents-enable; > }; > }; > + - | > + spi { > + #address-cells = <1>; > + #size-cells = <0>; > + > + adc@0 { > + #address-cells = <1>; > + #size-cells = <0>; > + compatible = "adi,ad7194"; > + reg = <0>; > + spi-max-frequency = <1000000>; > + spi-cpol; > + spi-cpha; > + clocks = <&ad7192_mclk>; > + clock-names = "mclk"; > + interrupts = <25 0x2>; > + interrupt-parent = <&gpio>; > + dvdd-supply = <&dvdd>; > + avdd-supply = <&avdd>; > + vref-supply = <&vref>; > + > + adi,refin2-pins-enable; > + adi,rejection-60-Hz-enable; > + adi,buffer-enable; > + adi,burnout-currents-enable; > + > + channel@0 { Why cannot you add this to the existing example? Best regards, Krzysztof
On 06.11.2023 10:56, Krzysztof Kozlowski wrote: > On 05/11/2023 20:31, alisadariana@gmail.com wrote: >> From: Alisa-Dariana Roman <alisa.roman@analog.com> >> >> Unlike the other AD719Xs, AD7194 has configurable differential >> channels. The default configuration for these channels can be changed >> from the devicetree. >> >> Also add an example for AD7194 devicetree. >> >> Signed-off-by: Alisa-Dariana Roman <alisa.roman@analog.com> >> --- >> .../bindings/iio/adc/adi,ad7192.yaml | 69 +++++++++++++++++++ >> 1 file changed, 69 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml >> index 16def2985ab4..b9a9f7b20670 100644 >> --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml >> +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml >> @@ -21,8 +21,15 @@ properties: >> - adi,ad7190 >> - adi,ad7192 >> - adi,ad7193 >> + - adi,ad7194 >> - adi,ad7195 >> >> + '#address-cells': >> + const: 1 >> + >> + '#size-cells': >> + const: 0 >> + >> reg: >> maxItems: 1 >> >> @@ -96,6 +103,31 @@ required: >> - spi-cpol >> - spi-cpha >> >> +patternProperties: >> + "^channel@([0-9a-f])$": >> + type: object >> + $ref: adc.yaml >> + unevaluatedProperties: false >> + >> + properties: >> + reg: >> + description: The channel index. >> + minimum: 0 >> + maximum: 7 > > Your pattern a bit above is not correct then: [0-7] > >> + >> + diff-channels: >> + description: | >> + The differential channel pair for Ad7194 configurable channels. The >> + first channel is the positive input, the second channel is the >> + negative input. >> + items: >> + minimum: 1 >> + maximum: 16 >> + >> + required: >> + - reg >> + - diff-channels >> + >> allOf: >> - $ref: /schemas/spi/spi-peripheral-props.yaml# >> >> @@ -127,3 +159,40 @@ examples: >> adi,burnout-currents-enable; >> }; >> }; >> + - | >> + spi { >> + #address-cells = <1>; >> + #size-cells = <0>; >> + >> + adc@0 { >> + #address-cells = <1>; >> + #size-cells = <0>; >> + compatible = "adi,ad7194"; >> + reg = <0>; >> + spi-max-frequency = <1000000>; >> + spi-cpol; >> + spi-cpha; >> + clocks = <&ad7192_mclk>; >> + clock-names = "mclk"; >> + interrupts = <25 0x2>; >> + interrupt-parent = <&gpio>; >> + dvdd-supply = <&dvdd>; >> + avdd-supply = <&avdd>; >> + vref-supply = <&vref>; >> + >> + adi,refin2-pins-enable; >> + adi,rejection-60-Hz-enable; >> + adi,buffer-enable; >> + adi,burnout-currents-enable; >> + >> + channel@0 { > > Why cannot you add this to the existing example? > > > > Best regards, > Krzysztof > I added another example to highlight the fact that only AD7194 supports configurable channels. How should I proceed? Kind regards, Alisa-Dariana Roman
On 14/11/2023 17:02, Alisa-Dariana Roman wrote: > On 06.11.2023 10:56, Krzysztof Kozlowski wrote: >> On 05/11/2023 20:31, alisadariana@gmail.com wrote: >>> From: Alisa-Dariana Roman <alisa.roman@analog.com> >>> >>> Unlike the other AD719Xs, AD7194 has configurable differential >>> channels. The default configuration for these channels can be changed >>> from the devicetree. >>> >>> Also add an example for AD7194 devicetree. >>> >>> Signed-off-by: Alisa-Dariana Roman <alisa.roman@analog.com> >>> --- >>> .../bindings/iio/adc/adi,ad7192.yaml | 69 +++++++++++++++++++ >>> 1 file changed, 69 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml >>> index 16def2985ab4..b9a9f7b20670 100644 >>> --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml >>> +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml >>> @@ -21,8 +21,15 @@ properties: >>> - adi,ad7190 >>> - adi,ad7192 >>> - adi,ad7193 >>> + - adi,ad7194 >>> - adi,ad7195 >>> >>> + '#address-cells': >>> + const: 1 >>> + >>> + '#size-cells': >>> + const: 0 >>> + >>> reg: >>> maxItems: 1 >>> >>> @@ -96,6 +103,31 @@ required: >>> - spi-cpol >>> - spi-cpha >>> >>> +patternProperties: >>> + "^channel@([0-9a-f])$": >>> + type: object >>> + $ref: adc.yaml >>> + unevaluatedProperties: false >>> + >>> + properties: >>> + reg: >>> + description: The channel index. >>> + minimum: 0 >>> + maximum: 7 >> >> Your pattern a bit above is not correct then: [0-7] >> >>> + >>> + diff-channels: >>> + description: | >>> + The differential channel pair for Ad7194 configurable channels. The >>> + first channel is the positive input, the second channel is the >>> + negative input. >>> + items: >>> + minimum: 1 >>> + maximum: 16 >>> + >>> + required: >>> + - reg >>> + - diff-channels >>> + >>> allOf: >>> - $ref: /schemas/spi/spi-peripheral-props.yaml# >>> >>> @@ -127,3 +159,40 @@ examples: >>> adi,burnout-currents-enable; >>> }; >>> }; >>> + - | >>> + spi { >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + >>> + adc@0 { >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + compatible = "adi,ad7194"; >>> + reg = <0>; >>> + spi-max-frequency = <1000000>; >>> + spi-cpol; >>> + spi-cpha; >>> + clocks = <&ad7192_mclk>; >>> + clock-names = "mclk"; >>> + interrupts = <25 0x2>; >>> + interrupt-parent = <&gpio>; >>> + dvdd-supply = <&dvdd>; >>> + avdd-supply = <&avdd>; >>> + vref-supply = <&vref>; >>> + >>> + adi,refin2-pins-enable; >>> + adi,rejection-60-Hz-enable; >>> + adi,buffer-enable; >>> + adi,burnout-currents-enable; >>> + >>> + channel@0 { >> >> Why cannot you add this to the existing example? >> >> >> >> Best regards, >> Krzysztof >> > I added another example to highlight the fact that only AD7194 supports > configurable channels. How should I proceed? Bindings did not tell that, so it seems you miss that part - allOf constraining channels per variant. Best regards, Krzysztof
On 14.11.2023 19:39, Krzysztof Kozlowski wrote: > On 14/11/2023 17:02, Alisa-Dariana Roman wrote: >> On 06.11.2023 10:56, Krzysztof Kozlowski wrote: >>> On 05/11/2023 20:31, alisadariana@gmail.com wrote: >>>> From: Alisa-Dariana Roman <alisa.roman@analog.com> >>>> >>>> Unlike the other AD719Xs, AD7194 has configurable differential >>>> channels. The default configuration for these channels can be changed >>>> from the devicetree. >>>> >>>> Also add an example for AD7194 devicetree. >>>> >>>> Signed-off-by: Alisa-Dariana Roman <alisa.roman@analog.com> >>>> --- >>>> .../bindings/iio/adc/adi,ad7192.yaml | 69 +++++++++++++++++++ >>>> 1 file changed, 69 insertions(+) >>>> >>>> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml >>>> index 16def2985ab4..b9a9f7b20670 100644 >>>> --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml >>>> +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml >>>> @@ -21,8 +21,15 @@ properties: >>>> - adi,ad7190 >>>> - adi,ad7192 >>>> - adi,ad7193 >>>> + - adi,ad7194 >>>> - adi,ad7195 >>>> >>>> + '#address-cells': >>>> + const: 1 >>>> + >>>> + '#size-cells': >>>> + const: 0 >>>> + >>>> reg: >>>> maxItems: 1 >>>> >>>> @@ -96,6 +103,31 @@ required: >>>> - spi-cpol >>>> - spi-cpha >>>> >>>> +patternProperties: >>>> + "^channel@([0-9a-f])$": >>>> + type: object >>>> + $ref: adc.yaml >>>> + unevaluatedProperties: false >>>> + >>>> + properties: >>>> + reg: >>>> + description: The channel index. >>>> + minimum: 0 >>>> + maximum: 7 >>> >>> Your pattern a bit above is not correct then: [0-7] >>> >>>> + >>>> + diff-channels: >>>> + description: | >>>> + The differential channel pair for Ad7194 configurable channels. The >>>> + first channel is the positive input, the second channel is the >>>> + negative input. >>>> + items: >>>> + minimum: 1 >>>> + maximum: 16 >>>> + >>>> + required: >>>> + - reg >>>> + - diff-channels >>>> + >>>> allOf: >>>> - $ref: /schemas/spi/spi-peripheral-props.yaml# >>>> >>>> @@ -127,3 +159,40 @@ examples: >>>> adi,burnout-currents-enable; >>>> }; >>>> }; >>>> + - | >>>> + spi { >>>> + #address-cells = <1>; >>>> + #size-cells = <0>; >>>> + >>>> + adc@0 { >>>> + #address-cells = <1>; >>>> + #size-cells = <0>; >>>> + compatible = "adi,ad7194"; >>>> + reg = <0>; >>>> + spi-max-frequency = <1000000>; >>>> + spi-cpol; >>>> + spi-cpha; >>>> + clocks = <&ad7192_mclk>; >>>> + clock-names = "mclk"; >>>> + interrupts = <25 0x2>; >>>> + interrupt-parent = <&gpio>; >>>> + dvdd-supply = <&dvdd>; >>>> + avdd-supply = <&avdd>; >>>> + vref-supply = <&vref>; >>>> + >>>> + adi,refin2-pins-enable; >>>> + adi,rejection-60-Hz-enable; >>>> + adi,buffer-enable; >>>> + adi,burnout-currents-enable; >>>> + >>>> + channel@0 { >>> >>> Why cannot you add this to the existing example? >>> >>> >>> >>> Best regards, >>> Krzysztof >>> >> I added another example to highlight the fact that only AD7194 supports >> configurable channels. How should I proceed? > > Bindings did not tell that, so it seems you miss that part - allOf > constraining channels per variant. > > Best regards, > Krzysztof > And should I remove the AD7194 example? Kind regards, Alisa-Dariana Roman
On 14/11/2023 19:27, Alisa-Dariana Roman wrote: >>>> >>>> Best regards, >>>> Krzysztof >>>> >>> I added another example to highlight the fact that only AD7194 supports >>> configurable channels. How should I proceed? >> >> Bindings did not tell that, so it seems you miss that part - allOf >> constraining channels per variant. >> >> Best regards, >> Krzysztof >> > And should I remove the AD7194 example? You can add new example in such case (and keep old). Best regards, Krzysztof
diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml index 16def2985ab4..b9a9f7b20670 100644 --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml @@ -21,8 +21,15 @@ properties: - adi,ad7190 - adi,ad7192 - adi,ad7193 + - adi,ad7194 - adi,ad7195 + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + reg: maxItems: 1 @@ -96,6 +103,31 @@ required: - spi-cpol - spi-cpha +patternProperties: + "^channel@([0-9a-f])$": + type: object + $ref: adc.yaml + unevaluatedProperties: false + + properties: + reg: + description: The channel index. + minimum: 0 + maximum: 7 + + diff-channels: + description: | + The differential channel pair for Ad7194 configurable channels. The + first channel is the positive input, the second channel is the + negative input. + items: + minimum: 1 + maximum: 16 + + required: + - reg + - diff-channels + allOf: - $ref: /schemas/spi/spi-peripheral-props.yaml# @@ -127,3 +159,40 @@ examples: adi,burnout-currents-enable; }; }; + - | + spi { + #address-cells = <1>; + #size-cells = <0>; + + adc@0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "adi,ad7194"; + reg = <0>; + spi-max-frequency = <1000000>; + spi-cpol; + spi-cpha; + clocks = <&ad7192_mclk>; + clock-names = "mclk"; + interrupts = <25 0x2>; + interrupt-parent = <&gpio>; + dvdd-supply = <&dvdd>; + avdd-supply = <&avdd>; + vref-supply = <&vref>; + + adi,refin2-pins-enable; + adi,rejection-60-Hz-enable; + adi,buffer-enable; + adi,burnout-currents-enable; + + channel@0 { + reg = <0>; + diff-channels = <1 6>; + }; + + channel@1 { + reg = <1>; + diff-channels = <2 3>; + }; + }; + };