linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: iio: ad7746: add device tree support
@ 2019-05-18 22:27 João Seckler
  2019-05-19 11:02 ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: João Seckler @ 2019-05-18 22:27 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

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

Signed-off-by: João Seckler <joaoseckler@gmail.com>
Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
Co-developed-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
---
 drivers/staging/iio/cdc/ad7746.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/staging/iio/cdc/ad7746.c b/drivers/staging/iio/cdc/ad7746.c
index 47610d863908..21527d84f940 100644
--- a/drivers/staging/iio/cdc/ad7746.c
+++ b/drivers/staging/iio/cdc/ad7746.c
@@ -748,9 +748,19 @@ static const struct i2c_device_id ad7746_id[] = {
 
 MODULE_DEVICE_TABLE(i2c, ad7746_id);
 
+static const struct of_device_id ad7746_of_match[] = {
+	{ .compatible = "adi,ad7745" },
+	{ .compatible = "adi,ad7746" },
+	{ .compatible = "adi,ad7747" },
+	{ },
+};
+
+MODULE_DEVICE_TABLE(of, ad7746_of_match);
+
 static struct i2c_driver ad7746_driver = {
 	.driver = {
 		.name = KBUILD_MODNAME,
+		.of_match_table = ad7746_of_match,
 	},
 	.probe = ad7746_probe,
 	.id_table = ad7746_id,
-- 
2.11.0


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

end of thread, other threads:[~2019-05-19 17:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-18 22:27 [PATCH] staging: iio: ad7746: add device tree support João Seckler
2019-05-19 11:02 ` Jonathan Cameron
2019-05-19 11:09   ` Jonathan Cameron

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).