[RAMEN9610-20413][9610] wlbt: SCSC Driver version 10.6.1.0
[GitHub/MotorolaMobilityLLC/kernel-slsi.git] / drivers / net / wireless / scsc / wakelock.h
1 /*****************************************************************************
2 *
3 * Copyright (c) 2014 - 2016 Samsung Electronics Co., Ltd. and its Licensors.
4 * All rights reserved.
5 *
6 ****************************************************************************/
7
8 #ifndef __SLSI_WAKELOCK_H__
9 #define __SLSI_WAKELOCK_H__
10
11 #ifdef CONFIG_WAKELOCK
12 #include <linux/wakelock.h>
13 #endif
14 #include <linux/spinlock.h>
15
16 struct slsi_wake_lock {
17 #ifdef CONFIG_WAKELOCK
18 struct wake_lock wl;
19 #endif
20 /* Spinlock to synchronize the access of the counter */
21 spinlock_t wl_spinlock;
22 int counter;
23 };
24
25 void slsi_wakelock(struct slsi_wake_lock *lock);
26 void slsi_wakeunlock(struct slsi_wake_lock *lock);
27 void slsi_wakelock_timeout(struct slsi_wake_lock *lock, int timeout);
28 int slsi_is_wakelock_active(struct slsi_wake_lock *lock);
29 void slsi_wakelock_exit(struct slsi_wake_lock *lock);
30 void slsi_wakelock_init(struct slsi_wake_lock *lock, char *name);
31 #endif