diff options
Diffstat (limited to 'drivers/input/touchscreen/st1232.c')
-rw-r--r-- | drivers/input/touchscreen/st1232.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c index 4ab371358b33..cbbf71b22696 100644 --- a/drivers/input/touchscreen/st1232.c +++ b/drivers/input/touchscreen/st1232.c @@ -23,6 +23,7 @@ #include <linux/input.h> #include <linux/interrupt.h> #include <linux/module.h> +#include <linux/pm_qos.h> #include <linux/slab.h> #include <linux/types.h> @@ -46,6 +47,7 @@ struct st1232_ts_data { struct i2c_client *client; struct input_dev *input_dev; struct st1232_ts_finger finger[MAX_FINGERS]; + struct dev_pm_qos_request low_latency_req; }; static int st1232_ts_read_data(struct st1232_ts_data *ts) @@ -118,8 +120,17 @@ static irqreturn_t st1232_ts_irq_handler(int irq, void *dev_id) } /* SYN_MT_REPORT only if no contact */ - if (!count) + if (!count) { input_mt_sync(input_dev); + if (ts->low_latency_req.dev) { + dev_pm_qos_remove_request(&ts->low_latency_req); + ts->low_latency_req.dev = NULL; + } + } else if (!ts->low_latency_req.dev) { + /* First contact, request 100 us latency. */ + dev_pm_qos_add_ancestor_request(&ts->client->dev, + &ts->low_latency_req, 100); + } /* SYN_REPORT */ input_sync(input_dev); @@ -257,17 +268,7 @@ static struct i2c_driver st1232_ts_driver = { }, }; -static int __init st1232_ts_init(void) -{ - return i2c_add_driver(&st1232_ts_driver); -} -module_init(st1232_ts_init); - -static void __exit st1232_ts_exit(void) -{ - i2c_del_driver(&st1232_ts_driver); -} -module_exit(st1232_ts_exit); +module_i2c_driver(st1232_ts_driver); MODULE_AUTHOR("Tony SIM <chinyeow.sim.xt@renesas.com>"); MODULE_DESCRIPTION("SITRONIX ST1232 Touchscreen Controller Driver"); |