staging: iio: accel: adis16240: enforce SPI mode on probe function
Subsystems (5)
PATCH v6 1/2 staging: iio: accel: adis16240: enforce SPI mode on probe function
According to the datasheet, this driver supports only SPI mode 3, so we should enforce it on probe function.
---
V6:
-none
drivers/staging/iio/accel/adis16240.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/staging/iio/accel/adis16240.c +7 -0
@@ -400,6 +400,13 @@ static int adis16240_probe(struct spi_device *spi) indio_dev->num_channels =ARRAY_SIZE (adis16240_channels); indio_dev->modes =INDIO_DIRECT_MODE ; + spi->mode =SPI_MODE_3 ; + ret =spi_setup (spi); +if (ret) { +dev_err (&spi->dev,"spi_setup failed!\n" ); +return ret; + } + ret =adis_init (st, indio_dev, spi, &adis16240_data);if (ret)return ret;
Signature · 1 line
2.24.0
PATCH v6 2/2 dt-bindings: iio: accel: add binding documentation for ADIS16240
This patch add device tree binding documentation for ADIS16240.
---
V6:
- Update SPDX license identifier
.../bindings/iio/accel/adi,adis16240.yaml | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml
Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml new file +49 -0
@@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/accel/adi,adis16240.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ADIS16240 Programmable Impact Sensor and Recorder driver + +maintainers: + - Alexandru Ardelean <[email protected]> + +description: | + ADIS16240 Programmable Impact Sensor and Recorder driver that supports + SPI interface. + https://www.analog.com/en/products/adis16240.html + +properties: + compatible: + enum: + - adi,adis16240 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + #include <dt-bindings/interrupt-controller/irq.h> + spi0 { + #address-cells = <1>; + #size-cells = <0>; + + /* Example for a SPI device node */ + accelerometer@0 { + compatible = "adi,adis16240"; + reg = <0>; + spi-max-frequency = <2500000>; + interrupt-parent = <&gpio0>; + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; + }; + };
Signature · 1 line
2.24.0
Rob Herring
maintainerRe: [PATCH v6 2/2] dt-bindings: iio: accel: add binding documentation for ADIS16240
Quoted 11 lines · Rodrigo Carvalho
This patch add device tree binding documentation for ADIS16240.
Signed-off-by Rodrigo Carvalho <[email protected]>---
V6:
- Update SPDX license identifier.../bindings/iio/accel/adi,adis16240.yaml | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml
Please add Acked-by/Reviewed-by tags when posting new versions. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for acks received on the version they apply.
If a tag was not added on purpose, please state why and what changed.
Re: [PATCH v6 2/2] dt-bindings: iio: accel: add binding documentation for ADIS16240
Quoted 13 lines · On Fri, 13 Dec 2019 13:10:36 -0600 Rob Herring <[email protected]> wrote:
Quoted 11 lines · Rodrigo Carvalho
This patch add device tree binding documentation for ADIS16240.
Signed-off-by Rodrigo Carvalho <[email protected]>---
V6:
- Update SPDX license identifier.../bindings/iio/accel/adi,adis16240.yaml | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/accel/adi,adis16240.yaml
Quoted 5 lines
Please add Acked-by/Reviewed-by tags when posting new versions. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for acks received on the version they apply.
If a tag was not added on purpose, please state why and what changed.
Applied to the togreg branch of iio.git, picking up Rob's tag from v5.
Pushed out as testing for the autobuilders to poke at it.
Thanks,
Jonathan