Skip to content

Commit

Permalink
drivers: Add Configurable Wakelocks
Browse files Browse the repository at this point in the history
Signed-off-by: topser9 <topser181@gmail.com>
  • Loading branch information
topser9 authored and ravindu644 committed Mar 5, 2024
1 parent fc82df2 commit 617c34a
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions drivers/base/power/wakeup.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,25 @@ bool wl_blocker_debug = false;
static void wakeup_source_deactivate(struct wakeup_source *ws);
#endif

#include <linux/moduleparam.h>

static bool enable_mmc0_detect_wl = true;
module_param(enable_mmc0_detect_wl, bool, 0644);

static bool enable_wlan_rx_wake_wl = true;
module_param(enable_wlan_rx_wake_wl, bool, 0644);

static bool enable_wlan_ctrl_wake_wl = true;
module_param(enable_wlan_ctrl_wake_wl, bool, 0644);

static bool enable_wlan_wake_wl = true;
module_param(enable_wlan_wake_wl, bool, 0644);

static bool enable_wlan_wd_wake_wl = true;
module_param(enable_wlan_wd_wake_wl, bool, 0644);

static bool enable_bluedroid_timer_wl = true;
module_param(enable_bluedroid_timer_wl, bool, 0644);

/*
* If set, the suspend/hibernate code will abort transitions to a sleep state
Expand Down Expand Up @@ -553,6 +572,24 @@ static bool wakeup_source_not_registered(struct wakeup_source *ws)
static void wakeup_source_activate(struct wakeup_source *ws)
{
unsigned int cec;

if (!enable_mmc0_detect_wl && !strcmp(ws->name, "mmc0_detect"))
return;

if (!enable_wlan_wake_wl && !strcmp(ws->name, "wlan_wake"))
return;

if (!enable_wlan_ctrl_wake_wl && !strcmp(ws->name, "wlan_ctrl_wake"))
return;

if (!enable_wlan_rx_wake_wl && !strcmp(ws->name, "wlan_rx_wake"))
return;

if (!enable_wlan_wd_wake_wl && !strcmp(ws->name, "wlan_wd_wake"))
return;

if (!enable_bluedroid_timer_wl && !strcmp(ws->name, "bluedroid_timer"))
return;

if (WARN_ONCE(wakeup_source_not_registered(ws),
"unregistered wakeup source\n"))
Expand Down

0 comments on commit 617c34a

Please sign in to comment.