usb: xhci: tegra: set SNPS owner only if no hs connected
[linux-3.10.git] / include / media / ov7695.h
1 /*
2  * Copyright (C) 2013 NVIDIA Corporation. All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
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  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
16  * 02111-1307, USA
17  */
18
19 #ifndef __OV7695_H__
20 #define __OV7695_H__
21
22 #include <linux/ioctl.h>  /* For IOCTL macros */
23
24 #define OV7695_SENSOR_NAME     "OV7695"
25 #define OV7695_DEV(x)          "/dev/"x
26 #define OV7695_SENSOR_PATH     DEV(OV7695_SENSOR_NAME)
27 #define OV7695_LOG_NAME(x)     "ImagerODM-"x
28 #define OV7695_LOG_TAG         LOG_NAME(OV7695_SENSOR_NAME)
29
30 #define OV7695_SENSOR_WAIT_MS          0
31 #define OV7695_SENSOR_TABLE_END        1
32 #define OV7695_SENSOR_BYTE_WRITE       2
33 #define OV7695_SENSOR_WORD_WRITE       3
34 #define OV7695_SENSOR_MASK_BYTE_WRITE  4
35 #define OV7695_SENSOR_MASK_WORD_WRITE  5
36 #define OV7695_SEQ_WRITE_START         6
37 #define OV7695_SEQ_WRITE_END           7
38
39 #define OV7695_SENSOR_MAX_RETRIES      3 /* max counter for retry I2C access */
40 #define OV7695_MAX_FACEDETECT_WINDOWS  5
41 #define OV7695_SENSOR_IOCTL_SET_MODE  _IOW('o', 1, struct ov7695_modeinfo)
42 #define OV7695_SENSOR_IOCTL_GET_STATUS         _IOR('o', 2, __u8)
43 #define OV7695_SENSOR_IOCTL_SET_COLOR_EFFECT   _IOW('o', 3, __u16)
44 #define OV7695_SENSOR_IOCTL_SET_WHITE_BALANCE  _IOW('o', 4, __u8)
45 #define OV7695_SENSOR_IOCTL_SET_SCENE_MODE     _IOW('o', 5, __u8)
46 #define OV7695_SENSOR_IOCTL_SET_AF_MODE        _IOW('o', 6, __u8)
47 #define OV7695_SENSOR_IOCTL_GET_AF_STATUS      _IOR('o', 7, __u8)
48 #define OV7695_SENSOR_IOCTL_SET_CAMERA         _IOW('o', 8, __u8)
49
50 struct ov7695_mode {
51         int xres;
52         int yres;
53 };
54
55 struct ov7695_modeinfo {
56         int xres;
57         int yres;
58 };
59
60 #define  AF_CMD_START 0
61 #define  AF_CMD_ABORT 1
62 #define  AF_CMD_SET_POSITION  2
63 #define  AF_CMD_SET_WINDOW_POSITION 3
64 #define  AF_CMD_SET_WINDOW_SIZE 4
65 #define  AF_CMD_SET_AFMODE  5
66 #define  AF_CMD_SET_CAF 6
67 #define  AF_CMD_GET_AF_STATUS 7
68
69 enum {
70         OV7695_YUV_ColorEffect = 0,
71         OV7695_YUV_Whitebalance,
72         OV7695_YUV_SceneMode,
73         OV7695_YUV_FlashType
74 };
75
76 enum {
77         OV7695_YUV_ColorEffect_Invalid = 0xA000,
78         OV7695_YUV_ColorEffect_Aqua,
79         OV7695_YUV_ColorEffect_Blackboard,
80         OV7695_YUV_ColorEffect_Mono,
81         OV7695_YUV_ColorEffect_Negative,
82         OV7695_YUV_ColorEffect_None,
83         OV7695_YUV_ColorEffect_Posterize,
84         OV7695_YUV_ColorEffect_Sepia,
85         OV7695_YUV_ColorEffect_Solarize,
86         OV7695_YUV_ColorEffect_Whiteboard,
87         OV7695_YUV_ColorEffect_Vivid,
88         OV7695_YUV_ColorEffect_WaterColor,
89         OV7695_YUV_ColorEffect_Vintage,
90         OV7695_YUV_ColorEffect_Vintage2,
91         OV7695_YUV_ColorEffect_Lomo,
92         OV7695_YUV_ColorEffect_Red,
93         OV7695_YUV_ColorEffect_Blue,
94         OV7695_YUV_ColorEffect_Yellow,
95         OV7695_YUV_ColorEffect_Aura,
96         OV7695_YUV_ColorEffect_Max
97 };
98
99 enum {
100         OV7695_YUV_Whitebalance_Invalid = 0,
101         OV7695_YUV_Whitebalance_Auto,
102         OV7695_YUV_Whitebalance_Incandescent,
103         OV7695_YUV_Whitebalance_Fluorescent,
104         OV7695_YUV_Whitebalance_WarmFluorescent,
105         OV7695_YUV_Whitebalance_Daylight,
106         OV7695_YUV_Whitebalance_CloudyDaylight,
107         OV7695_YUV_Whitebalance_Shade,
108         OV7695_YUV_Whitebalance_Twilight,
109         OV7695_YUV_Whitebalance_Custom
110 };
111
112 enum {
113         OV7695_YUV_SceneMode_Invalid = 0,
114         OV7695_YUV_SceneMode_Auto,
115         OV7695_YUV_SceneMode_Action,
116         OV7695_YUV_SceneMode_Portrait,
117         OV7695_YUV_SceneMode_Landscape,
118         OV7695_YUV_SceneMode_Beach,
119         OV7695_YUV_SceneMode_Candlelight,
120         OV7695_YUV_SceneMode_Fireworks,
121         OV7695_YUV_SceneMode_Night,
122         OV7695_YUV_SceneMode_NightPortrait,
123         OV7695_YUV_SceneMode_Party,
124         OV7695_YUV_SceneMode_Snow,
125         OV7695_YUV_SceneMode_Sports,
126         OV7695_YUV_SceneMode_SteadyPhoto,
127         OV7695_YUV_SceneMode_Sunset,
128         OV7695_YUV_SceneMode_Theatre,
129         OV7695_YUV_SceneMode_Barcode,
130         OV7695_YUV_SceneMode_BackLight
131 };
132
133 enum {
134         OV7695_YUV_FlashControlOn = 0,
135         OV7695_YUV_FlashControlOff,
136         OV7695_YUV_FlashControlAuto,
137         OV7695_YUV_FlashControlRedEyeReduction,
138         OV7695_YUV_FlashControlFillin,
139         OV7695_YUV_FlashControlTorch
140 };
141
142 enum {
143         OV7695_YUV_ISO_AUTO = 0,
144         OV7695_YUV_ISO_50 = 1,
145         OV7695_YUV_ISO_100 = 2,
146         OV7695_YUV_ISO_200 = 3,
147         OV7695_YUV_ISO_400 = 4,
148         OV7695_YUV_ISO_800 = 5,
149         OV7695_YUV_ISO_1600 = 6,
150 };
151
152 enum {
153         OV7695_YUV_FRAME_RATE_AUTO = 0,
154         OV7695_YUV_FRAME_RATE_30 = 1,
155         OV7695_YUV_FRAME_RATE_15 = 2,
156         OV7695_YUV_FRAME_RATE_7 = 3,
157 };
158
159 enum {
160         OV7695_YUV_ANTIBANGING_OFF = 0,
161         OV7695_YUV_ANTIBANGING_AUTO = 1,
162         OV7695_YUV_ANTIBANGING_50HZ = 2,
163         OV7695_YUV_ANTIBANGING_60HZ = 3,
164 };
165
166 enum {
167         OV7695_INT_STATUS_MODE = 0x01,
168         OV7695_INT_STATUS_AF = 0x02,
169         OV7695_INT_STATUS_ZOOM = 0x04,
170         OV7695_INT_STATUS_CAPTURE = 0x08,
171         OV7695_INT_STATUS_FRAMESYNC = 0x10,
172         OV7695_INT_STATUS_FD = 0x20,
173         OV7695_INT_STATELENS_INIT = 0x40,
174         OV7695_INT_STATUS_SOUND = 0x80,
175 };
176
177 enum {
178         OV7695_TOUCH_STATUS_OFF = 0,
179         OV7695_TOUCH_STATUS_ON,
180         OV7695_TOUCH_STATUS_DONE,
181 };
182
183 enum {
184         OV7695_CALIBRATION_ISP_POWERON_FAIL = 0,
185         OV7695_CALIBRATION_ISP_INIT_FAIL,
186         OV7695_CALIBRATION_ISP_MONITOR_FAIL,
187         OV7695_CALIBRATION_LIGHT_SOURCE_FAIL,
188         OV7695_CALIBRATION_LIGHT_SOURCE_OK,
189         OV7695_CALIBRATION_ISP_CAPTURE_FAIL,
190         OV7695_CALIBRATION_ISP_CHECKSUM_FAIL,
191         OV7695_CALIBRATION_ISP_PGAIN_FAIL,
192         OV7695_CALIBRATION_ISP_GOLDEN_FAIL,
193         OV7695_CALIBRATION_ISP_FAIL,
194         OV7695_CALIBRATION_ISP_OK,
195 };
196
197 enum {
198         OV7695_STREAMING_TYPE_PREVIEW_STREAMING = 0,
199         OV7695_STREAMING_TYPE_SINGLE_SHOT,
200         OV7695_STREAMING_TYPE_HDR_STREAMING,
201         OV7695_STREAMING_TYPE_BURST_STREAMING,
202         OV7695_STREAMING_TYPE_PREVIEW_AFTER_SINGLE_SHOT,
203         OV7695_STREAMING_TYPE_PREVIEW_AFTER_HDR_STREAMING,
204         OV7695_STREAMING_TYPE_PREVIEW_AFTER_BURST_STREAMING,
205 };
206
207 struct ov7695_sensordata {
208         __u32 fuse_id_size;
209         __u8  fuse_id[16];
210 };
211
212 #ifdef __KERNEL__
213 struct ov7695_power_rail {
214         struct regulator *dvdd;
215         struct regulator *avdd;
216         struct regulator *iovdd;
217 };
218
219 struct ov7695_platform_data {
220         int (*power_on)(struct ov7695_power_rail *pw);
221         int (*power_off)(struct ov7695_power_rail *pw);
222         const char *mclk_name;
223 };
224 #endif /* __KERNEL__ */
225
226 #endif  /* __OV7695_H__ */