summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-12-23 01:24:25 +0100
committerRafael J. Wysocki <rjw@sisk.pl>2011-12-25 23:39:50 +0100
commit9ee27ffbe303ce18e7336115f1d443e9911eba53 (patch)
tree9ec445eecfeece0ab1ec2e6b6f2ac7478c917373 /drivers/input
parent40a5f8be2f482783de0f1f0fe856660e489734a8 (diff)
PM / input / touchscreen: Make st1232 use device PM QoS constraints
Make the st1232 driver use dev_pm_qos_add_ancestor_request() to add a device PM QoS latency constraint for the controller it depends on, so that the controller won't go into an overly deep low-power state when the touchscreen has to be particularly responsive (e.g. when the user moves his or her finger on it). This change is based on a prototype patch from Guennadi Liakhovetski. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/st1232.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c
index 4ab371358b33..8825fe37d433 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);