diff options
author | Stefan Agner <stefan@agner.ch> | 2016-03-08 10:35:24 -0800 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2016-03-08 10:51:18 -0800 |
commit | fa6e3ca274429b66e12d06abc5a6c013cef66471 (patch) | |
tree | afdbbbab460653884caceea5088638571daa5c41 /drivers/input/touchscreen/ad7879-i2c.c | |
parent | 5f2940c4a544ae9040d0feff6da06a994cc201ff (diff) | |
download | op-kernel-dev-fa6e3ca274429b66e12d06abc5a6c013cef66471.zip op-kernel-dev-fa6e3ca274429b66e12d06abc5a6c013cef66471.tar.gz |
Input: ad7879 - add device tree support
Add device tree support for the I2C and SPI variant of AD7879(-1).
This allows to specify the touchscreen controller as a I2C client
node or SPI slave device. Most of the options available in platform
data are also available as device tree properties, the only exception
being GPIO capabilities, which can not be activated through device
tree currently.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/touchscreen/ad7879-i2c.c')
-rw-r--r-- | drivers/input/touchscreen/ad7879-i2c.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/ad7879-i2c.c b/drivers/input/touchscreen/ad7879-i2c.c index d66962c..58f72e0 100644 --- a/drivers/input/touchscreen/ad7879-i2c.c +++ b/drivers/input/touchscreen/ad7879-i2c.c @@ -10,6 +10,7 @@ #include <linux/i2c.h> #include <linux/module.h> #include <linux/types.h> +#include <linux/of.h> #include <linux/pm.h> #include "ad7879.h" @@ -91,10 +92,19 @@ static const struct i2c_device_id ad7879_id[] = { }; MODULE_DEVICE_TABLE(i2c, ad7879_id); +#ifdef CONFIG_OF +static const struct of_device_id ad7879_i2c_dt_ids[] = { + { .compatible = "adi,ad7879-1", }, + { } +}; +MODULE_DEVICE_TABLE(of, ad7879_i2c_dt_ids); +#endif + static struct i2c_driver ad7879_i2c_driver = { .driver = { .name = "ad7879", .pm = &ad7879_pm_ops, + .of_match_table = of_match_ptr(ad7879_i2c_dt_ids), }, .probe = ad7879_i2c_probe, .remove = ad7879_i2c_remove, |