Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp418980rwb; Sun, 6 Nov 2022 07:53:42 -0800 (PST) X-Google-Smtp-Source: AMsMyM7E+zAdrIWAM/Hz2sXCawNx4NRrQvYb/R0LYmc22LmPmJbawGlnF/AeP0sJJnl+CqSLp3OD X-Received: by 2002:a63:ce43:0:b0:45b:d6ed:6c2 with SMTP id r3-20020a63ce43000000b0045bd6ed06c2mr39116600pgi.406.1667750022020; Sun, 06 Nov 2022 07:53:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667750022; cv=none; d=google.com; s=arc-20160816; b=om91591lpSpcNendIedgVPT8LcjodwSEChh80Nl6K16/TjDBTe9NZ0w/n0TyfU4+1b VNE3Pg8PNSVOmi6uwFmnbhMUmH3heBSNg9NOLL5tCzlzFxzdoVdCwpzBmL4nxUiXbp83 hXIu+bCJydprvf1ZC0nA1kgBizRQiEfZa7ojXf1EVvdlRutg2oEgyPUhxYhFSCRy6u08 LzQ2Zf4EI8Uh04y6lMCgGCxrzGLq3lGbG7qSq6DccHUJW5FbNTh62JZFqILthtE1DHkX kukI20rr82LTrNGjqnlP6gyAtDEWjxqC0LqNSC/xTa2xOhRbRcKsp0pKdD+Xp4vxh4Zi xxXQ== 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 :dkim-signature; bh=OesZdO9bCo6KGwO9b6eGQ/fial04JaibOWde1QHNUrI=; b=UrfqYdQKG6uCwZTClwnkOGD1wIub+CGvGvclKF1EJEiM8Kb7Xcbu2LLApufDBrQ1hk 58klriEsw3BJSFsCIYVVn7wZqyktYxDCOwdpjh40LjxIj8MqMNvFdNssL2kDhMlr7IFq 6h645s4VGEiLcTsYDXey0j8ix8TK0ijnxlNEDAg79P9Hhl/Ize9k5Oin8jXqwUGQNMi7 FD3acFyu8H9hQ8/FTfo2w4MMAFmbyF7j0lvhynj5XOgin/B2cnW6BzAQrbPHVOGYj7xi r15DER6fMAD2RGIK4JUIWfnYiyIDHuwrLGUU3teK06nWEsyNgxrfD3aZaQOaVpKhOMsC PphA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BHUoGGLX; 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 h191-20020a636cc8000000b0046f63d17422si5658826pgc.359.2022.11.06.07.53.29; Sun, 06 Nov 2022 07:53:42 -0800 (PST) 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=BHUoGGLX; 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 S230145AbiKFPqs (ORCPT + 97 others); Sun, 6 Nov 2022 10:46:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230139AbiKFPqq (ORCPT ); Sun, 6 Nov 2022 10:46:46 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DADF6D2EE; Sun, 6 Nov 2022 07:46:45 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 80BC260BFF; Sun, 6 Nov 2022 15:46:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D3C0C433C1; Sun, 6 Nov 2022 15:46:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667749604; bh=uD5uha/gAGU0ejpz7W/EQnX5lrbypbUC7aV5rXsGakk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BHUoGGLXtsS59WT1qYEdWFIJ/U6vupy6vaxYYOruTa0Yq8SC75JoWpeHih077sdBh LGGXY+J9Rvuc2SoLW7S/PM0nNWoxj6u9dRpr56sTbCX9Y7VjUZ0uTlQ7vpT8GyN9Ch adGRSBUWI6d3uRg2hUKwqGQ2eCty0wMr7PDW+5MqVS/uGM5S6l2i7O5g+OgaBTiyRT /NE8Y18TuHNcz0eNOIzqxVCfx0PYCrgB1xtw43EXQEWuk8ANfAdIxg4g2UdFqJmXOD FaoMpLjXYl1JDIwu4vkxw70+VE9a5PMVaGvF87fHZI92mxBhrQ31Jm9cxnwJSJ8S8t 1VgZFEoRMsdLw== Date: Sun, 6 Nov 2022 15:46:34 +0000 From: Jonathan Cameron To: Cosmin Tanislav Cc: Cosmin Tanislav , Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Linus Walleij , William Breathitt Gray , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] dt-bindings: iio: addac: add AD74115 Message-ID: <20221106154634.2286faf3@jic23-huawei> In-Reply-To: <20221103094436.2136698-2-demonsingur@gmail.com> References: <20221103094436.2136698-1-demonsingur@gmail.com> <20221103094436.2136698-2-demonsingur@gmail.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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, 3 Nov 2022 11:44:35 +0200 Cosmin Tanislav wrote: > From: Cosmin Tanislav > > The AD74115H is a single-channel, software-configurable, input and > output device for industrial control applications. The AD74115H > provides a wide range of use cases, integrated on a single chip. > > These use cases include analog output, analog input, digital output, > digital input, resistance temperature detector (RTD), and thermocouple > measurement capability. The AD74115H also has an integrated HART modem. > > A serial peripheral interface (SPI) is used to handle all communications > to the device, including communications with the HART modem. The digital > input and digital outputs can be accessed via the SPI or the > general-purpose input and output (GPIO) pins to support higher > speed data rates. > > The device features a 16-bit, sigma-delta analog-to-digital converter > (ADC) and a 14-bit digital-to-analog converter (DAC). > The AD74115H contains a high accuracy 2.5 V on-chip reference that can > be used as the DAC and ADC reference. > > Signed-off-by: Cosmin Tanislav Hi Cosmin, A few questions inline. Complex device so I'll doubt we'll ever get this binding to be as tidy as for simpler devices. Hence most of the below are suggestions rather than requirements from me. Jonathan > --- > .../bindings/iio/addac/adi,ad74115.yaml | 370 ++++++++++++++++++ > MAINTAINERS | 7 + > 2 files changed, 377 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml > > diff --git a/Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml b/Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml > new file mode 100644 > index 000000000000..621f11d5c1f3 > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml > @@ -0,0 +1,370 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/iio/addac/adi,ad74115.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Analog Devices AD74115H device > + > +maintainers: > + - Cosmin Tanislav > + > +description: | > + The AD74115H is a single-channel software configurable input/output > + device for industrial control applications. It contains functionality for > + analog output, analog input, digital output, digital input, resistance > + temperature detector, and thermocouple measurements integrated into a single > + chip solution with an SPI interface. The device features a 16-bit ADC and a > + 14-bit DAC. > + > + https://www.analog.com/en/products/ad74115h.html > + > +properties: > + compatible: > + enum: > + - adi,ad74115h > + > + reg: > + maxItems: 1 > + > + '#address-cells': > + const: 1 > + > + '#size-cells': > + const: 0 I'm not seeing any child nodes, so why do we need these two? > + > + avdd-supply: true > + avcc-supply: true > + dvcc-supply: true > + aldo1v8-supply: true aldo1v8 is an output pin. "1.8 V Analog LDO Output. Do not use ALDO1V8 externally." The associated input is avcc. Given we shouldn't connect anything to the pin, we don't want it in the binding docs > + dovdd-supply: true > + refin-supply: true > + ... > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: | > + Conversion range for ADC conversion 2. > + 0 - 0V to 12V > + 1 - -12V to +12V > + 2 - -2.5V to +2.5V > + 3 - -2.5V to 0V > + 4 - 0V to 2.5V > + 5 - 0V to 0.625V > + 6 - -104mV to +104mV > + 7 - 0V to 12V For a lot of similar cases we handle these numerically to give a human readable dts. Is there a strong reason not to do so here (in mv) > + minimum: 0 > + maximum: 7 > + default: 0 > + > + adi,sense-agnd-buffer-lp: lp is a little ambiguous, given we have a habit of using it for low pass in filters etc. Perhaps worth spelling these out? adi,sens-agnd-buffer-low-power etc? > + type: boolean > + description: | > + Whether to enable low-power buffered mode for the AGND sense pin. > + > + adi,lf-buffer-lp: > + type: boolean > + description: | > + Whether to enable low-power buffered mode for the low-side filtered > + sense pin. > + > + adi,hf-buffer-lp: > + type: boolean > + description: | > + Whether to enable low-power buffered mode for the high-side filtered > + sense pin. > + > + adi,ext2-buffer-lp: > + type: boolean > + description: Whether to enable low-power buffered mode for the EXT2 pin. > + > + adi,ext1-buffer-lp: > + type: boolean > + description: Whether to enable low-power buffered mode for the EXT1 pin. > + > +required: > + - compatible > + - reg > + - spi-cpol > + - avdd-supply > + > +allOf: > + - $ref: /schemas/spi/spi-peripheral-props.yaml# > + - if: > + properties: > + adi,digital-input-sink-range-high: true > + then: > + properties: > + adi,digital-input-sink-microamp: > + maximum: 7400 > + > +additionalProperties: false Does this need to be unevalutatedProperties to allow for the extra ones in spi-periphera-props.yaml? > +