Merge branch 'sandbox/cyeon/devel' into tizen
[platform/adaptation/spreadtrum/libtbm-sprd.git] / src / tbm_bufmgr_tgl.h
1 /**************************************************************************
2  *
3  * libtbm
4  *
5  * Copyright 2012 Samsung Electronics co., Ltd. All Rights Reserved.
6  *
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>
9  *
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:
17  *
18  * The above copyright notice and this permission notice (including the
19  * next paragraph) shall be included in all copies or substantial portions
20  * of the Software.
21  *
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.
29  *
30  * **************************************************************************/
31
32 #ifndef __TBM_BUFMGR_TGL_H__
33 #define __TBM_BUFMGR_TGL_H__
34
35 #include <linux/ioctl.h>
36
37 static char tgl_devfile[] = "/dev/slp_global_lock";
38 static char tgl_devfile1[] = "/dev/tgl";
39
40 #define TGL_IOC_BASE                            0x32
41
42 struct tgl_attribute {
43         unsigned int key;
44         unsigned int timeout_ms;
45 };
46
47 struct tgl_user_data {
48         unsigned int key;
49         unsigned int data1;
50         unsigned int data2;
51         unsigned int locked;
52 };
53
54 typedef enum {
55         _TGL_INIT_LOCK = 1,
56         _TGL_DESTROY_LOCK,
57         _TGL_LOCK_LOCK,
58         _TGL_UNLOCK_LOCK,
59         _TGL_SET_DATA,
60         _TGL_GET_DATA,
61 } _tgl_ioctls;
62
63 #define TGL_IOC_INIT_LOCK                       _IOW(TGL_IOC_BASE, _TGL_INIT_LOCK, struct tgl_attribute *)
64 #define TGL_IOC_DESTROY_LOCK            _IOW(TGL_IOC_BASE, _TGL_DESTROY_LOCK, unsigned int)
65 #define TGL_IOC_LOCK_LOCK                       _IOW(TGL_IOC_BASE, _TGL_LOCK_LOCK, unsigned int)
66 #define TGL_IOC_UNLOCK_LOCK                     _IOW(TGL_IOC_BASE, _TGL_UNLOCK_LOCK, unsigned int)
67 #define TGL_IOC_SET_DATA                        _IOW(TGL_IOC_BASE, _TGL_SET_DATA, struct tgl_user_data *)
68 #define TGL_IOC_GET_DATA                        _IOW(TGL_IOC_BASE, _TGL_GET_DATA, struct tgl_user_data *)
69
70 #endif                                                  /* __TBM_BUFMGR_TGL_H__ */