All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/4] staging: iio: ad7816: Switch to the gpio descriptor interface
@ 2018-11-14 17:44 Nishad Kamdar
  2018-11-14 17:46 ` [PATCH v4 4/4] staging: iio: ad7816: Add device tree table Nishad Kamdar
  0 siblings, 1 reply; 6+ messages in thread
From: Nishad Kamdar @ 2018-11-14 17:44 UTC (permalink / raw)
  To: Jonathan Cameron, Ardelean, Alexandru
  Cc: Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
	Peter Meerwald-Stadler, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v4 4/4] staging: iio: ad7816: Add device tree table.
  2018-11-14 17:44 [PATCH v4 0/4] staging: iio: ad7816: Switch to the gpio descriptor interface Nishad Kamdar
@ 2018-11-14 17:46 ` Nishad Kamdar
  2018-11-15  8:16     ` Ardelean, Alexandru
  0 siblings, 1 reply; 6+ messages in thread
From: Nishad Kamdar @ 2018-11-14 17:46 UTC (permalink / raw)
  To: Jonathan Cameron, Ardelean, Alexandru
  Cc: Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
	Peter Meerwald-Stadler, Greg Kroah-Hartman, linux-iio, devel,
	linux-kernel

Add device tree table for matching vendor ID.

Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v4 4/4] staging: iio: ad7816: Add device tree table.
  2018-11-14 17:46 ` [PATCH v4 4/4] staging: iio: ad7816: Add device tree table Nishad Kamdar
@ 2018-11-15  8:16     ` Ardelean, Alexandru
  0 siblings, 0 replies; 6+ messages in thread
From: Ardelean, Alexandru @ 2018-11-15  8:16 UTC (permalink / raw)
  To: nishadkamdar, jic23
  Cc: linux-kernel, lars, knaack.h, Hennerich, Michael, linux-iio,
	devel, pmeerw, gregkh

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 <nishadkamdar@gmail.com>
> ---
>  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,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v4 4/4] staging: iio: ad7816: Add device tree table.
@ 2018-11-15  8:16     ` Ardelean, Alexandru
  0 siblings, 0 replies; 6+ messages in thread
From: Ardelean, Alexandru @ 2018-11-15  8:16 UTC (permalink / raw)
  To: nishadkamdar, jic23
  Cc: linux-kernel, lars, knaack.h, Hennerich, Michael, linux-iio,
	devel, pmeerw, gregkh

T24gV2VkLCAyMDE4LTExLTE0IGF0IDIzOjE2ICswNTMwLCBOaXNoYWQgS2FtZGFyIHdyb3RlOg0K
PiBBZGQgZGV2aWNlIHRyZWUgdGFibGUgZm9yIG1hdGNoaW5nIHZlbmRvciBJRC4NCj4gDQoNClRo
aXMgY291bGQgaGF2ZSBiZWVuIGp1c3Qgb25lIHBhdGNoLg0KU29tZXRoaW5nIGxpa2UgDQogICBb
UEFUQ0ggdjRdIHN0YWdpbm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dGF0aWMgY29uc3Qg
c3RydWN0IG9mX2RldmljZV9pZCBhZDc4MTZfb2ZfbWF0Y2hbXSA9IHsNCj4gKwl7IC5jb21wYXRp
YmxlID0gImFkaSxhZDc4MTYiLCB9LA0KPiArCXsgLmNvbXBhdGlibGUgPSAiYWRpLGFkNzgxNyIs
IH0sDQo+ICsJeyAuY29tcGF0aWJsZSA9ICJhZGksYWQ3ODE4IiwgfSwNCj4gKwl7IH0NCj4gK307
DQo+ICtNT0RVTEVfREVWSUNFX1RBQkxFKG9mLCBhZDc4MTZfb2ZfbWF0Y2gpOw0KPiArDQo+ICBz
dGF0aWMgY29uc3Qgc3RydWN0IHNwaV9kZXZpY2VfaWQgYWQ3ODE2X2lkW10gPSB7DQo+ICAJeyAi
YWQ3ODE2IiwgSURfQUQ3ODE2IH0sDQo+ICAJeyAiYWQ3ODE3IiwgSURfQUQ3ODE3IH0sDQo+IEBA
IC00MzQsNiArNDQyLDcgQEAgTU9EVUxFX0RFVklDRV9UQUJMRShzcGksIGFkNzgxNl9pZCk7DQo+
ICBzdGF0aWMgc3RydWN0IHNwaV9kcml2ZXIgYWQ3ODE2X2RyaXZlciA9IHsNCj4gIAkuZHJpdmVy
ID0gew0KPiAgCQkubmFtZSA9ICJhZDc4MTYiLA0KPiArCQkub2ZfbWF0Y2hfdGFibGUgPSBvZl9t
YXRjaF9wdHIoYWQ3ODE2X29mX21hdGNoKSwNCj4gIAl9LA0KPiAgCS5wcm9iZSA9IGFkNzgxNl9w
cm9iZSwNCj4gIAkuaWRfdGFibGUgPSBhZDc4MTZfaWQsDQo=

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v4 4/4] staging: iio: ad7816: Add device tree table.
  2018-11-15  8:16     ` Ardelean, Alexandru
  (?)
@ 2018-11-15 14:25     ` Nishad Kamdar
  2018-11-16 17:05       ` Jonathan Cameron
  -1 siblings, 1 reply; 6+ messages in thread
From: Nishad Kamdar @ 2018-11-15 14:25 UTC (permalink / raw)
  To: Ardelean, Alexandru
  Cc: jic23, linux-kernel, lars, knaack.h, Hennerich, Michael,
	linux-iio, devel, pmeerw, gregkh

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 <nishadkamdar@gmail.com>
> > ---
> >  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,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v4 4/4] staging: iio: ad7816: Add device tree table.
  2018-11-15 14:25     ` Nishad Kamdar
@ 2018-11-16 17:05       ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2018-11-16 17:05 UTC (permalink / raw)
  To: Nishad Kamdar
  Cc: Ardelean, Alexandru, linux-kernel, lars, knaack.h, Hennerich,
	Michael, linux-iio, devel, pmeerw, gregkh

On Thu, 15 Nov 2018 19:55:06 +0530
Nishad Kamdar <nishadkamdar@gmail.com> 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 <nishadkamdar@gmail.com>
> > > ---
> > >  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,  


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-11-16 17:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-14 17:44 [PATCH v4 0/4] staging: iio: ad7816: Switch to the gpio descriptor interface Nishad Kamdar
2018-11-14 17:46 ` [PATCH v4 4/4] staging: iio: ad7816: Add device tree table Nishad Kamdar
2018-11-15  8:16   ` Ardelean, Alexandru
2018-11-15  8:16     ` Ardelean, Alexandru
2018-11-15 14:25     ` Nishad Kamdar
2018-11-16 17:05       ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.