Message ID | 20230918080314.11959-2-jagathjog1996@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2703349vqi; Mon, 18 Sep 2023 07:31:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFRS53mG8VAPRTnfDCUBzyHotE7rUGEdaGSu0rNIVlDkckpb/YL1TrBSzySXkKCMJa9Yis X-Received: by 2002:a05:6a20:7d96:b0:137:23f1:4281 with SMTP id v22-20020a056a207d9600b0013723f14281mr8874756pzj.12.1695047488938; Mon, 18 Sep 2023 07:31:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695047488; cv=none; d=google.com; s=arc-20160816; b=CCx5xuhKaagWhsGdSNppfU2+RBHfCbWKU9FoCHBiIOBuRZ5nXrkAODU39GnW/MUe6b aakwPia8fUIg9oZ7M8B5kZt23OTKQYnOB3giFPeNrJQo/KZim/lhbvy0VWXg6I3SJGQ2 forZnN7qeO1SpRJ/UJOb6wpYdxmr6qr7sx6Oa2s0NeagEnUBmbeucIGx0LiX+uQTzvEG aLdoUqsqa8SDMGqOz36BgGRYm+Gi5AdQskBYq2L6kHtQkkeuZV3+3/jGUuJBNhTtkAlr 8Acdzgtn8w4Jy2Dc1VpM2SPFPJgETlgZORJz2JrJbQDSccKulek0oM4uHNQFaCPv2Be7 Vd6Q== 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:date:subject:cc:to:from :dkim-signature; bh=fMDBjV7ZdvjpiKYjnQ9ji2BJe9Llm9jhB+hSl4BOnZs=; fh=MiBlpE3Jb5j7gopYr3sZ3cHhGlgu/rlJercmH7sUAJk=; b=m6R1hMETELWpiTHNNB5CytCzFAbrp7VeTF8GPCIBcySwsq4Fze8z8IvBh4vxoOB7G5 dBNib65JQvyqXocNUKASr1NR4dkiCknefKeORHAbXjBpqoZaYj1gF0VAGXsw3FAxk0tD mpkytsfDeJsFQrDt65q7CAaw1vF2vbo9vDmLkRYf7amk5fKia5K4hCTSCb0vpGWOQpFq IBbmXU8N3dEB1/F+Rzk3sTx29g4ZbL9VkkyaMjc61UBP7tJqEtELCtp7dG8X3OE+9U1F fcBpLNLreKJNpxKC1wDK/lw71kGf1CpHqTCWpy9bPgOKK6apDlxAkcAO1CN0eRupGCqi IkvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YFdylu1x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id r69-20020a632b48000000b00573f9dbea23si7879514pgr.431.2023.09.18.07.31.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 07:31:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YFdylu1x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 6B916809B744; Mon, 18 Sep 2023 01:05:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238636AbjIRIEY (ORCPT <rfc822;kernel.ruili@gmail.com> + 27 others); Mon, 18 Sep 2023 04:04:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240451AbjIRIDu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 18 Sep 2023 04:03:50 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACEAA197; Mon, 18 Sep 2023 01:03:23 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1c3bd829b86so29929085ad.0; Mon, 18 Sep 2023 01:03:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695024203; x=1695629003; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fMDBjV7ZdvjpiKYjnQ9ji2BJe9Llm9jhB+hSl4BOnZs=; b=YFdylu1xirAND2CU3V2TjiFJuHh7/pSOGbIlh7l+BvzioafoIKeUoo2MiMpNEdPG/B PLkmkoMqmajf23goODDv3uJDTmstqNTvKqOGh/JR3tyhf/v8RuvMNj5CNIIaCJaTkj1S J/cPGFcqfRs//T2Gcap40Vy/6I/arK2ePAKWqADWADTL4r7u3QHvqIaqL5ArkpukfPpI KHLrftf5coVY0JChKurYKtDTifTYNsZoxzIeq4QsTy3+epynEYaN3/EEtggS7NpxIGIU SOtZ5gsCTS+w7rMWpKY0a5cWQLCH0kWSfCiMY6QJvFl1l1A0CtdmJm/BKvK7R6H0YB5a gZ/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695024203; x=1695629003; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fMDBjV7ZdvjpiKYjnQ9ji2BJe9Llm9jhB+hSl4BOnZs=; b=t0yTJOIwlE5FjzS6kLWDNiAEIsEPDV2oXMriowHpURehcM2s0zlFIaFDdeDFt46Dks fLo6Mpiz5eik1a+32ZztlmcI9Cla7zNKdjoWTMzOeRSO38YnKMbclkqWqp8JGcGETE7C HP42Qlso1t2g7BuUiwE8IDQDS+xtAOt87f3hxvFX0I9hijv7wku67qrKJ9mUj9BO4o8v N9fx+0ILK3Gj5KR1ePC61R/bHDyK8m9TqIRJ0ab/vlu2bUdcC9nQ36U+UoKPqcyBekRJ d2UgwIMnA2q5REpovwnI9huf4Xa42OZEyNOwerc1SOkVnTl5Cf++GH8w0pnlcdO+4xsI WiJA== X-Gm-Message-State: AOJu0YyrdOvTc4hb4AFwsc3xWQyGF86/Vzb2mNQToSxLSTV1asGcIGTG n5jpiOW5D5I6wag1HdX4Wow= X-Received: by 2002:a17:902:e84a:b0:1c5:69fa:23e9 with SMTP id t10-20020a170902e84a00b001c569fa23e9mr2100956plg.58.1695024202898; Mon, 18 Sep 2023 01:03:22 -0700 (PDT) Received: from localhost.localdomain ([115.96.179.37]) by smtp.gmail.com with ESMTPSA id w18-20020a1709029a9200b001bde877a7casm7716161plp.264.2023.09.18.01.03.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 01:03:22 -0700 (PDT) From: Jagath Jog J <jagathjog1996@gmail.com> To: jic23@kernel.org, andriy.shevchenko@linux.intel.com, lars@metafoo.de, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC 1/2] dt-bindings: iio: imu: Add DT binding doc for BMI323 Date: Mon, 18 Sep 2023 13:33:13 +0530 Message-Id: <20230918080314.11959-2-jagathjog1996@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230918080314.11959-1-jagathjog1996@gmail.com> References: <20230918080314.11959-1-jagathjog1996@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 18 Sep 2023 01:05:14 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777386115599415056 X-GMAIL-MSGID: 1777386115599415056 |
Series |
iio: imu: Add driver and dt-bindings for BMI323
|
|
Commit Message
Jagath Jog J
Sept. 18, 2023, 8:03 a.m. UTC
Add devicetree description document for Bosch BMI323, a 6-Axis IMU.
Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com>
---
.../bindings/iio/imu/bosch,bmi323.yaml | 81 +++++++++++++++++++
1 file changed, 81 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml
Comments
On 18/09/2023 10:03, Jagath Jog J wrote: > Add devicetree description document for Bosch BMI323, a 6-Axis IMU. I don't know why this is RFC and cover letter does not explain it. Shall I just ignore it? Patch is no ready? Recently at least two times someone was disappointed that his code marked as RFC received my review. A nit, subject: drop second/last, redundant "DT binding doc for". The "dt-bindings" prefix is already stating that these are bindings. Four words entirely redundant and duplicating what prefix is saying... > > Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com> > --- > .../bindings/iio/imu/bosch,bmi323.yaml | 81 +++++++++++++++++++ > 1 file changed, 81 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml > > diff --git a/Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml b/Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml > new file mode 100644 > index 000000000000..9c08988103c5 > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml > @@ -0,0 +1,81 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/iio/imu/bosch,bmi323.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Bosch BMI323 6-Axis IMU > + > +maintainers: > + - Jagath Jog J <jagathjog1996@gmail.com> > + > +description: > + BMI323 is a 6-axis inertial measurement unit that supports acceleration and > + gyroscopic measurements with hardware fifo buffering. Sensor also provides > + events information such as motion, steps, orientation, single and double > + tap detection. > + > +properties: > + compatible: > + const: bosch,bmi323 > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + interrupt-names: > + enum: > + - INT1 > + - INT2 > + description: | Do not need '|' unless you need to preserve formatting. > + set to "INT1" if INT1 pin should be used as interrupt input, set > + to "INT2" if INT2 pin should be used instead And what happens with other INT pin? Remains floating? > + > + drive-open-drain: > + description: | Do not need '|' unless you need to preserve formatting. > + set if the specified interrupt pin should be configured as > + open drain. If not set, defaults to push-pull. Missing supplies. Are you sure device does not use any electric energy? > + > +required: > + - compatible > + - reg > + > +allOf: > + - $ref: /schemas/spi/spi-peripheral-props.yaml# > + > +unevaluatedProperties: false > + > +examples: > + - | > + // Example for I2C > + #include <dt-bindings/interrupt-controller/irq.h> > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > +> + bmi323@68 { Node names should be generic. See also an explanation and list of examples (not exhaustive) in DT specification: https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation > + compatible = "bosch,bmi323"; > + reg = <0x68>; > + interrupt-parent = <&gpio1>; > + interrupts = <29 IRQ_TYPE_EDGE_RISING>; > + interrupt-names = "INT1"; > + }; > + }; > + - | > + // Example for SPI > + #include <dt-bindings/interrupt-controller/irq.h> > + spi { It's the same as other example. No difference. Drop. Best regards, Krzysztof
Hi Krzysztof, On Mon, Sep 18, 2023 at 5:55 PM Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 18/09/2023 10:03, Jagath Jog J wrote: > > Add devicetree description document for Bosch BMI323, a 6-Axis IMU. > > I don't know why this is RFC and cover letter does not explain it. Shall > I just ignore it? Patch is no ready? Recently at least two times someone > was disappointed that his code marked as RFC received my review. Thank you for reviewing. This was the sensor's first patch series, so I initially submitted it as an RFC. I will mark it as "Patch" in the next series. > > A nit, subject: drop second/last, redundant "DT binding doc for". The > "dt-bindings" prefix is already stating that these are bindings. Four > words entirely redundant and duplicating what prefix is saying... Sure I will remove redundant words from the subject line. > > > > > > Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com> > > --- > > .../bindings/iio/imu/bosch,bmi323.yaml | 81 +++++++++++++++++++ > > 1 file changed, 81 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml > > > > diff --git a/Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml b/Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml > > new file mode 100644 > > index 000000000000..9c08988103c5 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml > > @@ -0,0 +1,81 @@ > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/iio/imu/bosch,bmi323.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Bosch BMI323 6-Axis IMU > > + > > +maintainers: > > + - Jagath Jog J <jagathjog1996@gmail.com> > > + > > +description: > > + BMI323 is a 6-axis inertial measurement unit that supports acceleration and > > + gyroscopic measurements with hardware fifo buffering. Sensor also provides > > + events information such as motion, steps, orientation, single and double > > + tap detection. > > + > > +properties: > > + compatible: > > + const: bosch,bmi323 > > + > > + reg: > > + maxItems: 1 > > + > > + interrupts: > > + maxItems: 1 > > + > > + interrupt-names: > > + enum: > > + - INT1 > > + - INT2 > > + description: | > > Do not need '|' unless you need to preserve formatting. > > > + set to "INT1" if INT1 pin should be used as interrupt input, set > > + to "INT2" if INT2 pin should be used instead > > And what happens with other INT pin? Remains floating?` Yes, the other pin is unconnected. The driver provides support for either INT1, INT2, or no interrupt configuration. I should have added minItems, maxItems, and const, I will add these in the next series. > > > + > > + drive-open-drain: > > + description: | > > Do not need '|' unless you need to preserve formatting. Sure I will remove this. > > > + set if the specified interrupt pin should be configured as > > + open drain. If not set, defaults to push-pull. > > Missing supplies. Are you sure device does not use any electric energy? Sorry, I missed adding supply, I will add it in the next series. > > > + > > +required: > > + - compatible > > + - reg > > + > > +allOf: > > + - $ref: /schemas/spi/spi-peripheral-props.yaml# > > + > > +unevaluatedProperties: false > > + > > +examples: > > + - | > > + // Example for I2C > > + #include <dt-bindings/interrupt-controller/irq.h> > > + i2c { > > + #address-cells = <1>; > > + #size-cells = <0>; > > +> + bmi323@68 { > > Node names should be generic. See also an explanation and list of > examples (not exhaustive) in DT specification: > https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation I intend to utilize the generic term 'imu' (representing the accelerometer and gyrometer) even though it's not listed in the generic-names recommendation. Would this be acceptable? > > > + compatible = "bosch,bmi323"; > > + reg = <0x68>; > > + interrupt-parent = <&gpio1>; > > + interrupts = <29 IRQ_TYPE_EDGE_RISING>; > > + interrupt-names = "INT1"; > > + }; > > + }; > > + - | > > + // Example for SPI > > + #include <dt-bindings/interrupt-controller/irq.h> > > + spi { > > > It's the same as other example. No difference. Drop. Sure I will keep only one example. > > Best regards, > Krzysztof > Regards, Jagath
On Tue, 19 Sep 2023 22:14:40 +0530 Jagath Jog J <jagathjog1996@gmail.com> wrote: > Hi Krzysztof, > > On Mon, Sep 18, 2023 at 5:55 PM Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: > > > > On 18/09/2023 10:03, Jagath Jog J wrote: > > > Add devicetree description document for Bosch BMI323, a 6-Axis IMU. > > > > I don't know why this is RFC and cover letter does not explain it. Shall > > I just ignore it? Patch is no ready? Recently at least two times someone > > was disappointed that his code marked as RFC received my review. > > Thank you for reviewing. This was the sensor's first patch series, > so I initially submitted it as an RFC. I will mark it as "Patch" > in the next series. Have more confidence! RFCs need to have clearly stated questions. If you don't have any then you are putting forwards driver for review in ordering to get it merged upstream - so PATCH is appropriate. As you'll see many IIO drivers go through a 'few' revisions once they are posted (hopefully not too many!) Krzysztof is great at reviewing whatever shows up, but in many cases reviewers won't look at an RFC (unless a big discussion starts) because they aren't interested in open questions, just code that the author considers ready. Jonathan
On Mon, 18 Sep 2023 13:33:13 +0530 Jagath Jog J <jagathjog1996@gmail.com> wrote: > Add devicetree description document for Bosch BMI323, a 6-Axis IMU. > > Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com> > --- > .../bindings/iio/imu/bosch,bmi323.yaml | 81 +++++++++++++++++++ > 1 file changed, 81 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml > > diff --git a/Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml b/Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml > new file mode 100644 > index 000000000000..9c08988103c5 > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml > @@ -0,0 +1,81 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/iio/imu/bosch,bmi323.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Bosch BMI323 6-Axis IMU > + > +maintainers: > + - Jagath Jog J <jagathjog1996@gmail.com> > + > +description: > + BMI323 is a 6-axis inertial measurement unit that supports acceleration and > + gyroscopic measurements with hardware fifo buffering. Sensor also provides > + events information such as motion, steps, orientation, single and double > + tap detection. > + > +properties: > + compatible: > + const: bosch,bmi323 > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + interrupt-names: > + enum: > + - INT1 > + - INT2 > + description: | > + set to "INT1" if INT1 pin should be used as interrupt input, set > + to "INT2" if INT2 pin should be used instead Why not both? Sure driver might elect to use only one, but the binding describes the hardware not the driver and both might be wired. Lots of different sources of interrupts so might be advantageous to split them up across two wires. A simple case being to route errors to one and everything 'good' to the other. No obligation to support that in the Linux driver though if you don't need to. > + > + drive-open-drain: > + description: | > + set if the specified interrupt pin should be configured as > + open drain. If not set, defaults to push-pull. Two pins. Might be different so you need two controls. > + > +required: > + - compatible > + - reg As mentioned, need power supplies specified and marked as required (though they may be provided via always on regulators and rely on stubs being created by the regulator subsystem on a given board). Looks like there are at least 2 supplies. > + > +allOf: > + - $ref: /schemas/spi/spi-peripheral-props.yaml# > + > +unevaluatedProperties: false > + > +examples: > + - | > + // Example for I2C > + #include <dt-bindings/interrupt-controller/irq.h> > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + bmi323@68 { > + compatible = "bosch,bmi323"; > + reg = <0x68>; > + interrupt-parent = <&gpio1>; > + interrupts = <29 IRQ_TYPE_EDGE_RISING>; > + interrupt-names = "INT1"; > + }; > + }; > + - | > + // Example for SPI > + #include <dt-bindings/interrupt-controller/irq.h> > + spi { > + #address-cells = <1>; > + #size-cells = <0>; > + > + bmi323@0 { > + compatible = "bosch,bmi323"; > + reg = <0>; > + spi-max-frequency = <10000000>; > + interrupt-parent = <&gpio2>; > + interrupts = <12 IRQ_TYPE_EDGE_FALLING>; > + interrupt-names = "INT2"; > + }; > + };
Hi Jonathan On Sun, Sep 24, 2023 at 7:01 PM Jonathan Cameron <jic23@kernel.org> wrote: > > On Tue, 19 Sep 2023 22:14:40 +0530 > Jagath Jog J <jagathjog1996@gmail.com> wrote: > > > Hi Krzysztof, > > > > On Mon, Sep 18, 2023 at 5:55 PM Krzysztof Kozlowski > > <krzysztof.kozlowski@linaro.org> wrote: > > > > > > On 18/09/2023 10:03, Jagath Jog J wrote: > > > > Add devicetree description document for Bosch BMI323, a 6-Axis IMU. > > > > > > I don't know why this is RFC and cover letter does not explain it. Shall > > > I just ignore it? Patch is no ready? Recently at least two times someone > > > was disappointed that his code marked as RFC received my review. > > > > Thank you for reviewing. This was the sensor's first patch series, > > so I initially submitted it as an RFC. I will mark it as "Patch" > > in the next series. > > Have more confidence! RFCs need to have clearly stated questions. > If you don't have any then you are putting forwards driver for review > in ordering to get it merged upstream - so PATCH is appropriate. > As you'll see many IIO drivers go through a 'few' revisions once they > are posted (hopefully not too many!) > > Krzysztof is great at reviewing whatever shows up, but in many > cases reviewers won't look at an RFC (unless a big discussion starts) because > they aren't interested in open questions, just code that the author considers > ready. Thank you for your feedback and guidance. I appreciate the insight into the RFC process and the importance of clearly stated questions. I'll keep this in mind when preparing future submissions. Regards Jagath > > Jonathan
HI Jonathan, On Sun, Sep 24, 2023 at 7:07 PM Jonathan Cameron <jic23@kernel.org> wrote: > > On Mon, 18 Sep 2023 13:33:13 +0530 > Jagath Jog J <jagathjog1996@gmail.com> wrote: > > > Add devicetree description document for Bosch BMI323, a 6-Axis IMU. > > > > Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com> > > --- > > .../bindings/iio/imu/bosch,bmi323.yaml | 81 +++++++++++++++++++ > > 1 file changed, 81 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml > > > > diff --git a/Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml b/Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml > > new file mode 100644 > > index 000000000000..9c08988103c5 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml > > @@ -0,0 +1,81 @@ > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/iio/imu/bosch,bmi323.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Bosch BMI323 6-Axis IMU > > + > > +maintainers: > > + - Jagath Jog J <jagathjog1996@gmail.com> > > + > > +description: > > + BMI323 is a 6-axis inertial measurement unit that supports acceleration and > > + gyroscopic measurements with hardware fifo buffering. Sensor also provides > > + events information such as motion, steps, orientation, single and double > > + tap detection. > > + > > +properties: > > + compatible: > > + const: bosch,bmi323 > > + > > + reg: > > + maxItems: 1 > > + > > + interrupts: > > + maxItems: 1 > > + > > + interrupt-names: > > + enum: > > + - INT1 > > + - INT2 > > + description: | > > + set to "INT1" if INT1 pin should be used as interrupt input, set > > + to "INT2" if INT2 pin should be used instead > > Why not both? Sure driver might elect to use only one, but the binding > describes the hardware not the driver and both might be wired. If both interrupt pins are wired, should the DTS file need to define both of the pins? > > Lots of different sources of interrupts so might be advantageous > to split them up across two wires. A simple case being to route > errors to one and everything 'good' to the other. No obligation to > support that in the Linux driver though if you don't need to. Sure I will split into two different wires in bindings. > > > + > > + drive-open-drain: > > + description: | > > + set if the specified interrupt pin should be configured as > > + open drain. If not set, defaults to push-pull. > > Two pins. Might be different so you need two controls. Sure, In bindings I will add two different drive controls. If both interrupt pins are wired with different drive options should the DTS file still define both of the pins? > > > + > > +required: > > + - compatible > > + - reg > > As mentioned, need power supplies specified and marked as required > (though they may be provided via always on regulators and rely on stubs > being created by the regulator subsystem on a given board). > Looks like there are at least 2 supplies. Sure, I will add 2 power supplies in the next series. Regards Jagath
On Thu, 28 Sep 2023 03:07:22 +0530 Jagath Jog J <jagathjog1996@gmail.com> wrote: > HI Jonathan, > > On Sun, Sep 24, 2023 at 7:07 PM Jonathan Cameron <jic23@kernel.org> wrote: > > > > On Mon, 18 Sep 2023 13:33:13 +0530 > > Jagath Jog J <jagathjog1996@gmail.com> wrote: > > > > > Add devicetree description document for Bosch BMI323, a 6-Axis IMU. > > > > > > Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com> > > > --- > > > .../bindings/iio/imu/bosch,bmi323.yaml | 81 +++++++++++++++++++ > > > 1 file changed, 81 insertions(+) > > > create mode 100644 Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml b/Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml > > > new file mode 100644 > > > index 000000000000..9c08988103c5 > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml > > > @@ -0,0 +1,81 @@ > > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > > > +%YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/iio/imu/bosch,bmi323.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: Bosch BMI323 6-Axis IMU > > > + > > > +maintainers: > > > + - Jagath Jog J <jagathjog1996@gmail.com> > > > + > > > +description: > > > + BMI323 is a 6-axis inertial measurement unit that supports acceleration and > > > + gyroscopic measurements with hardware fifo buffering. Sensor also provides > > > + events information such as motion, steps, orientation, single and double > > > + tap detection. > > > + > > > +properties: > > > + compatible: > > > + const: bosch,bmi323 > > > + > > > + reg: > > > + maxItems: 1 > > > + > > > + interrupts: > > > + maxItems: 1 > > > + > > > + interrupt-names: > > > + enum: > > > + - INT1 > > > + - INT2 > > > + description: | > > > + set to "INT1" if INT1 pin should be used as interrupt input, set > > > + to "INT2" if INT2 pin should be used instead > > > > Why not both? Sure driver might elect to use only one, but the binding > > describes the hardware not the driver and both might be wired. > > If both interrupt pins are wired, should the DTS file need to define > both of the pins? Yes it should. + we need the names to know which is which. You could rely on order, but it's more flexible to not do so, particularly when you also need to support case where only one is wired. Jonathan
Hi Jonathan, Few more questions before sending the next series. On Sat, Sep 30, 2023 at 9:35 PM Jonathan Cameron <jic23@kernel.org> wrote: > > On Thu, 28 Sep 2023 03:07:22 +0530 > Jagath Jog J <jagathjog1996@gmail.com> wrote: > > > HI Jonathan, > > > > On Sun, Sep 24, 2023 at 7:07 PM Jonathan Cameron <jic23@kernel.org> wrote: > > > > > > On Mon, 18 Sep 2023 13:33:13 +0530 > > > Jagath Jog J <jagathjog1996@gmail.com> wrote: > > > > > > > Add devicetree description document for Bosch BMI323, a 6-Axis IMU. > > > > > > > > Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com> > > > > + interrupts: > > > > + maxItems: 1 > > > > + > > > > + interrupt-names: > > > > + enum: > > > > + - INT1 > > > > + - INT2 > > > > + description: | > > > > + set to "INT1" if INT1 pin should be used as interrupt input, set > > > > + to "INT2" if INT2 pin should be used instead > > > > > > Why not both? Sure driver might elect to use only one, but the binding > > > describes the hardware not the driver and both might be wired. > > > > If both interrupt pins are wired, should the DTS file need to define > > both of the pins? > > Yes it should. + we need the names to know which is which. > You could rely on order, but it's more flexible to not do so, particularly > when you also need to support case where only one is wired. In the driver, I currently prioritize INT1 over INT2 when checking (bmi323_trigger_probe(..)) based on the interrupt-names defined in the device tree. However, I'm open to suggestions on the best way to ensure that the order doesn't affect the selection process when both interrupts are defined in the device tree. Each feature, such as data-ready, watermark, tap, and others, supports either INT1 or INT2. Based on the interrupt pin defined in the device tree, I configure the all the features accordingly. Regarding your earlier suggestion to have two different controls for drive-open-drain, do I need to define sensor-specific drive controls in bindings for both interrupt pins? for ex: bosch,irq{1,2}-open-drain Regards Jagath > > > Jonathan > >
On Sun, 8 Oct 2023 11:54:39 +0530 Jagath Jog J <jagathjog1996@gmail.com> wrote: > Hi Jonathan, > > Few more questions before sending the next series. > > On Sat, Sep 30, 2023 at 9:35 PM Jonathan Cameron <jic23@kernel.org> wrote: > > > > On Thu, 28 Sep 2023 03:07:22 +0530 > > Jagath Jog J <jagathjog1996@gmail.com> wrote: > > > > > HI Jonathan, > > > > > > On Sun, Sep 24, 2023 at 7:07 PM Jonathan Cameron <jic23@kernel.org> wrote: > > > > > > > > On Mon, 18 Sep 2023 13:33:13 +0530 > > > > Jagath Jog J <jagathjog1996@gmail.com> wrote: > > > > > > > > > Add devicetree description document for Bosch BMI323, a 6-Axis IMU. > > > > > > > > > > Signed-off-by: Jagath Jog J <jagathjog1996@gmail.com> > > > > > > + interrupts: > > > > > + maxItems: 1 > > > > > + > > > > > + interrupt-names: > > > > > + enum: > > > > > + - INT1 > > > > > + - INT2 > > > > > + description: | > > > > > + set to "INT1" if INT1 pin should be used as interrupt input, set > > > > > + to "INT2" if INT2 pin should be used instead > > > > > > > > Why not both? Sure driver might elect to use only one, but the binding > > > > describes the hardware not the driver and both might be wired. > > > > > > If both interrupt pins are wired, should the DTS file need to define > > > both of the pins? > > > > Yes it should. + we need the names to know which is which. > > You could rely on order, but it's more flexible to not do so, particularly > > when you also need to support case where only one is wired. > > In the driver, I currently prioritize INT1 over INT2 when checking > (bmi323_trigger_probe(..)) based on the interrupt-names defined > in the device tree. However, I'm open to suggestions on the best > way to ensure that the order doesn't affect the selection process > when both interrupts are defined in the device tree. If they are both present it is absolutely fine to pick one in preference to the other. > > Each feature, such as data-ready, watermark, tap, and others, supports > either INT1 or INT2. Based on the interrupt pin defined in the device tree, > I configure the all the features accordingly. That's an implementation choice to do them all based on one interrupt pin so absolutely fine to do that in the Linux driver, but the dt binding should allow for other choices as there are sometimes efficiency gains in doing so. > > Regarding your earlier suggestion to have two different controls for > drive-open-drain, do I need to define sensor-specific drive controls > in bindings for both interrupt pins? > for ex: bosch,irq{1,2}-open-drain Hmm. We do have precedence for a single control e.g. nxp,fxls8962af.yaml as drive-open-drain. So perhaps just go with that and if anyone is needs different values we can figure it out later. pin control (which is where that binding item comes from) seems to have examples doing much the same. Sets of pins with a single drive-open-drain entry. Linus, any comments on this as you've dealt with far more similar cases than me! Jonathan > > Regards > Jagath > > > > > > Jonathan > > > >
On Tue, Oct 10, 2023 at 10:59 AM Jonathan Cameron <jic23@kernel.org> wrote: > Jagath Jog J <jagathjog1996@gmail.com> wrote: > > Regarding your earlier suggestion to have two different controls for > > drive-open-drain, do I need to define sensor-specific drive controls > > in bindings for both interrupt pins? > > for ex: bosch,irq{1,2}-open-drain > > Hmm. We do have precedence for a single control e.g. > nxp,fxls8962af.yaml as drive-open-drain. So perhaps just go with that > and if anyone is needs different values we can figure it out later. > pin control (which is where that binding item comes from) seems to have > examples doing much the same. Sets of pins with a single drive-open-drain > entry. > > Linus, any comments on this as you've dealt with far more similar cases > than me! Also st,st-sensors use drive-open-drain. And that in turn is used because the pin control subsystem use that exact property. (See Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml) So use that. (I'm so happy to be able to provide a definitive answer for once!) Yours, Linus Walleij
On Tue, 10 Oct 2023 11:06:18 +0200 Linus Walleij <linus.walleij@linaro.org> wrote: > On Tue, Oct 10, 2023 at 10:59 AM Jonathan Cameron <jic23@kernel.org> wrote: > > Jagath Jog J <jagathjog1996@gmail.com> wrote: > > > > Regarding your earlier suggestion to have two different controls for > > > drive-open-drain, do I need to define sensor-specific drive controls > > > in bindings for both interrupt pins? > > > for ex: bosch,irq{1,2}-open-drain > > > > Hmm. We do have precedence for a single control e.g. > > nxp,fxls8962af.yaml as drive-open-drain. So perhaps just go with that > > and if anyone is needs different values we can figure it out later. > > pin control (which is where that binding item comes from) seems to have > > examples doing much the same. Sets of pins with a single drive-open-drain > > entry. > > > > Linus, any comments on this as you've dealt with far more similar cases > > than me! > > Also st,st-sensors use drive-open-drain. > > And that in turn is used because the pin control subsystem use that > exact property. (See > Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml) > > So use that. > > (I'm so happy to be able to provide a definitive answer for once!) We kind of lost the question along the way. Wasn't so much about whether there was a generic binding but more about whether it is worth providing separate controls for the two IRQ pins? Or just assume no one is crazy enough to play that level of mix and match. J > > Yours, > Linus Walleij
On Tue, Oct 10, 2023 at 4:42 PM Jonathan Cameron <jic23@kernel.org> wrote: > We kind of lost the question along the way. Wasn't so much about whether > there was a generic binding but more about whether it is worth providing > separate controls for the two IRQ pins? Or just assume no one is crazy > enough to play that level of mix and match. Ugh no, that's upfront design for a nonexistent use case. - First, to even consider open drain the designer need to be really short of IRQ lines/rails, and, despite knowing it's a bad idea, decide to share this line between several peripherals, even though it will require I2C traffic to just determine which one even fired the IRQ. - Second, be interested in using two IRQs to distinguish between different events? When we just faced the situation that we had too few IRQ lines so we need to start sharing them with open drain...? It's not gonna happen. Stay with just drive-open-drain; and configure them all as that if that property is set. Yours, Linus Walleij
Hi, On Fri, Oct 13, 2023 at 1:46 PM Jonathan Cameron <Jonathan.Cameron@huawei.com> wrote: > > On Tue, 10 Oct 2023 21:51:17 +0200 > Linus Walleij <linus.walleij@linaro.org> wrote: > > > On Tue, Oct 10, 2023 at 4:42 PM Jonathan Cameron <jic23@kernel.org> wrote: > > > > > We kind of lost the question along the way. Wasn't so much about whether > > > there was a generic binding but more about whether it is worth providing > > > separate controls for the two IRQ pins? Or just assume no one is crazy > > > enough to play that level of mix and match. > > > > Ugh no, that's upfront design for a nonexistent use case. > > > > - First, to even consider open drain the designer need to be really > > short of IRQ lines/rails, and, despite knowing it's a bad idea, decide > > to share this line between several peripherals, even though it will > > require I2C traffic to just determine which one even fired the IRQ. > > > > - Second, be interested in using two IRQs to distinguish between > > different events? When we just faced the situation that we had > > too few IRQ lines so we need to start sharing them with open > > drain...? > > > > It's not gonna happen. > > > > Stay with just drive-open-drain; and configure them all as that if > > that property is set. > > Good insights, I'd not really thought about the wider reasons for using > this :) Not done any circuit design or embedded board bring up in a > long while. > > Thanks! Thank you for the explanation and suggestion. Regards Jagath. > > > > > Yours, > > Linus Walleij > > >
diff --git a/Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml b/Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml new file mode 100644 index 000000000000..9c08988103c5 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/imu/bosch,bmi323.yaml @@ -0,0 +1,81 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/imu/bosch,bmi323.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Bosch BMI323 6-Axis IMU + +maintainers: + - Jagath Jog J <jagathjog1996@gmail.com> + +description: + BMI323 is a 6-axis inertial measurement unit that supports acceleration and + gyroscopic measurements with hardware fifo buffering. Sensor also provides + events information such as motion, steps, orientation, single and double + tap detection. + +properties: + compatible: + const: bosch,bmi323 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + interrupt-names: + enum: + - INT1 + - INT2 + description: | + set to "INT1" if INT1 pin should be used as interrupt input, set + to "INT2" if INT2 pin should be used instead + + drive-open-drain: + description: | + set if the specified interrupt pin should be configured as + open drain. If not set, defaults to push-pull. + +required: + - compatible + - reg + +allOf: + - $ref: /schemas/spi/spi-peripheral-props.yaml# + +unevaluatedProperties: false + +examples: + - | + // Example for I2C + #include <dt-bindings/interrupt-controller/irq.h> + i2c { + #address-cells = <1>; + #size-cells = <0>; + + bmi323@68 { + compatible = "bosch,bmi323"; + reg = <0x68>; + interrupt-parent = <&gpio1>; + interrupts = <29 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "INT1"; + }; + }; + - | + // Example for SPI + #include <dt-bindings/interrupt-controller/irq.h> + spi { + #address-cells = <1>; + #size-cells = <0>; + + bmi323@0 { + compatible = "bosch,bmi323"; + reg = <0>; + spi-max-frequency = <10000000>; + interrupt-parent = <&gpio2>; + interrupts = <12 IRQ_TYPE_EDGE_FALLING>; + interrupt-names = "INT2"; + }; + };