2018-12-08 18:19:16

by Marcelo Schmitt

[permalink] [raw]
Subject: [PATCH 0/3] Add devicetree support for ad5933

This series of patches change voltage regulator error handling for the
ad5933.
It also add an option to specify external clock reference using a clock
framework and remove the old platform data structure.
Finally it adds binding documentation for devicetree.

Marcelo Schmitt (3):
staging: iio: ad5933: change regulator binging for vref
staging: iio: ad5933: use clock framework for clock reference
staging: iio: ad5933: add binding doc for ad5933

.../iio/impedance-analyzer/ad5933.txt | 26 +++++++++
.../staging/iio/impedance-analyzer/ad5933.c | 57 +++++++++----------
2 files changed, 54 insertions(+), 29 deletions(-)
create mode 100644 Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt

--
2.17.1



2018-12-08 18:20:15

by Marcelo Schmitt

[permalink] [raw]
Subject: [PATCH 1/3] staging: iio: ad5933: change regulator binging for vref

Set a single voltage regulator for all voltage references.
Remove voltage reference value from default platafrom data struct.

Signed-off-by: Marcelo Schmitt <[email protected]>
Signed-off-by: Gabriel Capella <[email protected]>
Co-Developed-by: Gabriel Capella <[email protected]>
---
drivers/staging/iio/impedance-analyzer/ad5933.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c
index 9e52384f5370..730bc397a26b 100644
--- a/drivers/staging/iio/impedance-analyzer/ad5933.c
+++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
@@ -91,7 +91,6 @@

struct ad5933_platform_data {
unsigned long ext_clk_hz;
- unsigned short vref_mv;
};

struct ad5933_state {
@@ -113,7 +112,6 @@ struct ad5933_state {
};

static struct ad5933_platform_data ad5933_default_pdata = {
- .vref_mv = 3300,
};

#define AD5933_CHANNEL(_type, _extend_name, _info_mask_separate, _address, \
@@ -691,7 +689,7 @@ static void ad5933_work(struct work_struct *work)
static int ad5933_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
- int ret, voltage_uv = 0;
+ int ret;
struct ad5933_platform_data *pdata = dev_get_platdata(&client->dev);
struct ad5933_state *st;
struct iio_dev *indio_dev;
@@ -718,12 +716,12 @@ static int ad5933_probe(struct i2c_client *client,
dev_err(&client->dev, "Failed to enable specified VDD supply\n");
return ret;
}
- voltage_uv = regulator_get_voltage(st->reg);
+ ret = regulator_get_voltage(st->reg);
+
+ if (ret < 0)
+ goto error_disable_reg;

- if (voltage_uv)
- st->vref_mv = voltage_uv / 1000;
- else
- st->vref_mv = pdata->vref_mv;
+ st->vref_mv = ret / 1000;

if (pdata->ext_clk_hz) {
st->mclk_hz = pdata->ext_clk_hz;
--
2.17.1


2018-12-08 18:21:15

by Marcelo Schmitt

[permalink] [raw]
Subject: [PATCH 2/3] staging: iio: ad5933: use clock framework for clock reference

Add the option to specify the external clock (MCLK) using the clock
framework.
Also remove the old platform data structure.

Signed-off-by: Marcelo Schmitt <[email protected]>
Signed-off-by: Gabriel Capella <[email protected]>
Co-Developed-by: Gabriel Capella <[email protected]>
---
.../staging/iio/impedance-analyzer/ad5933.c | 43 ++++++++++---------
1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c
index 730bc397a26b..3134295f014f 100644
--- a/drivers/staging/iio/impedance-analyzer/ad5933.c
+++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
@@ -16,6 +16,7 @@
#include <linux/err.h>
#include <linux/delay.h>
#include <linux/module.h>
+#include <linux/clk.h>

#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
@@ -82,20 +83,10 @@
#define AD5933_POLL_TIME_ms 10
#define AD5933_INIT_EXCITATION_TIME_ms 100

-/**
- * struct ad5933_platform_data - platform specific data
- * @ext_clk_hz: the external clock frequency in Hz, if not set
- * the driver uses the internal clock (16.776 MHz)
- * @vref_mv: the external reference voltage in millivolt
- */
-
-struct ad5933_platform_data {
- unsigned long ext_clk_hz;
-};
-
struct ad5933_state {
struct i2c_client *client;
struct regulator *reg;
+ struct clk *mclk;
struct delayed_work work;
struct mutex lock; /* Protect sensor state */
unsigned long mclk_hz;
@@ -111,9 +102,6 @@ struct ad5933_state {
unsigned int poll_time_jiffies;
};

-static struct ad5933_platform_data ad5933_default_pdata = {
-};
-
#define AD5933_CHANNEL(_type, _extend_name, _info_mask_separate, _address, \
_scan_index, _realbits) { \
.type = (_type), \
@@ -690,9 +678,9 @@ static int ad5933_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
int ret;
- struct ad5933_platform_data *pdata = dev_get_platdata(&client->dev);
struct ad5933_state *st;
struct iio_dev *indio_dev;
+ unsigned long ext_clk_hz = 0;

indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*st));
if (!indio_dev)
@@ -704,9 +692,6 @@ static int ad5933_probe(struct i2c_client *client,

mutex_init(&st->lock);

- if (!pdata)
- pdata = &ad5933_default_pdata;
-
st->reg = devm_regulator_get(&client->dev, "vdd");
if (IS_ERR(st->reg))
return PTR_ERR(st->reg);
@@ -723,8 +708,21 @@ static int ad5933_probe(struct i2c_client *client,

st->vref_mv = ret / 1000;

- if (pdata->ext_clk_hz) {
- st->mclk_hz = pdata->ext_clk_hz;
+ st->mclk = devm_clk_get(&client->dev, "mclk");
+ if (IS_ERR(st->mclk) && PTR_ERR(st->mclk) != -ENOENT) {
+ ret = PTR_ERR(st->mclk);
+ goto error_disable_reg;
+ }
+
+ if (!IS_ERR(st->mclk)) {
+ ret = clk_prepare_enable(st->mclk);
+ if (ret < 0)
+ goto error_disable_reg;
+ ext_clk_hz = clk_get_rate(st->mclk);
+ }
+
+ if (ext_clk_hz) {
+ st->mclk_hz = ext_clk_hz;
st->ctrl_lb = AD5933_CTRL_EXT_SYSCLK;
} else {
st->mclk_hz = AD5933_INT_OSC_FREQ_Hz;
@@ -744,7 +742,7 @@ static int ad5933_probe(struct i2c_client *client,

ret = ad5933_register_ring_funcs_and_init(indio_dev);
if (ret)
- goto error_disable_reg;
+ goto error_disable_mclk;

ret = ad5933_setup(st);
if (ret)
@@ -758,6 +756,8 @@ static int ad5933_probe(struct i2c_client *client,

error_unreg_ring:
iio_kfifo_free(indio_dev->buffer);
+error_disable_mclk:
+ clk_disable_unprepare(st->mclk);
error_disable_reg:
regulator_disable(st->reg);

@@ -772,6 +772,7 @@ static int ad5933_remove(struct i2c_client *client)
iio_device_unregister(indio_dev);
iio_kfifo_free(indio_dev->buffer);
regulator_disable(st->reg);
+ clk_disable_unprepare(st->mclk);

return 0;
}
--
2.17.1


2018-12-08 18:22:51

by Marcelo Schmitt

[permalink] [raw]
Subject: [PATCH 3/3] staging: iio: ad5933: add binding doc for ad5933

Add a devicetree documentation for the ad5933 and ad5934 impedance
converter, network analyzer.

Signed-off-by: Marcelo Schmitt <[email protected]>
Signed-off-by: Gabriel Capella <[email protected]>
Co-Developed-by: Gabriel Capella <[email protected]>
---
.../iio/impedance-analyzer/ad5933.txt | 26 +++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt

diff --git a/Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt b/Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt
new file mode 100644
index 000000000000..5ff38728ff91
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt
@@ -0,0 +1,26 @@
+Analog Devices AD5933/AD5934 Impedance Converter, Network Analyzer
+
+https://www.analog.com/media/en/technical-documentation/data-sheets/AD5933.pdf
+https://www.analog.com/media/en/technical-documentation/data-sheets/AD5934.pdf
+
+Required properties:
+ - compatible : should be one of
+ "adi,ad5933"
+ "adi,ad5934"
+ - reg : the I2C address.
+ - vdd-supply : The regulator supply for DVDD, AVDD1 and AVDD2 when they
+ are connected together.
+
+Optional properties:
+- clocks : external clock reference.
+- clock-names : must be "mclk" if clocks is set.
+
+Example for a I2C device node:
+
+ impedance-analyzer@0d {
+ compatible = "adi,adxl345";
+ reg = <0x0d>;
+ vdd-supply = <&vdd_supply>;
+ clocks = <&ref_clk>;
+ clock-names = "mclk";
+ };
--
2.17.1


2018-12-08 18:57:53

by Marcelo Schmitt

[permalink] [raw]
Subject: Re: [PATCH 0/3] Add devicetree support for ad5933

Parts of this work came from contributions of Alexandru Ardelean and
Dragos Bogdan, I and Gabriel would like to thank for the insights
provided by their previous patches. Maybe it would be the case to add
them as co-authors of this patch set.
We also wanted to thank Jhonatan Cameron for giving us the pieces of
advice needed for this work.

Thanks,
Marcelo

Em sáb, 8 de dez de 2018 às 16:18, Marcelo Schmitt
<[email protected]> escreveu:
>
> This series of patches change voltage regulator error handling for the
> ad5933.
> It also add an option to specify external clock reference using a clock
> framework and remove the old platform data structure.
> Finally it adds binding documentation for devicetree.
>
> Marcelo Schmitt (3):
> staging: iio: ad5933: change regulator binging for vref
> staging: iio: ad5933: use clock framework for clock reference
> staging: iio: ad5933: add binding doc for ad5933
>
> .../iio/impedance-analyzer/ad5933.txt | 26 +++++++++
> .../staging/iio/impedance-analyzer/ad5933.c | 57 +++++++++----------
> 2 files changed, 54 insertions(+), 29 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt
>
> --
> 2.17.1
>

2018-12-08 21:13:49

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 0/3] Add devicetree support for ad5933

On Sat, Dec 08, 2018 at 04:56:45PM -0200, Marcelo Schmitt wrote:
> Parts of this work came from contributions of Alexandru Ardelean and
> Dragos Bogdan, I and Gabriel would like to thank for the insights
> provided by their previous patches. Maybe it would be the case to add
> them as co-authors of this patch set.

That's what the Co-developed-by: tag is for, please use it :)


2018-12-10 22:03:24

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 0/3] Add devicetree support for ad5933

On Sat, 8 Dec 2018 22:10:43 +0100
Greg KH <[email protected]> wrote:

> On Sat, Dec 08, 2018 at 04:56:45PM -0200, Marcelo Schmitt wrote:
> > Parts of this work came from contributions of Alexandru Ardelean and
> > Dragos Bogdan, I and Gabriel would like to thank for the insights
> > provided by their previous patches. Maybe it would be the case to add
> > them as co-authors of this patch set.
>
> That's what the Co-developed-by: tag is for, please use it :)
>
Alexandru, Dragos. No idea how involved you were in the actual
patch...

Work amongst amongst the 4 of you what you would like to do and
let us know!

Patches look fine, though we need to let the DT maintainers have a few
days at least to get around to looking if they want to (they don't always
on simple bindings like these).

Jonathan


2018-12-11 00:05:28

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 3/3] staging: iio: ad5933: add binding doc for ad5933

On Sat, 8 Dec 2018 16:19:59 -0200
Marcelo Schmitt <[email protected]> wrote:

> Add a devicetree documentation for the ad5933 and ad5934 impedance
> converter, network analyzer.
>
> Signed-off-by: Marcelo Schmitt <[email protected]>
> Signed-off-by: Gabriel Capella <[email protected]>
> Co-Developed-by: Gabriel Capella <[email protected]>
Device tree binding patches need to also go to the DT maintainers and list
for review.

This looks fine to me but they are the specialists in these!

+cc Rob, Mark and DT list.

Jonathan
> ---
> .../iio/impedance-analyzer/ad5933.txt | 26 +++++++++++++++++++
> 1 file changed, 26 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt
>
> diff --git a/Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt b/Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt
> new file mode 100644
> index 000000000000..5ff38728ff91
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt
> @@ -0,0 +1,26 @@
> +Analog Devices AD5933/AD5934 Impedance Converter, Network Analyzer
> +
> +https://www.analog.com/media/en/technical-documentation/data-sheets/AD5933.pdf
> +https://www.analog.com/media/en/technical-documentation/data-sheets/AD5934.pdf
> +
> +Required properties:
> + - compatible : should be one of
> + "adi,ad5933"
> + "adi,ad5934"
> + - reg : the I2C address.
> + - vdd-supply : The regulator supply for DVDD, AVDD1 and AVDD2 when they
> + are connected together.
> +
> +Optional properties:
> +- clocks : external clock reference.
> +- clock-names : must be "mclk" if clocks is set.
> +
> +Example for a I2C device node:
> +
> + impedance-analyzer@0d {
> + compatible = "adi,adxl345";
> + reg = <0x0d>;
> + vdd-supply = <&vdd_supply>;
> + clocks = <&ref_clk>;
> + clock-names = "mclk";
> + };


2018-12-11 11:02:44

by Alexandru Ardelean

[permalink] [raw]
Subject: Re: [PATCH 0/3] Add devicetree support for ad5933

On Mon, 2018-12-10 at 21:27 +0000, Jonathan Cameron wrote:
> On Sat, 8 Dec 2018 22:10:43 +0100
> Greg KH <[email protected]> wrote:
>
> > On Sat, Dec 08, 2018 at 04:56:45PM -0200, Marcelo Schmitt wrote:
> > > Parts of this work came from contributions of Alexandru Ardelean and
> > > Dragos Bogdan, I and Gabriel would like to thank for the insights
> > > provided by their previous patches. Maybe it would be the case to add
> > > them as co-authors of this patch set.
> >
> > That's what the Co-developed-by: tag is for, please use it :)
> >
>
> Alexandru, Dragos. No idea how involved you were in the actual
> patch...
>
> Work amongst amongst the 4 of you what you would like to do and
> let us know!
>

Hey,

To give a bit of context, I sent some patches some time ago that deal with
this, but haven't had time to re-spin them [based on Jonathan's comments].

I've discussed with Dragos.
From our side, any version that is decided with respect to the `Co-
developed-by:` tag is fine. i.e. we don't need to be mentioned in the
commits.

I hope this is a sufficiently good answer [for the whole legal stuff].

> Patches look fine, though we need to let the DT maintainers have a few
> days at least to get around to looking if they want to (they don't always
> on simple bindings like these).
>

Thanks
Alex

> Jonathan
>

2018-12-16 12:18:12

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 2/3] staging: iio: ad5933: use clock framework for clock reference

On Sat, 8 Dec 2018 16:19:38 -0200
Marcelo Schmitt <[email protected]> wrote:

> Add the option to specify the external clock (MCLK) using the clock
> framework.
> Also remove the old platform data structure.
>
> Signed-off-by: Marcelo Schmitt <[email protected]>
> Signed-off-by: Gabriel Capella <[email protected]>
> Co-Developed-by: Gabriel Capella <[email protected]>
Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.

Thanks,

Jonathan

> ---
> .../staging/iio/impedance-analyzer/ad5933.c | 43 ++++++++++---------
> 1 file changed, 22 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c
> index 730bc397a26b..3134295f014f 100644
> --- a/drivers/staging/iio/impedance-analyzer/ad5933.c
> +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
> @@ -16,6 +16,7 @@
> #include <linux/err.h>
> #include <linux/delay.h>
> #include <linux/module.h>
> +#include <linux/clk.h>
>
> #include <linux/iio/iio.h>
> #include <linux/iio/sysfs.h>
> @@ -82,20 +83,10 @@
> #define AD5933_POLL_TIME_ms 10
> #define AD5933_INIT_EXCITATION_TIME_ms 100
>
> -/**
> - * struct ad5933_platform_data - platform specific data
> - * @ext_clk_hz: the external clock frequency in Hz, if not set
> - * the driver uses the internal clock (16.776 MHz)
> - * @vref_mv: the external reference voltage in millivolt
> - */
> -
> -struct ad5933_platform_data {
> - unsigned long ext_clk_hz;
> -};
> -
> struct ad5933_state {
> struct i2c_client *client;
> struct regulator *reg;
> + struct clk *mclk;
> struct delayed_work work;
> struct mutex lock; /* Protect sensor state */
> unsigned long mclk_hz;
> @@ -111,9 +102,6 @@ struct ad5933_state {
> unsigned int poll_time_jiffies;
> };
>
> -static struct ad5933_platform_data ad5933_default_pdata = {
> -};
> -
> #define AD5933_CHANNEL(_type, _extend_name, _info_mask_separate, _address, \
> _scan_index, _realbits) { \
> .type = (_type), \
> @@ -690,9 +678,9 @@ static int ad5933_probe(struct i2c_client *client,
> const struct i2c_device_id *id)
> {
> int ret;
> - struct ad5933_platform_data *pdata = dev_get_platdata(&client->dev);
> struct ad5933_state *st;
> struct iio_dev *indio_dev;
> + unsigned long ext_clk_hz = 0;
>
> indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*st));
> if (!indio_dev)
> @@ -704,9 +692,6 @@ static int ad5933_probe(struct i2c_client *client,
>
> mutex_init(&st->lock);
>
> - if (!pdata)
> - pdata = &ad5933_default_pdata;
> -
> st->reg = devm_regulator_get(&client->dev, "vdd");
> if (IS_ERR(st->reg))
> return PTR_ERR(st->reg);
> @@ -723,8 +708,21 @@ static int ad5933_probe(struct i2c_client *client,
>
> st->vref_mv = ret / 1000;
>
> - if (pdata->ext_clk_hz) {
> - st->mclk_hz = pdata->ext_clk_hz;
> + st->mclk = devm_clk_get(&client->dev, "mclk");
> + if (IS_ERR(st->mclk) && PTR_ERR(st->mclk) != -ENOENT) {
> + ret = PTR_ERR(st->mclk);
> + goto error_disable_reg;
> + }
> +
> + if (!IS_ERR(st->mclk)) {
> + ret = clk_prepare_enable(st->mclk);
> + if (ret < 0)
> + goto error_disable_reg;
> + ext_clk_hz = clk_get_rate(st->mclk);
> + }
> +
> + if (ext_clk_hz) {
> + st->mclk_hz = ext_clk_hz;
> st->ctrl_lb = AD5933_CTRL_EXT_SYSCLK;
> } else {
> st->mclk_hz = AD5933_INT_OSC_FREQ_Hz;
> @@ -744,7 +742,7 @@ static int ad5933_probe(struct i2c_client *client,
>
> ret = ad5933_register_ring_funcs_and_init(indio_dev);
> if (ret)
> - goto error_disable_reg;
> + goto error_disable_mclk;
>
> ret = ad5933_setup(st);
> if (ret)
> @@ -758,6 +756,8 @@ static int ad5933_probe(struct i2c_client *client,
>
> error_unreg_ring:
> iio_kfifo_free(indio_dev->buffer);
> +error_disable_mclk:
> + clk_disable_unprepare(st->mclk);
> error_disable_reg:
> regulator_disable(st->reg);
>
> @@ -772,6 +772,7 @@ static int ad5933_remove(struct i2c_client *client)
> iio_device_unregister(indio_dev);
> iio_kfifo_free(indio_dev->buffer);
> regulator_disable(st->reg);
> + clk_disable_unprepare(st->mclk);
>
> return 0;
> }


2018-12-16 12:27:00

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 1/3] staging: iio: ad5933: change regulator binging for vref

On Sat, 8 Dec 2018 16:19:08 -0200
Marcelo Schmitt <[email protected]> wrote:

> Set a single voltage regulator for all voltage references.
> Remove voltage reference value from default platafrom data struct.
>
> Signed-off-by: Marcelo Schmitt <[email protected]>
> Signed-off-by: Gabriel Capella <[email protected]>
> Co-Developed-by: Gabriel Capella <[email protected]>
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.

Thanks,

Jonathan

> ---
> drivers/staging/iio/impedance-analyzer/ad5933.c | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c
> index 9e52384f5370..730bc397a26b 100644
> --- a/drivers/staging/iio/impedance-analyzer/ad5933.c
> +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
> @@ -91,7 +91,6 @@
>
> struct ad5933_platform_data {
> unsigned long ext_clk_hz;
> - unsigned short vref_mv;
> };
>
> struct ad5933_state {
> @@ -113,7 +112,6 @@ struct ad5933_state {
> };
>
> static struct ad5933_platform_data ad5933_default_pdata = {
> - .vref_mv = 3300,
> };
>
> #define AD5933_CHANNEL(_type, _extend_name, _info_mask_separate, _address, \
> @@ -691,7 +689,7 @@ static void ad5933_work(struct work_struct *work)
> static int ad5933_probe(struct i2c_client *client,
> const struct i2c_device_id *id)
> {
> - int ret, voltage_uv = 0;
> + int ret;
> struct ad5933_platform_data *pdata = dev_get_platdata(&client->dev);
> struct ad5933_state *st;
> struct iio_dev *indio_dev;
> @@ -718,12 +716,12 @@ static int ad5933_probe(struct i2c_client *client,
> dev_err(&client->dev, "Failed to enable specified VDD supply\n");
> return ret;
> }
> - voltage_uv = regulator_get_voltage(st->reg);
> + ret = regulator_get_voltage(st->reg);
> +
> + if (ret < 0)
> + goto error_disable_reg;
>
> - if (voltage_uv)
> - st->vref_mv = voltage_uv / 1000;
> - else
> - st->vref_mv = pdata->vref_mv;
> + st->vref_mv = ret / 1000;
>
> if (pdata->ext_clk_hz) {
> st->mclk_hz = pdata->ext_clk_hz;


2018-12-16 13:02:30

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 3/3] staging: iio: ad5933: add binding doc for ad5933

On Mon, 10 Dec 2018 21:27:02 +0000
Jonathan Cameron <[email protected]> wrote:

> On Sat, 8 Dec 2018 16:19:59 -0200
> Marcelo Schmitt <[email protected]> wrote:
>
> > Add a devicetree documentation for the ad5933 and ad5934 impedance
> > converter, network analyzer.
> >
> > Signed-off-by: Marcelo Schmitt <[email protected]>
> > Signed-off-by: Gabriel Capella <[email protected]>
> > Co-Developed-by: Gabriel Capella <[email protected]>
> Device tree binding patches need to also go to the DT maintainers and list
> for review.
>
> This looks fine to me but they are the specialists in these!
>
> +cc Rob, Mark and DT list.

Long enough I think. This will be in my tree in a fashion I can rebase for
a week or so anyway so please still feel free to comment.

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

Thanks,

Jonathan
>
> Jonathan
> > ---
> > .../iio/impedance-analyzer/ad5933.txt | 26 +++++++++++++++++++
> > 1 file changed, 26 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt
> >
> > diff --git a/Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt b/Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt
> > new file mode 100644
> > index 000000000000..5ff38728ff91
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt
> > @@ -0,0 +1,26 @@
> > +Analog Devices AD5933/AD5934 Impedance Converter, Network Analyzer
> > +
> > +https://www.analog.com/media/en/technical-documentation/data-sheets/AD5933.pdf
> > +https://www.analog.com/media/en/technical-documentation/data-sheets/AD5934.pdf
> > +
> > +Required properties:
> > + - compatible : should be one of
> > + "adi,ad5933"
> > + "adi,ad5934"
> > + - reg : the I2C address.
> > + - vdd-supply : The regulator supply for DVDD, AVDD1 and AVDD2 when they
> > + are connected together.
> > +
> > +Optional properties:
> > +- clocks : external clock reference.
> > +- clock-names : must be "mclk" if clocks is set.
> > +
> > +Example for a I2C device node:
> > +
> > + impedance-analyzer@0d {
> > + compatible = "adi,adxl345";
> > + reg = <0x0d>;
> > + vdd-supply = <&vdd_supply>;
> > + clocks = <&ref_clk>;
> > + clock-names = "mclk";
> > + };
>