Skip to content

Commit

Permalink
power: wakeup: allow userspace control for wakelocks
Browse files Browse the repository at this point in the history
  • Loading branch information
javilonas committed Jun 11, 2015
1 parent 32db8ec commit 0133a5c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions drivers/base/power/wakeup.c
Expand Up @@ -14,10 +14,16 @@
#include <linux/suspend.h>
#include <linux/seq_file.h>
#include <linux/debugfs.h>
#include <linux/moduleparam.h>
#include <trace/events/power.h>

#include "power.h"

static bool enable_si_ws = false;
module_param(enable_si_ws, bool, 0644);
static bool enable_msm_hsic_ws = true;
module_param(enable_msm_hsic_ws, bool, 0644);

/*
* If set, the suspend/hibernate code will abort transitions to a sleep state
* if wakeup events are registered during or immediately before the transition.
Expand Down Expand Up @@ -388,6 +394,16 @@ static void wakeup_source_activate(struct wakeup_source *ws)
*/
freeze_wake();

if (!enable_si_ws && !strcmp(ws->name, "sensor_ind")) {
pr_info("wakeup source sensor_ind activate skipped\n");
return;
}

if (!enable_msm_hsic_ws && !strcmp(ws->name, "msm_hsic_host")) {
pr_info("wakeup source msm_hsic_host activate skipped\n");
return;
}

ws->active = true;
ws->active_count++;
ws->last_time = ktime_get();
Expand Down

0 comments on commit 0133a5c

Please sign in to comment.