]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
staging: iio: ad7816: Add device tree table.
authorNishad Kamdar <nishadkamdar@gmail.com>
Wed, 14 Nov 2018 17:46:14 +0000 (23:16 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Fri, 16 Nov 2018 18:32:36 +0000 (18:32 +0000)
Add device tree table for matching vendor ID.

Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/staging/iio/adc/ad7816.c

index a2fead85cd4662647774885a8b94ec63d9816424..5209651a1b25aba4f291b3f0f8713cc1d9ca3004 100644 (file)
@@ -422,6 +422,14 @@ static int ad7816_probe(struct spi_device *spi_dev)
        return 0;
 }
 
+static const struct of_device_id ad7816_of_match[] = {
+       { .compatible = "adi,ad7816", },
+       { .compatible = "adi,ad7817", },
+       { .compatible = "adi,ad7818", },
+       { }
+};
+MODULE_DEVICE_TABLE(of, ad7816_of_match);
+
 static const struct spi_device_id ad7816_id[] = {
        { "ad7816", ID_AD7816 },
        { "ad7817", ID_AD7817 },
@@ -434,6 +442,7 @@ MODULE_DEVICE_TABLE(spi, ad7816_id);
 static struct spi_driver ad7816_driver = {
        .driver = {
                .name = "ad7816",
+               .of_match_table = ad7816_of_match,
        },
        .probe = ad7816_probe,
        .id_table = ad7816_id,