iio: dac: ad5686: add of_match_table
authorMichael Auchter <michael.auchter@ni.com>
Thu, 24 Sep 2020 19:52:13 +0000 (14:52 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 10 Oct 2020 15:41:33 +0000 (16:41 +0100)
Add of_match_table to this driver, so devices can be probed based on
device tree contents.

Signed-off-by: Michael Auchter <michael.auchter@ni.com>
Link: https://lore.kernel.org/r/20200924195215.49443-2-michael.auchter@ni.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dac/ad5696-i2c.c

index 89e7b063b7bbab992c3eee9fa87c390240b41237..a39eda7c02d23d509ab2aec0552310de602d1642 100644 (file)
@@ -88,9 +88,28 @@ static const struct i2c_device_id ad5686_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, ad5686_i2c_id);
 
+static const struct of_device_id ad5686_of_match[] = {
+       { .compatible = "adi,ad5311r" },
+       { .compatible = "adi,ad5338r" },
+       { .compatible = "adi,ad5671r" },
+       { .compatible = "adi,ad5675r" },
+       { .compatible = "adi,ad5691r" },
+       { .compatible = "adi,ad5692r" },
+       { .compatible = "adi,ad5693" },
+       { .compatible = "adi,ad5693r" },
+       { .compatible = "adi,ad5694" },
+       { .compatible = "adi,ad5694r" },
+       { .compatible = "adi,ad5695r" },
+       { .compatible = "adi,ad5696" },
+       { .compatible = "adi,ad5696r" },
+       {}
+};
+MODULE_DEVICE_TABLE(of, ad5686_of_match);
+
 static struct i2c_driver ad5686_i2c_driver = {
        .driver = {
                .name = "ad5696",
+               .of_match_table = ad5686_of_match,
        },
        .probe = ad5686_i2c_probe,
        .remove = ad5686_i2c_remove,