@@ -741,17 +741,17 @@ static void set_vbus_power(struct hisi_dwc3_device *hisi_dwc3, unsigned int is_o
static void hisi_dwc3_wake_lock(struct hisi_dwc3_device *hisi_dwc3)
{
- if (!wake_lock_active(&hisi_dwc3->wake_lock)) {
+ if (!(hisi_dwc3->ws.active)) {
usb_dbg("usb otg wake lock\n");
- wake_lock(&hisi_dwc3->wake_lock);
+ __pm_stay_awake(&hisi_dwc3->ws);
}
}
static void hisi_dwc3_wake_unlock(struct hisi_dwc3_device *hisi_dwc3)
{
- if (wake_lock_active(&hisi_dwc3->wake_lock)) {
+ if (hisi_dwc3->ws.active) {
usb_dbg("usb otg wake unlock\n");
- wake_unlock(&hisi_dwc3->wake_lock);
+ __pm_relax(&hisi_dwc3->ws);
}
}
@@ -1569,7 +1569,7 @@ int hisi_dwc3_probe(struct platform_device *pdev,
spin_lock_init(&hisi_dwc->event_lock);
INIT_WORK(&hisi_dwc->event_work, event_work);
mutex_init(&hisi_dwc->lock);
- wake_lock_init(&hisi_dwc->wake_lock, WAKE_LOCK_SUSPEND, "usb_wake_lock");
+ wakeup_source_init(&hisi_dwc->ws, "usb_wake_lock");
ATOMIC_INIT_NOTIFIER_HEAD(&hisi_dwc->charger_type_notifier);
event_queue_creat(&hisi_dwc->event_queue, MAX_EVENT_COUNT);
hisi_dwc->disable_vdp_src = disable_vdp_src;
@@ -2,7 +2,7 @@
#ifndef _DWC3_HISI_H_
#define _DWC3_HISI_H_
-#include <linux/wakelock.h>
+#include <linux/pm_wakeup.h>
#include <linux/clk.h>
#include <linux/hisi/usb/hisi_usb.h>
#include <linux/regulator/consumer.h>
@@ -210,7 +210,7 @@ struct hisi_dwc3_device {
spinlock_t event_lock;
struct mutex lock;
- struct wake_lock wake_lock;
+ struct wakeup_source ws;
struct atomic_notifier_head charger_type_notifier;
struct work_struct event_work;
deleted file mode 100644
@@ -1,67 +0,0 @@
-/* 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
This should be squished down into the hack patch. Signed-off-by: John Stultz <john.stultz@linaro.org> --- drivers/usb/dwc3/dwc3-hisi.c | 10 +++---- drivers/usb/dwc3/dwc3-hisi.h | 4 +-- include/linux/wakelock.h | 67 -------------------------------------------- 3 files changed, 7 insertions(+), 74 deletions(-) delete mode 100644 include/linux/wakelock.h -- 2.7.4