diff mbox series

[1/4] dt-bindings: iio/accel: Drop duplicate adi, adxl345/6 from trivial-devices.yaml

Message ID 20200325220542.19189-2-robh@kernel.org
State Accepted
Commit 04bd645a0f24f6870f81e9abbc0b865c22b86c67
Headers show
Series dt-bindings: additionalProperties clean-up | expand

Commit Message

Rob Herring (Arm) March 25, 2020, 10:05 p.m. UTC
The 'adi,adxl345' definition is a duplicate as there's a full binding in:
Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

The trivial-devices binding doesn't capture that 'adi,adxl346' has a
fallback compatible 'adi,adxl345', so let's add it to adi,adxl345.yaml.

Cc: Michael Hennerich <michael.hennerich@analog.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: linux-iio@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>

---
 .../devicetree/bindings/iio/accel/adi,adxl345.yaml     | 10 +++++++---
 Documentation/devicetree/bindings/trivial-devices.yaml |  4 ----
 2 files changed, 7 insertions(+), 7 deletions(-)

-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Comments

Alexandru Ardelean March 26, 2020, 7:57 a.m. UTC | #1
On Wed, 2020-03-25 at 16:05 -0600, Rob Herring wrote:
> [External]

> 

> The 'adi,adxl345' definition is a duplicate as there's a full binding in:

> Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

> 

> The trivial-devices binding doesn't capture that 'adi,adxl346' has a

> fallback compatible 'adi,adxl345', so let's add it to adi,adxl345.yaml.

> 


Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>


> Cc: Michael Hennerich <michael.hennerich@analog.com>

> Cc: Jonathan Cameron <jic23@kernel.org>

> Cc: Hartmut Knaack <knaack.h@gmx.de>

> Cc: Lars-Peter Clausen <lars@metafoo.de>

> Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>

> Cc: linux-iio@vger.kernel.org

> Signed-off-by: Rob Herring <robh@kernel.org>

> ---

>  .../devicetree/bindings/iio/accel/adi,adxl345.yaml     | 10 +++++++---

>  Documentation/devicetree/bindings/trivial-devices.yaml |  4 ----

>  2 files changed, 7 insertions(+), 7 deletions(-)

> 

> diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

> b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

> index c602b6fe1c0c..d124eba1ce54 100644

> --- a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

> +++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

> @@ -17,9 +17,13 @@ description: |

>  

>  properties:

>    compatible:

> -    enum:

> -      - adi,adxl345

> -      - adi,adxl375

> +    oneOf:

> +      - items:

> +          - const: adi,adxl346

> +          - const: adi,adxl345

> +      - enum:

> +          - adi,adxl345

> +          - adi,adxl375

>  

>    reg:

>      maxItems: 1

> diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml

> b/Documentation/devicetree/bindings/trivial-devices.yaml

> index 978de7d37c66..51d1f6e43c02 100644

> --- a/Documentation/devicetree/bindings/trivial-devices.yaml

> +++ b/Documentation/devicetree/bindings/trivial-devices.yaml

> @@ -42,10 +42,6 @@ properties:

>            - adi,adt7476

>              # +/-1C TDM Extended Temp Range I.C

>            - adi,adt7490

> -            # Three-Axis Digital Accelerometer

> -          - adi,adxl345

> -            # Three-Axis Digital Accelerometer (backward-compatibility value

> "adi,adxl345" must be listed too)

> -          - adi,adxl346

>              # AMS iAQ-Core VOC Sensor

>            - ams,iaq-core

>              # i2c serial eeprom  (24cxx)

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Jonathan Cameron March 26, 2020, 12:43 p.m. UTC | #2
On Thu, 26 Mar 2020 07:57:31 +0000
"Ardelean, Alexandru" <alexandru.Ardelean@analog.com> wrote:

> On Wed, 2020-03-25 at 16:05 -0600, Rob Herring wrote:

> > [External]

> > 

> > The 'adi,adxl345' definition is a duplicate as there's a full binding in:

> > Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

> > 

> > The trivial-devices binding doesn't capture that 'adi,adxl346' has a

> > fallback compatible 'adi,adxl345', so let's add it to adi,adxl345.yaml.

> >   

> 

> Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>


Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>


> 

> > Cc: Michael Hennerich <michael.hennerich@analog.com>

> > Cc: Jonathan Cameron <jic23@kernel.org>

> > Cc: Hartmut Knaack <knaack.h@gmx.de>

> > Cc: Lars-Peter Clausen <lars@metafoo.de>

> > Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>

> > Cc: linux-iio@vger.kernel.org

> > Signed-off-by: Rob Herring <robh@kernel.org>

> > ---

> >  .../devicetree/bindings/iio/accel/adi,adxl345.yaml     | 10 +++++++---

> >  Documentation/devicetree/bindings/trivial-devices.yaml |  4 ----

> >  2 files changed, 7 insertions(+), 7 deletions(-)

> > 

> > diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

> > b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

> > index c602b6fe1c0c..d124eba1ce54 100644

> > --- a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

> > +++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

> > @@ -17,9 +17,13 @@ description: |

> >  

> >  properties:

> >    compatible:

> > -    enum:

> > -      - adi,adxl345

> > -      - adi,adxl375

> > +    oneOf:

> > +      - items:

> > +          - const: adi,adxl346

> > +          - const: adi,adxl345

> > +      - enum:

> > +          - adi,adxl345

> > +          - adi,adxl375

> >  

> >    reg:

> >      maxItems: 1

> > diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml

> > b/Documentation/devicetree/bindings/trivial-devices.yaml

> > index 978de7d37c66..51d1f6e43c02 100644

> > --- a/Documentation/devicetree/bindings/trivial-devices.yaml

> > +++ b/Documentation/devicetree/bindings/trivial-devices.yaml

> > @@ -42,10 +42,6 @@ properties:

> >            - adi,adt7476

> >              # +/-1C TDM Extended Temp Range I.C

> >            - adi,adt7490

> > -            # Three-Axis Digital Accelerometer

> > -          - adi,adxl345

> > -            # Three-Axis Digital Accelerometer (backward-compatibility value

> > "adi,adxl345" must be listed too)

> > -          - adi,adxl346

> >              # AMS iAQ-Core VOC Sensor

> >            - ams,iaq-core

> >              # i2c serial eeprom  (24cxx)  

> _______________________________________________

> linux-arm-kernel mailing list

> linux-arm-kernel@lists.infradead.org

> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sam Ravnborg March 27, 2020, 8:21 p.m. UTC | #3
Hi Rob.

On Wed, Mar 25, 2020 at 04:05:38PM -0600, Rob Herring wrote:
> The 'adi,adxl345' definition is a duplicate as there's a full binding in:

> Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

> 

> The trivial-devices binding doesn't capture that 'adi,adxl346' has a

> fallback compatible 'adi,adxl345', so let's add it to adi,adxl345.yaml.

> 

> Cc: Michael Hennerich <michael.hennerich@analog.com>

> Cc: Jonathan Cameron <jic23@kernel.org>

> Cc: Hartmut Knaack <knaack.h@gmx.de>

> Cc: Lars-Peter Clausen <lars@metafoo.de>

> Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>

> Cc: linux-iio@vger.kernel.org

> Signed-off-by: Rob Herring <robh@kernel.org>

> ---

>  .../devicetree/bindings/iio/accel/adi,adxl345.yaml     | 10 +++++++---

>  Documentation/devicetree/bindings/trivial-devices.yaml |  4 ----

>  2 files changed, 7 insertions(+), 7 deletions(-)

> 

> diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

> index c602b6fe1c0c..d124eba1ce54 100644

> --- a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

> +++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

> @@ -17,9 +17,13 @@ description: |

>  

>  properties:

>    compatible:

> -    enum:

> -      - adi,adxl345

> -      - adi,adxl375

> +    oneOf:

> +      - items:

> +          - const: adi,adxl346

> +          - const: adi,adxl345

> +      - enum:

> +          - adi,adxl345

> +          - adi,adxl375


I assume it is my schema understanding that is poor.
But I cannot parse the above.

The mix of items, enum and const confuses me.

I guess that if I am confused then others may end in the same situation.
Can we improve readability here or amybe add a comment?

	Sam

>  

>    reg:

>      maxItems: 1

> diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml

> index 978de7d37c66..51d1f6e43c02 100644

> --- a/Documentation/devicetree/bindings/trivial-devices.yaml

> +++ b/Documentation/devicetree/bindings/trivial-devices.yaml

> @@ -42,10 +42,6 @@ properties:

>            - adi,adt7476

>              # +/-1C TDM Extended Temp Range I.C

>            - adi,adt7490

> -            # Three-Axis Digital Accelerometer

> -          - adi,adxl345

> -            # Three-Axis Digital Accelerometer (backward-compatibility value "adi,adxl345" must be listed too)

> -          - adi,adxl346

>              # AMS iAQ-Core VOC Sensor

>            - ams,iaq-core

>              # i2c serial eeprom  (24cxx)

> -- 

> 2.20.1

> 

> _______________________________________________

> dri-devel mailing list

> dri-devel@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Rob Herring (Arm) March 31, 2020, 2:48 p.m. UTC | #4
On Fri, Mar 27, 2020 at 2:22 PM Sam Ravnborg <sam@ravnborg.org> wrote:
>

> Hi Rob.

>

> On Wed, Mar 25, 2020 at 04:05:38PM -0600, Rob Herring wrote:

> > The 'adi,adxl345' definition is a duplicate as there's a full binding in:

> > Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

> >

> > The trivial-devices binding doesn't capture that 'adi,adxl346' has a

> > fallback compatible 'adi,adxl345', so let's add it to adi,adxl345.yaml.

> >

> > Cc: Michael Hennerich <michael.hennerich@analog.com>

> > Cc: Jonathan Cameron <jic23@kernel.org>

> > Cc: Hartmut Knaack <knaack.h@gmx.de>

> > Cc: Lars-Peter Clausen <lars@metafoo.de>

> > Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>

> > Cc: linux-iio@vger.kernel.org

> > Signed-off-by: Rob Herring <robh@kernel.org>

> > ---

> >  .../devicetree/bindings/iio/accel/adi,adxl345.yaml     | 10 +++++++---

> >  Documentation/devicetree/bindings/trivial-devices.yaml |  4 ----

> >  2 files changed, 7 insertions(+), 7 deletions(-)

> >

> > diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

> > index c602b6fe1c0c..d124eba1ce54 100644

> > --- a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

> > +++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml

> > @@ -17,9 +17,13 @@ description: |

> >

> >  properties:

> >    compatible:

> > -    enum:

> > -      - adi,adxl345

> > -      - adi,adxl375

> > +    oneOf:

> > +      - items:

> > +          - const: adi,adxl346

> > +          - const: adi,adxl345

> > +      - enum:

> > +          - adi,adxl345

> > +          - adi,adxl375

>

> I assume it is my schema understanding that is poor.

> But I cannot parse the above.

>

> The mix of items, enum and const confuses me.


compatible can be one of 3 possibilities:
"adi,adxl346", "adi,adxl345"
"adi,adxl345"
"adi,adxl375"

For a single entry, 'items' can be omitted.

> I guess that if I am confused then others may end in the same situation.

> Can we improve readability here or amybe add a comment?


example-schema.yaml explains this to some extent. I'd rather improve that.

Rob
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
index c602b6fe1c0c..d124eba1ce54 100644
--- a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
+++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
@@ -17,9 +17,13 @@  description: |
 
 properties:
   compatible:
-    enum:
-      - adi,adxl345
-      - adi,adxl375
+    oneOf:
+      - items:
+          - const: adi,adxl346
+          - const: adi,adxl345
+      - enum:
+          - adi,adxl345
+          - adi,adxl375
 
   reg:
     maxItems: 1
diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
index 978de7d37c66..51d1f6e43c02 100644
--- a/Documentation/devicetree/bindings/trivial-devices.yaml
+++ b/Documentation/devicetree/bindings/trivial-devices.yaml
@@ -42,10 +42,6 @@  properties:
           - adi,adt7476
             # +/-1C TDM Extended Temp Range I.C
           - adi,adt7490
-            # Three-Axis Digital Accelerometer
-          - adi,adxl345
-            # Three-Axis Digital Accelerometer (backward-compatibility value "adi,adxl345" must be listed too)
-          - adi,adxl346
             # AMS iAQ-Core VOC Sensor
           - ams,iaq-core
             # i2c serial eeprom  (24cxx)