Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp634887rdg; Thu, 10 Aug 2023 14:19:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGPcVFANxRrtVwcuUi5V61dYqc088P4S2kcc+BVXMtKsPrOdAEJeBMQ3MBAPyQ/ykbso1HU X-Received: by 2002:a05:6808:15aa:b0:3a7:a375:a173 with SMTP id t42-20020a05680815aa00b003a7a375a173mr3175oiw.10.1691702358092; Thu, 10 Aug 2023 14:19:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691702358; cv=none; d=google.com; s=arc-20160816; b=JIfFHf+a4+dIT8uhpa4ALueNAUgqBP1AHCOr2YSE+x2G1zP3/uBLMDliZpBPMUjNVa csSKIOat6V+lxwIQxOezE8Z2aafDzoPOszqZeUiukFvuhVGi92nhJBuVKd58dhRKve2B wY3BOARpzA84SPA4Z0JN07wzRrcg6/jL13tkNr6ORf6lnz2pNI/KjcFX3Jz/7eVJupsN 8OpPWiRnpNpZlmDacmomLrW5k8sSrcGmyra79jG9xt/wRGX1ZXjgsl/iLJLFGxOaFeJS a7/5iPZvBPgaIXO0ErE52za9cfv8zF6t6Y2oWHJQi7oSh0Em/kyk2+K8XJ0WSr/5usb5 Nd/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jpgHz4YTJ/wX6itKrUfNYrBqnGdQcrRXNKy3FssJO9Q=; fh=WeM0Icz2HUQ0oFoqzxnWf/ljcmkzygz8fNI1IKrksRk=; b=bhcoXPCt9jFNcuGIkimuGOFp6g7V7qGEaGW3Cs/8JWvmhHaGBgBO+WmZueJy9/g3Oq FnMsfytjSNGms+zG+DZFpoXlE7Yl1M9ZVXHYs9sChj+JKXNn43IRFMqVE5HrM99Z9crX rd2cTBxcoaV8nEdfm9ddx/Z6T6ZBiTqa+PTp8JwhBjDun62zhMyFZXgOCO5GV2d793PN +g4XIohTw0zcc5rV6kZLRoBr9f/hFK/VtjzExfFg4plkHQTq9PldpUjYYfz7FdodP3U5 tNQqVPAV1dlT1NfvvmM0x7B8Cf6R8RZK0FLO2UWNS9awWoMg+0J8gyRIPZErp04j3Mso 7h7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r7T4m0rQ; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k4-20020a6568c4000000b0056433ae7cc9si2131192pgt.260.2023.08.10.14.19.05; Thu, 10 Aug 2023 14:19:18 -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=@kernel.org header.s=k20201202 header.b=r7T4m0rQ; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231336AbjHJUvN (ORCPT + 99 others); Thu, 10 Aug 2023 16:51:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231956AbjHJUvM (ORCPT ); Thu, 10 Aug 2023 16:51:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42EB6270E; Thu, 10 Aug 2023 13:51:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D549965449; Thu, 10 Aug 2023 20:51:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EAD3C433C8; Thu, 10 Aug 2023 20:51:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691700670; bh=D/+A79azXEalodMTBC1cWRFoAqzjpUxIqIK+CgZ8WcU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r7T4m0rQQGbHwzkP0K3ZaZQSlJN+UpYOynNdXP45ljAmD8T19J702URtqg9eo7Hii Kgy1KqdYazA2QcFpBOQyR1xCyBdIyxQ6fziWyY5zErD96I4OT8jgqprxo/grMhHbnE PTuYrwppjVS++yDL3YNPW++tyrWNMpptDXEoxgFyt9MST6B3eD5a0+5Hy+yPN/PR7B FeWnKDFRhU9iAvgklAQMw65M+smfCIwYZe+2BWubtXIbYSZ/UBnCKCqztZBisZVKVs XbhnagBxq7xMBZ02FkQaX11LreKY6NtdhnKin6mj1NSHX5HsLOKCG7g9KWQq+WXm4v Ea2yCjd1Px2SA== Received: (nullmailer pid 1154620 invoked by uid 1000); Thu, 10 Aug 2023 20:51:07 -0000 Date: Thu, 10 Aug 2023 14:51:07 -0600 From: Rob Herring To: Dumitru Ceclan Cc: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Krzysztof Kozlowski , Conor Dooley , Andy Shevchenko , Cosmin Tanislav , Arnd Bergmann , ChiaEn Wu , ChiYuan Huang , Hugo Villeneuve , Haibo Chen , Ibrahim Tilki , Ramona Bolboaca , William Breathitt Gray , Leonard =?iso-8859-1?Q?G=F6hrs?= , Ceclan Dumitru , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] dt-bindings: adc: add AD717X Message-ID: <20230810205107.GA1136590-robh@kernel.org> References: <20230810093322.593259-1-mitrutzceclan@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230810093322.593259-1-mitrutzceclan@gmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 On Thu, Aug 10, 2023 at 12:33:16PM +0300, Dumitru Ceclan wrote: > The AD717x 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. > > Signed-off-by: Dumitru Ceclan > --- > .../bindings/iio/adc/adi,ad717x.yaml | 158 ++++++++++++++++++ > 1 file changed, 158 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad717x.yaml > > diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad717x.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad717x.yaml > new file mode 100644 > index 000000000000..f12926e69958 > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad717x.yaml > @@ -0,0 +1,158 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +# Copyright 2023 Analog Devices Inc. > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/iio/adc/adi,ad717x.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Analog Devices AD717X ADC family SPI driver Drop 'SPI driver'. This is not a driver. > + > +maintainers: > + - Ceclan Dumitru > + > +description: | > + Bindings for the Analog Devices AD717X ADC's. Datasheets for supported chips: > + https://www.analog.com/media/en/technical-documentation/data-sheets/AD7172-2.pdf > + https://www.analog.com/media/en/technical-documentation/data-sheets/AD7173-8.pdf > + https://www.analog.com/media/en/technical-documentation/data-sheets/AD7175-2.pdf > + https://www.analog.com/media/en/technical-documentation/data-sheets/AD7176-2.pdf > + > +properties: > + compatible: > + enum: > + - adi,ad7172-2 > + - adi,ad7173-8 > + - adi,ad7175-2 > + - adi,ad7176-2 > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + '#address-cells': > + const: 1 > + > + '#size-cells': > + const: 0 > + > + spi-max-frequency: > + maximum: 20000000 > + > + spi-cpol: > + type: boolean > + > + spi-cpha: > + type: boolean > + > + adi,temp-channel: > + description: > + Enables temperature reading channel > + type: boolean > + > + dependencies: > + adi,temp-channel: > + compatible: > + enum: > + - adi,ad7172-2 > + - adi,ad7173-8 > + - adi,ad7175-2 That's not actually valid schema. You are missing "properties" above "compatible". I'm also not sure the tools which do a number of fixups/transforms on schemas would handle this. I do think this is a bit nicer than the if/then schemas we normally use for restricting properties by compatibles. > + > + Extra blank line. > + required: > + - compatible > + - reg > + - interrupts > + - spi-cpol > + - spi-cpha If the device(s) are not configurable, then you shouldn't need these 2 properties. The driver can hardcode the correct setting. > + > +patternProperties: > + "^channel@([0-9a-f])$": Don't need (). > + type: object > + $ref: adc.yaml > + unevaluatedProperties: false > + > + properties: > + reg: > + description: Channel number > + minimum: 0 > + maximum: 15 > + > + diff-channels: > + description: > + Analog input pins > + items: > + minimum: 0 > + maximum: 31 > + > + adi,bipolar: > + description: Specify if the channel should measure in bipolar mode. > + type: boolean > + > + required: > + - reg > + - diff-channels > + > +allOf: > + - $ref: /schemas/spi/spi-peripheral-props.yaml# > + > +unevaluatedProperties: false > + > +examples: > + - | > + #include > + #include > + > + spi { > + status = "okay"; Drop status. You need #address-cells and #size-cells. Did you test this? > + > + ad7173@0 { > + compatible = "adi,ad7173-8"; > + reg = <0>; > + > + #address-cells = <1>; > + #size-cells = <0>; > + > + interrupts = <25 IRQ_TYPE_EDGE_FALLING>; > + interrupt-parent = <&gpio>; > + spi-max-frequency = <5000000>; > + spi-cpol; > + spi-cpha; > + > + adi,temp-channel; > + > + channel@0 { > + reg = <0>; > + adi,bipolar; > + > + diff-channels = <0 1>; > + }; > + > + channel@1 { > + reg = <1>; > + > + diff-channels = <2 3>; > + }; > + > + channel@2 { > + reg = <2>; > + adi,bipolar; > + > + diff-channels = <4 5>; > + }; > + > + channel@3 { > + reg = <3>; > + adi,bipolar; > + > + diff-channels = <6 7>; > + }; > + > + channel@4 { > + reg = <4>; > + > + diff-channels = <8 9>; > + }; > + }; > + }; > -- > 2.30.2 >