linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] iio: frequency: ad9832: devicetree probing support
@ 2025-03-22 16:28 Siddharth Menon
  2025-03-23 12:02 ` Jonathan Cameron
  2025-04-16 18:58 ` Rob Herring
  0 siblings, 2 replies; 7+ messages in thread
From: Siddharth Menon @ 2025-03-22 16:28 UTC (permalink / raw)
  To: linux-iio, lars, Michael.Hennerich, jic23, gregkh
  Cc: linux-kernel, linux-staging, marcelo.schmitt1, Siddharth Menon

Introduce struct for device match of_device_id to avoid relying on fallback
mechanisms, which could lead to false matches against other AD9832 variants
in the future.

Suggested-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Siddharth Menon <simeddon@gmail.com>
---
 v1->v2:
 - updated commit message to be more informative
 - minor changes to code formatting
 drivers/staging/iio/frequency/ad9832.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c
index 140ee4f9c137..7d4f655f6df1 100644
--- a/drivers/staging/iio/frequency/ad9832.c
+++ b/drivers/staging/iio/frequency/ad9832.c
@@ -431,6 +431,13 @@ static int ad9832_probe(struct spi_device *spi)
 	return devm_iio_device_register(&spi->dev, indio_dev);
 }
 
+static const struct of_device_id ad9832_of_match[] = {
+	{ .compatible = "adi,ad9832" },
+	{ .compatible = "adi,ad9835" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, ad9832_of_match);
+
 static const struct spi_device_id ad9832_id[] = {
 	{"ad9832", 0},
 	{"ad9835", 0},
@@ -441,6 +448,7 @@ MODULE_DEVICE_TABLE(spi, ad9832_id);
 static struct spi_driver ad9832_driver = {
 	.driver = {
 		.name	= "ad9832",
+		.of_match_table = ad9832_of_match,
 	},
 	.probe		= ad9832_probe,
 	.id_table	= ad9832_id,
-- 
2.48.1


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

* Re: [PATCH v2] iio: frequency: ad9832: devicetree probing support
  2025-03-22 16:28 [PATCH v2] iio: frequency: ad9832: devicetree probing support Siddharth Menon
@ 2025-03-23 12:02 ` Jonathan Cameron
  2025-03-23 21:49   ` Siddharth Menon
  2025-04-16 18:58 ` Rob Herring
  1 sibling, 1 reply; 7+ messages in thread
From: Jonathan Cameron @ 2025-03-23 12:02 UTC (permalink / raw)
  To: Siddharth Menon
  Cc: linux-iio, lars, Michael.Hennerich, gregkh, linux-kernel,
	linux-staging, marcelo.schmitt1

On Sat, 22 Mar 2025 21:58:11 +0530
Siddharth Menon <simeddon@gmail.com> wrote:

> Introduce struct for device match of_device_id to avoid relying on fallback
> mechanisms, which could lead to false matches against other AD9832 variants
> in the future.
> 
> Suggested-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
> Signed-off-by: Siddharth Menon <simeddon@gmail.com>
> ---
Marcelo gave a Reviewed-by tag.  This time I've picked it up
manually but in general it is the responsibility of the submitter
to include those on new versions. Obviously sometimes things race though so
maybe that is what happened here!

Applied

Thanks,

Jonathan


>  v1->v2:
>  - updated commit message to be more informative
>  - minor changes to code formatting
>  drivers/staging/iio/frequency/ad9832.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c
> index 140ee4f9c137..7d4f655f6df1 100644
> --- a/drivers/staging/iio/frequency/ad9832.c
> +++ b/drivers/staging/iio/frequency/ad9832.c
> @@ -431,6 +431,13 @@ static int ad9832_probe(struct spi_device *spi)
>  	return devm_iio_device_register(&spi->dev, indio_dev);
>  }
>  
> +static const struct of_device_id ad9832_of_match[] = {
> +	{ .compatible = "adi,ad9832" },
> +	{ .compatible = "adi,ad9835" },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(of, ad9832_of_match);
> +
>  static const struct spi_device_id ad9832_id[] = {
>  	{"ad9832", 0},
>  	{"ad9835", 0},
> @@ -441,6 +448,7 @@ MODULE_DEVICE_TABLE(spi, ad9832_id);
>  static struct spi_driver ad9832_driver = {
>  	.driver = {
>  		.name	= "ad9832",
> +		.of_match_table = ad9832_of_match,
>  	},
>  	.probe		= ad9832_probe,
>  	.id_table	= ad9832_id,


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

* Re: [PATCH v2] iio: frequency: ad9832: devicetree probing support
  2025-03-23 12:02 ` Jonathan Cameron
@ 2025-03-23 21:49   ` Siddharth Menon
  2025-03-30 16:40     ` Jonathan Cameron
  0 siblings, 1 reply; 7+ messages in thread
From: Siddharth Menon @ 2025-03-23 21:49 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, lars, Michael.Hennerich, gregkh, linux-kernel,
	linux-staging, marcelo.schmitt1

On Sun, 23 Mar 2025 at 17:32, Jonathan Cameron <jic23@kernel.org> wrote:
> Marcelo gave a Reviewed-by tag.  This time I've picked it up
> manually but in general it is the responsibility of the submitter
> to include those on new versions. Obviously sometimes things race though so
> maybe that is what happened here!

Sorry, I was unsure whether the tag still applied after modifying a patch or
if it needed to be reviewed again.

Thanks,
Siddharth Menon

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

* Re: [PATCH v2] iio: frequency: ad9832: devicetree probing support
  2025-03-23 21:49   ` Siddharth Menon
@ 2025-03-30 16:40     ` Jonathan Cameron
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2025-03-30 16:40 UTC (permalink / raw)
  To: Siddharth Menon
  Cc: linux-iio, lars, Michael.Hennerich, gregkh, linux-kernel,
	linux-staging, marcelo.schmitt1

On Mon, 24 Mar 2025 03:19:31 +0530
Siddharth Menon <simeddon@gmail.com> wrote:

> On Sun, 23 Mar 2025 at 17:32, Jonathan Cameron <jic23@kernel.org> wrote:
> > Marcelo gave a Reviewed-by tag.  This time I've picked it up
> > manually but in general it is the responsibility of the submitter
> > to include those on new versions. Obviously sometimes things race though so
> > maybe that is what happened here!  
> 
> Sorry, I was unsure whether the tag still applied after modifying a patch or
> if it needed to be reviewed again.

It is up to you as the submitter to make that decision, but if you
do drop a tag due to changes, I'd expect to see a comment under the ---
(alongside the change log) saying why.

Jonathan

> 
> Thanks,
> Siddharth Menon


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

* Re: [PATCH v2] iio: frequency: ad9832: devicetree probing support
  2025-03-22 16:28 [PATCH v2] iio: frequency: ad9832: devicetree probing support Siddharth Menon
  2025-03-23 12:02 ` Jonathan Cameron
@ 2025-04-16 18:58 ` Rob Herring
  2025-04-18 14:26   ` Jonathan Cameron
  1 sibling, 1 reply; 7+ messages in thread
From: Rob Herring @ 2025-04-16 18:58 UTC (permalink / raw)
  To: Siddharth Menon
  Cc: linux-iio, lars, Michael.Hennerich, jic23, gregkh, linux-kernel,
	linux-staging, marcelo.schmitt1

On Sat, Mar 22, 2025 at 09:58:11PM +0530, Siddharth Menon wrote:
> Introduce struct for device match of_device_id to avoid relying on fallback
> mechanisms, which could lead to false matches against other AD9832 variants
> in the future.
> 
> Suggested-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
> Signed-off-by: Siddharth Menon <simeddon@gmail.com>
> ---
>  v1->v2:
>  - updated commit message to be more informative
>  - minor changes to code formatting
>  drivers/staging/iio/frequency/ad9832.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c
> index 140ee4f9c137..7d4f655f6df1 100644
> --- a/drivers/staging/iio/frequency/ad9832.c
> +++ b/drivers/staging/iio/frequency/ad9832.c
> @@ -431,6 +431,13 @@ static int ad9832_probe(struct spi_device *spi)
>  	return devm_iio_device_register(&spi->dev, indio_dev);
>  }
>  
> +static const struct of_device_id ad9832_of_match[] = {
> +	{ .compatible = "adi,ad9832" },
> +	{ .compatible = "adi,ad9835" },

Is there some reason we can't add a binding for this?

Rob


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

* Re: [PATCH v2] iio: frequency: ad9832: devicetree probing support
  2025-04-16 18:58 ` Rob Herring
@ 2025-04-18 14:26   ` Jonathan Cameron
  2025-04-28 16:06     ` Rob Herring
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Cameron @ 2025-04-18 14:26 UTC (permalink / raw)
  To: Rob Herring
  Cc: Siddharth Menon, linux-iio, lars, Michael.Hennerich, gregkh,
	linux-kernel, linux-staging, marcelo.schmitt1

On Wed, 16 Apr 2025 13:58:46 -0500
Rob Herring <robh@kernel.org> wrote:

> On Sat, Mar 22, 2025 at 09:58:11PM +0530, Siddharth Menon wrote:
> > Introduce struct for device match of_device_id to avoid relying on fallback
> > mechanisms, which could lead to false matches against other AD9832 variants
> > in the future.
> > 
> > Suggested-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
> > Signed-off-by: Siddharth Menon <simeddon@gmail.com>
> > ---
> >  v1->v2:
> >  - updated commit message to be more informative
> >  - minor changes to code formatting
> >  drivers/staging/iio/frequency/ad9832.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c
> > index 140ee4f9c137..7d4f655f6df1 100644
> > --- a/drivers/staging/iio/frequency/ad9832.c
> > +++ b/drivers/staging/iio/frequency/ad9832.c
> > @@ -431,6 +431,13 @@ static int ad9832_probe(struct spi_device *spi)
> >  	return devm_iio_device_register(&spi->dev, indio_dev);
> >  }
> >  
> > +static const struct of_device_id ad9832_of_match[] = {
> > +	{ .compatible = "adi,ad9832" },
> > +	{ .compatible = "adi,ad9835" },  
> 
> Is there some reason we can't add a binding for this?
> 
It might take some thought on how to actually describe some aspects
of this device that aren't yet supported by the driver,
but in principle we certainly should.  For drivers that have been
in staging a long time I'm a little reluctant to do merge a binding
until we are fairly sure the driver is going to move out of staging though.

> 


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

* Re: [PATCH v2] iio: frequency: ad9832: devicetree probing support
  2025-04-18 14:26   ` Jonathan Cameron
@ 2025-04-28 16:06     ` Rob Herring
  0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2025-04-28 16:06 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Siddharth Menon, linux-iio, lars, Michael.Hennerich, gregkh,
	linux-kernel, linux-staging, marcelo.schmitt1

On Fri, Apr 18, 2025 at 03:26:21PM +0100, Jonathan Cameron wrote:
> On Wed, 16 Apr 2025 13:58:46 -0500
> Rob Herring <robh@kernel.org> wrote:
> 
> > On Sat, Mar 22, 2025 at 09:58:11PM +0530, Siddharth Menon wrote:
> > > Introduce struct for device match of_device_id to avoid relying on fallback
> > > mechanisms, which could lead to false matches against other AD9832 variants
> > > in the future.
> > > 
> > > Suggested-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
> > > Signed-off-by: Siddharth Menon <simeddon@gmail.com>
> > > ---
> > >  v1->v2:
> > >  - updated commit message to be more informative
> > >  - minor changes to code formatting
> > >  drivers/staging/iio/frequency/ad9832.c | 8 ++++++++
> > >  1 file changed, 8 insertions(+)
> > > 
> > > diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c
> > > index 140ee4f9c137..7d4f655f6df1 100644
> > > --- a/drivers/staging/iio/frequency/ad9832.c
> > > +++ b/drivers/staging/iio/frequency/ad9832.c
> > > @@ -431,6 +431,13 @@ static int ad9832_probe(struct spi_device *spi)
> > >  	return devm_iio_device_register(&spi->dev, indio_dev);
> > >  }
> > >  
> > > +static const struct of_device_id ad9832_of_match[] = {
> > > +	{ .compatible = "adi,ad9832" },
> > > +	{ .compatible = "adi,ad9835" },  
> > 
> > Is there some reason we can't add a binding for this?
> > 
> It might take some thought on how to actually describe some aspects
> of this device that aren't yet supported by the driver,
> but in principle we certainly should.  For drivers that have been
> in staging a long time I'm a little reluctant to do merge a binding
> until we are fairly sure the driver is going to move out of staging though.

Okay, I suppose I could exclude staging from looking for compatible 
strings.

Rob

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

end of thread, other threads:[~2025-04-28 16:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-22 16:28 [PATCH v2] iio: frequency: ad9832: devicetree probing support Siddharth Menon
2025-03-23 12:02 ` Jonathan Cameron
2025-03-23 21:49   ` Siddharth Menon
2025-03-30 16:40     ` Jonathan Cameron
2025-04-16 18:58 ` Rob Herring
2025-04-18 14:26   ` Jonathan Cameron
2025-04-28 16:06     ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).