diff mbox series

[3/3] dt-bindings: iio: accel: bma255: Merge bosch,bma180 schema

Message ID 20210614163150.7774-4-stephan@gerhold.net
State Not Applicable
Headers show
Series dt-bindings: iio: accel: bma255: Fix interrupt type / merge bma180 | expand

Checks

Context Check Description
robh/checkpatch warning total: 0 errors, 2 warnings, 27 lines checked

Commit Message

Stephan Gerhold June 14, 2021, 4:31 p.m. UTC
In Linux the bma180 and bmc150-accel driver cover fairly similar chips
from Bosch (just with minor register differences). For the DT schema,
this does not make any difference: They both represent I2C/SPI devices,
have one or two interrupts plus a vdd/vddio-supply.

This means there is no need to duplicate the schema, we can just
document the compatibles for both drivers in a single DT schema.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
Some additional notes:
  - The datasheet links in bma180 sadly seem all broken for me so
    I just dropped them.
  - I separated the bma180/bmc150-accel compatibles using a comment.
    This is just for clarity, it has no influence on the schema.
  - I added myself as second maintainer for the bma255 binding since
    Jonathan seemed to be happy to get unlisted for bma180. :)

In the future we could consider combining even more schemas.
In particular bosch,bma400.yaml and bosch,bmi088.yaml are also
almost identical, although they currently specify different interrupt
types. I think in general the situation for those Bosch sensors is
exactly the same: The sensors can be configured to either active-high
or active-low level. However, at the moment neither bma400 or bmi088
actually implement interrupt support. For now I kept those schemas
as-is, I think this is better left up for follow-up patches.
---
 .../bindings/iio/accel/bosch,bma180.yaml      | 61 -------------------
 .../bindings/iio/accel/bosch,bma255.yaml      |  9 +++
 2 files changed, 9 insertions(+), 61 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml

Comments

Linus Walleij June 16, 2021, 9:04 a.m. UTC | #1
On Mon, Jun 14, 2021 at 6:34 PM Stephan Gerhold <stephan@gerhold.net> wrote:

> In Linux the bma180 and bmc150-accel driver cover fairly similar chips
> from Bosch (just with minor register differences). For the DT schema,
> this does not make any difference: They both represent I2C/SPI devices,
> have one or two interrupts plus a vdd/vddio-supply.
>
> This means there is no need to duplicate the schema, we can just
> document the compatibles for both drivers in a single DT schema.
>
> Suggested-by: Jonathan Cameron <jic23@kernel.org>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

> Some additional notes:
>   - The datasheet links in bma180 sadly seem all broken for me so
>     I just dropped them.

Fair enough, but some people would be able to obtain them using the
Wayback machine.

>   - I separated the bma180/bmc150-accel compatibles using a comment.
>     This is just for clarity, it has no influence on the schema.

Some DT binding maintainers may be allergic to any mention of
Linux particulars in binding documents but I am not so fine by me.

>   - I added myself as second maintainer for the bma255 binding since
>     Jonathan seemed to be happy to get unlisted for bma180. :)

Thanks!

> In the future we could consider combining even more schemas.
> In particular bosch,bma400.yaml and bosch,bmi088.yaml are also
> almost identical, although they currently specify different interrupt
> types. I think in general the situation for those Bosch sensors is
> exactly the same: The sensors can be configured to either active-high
> or active-low level. However, at the moment neither bma400 or bmi088
> actually implement interrupt support. For now I kept those schemas
> as-is, I think this is better left up for follow-up patches.

The situation is caused by Bosch sensortec
division not being particularly involved with the maintenance of these
drivers in the Linux kernel. (They did send a few initial patches
some years back, but since have not been heard from.)

It would be great to get the attention of someone in charge
@bosch-sensortec.com.

Their own drivers seem to target stuff like Arduino but more
generally on the "OS independence shim"-paradigm:
https://github.com/BoschSensortec

They have their own community here:
https://community.bosch-sensortec.com/t5/Bosch-Sensortec-Community/ct-p/bst_community
Their users ask questions about Linux sensor support all the time.
Their stance seem to be to work directly with companies making
products through FAE:s (field application engineers). It's a bit
like a guild.

I tried to find a real mail address to them but failed.

Yours,
Linus Walleij
Stephan Gerhold June 16, 2021, 5:36 p.m. UTC | #2
On Wed, Jun 16, 2021 at 11:04:36AM +0200, Linus Walleij wrote:
> On Mon, Jun 14, 2021 at 6:34 PM Stephan Gerhold <stephan@gerhold.net> wrote:
> 
> > In Linux the bma180 and bmc150-accel driver cover fairly similar chips
> > from Bosch (just with minor register differences). For the DT schema,
> > this does not make any difference: They both represent I2C/SPI devices,
> > have one or two interrupts plus a vdd/vddio-supply.
> >
> > This means there is no need to duplicate the schema, we can just
> > document the compatibles for both drivers in a single DT schema.
> >
> > Suggested-by: Jonathan Cameron <jic23@kernel.org>
> > Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> 
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> 
> > Some additional notes:
> >   - The datasheet links in bma180 sadly seem all broken for me so
> >     I just dropped them.
> 
> Fair enough, but some people would be able to obtain them using the
> Wayback machine.
>

Good point, perhaps we should add some links directly to the Wayback
Machine if it still has some of the datasheets. Those links should be
more stable. :)
 
> >   - I separated the bma180/bmc150-accel compatibles using a comment.
> >     This is just for clarity, it has no influence on the schema.
> 
> Some DT binding maintainers may be allergic to any mention of
> Linux particulars in binding documents but I am not so fine by me.
> 

Yeah, I kind of expected this to be honest. I don't mind removing those
comments, just thought it would be a bit less confusing for people who
read the bindings (so they know which driver covers which compatibles).
And for those using the bindings outside Linux, the comments can just be
ignored since they do not have any semantic meaning.

> 
> > In the future we could consider combining even more schemas.
> > In particular bosch,bma400.yaml and bosch,bmi088.yaml are also
> > almost identical, although they currently specify different interrupt
> > types. I think in general the situation for those Bosch sensors is
> > exactly the same: The sensors can be configured to either active-high
> > or active-low level. However, at the moment neither bma400 or bmi088
> > actually implement interrupt support. For now I kept those schemas
> > as-is, I think this is better left up for follow-up patches.
> 
> The situation is caused by Bosch sensortec
> division not being particularly involved with the maintenance of these
> drivers in the Linux kernel. (They did send a few initial patches
> some years back, but since have not been heard from.)
> 
> It would be great to get the attention of someone in charge
> @bosch-sensortec.com.
> 
> Their own drivers seem to target stuff like Arduino but more
> generally on the "OS independence shim"-paradigm:
> https://github.com/BoschSensortec
> 
> They have their own community here:
> https://community.bosch-sensortec.com/t5/Bosch-Sensortec-Community/ct-p/bst_community
> Their users ask questions about Linux sensor support all the time.
> Their stance seem to be to work directly with companies making
> products through FAE:s (field application engineers). It's a bit
> like a guild.
> 
> I tried to find a real mail address to them but failed.
> 

Yeah it would be nice if they would become a bit more involved. But from
my experience with various other vendors I'm not really expecting much
here sadly. However, I would be very happy to be proven otherwise. :)

Thanks!
Stephan
Rob Herring June 24, 2021, 8:40 p.m. UTC | #3
On Mon, 14 Jun 2021 18:31:50 +0200, Stephan Gerhold wrote:
> In Linux the bma180 and bmc150-accel driver cover fairly similar chips
> from Bosch (just with minor register differences). For the DT schema,
> this does not make any difference: They both represent I2C/SPI devices,
> have one or two interrupts plus a vdd/vddio-supply.
> 
> This means there is no need to duplicate the schema, we can just
> document the compatibles for both drivers in a single DT schema.
> 
> Suggested-by: Jonathan Cameron <jic23@kernel.org>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
> Some additional notes:
>   - The datasheet links in bma180 sadly seem all broken for me so
>     I just dropped them.
>   - I separated the bma180/bmc150-accel compatibles using a comment.
>     This is just for clarity, it has no influence on the schema.
>   - I added myself as second maintainer for the bma255 binding since
>     Jonathan seemed to be happy to get unlisted for bma180. :)
> 
> In the future we could consider combining even more schemas.
> In particular bosch,bma400.yaml and bosch,bmi088.yaml are also
> almost identical, although they currently specify different interrupt
> types. I think in general the situation for those Bosch sensors is
> exactly the same: The sensors can be configured to either active-high
> or active-low level. However, at the moment neither bma400 or bmi088
> actually implement interrupt support. For now I kept those schemas
> as-is, I think this is better left up for follow-up patches.
> ---
>  .../bindings/iio/accel/bosch,bma180.yaml      | 61 -------------------
>  .../bindings/iio/accel/bosch,bma255.yaml      |  9 +++
>  2 files changed, 9 insertions(+), 61 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml
> 

Reviewed-by: Rob Herring <robh@kernel.org>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml b/Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml
deleted file mode 100644
index a7e84089cc3d..000000000000
--- a/Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml
+++ /dev/null
@@ -1,61 +0,0 @@ 
-# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
-%YAML 1.2
----
-$id: http://devicetree.org/schemas/iio/accel/bosch,bma180.yaml#
-$schema: http://devicetree.org/meta-schemas/core.yaml#
-
-title: Bosch BMA023 / BMA150/ BMA180 / BMA250 / SMB380 triaxial accelerometers
-
-maintainers:
-  - Jonathan Cameron <jic23@kernel.org>
-
-description: |
-  https://media.digikey.com/pdf/Data%20Sheets/Bosch/BMA150.pdf
-  http://omapworld.com/BMA180_111_1002839.pdf
-  http://ae-bst.resource.bosch.com/media/products/dokumente/bma250/bst-bma250-ds002-05.pdf
-
-properties:
-  compatible:
-    enum:
-      - bosch,bma023
-      - bosch,bma150
-      - bosch,bma180
-      - bosch,bma250
-      - bosch,smb380
-
-  reg:
-    maxItems: 1
-
-  vdd-supply: true
-
-  vddio-supply: true
-
-  interrupts:
-    minItems: 1
-    maxItems: 2
-    description: |
-      Type should be either IRQ_TYPE_LEVEL_HIGH or IRQ_TYPE_EDGE_RISING.
-      For the bma250 the first interrupt listed must be the one
-      connected to the INT1 pin, the second (optional) interrupt
-      listed must be the one connected to the INT2 pin.
-
-required:
-  - compatible
-  - reg
-
-additionalProperties: false
-
-examples:
-  - |
-    #include <dt-bindings/interrupt-controller/irq.h>
-    i2c {
-        #address-cells = <1>;
-        #size-cells = <0>;
-        accel@40 {
-            compatible = "bosch,bma180";
-            reg = <0x40>;
-            interrupt-parent = <&gpio6>;
-            interrupts = <18 (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING)>;
-        };
-    };
-...
diff --git a/Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml b/Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml
index f35c57b8105f..5b35856b1942 100644
--- a/Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml
+++ b/Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml
@@ -8,6 +8,7 @@  title: Bosch BMA255 and Similar Accelerometers
 
 maintainers:
   - Linus Walleij <linus.walleij@linaro.org>
+  - Stephan Gerhold <stephan@gerhold.net>
 
 description:
   3 axis accelerometers with varying range and I2C or SPI
@@ -16,6 +17,7 @@  description:
 properties:
   compatible:
     enum:
+      # bmc150-accel driver in Linux
       - bosch,bma222
       - bosch,bma222e
       - bosch,bma250e
@@ -26,6 +28,13 @@  properties:
       - bosch,bmc150_accel
       - bosch,bmi055_accel
 
+      # bma180 driver in Linux
+      - bosch,bma023
+      - bosch,bma150
+      - bosch,bma180
+      - bosch,bma250
+      - bosch,smb380
+
   reg:
     maxItems: 1