Linux-IIO Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] staging: iio: ad9834: add of_device_id table
@ 2019-05-18 22:47 João Victor Marques de Oliveira
  2019-05-19 10:39 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: João Victor Marques de Oliveira @ 2019-05-18 22:47 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Stefan Popa,
	Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler,
	Greg Kroah-Hartman
  Cc: linux-iio, devel, linux-kernel, kernel-usp,
	Thiago L . A . Miller, Osvaldo M . Yasuda

Add a of_device_id struct array of_match_table variable and subsequent
call to MODULE_DEVICE_TABLE macro to device tree support.

Co-developed-by: Thiago L. A. Miller <tmiller@mochsl.org.br>
Signed-off-by: Thiago L. A. Miller <tmiller@mochsl.org.br>
Co-developed-by: Osvaldo M. Yasuda <omyasuda@yahoo.com.br>
Signed-off-by: Osvaldo M. Yasuda <omyasuda@yahoo.com.br>
Signed-off-by: João Victor Marques de Oliveira <joao.marques.oliveira@usp.br>
---
 drivers/staging/iio/frequency/ad9834.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/staging/iio/frequency/ad9834.c b/drivers/staging/iio/frequency/ad9834.c
index 6de3cd7363d7..038d6732c3fd 100644
--- a/drivers/staging/iio/frequency/ad9834.c
+++ b/drivers/staging/iio/frequency/ad9834.c
@@ -521,9 +521,20 @@ static const struct spi_device_id ad9834_id[] = {
 };
 MODULE_DEVICE_TABLE(spi, ad9834_id);
 
+static const struct of_device_id ad9834_of_match[] = {
+	{.compatible = "adi,ad9833"},
+	{.compatible = "adi,ad9834"},
+	{.compatible = "adi,ad9837"},
+	{.compatible = "adi,ad9838"},
+	{}
+};
+
+MODULE_DEVICE_TABLE(of, ad9834_of_match);
+
 static struct spi_driver ad9834_driver = {
 	.driver = {
 		.name	= "ad9834",
+		.of_match_table = ad9834_of_match
 	},
 	.probe		= ad9834_probe,
 	.remove		= ad9834_remove,
-- 
2.21.0


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

* Re: [PATCH] staging: iio: ad9834: add of_device_id table
  2019-05-18 22:47 [PATCH] staging: iio: ad9834: add of_device_id table João Victor Marques de Oliveira
@ 2019-05-19 10:39 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2019-05-19 10:39 UTC (permalink / raw)
  To: João Victor Marques de Oliveira
  Cc: Lars-Peter Clausen, Michael Hennerich, Stefan Popa,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel, kernel-usp,
	Thiago L . A . Miller, Osvaldo M . Yasuda

On Sat, 18 May 2019 19:47:20 -0300
João Victor Marques de Oliveira         <joao.marques.oliveira@usp.br> wrote:

> Add a of_device_id struct array of_match_table variable and subsequent
> call to MODULE_DEVICE_TABLE macro to device tree support.
> 
> Co-developed-by: Thiago L. A. Miller <tmiller@mochsl.org.br>
> Signed-off-by: Thiago L. A. Miller <tmiller@mochsl.org.br>
> Co-developed-by: Osvaldo M. Yasuda <omyasuda@yahoo.com.br>
> Signed-off-by: Osvaldo M. Yasuda <omyasuda@yahoo.com.br>
> Signed-off-by: João Victor Marques de Oliveira <joao.marques.oliveira@usp.br>
Nice patch.

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

Thanks,

j
> ---
>  drivers/staging/iio/frequency/ad9834.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/staging/iio/frequency/ad9834.c b/drivers/staging/iio/frequency/ad9834.c
> index 6de3cd7363d7..038d6732c3fd 100644
> --- a/drivers/staging/iio/frequency/ad9834.c
> +++ b/drivers/staging/iio/frequency/ad9834.c
> @@ -521,9 +521,20 @@ static const struct spi_device_id ad9834_id[] = {
>  };
>  MODULE_DEVICE_TABLE(spi, ad9834_id);
>  
> +static const struct of_device_id ad9834_of_match[] = {
> +	{.compatible = "adi,ad9833"},
> +	{.compatible = "adi,ad9834"},
> +	{.compatible = "adi,ad9837"},
> +	{.compatible = "adi,ad9838"},
> +	{}
> +};
> +
> +MODULE_DEVICE_TABLE(of, ad9834_of_match);
> +
>  static struct spi_driver ad9834_driver = {
>  	.driver = {
>  		.name	= "ad9834",
> +		.of_match_table = ad9834_of_match
>  	},
>  	.probe		= ad9834_probe,
>  	.remove		= ad9834_remove,


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-18 22:47 [PATCH] staging: iio: ad9834: add of_device_id table João Victor Marques de Oliveira
2019-05-19 10:39 ` Jonathan Cameron

Linux-IIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-iio/0 linux-iio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iio linux-iio/ https://lore.kernel.org/linux-iio \
		linux-iio@vger.kernel.org linux-iio@archiver.kernel.org
	public-inbox-index linux-iio


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-iio


AGPL code for this site: git clone https://public-inbox.org/ public-inbox