diff mbox series

[08/11] staging: iio: adc: ad7606: Add OF device ID table

Message ID 1544705183-13288-9-git-send-email-stefan.popa@analog.com (mailing list archive)
State New, archived
Headers show
Series staging: iio: ad7606: Move out of staging | expand

Commit Message

Stefan Popa Dec. 13, 2018, 12:46 p.m. UTC
The driver does not have a struct of_device_id table, but supported
devices are registered via Device Trees. This patch adds and OF device
ID table.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
---
 drivers/staging/iio/adc/ad7606_par.c | 10 ++++++++++
 drivers/staging/iio/adc/ad7606_spi.c | 10 ++++++++++
 2 files changed, 20 insertions(+)

Comments

Jonathan Cameron Dec. 16, 2018, 1:54 p.m. UTC | #1
On Thu, 13 Dec 2018 14:46:20 +0200
Stefan Popa <stefan.popa@analog.com> wrote:

> The driver does not have a struct of_device_id table, but supported
> devices are registered via Device Trees. This patch adds and OF device
> ID table.
> 
> Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Applied.

Thanks,

Jonathan

> ---
>  drivers/staging/iio/adc/ad7606_par.c | 10 ++++++++++
>  drivers/staging/iio/adc/ad7606_spi.c | 10 ++++++++++
>  2 files changed, 20 insertions(+)
> 
> diff --git a/drivers/staging/iio/adc/ad7606_par.c b/drivers/staging/iio/adc/ad7606_par.c
> index 6269ee7..ac0c7b0 100644
> --- a/drivers/staging/iio/adc/ad7606_par.c
> +++ b/drivers/staging/iio/adc/ad7606_par.c
> @@ -90,12 +90,22 @@ static const struct platform_device_id ad7606_driver_ids[] = {
>  
>  MODULE_DEVICE_TABLE(platform, ad7606_driver_ids);
>  
> +static const struct of_device_id ad7606_of_match[] = {
> +	{ .compatible = "adi,ad7605-4" },
> +	{ .compatible = "adi,ad7606-4" },
> +	{ .compatible = "adi,ad7606-6" },
> +	{ .compatible = "adi,ad7606-8" },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, ad7606_of_match);
> +
>  static struct platform_driver ad7606_driver = {
>  	.probe = ad7606_par_probe,
>  	.id_table = ad7606_driver_ids,
>  	.driver = {
>  		.name	 = "ad7606",
>  		.pm	 = AD7606_PM_OPS,
> +		.of_match_table = ad7606_of_match,
>  	},
>  };
>  
> diff --git a/drivers/staging/iio/adc/ad7606_spi.c b/drivers/staging/iio/adc/ad7606_spi.c
> index 9291598..2608d34 100644
> --- a/drivers/staging/iio/adc/ad7606_spi.c
> +++ b/drivers/staging/iio/adc/ad7606_spi.c
> @@ -57,9 +57,19 @@ static const struct spi_device_id ad7606_id[] = {
>  };
>  MODULE_DEVICE_TABLE(spi, ad7606_id);
>  
> +static const struct of_device_id ad7606_of_match[] = {
> +	{ .compatible = "adi,ad7605-4" },
> +	{ .compatible = "adi,ad7606-4" },
> +	{ .compatible = "adi,ad7606-6" },
> +	{ .compatible = "adi,ad7606-8" },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, ad7606_of_match);
> +
>  static struct spi_driver ad7606_driver = {
>  	.driver = {
>  		.name = "ad7606",
> +		.of_match_table = ad7606_of_match,
>  		.pm = AD7606_PM_OPS,
>  	},
>  	.probe = ad7606_spi_probe,
diff mbox series

Patch

diff --git a/drivers/staging/iio/adc/ad7606_par.c b/drivers/staging/iio/adc/ad7606_par.c
index 6269ee7..ac0c7b0 100644
--- a/drivers/staging/iio/adc/ad7606_par.c
+++ b/drivers/staging/iio/adc/ad7606_par.c
@@ -90,12 +90,22 @@  static const struct platform_device_id ad7606_driver_ids[] = {
 
 MODULE_DEVICE_TABLE(platform, ad7606_driver_ids);
 
+static const struct of_device_id ad7606_of_match[] = {
+	{ .compatible = "adi,ad7605-4" },
+	{ .compatible = "adi,ad7606-4" },
+	{ .compatible = "adi,ad7606-6" },
+	{ .compatible = "adi,ad7606-8" },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, ad7606_of_match);
+
 static struct platform_driver ad7606_driver = {
 	.probe = ad7606_par_probe,
 	.id_table = ad7606_driver_ids,
 	.driver = {
 		.name	 = "ad7606",
 		.pm	 = AD7606_PM_OPS,
+		.of_match_table = ad7606_of_match,
 	},
 };
 
diff --git a/drivers/staging/iio/adc/ad7606_spi.c b/drivers/staging/iio/adc/ad7606_spi.c
index 9291598..2608d34 100644
--- a/drivers/staging/iio/adc/ad7606_spi.c
+++ b/drivers/staging/iio/adc/ad7606_spi.c
@@ -57,9 +57,19 @@  static const struct spi_device_id ad7606_id[] = {
 };
 MODULE_DEVICE_TABLE(spi, ad7606_id);
 
+static const struct of_device_id ad7606_of_match[] = {
+	{ .compatible = "adi,ad7605-4" },
+	{ .compatible = "adi,ad7606-4" },
+	{ .compatible = "adi,ad7606-6" },
+	{ .compatible = "adi,ad7606-8" },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, ad7606_of_match);
+
 static struct spi_driver ad7606_driver = {
 	.driver = {
 		.name = "ad7606",
+		.of_match_table = ad7606_of_match,
 		.pm = AD7606_PM_OPS,
 	},
 	.probe = ad7606_spi_probe,