diff mbox series

[v3,3/4] dt-bindings: iio: accel: fxls8962af: add new compatible string

Message ID 20221213171536.1880089-5-han.xu@nxp.com
State Changes Requested, archived
Headers show
Series FXLS8967AF and FXLS8974CF support | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success
robh/checkpatch success
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Han Xu Dec. 13, 2022, 5:15 p.m. UTC
Add new compatible string for the NXP FXLS8967AF accelerometer sensor.

Signed-off-by: Han Xu <han.xu@nxp.com>

---
changes in v3
- Start commit message in capital
- Describe all these chips are compatible
---
 .../devicetree/bindings/iio/accel/nxp,fxls8962af.yaml         | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Krzysztof Kozlowski Dec. 13, 2022, 6:54 p.m. UTC | #1
On 13/12/2022 18:15, Han Xu wrote:
> Add new compatible string for the NXP FXLS8967AF accelerometer sensor.
> 
> Signed-off-by: Han Xu <han.xu@nxp.com>
> 
> ---
> changes in v3
> - Start commit message in capital
> - Describe all these chips are compatible
> ---
>  .../devicetree/bindings/iio/accel/nxp,fxls8962af.yaml         | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml b/Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml
> index 65ce8ea14b52..8f07ade21abb 100644
> --- a/Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml
> +++ b/Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml
> @@ -14,12 +14,16 @@ description: |
>    SPI and I2C interface.
>      https://www.nxp.com/docs/en/data-sheet/FXLS8962AF.pdf
>      https://www.nxp.com/docs/en/data-sheet/FXLS8964AF.pdf
> +    https://www.nxp.com/docs/en/data-sheet/FXLS8967AF.pdf
>  
>  properties:
>    compatible:
> +    description:
> +      These chips are compatible with each other, just have different IDs.

That's not what I meant.

Compatibility is expressed (check DT spec) by following specific
compatible with a more generic one (fallback), so in DTS:

	compatible = "nxp,fxls8967af", "nxp,fxls8964af";

Your driver changes partially suggested that (and driver changes should
be probably skipped in such case), but now I wonder how it is in reality....

Best regards,
Krzysztof
Krzysztof Kozlowski Dec. 14, 2022, 9:54 a.m. UTC | #2
On 13/12/2022 18:15, Han Xu wrote:
> Add new compatible string for the NXP FXLS8967AF accelerometer sensor.
> 
> Signed-off-by: Han Xu <han.xu@nxp.com>
> 
> ---
> changes in v3
> - Start commit message in capital
> - Describe all these chips are compatible
> ---
>  .../devicetree/bindings/iio/accel/nxp,fxls8962af.yaml         | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml b/Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml
> index 65ce8ea14b52..8f07ade21abb 100644
> --- a/Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml
> +++ b/Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml
> @@ -14,12 +14,16 @@ description: |
>    SPI and I2C interface.
>      https://www.nxp.com/docs/en/data-sheet/FXLS8962AF.pdf
>      https://www.nxp.com/docs/en/data-sheet/FXLS8964AF.pdf
> +    https://www.nxp.com/docs/en/data-sheet/FXLS8967AF.pdf
>  
>  properties:
>    compatible:
> +    description:
> +      These chips are compatible with each other, just have different IDs.

As pointed in other mail, the chips are not compatible, so drop the comment.

Best regards,
Krzysztof
Jonathan Cameron Dec. 19, 2022, 9:39 a.m. UTC | #3
On Wed, 14 Dec 2022 10:54:32 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:

> On 13/12/2022 18:15, Han Xu wrote:
> > Add new compatible string for the NXP FXLS8967AF accelerometer sensor.
> > 
> > Signed-off-by: Han Xu <han.xu@nxp.com>
> > 
> > ---
> > changes in v3
> > - Start commit message in capital
> > - Describe all these chips are compatible
> > ---
> >  .../devicetree/bindings/iio/accel/nxp,fxls8962af.yaml         | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml b/Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml
> > index 65ce8ea14b52..8f07ade21abb 100644
> > --- a/Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml
> > +++ b/Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml
> > @@ -14,12 +14,16 @@ description: |
> >    SPI and I2C interface.
> >      https://www.nxp.com/docs/en/data-sheet/FXLS8962AF.pdf
> >      https://www.nxp.com/docs/en/data-sheet/FXLS8964AF.pdf
> > +    https://www.nxp.com/docs/en/data-sheet/FXLS8967AF.pdf
> >  
> >  properties:
> >    compatible:
> > +    description:
> > +      These chips are compatible with each other, just have different IDs.  
> 
> As pointed in other mail, the chips are not compatible, so drop the comment.

The difference is an ID register.  Given we have had a bunch of cases of board
manufacturers swapping parts that aren't always compatible we have an old
pattern that we are fixing of rejecting unmatched who am I registers.

This driver should be relaxed to just print a message when the value doesn't
match - that was the compromise we reached with still pointing out possible
compatibility problems, whilst assuming the dts is correct.
Even better would be to make it a little more clever so it doesn't bother moaning
about part changes if the driver knows the new ID is compatible.

Once that's done the comment would reflect how we treat it in the driver
(which shouldn't matter to the binding anyway).

I'm not entirely sure why this driver has handling to allow for different channel
sets, but assume there are more parts to be upstreamed where that flexibility will
be useful.

Jonathan



> 
> Best regards,
> Krzysztof
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml b/Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml
index 65ce8ea14b52..8f07ade21abb 100644
--- a/Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml
+++ b/Documentation/devicetree/bindings/iio/accel/nxp,fxls8962af.yaml
@@ -14,12 +14,16 @@  description: |
   SPI and I2C interface.
     https://www.nxp.com/docs/en/data-sheet/FXLS8962AF.pdf
     https://www.nxp.com/docs/en/data-sheet/FXLS8964AF.pdf
+    https://www.nxp.com/docs/en/data-sheet/FXLS8967AF.pdf
 
 properties:
   compatible:
+    description:
+      These chips are compatible with each other, just have different IDs.
     enum:
       - nxp,fxls8962af
       - nxp,fxls8964af
+      - nxp,fxls8967af
 
   reg:
     maxItems: 1