2018-11-14 17:45:13

by Nishad Kamdar

[permalink] [raw]
Subject: [PATCH v4 0/4] staging: iio: ad7816: Switch to the gpio descriptor interface

Changes in v4:
- Add all parts to the dt bindings as they
are functionally different.
Changes in v3:
- Drop busy pin in case of AD7818.
- Set RD/WR pin and CONVST pin as outputs.
- Add device tree table.

Nishad Kamdar (4):
staging: iio: ad7816: Switch to the gpio descriptor interface
staging: iio: ad7816: Do not use busy_pin in case of AD7818
staging: iio: ad7816: Set RD/WR pin and CONVST pin as outputs.
staging: iio: ad7816: Add device tree table.

drivers/staging/iio/adc/ad7816.c | 113 +++++++++++++++++--------------
1 file changed, 62 insertions(+), 51 deletions(-)

--
2.17.1



2018-11-14 17:47:33

by Nishad Kamdar

[permalink] [raw]
Subject: [PATCH v4 4/4] staging: iio: ad7816: Add device tree table.

Add device tree table for matching vendor ID.

Signed-off-by: Nishad Kamdar <[email protected]>
---
drivers/staging/iio/adc/ad7816.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
index a2fead85cd46..925f7086bc07 100644
--- a/drivers/staging/iio/adc/ad7816.c
+++ b/drivers/staging/iio/adc/ad7816.c
@@ -422,6 +422,14 @@ static int ad7816_probe(struct spi_device *spi_dev)
return 0;
}

+static const struct of_device_id ad7816_of_match[] = {
+ { .compatible = "adi,ad7816", },
+ { .compatible = "adi,ad7817", },
+ { .compatible = "adi,ad7818", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, ad7816_of_match);
+
static const struct spi_device_id ad7816_id[] = {
{ "ad7816", ID_AD7816 },
{ "ad7817", ID_AD7817 },
@@ -434,6 +442,7 @@ MODULE_DEVICE_TABLE(spi, ad7816_id);
static struct spi_driver ad7816_driver = {
.driver = {
.name = "ad7816",
+ .of_match_table = of_match_ptr(ad7816_of_match),
},
.probe = ad7816_probe,
.id_table = ad7816_id,
--
2.17.1


2018-11-15 08:18:26

by Alexandru Ardelean

[permalink] [raw]
Subject: Re: [PATCH v4 4/4] staging: iio: ad7816: Add device tree table.

On Wed, 2018-11-14 at 23:16 +0530, Nishad Kamdar wrote:
> Add device tree table for matching vendor ID.
>

This could have been just one patch.
Something like
[PATCH v4] staging: iio: ad7816: Add device tree table.

It's no longer a series, because the other patches were applied already.

I don't think you need to re-spin this [it's up to Jonathan though].

It's just something to keep in mind for later when re-spinning patches or
series of patches.

Alex

> Signed-off-by: Nishad Kamdar <[email protected]>
> ---
> drivers/staging/iio/adc/ad7816.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/staging/iio/adc/ad7816.c
> b/drivers/staging/iio/adc/ad7816.c
> index a2fead85cd46..925f7086bc07 100644
> --- a/drivers/staging/iio/adc/ad7816.c
> +++ b/drivers/staging/iio/adc/ad7816.c
> @@ -422,6 +422,14 @@ static int ad7816_probe(struct spi_device *spi_dev)
> return 0;
> }
>
> +static const struct of_device_id ad7816_of_match[] = {
> + { .compatible = "adi,ad7816", },
> + { .compatible = "adi,ad7817", },
> + { .compatible = "adi,ad7818", },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, ad7816_of_match);
> +
> static const struct spi_device_id ad7816_id[] = {
> { "ad7816", ID_AD7816 },
> { "ad7817", ID_AD7817 },
> @@ -434,6 +442,7 @@ MODULE_DEVICE_TABLE(spi, ad7816_id);
> static struct spi_driver ad7816_driver = {
> .driver = {
> .name = "ad7816",
> + .of_match_table = of_match_ptr(ad7816_of_match),
> },
> .probe = ad7816_probe,
> .id_table = ad7816_id,

2018-11-15 14:26:13

by Nishad Kamdar

[permalink] [raw]
Subject: Re: [PATCH v4 4/4] staging: iio: ad7816: Add device tree table.

On Thu, Nov 15, 2018 at 08:16:03AM +0000, Ardelean, Alexandru wrote:
> On Wed, 2018-11-14 at 23:16 +0530, Nishad Kamdar wrote:
> > Add device tree table for matching vendor ID.
> >
>
> This could have been just one patch.
> Something like
> [PATCH v4] staging: iio: ad7816: Add device tree table.
>
> It's no longer a series, because the other patches were applied already.
>
> I don't think you need to re-spin this [it's up to Jonathan though].
>
> It's just something to keep in mind for later when re-spinning patches or
> series of patches.
>
> Alex
>

Ok. I'll keep that in mind.

Thanks for the review.

Regards,
Nishad

> > Signed-off-by: Nishad Kamdar <[email protected]>
> > ---
> > drivers/staging/iio/adc/ad7816.c | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/drivers/staging/iio/adc/ad7816.c
> > b/drivers/staging/iio/adc/ad7816.c
> > index a2fead85cd46..925f7086bc07 100644
> > --- a/drivers/staging/iio/adc/ad7816.c
> > +++ b/drivers/staging/iio/adc/ad7816.c
> > @@ -422,6 +422,14 @@ static int ad7816_probe(struct spi_device *spi_dev)
> > return 0;
> > }
> >
> > +static const struct of_device_id ad7816_of_match[] = {
> > + { .compatible = "adi,ad7816", },
> > + { .compatible = "adi,ad7817", },
> > + { .compatible = "adi,ad7818", },
> > + { }
> > +};
> > +MODULE_DEVICE_TABLE(of, ad7816_of_match);
> > +
> > static const struct spi_device_id ad7816_id[] = {
> > { "ad7816", ID_AD7816 },
> > { "ad7817", ID_AD7817 },
> > @@ -434,6 +442,7 @@ MODULE_DEVICE_TABLE(spi, ad7816_id);
> > static struct spi_driver ad7816_driver = {
> > .driver = {
> > .name = "ad7816",
> > + .of_match_table = of_match_ptr(ad7816_of_match),
> > },
> > .probe = ad7816_probe,
> > .id_table = ad7816_id,

2018-11-16 17:07:00

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH v4 4/4] staging: iio: ad7816: Add device tree table.

On Thu, 15 Nov 2018 19:55:06 +0530
Nishad Kamdar <[email protected]> wrote:

> On Thu, Nov 15, 2018 at 08:16:03AM +0000, Ardelean, Alexandru wrote:
> > On Wed, 2018-11-14 at 23:16 +0530, Nishad Kamdar wrote:
> > > Add device tree table for matching vendor ID.
> > >
> >
> > This could have been just one patch.
> > Something like
> > [PATCH v4] staging: iio: ad7816: Add device tree table.
> >
> > It's no longer a series, because the other patches were applied already.
> >
> > I don't think you need to re-spin this [it's up to Jonathan though].
> >
> > It's just something to keep in mind for later when re-spinning patches or
> > series of patches.
> >
> > Alex
> >
>
> Ok. I'll keep that in mind.
>
> Thanks for the review.
>
> Regards,
> Nishad
>
> > > Signed-off-by: Nishad Kamdar <[email protected]>
> > > ---
> > > drivers/staging/iio/adc/ad7816.c | 9 +++++++++
> > > 1 file changed, 9 insertions(+)
> > >
> > > diff --git a/drivers/staging/iio/adc/ad7816.c
> > > b/drivers/staging/iio/adc/ad7816.c
> > > index a2fead85cd46..925f7086bc07 100644
> > > --- a/drivers/staging/iio/adc/ad7816.c
> > > +++ b/drivers/staging/iio/adc/ad7816.c
> > > @@ -422,6 +422,14 @@ static int ad7816_probe(struct spi_device *spi_dev)
> > > return 0;
> > > }
> > >
> > > +static const struct of_device_id ad7816_of_match[] = {
> > > + { .compatible = "adi,ad7816", },
> > > + { .compatible = "adi,ad7817", },
> > > + { .compatible = "adi,ad7818", },
> > > + { }
> > > +};
> > > +MODULE_DEVICE_TABLE(of, ad7816_of_match);
> > > +
> > > static const struct spi_device_id ad7816_id[] = {
> > > { "ad7816", ID_AD7816 },
> > > { "ad7817", ID_AD7817 },
> > > @@ -434,6 +442,7 @@ MODULE_DEVICE_TABLE(spi, ad7816_id);
> > > static struct spi_driver ad7816_driver = {
> > > .driver = {
> > > .name = "ad7816",
> > > + .of_match_table = of_match_ptr(ad7816_of_match),
Also, don't use of_match_ptr, it defines the table to NULL if
CONFIG_OF is not set, which breaks the ACPI based probing using
the magic number to tell it to use the DT bindings (weird
corner case). One of those really obscure corners cases
(and one that hasn't existed for that long!)

I'll fix up.

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

Thanks,

Jonathan
> > > },
> > > .probe = ad7816_probe,
> > > .id_table = ad7816_id,