2019-07-23 14:53:19

by Alexandru Ardelean

[permalink] [raw]
Subject: [PATCH 0/3][V4] iio: imu: Add support for the ADIS16460 IMU

This changeset adds support for the ADIS16460.
The default CS change delay is 10 uS, while the ADIS16460 requires a
minimum of 16 uS.

As it turns out, the SPI framework support already has support for this
feature, which is currently present in the for-next branch:
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git/commit/?h=0ff2de8bb163551ec4230a5a6f3c40c1f6adec4f

This changeset now makes use of that feature, to allow longer CS change
times (as needed) for ADIS16460.

The SPI patch is present in the iio/testing branch, but not present in the
iio/togreg branch.

Changelog v3 -> v4:
* for SPI: no change
* for ADIS lib: use existing `cs_change_delay` feature (from SPI)
* for DT: no change

Changelog v2 -> v3:
* for SPI:
* used `cs_change_delay` instead of `cs_change_delay_usecs` (i.e. removed
`_usecs` suffix
* used SPI specific subject line for SPI patch
* for ADIS lib:
* updated to use the `cs_change_delay`
* for DT:
* added Rob's `Reviewed-by` tag

Changelog v1 -> v2:
* for SPI:
* renamed `cs_change_stall_delay_us` -> `cs_change_delay_usecs`
initial recommendation was `cs_change_delay`, but decided to name this
`cs_change_delay_usecs`, since the convention for these delays seems
to add the `_usecs` suffix
* for ADIS lib:
* renamed `stall_delay` -> `cs_change_delay`
* removed some assignments of `cs_change_delay`
where `cs_change` is not set
* for ADIS16460 driver:
* fixed license
* adjusted to new `cs_change_delay[_usecs]`

Alexandru Ardelean (3):
iio: imu: adis: Add support for SPI transfer cs_change_delay
iio: imu: Add support for the ADIS16460 IMU
dt-bindings: iio: imu: add bindings for ADIS16460

.../bindings/iio/imu/adi,adis16460.yaml | 53 ++
MAINTAINERS | 8 +
drivers/iio/imu/Kconfig | 12 +
drivers/iio/imu/Makefile | 1 +
drivers/iio/imu/adis.c | 12 +
drivers/iio/imu/adis16460.c | 489 ++++++++++++++++++
include/linux/iio/imu/adis.h | 2 +
7 files changed, 577 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/imu/adi,adis16460.yaml
create mode 100644 drivers/iio/imu/adis16460.c

--
2.20.1


2019-07-23 16:24:30

by Alexandru Ardelean

[permalink] [raw]
Subject: [PATCH 3/3][V4] dt-bindings: iio: imu: add bindings for ADIS16460

This change adds device-tree bindings for the ADIS16460.

Reviewed-by: Rob Herring <[email protected]>
Signed-off-by: Alexandru Ardelean <[email protected]>
---
.../bindings/iio/imu/adi,adis16460.yaml | 53 +++++++++++++++++++
MAINTAINERS | 1 +
2 files changed, 54 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/imu/adi,adis16460.yaml

diff --git a/Documentation/devicetree/bindings/iio/imu/adi,adis16460.yaml b/Documentation/devicetree/bindings/iio/imu/adi,adis16460.yaml
new file mode 100644
index 000000000000..0c53009ba7d6
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/imu/adi,adis16460.yaml
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/imu/adi,adis16460.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices ADIS16460 and similar IMUs
+
+maintainers:
+ - Dragos Bogdan <[email protected]>
+
+description: |
+ Analog Devices ADIS16460 and similar IMUs
+ https://www.analog.com/media/en/technical-documentation/data-sheets/ADIS16460.pdf
+
+properties:
+ compatible:
+ enum:
+ - adi,adis16460
+
+ reg:
+ maxItems: 1
+
+ spi-cpha: true
+
+ spi-cpol: true
+
+ 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>;
+
+ imu@0 {
+ compatible = "adi,adis16460";
+ reg = <0>;
+ spi-max-frequency = <5000000>;
+ spi-cpol;
+ spi-cpha;
+ interrupt-parent = <&gpio0>;
+ interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+ };
+ };
diff --git a/MAINTAINERS b/MAINTAINERS
index f7de89e82e35..07105e43ea1e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -951,6 +951,7 @@ S: Supported
L: [email protected]
W: http://ez.analog.com/community/linux-device-drivers
F: drivers/iio/imu/adis16460.c
+F: Documentation/devicetree/bindings/iio/imu/adi,adis16460.yaml

ANALOG DEVICES INC ADP5061 DRIVER
M: Stefan Popa <[email protected]>
--
2.20.1

2019-07-27 18:59:12

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 3/3][V4] dt-bindings: iio: imu: add bindings for ADIS16460

On Tue, 23 Jul 2019 10:36:40 +0300
Alexandru Ardelean <[email protected]> wrote:

> This change adds device-tree bindings for the ADIS16460.
>
> Reviewed-by: Rob Herring <[email protected]>
> Signed-off-by: Alexandru Ardelean <[email protected]>

Really trivial, but convention (as driven by what git am -s does if nothing
else, is to add extra tags in chronological order. So Rob would be after
you. I tweaked it which I don't always remember to do.

It's not consistent across the kernel but I'll fight for my little corner
to be :)

Applied.

Thanks,

Jonathan

> ---
> .../bindings/iio/imu/adi,adis16460.yaml | 53 +++++++++++++++++++
> MAINTAINERS | 1 +
> 2 files changed, 54 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/imu/adi,adis16460.yaml
>
> diff --git a/Documentation/devicetree/bindings/iio/imu/adi,adis16460.yaml b/Documentation/devicetree/bindings/iio/imu/adi,adis16460.yaml
> new file mode 100644
> index 000000000000..0c53009ba7d6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/imu/adi,adis16460.yaml
> @@ -0,0 +1,53 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/imu/adi,adis16460.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices ADIS16460 and similar IMUs
> +
> +maintainers:
> + - Dragos Bogdan <[email protected]>
> +
> +description: |
> + Analog Devices ADIS16460 and similar IMUs
> + https://www.analog.com/media/en/technical-documentation/data-sheets/ADIS16460.pdf
> +
> +properties:
> + compatible:
> + enum:
> + - adi,adis16460
> +
> + reg:
> + maxItems: 1
> +
> + spi-cpha: true
> +
> + spi-cpol: true
> +
> + 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>;
> +
> + imu@0 {
> + compatible = "adi,adis16460";
> + reg = <0>;
> + spi-max-frequency = <5000000>;
> + spi-cpol;
> + spi-cpha;
> + interrupt-parent = <&gpio0>;
> + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
> + };
> + };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f7de89e82e35..07105e43ea1e 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -951,6 +951,7 @@ S: Supported
> L: [email protected]
> W: http://ez.analog.com/community/linux-device-drivers
> F: drivers/iio/imu/adis16460.c
> +F: Documentation/devicetree/bindings/iio/imu/adi,adis16460.yaml
>
> ANALOG DEVICES INC ADP5061 DRIVER
> M: Stefan Popa <[email protected]>


2019-07-30 03:27:07

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH 3/3][V4] dt-bindings: iio: imu: add bindings for ADIS16460

On Sat, Jul 27, 2019 at 12:56 PM Jonathan Cameron <[email protected]> wrote:
>
> On Tue, 23 Jul 2019 10:36:40 +0300
> Alexandru Ardelean <[email protected]> wrote:
>
> > This change adds device-tree bindings for the ADIS16460.
> >
> > Reviewed-by: Rob Herring <[email protected]>
> > Signed-off-by: Alexandru Ardelean <[email protected]>
>
> Really trivial, but convention (as driven by what git am -s does if nothing
> else, is to add extra tags in chronological order. So Rob would be after
> you. I tweaked it which I don't always remember to do.

I'd argue it is in chronological order as the submitter added my tag
and then sent it out. If you applied it and added my tag, then it
would be after (but before yours).

> It's not consistent across the kernel but I'll fight for my little corner
> to be :)

More consistency would be nice then there's less tribal knowledge
about maintainers for submitters to learn.

Rob

2019-08-01 12:42:49

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 3/3][V4] dt-bindings: iio: imu: add bindings for ADIS16460

On Mon, 29 Jul 2019 17:24:40 -0600
Rob Herring <[email protected]> wrote:

> On Sat, Jul 27, 2019 at 12:56 PM Jonathan Cameron <[email protected]> wrote:
> >
> > On Tue, 23 Jul 2019 10:36:40 +0300
> > Alexandru Ardelean <[email protected]> wrote:
> >
> > > This change adds device-tree bindings for the ADIS16460.
> > >
> > > Reviewed-by: Rob Herring <[email protected]>
> > > Signed-off-by: Alexandru Ardelean <[email protected]>
> >
> > Really trivial, but convention (as driven by what git am -s does if nothing
> > else, is to add extra tags in chronological order. So Rob would be after
> > you. I tweaked it which I don't always remember to do.
>
> I'd argue it is in chronological order as the submitter added my tag
> and then sent it out. If you applied it and added my tag, then it
> would be after (but before yours).

Bike shedding to follow...

Possibly but given you gave the Reviewed-by for v2, and it hasn't changed
is Alex's the same Signed-off-by as seen on V2, or a new one reflecting the
addition of your Reviewed-by?

:)


>
> > It's not consistent across the kernel but I'll fight for my little corner
> > to be :)
>
> More consistency would be nice then there's less tribal knowledge
> about maintainers for submitters to learn.

Agreed.

Jonathan

>
> Rob