Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp1995781pxt; Sun, 8 Aug 2021 08:08:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXn/pxqjTrcl7ID/FxGkxIiI7OCQX1nKB5ZcOqKPjpGqoq5BUD/XTObfDrh0SNP1M72LP3 X-Received: by 2002:a17:907:3e0d:: with SMTP id hp13mr18068802ejc.372.1628435323448; Sun, 08 Aug 2021 08:08:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628435323; cv=none; d=google.com; s=arc-20160816; b=nqOILQXbNP4nCT1Qb+eXqNpmlmjqSTWINwM34d9RUJtxVsMGU7oRw5RYw137KjLLNx BT0Oihjs0PQkYsfg5+qVDt+R7okoMFj6kNP1tB14pTUxODtyXYL0mPqxeIDfCgMCqovW ll9OgcNfz6L4UWdF1YELe0xghpvmnguYehPfKUJbKQndLQe2bUfP+HscQy2C7QMtel5P rUg4Rx38Zf17lmZQzMWq8wQwl+ubKZSSKuzSfqat1C3JOaJtweUtY35PctzhWOQuwTpC mDz4BSvzqmMvxod3oUEAlX7L3wh1slGAD8e6jt59NuQfKP9mzzIwZZp46BZdcDOdkO0O 0kSw== 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; bh=dFwTdpTLmCk/j08oxsjUCYRGg05n4qbAi6EnBRo5jNw=; b=XYSiH72rJHt/gzmprnT+JL/MlEXxa7Hv8cjz4UgA7LaLpfSznlhUJHhKwAqbvjq1bE 22o4Lb+zMsGv78rJPM4YVSrqxfogau+Ad2dHi4W++DhDrMaSuEs5X+HwiAbODFCe8djj BpjlpG3lJp3hssi+W9+uOQoj/p2Bko0r+Hc9QJQU+mQ4ifCnQuybE38PGALloy+Kf2fl zS2vXbilmlrRaDqb+1Juvcw5QzMwEpC8fLwlggyv/AbevEMGh/AlY+FPG58eeLZn12AT rWTxMbc9Nk3bdOmIjQw/zFmibTmSTvZsm/PzJHwls0x53lKobWJY4LHDthRAGHQtvphW FtNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v11si180179ejb.644.2021.08.08.08.08.03; Sun, 08 Aug 2021 08:08:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231576AbhHHOnO (ORCPT + 99 others); Sun, 8 Aug 2021 10:43:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:44910 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229923AbhHHOnN (ORCPT ); Sun, 8 Aug 2021 10:43:13 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7ED1760F0F; Sun, 8 Aug 2021 14:42:52 +0000 (UTC) Date: Sun, 8 Aug 2021 15:45:41 +0100 From: Jonathan Cameron To: Lucas Stankus Cc: Rob Herring , Lars-Peter Clausen , "Hennerich, Michael" , "Bogdan, Dragos" , "Berghe, Darius" , linux-iio , devicetree , Linux Kernel Mailing List Subject: Re: [PATCH v2 1/2] dt-bindings: iio: accel: Add binding documentation for ADXL313 Message-ID: <20210808154541.276e6685@jic23-huawei> In-Reply-To: References: X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 6 Aug 2021 21:33:44 -0300 Lucas Stankus wrote: > On Fri, Aug 6, 2021 at 3:10 PM Rob Herring wrote: > > > > On Thu, Aug 05, 2021 at 03:29:37AM -0300, Lucas Stankus wrote: > > > Add device tree binding documentation for ADXL313 3-axis accelerometer. > > > > > > Signed-off-by: Lucas Stankus > > > --- > > > .../bindings/iio/accel/adi,adxl313.yaml | 90 +++++++++++++++++++ > > > 1 file changed, 90 insertions(+) > > > create mode 100644 Documentation/devicetree/bindings/iio/accel/adi,adxl313.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl313.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adxl313.yaml > > > new file mode 100644 > > > index 000000000000..fea03b6790f3 > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl313.yaml > > > @@ -0,0 +1,90 @@ > > > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause > > > +%YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/iio/accel/adi,adxl313.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: Analog Devices ADXL313 3-Axis Digital Accelerometer > > > + > > > +maintainers: > > > + - Lucas Stankus > > > + > > > +description: | > > > + Analog Devices ADXL313 3-Axis Digital Accelerometer that supports > > > + both I2C & SPI interfaces. > > > + https://www.analog.com/en/products/adxl313.html > > > + > > > +properties: > > > + compatible: > > > + enum: > > > + - adi,adxl313 > > > + > > > + reg: > > > + maxItems: 1 > > > + > > > + spi-3wire: true > > > + > > > + spi-cpha: true > > > + > > > + spi-cpol: true > > > > These 3 generally shouldn't be needed, but can be set from the driver. > > If they are valid, is any combination of them really valid? > > > > Only the 3wire is optional, both cpha and cpol are required for proper > spi connection. We've been round this one a few time, and last time we discussed the cases where you'd need these in DT (because of inverters on the bus) https://lore.kernel.org/linux-iio/20191204111231.GO1998@sirena.org.uk/ conclusion was, that we don't want to put the burden on the dt files for those odd cases. The equivalent for interrupt lines is interestingly different because in those cases the two-cell version includes the type of interrupt, so it makes little sense to push that down into the drivers as well. Mind you I'm not 100% sure how we would retrofit a binding if necessary for the inverted cases. Hope we don't hit one here :) As you note, 3wire is needed in the binding because it's optional. Jonathan > > > > + > > > + spi-max-frequency: true > > > + > > > + vs-supply: > > > + description: Regulator that supplies power to the accelerometer > > > + > > > + vdd-supply: > > > + description: Regulator that supplies the digital interface supply voltage > > > + > > > + interrupts: > > > + maxItems: 2 > > > > This means there must be 2 entries. If 1 is valid, you need 'minItems'. > > > > I'll add 'minItems' for the v3 then, thanks! > > > > + > > > + interrupt-names: > > > + maxItems: 2 > > > > You need 'minItems' too to fix the error. > > > > Thank you again and sorry for not catching that error before submitting. > > > > + items: > > > + enum: > > > + - INT1 > > > + - INT2 > > > + > > > +required: > > > + - compatible > > > + - reg > > > + > > > +additionalProperties: false > > > + > > > +examples: > > > + - | > > > + #include > > > + #include > > > + i2c0 { > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + > > > + /* Example for a I2C device node */ > > > + accelerometer@53 { > > > + compatible = "adi,adxl313"; > > > + reg = <0x53>; > > > + interrupt-parent = <&gpio0>; > > > + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; > > > + interrupt-names = "INT1"; > > > + }; > > > + }; > > > + - | > > > + #include > > > + #include > > > + spi { > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + > > > + /* Example for a SPI device node */ > > > + accelerometer@0 { > > > + compatible = "adi,adxl313"; > > > + reg = <0>; > > > + spi-max-frequency = <5000000>; > > > + spi-cpol; > > > + spi-cpha; > > > + interrupt-parent = <&gpio0>; > > > + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; > > > + interrupt-names = "INT1"; > > > + }; > > > + }; > > > -- > > > 2.32.0 > > > > > >