tizen 2.4 release
[profile/mobile/platform/kernel/linux-3.10-sc7730.git] / include / video / sprd_vsp.h
1 /*
2  * Copyright (C) 2012 Spreadtrum Communications Inc.
3  *
4  * This software is licensed under the terms of the GNU General Public
5  * License version 2, as published by the Free Software Foundation, and
6  * may be copied, distributed, and modified under those terms.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU General Public License for more details.
12  */
13 #ifndef _SPRD_VSP_H
14 #define _SPRD_VSP_H
15
16 #include <linux/ioctl.h>
17
18 #if defined(CONFIG_ARCH_SCX35)
19 //#include "__sprd_vsp_sc8830.h"
20 /*40k vsp address space size*/
21 #define SPRD_VSP_MAP_SIZE 0xA000
22 #define SPRD_VSP_CLK_LEVEL_NUM 4 //depend on chip design
23 #define SPRD_VSP_CLK_LEVEL_NUM_PIKE 3 //depend on chip design
24
25 #define SPRD_VSP_IOCTL_MAGIC 'm'
26 #define VSP_CONFIG_FREQ _IOW(SPRD_VSP_IOCTL_MAGIC, 1, unsigned int)
27 #define VSP_GET_FREQ    _IOR(SPRD_VSP_IOCTL_MAGIC, 2, unsigned int)
28 #define VSP_ENABLE      _IO(SPRD_VSP_IOCTL_MAGIC, 3)
29 #define VSP_DISABLE     _IO(SPRD_VSP_IOCTL_MAGIC, 4)
30 #define VSP_ACQUAIRE    _IO(SPRD_VSP_IOCTL_MAGIC, 5)
31 #define VSP_RELEASE     _IO(SPRD_VSP_IOCTL_MAGIC, 6)
32 #define VSP_COMPLETE       _IO(SPRD_VSP_IOCTL_MAGIC, 7)
33 #define VSP_RESET       _IO(SPRD_VSP_IOCTL_MAGIC, 8)
34 #define VSP_HW_INFO     _IO(SPRD_VSP_IOCTL_MAGIC, 9)
35 #define VSP_VERSION                  _IO(SPRD_VSP_IOCTL_MAGIC, 10)
36
37 enum sprd_vsp_frequency_e {
38     VSP_FREQENCY_LEVEL_0 = 0,
39     VSP_FREQENCY_LEVEL_1 = 1,
40     VSP_FREQENCY_LEVEL_2 = 2,
41     VSP_FREQENCY_LEVEL_3 = 3
42 };
43
44 typedef enum
45 {
46     SHARK = 0,
47     DOLPHIN = 1,
48     TSHARK = 2,
49     SHARKL = 3,
50     PIKE = 4,
51     PIKEL = 5,
52     SHARKL64 = 6,
53     SHARKLT8 = 7,
54     MAX_VERSIONS,
55 }
56 VSP_VERSION_E;
57
58 /*
59 ioctl command description
60 the VSP user must mmap the vsp address space to user-space to access
61 the hardware.
62 VSP_ACQUAIRE:aquaire the vsp lock
63 VSP_RELEASE:release the vsp lock
64 all other commands must be sent only when the VSP user posses the lock
65 VSP_ENABLE:enable vsp clock
66 VSP_DISABLE:disable vsp clock
67 VSP_COMPLETE:all the preparing work is done and start the vsp, the vsp finishes
68 its job after this command retruns.
69 VSP_RESET:reset vsp hardware
70 VSP_CONFIG_FREQ/VSP_GET_FREQ:set/get vsp frequency,the parameter is of
71 type sprd_vsp_frequency_e, the smaller the faster
72 */
73
74 //#elif defined(CONFIG_ARCH_SC8825)
75 #else   //for 8810/7710/8825
76 //#include "__sprd_vsp_sc8825.h"
77 /*76k vsp address space size*/
78 #define SPRD_VSP_MAP_SIZE 0x13000
79
80 #define SPRD_VSP_IOCTL_MAGIC 'm'
81 #define VSP_CONFIG_FREQ _IOW(SPRD_VSP_IOCTL_MAGIC, 1, unsigned int)
82 #define VSP_GET_FREQ    _IOR(SPRD_VSP_IOCTL_MAGIC, 2, unsigned int)
83 #define VSP_ENABLE      _IO(SPRD_VSP_IOCTL_MAGIC, 3)
84 #define VSP_DISABLE     _IO(SPRD_VSP_IOCTL_MAGIC, 4)
85 #define VSP_ACQUAIRE    _IO(SPRD_VSP_IOCTL_MAGIC, 5)
86 #define VSP_RELEASE     _IO(SPRD_VSP_IOCTL_MAGIC, 6)
87 #define VSP_START       _IO(SPRD_VSP_IOCTL_MAGIC, 7)
88 #define VSP_RESET       _IO(SPRD_VSP_IOCTL_MAGIC, 8)
89 #define VSP_REG_IRQ       _IO(SPRD_VSP_IOCTL_MAGIC,9)
90 #define VSP_UNREG_IRQ       _IO(SPRD_VSP_IOCTL_MAGIC,10)
91 #define VSP_ACQUAIRE_MEA_DONE _IO(SPRD_VSP_IOCTL_MAGIC, 11)
92 #define VSP_ACQUAIRE_MP4ENC_DONE _IO(SPRD_VSP_IOCTL_MAGIC, 12)
93 enum sprd_vsp_frequency_e {
94     VSP_FREQENCY_LEVEL_0 = 0,
95     VSP_FREQENCY_LEVEL_1 = 1,
96     VSP_FREQENCY_LEVEL_2 = 2,
97     VSP_FREQENCY_LEVEL_3 = 3
98 };
99
100 /*
101 ioctl command description
102 the VSP user must mmap the vsp address space to user-space to access
103 the hardware.
104 VSP_ACQUAIRE:aquaire the vsp lock
105 VSP_RELEASE:release the vsp lock
106 all other commands must be sent only when the VSP user posses the lock
107 VSP_ENABLE:enable vsp clock
108 VSP_DISABLE:disable vsp clock
109 VSP_START:all the preparing work is done and start the vsp, the vsp finishes
110 its job after this command retruns.
111 VSP_RESET:reset vsp hardware
112 VSP_CONFIG_FREQ/VSP_GET_FREQ:set/get vsp frequency,the parameter is of
113 type sprd_vsp_frequency_e, the smaller the faster
114 */
115
116 //#else
117 //#error "Unknown architecture specification"
118 #endif
119
120 #endif
121