[PATCH 0/6] staging:iio:ad2s90: Add dt support and move out of staging

8 views
Skip to first unread message

Matheus Tavares

unread,
Nov 9, 2018, 5:01:12 PM11/9/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
This patch set adds device tree support to ad2s90, with standard
device tree id table, adds the respective dt-binding documentation,
solves a codestyle warning and move the driver out of staging.

This patch set completes all the remaining itens listed to be done
before moving the driver out of staging, enumerated in this mail thread:
https://marc.info/?l=linux-iio&m=154028966111330&w=2, except by one
codestyle problem: "CHECK: struct mutex definition without comment". It
seems to be a commonly ignored check for mutexes of device states. If I
am wrong, please, let me know and I will be happy to send a patch to
tackle it.

Matheus Tavares (6):
staging:iio:ad2s90: Add device tree support
staging:iio:ad2s90: Remove spi setup that should be done via dt
staging:iio:ad2s90: Add max frequency check at probe
dt-bindings:iio:resolver: Add docs for ad2s90
staging:iio:ad2s90: Add SPDX license identifier
staging:iio:ad2s90: Move out of staging

.../bindings/iio/resolver/ad2s90.txt | 26 ++++++++++++++++
drivers/iio/resolver/Kconfig | 10 ++++++
drivers/iio/resolver/Makefile | 1 +
drivers/{staging => }/iio/resolver/ad2s90.c | 31 ++++++++++++-------
drivers/staging/iio/resolver/Kconfig | 10 ------
drivers/staging/iio/resolver/Makefile | 1 -
6 files changed, 57 insertions(+), 22 deletions(-)
create mode 100644 Documentation/devicetree/bindings/iio/resolver/ad2s90.txt
rename drivers/{staging => }/iio/resolver/ad2s90.c (81%)

--
2.18.0

Matheus Tavares

unread,
Nov 9, 2018, 5:01:17 PM11/9/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
This patch adds device tree support to ad2s90 with standard
device tree id table.

Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
---
drivers/staging/iio/resolver/ad2s90.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c
index 3e257ac46f7a..ff32ca76ca00 100644
--- a/drivers/staging/iio/resolver/ad2s90.c
+++ b/drivers/staging/iio/resolver/ad2s90.c
@@ -107,6 +107,12 @@ static int ad2s90_probe(struct spi_device *spi)
return devm_iio_device_register(indio_dev->dev.parent, indio_dev);
}

+static const struct of_device_id ad2s90_of_match[] = {
+ { .compatible = "adi,ad2s90", },
+ {}
+};
+MODULE_DEVICE_TABLE(of, ad2s90_of_match);
+
static const struct spi_device_id ad2s90_id[] = {
{ "ad2s90" },
{}
@@ -116,6 +122,7 @@ MODULE_DEVICE_TABLE(spi, ad2s90_id);
static struct spi_driver ad2s90_driver = {
.driver = {
.name = "ad2s90",
+ .of_match_table = of_match_ptr(ad2s90_of_match),
},
.probe = ad2s90_probe,
.id_table = ad2s90_id,
--
2.18.0

Matheus Tavares

unread,
Nov 9, 2018, 5:01:21 PM11/9/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
The ad2s90 driver currently sets some spi settings (max_speed_hz and
mode) at ad2s90_probe. This should, instead, be handled via device tree.
This patch removes these configurations from the probe function.

Note: The way in which the mentioned spi settings need to be specified
on the ad2s90's node of a device tree will be documented in the future
patch "dt-bindings:iio:resolver: Add docs for ad2s90".

Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
---
drivers/staging/iio/resolver/ad2s90.c | 11 -----------
1 file changed, 11 deletions(-)

diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c
index ff32ca76ca00..95c118c48400 100644
--- a/drivers/staging/iio/resolver/ad2s90.c
+++ b/drivers/staging/iio/resolver/ad2s90.c
@@ -77,7 +77,6 @@ static int ad2s90_probe(struct spi_device *spi)
{
struct iio_dev *indio_dev;
struct ad2s90_state *st;
- int ret;

indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
if (!indio_dev)
@@ -94,16 +93,6 @@ static int ad2s90_probe(struct spi_device *spi)
indio_dev->num_channels = 1;
indio_dev->name = spi_get_device_id(spi)->name;

- /* need 600ns between CS and the first falling edge of SCLK */
- spi->max_speed_hz = 830000;
- spi->mode = SPI_MODE_3;
- ret = spi_setup(spi);
-
- if (ret < 0) {
- dev_err(&spi->dev, "spi_setup failed!\n");
- return ret;
- }
-
return devm_iio_device_register(indio_dev->dev.parent, indio_dev);
}

--
2.18.0

Matheus Tavares

unread,
Nov 9, 2018, 5:01:25 PM11/9/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
This patch adds a max frequency check at the beginning of ad2s90_probe
function so that when it is set to a value above 0.83Mhz, dev_err is
called with an appropriate message and -EINVAL is returned.

The defined limit is 0.83Mhz instead of 2Mhz, which is the chip's max
frequency as specified in the datasheet, because, as also specified in
the datasheet, a 600ns delay is expected between the application of a
logic LO to CS and the application of SCLK. Since the delay is not
implemented in the spi code, to satisfy it, SCLK's period should be at
most 2 * 600ns, so the max frequency should be 1 / (2 * 6e-7), which
gives roughly 830000Hz.

Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
Signed-off-by: Alexandru Ardelean <alexandru...@analog.com>
---
Alex's S-o-B was added because he gave the code suggestion for this
patch.

drivers/staging/iio/resolver/ad2s90.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c
index 95c118c48400..949ff55ac6b0 100644
--- a/drivers/staging/iio/resolver/ad2s90.c
+++ b/drivers/staging/iio/resolver/ad2s90.c
@@ -19,6 +19,12 @@
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>

+/*
+ * Although chip's max frequency is 2Mhz, it needs 600ns between CS and the
+ * first falling edge of SCLK, so frequency should be at most 1 / (2 * 6e-7)
+ */
+#define AD2S90_MAX_SPI_FREQ_HZ 830000
+
struct ad2s90_state {
struct mutex lock;
struct spi_device *sdev;
@@ -78,6 +84,12 @@ static int ad2s90_probe(struct spi_device *spi)
struct iio_dev *indio_dev;
struct ad2s90_state *st;

+ if (spi->max_speed_hz > AD2S90_MAX_SPI_FREQ_HZ) {
+ dev_err(&spi->dev, "SPI CLK, %d Hz exceeds %d Hz\n",
+ spi->max_speed_hz, AD2S90_MAX_SPI_FREQ_HZ);
+ return -EINVAL;
+ }
+
indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
if (!indio_dev)
return -ENOMEM;
--
2.18.0

Matheus Tavares

unread,
Nov 9, 2018, 5:01:30 PM11/9/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
This patch adds the device tree binding documentation for the ad2s90
resolver-to-digital converter.

Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
---
.../bindings/iio/resolver/ad2s90.txt | 26 +++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/resolver/ad2s90.txt

diff --git a/Documentation/devicetree/bindings/iio/resolver/ad2s90.txt b/Documentation/devicetree/bindings/iio/resolver/ad2s90.txt
new file mode 100644
index 000000000000..b42cc7752ffd
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/resolver/ad2s90.txt
@@ -0,0 +1,26 @@
+Analog Devices AD2S90 Resolver-to-Digital Converter
+
+https://www.analog.com/en/products/ad2s90.html
+
+Required properties:
+ - compatible : should be "adi,ad2s90"
+ - reg : SPI chip select number for the device
+ - spi-max-frequency : set maximum clock frequency, must be 830000
+ - spi-cpol and spi-cpha : must be defined to enable SPI mode 3
+
+Note about max frequency:
+ Chip's max frequency, as specified in its datasheet, is 2Mhz. But a 600ns
+ delay is expected between the application of a logic LO to CS and the
+ application of SCLK, as also specified. And since the delay is not
+ implemented in the spi code, to satisfy it, SCLK's period should be at most
+ 2 * 600ns, so the max frequency should be 1 / (2 * 6e-7), which gives
+ roughly 830000Hz.
+
+Example:
+resolver@0 {
+ compatible = "adi,ad2s90";
+ reg = <0>;
+ spi-max-frequency = <830000>;
+ spi-cpol;
+ spi-cpha;
+};
--
2.18.0

Matheus Tavares

unread,
Nov 9, 2018, 5:01:35 PM11/9/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
This patch adds the SPDX GPL-2.0-only license identifier to ad2s90.c,
which solves the checkpatch.pl warning:
"WARNING: Missing or malformed SPDX-License-Identifier tag in line 1".

Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
---
drivers/staging/iio/resolver/ad2s90.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c
index 949ff55ac6b0..f439da721df8 100644
--- a/drivers/staging/iio/resolver/ad2s90.c
+++ b/drivers/staging/iio/resolver/ad2s90.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-only
/*
* ad2s90.c simple support for the ADI Resolver to Digital Converters: AD2S90
*
--
2.18.0

Matheus Tavares

unread,
Nov 9, 2018, 5:01:38 PM11/9/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
Move ad2s90 resolver driver out of staging to the main tree.

Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
Signed-off-by: Victor Colombo <victor...@gmail.com>
---
drivers/iio/resolver/Kconfig | 10 ++++++++++
drivers/iio/resolver/Makefile | 1 +
drivers/{staging => }/iio/resolver/ad2s90.c | 0
drivers/staging/iio/resolver/Kconfig | 10 ----------
drivers/staging/iio/resolver/Makefile | 1 -
5 files changed, 11 insertions(+), 11 deletions(-)
rename drivers/{staging => }/iio/resolver/ad2s90.c (100%)

diff --git a/drivers/iio/resolver/Kconfig b/drivers/iio/resolver/Kconfig
index 2ced9f22aa70..786801be54f6 100644
--- a/drivers/iio/resolver/Kconfig
+++ b/drivers/iio/resolver/Kconfig
@@ -3,6 +3,16 @@
#
menu "Resolver to digital converters"

+config AD2S90
+ tristate "Analog Devices ad2s90 driver"
+ depends on SPI
+ help
+ Say yes here to build support for Analog Devices spi resolver
+ to digital converters, ad2s90, provides direct access via sysfs.
+
+ To compile this driver as a module, choose M here: the
+ module will be called ad2s90.
+
config AD2S1200
tristate "Analog Devices ad2s1200/ad2s1205 driver"
depends on SPI
diff --git a/drivers/iio/resolver/Makefile b/drivers/iio/resolver/Makefile
index 4e1dccae07e7..398d82d50028 100644
--- a/drivers/iio/resolver/Makefile
+++ b/drivers/iio/resolver/Makefile
@@ -2,4 +2,5 @@
# Makefile for Resolver/Synchro drivers
#

+obj-$(CONFIG_AD2S90) += ad2s90.o
obj-$(CONFIG_AD2S1200) += ad2s1200.o
diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/iio/resolver/ad2s90.c
similarity index 100%
rename from drivers/staging/iio/resolver/ad2s90.c
rename to drivers/iio/resolver/ad2s90.c
diff --git a/drivers/staging/iio/resolver/Kconfig b/drivers/staging/iio/resolver/Kconfig
index 6a469ee6101f..4a727c17bb8f 100644
--- a/drivers/staging/iio/resolver/Kconfig
+++ b/drivers/staging/iio/resolver/Kconfig
@@ -3,16 +3,6 @@
#
menu "Resolver to digital converters"

-config AD2S90
- tristate "Analog Devices ad2s90 driver"
- depends on SPI
- help
- Say yes here to build support for Analog Devices spi resolver
- to digital converters, ad2s90, provides direct access via sysfs.
-
- To compile this driver as a module, choose M here: the
- module will be called ad2s90.
-
config AD2S1210
tristate "Analog Devices ad2s1210 driver"
depends on SPI
diff --git a/drivers/staging/iio/resolver/Makefile b/drivers/staging/iio/resolver/Makefile
index 8d901dc7500b..b2049f2ce36e 100644
--- a/drivers/staging/iio/resolver/Makefile
+++ b/drivers/staging/iio/resolver/Makefile
@@ -2,5 +2,4 @@
# Makefile for Resolver/Synchro drivers
#

-obj-$(CONFIG_AD2S90) += ad2s90.o
obj-$(CONFIG_AD2S1210) += ad2s1210.o
--
2.18.0

Fabio Estevam

unread,
Nov 9, 2018, 5:13:12 PM11/9/18
to matheus.b...@usp.br, Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald, Greg Kroah-Hartman, Rob Herring, Mark Rutland, de...@driverdev.osuosl.org, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, linu...@vger.kernel.org, linux-kernel, kerne...@googlegroups.com, alexandru...@analog.com, victor...@gmail.com
Hi Matheus,

On Fri, Nov 9, 2018 at 8:01 PM Matheus Tavares
<matheus.b...@usp.br> wrote:
>
> This patch adds the SPDX GPL-2.0-only license identifier to ad2s90.c,
> which solves the checkpatch.pl warning:
> "WARNING: Missing or malformed SPDX-License-Identifier tag in line 1".
>
> Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
> ---
> drivers/staging/iio/resolver/ad2s90.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c
> index 949ff55ac6b0..f439da721df8 100644
> --- a/drivers/staging/iio/resolver/ad2s90.c
> +++ b/drivers/staging/iio/resolver/ad2s90.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0-only

This should be:
// SPDX-License-Identifier: GPL-2.0

Matheus Tavares Bernardino

unread,
Nov 9, 2018, 6:20:05 PM11/9/18
to fest...@gmail.com, Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, kerne...@googlegroups.com, Alexandru Ardelean, Victor Colombo
On Fri, Nov 9, 2018 at 8:13 PM Fabio Estevam <fest...@gmail.com> wrote:
>
> Hi Matheus,
>

Hi, Fabio
Hm, but it seems that the identifier "GPL-2.0" is deprecated, look:
https://spdx.org/licenses/GPL-2.0.html. It has been updated to
"GPL-2.0-only" in license list v3
(https://spdx.org/licenses/GPL-2.0-only.html). Is there some other
reason to use the deprecated "GPL-2.0" that I'm not aware of?

Thanks,
Matheus

Greg Kroah-Hartman

unread,
Nov 9, 2018, 7:20:20 PM11/9/18
to Matheus Tavares Bernardino, fest...@gmail.com, Mark Rutland, de...@driverdev.osuosl.org, Lars-Peter Clausen, Michael Hennerich, devic...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, kerne...@googlegroups.com, Rob Herring, Peter Meerwald-Stadler, Hartmut Knaack, Alexandru Ardelean, Victor Colombo, Jonathan Cameron
Yes, please read the in-kernel documentation for all of this at:
Documentation/process/license-rules.rst

Long story short, we started the adding of these tags to the kernel
before the crazyness of the "-only" markings for GPL in spdx. Let's
keep it this way for now, if we ever get the whole kernel finished, then
we can revisit the markings and maybe do a wholesale conversion, if it's
really needed.

thanks,

greg k-h

Matheus Tavares Bernardino

unread,
Nov 9, 2018, 7:27:28 PM11/9/18
to Greg Kroah-Hartman, fest...@gmail.com, Mark Rutland, de...@driverdev.osuosl.org, Lars-Peter Clausen, Michael Hennerich, devic...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, kerne...@googlegroups.com, Rob Herring, Peter Meerwald-Stadler, Hartmut Knaack, Alexandru Ardelean, Victor Colombo, Jonathan Cameron
Got it, thanks for the explanation! I'll correct this in v2.

Thanks,
Matheus

> thanks,
>
> greg k-h

Fabio Estevam

unread,
Nov 10, 2018, 8:23:02 AM11/10/18
to Matheus Tavares Bernardino, Greg Kroah-Hartman, Mark Rutland, de...@driverdev.osuosl.org, Lars-Peter Clausen, Michael Hennerich, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, linu...@vger.kernel.org, linux-kernel, kerne...@googlegroups.com, Rob Herring, Peter Meerwald, Hartmut Knaack, alexandru...@analog.com, Victor Colombo, Jonathan Cameron
Hi Matheus,

On Fri, Nov 9, 2018 at 10:27 PM Matheus Tavares Bernardino
<matheus.b...@usp.br> wrote:

> Got it, thanks for the explanation! I'll correct this in v2.

One more suggestion: in v2 you could also consider to remove the legal
text that says GPL v2, as you are adding the SPDX tag.

Matheus Tavares Bernardino

unread,
Nov 10, 2018, 1:23:29 PM11/10/18
to Fabio Estevam, Greg Kroah-Hartman, Mark Rutland, de...@driverdev.osuosl.org, Lars-Peter Clausen, Michael Hennerich, devic...@vger.kernel.org, linu...@vger.kernel.org, linux-...@vger.kernel.org, kerne...@googlegroups.com, Rob Herring, Peter Meerwald-Stadler, Hartmut Knaack, Alexandru Ardelean, Victor Colombo, Jonathan Cameron
Okay, I'll do it! Thanks again for the review and suggestions!

Matheus

Jonathan Cameron

unread,
Nov 11, 2018, 6:31:33 AM11/11/18
to Matheus Tavares, Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
On Fri, 9 Nov 2018 20:00:44 -0200
Matheus Tavares <matheus.b...@usp.br> wrote:

> Move ad2s90 resolver driver out of staging to the main tree.
>
> Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
> Signed-off-by: Victor Colombo <victor...@gmail.com>

For a move out of staging patch, please disable move detection.
It let's us see the whole driver and perform a thorough review on list.
Note this is the only case I'm aware of where move detection should
be disabled. I'm not sure if others have the same feeling for
such patches, but in IIO I always want to see what we are actually
moving!

Normally we then review it as if it were a new incoming driver.
That can pick up on stuff that has previously been missed.

Thanks,

Jonathan

Jonathan Cameron

unread,
Nov 11, 2018, 6:34:20 AM11/11/18
to Matheus Tavares, Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
On Fri, 9 Nov 2018 20:00:38 -0200
Matheus Tavares <matheus.b...@usp.br> wrote:

> This patch set adds device tree support to ad2s90, with standard
> device tree id table, adds the respective dt-binding documentation,
> solves a codestyle warning and move the driver out of staging.
>
> This patch set completes all the remaining itens listed to be done
> before moving the driver out of staging, enumerated in this mail thread:
> https://marc.info/?l=linux-iio&m=154028966111330&w=2, except by one
> codestyle problem: "CHECK: struct mutex definition without comment". It
> seems to be a commonly ignored check for mutexes of device states. If I
> am wrong, please, let me know and I will be happy to send a patch to
> tackle it.
It should be commented. Device state is not actually all that
well defined and means different things in different drivers.

Here it is very straight forward as it's role is to protect the
buffer. There is no other state maintained.

Jonathan

Jonathan Cameron

unread,
Nov 11, 2018, 6:42:30 AM11/11/18
to Matheus Tavares, Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com, Mark Brown
On Fri, 9 Nov 2018 20:00:40 -0200
Matheus Tavares <matheus.b...@usp.br> wrote:

> The ad2s90 driver currently sets some spi settings (max_speed_hz and
> mode) at ad2s90_probe. This should, instead, be handled via device tree.
> This patch removes these configurations from the probe function.
>
> Note: The way in which the mentioned spi settings need to be specified
> on the ad2s90's node of a device tree will be documented in the future
> patch "dt-bindings:iio:resolver: Add docs for ad2s90".
>
> Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
I'd actually like to get Rob and Mark's views on this one. Previously
I would just have applied it without thinking on the basis these can
be easily specified from devicetree.

Recent discussions with Rob have suggested that the settings in devicetree
should perhaps be concerned with specifying constraints about the device
that are not visible to the driver. The driver itself should apply
the device constraints, but there are others such as wiring that
might reduce the maximum frequency for example...

So should a driver be clamping an over specified value from DT for
example? Or given that is optional in DT, should it be making sure
that a controller max frequency isn't too high for the sensor?

It seems to be unusual to do this, but to my mind it would make
sense and might be worth pushing out into more drivers.

Jonathan

Jonathan Cameron

unread,
Nov 11, 2018, 6:46:21 AM11/11/18
to Matheus Tavares, Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
On Fri, 9 Nov 2018 20:00:41 -0200
Matheus Tavares <matheus.b...@usp.br> wrote:

> This patch adds a max frequency check at the beginning of ad2s90_probe
> function so that when it is set to a value above 0.83Mhz, dev_err is
> called with an appropriate message and -EINVAL is returned.
>
> The defined limit is 0.83Mhz instead of 2Mhz, which is the chip's max
> frequency as specified in the datasheet, because, as also specified in
> the datasheet, a 600ns delay is expected between the application of a
> logic LO to CS and the application of SCLK. Since the delay is not
> implemented in the spi code, to satisfy it, SCLK's period should be at
> most 2 * 600ns, so the max frequency should be 1 / (2 * 6e-7), which
> gives roughly 830000Hz.
>
> Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
> Signed-off-by: Alexandru Ardelean <alexandru...@analog.com>
> ---
> Alex's S-o-B was added because he gave the code suggestion for this
> patch.
If he gave the actual code then he should be the credited author
git commit --amend --author=...

If it was just a suggestion, then an informal tag such as
Suggested-by is usually used.

Signed-off-by has formal legal meaning to do with the developer
certificate of origin, it's not valid as a way of crediting someone
with a contribution to the patch.
Now this is interesting as a follow up to the previous and may actually
answer the question I raised. Let's see what Mark and Rob come
back with. If possible I'd like us to resolve this once and for all
with a thread to point people back to!

Jonathan Cameron

unread,
Nov 11, 2018, 6:48:55 AM11/11/18
to Matheus Tavares, Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com, bro...@kernel.org
On Fri, 9 Nov 2018 20:00:42 -0200
Matheus Tavares <matheus.b...@usp.br> wrote:

> This patch adds the device tree binding documentation for the ad2s90
> resolver-to-digital converter.
>
> Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
> ---
> .../bindings/iio/resolver/ad2s90.txt | 26 +++++++++++++++++++
> 1 file changed, 26 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/resolver/ad2s90.txt
>
> diff --git a/Documentation/devicetree/bindings/iio/resolver/ad2s90.txt b/Documentation/devicetree/bindings/iio/resolver/ad2s90.txt
> new file mode 100644
> index 000000000000..b42cc7752ffd
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/resolver/ad2s90.txt
> @@ -0,0 +1,26 @@
> +Analog Devices AD2S90 Resolver-to-Digital Converter
> +
> +https://www.analog.com/en/products/ad2s90.html
> +
> +Required properties:
> + - compatible : should be "adi,ad2s90"
> + - reg : SPI chip select number for the device
> + - spi-max-frequency : set maximum clock frequency, must be 830000
> + - spi-cpol and spi-cpha : must be defined to enable SPI mode 3

As the part only works in mode 3, my gut feeling is that this belongs
in the driver, not here. Rob, what do you think?

Matheus Tavares Bernardino

unread,
Nov 15, 2018, 9:44:51 AM11/15/18
to Jonathan Cameron, Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, Victor Colombo, bro...@kernel.org
On Sun, Nov 11, 2018 at 9:42 AM Jonathan Cameron <ji...@kernel.org> wrote:
>
> On Fri, 9 Nov 2018 20:00:40 -0200
> Matheus Tavares <matheus.b...@usp.br> wrote:
>
> > The ad2s90 driver currently sets some spi settings (max_speed_hz and
> > mode) at ad2s90_probe. This should, instead, be handled via device tree.
> > This patch removes these configurations from the probe function.
> >
> > Note: The way in which the mentioned spi settings need to be specified
> > on the ad2s90's node of a device tree will be documented in the future
> > patch "dt-bindings:iio:resolver: Add docs for ad2s90".
> >
> > Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
> I'd actually like to get Rob and Mark's views on this one. Previously
> I would just have applied it without thinking on the basis these can
> be easily specified from devicetree.
>
> Recent discussions with Rob have suggested that the settings in devicetree
> should perhaps be concerned with specifying constraints about the device
> that are not visible to the driver. The driver itself should apply
> the device constraints, but there are others such as wiring that
> might reduce the maximum frequency for example...
>
> So should a driver be clamping an over specified value from DT for
> example? Or given that is optional in DT, should it be making sure
> that a controller max frequency isn't too high for the sensor?
>

First of all, thanks for the review and comments.

By what you've said here and in the reviews for patches 3 and 4 of
this patch-set, it seems to me that the most reasonable thing would be
to keep the SPI mode 3 settings at the driver but the max frequency
setting at DT and check if it exceeds the maximum at the driver (as
patch 3 does). This makes sense to me, based on what you've said,
because mode 3 is a device constraint visible to the driver (as it
won't change) but max frequency is not (because of things such as
wiring, as you said).

What do you think, Jonathan, Rob, and Mark?

Matheus

Jonathan Cameron

unread,
Nov 16, 2018, 1:37:19 PM11/16/18
to Matheus Tavares Bernardino, Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, Victor Colombo, bro...@kernel.org
On Thu, 15 Nov 2018 12:44:39 -0200
Matheus Tavares Bernardino <matheus.b...@usp.br> wrote:

Sounds good to me. I just checked the DT bindings for spi-bus
and max-frequency is indeed a required binding element for slave
devices, hence has to be there. Best to confirm it is sane in
the driver however as you suggest. I think we'll standardise
on that bit of paranoia in IIO unless Rob or Mark shouts otherwise.

Jonathan

Matheus Tavares Bernardino

unread,
Nov 16, 2018, 10:29:22 PM11/16/18
to Jonathan Cameron, Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, Victor Colombo, bro...@kernel.org
For this patch, I assumed the part only worked in mode 3 based on the
driver's code that set this at probe. But today I carefully looked for
it at the datasheet and now I'm unsure. It is never said, explicitly,
which SPI mode ad2s90 works with. But looking at the diagram that
shows the expected pins signals at each communication moment, it seems
to me that this chip can either work in mode 0 (CPOL=0, CPHA=0) or
mode 3 (CPOL=1, CPHA=1). Could someone help me to confirm this? And if
that is the case, them the SPI mode setting should be left in DT, as
adc/mcp320x and dac/ti-dac082s085 do, right?

Also, when I thought that ad2s90 only worked in mode 3, I wrote this
patch based on the dt-binding docs for the adxl345 accelerometer,
which only works in mode 3 but lets this setting to DT not in the
driver. Do you think, perhaps, it is wrong in adxl345, them?

Thanks,
Matheus.

Matheus Tavares

unread,
Nov 17, 2018, 11:26:12 PM11/17/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
This series adds device tree support to ad2s90, adds the respective dt-binding
documentation, solves all remaining codestyle problems in the driver code and
move it out of staging.

This patch set completes all the remaining itens listed to be done before moving
the driver out of staging, enumerated in this mail thread:
https://marc.info/?l=linux-iio&m=154028966111330&w=2.

Alexandru Ardelean (1):
staging:iio:ad2s90: Add max frequency check at probe

Matheus Tavares (5):
staging:iio:ad2s90: Add device tree support
staging:iio:ad2s90: Remove spi setup that should be done via dt
dt-bindings:iio:resolver: Add docs for ad2s90
staging:iio:ad2s90: Replace license text w/ SPDX identifier
staging:iio:ad2s90: Move out of staging

Victor Colombo (1):
staging:iio:ad2s90: Add comment to device state mutex

.../bindings/iio/resolver/ad2s90.txt | 28 ++++
drivers/iio/resolver/Kconfig | 10 ++
drivers/iio/resolver/Makefile | 1 +
drivers/iio/resolver/ad2s90.c | 131 ++++++++++++++++++
drivers/staging/iio/resolver/Kconfig | 10 --
drivers/staging/iio/resolver/Makefile | 1 -
drivers/staging/iio/resolver/ad2s90.c | 127 -----------------
7 files changed, 170 insertions(+), 138 deletions(-)
create mode 100644 Documentation/devicetree/bindings/iio/resolver/ad2s90.txt
create mode 100644 drivers/iio/resolver/ad2s90.c
delete mode 100644 drivers/staging/iio/resolver/ad2s90.c

--
2.18.0

Matheus Tavares

unread,
Nov 17, 2018, 11:26:16 PM11/17/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
This patch adds device tree support to ad2s90 with standard
device tree id table.

Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
---
Changes in v2:
- none

drivers/staging/iio/resolver/ad2s90.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c
index 3e257ac46f7a..6ffbac66b837 100644
--- a/drivers/staging/iio/resolver/ad2s90.c
+++ b/drivers/staging/iio/resolver/ad2s90.c

Matheus Tavares

unread,
Nov 17, 2018, 11:26:19 PM11/17/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
The ad2s90 driver currently sets some spi settings (max_speed_hz and
mode) at ad2s90_probe. Since the maximum frequency is a required element
in DT binding for spi slave devices and because the spi mode for the
device can be either (0,0) or (1,1), these settings should be handled
via device tree, not in the driver's code. This patch removes them from
the probe function.

Note: The way in which the mentioned spi settings need to be specified
on the ad2s90's node of a device tree will be documented in the future
patch "dt-bindings:iio:resolver: Add docs for ad2s90".

Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
---
Changes in v2:
- Rewritten patch message to better explain why the code snippet in
question should be removed.

drivers/staging/iio/resolver/ad2s90.c | 11 -----------
1 file changed, 11 deletions(-)

diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c
index 6ffbac66b837..913d6fad2d4d 100644
--- a/drivers/staging/iio/resolver/ad2s90.c
+++ b/drivers/staging/iio/resolver/ad2s90.c
@@ -77,7 +77,6 @@ static int ad2s90_probe(struct spi_device *spi)
{
struct iio_dev *indio_dev;
struct ad2s90_state *st;
- int ret;

indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
if (!indio_dev)
@@ -94,16 +93,6 @@ static int ad2s90_probe(struct spi_device *spi)
indio_dev->num_channels = 1;
indio_dev->name = spi_get_device_id(spi)->name;

- /* need 600ns between CS and the first falling edge of SCLK */
- spi->max_speed_hz = 830000;
- spi->mode = SPI_MODE_3;
- ret = spi_setup(spi);
-
- if (ret < 0) {
- dev_err(&spi->dev, "spi_setup failed!\n");
- return ret;
- }
-
return devm_iio_device_register(indio_dev->dev.parent, indio_dev);
}

--
2.18.0

Matheus Tavares

unread,
Nov 17, 2018, 11:26:24 PM11/17/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
From: Alexandru Ardelean <alexandru...@analog.com>

This patch adds a max frequency check at the beginning of ad2s90_probe
function so that when it is set to a value above 0.83Mhz, dev_err is
called with an appropriate message and -EINVAL is returned.

The defined limit is 0.83Mhz instead of 2Mhz, which is the chip's max
frequency as specified in the datasheet, because, as also specified in
the datasheet, a 600ns delay is expected between the application of a
logic LO to CS and the application of SCLK. Since the delay is not
implemented in the spi code, to satisfy it, SCLK's period should be at
most 2 * 600ns, so the max frequency should be 1 / (2 * 6e-7), which
gives roughly 830000Hz.

Signed-off-by: Alexandru Ardelean <alexandru...@analog.com>
Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
---
Changes in v2:
- Correctly credit Alexandru as the patch's author

drivers/staging/iio/resolver/ad2s90.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c
index 913d6fad2d4d..fe90f2056bff 100644
--- a/drivers/staging/iio/resolver/ad2s90.c
+++ b/drivers/staging/iio/resolver/ad2s90.c
@@ -19,6 +19,12 @@
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>

+/*
+ * Although chip's max frequency is 2Mhz, it needs 600ns between CS and the
+ * first falling edge of SCLK, so frequency should be at most 1 / (2 * 6e-7)
+ */
+#define AD2S90_MAX_SPI_FREQ_HZ 830000
+
struct ad2s90_state {
struct mutex lock;
struct spi_device *sdev;
@@ -78,6 +84,12 @@ static int ad2s90_probe(struct spi_device *spi)
struct iio_dev *indio_dev;
struct ad2s90_state *st;

+ if (spi->max_speed_hz > AD2S90_MAX_SPI_FREQ_HZ) {
+ dev_err(&spi->dev, "SPI CLK, %d Hz exceeds %d Hz\n",
+ spi->max_speed_hz, AD2S90_MAX_SPI_FREQ_HZ);
+ return -EINVAL;
+ }
+
indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
if (!indio_dev)
return -ENOMEM;
--
2.18.0

Matheus Tavares

unread,
Nov 17, 2018, 11:26:28 PM11/17/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
This patch adds the device tree binding documentation for the ad2s90
resolver-to-digital converter.

Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
---
Changes in v2:
- Rewritten 'spi-cpol and spi-cpha' item to say that the device can
work in either mode (0,0) or (1,1) and explain how they should be
specified in DT.

.../bindings/iio/resolver/ad2s90.txt | 28 +++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/resolver/ad2s90.txt

diff --git a/Documentation/devicetree/bindings/iio/resolver/ad2s90.txt b/Documentation/devicetree/bindings/iio/resolver/ad2s90.txt
new file mode 100644
index 000000000000..594417539938
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/resolver/ad2s90.txt
@@ -0,0 +1,28 @@
+Analog Devices AD2S90 Resolver-to-Digital Converter
+
+https://www.analog.com/en/products/ad2s90.html
+
+Required properties:
+ - compatible: should be "adi,ad2s90"
+ - reg: SPI chip select number for the device
+ - spi-max-frequency: set maximum clock frequency, must be 830000
+ - spi-cpol and spi-cpha:
+ Either SPI mode (0,0) or (1,1) must be used, so specify none or both of
+ spi-cpha, spi-cpol.
+
+Note about max frequency:
+ Chip's max frequency, as specified in its datasheet, is 2Mhz. But a 600ns
+ delay is expected between the application of a logic LO to CS and the
+ application of SCLK, as also specified. And since the delay is not
+ implemented in the spi code, to satisfy it, SCLK's period should be at most
+ 2 * 600ns, so the max frequency should be 1 / (2 * 6e-7), which gives
+ roughly 830000Hz.
+
+Example:
+resolver@0 {
+ compatible = "adi,ad2s90";
+ reg = <0>;
+ spi-max-frequency = <830000>;
+ spi-cpol;
+ spi-cpha;
+};
--
2.18.0

Matheus Tavares

unread,
Nov 17, 2018, 11:26:31 PM11/17/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
This patch removes the license boilerplate text at the top of ad2s90.c
and, instead, adds the SPDX GPL-2.0 license identifier, which solves the
checkpatch.pl warning:
"WARNING: Missing or malformed SPDX-License-Identifier tag in line 1".

Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
---
Changes in v2:
- Changed GPL-2.0-only identifier to GPL-2.0
- Removed license boilerplate text
- Rewritten patch message to reflect these modifications

drivers/staging/iio/resolver/ad2s90.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c
index fe90f2056bff..9aa229ba47e7 100644
--- a/drivers/staging/iio/resolver/ad2s90.c
+++ b/drivers/staging/iio/resolver/ad2s90.c
@@ -1,12 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* ad2s90.c simple support for the ADI Resolver to Digital Converters: AD2S90
*
* Copyright (c) 2010-2010 Analog Devices Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
*/
#include <linux/types.h>
#include <linux/mutex.h>
--
2.18.0

Matheus Tavares

unread,
Nov 17, 2018, 11:26:36 PM11/17/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
From: Victor Colombo <victor...@gmail.com>

Fix the checkpatch.pl issue:
"CHECK: struct mutex definition without comment".

Signed-off-by: Victor Colombo <victor...@gmail.com>
Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
---
Changes in v2:
- Patch added in v2

drivers/staging/iio/resolver/ad2s90.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c
index 9aa229ba47e7..f04dc5dede00 100644
--- a/drivers/staging/iio/resolver/ad2s90.c
+++ b/drivers/staging/iio/resolver/ad2s90.c
@@ -22,7 +22,7 @@
#define AD2S90_MAX_SPI_FREQ_HZ 830000

struct ad2s90_state {
- struct mutex lock;
+ struct mutex lock; /* lock to protect rx buffer */
struct spi_device *sdev;
u8 rx[2] ____cacheline_aligned;
};
--
2.18.0

Matheus Tavares

unread,
Nov 17, 2018, 11:26:40 PM11/17/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
Move ad2s90 resolver driver out of staging to the main tree.

Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
Signed-off-by: Victor Colombo <victor...@gmail.com>
---
Changes in v2:
- Disabled git move detection, to see the whole code, as Jonathan
suggested

drivers/iio/resolver/Kconfig | 10 ++
drivers/iio/resolver/Makefile | 1 +
drivers/iio/resolver/ad2s90.c | 131 ++++++++++++++++++++++++++
drivers/staging/iio/resolver/Kconfig | 10 --
drivers/staging/iio/resolver/Makefile | 1 -
drivers/staging/iio/resolver/ad2s90.c | 131 --------------------------
6 files changed, 142 insertions(+), 142 deletions(-)
create mode 100644 drivers/iio/resolver/ad2s90.c
delete mode 100644 drivers/staging/iio/resolver/ad2s90.c

diff --git a/drivers/iio/resolver/ad2s90.c b/drivers/iio/resolver/ad2s90.c
new file mode 100644
index 000000000000..f04dc5dede00
--- /dev/null
+++ b/drivers/iio/resolver/ad2s90.c
@@ -0,0 +1,131 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * ad2s90.c simple support for the ADI Resolver to Digital Converters: AD2S90
+ *
+ * Copyright (c) 2010-2010 Analog Devices Inc.
+ */
+#include <linux/types.h>
+#include <linux/mutex.h>
+#include <linux/device.h>
+#include <linux/spi/spi.h>
+#include <linux/slab.h>
+#include <linux/sysfs.h>
+#include <linux/module.h>
+
+#include <linux/iio/iio.h>
+#include <linux/iio/sysfs.h>
+
+/*
+ * Although chip's max frequency is 2Mhz, it needs 600ns between CS and the
+ * first falling edge of SCLK, so frequency should be at most 1 / (2 * 6e-7)
+ */
+#define AD2S90_MAX_SPI_FREQ_HZ 830000
+
+struct ad2s90_state {
+ struct mutex lock; /* lock to protect rx buffer */
+ struct spi_device *sdev;
+ u8 rx[2] ____cacheline_aligned;
+};
+
+static int ad2s90_read_raw(struct iio_dev *indio_dev,
+ struct iio_chan_spec const *chan,
+ int *val,
+ int *val2,
+ long m)
+{
+ int ret;
+ struct ad2s90_state *st = iio_priv(indio_dev);
+
+ if (chan->type != IIO_ANGL)
+ return -EINVAL;
+
+ switch (m) {
+ case IIO_CHAN_INFO_SCALE:
+ /* 2 * Pi / 2^12 */
+ *val = 6283; /* mV */
+ *val2 = 12;
+ return IIO_VAL_FRACTIONAL_LOG2;
+ case IIO_CHAN_INFO_RAW:
+ mutex_lock(&st->lock);
+ ret = spi_read(st->sdev, st->rx, 2);
+ if (ret < 0) {
+ mutex_unlock(&st->lock);
+ return ret;
+ }
+ *val = (((u16)(st->rx[0])) << 4) | ((st->rx[1] & 0xF0) >> 4);
+
+ mutex_unlock(&st->lock);
+
+ return IIO_VAL_INT;
+ default:
+ break;
+ }
+
+ return -EINVAL;
+}
+
+static const struct iio_info ad2s90_info = {
+ .read_raw = ad2s90_read_raw,
+};
+
+static const struct iio_chan_spec ad2s90_chan = {
+ .type = IIO_ANGL,
+ .indexed = 1,
+ .channel = 0,
+ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),
+};
+
+static int ad2s90_probe(struct spi_device *spi)
+{
+ struct iio_dev *indio_dev;
+ struct ad2s90_state *st;
+
+ if (spi->max_speed_hz > AD2S90_MAX_SPI_FREQ_HZ) {
+ dev_err(&spi->dev, "SPI CLK, %d Hz exceeds %d Hz\n",
+ spi->max_speed_hz, AD2S90_MAX_SPI_FREQ_HZ);
+ return -EINVAL;
+ }
+
+ indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
+ if (!indio_dev)
+ return -ENOMEM;
+ st = iio_priv(indio_dev);
+ spi_set_drvdata(spi, indio_dev);
+
+ mutex_init(&st->lock);
+ st->sdev = spi;
+ indio_dev->dev.parent = &spi->dev;
+ indio_dev->info = &ad2s90_info;
+ indio_dev->modes = INDIO_DIRECT_MODE;
+ indio_dev->channels = &ad2s90_chan;
+ indio_dev->num_channels = 1;
+ indio_dev->name = spi_get_device_id(spi)->name;
+
+ return devm_iio_device_register(indio_dev->dev.parent, indio_dev);
+}
+
+static const struct of_device_id ad2s90_of_match[] = {
+ { .compatible = "adi,ad2s90", },
+ {}
+};
+MODULE_DEVICE_TABLE(of, ad2s90_of_match);
+
+static const struct spi_device_id ad2s90_id[] = {
+ { "ad2s90" },
+ {}
+};
+MODULE_DEVICE_TABLE(spi, ad2s90_id);
+
+static struct spi_driver ad2s90_driver = {
+ .driver = {
+ .name = "ad2s90",
+ .of_match_table = of_match_ptr(ad2s90_of_match),
+ },
+ .probe = ad2s90_probe,
+ .id_table = ad2s90_id,
+};
+module_spi_driver(ad2s90_driver);
+
+MODULE_AUTHOR("Graff Yang <graff...@gmail.com>");
+MODULE_DESCRIPTION("Analog Devices AD2S90 Resolver to Digital SPI driver");
+MODULE_LICENSE("GPL v2");
diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c
deleted file mode 100644
index f04dc5dede00..000000000000
--- a/drivers/staging/iio/resolver/ad2s90.c
+++ /dev/null
@@ -1,131 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * ad2s90.c simple support for the ADI Resolver to Digital Converters: AD2S90
- *
- * Copyright (c) 2010-2010 Analog Devices Inc.
- */
-#include <linux/types.h>
-#include <linux/mutex.h>
-#include <linux/device.h>
-#include <linux/spi/spi.h>
-#include <linux/slab.h>
-#include <linux/sysfs.h>
-#include <linux/module.h>
-
-#include <linux/iio/iio.h>
-#include <linux/iio/sysfs.h>
-
-/*
- * Although chip's max frequency is 2Mhz, it needs 600ns between CS and the
- * first falling edge of SCLK, so frequency should be at most 1 / (2 * 6e-7)
- */
-#define AD2S90_MAX_SPI_FREQ_HZ 830000
-
-struct ad2s90_state {
- struct mutex lock; /* lock to protect rx buffer */
- struct spi_device *sdev;
- u8 rx[2] ____cacheline_aligned;
-};
-
-static int ad2s90_read_raw(struct iio_dev *indio_dev,
- struct iio_chan_spec const *chan,
- int *val,
- int *val2,
- long m)
-{
- int ret;
- struct ad2s90_state *st = iio_priv(indio_dev);
-
- if (chan->type != IIO_ANGL)
- return -EINVAL;
-
- switch (m) {
- case IIO_CHAN_INFO_SCALE:
- /* 2 * Pi / 2^12 */
- *val = 6283; /* mV */
- *val2 = 12;
- return IIO_VAL_FRACTIONAL_LOG2;
- case IIO_CHAN_INFO_RAW:
- mutex_lock(&st->lock);
- ret = spi_read(st->sdev, st->rx, 2);
- if (ret < 0) {
- mutex_unlock(&st->lock);
- return ret;
- }
- *val = (((u16)(st->rx[0])) << 4) | ((st->rx[1] & 0xF0) >> 4);
-
- mutex_unlock(&st->lock);
-
- return IIO_VAL_INT;
- default:
- break;
- }
-
- return -EINVAL;
-}
-
-static const struct iio_info ad2s90_info = {
- .read_raw = ad2s90_read_raw,
-};
-
-static const struct iio_chan_spec ad2s90_chan = {
- .type = IIO_ANGL,
- .indexed = 1,
- .channel = 0,
- .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),
-};
-
-static int ad2s90_probe(struct spi_device *spi)
-{
- struct iio_dev *indio_dev;
- struct ad2s90_state *st;
-
- if (spi->max_speed_hz > AD2S90_MAX_SPI_FREQ_HZ) {
- dev_err(&spi->dev, "SPI CLK, %d Hz exceeds %d Hz\n",
- spi->max_speed_hz, AD2S90_MAX_SPI_FREQ_HZ);
- return -EINVAL;
- }
-
- indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
- if (!indio_dev)
- return -ENOMEM;
- st = iio_priv(indio_dev);
- spi_set_drvdata(spi, indio_dev);
-
- mutex_init(&st->lock);
- st->sdev = spi;
- indio_dev->dev.parent = &spi->dev;
- indio_dev->info = &ad2s90_info;
- indio_dev->modes = INDIO_DIRECT_MODE;
- indio_dev->channels = &ad2s90_chan;
- indio_dev->num_channels = 1;
- indio_dev->name = spi_get_device_id(spi)->name;
-
- return devm_iio_device_register(indio_dev->dev.parent, indio_dev);
-}
-
-static const struct of_device_id ad2s90_of_match[] = {
- { .compatible = "adi,ad2s90", },
- {}
-};
-MODULE_DEVICE_TABLE(of, ad2s90_of_match);
-
-static const struct spi_device_id ad2s90_id[] = {
- { "ad2s90" },
- {}
-};
-MODULE_DEVICE_TABLE(spi, ad2s90_id);
-
-static struct spi_driver ad2s90_driver = {
- .driver = {
- .name = "ad2s90",
- .of_match_table = of_match_ptr(ad2s90_of_match),
- },
- .probe = ad2s90_probe,
- .id_table = ad2s90_id,
-};
-module_spi_driver(ad2s90_driver);
-
-MODULE_AUTHOR("Graff Yang <graff...@gmail.com>");
-MODULE_DESCRIPTION("Analog Devices AD2S90 Resolver to Digital SPI driver");
-MODULE_LICENSE("GPL v2");
--
2.18.0

Ardelean, Alexandru

unread,
Nov 19, 2018, 3:09:26 AM11/19/18
to la...@metafoo.de, rob...@kernel.org, knaa...@gmx.de, ji...@kernel.org, Hennerich, Michael, mark.r...@arm.com, matheus.b...@usp.br, pme...@pmeerw.net, gre...@linuxfoundation.org, victor...@gmail.com, linux-...@vger.kernel.org, linu...@vger.kernel.org, de...@driverdev.osuosl.org, kerne...@googlegroups.com, devic...@vger.kernel.org
On Sun, 2018-11-18 at 02:25 -0200, Matheus Tavares wrote:
> This patch adds device tree support to ad2s90 with standard
> device tree id table.
>

Hey,

Comment inline
I think you need to remove the of_match_ptr().
There was a comment from Jonathan on another thread about this.
See:
https://patchwork.kernel.org/patch/10682963/

So,
+ .of_match_table = of_match_ptr(ad2s90_of_match),

becomes
> + .of_match_table = ad2s90_of_match,

Ardelean, Alexandru

unread,
Nov 19, 2018, 3:18:58 AM11/19/18
to la...@metafoo.de, rob...@kernel.org, knaa...@gmx.de, ji...@kernel.org, Hennerich, Michael, mark.r...@arm.com, matheus.b...@usp.br, pme...@pmeerw.net, gre...@linuxfoundation.org, victor...@gmail.com, linux-...@vger.kernel.org, linu...@vger.kernel.org, de...@driverdev.osuosl.org, kerne...@googlegroups.com, devic...@vger.kernel.org
On Sun, 2018-11-18 at 02:25 -0200, Matheus Tavares wrote:
> From: Alexandru Ardelean <alexandru...@analog.com>
>
> This patch adds a max frequency check at the beginning of ad2s90_probe
> function so that when it is set to a value above 0.83Mhz, dev_err is
> called with an appropriate message and -EINVAL is returned.
>
> The defined limit is 0.83Mhz instead of 2Mhz, which is the chip's max
> frequency as specified in the datasheet, because, as also specified in
> the datasheet, a 600ns delay is expected between the application of a
> logic LO to CS and the application of SCLK. Since the delay is not
> implemented in the spi code, to satisfy it, SCLK's period should be at
> most 2 * 600ns, so the max frequency should be 1 / (2 * 6e-7), which
> gives roughly 830000Hz.
>
> Signed-off-by: Alexandru Ardelean <alexandru...@analog.com>

I think you can use "Suggested-by:" instead.
But this is also fine.

Ardelean, Alexandru

unread,
Nov 19, 2018, 3:22:18 AM11/19/18
to la...@metafoo.de, rob...@kernel.org, knaa...@gmx.de, ji...@kernel.org, Hennerich, Michael, mark.r...@arm.com, matheus.b...@usp.br, pme...@pmeerw.net, gre...@linuxfoundation.org, victor...@gmail.com, linux-...@vger.kernel.org, linu...@vger.kernel.org, de...@driverdev.osuosl.org, kerne...@googlegroups.com, devic...@vger.kernel.org
On Sun, 2018-11-18 at 02:25 -0200, Matheus Tavares wrote:
> This patch adds the device tree binding documentation for the ad2s90
> resolver-to-digital converter.
>

One minor comment inline.
For SPI properties it's a good idea to also reference the document for SPI
bindings.
Something like:
See for more details:
Documentation/devicetree/bindings/spi/spi-bus.txt

Matheus Tavares Bernardino

unread,
Nov 20, 2018, 6:34:50 PM11/20/18
to Alexandru Ardelean, Lars-Peter Clausen, Rob Herring, Hartmut Knaack, Jonathan Cameron, Michael Hennerich, Mark Rutland, Peter Meerwald-Stadler, Greg Kroah-Hartman, Victor Colombo, linux-...@vger.kernel.org, linu...@vger.kernel.org, de...@driverdev.osuosl.org, kerne...@googlegroups.com, devic...@vger.kernel.org
Thanks, Alex! I'll add that for v3.

Also, can you confirm AD2S90 works in both spi mode 0 and 3? It's not
explicitly stated in the datasheet, but that's what it seemed to me
and some colleagues.

Thanks,
Matheus

> > +
> > +Note about max frequency:
> > + Chip's max frequency, as specified in its datasheet, is 2Mhz. But a
> > 600ns
> > + delay is expected between the application of a logic LO to CS and
> > the
> > + application of SCLK, as also specified. And since the delay is not
> > + implemented in the spi code, to satisfy it, SCLK's period should be
> > at most
> > + 2 * 600ns, so the max frequency should be 1 / (2 * 6e-7), which
> > gives
> > + roughly 830000Hz.
> > +
> > +Example:
> > +resolver@0 {
> > + compatible = "adi,ad2s90";
> > + reg = <0>;
> > + spi-max-frequency = <830000>;
> > + spi-cpol;
> > + spi-cpha;
> > +};
>
> --
> You received this message because you are subscribed to the Google Groups "Kernel USP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kernel-usp+...@googlegroups.com.
> To post to this group, send email to kerne...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/kernel-usp/563614e00314ba92b9513645a82fde06504a42d5.camel%40analog.com.
> For more options, visit https://groups.google.com/d/optout.

Matheus Tavares Bernardino

unread,
Nov 20, 2018, 6:59:32 PM11/20/18
to Alexandru Ardelean, Lars-Peter Clausen, Rob Herring, Hartmut Knaack, Jonathan Cameron, Michael Hennerich, Mark Rutland, Peter Meerwald-Stadler, Greg Kroah-Hartman, Victor Colombo, linux-...@vger.kernel.org, linu...@vger.kernel.org, de...@driverdev.osuosl.org, kerne...@googlegroups.com, devic...@vger.kernel.org
Hm, got it, thanks!

I don't understand much about ACPI yet, and I had understood the
"of_match_ptr" as a guard. Could someone point me in which cases it
should be used? Or is it obsolete?

Matheus

> So,
> + .of_match_table = of_match_ptr(ad2s90_of_match),
>
> becomes
> > + .of_match_table = ad2s90_of_match,
>
> > },
> > .probe = ad2s90_probe,
> > .id_table = ad2s90_id,
>
> --
> You received this message because you are subscribed to the Google Groups "Kernel USP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kernel-usp+...@googlegroups.com.
> To post to this group, send email to kerne...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/kernel-usp/f250fa3a01b51d59979e7a2e3e42cc34d02aa52e.camel%40analog.com.

Jonathan Cameron

unread,
Nov 21, 2018, 2:12:45 PM11/21/18
to Matheus Tavares Bernardino, Alexandru Ardelean, Lars-Peter Clausen, Rob Herring, Hartmut Knaack, Michael Hennerich, Mark Rutland, Peter Meerwald-Stadler, Greg Kroah-Hartman, Victor Colombo, linux-...@vger.kernel.org, linu...@vger.kernel.org, de...@driverdev.osuosl.org, kerne...@googlegroups.com, devic...@vger.kernel.org
On Tue, 20 Nov 2018 21:59:19 -0200
Matheus Tavares Bernardino <matheus.b...@usp.br> wrote:

It's an odd one. The ACPI route allows you to basically provide
a temporary (these are really just for debugging purposes)

https://lwn.net/Articles/612062/
https://www.kernel.org/doc/Documentation/acpi/enumeration.txt
search for prp0001

So of_match_ptr is sort of obsolete, but conversely for some
types of driver it might never make sense to use the prp0001
route. For the stuff I play with in my day job for example
we can just change the firmware to do it right whenever we
need to and have appropriate ACPI ids to be able to issue
unique ones.

Jonathan

Matheus Tavares

unread,
Nov 23, 2018, 7:23:27 PM11/23/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
This series adds device tree support to ad2s90, adds the respective dt-binding
documentation, solves all remaining codestyle problems for ad2s90 and move it
out of staging.

This patch set completes all the remaining itens listed to be done before moving
the driver out of staging, enumerated in this mail thread:
https://marc.info/?l=linux-iio&m=154028966111330&w=2.

Alexandru Ardelean (1):
staging:iio:ad2s90: Add max frequency check at probe

Matheus Tavares (5):
staging:iio:ad2s90: Add device tree support
staging:iio:ad2s90: Remove spi setup that should be done via dt
dt-bindings:iio:resolver: Add docs for ad2s90
staging:iio:ad2s90: Replace license text w/ SPDX identifier
staging:iio:ad2s90: Move out of staging

Victor Colombo (1):
staging:iio:ad2s90: Add comment to device state mutex

.../bindings/iio/resolver/ad2s90.txt | 31 +++++
drivers/iio/resolver/Kconfig | 10 ++
drivers/iio/resolver/Makefile | 1 +
drivers/iio/resolver/ad2s90.c | 131 ++++++++++++++++++
drivers/staging/iio/resolver/Kconfig | 10 --
drivers/staging/iio/resolver/Makefile | 1 -
drivers/staging/iio/resolver/ad2s90.c | 127 -----------------
7 files changed, 173 insertions(+), 138 deletions(-)
create mode 100644 Documentation/devicetree/bindings/iio/resolver/ad2s90.txt
create mode 100644 drivers/iio/resolver/ad2s90.c
delete mode 100644 drivers/staging/iio/resolver/ad2s90.c

--
2.18.0

Matheus Tavares

unread,
Nov 23, 2018, 7:23:31 PM11/23/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
This patch adds device tree support to ad2s90 with standard
device tree id table.

Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
---
Changes in v3:
- Removed of_patch_ptr from of_match_table assignment

Changes in v2:
- none

drivers/staging/iio/resolver/ad2s90.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c
index 3e257ac46f7a..fdae067ed866 100644
--- a/drivers/staging/iio/resolver/ad2s90.c
+++ b/drivers/staging/iio/resolver/ad2s90.c
@@ -107,6 +107,12 @@ static int ad2s90_probe(struct spi_device *spi)
return devm_iio_device_register(indio_dev->dev.parent, indio_dev);
}

+static const struct of_device_id ad2s90_of_match[] = {
+ { .compatible = "adi,ad2s90", },
+ {}
+};
+MODULE_DEVICE_TABLE(of, ad2s90_of_match);
+
static const struct spi_device_id ad2s90_id[] = {
{ "ad2s90" },
{}
@@ -116,6 +122,7 @@ MODULE_DEVICE_TABLE(spi, ad2s90_id);
static struct spi_driver ad2s90_driver = {
.driver = {
.name = "ad2s90",
+ .of_match_table = ad2s90_of_match,
},
.probe = ad2s90_probe,
.id_table = ad2s90_id,
--
2.18.0

Matheus Tavares

unread,
Nov 23, 2018, 7:23:35 PM11/23/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
The ad2s90 driver currently sets some spi settings (max_speed_hz and
mode) at ad2s90_probe. Since the maximum frequency is a required element
in DT binding for spi slave devices and because the spi mode for the
device can be either (0,0) or (1,1), these settings should be handled
via device tree, not in the driver's code. This patch removes them from
the probe function.

Note: The way in which the mentioned spi settings need to be specified
on the ad2s90's node of a device tree will be documented in the future
patch "dt-bindings:iio:resolver: Add docs for ad2s90".

Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
---
Changes in v3:
- none

Changes in v2:
- Rewritten patch message to better explain why the code snippet in
question should be removed.

drivers/staging/iio/resolver/ad2s90.c | 11 -----------
1 file changed, 11 deletions(-)

diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c
index fdae067ed866..abb9b9147ee6 100644
--- a/drivers/staging/iio/resolver/ad2s90.c
+++ b/drivers/staging/iio/resolver/ad2s90.c
@@ -77,7 +77,6 @@ static int ad2s90_probe(struct spi_device *spi)
{
struct iio_dev *indio_dev;
struct ad2s90_state *st;
- int ret;

indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
if (!indio_dev)
@@ -94,16 +93,6 @@ static int ad2s90_probe(struct spi_device *spi)
indio_dev->num_channels = 1;
indio_dev->name = spi_get_device_id(spi)->name;

- /* need 600ns between CS and the first falling edge of SCLK */
- spi->max_speed_hz = 830000;
- spi->mode = SPI_MODE_3;
- ret = spi_setup(spi);
-
- if (ret < 0) {
- dev_err(&spi->dev, "spi_setup failed!\n");
- return ret;
- }
-

Matheus Tavares

unread,
Nov 23, 2018, 7:23:39 PM11/23/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
From: Alexandru Ardelean <alexandru...@analog.com>

This patch adds a max frequency check at the beginning of ad2s90_probe
function so that when it is set to a value above 0.83Mhz, dev_err is
called with an appropriate message and -EINVAL is returned.

The defined limit is 0.83Mhz instead of 2Mhz, which is the chip's max
frequency as specified in the datasheet, because, as also specified in
the datasheet, a 600ns delay is expected between the application of a
logic LO to CS and the application of SCLK. Since the delay is not
implemented in the spi code, to satisfy it, SCLK's period should be at
most 2 * 600ns, so the max frequency should be 1 / (2 * 6e-7), which
gives roughly 830000Hz.

Signed-off-by: Alexandru Ardelean <alexandru...@analog.com>
Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
---
Changes in v3:
- none

Changes in v2:
- Correctly credit Alexandru as the patch's author

drivers/staging/iio/resolver/ad2s90.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c
index abb9b9147ee6..4721e9bbb8b0 100644
--- a/drivers/staging/iio/resolver/ad2s90.c
+++ b/drivers/staging/iio/resolver/ad2s90.c
@@ -19,6 +19,12 @@
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>

+/*
+ * Although chip's max frequency is 2Mhz, it needs 600ns between CS and the
+ * first falling edge of SCLK, so frequency should be at most 1 / (2 * 6e-7)
+ */
+#define AD2S90_MAX_SPI_FREQ_HZ 830000
+
struct ad2s90_state {
struct mutex lock;
struct spi_device *sdev;
@@ -78,6 +84,12 @@ static int ad2s90_probe(struct spi_device *spi)
struct iio_dev *indio_dev;
struct ad2s90_state *st;

+ if (spi->max_speed_hz > AD2S90_MAX_SPI_FREQ_HZ) {
+ dev_err(&spi->dev, "SPI CLK, %d Hz exceeds %d Hz\n",
+ spi->max_speed_hz, AD2S90_MAX_SPI_FREQ_HZ);
+ return -EINVAL;
+ }
+
indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
if (!indio_dev)
return -ENOMEM;
--
2.18.0

Matheus Tavares

unread,
Nov 23, 2018, 7:23:43 PM11/23/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
This patch adds the device tree binding documentation for the ad2s90
resolver-to-digital converter.

Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
---
Changes in v3:
- Added reference to spi-bus documentation after spi properties, as
suggested by Alexandru Ardelean.

Changes in v2:
- Rewritten 'spi-cpol and spi-cpha' item to say that the device can
work in either mode (0,0) or (1,1) and explain how they should be
specified in DT.

.../bindings/iio/resolver/ad2s90.txt | 31 +++++++++++++++++++
1 file changed, 31 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/resolver/ad2s90.txt

diff --git a/Documentation/devicetree/bindings/iio/resolver/ad2s90.txt b/Documentation/devicetree/bindings/iio/resolver/ad2s90.txt
new file mode 100644
index 000000000000..477d41fa6467
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/resolver/ad2s90.txt
@@ -0,0 +1,31 @@
+Analog Devices AD2S90 Resolver-to-Digital Converter
+
+https://www.analog.com/en/products/ad2s90.html
+
+Required properties:
+ - compatible: should be "adi,ad2s90"
+ - reg: SPI chip select number for the device
+ - spi-max-frequency: set maximum clock frequency, must be 830000
+ - spi-cpol and spi-cpha:
+ Either SPI mode (0,0) or (1,1) must be used, so specify none or both of
+ spi-cpha, spi-cpol.
+
+See for more details:
+ Documentation/devicetree/bindings/spi/spi-bus.txt
+
+Note about max frequency:
+ Chip's max frequency, as specified in its datasheet, is 2Mhz. But a 600ns
+ delay is expected between the application of a logic LO to CS and the
+ application of SCLK, as also specified. And since the delay is not
+ implemented in the spi code, to satisfy it, SCLK's period should be at most
+ 2 * 600ns, so the max frequency should be 1 / (2 * 6e-7), which gives
+ roughly 830000Hz.
+
+Example:
+resolver@0 {
+ compatible = "adi,ad2s90";
+ reg = <0>;
+ spi-max-frequency = <830000>;
+ spi-cpol;
+ spi-cpha;
+};
--
2.18.0

Matheus Tavares

unread,
Nov 23, 2018, 7:23:47 PM11/23/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
This patch removes the license boilerplate text at the top of ad2s90.c
and, instead, adds the SPDX GPL-2.0 license identifier, which solves the
checkpatch.pl warning:
"WARNING: Missing or malformed SPDX-License-Identifier tag in line 1".

Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
---
Changes in v3:
- none

Changes in v2:
- Changed GPL-2.0-only identifier to GPL-2.0
- Removed license boilerplate text
- Rewritten patch message to reflect these modifications

drivers/staging/iio/resolver/ad2s90.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c
index 4721e9bbb8b0..678351dabe6b 100644
--- a/drivers/staging/iio/resolver/ad2s90.c
+++ b/drivers/staging/iio/resolver/ad2s90.c
@@ -1,12 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* ad2s90.c simple support for the ADI Resolver to Digital Converters: AD2S90
*
* Copyright (c) 2010-2010 Analog Devices Inc.

Matheus Tavares

unread,
Nov 23, 2018, 7:23:51 PM11/23/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
From: Victor Colombo <victor...@gmail.com>

Fix the checkpatch.pl issue:
"CHECK: struct mutex definition without comment".

Signed-off-by: Victor Colombo <victor...@gmail.com>
Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
---
Changes in v3:
- none

Changes in v2:
- Patch added in v2

drivers/staging/iio/resolver/ad2s90.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c
index 678351dabe6b..a41f5cb10da5 100644
--- a/drivers/staging/iio/resolver/ad2s90.c
+++ b/drivers/staging/iio/resolver/ad2s90.c
@@ -22,7 +22,7 @@
#define AD2S90_MAX_SPI_FREQ_HZ 830000

struct ad2s90_state {
- struct mutex lock;
+ struct mutex lock; /* lock to protect rx buffer */

Matheus Tavares

unread,
Nov 23, 2018, 7:23:55 PM11/23/18
to Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
Move ad2s90 resolver driver out of staging to the main tree.

Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
Signed-off-by: Victor Colombo <victor...@gmail.com>
---
Changes in v3:
- none

Changes in v2:
- Disabled git move detection, to see the whole code, as Jonathan
suggested

drivers/iio/resolver/Kconfig | 10 ++
drivers/iio/resolver/Makefile | 1 +
drivers/iio/resolver/ad2s90.c | 131 ++++++++++++++++++++++++++
drivers/staging/iio/resolver/Kconfig | 10 --
drivers/staging/iio/resolver/Makefile | 1 -
drivers/staging/iio/resolver/ad2s90.c | 131 --------------------------
6 files changed, 142 insertions(+), 142 deletions(-)
create mode 100644 drivers/iio/resolver/ad2s90.c
delete mode 100644 drivers/staging/iio/resolver/ad2s90.c

new file mode 100644
index 000000000000..a41f5cb10da5
--- /dev/null
+++ b/drivers/iio/resolver/ad2s90.c
@@ -0,0 +1,131 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * ad2s90.c simple support for the ADI Resolver to Digital Converters: AD2S90
+ *
+ * Copyright (c) 2010-2010 Analog Devices Inc.
+ */
+#include <linux/types.h>
+#include <linux/mutex.h>
+#include <linux/device.h>
+#include <linux/spi/spi.h>
+#include <linux/slab.h>
+#include <linux/sysfs.h>
+#include <linux/module.h>
+
+#include <linux/iio/iio.h>
+#include <linux/iio/sysfs.h>
+
+/*
+ * Although chip's max frequency is 2Mhz, it needs 600ns between CS and the
+ * first falling edge of SCLK, so frequency should be at most 1 / (2 * 6e-7)
+ */
+#define AD2S90_MAX_SPI_FREQ_HZ 830000
+
+struct ad2s90_state {
+ struct mutex lock; /* lock to protect rx buffer */
+ struct spi_device *sdev;
+ u8 rx[2] ____cacheline_aligned;
+};
+
+static int ad2s90_read_raw(struct iio_dev *indio_dev,
+ struct iio_chan_spec const *chan,
+ int *val,
+ int *val2,
+ long m)
+{
+ int ret;
+ struct ad2s90_state *st = iio_priv(indio_dev);
+
+ if (chan->type != IIO_ANGL)
+ return -EINVAL;
+
+ switch (m) {
+ case IIO_CHAN_INFO_SCALE:
+ /* 2 * Pi / 2^12 */
+ *val = 6283; /* mV */
+ *val2 = 12;
+ return IIO_VAL_FRACTIONAL_LOG2;
+ case IIO_CHAN_INFO_RAW:
+ mutex_lock(&st->lock);
+ ret = spi_read(st->sdev, st->rx, 2);
+ if (ret < 0) {
+ mutex_unlock(&st->lock);
+ return ret;
+ }
+ *val = (((u16)(st->rx[0])) << 4) | ((st->rx[1] & 0xF0) >> 4);
+
+ mutex_unlock(&st->lock);
+
+ return IIO_VAL_INT;
+ default:
+ break;
+ }
+
+ return -EINVAL;
+}
+
+static const struct iio_info ad2s90_info = {
+ .read_raw = ad2s90_read_raw,
+};
+
+static const struct iio_chan_spec ad2s90_chan = {
+ .type = IIO_ANGL,
+ .indexed = 1,
+ .channel = 0,
+ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),
+};
+
+static int ad2s90_probe(struct spi_device *spi)
+{
+ struct iio_dev *indio_dev;
+ struct ad2s90_state *st;
+
+ if (spi->max_speed_hz > AD2S90_MAX_SPI_FREQ_HZ) {
+ dev_err(&spi->dev, "SPI CLK, %d Hz exceeds %d Hz\n",
+ spi->max_speed_hz, AD2S90_MAX_SPI_FREQ_HZ);
+ return -EINVAL;
+ }
+
+ indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
+ if (!indio_dev)
+ return -ENOMEM;
+ st = iio_priv(indio_dev);
+ spi_set_drvdata(spi, indio_dev);
+
+ mutex_init(&st->lock);
+ st->sdev = spi;
+ indio_dev->dev.parent = &spi->dev;
+ indio_dev->info = &ad2s90_info;
+ indio_dev->modes = INDIO_DIRECT_MODE;
+ indio_dev->channels = &ad2s90_chan;
+ indio_dev->num_channels = 1;
+ indio_dev->name = spi_get_device_id(spi)->name;
+
+ return devm_iio_device_register(indio_dev->dev.parent, indio_dev);
+}
+
+static const struct of_device_id ad2s90_of_match[] = {
+ { .compatible = "adi,ad2s90", },
+ {}
+};
+MODULE_DEVICE_TABLE(of, ad2s90_of_match);
+
+static const struct spi_device_id ad2s90_id[] = {
+ { "ad2s90" },
+ {}
+};
+MODULE_DEVICE_TABLE(spi, ad2s90_id);
+
+static struct spi_driver ad2s90_driver = {
+ .driver = {
+ .name = "ad2s90",
+ .of_match_table = ad2s90_of_match,
index a41f5cb10da5..000000000000
- if (ret < 0) {
- mutex_unlock(&st->lock);
- return ret;
- }
- indio_dev->name = spi_get_device_id(spi)->name;
-
- return devm_iio_device_register(indio_dev->dev.parent, indio_dev);
-}
-
-static const struct of_device_id ad2s90_of_match[] = {
- { .compatible = "adi,ad2s90", },
- {}
-};
-MODULE_DEVICE_TABLE(of, ad2s90_of_match);
-
-static const struct spi_device_id ad2s90_id[] = {
- { "ad2s90" },
- {}
-};
-MODULE_DEVICE_TABLE(spi, ad2s90_id);
-
-static struct spi_driver ad2s90_driver = {
- .driver = {
- .name = "ad2s90",
- .of_match_table = ad2s90_of_match,

Jonathan Cameron

unread,
Nov 25, 2018, 4:56:45 AM11/25/18
to Matheus Tavares, Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
On Fri, 23 Nov 2018 22:23:12 -0200
Matheus Tavares <matheus.b...@usp.br> wrote:

> Move ad2s90 resolver driver out of staging to the main tree.
>
> Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
> Signed-off-by: Victor Colombo <victor...@gmail.com>
Hi.

One totally trivial comment inline, but if you want to clean
that up, do it after we have moved this out of staging
(unless respinning for some other reason).

However, I would like to let this sit on the mailing list for
a little longer to let others comment and perhaps to pick up
a review of the DT binding doc (which looks fine to me, but
I am forever missing issues in those!)

Good work and I'll probably pick this up later in the week.

Thanks,

Jonathan
We are into the truely trivial realms now - alphabetical order preferred
for includes.
...

Ardelean, Alexandru

unread,
Nov 26, 2018, 2:34:40 AM11/26/18
to la...@metafoo.de, rob...@kernel.org, knaa...@gmx.de, ji...@kernel.org, Hennerich, Michael, mark.r...@arm.com, matheus.b...@usp.br, pme...@pmeerw.net, gre...@linuxfoundation.org, victor...@gmail.com, linux-...@vger.kernel.org, linu...@vger.kernel.org, de...@driverdev.osuosl.org, kerne...@googlegroups.com, devic...@vger.kernel.org
On Fri, 2018-11-23 at 22:23 -0200, Matheus Tavares wrote:
> Move ad2s90 resolver driver out of staging to the main tree.
>

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

Rob Herring

unread,
Nov 26, 2018, 8:52:30 PM11/26/18
to Matheus Tavares, Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
On Fri, 23 Nov 2018 22:23:09 -0200, Matheus Tavares wrote:
> This patch adds the device tree binding documentation for the ad2s90
> resolver-to-digital converter.
>
> Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
> ---
> Changes in v3:
> - Added reference to spi-bus documentation after spi properties, as
> suggested by Alexandru Ardelean.
>
> Changes in v2:
> - Rewritten 'spi-cpol and spi-cpha' item to say that the device can
> work in either mode (0,0) or (1,1) and explain how they should be
> specified in DT.
>
> .../bindings/iio/resolver/ad2s90.txt | 31 +++++++++++++++++++
> 1 file changed, 31 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/resolver/ad2s90.txt
>

Reviewed-by: Rob Herring <ro...@kernel.org>

Jonathan Cameron

unread,
Dec 1, 2018, 10:34:16 AM12/1/18
to Matheus Tavares, Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
On Fri, 23 Nov 2018 22:23:06 -0200
Matheus Tavares <matheus.b...@usp.br> wrote:

> This patch adds device tree support to ad2s90 with standard
> device tree id table.
>
> Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.

Thanks,

Joanthan

Jonathan Cameron

unread,
Dec 1, 2018, 10:34:35 AM12/1/18
to Matheus Tavares, Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
On Fri, 23 Nov 2018 22:23:07 -0200
Matheus Tavares <matheus.b...@usp.br> wrote:

> The ad2s90 driver currently sets some spi settings (max_speed_hz and
> mode) at ad2s90_probe. Since the maximum frequency is a required element
> in DT binding for spi slave devices and because the spi mode for the
> device can be either (0,0) or (1,1), these settings should be handled
> via device tree, not in the driver's code. This patch removes them from
> the probe function.
>
> Note: The way in which the mentioned spi settings need to be specified
> on the ad2s90's node of a device tree will be documented in the future
> patch "dt-bindings:iio:resolver: Add docs for ad2s90".
>
> Signed-off-by: Matheus Tavares <matheus.b...@usp.br>

Applied,

Thanks,

Jonathan

Jonathan Cameron

unread,
Dec 1, 2018, 10:37:11 AM12/1/18
to Rob Herring, Matheus Tavares, Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders
to play with it.

Thanks,

Jonathan

Jonathan Cameron

unread,
Dec 1, 2018, 10:37:33 AM12/1/18
to Matheus Tavares, Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
On Fri, 23 Nov 2018 22:23:08 -0200
Matheus Tavares <matheus.b...@usp.br> wrote:

> From: Alexandru Ardelean <alexandru...@analog.com>
>
> This patch adds a max frequency check at the beginning of ad2s90_probe
> function so that when it is set to a value above 0.83Mhz, dev_err is
> called with an appropriate message and -EINVAL is returned.
>
> The defined limit is 0.83Mhz instead of 2Mhz, which is the chip's max
> frequency as specified in the datasheet, because, as also specified in
> the datasheet, a 600ns delay is expected between the application of a
> logic LO to CS and the application of SCLK. Since the delay is not
> implemented in the spi code, to satisfy it, SCLK's period should be at
> most 2 * 600ns, so the max frequency should be 1 / (2 * 6e-7), which
> gives roughly 830000Hz.
>
> Signed-off-by: Alexandru Ardelean <alexandru...@analog.com>
> Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
Applied,

Thanks,

Jonathan Cameron

unread,
Dec 1, 2018, 10:38:43 AM12/1/18
to Matheus Tavares, Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
On Fri, 23 Nov 2018 22:23:10 -0200
Matheus Tavares <matheus.b...@usp.br> wrote:

> This patch removes the license boilerplate text at the top of ad2s90.c
> and, instead, adds the SPDX GPL-2.0 license identifier, which solves the
> checkpatch.pl warning:
> "WARNING: Missing or malformed SPDX-License-Identifier tag in line 1".
>
> Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
Applied,

Thanks,

Jonathan

Jonathan Cameron

unread,
Dec 1, 2018, 10:39:39 AM12/1/18
to Matheus Tavares, Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman, Rob Herring, Mark Rutland, linu...@vger.kernel.org, de...@driverdev.osuosl.org, devic...@vger.kernel.org, linux-...@vger.kernel.org, Alexandru Ardelean, kerne...@googlegroups.com, victor...@gmail.com
On Fri, 23 Nov 2018 22:23:11 -0200
Matheus Tavares <matheus.b...@usp.br> wrote:

> From: Victor Colombo <victor...@gmail.com>
>
> Fix the checkpatch.pl issue:
> "CHECK: struct mutex definition without comment".
>
> Signed-off-by: Victor Colombo <victor...@gmail.com>
> Signed-off-by: Matheus Tavares <matheus.b...@usp.br>
Applied, thanks

Jonathan

Jonathan Cameron

unread,
Dec 1, 2018, 10:41:34 AM12/1/18
to Ardelean, Alexandru, la...@metafoo.de, rob...@kernel.org, knaa...@gmx.de, Hennerich, Michael, mark.r...@arm.com, matheus.b...@usp.br, pme...@pmeerw.net, gre...@linuxfoundation.org, victor...@gmail.com, linux-...@vger.kernel.org, linu...@vger.kernel.org, de...@driverdev.osuosl.org, kerne...@googlegroups.com, devic...@vger.kernel.org
On Mon, 26 Nov 2018 07:34:35 +0000
"Ardelean, Alexandru" <alexandru...@analog.com> wrote:

> On Fri, 2018-11-23 at 22:23 -0200, Matheus Tavares wrote:
> > Move ad2s90 resolver driver out of staging to the main tree.
> >
>
> Acked-by: Alexandru Ardelean <alexandru...@analog.com>
Hi Alexandru,

I took that to apply to the whole series, hope you don't mind.

Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.

Thanks,

Jonathan

>
Reply all
Reply to author
Forward
0 new messages