input: touch: synaptic: report MSC_ACTIVITY event in IRQ
Vikas Jain [Fri, 15 Mar 2013 06:08:23 +0000 (02:08 -0400)]
Report MSC_ACTIVITY event while entering IRQ handler so that
CPU frequency governor can act.
This improves direct touch processing latencies.

Bug 1254080

Change-Id: Ic8c622045185977d88423d94b2604ec6648798ba
Signed-off-by: Vikas Jain <vjain@nvidia.com>
Reviewed-on: http://git-master/r/209873
Reviewed-by: Xiaohui Tao <xtao@nvidia.com>
Reviewed-by: Robert Collins <rcollins@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

drivers/input/touchscreen/synaptics_i2c_rmi.c

index 005df54..02f7677 100644 (file)
@@ -1,6 +1,7 @@
 /* drivers/input/keyboard/synaptics_i2c_rmi.c
  *
  * Copyright (C) 2007 Google, Inc.
+ * Copyright (C) 2013, NVIDIA Corporation.  All Rights Reserved.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and
@@ -26,6 +27,9 @@
 
 #define ABS_DIFF(a, b)   (((a) > (b)) ? ((a) - (b)) : ((b) - (a)))
 
+/* Enable CPU boost when entering IRQ handler */
+#define ENABLE_CPU_BOOST
+
 static struct workqueue_struct *synaptics_wq;
 
 struct synaptics_ts_data {
@@ -295,6 +299,11 @@ static irqreturn_t synaptics_ts_irq_handler(int irq, void *dev_id)
        struct synaptics_ts_data *ts = dev_id;
 
        /* printk("synaptics_ts_irq_handler\n"); */
+
+#ifdef ENABLE_CPU_BOOST
+       input_event(ts->input_dev, EV_MSC, MSC_ACTIVITY, 1);
+#endif
+
        disable_irq_nosync(ts->client->irq);
        queue_work(synaptics_wq, &ts->work);
        return IRQ_HANDLED;
@@ -559,6 +568,9 @@ static int synaptics_ts_probe(
                printk(KERN_ERR "synaptics_ts_probe: Unable to register %s input device\n", ts->input_dev->name);
                goto err_input_register_device_failed;
        }
+#ifdef ENABLE_CPU_BOOST
+       input_set_capability(ts->input_dev, EV_MSC, MSC_ACTIVITY);
+#endif
        if (client->irq) {
                ret = request_irq(client->irq, synaptics_ts_irq_handler, irqflags, client->name, ts);
                if (ret == 0) {