Re: [PATCH v8 1/3] dt-bindings: iio: accel: Add DT binding doc for ADXL355

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Aug 8, 2021 at 9:10 PM Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
>
> On Sun, 8 Aug 2021 16:06:28 +0100
> Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
>
> > On Wed,  4 Aug 2021 19:33:07 +0530
> > Puranjay Mohan <puranjay12@xxxxxxxxx> wrote:
> >
> > > Add devicetree binding document for ADXL355, a 3-Axis MEMS Accelerometer.
> > >
> > > Signed-off-by: Puranjay Mohan <puranjay12@xxxxxxxxx>
> >
> > Looks good to me. I'll pick this up once Rob and anyone else interested
> > has had time to take a look assuming they don't ask for any changes.
> >
> > Thanks,
> >
> > Jonathan
> >
> >
> > > ---
> > >  .../bindings/iio/accel/adi,adxl355.yaml       | 88 +++++++++++++++++++
> > >  1 file changed, 88 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/iio/accel/adi,adxl355.yaml
> > >
> > > diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl355.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adxl355.yaml
> > > new file mode 100644
> > > index 000000000..5da3fd5ad
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl355.yaml
> > > @@ -0,0 +1,88 @@
> > > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/iio/accel/adi,adxl355.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: Analog Devices ADXL355 3-Axis, Low noise MEMS Accelerometer
> > > +
> > > +maintainers:
> > > +  - Puranjay Mohan <puranjay12@xxxxxxxxx>
> > > +
> > > +description: |
> > > +  Analog Devices ADXL355 3-Axis, Low noise MEMS Accelerometer that supports
> > > +  both I2C & SPI interfaces
> > > +    https://www.analog.com/en/products/adxl355.html
> > > +
> > > +properties:
> > > +  compatible:
> > > +    enum:
> > > +      - adi,adxl355
> > > +
> > > +  reg:
> > > +    maxItems: 1
> > > +
> > > +  interrupts:
> > > +    minItems: 1
> > > +    maxItems: 3
> > > +    description: |
> > > +      Type should be IRQ_TYPE_LEVEL_HIGH.
> > > +      Three configurable interrupt lines exist.
>
> I just noticed from the datasheet, that INT1 and INT2 have controllable
> polarity on the device.  We should look to support that rather than
> stating all 3 interrupts are LEVEL_HIGH.  For now, I'd just not
> state the type here, or make that statement only for the dataready pin.
>

Hi Jonathan,
I will be sending v9 of this series where I will state this only for
the DRDY pin. I will also make the scale defines inline for the other
patch.
Also, I will not send the third patch: trigger support in v9 because
it needs a lot of work.
It would be great if the base driver gets accepted and I will keep
working on the trigger support separately and not as a part of this
patch series.
I am also interested in looking into fwnode_get_irq_byname() for the
trigger patch.

> Once you enable these interrupts, you will want to handle the polarity setting
> in a similar fashion to the bmi160.
>
> It is a bit messy to combine the interrupt polarity at the interrupt controller
> with that at the device, but that is how we've handled these in the past.
>
> Jonathan
>
> > > +
> > > +  interrupt-names:
> > > +    description: Specify which interrupt line is in use.
> > > +    items:
> > > +      enum:
> > > +        - INT1
> > > +        - INT2
> > > +        - DRDY
> > > +    minItems: 1
> > > +    maxItems: 3
> > > +
> > > +  vdd-supply:
> > > +    description: Regulator that provides power to the sensor
> > > +
> > > +  vddio-supply:
> > > +    description: Regulator that provides power to the bus
> > > +
> > > +  spi-max-frequency: true
> > > +
> > > +required:
> > > +  - compatible
> > > +  - reg
> > > +
> > > +additionalProperties: false
> > > +
> > > +examples:
> > > +  - |
> > > +        #include <dt-bindings/gpio/gpio.h>
> > > +        #include <dt-bindings/interrupt-controller/irq.h>
> > > +        i2c {
> > > +                #address-cells = <1>;
> > > +                #size-cells = <0>;
> > > +
> > > +                /* Example for a I2C device node */
> > > +                accelerometer@1d {
> > > +                        compatible = "adi,adxl355";
> > > +                        reg = <0x1d>;
> > > +                        interrupt-parent = <&gpio>;
> > > +                        interrupts = <25 IRQ_TYPE_EDGE_RISING>;
> > > +                        interrupt-names = "DRDY";
> > > +                };
> > > +        };
> > > +  - |
> > > +        #include <dt-bindings/gpio/gpio.h>
> > > +        #include <dt-bindings/interrupt-controller/irq.h>
> > > +        spi {
> > > +                #address-cells = <1>;
> > > +                #size-cells = <0>;
> > > +
> > > +                accelerometer@0 {
> > > +                        compatible = "adi,adxl355";
> > > +                        reg = <0>;
> > > +                        spi-max-frequency = <1000000>;
> > > +                        interrupt-parent = <&gpio>;
> > > +                        interrupts = <25 IRQ_TYPE_EDGE_RISING>;
> > > +                        interrupt-names = "DRDY";
> > > +                };
> > > +        };
> >
>


-- 
Thanks and Regards

Yours Truly,

Puranjay Mohan



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux