Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5954441rdb; Thu, 14 Dec 2023 04:43:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFdXg+8AVz9zOea2KgK+6bAYVGPZC02KuCKVZiETF3g4bXbLiOcx5CmRLr9GHiEhazUzU7z X-Received: by 2002:a05:6a21:3d89:b0:191:e72c:24df with SMTP id bj9-20020a056a213d8900b00191e72c24dfmr1270505pzc.19.1702557803179; Thu, 14 Dec 2023 04:43:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702557803; cv=none; d=google.com; s=arc-20160816; b=hJ3uY0+kM6GW3pvUuiSt/HRPhlmZLVwYdnCgtzK+Y7lySheGZlHeOAuP4EVk+NsNX4 tj7WLCNLi1HWf5Qte23UF6o+28e2/ucBOs8WxRy/bmw+sjY2nC11vKlMqbQsiHWqpdt8 N1Kmhhctyn31FLCABs1hONZLetsg6RWAAZ6XCwo58SjqMt6aZRi+j+nb2aClfQEdaWNF VbRGDtaQZMT24F1WLtXfNYvZg0CNRDoNYIxL527qzoCD6NopM7qeiXEAcI1WoD8qi/vE jmpSMFmYbYpS2ZAR6COgaAoXs8l0SxvMxrMUqnACgathZMbj8RNvaXtpLeHREO5KKbst cQBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=DLS5Sl/tcs7UdHUclsP8wzE7HsHwHptKsbrYJkJgZGU=; fh=YjyM5Q9l8VlOdl4Y9mmJrA0j+K5yVNPCLP4H4GPsXbY=; b=F8Isjuqtwlb8DsB1jdRqj8cTbUZPmyfDBTecEEsfqhg+zUQyUF+7ap5Ka3RE4mPRXD 7CVo1uQVyUWnxWLHR/bndy8ch68fs2XfRKDSt+gueT9vwP+SMsOzhyqZlUG5JgB3UH/N PRA0GsmzSoQktT/yMkyZQ76d95/Pl+dU5nmAzHtJe+H8Qy0aows3RhML53OEaPCpDL+l 6FELwLZKKoHQQDALhMWT0IGQiGMfMEjwT440rQ5YBaMqDG5Si/FCRyFOf/GtcFQISDLt YaHDZ/8baLwWE6R04QAQe4VHriMNV3vlgbC1g8K6+HA6QOyKx4jGpFFY+Y1NxM9oUhzX 7uSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GuBkbk8X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id m3-20020a170902768300b001d0b7902fbasi11243385pll.189.2023.12.14.04.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 04:43:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GuBkbk8X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (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 snail.vger.email (Postfix) with ESMTP id 5AB1C8025BC4; Thu, 14 Dec 2023 04:43:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573125AbjLNMnJ (ORCPT + 99 others); Thu, 14 Dec 2023 07:43:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573090AbjLNMnI (ORCPT ); Thu, 14 Dec 2023 07:43:08 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECA9D11D; Thu, 14 Dec 2023 04:43:13 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-50bf2d9b3fdso10891313e87.3; Thu, 14 Dec 2023 04:43:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702557792; x=1703162592; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=DLS5Sl/tcs7UdHUclsP8wzE7HsHwHptKsbrYJkJgZGU=; b=GuBkbk8X//vN2MqB3QH9cyd69URtayCAMJI12a8HoECoWdRwrkDVsnAhZ+q/Is84Pr bIrt+2dEmsP4wXyOZtRghQO77n7wK2foJsDpEdotyABrYNkPWO4iUvawl/slzmWrvm0q 6h1fksVXcrhD5U3VJAzTLpDnCtMCfLv+6eQILKWQnA2GhIMjlsrQR43NsTcxEcnYzmJ7 ketzu+CDgiTuM1rxANdo8HBqnArsvQFTGXOZTcbUwgpsS5Dc1WH5mDGxA6VtDnvSZWvB p3tSBD3vv/Ui6zeZHfINakAFjeydfrv+7TtcEqdAKigJK3QY8PLlOjWzKb0V3liaGLJo q+wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702557792; x=1703162592; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DLS5Sl/tcs7UdHUclsP8wzE7HsHwHptKsbrYJkJgZGU=; b=Uwxo0wK8cIOGJzAeyKbxAH+9irj8ryaxKdpKDaKPYYOEKqn6EVGS58YmAZgK2QgQgI wgo909Zue0WQXIZppT5EsVlHJuS7sdNjpbqNA1lfmKL+/HKHfetECA3WmUWFUnCZQcnB 6xPEM6J1ubnVWCKxCs3gNStwzly/IAOY3Fjfr+epmbUaLEB9MEtxvNTq7gsjysVg4z8/ RIaOQs1uCXxyyUbbMtdulGpAKWujhDfu/nhhbmtbCtdqQ8E0wEkMRV8VHLzs3q768kSY PfuaNTWgO7Pw9xGT7prr9dQdjawbxHsLsJidFXHLkkpB9UeD/H4sEALyVfopXPEAGSLa XcKA== X-Gm-Message-State: AOJu0YzLrFjBrHEE4+yWpdGc3KW9zBjA4tpDwbuxRnft/M3tHd35FdH7 M5NXY3v0fMSiJCkRbMoYI3Q= X-Received: by 2002:a05:6512:238f:b0:50d:1a7f:f76 with SMTP id c15-20020a056512238f00b0050d1a7f0f76mr5708024lfv.65.1702557791782; Thu, 14 Dec 2023 04:43:11 -0800 (PST) Received: from [172.25.98.130] ([5.2.194.157]) by smtp.gmail.com with ESMTPSA id vh2-20020a170907d38200b00a1be80a0b69sm9324342ejc.58.2023.12.14.04.43.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Dec 2023 04:43:11 -0800 (PST) Message-ID: Date: Thu, 14 Dec 2023 14:43:09 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 1/2] dt-bindings: adc: add AD7173 Content-Language: en-US To: David Lechner Cc: linus.walleij@linaro.org, brgl@bgdev.pl, andy@kernel.org, linux-gpio@vger.kernel.org, Lars-Peter Clausen , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Walle , Andy Shevchenko , Arnd Bergmann , ChiaEn Wu , Niklas Schnelle , =?UTF-8?Q?Leonard_G=C3=B6hrs?= , Mike Looijmans , Haibo Chen , Hugo Villeneuve , Ceclan Dumitru , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231212104451.22522-1-mitrutzceclan@gmail.com> From: Ceclan Dumitru In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 14 Dec 2023 04:43:21 -0800 (PST) On 12/12/23 17:09, David Lechner wrote: > On Tue, Dec 12, 2023 at 11:45 AM Dumitru Ceclan wrote: >> >> The AD7173 family offer a complete integrated Sigma-Delta ADC solution >> which can be used in high precision, low noise single channel applications >> or higher speed multiplexed applications. The Sigma-Delta ADC is intended >> primarily for measurement of signals close to DC but also delivers >> outstanding performance with input bandwidths out to ~10kHz. > > As stated in [1], we should try to make complete bindings. I think > more could be done here to make this more complete. Most notably, the > gpio-controller binding is missing. Also maybe something is needed to > describe how the SYNC/ERROR pin is wired up since it can be an input > or an output with different functions? > GPIO-controller: '#gpio-cells': const: 2 gpio-controller: true Like this, in properties? Sync can only be an output, Error is configurable. Are there any examples for how something like this is described? ... >> + interrupts: >> + maxItems: 1 > > Shouldn't this be 2? The datasheet says there is a "Data Output Ready" > signal on the DOUT/RDY pin and an "Error Output" on the SYNC/ERROR > pin. Although I could see how RDY could be considered part of the SPI > bus. In any case, a description explaining what the interrupt is would > be useful. > I do not see how there could be 2 interrupts. DOUT/RDY is used as an interrupt when waiting for a conversion to finalize. Sync and Error are sepparate pins, Sync(if enabled) works only as an input that resets the modulator and the digital filter. Error can be configured as input, output or ERROR output (OR between all internal error sources). Would this be alright interrupts: description: Conversion completion interrupt. Pin is shared with SPI DOUT. maxItems: 1 ... >> + >> +patternProperties: >> + "^channel@[0-9a-f]$": >> + type: object >> + $ref: adc.yaml >> + unevaluatedProperties: false >> + >> + properties: >> + reg: >> + minimum: 0 >> + maximum: 15 >> + >> + diff-channels: >> + items: >> + minimum: 0 >> + maximum: 31 > > Do we need to add overrides to limit the maximums for each compatible string? > Just to be sure, in the allOf section? If yes, is there any other more elegant method to obtain this behavior? ... >> + >> + required: >> + - reg >> + - diff-channels > > Individual analog inputs can be used as single-ended or in pairs as > differential, right? If so, diff-channels should not be required to > allow for single-ended use. > > And we would need to add something like a single-ended-channel > property to adc.yaml to allow mapping analog input pins to channels > similar to how diff-channels works, I think (I don't see anything like > that there already)? > > So maybe something like: > > oneOf: > - required: > single-ended-channel > - required: > diff-channels > All channels must specify 2 analog input sources, there is no input source wired by default to AVSS. In my opinion, there is no need to specify channels as single-ended because that would require a property that specifies the input that is wired to AVSS.