Skip to contentSkip to conversation

staging: iio: ad5933: add device tree support

PATCH In review Marcelo Schmitt 2 participants 2 messages Nov 24, 2018 – Nov 25, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: iio: ad5933: add device tree support

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

---
 drivers/staging/iio/impedance-analyzer/ad5933.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/staging/iio/impedance-analyzer/ad5933.c +9 -0
index edb8b540bbf1..6faa2700dc8d 100644
@@ -771,9 +771,18 @@ static const struct i2c_device_id ad5933_id[] = {
 
 MODULE_DEVICE_TABLE(i2c, ad5933_id);
 
+static const struct of_device_id ad5933_of_match[] = {
+	{ .compatible = "adi,ad5933" },
+	{ .compatible = "adi,ad5934" },
+	{ },
+};
+
+MODULE_DEVICE_TABLE(of, ad5933_of_match);
+
 static struct i2c_driver ad5933_driver = {
 	.driver = {
 		.name = "ad5933",
+		.of_match_table = ad5933_of_match,
 	},
 	.probe = ad5933_probe,
 	.remove = ad5933_remove,
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 4 lines · On Sat, 24 Nov 2018 11:18:57 -0200 Marcelo Schmitt…

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

Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Note we'll need a binding doc for this before it can leave staging.

Thanks,

Jonathan

Quoted 27 lines
---
 drivers/staging/iio/impedance-analyzer/ad5933.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/staging/iio/impedance-analyzer/ad5933.c +9 -0
index edb8b540bbf1..6faa2700dc8d 100644
@@ -771,9 +771,18 @@ static const struct i2c_device_id ad5933_id[] = {
 
 MODULE_DEVICE_TABLE(i2c, ad5933_id);
 
+static const struct of_device_id ad5933_of_match[] = {
+	{ .compatible = "adi,ad5933" },
+	{ .compatible = "adi,ad5934" },
+	{ },
+};
+
+MODULE_DEVICE_TABLE(of, ad5933_of_match);
+
 static struct i2c_driver ad5933_driver = {
 	.driver = {
 		.name = "ad5933",
+		.of_match_table = ad5933_of_match,
 	},
 	.probe = ad5933_probe,
 	.remove = ad5933_remove,