Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4348d871 authored by Stephen Boyd's avatar Stephen Boyd
Browse files

Revert "PM / Sleep: Add wake lock api wrapper on top of wakeup sources"



This reverts commit 3482eeaa ("PM / Sleep: Add wake lock api
wrapper on top of wakeup sources") and also commit a12d5bf2
("power: Remove HAS_WAKELOCK config and document WAKELOCK") as
both of these commits aren't present in the android common kernel
anymore. They seem to have come in through some other tree that
we had before android-common-4.9 existed.

Change-Id: I1fb98a391f5ff194383fd919ef3fa71dfca39d0b
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent 73f8c49e
Loading
Loading
Loading
Loading

include/linux/wakelock.h

deleted100644 → 0
+0 −67
Original line number Diff line number Diff line
/* include/linux/wakelock.h
 *
 * Copyright (C) 2007-2012 Google, Inc.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

#ifndef _LINUX_WAKELOCK_H
#define _LINUX_WAKELOCK_H

#include <linux/ktime.h>
#include <linux/device.h>

/* A wake_lock prevents the system from entering suspend or other low power
 * states when active. If the type is set to WAKE_LOCK_SUSPEND, the wake_lock
 * prevents a full system suspend.
 */

enum {
	WAKE_LOCK_SUSPEND, /* Prevent suspend */
	WAKE_LOCK_TYPE_COUNT
};

struct wake_lock {
	struct wakeup_source ws;
};

static inline void wake_lock_init(struct wake_lock *lock, int type,
				  const char *name)
{
	wakeup_source_init(&lock->ws, name);
}

static inline void wake_lock_destroy(struct wake_lock *lock)
{
	wakeup_source_trash(&lock->ws);
}

static inline void wake_lock(struct wake_lock *lock)
{
	__pm_stay_awake(&lock->ws);
}

static inline void wake_lock_timeout(struct wake_lock *lock, long timeout)
{
	__pm_wakeup_event(&lock->ws, jiffies_to_msecs(timeout));
}

static inline void wake_unlock(struct wake_lock *lock)
{
	__pm_relax(&lock->ws);
}

static inline int wake_lock_active(struct wake_lock *lock)
{
	return lock->ws.active;
}

#endif
+0 −9
Original line number Diff line number Diff line
@@ -29,15 +29,6 @@ config SUSPEND_SKIP_SYNC
	  of suspend, or they are content with invoking sync() from
	  user-space before invoking suspend.  Say Y if that's your case.

config WAKELOCK
	bool "Android's method of preventing suspend"
	default y
	---help---
	  This allows applications to prevent the CPU from suspending while
	  they need it.

	  Say Y if you are running an android userspace.

config HIBERNATE_CALLBACKS
	bool