summaryrefslogtreecommitdiff
path: root/drivers/input/input-cfboost.c
diff options
context:
space:
mode:
authorBrian Harris <brianh@nvidia.com>2014-05-01 12:37:51 -0500
committerRiham Haidar <rhaidar@nvidia.com>2014-05-15 12:57:56 -0700
commit9ef6bf0194e6fcd6887cfafa5e7501b3d6757991 (patch)
tree8015dfaa8a67535ee7de247a302b5be61fb97089 /drivers/input/input-cfboost.c
parentc436d07ff6b15f6540e7468c7c793ef15e55a921 (diff)
cfboost: Boost on MSC_ACTIVITY and any ABS
Modifies cfboost to trigger on EV_MSC=MSC_ACTIVITY and any EV_ABS. Also added a timeout between boosts equal to half the boost duration since it will be getting a lot more events now. This makes cfboost more resilient to touch driver changes. Bug 1509022 Change-Id: I734cdce22b6a1f65466924a92768c2afd4992960 Reviewed-on: http://git-master/r/404285 Reviewed-on: http://git-master/r/404023 Signed-off-by: Donghan Ryu <dryu@nvidia.com> Reviewed-on: http://git-master/r/406498 Reviewed-by: Riham Haidar <rhaidar@nvidia.com> Tested-by: Riham Haidar <rhaidar@nvidia.com>
Diffstat (limited to 'drivers/input/input-cfboost.c')
-rw-r--r--drivers/input/input-cfboost.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/input/input-cfboost.c b/drivers/input/input-cfboost.c
index c5596193a001..d38bb956f073 100644
--- a/drivers/input/input-cfboost.c
+++ b/drivers/input/input-cfboost.c
@@ -74,6 +74,8 @@ module_param(gpu_wakeup, bool, 0644);
static struct device *gpu_device;
static DEFINE_MUTEX(gpu_device_lock);
+static unsigned long last_boost_jiffies;
+
int cfb_add_device(struct device *dev)
{
mutex_lock(&gpu_device_lock);
@@ -128,7 +130,11 @@ static void cfb_input_event(struct input_handle *handle, unsigned int type,
unsigned int code, int value)
{
trace_input_cfboost_event("event", type, code, value);
- queue_kthread_work(&boost_worker, &boost_work);
+ if (jiffies < last_boost_jiffies ||
+ jiffies > last_boost_jiffies + msecs_to_jiffies(boost_time/2)) {
+ queue_kthread_work(&boost_worker, &boost_work);
+ last_boost_jiffies = jiffies;
+ }
}
static int cfb_input_connect(struct input_handler *handler,
@@ -171,18 +177,15 @@ static void cfb_input_disconnect(struct input_handle *handle)
/* XXX make configurable */
static const struct input_device_id cfb_ids[] = {
- { /* raydium touch screen */
+ { /* touch screens send this at wakeup */
.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
- INPUT_DEVICE_ID_MATCH_KEYBIT,
- .evbit = { BIT_MASK(EV_ABS) },
- .keybit = {[BIT_WORD(BTN_TOOL_RUBBER)] =
- BIT_MASK(BTN_TOOL_RUBBER) },
+ INPUT_DEVICE_ID_MATCH_MSCIT,
+ .evbit = { BIT_MASK(EV_MSC) },
+ .mscbit = {BIT_MASK(MSC_ACTIVITY)},
},
- { /* other touch screen */
- .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
- INPUT_DEVICE_ID_MATCH_KEYBIT,
+ { /* trigger on any touch screen events */
+ .flags = INPUT_DEVICE_ID_MATCH_EVBIT,
.evbit = { BIT_MASK(EV_ABS) },
- .keybit = {[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH) },
},
{ /* mouse */
.flags = INPUT_DEVICE_ID_MATCH_EVBIT |