1 /*****************************************************************************
3 * Copyright (c) 2014 - 2016 Samsung Electronics Co., Ltd. and its Licensors.
6 ****************************************************************************/
8 #ifndef __SLSI_WAKELOCK_H__
9 #define __SLSI_WAKELOCK_H__
11 #ifdef CONFIG_WAKELOCK
12 #include <linux/wakelock.h>
14 #include <linux/spinlock.h>
16 struct slsi_wake_lock
{
17 #ifdef CONFIG_WAKELOCK
20 /* Spinlock to synchronize the access of the counter */
21 spinlock_t wl_spinlock
;
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
);