aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/st1232.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen/st1232.c')
-rw-r--r--drivers/input/touchscreen/st1232.c25
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 @@
23#include <linux/input.h> 23#include <linux/input.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/pm_qos.h>
26#include <linux/slab.h> 27#include <linux/slab.h>
27#include <linux/types.h> 28#include <linux/types.h>
28 29
@@ -46,6 +47,7 @@ struct st1232_ts_data {
46 struct i2c_client *client; 47 struct i2c_client *client;
47 struct input_dev *input_dev; 48 struct input_dev *input_dev;
48 struct st1232_ts_finger finger[MAX_FINGERS]; 49 struct st1232_ts_finger finger[MAX_FINGERS];
50 struct dev_pm_qos_request low_latency_req;
49}; 51};
50 52
51static int st1232_ts_read_data(struct st1232_ts_data *ts) 53static 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)
118 } 120 }
119 121
120 /* SYN_MT_REPORT only if no contact */ 122 /* SYN_MT_REPORT only if no contact */
121 if (!count) 123 if (!count) {
122 input_mt_sync(input_dev); 124 input_mt_sync(input_dev);
125 if (ts->low_latency_req.dev) {
126 dev_pm_qos_remove_request(&ts->low_latency_req);
127 ts->low_latency_req.dev = NULL;
128 }
129 } else if (!ts->low_latency_req.dev) {
130 /* First contact, request 100 us latency. */
131 dev_pm_qos_add_ancestor_request(&ts->client->dev,
132 &ts->low_latency_req, 100);
133 }
123 134
124 /* SYN_REPORT */ 135 /* SYN_REPORT */
125 input_sync(input_dev); 136 input_sync(input_dev);
@@ -257,17 +268,7 @@ static struct i2c_driver st1232_ts_driver = {
257 }, 268 },
258}; 269};
259 270
260static int __init st1232_ts_init(void) 271module_i2c_driver(st1232_ts_driver);
261{
262 return i2c_add_driver(&st1232_ts_driver);
263}
264module_init(st1232_ts_init);
265
266static void __exit st1232_ts_exit(void)
267{
268 i2c_del_driver(&st1232_ts_driver);
269}
270module_exit(st1232_ts_exit);
271 272
272MODULE_AUTHOR("Tony SIM <chinyeow.sim.xt@renesas.com>"); 273MODULE_AUTHOR("Tony SIM <chinyeow.sim.xt@renesas.com>");
273MODULE_DESCRIPTION("SITRONIX ST1232 Touchscreen Controller Driver"); 274MODULE_DESCRIPTION("SITRONIX ST1232 Touchscreen Controller Driver");