tizen 2.3.1 release
[kernel/linux-3.0.git] / drivers / media / video / slp_s5c73m3.h
1 /*
2  * Driver for LSI S5C73M3 (ISP for 8MP Camera)
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 as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  */
9
10 #ifndef __SLP_S5C73M3_H
11 #define __SLP_S5C73M3_H
12
13 #define CONFIG_CAM_DEBUG        1
14
15 #define cam_warn(fmt, ...)      \
16         do { \
17                 printk(KERN_WARNING "%s: " fmt, __func__, ##__VA_ARGS__); \
18         } while (0)
19
20 #define cam_err(fmt, ...)       \
21         do { \
22                 printk(KERN_ERR "%s: " fmt, __func__, ##__VA_ARGS__); \
23         } while (0)
24
25 #define cam_info(fmt, ...)      \
26         do { \
27                 printk(KERN_INFO "%s: " fmt, __func__, ##__VA_ARGS__); \
28         } while (0)
29
30 #ifdef CONFIG_CAM_DEBUG
31 #define CAM_DEBUG       (1 << 0)
32 #define CAM_TRACE       (1 << 1)
33 #define CAM_I2C         (1 << 2)
34
35 #define cam_dbg(fmt, ...)       \
36         do { \
37                 if (to_state(sd)->dbg_level & CAM_DEBUG) \
38                         printk(KERN_DEBUG "%s: " fmt, \
39                                         __func__, ##__VA_ARGS__); \
40         } while (0)
41
42 #define cam_trace(fmt, ...)     \
43         do { \
44                 if (to_state(sd)->dbg_level & CAM_TRACE) \
45                         printk(KERN_DEBUG "%s: " fmt, \
46                                         __func__, ##__VA_ARGS__); \
47         } while (0)
48
49 #define cam_i2c_dbg(fmt, ...)   \
50         do { \
51                 if (to_state(sd)->dbg_level & CAM_I2C) \
52                         printk(KERN_DEBUG "%s: " fmt, \
53                                         __func__, ##__VA_ARGS__); \
54         } while (0)
55 #else
56 #define cam_dbg(fmt, ...)
57 #define cam_trace(fmt, ...)
58 #define cam_i2c_dbg(fmt, ...)
59 #endif
60
61 enum s5c73m3_fw_path {
62         S5C73M3_OPT_MEDIA,
63         S5C73M3_IN_DATA,
64         S5C73M3_IN_SYSTEM,
65         S5C73M3_PATH_MAX,
66 };
67
68 enum s5c73m3_prev_frmsize {
69         S5C73M3_PREVIEW_QCIF,
70         S5C73M3_PREVIEW_QCIF2,
71         S5C73M3_PREVIEW_QVGA,
72         S5C73M3_PREVIEW_CIF,
73         S5C73M3_PREVIEW_VGA,
74         S5C73M3_PREVIEW_D1,
75         S5C73M3_PREVIEW_WVGA,
76         S5C73M3_PREVIEW_800X600,
77         S5C73M3_PREVIEW_880X720,
78         S5C73M3_PREVIEW_960X720,
79         S5C73M3_PREVIEW_1008X672,
80         S5C73M3_PREVIEW_1056X704,
81         S5C73M3_PREVIEW_1184X666,
82         S5C73M3_PREVIEW_720P,
83         S5C73M3_VDIS_720P,
84         S5C73M3_PREVIEW_1080P,
85         S5C73M3_VDIS_1080P,
86         S5C73M3_PREVIEW_HDR,
87         S5C73M3_PREVIEW_3264X1836,
88 };
89
90 enum s5c73m3_cap_frmsize {
91         S5C73M3_CAPTURE_VGA,    /* 640 x 480 */
92         S5C73M3_CAPTURE_WVGA,   /* 800 x 480 */
93         S5C73M3_CAPTURE_960x540,        /* 960 x 540 */
94         S5C73M3_CAPTURE_960x720,        /* 960 x 720 */
95         S5C73M3_CAPTURE_1024X768,       /* 1024 x 768 */
96         S5C73M3_CAPTURE_HD,     /* 1280 x 720 */
97         S5C73M3_CAPTURE_W1MP,   /* 1600 x 960 */
98         S5C73M3_CAPTURE_2MP,    /* UXGA - 1600 x 1200 */
99         S5C73M3_CAPTURE_W2MP,   /* 2048 x 1232 */
100         S5C73M3_CAPTURE_3MP,    /* QXGA - 2048 x 1536 */
101         S5C73M3_CAPTURE_W4MP,   /* WQXGA - 2560 x 1440 */
102         S5C73M3_CAPTURE_5MP,    /* 2560 x 1920 */
103         S5C73M3_CAPTURE_W6MP,   /* 3072 x 1856 */
104         S5C73M3_CAPTURE_7MP,    /* 3072 x 2304 */
105         S5C73M3_CAPTURE_W7MP,   /* WQXGA - 2560 x 1536 */
106         S5C73M3_CAPTURE_3264X2176,      /* 3264 x 2176 */
107         S5C73M3_CAPTURE_8MP,    /* 3264 x 2448 */
108 };
109
110 enum s5c73m3_isneed_flash_tristate {
111         S5C73M3_ISNEED_FLASH_OFF = 0x00,
112         S5C73M3_ISNEED_FLASH_ON = 0x01,
113         S5C73M3_ISNEED_FLASH_UNDEFINED = 0x02,
114 };
115
116 struct s5c73m3_control {
117         u32 id;
118         s32 value;
119         s32 minimum;            /* Note signedness */
120         s32 maximum;
121         s32 step;
122         s32 default_value;
123 };
124
125 struct s5c73m3_frmsizeenum {
126         unsigned int index;
127         unsigned int width;
128         unsigned int height;
129         u8 reg_val;             /* a value for category parameter */
130 };
131
132 struct s5c73m3_effectenum {
133         unsigned int index;
134         unsigned int reg_val;
135 };
136
137 struct s5c73m3_isp {
138         wait_queue_head_t wait;
139         unsigned int irq;       /* irq issued by ISP */
140         unsigned int issued;
141         unsigned int int_factor;
142         unsigned int bad_fw:1;
143 };
144
145 struct s5c73m3_jpeg {
146         int quality;
147         unsigned int main_size; /* Main JPEG file size */
148         unsigned int thumb_size;        /* Thumbnail file size */
149         unsigned int main_offset;
150         unsigned int thumb_offset;
151         unsigned int postview_offset;
152 };
153 struct s5c73m3_fw_version {
154         unsigned int index;
155         unsigned int opened;
156         char path[25];
157         char ver[10];
158 };
159
160 struct s5c73m3_focus {
161         unsigned int mode;
162         unsigned int lock;
163         unsigned int status;
164         unsigned int touch;
165         unsigned int pos_x;
166         unsigned int pos_y;
167
168         /* rectangle type values */
169         unsigned int left;
170         unsigned int top;
171         unsigned int width;
172         unsigned int height;
173 };
174
175 struct s5c73m3_exif {
176         char unique_id[7];
177         u32 exptime;            /* us */
178         u16 flash;
179         u16 iso;
180         int tv;                 /* shutter speed */
181         int bv;                 /* brightness */
182         int ebv;                /* exposure bias */
183         int effect;             /* effect(colorfx) */
184         int saturation;
185         int sharpness;
186         int metering;
187         int wdr;
188 };
189
190 struct s5c73m3_state {
191         struct s5c73m3_platform_data *pdata;
192         struct v4l2_subdev sd;
193
194         struct s5c73m3_isp isp;
195
196         const struct s5c73m3_frmsizeenum *preview;
197         const struct s5c73m3_frmsizeenum *capture;
198
199         enum v4l2_pix_format_mode format_mode;
200         enum v4l2_sensor_mode sensor_mode;
201         enum v4l2_flash_mode flash_mode;
202         enum v4l2_wb_mode wb_mode;
203         enum v4l2_scene_mode scene_mode;
204         int vt_mode;
205         int beauty_mode;
206         int hdr_mode;
207         int hybrid_mode;
208         int zoom;
209         int stream_enable;
210         int ae_lock;
211         int awb_lock;
212         int fw_index;
213         u32 cal_device;
214         u32 cal_dll;
215
216         unsigned int fps;
217         struct s5c73m3_focus focus;
218         int caf_mode;
219         char isflash;
220
221         struct s5c73m3_jpeg jpeg;
222         struct s5c73m3_exif exif;
223
224         int check_dataline;
225         char *fw_version;
226
227         u32 jpeg_width;
228         u32 jpeg_height;
229         u32 sensor_size;
230
231         u8 sensor_fw[10];
232         u8 phone_fw[10];
233
234         u8 sensor_type[15];
235
236 #ifdef CONFIG_CAM_DEBUG
237         u8 dbg_level;
238 #endif
239 };
240
241 #define S5C73M3_IMG_OUTPUT      0x0902
242 #define S5C73M3_HDR_OUTPUT      0x0008
243 #define S5C73M3_YUV_OUTPUT      0x0009
244 #define S5C73M3_INTERLEAVED_OUTPUT      0x000D
245 #define S5C73M3_HYBRID_OUTPUT   0x0016
246
247 #define S5C73M3_STILL_PRE_FLASH                 0x0A00
248 #define S5C73M3_STILL_PRE_FLASH_FIRE            0x0000
249 #define S5C73M3_STILL_PRE_FLASH_NON_FIRED       0x0000
250 #define S5C73M3_STILL_PRE_FLASH_FIRED           0x0001
251
252 #define S5C73M3_STILL_MAIN_FLASH                0x0A02
253 #define S5C73M3_STILL_MAIN_FLASH_CANCEL         0x0001
254 #define S5C73M3_STILL_MAIN_FLASH_FIRE           0x0002
255
256
257 #define S5C73M3_ZOOM_STEP       0x0B00
258
259
260 #define S5C73M3_IMAGE_EFFECT            0x0B0A
261 #define S5C73M3_IMAGE_EFFECT_NONE       0x0001
262 #define S5C73M3_IMAGE_EFFECT_NEGATIVE   0x0002
263 #define S5C73M3_IMAGE_EFFECT_AQUA       0x0003
264 #define S5C73M3_IMAGE_EFFECT_SEPIA      0x0004
265 #define S5C73M3_IMAGE_EFFECT_MONO       0x0005
266 #define S5C73M3_IMAGE_EFFECT_SKETCH     0x0006
267 #define S5C73M3_IMAGE_EFFECT_WASHED     0x0007
268 #define S5C73M3_IMAGE_EFFECT_VINTAGE_WARM       0x0008
269 #define S5C73M3_IMAGE_EFFECT_VINTAGE_COLD       0x0009
270 #define S5C73M3_IMAGE_EFFECT_SOLARIZE   0x000A
271 #define S5C73M3_IMAGE_EFFECT_POSTERIZE  0x000B
272 #define S5C73M3_IMAGE_EFFECT_POINT_BLUE 0x000C
273 #define S5C73M3_IMAGE_EFFECT_POINT_RED_YELLOW   0x000D
274 #define S5C73M3_IMAGE_EFFECT_POINT_COLOR_3      0x000E
275 #define S5C73M3_IMAGE_EFFECT_POINT_GREEN        0x000F
276 #define S5C73M3_IMAGE_EFFECT_CARTOONIZE 0x001A
277
278 #define S5C73M3_IMAGE_QUALITY           0x0B0C
279 #define S5C73M3_IMAGE_QUALITY_SUPERFINE 0x0000
280 #define S5C73M3_IMAGE_QUALITY_FINE      0x0001
281 #define S5C73M3_IMAGE_QUALITY_NORMAL    0x0002
282
283
284 #define S5C73M3_FLASH_MODE              0x0B0E
285 #define S5C73M3_FLASH_MODE_OFF          0x0000
286 #define S5C73M3_FLASH_MODE_ON           0x0001
287 #define S5C73M3_FLASH_MODE_AUTO         0x0002
288
289 #define S5C73M3_FLASH_TORCH             0x0B12
290 #define S5C73M3_FLASH_TORCH_OFF         0x0000
291 #define S5C73M3_FLASH_TORCH_ON          0x0001
292
293 #define S5C73M3_AE_ISNEEDFLASH          0x0CBA
294 #define S5C73M3_AE_ISNEEDFLASH_OFF      0x0000
295 #define S5C73M3_AE_ISNEEDFLASH_ON       0x0001
296
297
298 #define S5C73M3_CHG_MODE                0x0B10
299 #define S5C73M3_DEFAULT_MODE            0x8000
300
301 #define S5C73M3_CHG_MODE_YUV_320_240    0x8001
302 #define S5C73M3_CHG_MODE_YUV_400_300    0x8002
303 #define S5C73M3_CHG_MODE_YUV_640_480    0x8003
304 #define S5C73M3_CHG_MODE_YUV_800_600    0x8004
305 #define S5C73M3_CHG_MODE_YUV_960_720    0x8005
306 #define S5C73M3_CHG_MODE_YUV_1280_720   0x8006
307 #define S5C73M3_CHG_MODE_YUV_1280_960   0x8007
308 #define S5C73M3_CHG_MODE_YUV_1600_1200  0x8008
309 #define S5C73M3_CHG_MODE_YUV_1632_1224  0x8009
310 #define S5C73M3_CHG_MODE_YUV_1920_1080  0x800A
311 #define S5C73M3_CHG_MODE_YUV_1920_1440  0x800B
312 #define S5C73M3_CHG_MODE_YUV_2304_1296  0x800C
313 #define S5C73M3_CHG_MODE_YUV_2304_1728  0x800D
314 #define S5C73M3_CHG_MODE_JPEG_640_480   0x0010
315 #define S5C73M3_CHG_MODE_JPEG_800_450   0x0020
316 #define S5C73M3_CHG_MODE_JPEG_800_600   0x0030
317 #define S5C73M3_CHG_MODE_JPEG_1600_960  0x0040
318 #define S5C73M3_CHG_MODE_JPEG_1600_1200 0x0050
319 #define S5C73M3_CHG_MODE_JPEG_2048_1152 0x0060
320 #define S5C73M3_CHG_MODE_JPEG_2048_1536 0x0070
321 #define S5C73M3_CHG_MODE_JPEG_2560_1440 0x0080
322 #define S5C73M3_CHG_MODE_JPEG_2560_1920 0x0090
323 #define S5C73M3_CHG_MODE_JPEG_3072_1728 0x00A0
324 #define S5C73M3_CHG_MODE_JPEG_3264_2304 0x00B0
325 #define S5C73M3_CHG_MODE_JPEG_3264_1836 0x00C0
326 #define S5C73M3_CHG_MODE_JPEG_3264_2448 0x00D0
327
328
329 #define S5C73M3_AF_CON                  0x0E00
330 #define S5C73M3_AF_CON_STOP             0x0000
331 #define S5C73M3_AF_CON_SCAN             0x0001/*AF_SCAN:Full Search*/
332 #define S5C73M3_AF_CON_START    0x0002/*AF_START:Fast Search*/
333
334 #define S5C73M3_AF_STATUS               0x5E80
335
336 #define S5C73M3_AF_TOUCH_AF             0x0E0A
337
338 #define S5C73M3_AF_CAL                  0x0E06
339
340 #define S5C73M3_CAF_STATUS_FIND_SEARCHING_DIR   0x0001
341 #define S5C73M3_CAF_STATUS_FOCUSING     0x0002
342 #define S5C73M3_CAF_STATUS_FOCUSED      0x0003
343 #define S5C73M3_CAF_STATUS_UNFOCUSED    0x0004
344
345 #define S5C73M3_AF_STATUS_INVALID       0x0010
346 #define S5C73M3_AF_STATUS_FOCUSING      0x0020
347 #define S5C73M3_AF_STATUS_FOCUSED       0x0030/*SUCCESS*/
348 #define S5C73M3_AF_STATUS_UNFOCUSED     0x0040/*FAIL*/
349
350 #define S5C73M3_AF_TOUCH_POSITION       0x5E8E
351
352 #define S5C73M3_AF_FACE_ZOOM    0x0E10
353
354 #define S5C73M3_AF_MODE                 0x0E02
355 #define S5C73M3_AF_MODE_NORMAL          0x0000
356 #define S5C73M3_AF_MODE_MACRO           0x0001
357 #define S5C73M3_AF_MODE_MOVIE_CAF_START 0x0002
358 #define S5C73M3_AF_MODE_MOVIE_CAF_STOP          0x0003
359 #define S5C73M3_AF_MODE_PREVIEW_CAF_START       0x0004
360 #define S5C73M3_AF_MODE_PREVIEW_CAF_STOP        0x0005
361
362 #define S5C73M3_AF_SOFTLANDING          0x0E16
363 #define S5C73M3_AF_SOFTLANDING_ON       0x0000
364
365 #define S5C73M3_FACE_DET                0x0E0C
366 #define S5C73M3_FACE_DET_OFF            0x0000
367 #define S5C73M3_FACE_DET_ON             0x0001
368
369 #define S5C73M3_FACE_DET_OSD            0x0E0E
370 #define S5C73M3_FACE_DET_OSD_OFF        0x0000
371 #define S5C73M3_FACE_DET_OSD_ON         0x0001
372
373 #define S5C73M3_AE_CON          0x0C00
374 #define S5C73M3_AE_STOP         0x0000/*LOCK*/
375 #define S5C73M3_AE_START        0x0001/*UNLOCK*/
376
377 #define S5C73M3_ISO             0x0C02
378 #define S5C73M3_ISO_AUTO        0x0000
379 #define S5C73M3_ISO_100         0x0001
380 #define S5C73M3_ISO_200         0x0002
381 #define S5C73M3_ISO_400         0x0003
382 #define S5C73M3_ISO_800         0x0004
383 #define S5C73M3_ISO_SPORTS      0x0005
384 #define S5C73M3_ISO_NIGHT       0x0006
385 #define S5C73M3_ISO_INDOOR      0x0007
386
387 #define S5C73M3_EV              0x0C04
388 #define S5C73M3_EV_M20          0x0000
389 #define S5C73M3_EV_M15          0x0001
390 #define S5C73M3_EV_M10          0x0002
391 #define S5C73M3_EV_M05          0x0003
392 #define S5C73M3_EV_ZERO         0x0004
393 #define S5C73M3_EV_P05          0x0005
394 #define S5C73M3_EV_P10          0x0006
395 #define S5C73M3_EV_P15          0x0007
396 #define S5C73M3_EV_P20          0x0008
397
398 #define S5C73M3_METER           0x0C06
399 #define S5C73M3_METER_CENTER    0x0000
400 #define S5C73M3_METER_SPOT      0x0001
401 #define S5C73M3_METER_AVERAGE   0x0002
402 #define S5C73M3_METER_SMART     0x0003
403
404 #define S5C73M3_WDR             0x0C08
405 #define S5C73M3_WDR_OFF         0x0000
406 #define S5C73M3_WDR_ON          0x0001
407
408 #define S5C73M3_FLICKER_MODE    0x0C12
409 #define S5C73M3_FLICKER_NONE    0x0000
410 #define S5C73M3_FLICKER_MANUAL_50HZ     0x0001
411 #define S5C73M3_FLICKER_MANUAL_60HZ     0x0002
412 #define S5C73M3_FLICKER_AUTO    0x0003
413 #define S5C73M3_FLICKER_AUTO_50HZ       0x0004
414 #define S5C73M3_FLICKER_AUTO_60HZ       0x0005
415
416 #define S5C73M3_AE_MODE 0x0C1E
417 #define S5C73M3_AUTO_MODE_AE_SET        0x0000
418 #define S5C73M3_FIXED_30FPS     0x0002
419 #define S5C73M3_FIXED_20FPS     0x0003
420 #define S5C73M3_FIXED_15FPS     0x0004
421 #define S5C73M3_FIXED_60FPS     0x0007
422 #define S5C73M3_FIXED_120FPS    0x0008
423 #define S5C73M3_FIXED_7FPS      0x0009
424 #define S5C73M3_FIXED_10FPS     0x000A
425 #define S5C73M3_FIXED_90FPS     0x000B
426 #define S5C73M3_ANTI_SHAKE      0x0013
427
428 #define S5C73M3_SHARPNESS       0x0C14
429 #define S5C73M3_SHARPNESS_0     0x0000
430 #define S5C73M3_SHARPNESS_1     0x0001
431 #define S5C73M3_SHARPNESS_2     0x0002
432 #define S5C73M3_SHARPNESS_M1    0x0003
433 #define S5C73M3_SHARPNESS_M2    0x0004
434
435 #define S5C73M3_SATURATION      0x0C16
436 #define S5C73M3_SATURATION_0    0x0000
437 #define S5C73M3_SATURATION_1    0x0001
438 #define S5C73M3_SATURATION_2    0x0002
439 #define S5C73M3_SATURATION_M1   0x0003
440 #define S5C73M3_SATURATION_M2   0x0004
441
442 #define S5C73M3_CONTRAST        0x0C18
443 #define S5C73M3_CONTRAST_0      0x0000
444 #define S5C73M3_CONTRAST_1      0x0001
445 #define S5C73M3_CONTRAST_2      0x0002
446 #define S5C73M3_CONTRAST_M1     0x0003
447 #define S5C73M3_CONTRAST_M2     0x0004
448
449 #define S5C73M3_SCENE_MODE              0x0C1A
450 #define S5C73M3_SCENE_MODE_NONE         0x0000
451 #define S5C73M3_SCENE_MODE_PORTRAIT     0x0001
452 #define S5C73M3_SCENE_MODE_LANDSCAPE    0x0002
453 #define S5C73M3_SCENE_MODE_SPORTS       0x0003
454 #define S5C73M3_SCENE_MODE_INDOOR       0x0004
455 #define S5C73M3_SCENE_MODE_BEACH        0x0005
456 #define S5C73M3_SCENE_MODE_SUNSET       0x0006
457 #define S5C73M3_SCENE_MODE_DAWN         0x0007
458 #define S5C73M3_SCENE_MODE_FALL         0x0008
459 #define S5C73M3_SCENE_MODE_NIGHT        0x0009
460 #define S5C73M3_SCENE_MODE_AGAINSTLIGHT 0x000A
461 #define S5C73M3_SCENE_MODE_FIRE         0x000B
462 #define S5C73M3_SCENE_MODE_TEXT         0x000C
463 #define S5C73M3_SCENE_MODE_CANDLE       0x000D
464
465 #define S5C73M3_FIREWORK_CAPTURE 0x0C20
466
467 #define S5C73M3_AE_AUTO_BRAKET          0x0B14
468 #define S5C73M3_AE_AUTO_BRAKET_EV05     0x0080
469 #define S5C73M3_AE_AUTO_BRAKET_EV10     0x0100
470 #define S5C73M3_AE_AUTO_BRAKET_EV15     0x0180
471 #define S5C73M3_AE_AUTO_BRAKET_EV20     0x0200
472
473 #define S5C73M3_SENSOR_STREAMING        0x090A
474 #define S5C73M3_SENSOR_STREAMING_OFF    0x0000
475 #define S5C73M3_SENSOR_STREAMING_ON     0x0001
476
477 #define S5C73M3_AWB_MODE                0x0D02
478 #define S5C73M3_AWB_MODE_INCANDESCENT   0x0000
479 #define S5C73M3_AWB_MODE_FLUORESCENT1   0x0001
480 #define S5C73M3_AWB_MODE_FLUORESCENT2   0x0002
481 #define S5C73M3_AWB_MODE_DAYLIGHT       0x0003
482 #define S5C73M3_AWB_MODE_CLOUDY         0x0004
483 #define S5C73M3_AWB_MODE_AUTO           0x0005
484
485 #define S5C73M3_AWB_CON                 0x0D00
486 #define S5C73M3_AWB_STOP                0x0000/*LOCK*/
487 #define S5C73M3_AWB_START               0x0001/*UNLOCK*/
488
489 #define S5C73M3_HYBRID_CAPTURE  0x0996
490
491 #define S5C73M3_STATUS                  0x5080
492
493 #define S5C73M3_I2C_SEQ_STATUS  0x59A6
494 #define SEQ_END_PLL             (1<<0x0)
495 #define SEQ_END_SENSOR          (1<<0x1)
496 #define SEQ_END_GPIO            (1<<0x2)
497 #define SEQ_END_FROM            (1<<0x3)
498 #define SEQ_END_STABLE_AE_AWB   (1<<0x4)
499 #define SEQ_END_READY_I2C_CMD   (1<<0x5)
500
501 #define S5C73M3_I2C_ERR_STATUS          0x599E
502 #define ERR_STATUS_CIS_I2C              (1<<0x0)
503 #define ERR_STATUS_AF_INIT              (1<<0x1)
504 #define ERR_STATUS_CAL_DATA             (1<<0x2)
505 #define ERR_STATUS_FRAME_COUNT          (1<<0x3)
506 #define ERR_STATUS_FROM_INIT            (1<<0x4)
507 #define ERR_STATUS_I2C_CIS_STREAM_OFF   (1<<0x5)
508 #define ERR_STATUS_I2C_N_CMD_OVER       (1<<0x6)
509 #define ERROR_STATUS_I2C_N_CMD_MISMATCH    (1<<0x7)
510 #define ERROR_STATUS_CHECK_BIN_CRC    (1<<0x8)
511 #define ERROR_STATUS_EXCEPTION    (1<<0x9)
512 #define ERROR_STATUS_INIF_INIT_STATE    (0x8)
513
514 /* S5C73M3 Sensor Mode */
515 #define S5C73M3_SYSINIT_MODE    0x0
516 #define S5C73M3_PARMSET_MODE    0x1
517 #define S5C73M3_MONITOR_MODE    0x2
518 #define S5C73M3_STILLCAP_MODE   0x3
519
520 /* Interrupt Factor */
521 #define S5C73M3_INT_SOUND               (1 << 7)
522 #define S5C73M3_INT_LENS_INIT   (1 << 6)
523 #define S5C73M3_INT_FD          (1 << 5)
524 #define S5C73M3_INT_FRAME_SYNC  (1 << 4)
525 #define S5C73M3_INT_CAPTURE     (1 << 3)
526 #define S5C73M3_INT_ZOOM                (1 << 2)
527 #define S5C73M3_INT_AF          (1 << 1)
528 #define S5C73M3_INT_MODE                (1 << 0)
529
530 /* ESD Interrupt */
531 #define S5C73M3_INT_ESD         (1 << 0)
532
533 static const u32 S5C73M3_INIT[] = {
534 0x00500009,
535 0x00545000,
536 0x0F140B08,
537 0x0F140000,
538 0x0F140900,
539 0x0F140403, /*640MHz*/
540 0x00545080,
541 0x0F140002
542 };
543
544 #ifdef CONFIG_VIDEO_S5C73M3_SPI
545 extern int s5c73m3_spi_write(const u8 *addr, const int len, const int txSize);
546 extern int s5c73m3_spi_read(u8 *buf, size_t len, const int rxSize);
547 #endif
548
549 #endif /* __SLP_S5C73M3_H */