Input: tsc2005 - add OF device table
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 10 Feb 2017 23:12:20 +0000 (15:12 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sun, 12 Feb 2017 22:55:08 +0000 (14:55 -0800)
To be prepared for SPI module loading using full compatible strings from
device tree, let's add OF module device table data.

Reviewed-By: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/tsc2005.c

index f2c5f0e47f77dd6ab177adec2bb102ed0da5dd08..e02b69f40ad8ab103024071623d1165629b9b8b9 100644 (file)
@@ -18,8 +18,9 @@
  * GNU General Public License for more details.
  */
 
-#include <linux/module.h>
 #include <linux/input.h>
+#include <linux/module.h>
+#include <linux/of.h>
 #include <linux/spi/spi.h>
 #include <linux/regmap.h>
 #include "tsc200x-core.h"
@@ -77,9 +78,18 @@ static int tsc2005_remove(struct spi_device *spi)
        return tsc200x_remove(&spi->dev);
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id tsc2005_of_match[] = {
+       { .compatible = "ti,tsc2005" },
+       { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, tsc2005_of_match);
+#endif
+
 static struct spi_driver tsc2005_driver = {
        .driver = {
                .name   = "tsc2005",
+               .of_match_table = of_match_ptr(tsc2005_of_match),
                .pm     = &tsc200x_pm_ops,
        },
        .probe  = tsc2005_probe,