aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2012-11-08 11:51:52 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-11-08 11:51:52 -0500
commitfa8e2458ecfc959cd627e25ba86d8eddcb63c887 (patch)
treed8c9dec3dac8e97e8591e6507a619959449d6344 /drivers/input/touchscreen
parentd56a289be2ce01d1aa426a6cf45dede14a8db41e (diff)
parent3d70f8c617a436c7146ecb81df2265b4626dfe89 (diff)
Merge tag 'v3.7-rc4' into next to sync up Wacom bits
Linux 3.7-rc4
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r--drivers/input/touchscreen/Kconfig2
-rw-r--r--drivers/input/touchscreen/egalax_ts.c23
-rw-r--r--drivers/input/touchscreen/tsc40.c1
3 files changed, 22 insertions, 4 deletions
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 1ba232cbc09d..f7668b24c378 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -239,7 +239,7 @@ config TOUCHSCREEN_EETI
239 239
240config TOUCHSCREEN_EGALAX 240config TOUCHSCREEN_EGALAX
241 tristate "EETI eGalax multi-touch panel support" 241 tristate "EETI eGalax multi-touch panel support"
242 depends on I2C 242 depends on I2C && OF
243 help 243 help
244 Say Y here to enable support for I2C connected EETI 244 Say Y here to enable support for I2C connected EETI
245 eGalax multi-touch panels. 245 eGalax multi-touch panels.
diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
index c1e3460f1195..13fa62fdfb0b 100644
--- a/drivers/input/touchscreen/egalax_ts.c
+++ b/drivers/input/touchscreen/egalax_ts.c
@@ -28,6 +28,7 @@
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/bitops.h> 29#include <linux/bitops.h>
30#include <linux/input/mt.h> 30#include <linux/input/mt.h>
31#include <linux/of_gpio.h>
31 32
32/* 33/*
33 * Mouse Mode: some panel may configure the controller to mouse mode, 34 * Mouse Mode: some panel may configure the controller to mouse mode,
@@ -122,9 +123,17 @@ static irqreturn_t egalax_ts_interrupt(int irq, void *dev_id)
122/* wake up controller by an falling edge of interrupt gpio. */ 123/* wake up controller by an falling edge of interrupt gpio. */
123static int egalax_wake_up_device(struct i2c_client *client) 124static int egalax_wake_up_device(struct i2c_client *client)
124{ 125{
125 int gpio = irq_to_gpio(client->irq); 126 struct device_node *np = client->dev.of_node;
127 int gpio;
126 int ret; 128 int ret;
127 129
130 if (!np)
131 return -ENODEV;
132
133 gpio = of_get_named_gpio(np, "wakeup-gpios", 0);
134 if (!gpio_is_valid(gpio))
135 return -ENODEV;
136
128 ret = gpio_request(gpio, "egalax_irq"); 137 ret = gpio_request(gpio, "egalax_irq");
129 if (ret < 0) { 138 if (ret < 0) {
130 dev_err(&client->dev, 139 dev_err(&client->dev,
@@ -181,7 +190,11 @@ static int __devinit egalax_ts_probe(struct i2c_client *client,
181 ts->input_dev = input_dev; 190 ts->input_dev = input_dev;
182 191
183 /* controller may be in sleep, wake it up. */ 192 /* controller may be in sleep, wake it up. */
184 egalax_wake_up_device(client); 193 error = egalax_wake_up_device(client);
194 if (error) {
195 dev_err(&client->dev, "Failed to wake up the controller\n");
196 goto err_free_dev;
197 }
185 198
186 ret = egalax_firmware_version(client); 199 ret = egalax_firmware_version(client);
187 if (ret < 0) { 200 if (ret < 0) {
@@ -274,11 +287,17 @@ static int egalax_ts_resume(struct device *dev)
274 287
275static SIMPLE_DEV_PM_OPS(egalax_ts_pm_ops, egalax_ts_suspend, egalax_ts_resume); 288static SIMPLE_DEV_PM_OPS(egalax_ts_pm_ops, egalax_ts_suspend, egalax_ts_resume);
276 289
290static struct of_device_id egalax_ts_dt_ids[] = {
291 { .compatible = "eeti,egalax_ts" },
292 { /* sentinel */ }
293};
294
277static struct i2c_driver egalax_ts_driver = { 295static struct i2c_driver egalax_ts_driver = {
278 .driver = { 296 .driver = {
279 .name = "egalax_ts", 297 .name = "egalax_ts",
280 .owner = THIS_MODULE, 298 .owner = THIS_MODULE,
281 .pm = &egalax_ts_pm_ops, 299 .pm = &egalax_ts_pm_ops,
300 .of_match_table = of_match_ptr(egalax_ts_dt_ids),
282 }, 301 },
283 .id_table = egalax_ts_id, 302 .id_table = egalax_ts_id,
284 .probe = egalax_ts_probe, 303 .probe = egalax_ts_probe,
diff --git a/drivers/input/touchscreen/tsc40.c b/drivers/input/touchscreen/tsc40.c
index 63209aaa55f0..eb96f168fb9d 100644
--- a/drivers/input/touchscreen/tsc40.c
+++ b/drivers/input/touchscreen/tsc40.c
@@ -107,7 +107,6 @@ static int tsc_connect(struct serio *serio, struct serio_driver *drv)
107 __set_bit(BTN_TOUCH, input_dev->keybit); 107 __set_bit(BTN_TOUCH, input_dev->keybit);
108 input_set_abs_params(ptsc->dev, ABS_X, 0, 0x3ff, 0, 0); 108 input_set_abs_params(ptsc->dev, ABS_X, 0, 0x3ff, 0, 0);
109 input_set_abs_params(ptsc->dev, ABS_Y, 0, 0x3ff, 0, 0); 109 input_set_abs_params(ptsc->dev, ABS_Y, 0, 0x3ff, 0, 0);
110 input_set_abs_params(ptsc->dev, ABS_PRESSURE, 0, 0, 0, 0);
111 110
112 serio_set_drvdata(serio, ptsc); 111 serio_set_drvdata(serio, ptsc);
113 112