summaryrefslogtreecommitdiff
path: root/drivers/misc/m4sensorhub_stillmode.c
diff options
context:
space:
mode:
authorViditha Hanumanthareddy <ngjq36@motorola.com>2014-05-14 07:17:14 -0500
committerViditha H <ngjq36@motorola.com>2014-05-14 16:53:22 +0000
commit281ee14b6350aa2cd341507816a28fc067b3578a (patch)
tree9d9298d0a463c2ca896a71828c7ffb9a06c8bac6 /drivers/misc/m4sensorhub_stillmode.c
parent65fcccea0ee3987f0fef3047adde958e7cd62103 (diff)
downloadolio-linux-3.10-281ee14b6350aa2cd341507816a28fc067b3578a.tar.xz
olio-linux-3.10-281ee14b6350aa2cd341507816a28fc067b3578a.zip
IKXCLOCK-1233: Hold a timed wakelock for m4 events
A few m4 interrupts/events like gesture, rtc alarm that can occur when kernel is suspended need enough time to allow the event to reach the higher layer before kernel suspends again. The absence of this was causing gestures & rtc alarm to get missed by the higher layers. Change-Id: Ibf10a1a031bd279ef2a488214498036c648220dc
Diffstat (limited to 'drivers/misc/m4sensorhub_stillmode.c')
-rw-r--r--drivers/misc/m4sensorhub_stillmode.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/misc/m4sensorhub_stillmode.c b/drivers/misc/m4sensorhub_stillmode.c
index 20ced175c6c..f0f95ae47c4 100644
--- a/drivers/misc/m4sensorhub_stillmode.c
+++ b/drivers/misc/m4sensorhub_stillmode.c
@@ -44,7 +44,6 @@ struct stillmode_client {
struct m4sensorhub_data *m4sensorhub;
struct input_dev *input_dev;
enum m4_stillmode_type state;
- struct wake_lock wakelock;
struct work_struct queued_work;
u16 timeout;
};
@@ -82,9 +81,6 @@ static void stillmode_set_state(struct stillmode_client *stillmode_client_data,
stillmode_client_data->state = state;
mutex_unlock(&state_access);
- /* Hold a 500ms wakelock to let data get to KineticManager */
- wake_lock_timeout(&stillmode_client_data->wakelock, 0.5 * HZ);
-
input_report_switch(stillmode_client_data->input_dev,
SW_STILL_MODE,
(stillmode_client_data->state == STILL));
@@ -231,7 +227,7 @@ static int stillmode_driver_init(struct init_calldata *p_arg)
ret = m4sensorhub_irq_register(m4sensorhub, M4SH_IRQ_STILL_DETECTED,
m4_handle_stillmode_irq,
- g_stillmode_data);
+ g_stillmode_data, 1);
if (ret < 0) {
KDEBUG(M4SH_ERROR, "Error registering still mode IRQ: %d\n",
@@ -248,7 +244,7 @@ static int stillmode_driver_init(struct init_calldata *p_arg)
ret = m4sensorhub_irq_register(m4sensorhub, M4SH_IRQ_MOTION_DETECTED,
m4_handle_stillmode_irq,
- g_stillmode_data);
+ g_stillmode_data, 1);
if (ret < 0) {
KDEBUG(M4SH_ERROR, "Error registering moving mode IRQ: %d\n",
@@ -315,9 +311,6 @@ static int stillmode_client_probe(struct platform_device *pdev)
goto free_memory;
}
- wake_lock_init(&stillmode_client_data->wakelock, WAKE_LOCK_SUSPEND,
- STILLMODE_CLIENT_DRIVER_NAME);
-
INIT_WORK(&stillmode_client_data->queued_work,
m4sensorhub_stillmode_work);
@@ -351,7 +344,6 @@ remove_stillmode_sysfs:
unregister_initcall:
m4sensorhub_unregister_initcall(stillmode_driver_init);
destroy_wakelock:
- wake_lock_destroy(&stillmode_client_data->wakelock);
input_unregister_device(stillmode_client_data->input_dev);
free_memory:
platform_set_drvdata(pdev, NULL);
@@ -377,7 +369,6 @@ static int __exit stillmode_client_remove(struct platform_device *pdev)
m4sensorhub_irq_disable(m4sensorhub, M4SH_IRQ_STILL_DETECTED);
m4sensorhub_irq_unregister(m4sensorhub, M4SH_IRQ_STILL_DETECTED);
m4sensorhub_unregister_initcall(stillmode_driver_init);
- wake_lock_destroy(&stillmode_client_data->wakelock);
input_unregister_device(stillmode_client_data->input_dev);
platform_set_drvdata(pdev, NULL);
m4sensorhub->pdev->stillmode_exit = NULL;