From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18174C17440 for ; Sat, 9 Nov 2019 12:56:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D80A821882 for ; Sat, 9 Nov 2019 12:56:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573304198; bh=ruOl9OKhH8I+jv/Zqo/kN3RszLAM0zMoLnCEwtHAnoM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=STkz24z2+OD6Wh6EWTQOYL8h+SSgvZFRT04MJn+aAOm3Uz/DemxoYDRkSvlpqxBfQ 54SXfYU3d33iyq1fqMXbd5PgeT/Y09bXwnByhE6nzEhpFTRdm9NK+PoeXzG9tfrqoB CAHhos9s4Y3nk7UNJHaVZOqVZrkSvczCHmgMJOhY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726390AbfKIM4h (ORCPT ); Sat, 9 Nov 2019 07:56:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:46772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726267AbfKIM4g (ORCPT ); Sat, 9 Nov 2019 07:56:36 -0500 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (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 3A9B321848; Sat, 9 Nov 2019 12:56:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573304195; bh=ruOl9OKhH8I+jv/Zqo/kN3RszLAM0zMoLnCEwtHAnoM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mKxw6pj/wW4yKKVBwgAU5QBYv3LPXWzIBZ2e0t7RS7q1CKQ674TMte/wZ2MJLvSKz fSo7zy+1/xOlqHiSNSOI2jxHrgAOvlHaC5FOriOn/9NoNEBOkvRl0IR+qTL4mBV0rm d+oXOBNY+aNwPh6zbT4WZeDmxa65CQsBfswtekj4= Date: Sat, 9 Nov 2019 12:56:29 +0000 From: Jonathan Cameron To: Rob Herring Cc: Rodrigo Carvalho , Lars-Peter Clausen , Michael Hennerich , Stefan Popa , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman , linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, kernel-usp@googlegroups.com Subject: Re: [PATCH v3] dt-bindings: iio: accel: add binding documentation for ADIS16240 Message-ID: <20191109125629.71b8d3e6@archlinux> In-Reply-To: <20191105201932.GA24515@bogus> References: <20191101000301.12901-1-rodrigorsdc@gmail.com> <20191105201932.GA24515@bogus> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 5 Nov 2019 14:19:32 -0600 Rob Herring wrote: > On Thu, Oct 31, 2019 at 09:03:01PM -0300, Rodrigo Carvalho wrote: > > This patch add device tree binding documentation for ADIS16240. > > > > Signed-off-by: Rodrigo Ribeiro Carvalho > > --- > > V3: > > - Remove spi-cpol and spi-cpha field. They don't seem necessary > > Not necessary to document or use? The latter requires the former. > > If your device only supports one timing mode, then you don't need them > because it should be implied and the driver can just tell the SPI > subsystem what mode it requires. If the device can support multiple > timing modes, then you should document that you are using the > properties. The diagram in the datasheet is less than clear and the driver doesn't currently enforce anything. Looks like clock is high when in active and fall so CPOL, as per SPI docs though this might not matter... Sampling on rising edge (that's the bit that is unclear) so CPHA, but the timing is such that you can probably get away with not setting that. As Rob said, makes sense for driver to enforce the documented correct mode and not have anything in the binding. We should probably audit all drivers for this at somepoint and drop the binding requirements for ones that have only one supported mode. Jonathan > > > .../bindings/iio/accel/adi,adis16240.yaml | 51 +++++++++++++++++++ > > 1 file changed, 51 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml > > > > diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml > > new file mode 100644 > > index 000000000000..9a4cd12c4818 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml > > @@ -0,0 +1,51 @@ > > +# SPDX-License-Identifier: GPL-2.0 > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/iio/accel/adi,adis16240.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: ADIS16240 Programmable Impact Sensor and Recorder driver > > + > > +maintainers: > > + - Alexandru Ardelean > > + > > +description: | > > + ADIS16240 Programmable Impact Sensor and Recorder driver that supports > > + SPI interface. > > + https://www.analog.com/en/products/adis16240.html > > + > > +properties: > > + compatible: > > + enum: > > + - adi,adis16240 > > + > > + reg: > > + maxItems: 1 > > + > > + interrupts: > > + maxItems: 1 > > + > > +required: > > + - compatible > > + - reg > > + - interrupts > > + > > +examples: > > + - | > > + #include > > + #include > > + spi0 { > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + /* Example for a SPI device node */ > > + accelerometer@0 { > > + compatible = "adi,adis16240"; > > + reg = <0>; > > + spi-max-frequency = <2500000>; > > + spi-cpol; > > + spi-cpha; > > + interrupt-parent = <&gpio0>; > > + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; > > + }; > > + }; > > -- > > 2.23.0 > >