1 /**************************************************************************
5 * Copyright 2012 Samsung Electronics co., Ltd. All Rights Reserved.
7 * Contact: SooChan Lim <sc1.lim@samsung.com>, Sangjin Lee <lsj119@samsung.com>
8 * Boram Park <boram1288.park@samsung.com>, Changyeon Lee <cyeon.lee@samsung.com>
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the
12 * "Software"), to deal in the Software without restriction, including
13 * without limitation the rights to use, copy, modify, merge, publish,
14 * distribute, sub license, and/or sell copies of the Software, and to
15 * permit persons to whom the Software is furnished to do so, subject to
16 * the following conditions:
18 * The above copyright notice and this permission notice (including the
19 * next paragraph) shall be included in all copies or substantial portions
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
25 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
26 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
27 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
28 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 * **************************************************************************/
32 #ifndef __TBM_BUFMGR_TGL_H__
33 #define __TBM_BUFMGR_TGL_H__
35 #include <linux/ioctl.h>
37 static char tgl_devfile[] = "/dev/slp_global_lock";
38 static char tgl_devfile1[] = "/dev/tgl";
40 #define TGL_IOCTL_BASE 0x32
41 #define TGL_IO(nr) _IO(TGL_IOCTL_BASE, nr)
42 #define TGL_IOR(nr, type) _IOR(TGL_IOCTL_BASE, nr, type)
43 #define TGL_IOW(nr, type) _IOW(TGL_IOCTL_BASE, nr, type)
44 #define TGL_IOWR(nr, type) _IOWR(TGL_IOCTL_BASE, nr, type)
47 * struct tgl_ver_data - tgl version data structure
48 * @major: major version
49 * @minor: minor version
57 * struct tgl_reg_data - tgl data structure
59 * @timeout_ms: timeout value for waiting event
63 unsigned int timeout_ms;
68 TGL_TYPE_READ = (1 << 0),
69 TGL_TYPE_WRITE = (1 << 1),
73 * struct tgl_lock_data - tgl lock data structure
75 * @type: lock type that is in tgl_type_data
77 struct tgl_lock_data {
79 enum tgl_type_data type;
82 enum tgl_status_data {
88 * struct tgl_usr_data - tgl user data structure
92 * @status: lock status that is in tgl_status_data
98 enum tgl_status_data status;
111 /* get version information */
112 #define TGL_IOCTL_GET_VERSION TGL_IOR(_TGL_GET_VERSION, struct tgl_ver_data)
114 #define TGL_IOCTL_REGISTER TGL_IOW(_TGL_REGISTER, struct tgl_reg_data)
116 #define TGL_IOCTL_UNREGISTER TGL_IOW(_TGL_UNREGISTER, struct tgl_reg_data)
118 #define TGL_IOCTL_LOCK TGL_IOW(_TGL_LOCK, struct tgl_lock_data)
119 /* unlock with key */
120 #define TGL_IOCTL_UNLOCK TGL_IOW(_TGL_UNLOCK, struct tgl_lock_data)
121 /* set user data with key */
122 #define TGL_IOCTL_SET_DATA TGL_IOW(_TGL_SET_DATA, struct tgl_usr_data)
123 /* get user data with key */
124 #define TGL_IOCTL_GET_DATA TGL_IOR(_TGL_GET_DATA, struct tgl_usr_data)
126 #endif /* __TBM_BUFMGR_TGL_H__ */