2 * Tizen Global Lock device driver
4 * Copyright (C) 2014 Samsung Electronics Co., Ltd.
6 * Author: YoungJun Cho <yj44.cho@samsung.com>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2, as published
10 * by the Free Software Foundation.
16 #define TGL_IOCTL_BASE 0x32
17 #define TGL_IO(nr) _IO(TGL_IOCTL_BASE, nr)
18 #define TGL_IOR(nr, type) _IOR(TGL_IOCTL_BASE, nr, type)
19 #define TGL_IOW(nr, type) _IOW(TGL_IOCTL_BASE, nr, type)
20 #define TGL_IOWR(nr, type) _IOWR(TGL_IOCTL_BASE, nr, type)
23 * struct tgl_reg_data - tgl register data structure
25 * @timeout_ms: timeout value for waiting event
29 unsigned int timeout_ms;
34 TGL_TYPE_READ = (1 << 0),
35 TGL_TYPE_WRITE = (1 << 1),
39 * struct tgl_lock_data - tgl lock data structure
41 * @type: lock type that is in tgl_type_data
43 struct tgl_lock_data {
45 enum tgl_type_data type;
48 enum tgl_status_data {
54 * struct tgl_usr_data - tgl user data structure
58 * @status: lock status that is in tgl_status_data
64 enum tgl_status_data status;
77 #define TGL_IOCTL_REGISTER TGL_IOW(_TGL_REGISTER, struct tgl_reg_data)
79 #define TGL_IOCTL_UNREGISTER TGL_IOW(_TGL_UNREGISTER, struct tgl_reg_data)
81 #define TGL_IOCTL_LOCK TGL_IOW(_TGL_LOCK, struct tgl_lock_data)
83 #define TGL_IOCTL_UNLOCK TGL_IOW(_TGL_UNLOCK, struct tgl_lock_data)
84 /* set user data with key */
85 #define TGL_IOCTL_SET_DATA TGL_IOW(_TGL_SET_DATA, struct tgl_usr_data)
86 /* get user data with key */
87 #define TGL_IOCTL_GET_DATA TGL_IOR(_TGL_GET_DATA, struct tgl_usr_data)