upload tizen1.0 source
[kernel/linux-2.6.36.git] / drivers / media / video / s5k4ba.h
1 /* linux/drivers/media/video/s5k4ba.h
2  *
3  * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4  *              http://www.samsung.com/
5  *
6  * Driver for S5K4BA (UXGA camera) from Samsung Electronics
7  * 1/4" 2.0Mp CMOS Image Sensor SoC with an Embedded Image Processor
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 2 as
11  * published by the Free Software Foundation.
12  */
13
14 #define S5K4BA_COMPLETE
15 #ifndef __S5K4BA_H__
16 #define __S5K4BA_H__
17
18 struct s5k4ba_reg {
19         unsigned char addr;
20         unsigned char val;
21 };
22
23 struct s5k4ba_regset_type {
24         unsigned char *regset;
25         int len;
26 };
27
28 /*
29  * Macro
30  */
31 #define REGSET_LENGTH(x)        (sizeof(x)/sizeof(s5k4ba_reg))
32
33 /*
34  * User defined commands
35  */
36 /* S/W defined features for tune */
37 #define REG_DELAY       0xFF00  /* in ms */
38 #define REG_CMD         0xFFFF  /* Followed by command */
39
40 /* Following order should not be changed */
41 enum image_size_s5k4ba {
42         /* This SoC supports upto UXGA (1600*1200) */
43 #if 0
44         QQVGA,  /* 160*120*/
45         QCIF,   /* 176*144 */
46         QVGA,   /* 320*240 */
47         CIF,    /* 352*288 */
48         VGA,    /* 640*480 */
49 #endif
50         SVGA,   /* 800*600 */
51 #if 0
52         HD720P, /* 1280*720 */
53         SXGA,   /* 1280*1024 */
54         UXGA,   /* 1600*1200 */
55 #endif
56 };
57
58 /*
59  * Following values describe controls of camera
60  * in user aspect and must be match with index of s5k4ba_regset[]
61  * These values indicates each controls and should be used
62  * to control each control
63  */
64 enum s5k4ba_control {
65         S5K4BA_INIT,
66         S5K4BA_EV,
67         S5K4BA_AWB,
68         S5K4BA_MWB,
69         S5K4BA_EFFECT,
70         S5K4BA_CONTRAST,
71         S5K4BA_SATURATION,
72         S5K4BA_SHARPNESS,
73 };
74
75 #define S5K4BA_REGSET(x)        {       \
76         .regset = x,                    \
77         .len = sizeof(x)/sizeof(s5k4ba_reg),}
78
79
80 /*
81  * User tuned register setting values
82  */
83 static unsigned char s5k4ba_init_reg[][2] = {
84         {0xfc, 0x07},
85         {0x66, 0x01},    /* Watch Dog Time On */
86         {0xfc, 0x00},
87         {0x00, 0xAA},   /* For EDS Check */
88         {0x21, 0x03},   /* peter0223 */
89         {0xfc, 0x01},
90         {0x04, 0x01},   /* ARM Clock Divider */
91
92         {0xfc, 0x02},
93         {0x30, 0x90},   /* Analog offset */
94         {0x37, 0x0d},   /* Global Gain */
95         {0x2d, 0x48},   /* Double Shutter */
96         {0x60, 0x00},   /* Blank_Adrs */
97
98         {0x45, 0x1e},   /*0e// CDS Timing for Average Sub_Sampling */
99         {0x47, 0x2f},
100         {0x02, 0x0e},   /* ADC Resolution */
101         {0x3d, 0x06},   /* Frame ADLC */
102         {0x4d, 0x08},   /* Doubler Volatage */
103         {0x54, 0x02},   /* Double Shutter */
104         {0x55, 0x1e},   /* Line ADLC */
105         {0x56, 0x30},   /* */
106         {0x59, 0x00},   /* LineADLC offset */
107         {0x5b, 0x08},   /* R_Ref_Ctrl */
108         {0x44, 0x63},   /* CLP_EN */
109         {0x4A, 0x10},   /* Clamp Control */
110         {0x42, 0x02},   /* */
111         {0x43, 0xef},   /* */
112
113         /*========================================================== */
114         /*      Table Set for Sub-Sampling */
115         /*========================================================== */
116         {0xfc, 0x03},
117         {0x2c, 0x00},   /* crcb_sel for Sub-Sampling Table */
118         {0x05, 0x46},   /* Output Image Size Set for Capture */
119         {0x07, 0xb6},
120         {0x0e, 0x04},
121         {0x12, 0x03},
122
123         {0xfc, 0x04},
124         {0x32, 0x04},
125         {0x33, 0xbc},
126
127         {0xfc, 0x04},
128         {0xc5, 0x26},   /* Output Image Size Set for Preview */
129         {0xc7, 0x5e},
130         {0xce, 0x04},
131         {0xd2, 0x04},
132
133         {0xec, 0x06},   /*CrCb sel = YCBYCR(0x06) by jsgood */
134         {0xc0, 0x06},
135         {0xc1, 0x70},
136         {0xc2, 0x02},
137         {0xc3, 0x87},
138
139         {0xfc, 0x07},
140         {0x05, 0x00},
141         {0x06, 0x00},
142         {0x07, 0x8b},
143         {0x08, 0xf5},
144         {0x09, 0x00},
145         {0x0a, 0xb4},
146         {0x0b, 0x00},
147         {0x0c, 0xea},
148         {0x0d, 0x00},
149         {0x0e, 0x40},
150
151         {0xfc, 0x00},
152         {0x70, 0x02},
153
154         /* Jeongyun added still shot cbcr_sel */
155         {0xfc, 0x03},
156         {0x2c, 0x00},
157         {0x5c, 0x00},
158         {0x8c, 0x00},
159         {0xbc, 0x00},
160         {0xfc, 0x04},
161         {0x5c, 0x00},
162
163
164         /*========================================================== */
165         /*      COMMAND SET */
166         /*========================================================== */
167         {0xfc, 0x00},
168         {0x73, 0x21},   /* Frmae AE Enable peter */
169         {0x20, 0x02},   /* Change AWB Mode */
170
171         {0xfc, 0x00},
172         {0x6c, 0xb0},   /* AE target */
173         {0x6d, 0x00},
174
175         {0xfc, 0x20},
176         {0x16, 0x5a},   /* for Prevating AE Hunting */
177
178         {0xfc, 0x00},
179         {0x78, 0x6a},   /* AGC Max */
180         {0xfc, 0x20},
181         {0x16, 0x60},   /* Frame AE Start */
182
183         {0xfc, 0x20},
184         {0x57, 0x18},   /* Stable_Frame_AE */
185         {0x2C, 0x30},   /* For Forbidden Area */
186         {0x2E, 0x00},   /* For Forbidden Area */
187         {0x14, 0x70},
188         {0x01, 0x00},   /* Stepless_Off */
189
190         {0xfc, 0x07},
191         {0x11, 0x02},   /* AWB G Gain offset */
192
193         {0xfc, 0x07},
194         {0x3e, 0x0a},   /* AWB Cut R max */
195
196         {0xfc, 0x01},
197         {0xc8, 0xd0},   /* AWB Y Max e0 */
198         {0xfc, 0x00},
199         {0x3e, 0x20},   /*30 AWB Y_min */
200         {0x3d, 0x10},   /* AWB Y_min Low */
201         {0xfc, 0x22},
202         {0x8c, 0x04},   /* AWB Min Y Weight */
203         {0x8d, 0x16},   /* AWB Max Y Weight */
204
205         {0xfc, 0x00},
206         {0x32, 0x04},   /* AWB moving average 8 frame */
207         {0x81, 0x10},   /* AWB G gain suppress Disable */
208         {0xbc, 0xf0},
209
210         {0x29, 0x04},   /* Y level H */
211         {0x2a, 0x00},   /* Y level L */
212         {0x2b, 0x03},   /* color level H */
213         {0x2c, 0xc8},   /* color level L */
214
215         {0xfc, 0x07},
216         {0x37, 0x00},   /* Flicker Add for 32Mhz */
217         {0xfc, 0x00},
218         {0x72, 0xa0},   /* Flicker for 32MHz */
219         {0x74, 0x08},   /* flicker 60Hz Fix */
220
221         {0xfc, 0x20},
222         {0x02, 0x02},   /* Flicker Dgain Mode */
223
224         {0xfc, 0x00},
225         /*{0x23, 0x40},  // Mirror Option */
226         {0x62, 0x0a},   /* Mirror Option */
227
228         {0xfc, 0x02},
229         {0x4e, 0x00},   /* IO current 8mA set */
230         {0x4e, 0x00},   /* IO current 8mA set */
231         {0x4e, 0x00},   /* IO current 8mA set */
232         {0x4e, 0x00},   /* IO current 8mA set */
233         {0x4f, 0x0a},   /* 2a IO current 48mA set */
234         {0x4f, 0x0a},   /* IO current 48mA set */
235         {0x4f, 0x0a},   /* IO current 48mA set */
236         {0x4f, 0x0a},   /* IO current 48mA set */
237
238         {0xfc, 0x01},
239         {0x0c, 0x03},   /* Full YC Enable */
240         /*{0x0c,03},    // Full YC Enable */
241         /*{0x02,02},    // crcb_sel */
242         /*{0x02,02},    // crcb_sel  peter0222 */
243         /*{0x01,01},    // pclk      peter0222 */
244         /*{0x01,01}, */
245
246         /*========================================================== */
247         /*      COLOR MATRIX */
248         /*========================================================== */
249         {0xfc, 0x01},   /* color matrix */
250         {0x51, 0x0A},
251         {0x52, 0x42},
252         {0x53, 0xF9},
253         {0x54, 0x80},
254         {0x55, 0x00},
255         {0x56, 0x3D},
256
257         {0x57, 0xFE},
258         {0x58, 0x0B},
259         {0x59, 0x06},
260         {0x5A, 0x9C},
261         {0x5B, 0xFF},
262         {0x5C, 0x59},
263
264         {0x5D, 0xFF},
265         {0x5E, 0xD8},
266         {0x5F, 0xFC},
267         {0x60, 0x2E},
268         {0x61, 0x07},
269         {0x62, 0xFA},
270
271         /*========================================================== */
272         /*      EDGE ENHANCEMENT */
273         /*========================================================== */
274         {0xfc, 0x00},
275         {0x89, 0x03},   /* Edge Suppress On */
276         {0xfc, 0x0b},
277         {0x42, 0x50},   /* Edge AGC MIN */
278         {0x43, 0x60},   /* Edge AGC MAX */
279         {0x45, 0x18},   /* positive gain AGC MIN */
280         {0x49, 0x0a},   /* positive gain AGC MAX */
281         {0x4d, 0x18},   /* negative gain AGC MIN */
282         {0x51, 0x0a},   /* negative gain AGC MAX */
283
284         {0xfc, 0x05},
285         {0x34, 0x20},   /* APTCLP */
286         {0x35, 0x09},   /* APTSC */
287         {0x36, 0x0b},   /* ENHANCE */
288         {0x3f, 0x00},   /* NON-LIN */
289         {0x42, 0x10},   /* EGFALL */
290         {0x43, 0x00},   /* HLFALL */
291         {0x45, 0xa0},   /* EGREF */
292         {0x46, 0x7a},   /* HLREF */
293         {0x47, 0x40},   /* LLREF */
294         {0x48, 0x0c},
295         {0x49, 0x31},   /* CSSEL  EGSEL  CS_DLY */
296
297         {0x40, 0x41},   /* Y delay */
298
299         /*========================================================== */
300         /*      GAMMA */
301         /*========================================================== */
302         {0xfc, 0x01},
303
304         {0x6F, 0x0A},   /* R */
305         {0x70, 0x1A},
306         {0x71, 0x7A},
307         {0x72, 0xF8},
308         {0x73, 0x00},
309
310         {0x74, 0xA0},
311         {0x75, 0x18},
312         {0x76, 0x65},
313         {0x77, 0xAD},
314         {0x78, 0x6A},
315
316         {0x79, 0xE2},
317         {0x7A, 0x12},
318         {0x7B, 0x3D},
319         {0x7C, 0x5A},
320         {0x7D, 0xBF},
321
322         {0x7E, 0x72},
323         {0x7F, 0x88},
324         {0x80, 0x9D},
325         {0x81, 0xB0},
326         {0x82, 0xFF},
327
328         {0x83, 0xC0},
329         {0x84, 0xCF},
330         {0x85, 0xDA},
331         {0x86, 0xFC},
332
333         {0x87, 0x08},   /*G */
334         {0x88, 0x12},
335         {0x89, 0x42},
336         {0x8A, 0xBA},
337         {0x8B, 0x00},
338
339         {0x8C, 0x75},
340         {0x8D, 0xED},
341         {0x8E, 0x42},
342         {0x8F, 0x80},
343         {0x90, 0x5A},
344
345         {0x91, 0xB5},
346         {0x92, 0xE5},
347         {0x93, 0x10},
348         {0x94, 0x35},
349         {0x95, 0xAF},
350
351         {0x96, 0x55},
352         {0x97, 0x70},
353         {0x98, 0x88},
354         {0x99, 0x9D},
355         {0x9A, 0xFF},
356
357         {0x9B, 0xB1},
358         {0x9C, 0xC4},
359         {0x9D, 0xD5},
360         {0x9E, 0xFC},
361
362         {0x9F, 0x05},   /*B */
363         {0xA0, 0x18},
364         {0xA1, 0x42},
365         {0xA2, 0xd7},
366         {0xA3, 0x00},
367
368         {0xA4, 0xB6},
369         {0xA5, 0x3b},
370         {0xA6, 0x88},
371         {0xA7, 0xC8},
372         {0xA8, 0x6A},
373
374         {0xA9, 0x00},
375         {0xAA, 0x30},
376         {0xAB, 0x58},
377         {0xAC, 0x78},
378         {0xAD, 0xFF},
379
380         {0xAE, 0x90},
381         {0xAF, 0xA5},
382         {0xB0, 0xB6},
383         {0xB1, 0xC5},
384         {0xB2, 0xFF},
385
386         {0xB3, 0xD0},
387         {0xB4, 0xD6},
388         {0xB5, 0xDA},
389         {0xB6, 0xFC},
390
391         /*========================================================== */
392         /*      HUE CONTROL */
393         /*========================================================== */
394         {0xfc, 0x00},
395         {0x48, 0x34},   /* 2000K */
396         {0x49, 0x34},
397         {0x4a, 0xf4},
398         {0x4b, 0x00},
399         {0x4c, 0x44},
400         {0x4d, 0x3c},
401         {0x4e, 0xf0},
402         {0x4f, 0x0c},
403
404         {0x50, 0x34},   /* 3000K */
405         {0x51, 0x34},
406         {0x52, 0xf4},
407         {0x53, 0x00},
408         {0x54, 0x44},
409         {0x55, 0x3c},
410         {0x56, 0xf0},
411         {0x57, 0x0c},
412
413         {0x58, 0x34},   /* 5100K */
414         {0x59, 0x30},
415         {0x5a, 0x00},
416         {0x5b, 0x04},
417         {0x5c, 0x40},
418         {0x5d, 0x2c},
419         {0x5e, 0xfc},
420         {0x5f, 0x04},
421         /*========================================================== */
422         /*      UPPRE0x0x FUNCTION */
423         /*========================================================== */
424         {0xfc, 0x00},
425         {0x7e, 0xf4},
426
427         /*========================================================== */
428         /*      BPR */
429         /*========================================================== */
430         {0xfc, 0x01},
431         {0x3d, 0x10},
432
433         {0xfc, 0x0b},
434         {0x0b, 0x00},   /* ISP BPR On start */
435         {0x0c, 0x20},   /* Th13 AGC Min */
436         {0x0d, 0x40},   /* Th13 AGC Max */
437         {0x0e, 0x00},   /* Th1 Max H for AGCMIN */
438         {0x0f, 0x20},   /* Th1 Max L for AGCMIN */
439         {0x10, 0x00},   /* Th1 Min H for AGCMAX */
440         {0x11, 0x10},   /* Th1 Min L for AGCMAX */
441         {0x12, 0x00},   /* Th3 Max H for AGCMIN */
442         {0x13, 0x00},   /* Th3 Max L for AGCMIN */
443         {0x14, 0xff},   /* Th3 Min H for AGCMAX */
444         {0x15, 0xff},   /* Th3 Min L for AGCMAX */
445         {0x16, 0x20},   /* Th57 AGC Min */
446         {0x17, 0x40},   /* Th57 AGC Max */
447         {0x18, 0x00},   /* Th5 Max H for AGCMIN */
448         {0x19, 0x00},   /* Th5 Max L for AGCMIN */
449         {0x1a, 0x00},   /* Th5 Min H for AGCMAX */
450         {0x1b, 0x20},   /* Th5 Min L for AGCMAX */
451         {0x1c, 0x00},   /* Th7 Max H for AGCMIN */
452         {0x1d, 0x00},   /* Th7 Max L for AGCMIN */
453         {0x1e, 0x00},   /* Th7 Min H for AGCMAX */
454         {0x1f, 0x20},   /* Th7 Min L for AGCMAX */
455
456         /*========================================================== */
457         /*      GR/GB CORRECTION */
458         /*========================================================== */
459         {0xfc, 0x01},
460         {0x45, 0x0c},
461
462         {0xfc, 0x0b},
463         {0x21, 0x00},   /* start AGC */
464         {0x22, 0x18},   /* AGCMIN */
465         {0x23, 0x58},   /* AGCMAX */
466         {0x24, 0x0d},   /* G Th AGCMIN */
467         {0x25, 0x30},   /* G Th AGCMAX */
468         {0x26, 0x0d},   /* RB Th AGCMIN */
469         {0x27, 0x30},   /* RB Th AGCMAX */
470
471         /*========================================================== */
472         /*      NR */
473         /*========================================================== */
474         {0xfc, 0x01},
475         {0x4C, 0x01},   /* NR Enable */
476         {0x49, 0x15},   /* Sig_Th Mult */
477         {0x4B, 0x0A},   /* Pre_Th Mult */
478
479         {0xfc, 0x0b},
480         {0x28, 0x00},   /* NR start AGC  */
481         {0x29, 0x00},   /* SIG Th AGCMIN H */
482         {0x2a, 0x14},   /* SIG Th AGCMIN L */
483         {0x2b, 0x00},   /* SIG Th AGCMAX H */
484         {0x2c, 0x14},   /* SIG Th AGCMAX L */
485         {0x2d, 0x00},   /* PRE Th AGCMIN H */
486         {0x2e, 0x90},   /* PRE Th AGCMIN L */
487         {0x2f, 0x01},   /* PRE Th AGCMAX H */
488         {0x30, 0x00},   /* PRE Th AGCMAX L */
489         {0x31, 0x00},   /* POST Th AGCMIN H */
490         {0x32, 0xa0},   /* POST Th AGCMIN L */
491         {0x33, 0x01},   /* POST Th AGCMAX H */
492         {0x34, 0x10},   /* POST Th AGCMAX L */
493
494         /*========================================================== */
495         /*      1D-Y/C-SIGMA-LPF */
496         /*========================================================== */
497         {0xfc, 0x01},
498         {0x05, 0xc0},
499
500         {0xfc, 0x0b},
501         {0x35, 0x00},   /* YLPF start AGC */
502         {0x36, 0x40},   /* YLPF01 AGCMIN */
503         {0x37, 0x60},   /* YLPF01 AGCMAX */
504         {0x38, 0x00},   /* YLPF SIG01 Th AGCMINH */
505         {0x39, 0x18},   /* YLPF SIG01 Th AGCMINL */
506         {0x3a, 0x00},   /* YLPF SIG01 Th AGCMAXH */
507         {0x3b, 0x40},   /* YLPF SIG01 Th AGCMAXH */
508         {0x3c, 0x50},   /* YLPF02 AGCMIN */
509         {0x3d, 0x60},   /* YLPF02 AGCMAX */
510         {0x3e, 0x00},   /* YLPF SIG02 Th AGCMINH */
511         {0x3f, 0x30},   /* YLPF SIG02 Th AGCMINL */
512         {0x40, 0x00},   /* YLPF SIG02 Th AGCMAXH */
513         {0x41, 0x40},   /* YLPF SIG02 Th AGCMAXH */
514         {0xd4, 0x40},   /* CLPF AGCMIN */
515         {0xd5, 0x60},   /* CLPF AGCMAX */
516         {0xd6, 0xb0},   /* CLPF SIG01 Th AGCMIN */
517         {0xd7, 0xf0},   /* CLPF SIG01 Th AGCMAX */
518         {0xd8, 0xb0},   /* CLPF SIG02 Th AGCMIN */
519         {0xd9, 0xf0},   /* CLPF SIG02 Th AGCMAX */
520
521         /*========================================================== */
522         /*      COLOR SUPPRESS */
523         /*========================================================== */
524         {0xfc, 0x0b},
525         {0x08, 0x58},   /* Color suppress AGC MIN */
526         {0x09, 0x03},   /* Color suppress MIN H */
527         {0x0a, 0x80},   /* Color suppress MIN L */
528
529         /*========================================================== */
530         /*      SHADING */
531         /*========================================================== */
532         {0xfc, 0x09},
533          /*Shading file for 3BAFX */
534         /*s90000// shading off */
535         /* DSP9_SH_WIDTH_H */
536         {0x01, 0x06},
537         {0x02, 0x40},
538         /* DSP9_SH_HEIGHT_H */
539         {0x03, 0x04},
540         {0x04, 0xB0},
541         /* DSP9_SH_XCH_R */
542         {0x05, 0x03},
543         {0x06, 0x1A},
544         {0x07, 0x02},
545         {0x08, 0x4E},
546         /* DSP9_SH_XCH_G */
547         {0x09, 0x03},
548         {0x0A, 0x27},
549         {0x0B, 0x02},
550         {0x0C, 0x11},
551         /* DSP9_SH_XCH_B */
552         {0x0D, 0x03},
553         {0x0E, 0x15},
554         {0x0F, 0x01},
555         {0x10, 0xE3},
556         /* DSP9_SH_Del_eH_R */
557         {0x1D, 0x85},
558         {0x1E, 0x55},
559         {0x1F, 0x77},
560         {0x20, 0x9E},
561         {0x23, 0x7F},
562         {0x24, 0xE6},
563         {0x21, 0x7F},
564         {0x22, 0xE6},
565         /* DSP9_SH_Del_eH_G */
566         {0x25, 0x82},
567         {0x26, 0x9A},
568         {0x27, 0x78},
569         {0x28, 0xC0},
570         {0x2B, 0x76},
571         {0x2C, 0x07},
572         {0x29, 0x86},
573         {0x2A, 0x09},
574         /* DSP9_SH_Del_eH_B */
575         {0x2D, 0x85},
576         {0x2E, 0x55},
577         {0x2F, 0x75},
578         {0x30, 0x6D},
579         {0x33, 0x74},
580         {0x34, 0xA2},
581         {0x31, 0x84},
582         {0x32, 0xA2},
583         /* DSP9_SH_VAL_R0H */
584         {0x35, 0x01},
585         {0x36, 0x01},
586         {0x37, 0x01},
587         {0x38, 0x14},
588         {0x39, 0x01},
589         {0x3A, 0x45},
590         {0x3B, 0x01},
591         {0x3C, 0x8A},
592         {0x3D, 0x01},
593         {0x3E, 0xA3},
594         {0x3F, 0x01},
595         {0x40, 0xB9},
596         {0x41, 0x01},
597         {0x42, 0xD9},
598         {0x43, 0x01},
599         {0x44, 0xF6},
600         /* DSP9_SH_VAL_G0H */
601         {0x45, 0x01},
602         {0x46, 0x00},
603         {0x47, 0x01},
604         {0x48, 0x0E},
605         {0x49, 0x01},
606         {0x4A, 0x34},
607         {0x4B, 0x01},
608         {0x4C, 0x68},
609         {0x4D, 0x01},
610         {0x4E, 0x76},
611         {0x4F, 0x01},
612         {0x50, 0x94},
613         {0x51, 0x01},
614         {0x52, 0xAB},
615         {0x53, 0x01},
616         {0x54, 0xC3},
617         /* DSP9_SH_VAL_B0H */
618         {0x55, 0x01},
619         {0x56, 0x00},
620         {0x57, 0x01},
621         {0x58, 0x0C},
622         {0x59, 0x01},
623         {0x5A, 0x2B},
624         {0x5B, 0x01},
625         {0x5C, 0x5D},
626         {0x5D, 0x01},
627         {0x5E, 0x70},
628         {0x5F, 0x01},
629         {0x60, 0x8A},
630         {0x61, 0x01},
631         {0x62, 0xA1},
632         {0x63, 0x01},
633         {0x64, 0xB3},
634         /* DSP9_SH_M_R2_R1H */
635         {0x65, 0x00},
636         {0x66, 0x98},
637         {0x67, 0x2C},
638         {0x68, 0x02},
639         {0x69, 0x60},
640         {0x6A, 0xB0},
641         {0x6B, 0x05},
642         {0x6C, 0x59},
643         {0x6D, 0x8C},
644         {0x6E, 0x07},
645         {0x6F, 0x48},
646         {0x70, 0x1B},
647         {0x71, 0x09},
648         {0x72, 0x82},
649         {0x73, 0xC0},
650         {0x74, 0x0C},
651         {0x75, 0x09},
652         {0x76, 0x7B},
653         {0x77, 0x0E},
654         {0x78, 0xDC},
655         {0x79, 0x4D},
656         /* DSP9_SH_M_R2_G1H */
657         {0x7A, 0x00},
658         {0x7B, 0xAD},
659         {0x7C, 0x76},
660         {0x7D, 0x02},
661         {0x7E, 0xB5},
662         {0x7F, 0xD7},
663         {0x80, 0x06},
664         {0x81, 0x19},
665         {0x82, 0x23},
666         {0x83, 0x08},
667         {0x84, 0x4C},
668         {0x85, 0xE2},
669         {0x86, 0x0A},
670         {0x87, 0xD7},
671         {0x88, 0x5C},
672         {0x89, 0x0D},
673         {0x8A, 0xB8},
674         {0x8B, 0x90},
675         {0x8C, 0x10},
676         {0x8D, 0xF0},
677         {0x8E, 0x7F},
678         /* DSP9_SH_M_R2_B1H */
679         {0x8F, 0x00},
680         {0x90, 0xC1},
681         {0x91, 0xD0},
682         {0x92, 0x03},
683         {0x93, 0x07},
684         {0x94, 0x3F},
685         {0x95, 0x06},
686         {0x96, 0xD0},
687         {0x97, 0x4F},
688         {0x98, 0x09},
689         {0x99, 0x46},
690         {0x9A, 0x32},
691         {0x9B, 0x0C},
692         {0x9C, 0x1C},
693         {0x9D, 0xFE},
694         {0x9E, 0x0F},
695         {0x9F, 0x54},
696         {0xA0, 0xB1},
697         {0xA1, 0x12},
698         {0xA2, 0xED},
699         {0xA3, 0x4C},
700         /* DSP9_SH_SUB_RR0H */
701         {0xA4, 0x6B},
702         {0xA5, 0xAA},
703         {0xA6, 0x23},
704         {0xA7, 0xE3},
705         {0xA8, 0x15},
706         {0xA9, 0x88},
707         {0xAA, 0x21},
708         {0xAB, 0x20},
709         {0xAC, 0x1C},
710         {0xAD, 0xB6},
711         {0xAE, 0x19},
712         {0xAF, 0x55},
713         {0xB0, 0x16},
714         {0xB1, 0xAA},
715         /* DSP9_SH_SUB_RG0H */
716         {0xB2, 0x5E},
717         {0xB3, 0x74},
718         {0xB4, 0x1F},
719         {0xB5, 0x7C},
720         {0xB6, 0x12},
721         {0xB7, 0xE4},
722         {0xB8, 0x1D},
723         {0xB9, 0x10},
724         {0xBA, 0x19},
725         {0xBB, 0x30},
726         {0xBC, 0x16},
727         {0xBD, 0x39},
728         {0xBE, 0x13},
729         {0xBF, 0xE2},
730         /* DSP9_SH_SUB_RB0H */
731         {0xC0, 0x54},
732         {0xC1, 0x89},
733         {0xC2, 0x1C},
734         {0xC3, 0x2D},
735         {0xC4, 0x10},
736         {0xC5, 0xE8},
737         {0xC6, 0x1A},
738         {0xC7, 0x02},
739         {0xC8, 0x16},
740         {0xC9, 0x8A},
741         {0xCA, 0x13},
742         {0xCB, 0xE4},
743         {0xCC, 0x11},
744         {0xCD, 0xCC},
745
746         {0x00, 0x02},  /* {0xhading on */
747
748         /*========================================================== */
749         /*      X-SHADING */
750         /*========================================================== */
751         {0xfc, 0x1B},
752         {0x80, 0x01},
753         {0x81, 0x00},
754         {0x82, 0x4C},
755         {0x83, 0x00},
756         {0x84, 0x86},
757         {0x85, 0x03},
758         {0x86, 0x5E},
759         {0x87, 0x00},
760         {0x88, 0x07},
761         {0x89, 0xA4},
762         {0x90, 0x00},
763         {0x91, 0x12},
764         {0x92, 0x00},
765         {0x93, 0x12},
766         {0x94, 0x00},
767         {0x95, 0x12},
768         {0x96, 0x00},
769         {0x97, 0x12},
770         {0x98, 0x00},
771         {0x99, 0x12},
772         {0x9A, 0x00},
773         {0x9B, 0x12},
774         {0x9C, 0x00},
775         {0x9D, 0x12},
776         {0x9E, 0x00},
777         {0x9F, 0x12},
778         {0xA0, 0x00},
779         {0xA1, 0x12},
780         {0xA2, 0x00},
781         {0xA3, 0x12},
782         {0xA4, 0x00},
783         {0xA5, 0x12},
784         {0xA6, 0x00},
785         {0xA7, 0x12},
786         {0xA8, 0x00},
787         {0xA9, 0x12},
788         {0xAA, 0x00},
789         {0xAB, 0x12},
790         {0xAC, 0x00},
791         {0xAD, 0x12},
792         {0xAE, 0x00},
793         {0xAF, 0x12},
794         {0xB0, 0x00},
795         {0xB1, 0x12},
796         {0xB2, 0x00},
797         {0xB3, 0x12},
798         {0xB4, 0x00},
799         {0xB5, 0x12},
800         {0xB6, 0x00},
801         {0xB7, 0x15},
802         {0xB8, 0x00},
803         {0xB9, 0x12},
804         {0xBA, 0x00},
805         {0xBB, 0x12},
806         {0xBC, 0x00},
807         {0xBD, 0x12},
808         {0xBE, 0x00},
809         {0xBF, 0x12},
810         {0xC0, 0x00},
811         {0xC1, 0x12},
812         {0xC2, 0x00},
813         {0xC3, 0x12},
814         {0xC4, 0x00},
815         {0xC5, 0x12},
816         {0xC6, 0x00},
817         {0xC7, 0x12},
818         {0xC8, 0x00},
819         {0xC9, 0x12},
820         {0xCA, 0x00},
821         {0xCB, 0x12},
822         {0xCC, 0x00},
823         {0xCD, 0x12},
824         {0xCE, 0x00},
825         {0xCF, 0x12},
826         {0xD0, 0x00},
827         {0xD1, 0x12},
828         {0xD2, 0x00},
829         {0xD3, 0x12},
830         {0xD4, 0x00},
831         {0xD5, 0x12},
832                  /* x-shading temp. correlation factor */
833         {0xfc, 0x0b},
834         {0xda, 0x00},   /* t0(3100K) */
835         {0xdb, 0xac},
836         {0xdc, 0x01},   /* tc(5100K) */
837         {0xdd, 0x30},   /* default eeh */
838
839         {0xfc, 0x00},
840         {0x81, 0x10},   /* xshading tem */
841
842         {0xfc, 0x1b},
843         {0x80, 0x01},   /* X-Shading On */
844
845         /*========================================================== */
846         /*      AE WINDOW WEIGHT */
847         /*========================================================== */
848         {0xfc, 0x00},
849         {0x03, 0x4b},   /* AE Suppress On */
850
851         {0xfc, 0x06},
852         {0x01, 0x35},   /* UXGA AE Window */
853         {0x03, 0xc2},
854         {0x05, 0x48},
855         {0x07, 0xb8},
856         {0x31, 0x2a},   /* Subsampling AE Window */
857         {0x33, 0x61},
858         {0x35, 0x28},
859         {0x37, 0x5c},
860         {0x39, 0x28},
861         {0x3B, 0x5A},
862         {0x3D, 0x10},   /* 1c */
863         {0x3F, 0x44},
864
865         {0xfc, 0x20},
866         {0x60, 0x11},
867         {0x61, 0x11},
868         {0x62, 0x11},
869         {0x63, 0x11},
870         {0x64, 0x11},
871         {0x65, 0x22},
872         {0x66, 0x22},
873         {0x67, 0x11},
874         {0x68, 0x11},
875         {0x69, 0x33},
876         {0x6a, 0x33},
877         {0x6b, 0x11},
878         {0x6c, 0x12},
879         {0x6d, 0x55},
880         {0x6e, 0x55},
881         {0x6f, 0x21},
882         {0x70, 0x13},
883         {0x71, 0x55},
884         {0x72, 0x55},
885         {0x73, 0x31},
886         {0x74, 0x33},
887         {0x75, 0x33},
888         {0x76, 0x33},
889         {0x77, 0x33},
890
891         /*========================================================== */
892         /*      SAIT AWB */
893         /*========================================================== */
894         /*================================= */
895         /* White Point */
896         /*================================= */
897         {0xfc, 0x22},   /* White Point (For Hue Control & MWB) */
898         {0x01, 0xD0},   /* D65 */
899         {0x03, 0x9B},
900         {0x05, 0xC0},   /* 5000K */
901         {0x07, 0xB8},
902         {0x09, 0xA7},   /* CWF */
903         {0x0b, 0xDC},
904         {0x0d, 0x98},   /* 3000K */
905         {0x0f, 0xE0},
906         {0x11, 0x85},   /* A */
907         {0x12, 0x00},
908         {0x13, 0xF6},
909         {0x15, 0x80},   /* 2000K */
910         {0x16, 0x01},
911         {0x17, 0x00},
912
913         /*================================= */
914         /* Basic Setting */
915         /*================================= */
916         {0xfc, 0x22},
917         {0xA0, 0x01},
918         {0xA1, 0x3F},
919         {0xA2, 0x0E},
920         {0xA3, 0x65},
921         {0xA4, 0x07},
922         {0xA5, 0xF4},
923         {0xA6, 0x11},
924         {0xA7, 0xC8},
925         {0xA9, 0x02},
926         {0xAA, 0x43},
927         {0xAB, 0x26},
928         {0xAC, 0x1F},
929         {0xAD, 0x02},
930         {0xAE, 0x2C},
931         {0xAF, 0x19},
932         {0xB0, 0x0F},
933
934         {0x94, 0x3C},
935         {0x95, 0xCC},
936         {0x96, 0x5C},
937         {0x97, 0x4D},
938         {0xD0, 0xA8},
939         {0xD1, 0x29},
940         {0xD2, 0x39},
941         {0xD3, 0x22},
942         {0xD4, 0x30},
943         {0xDB, 0x29},
944         {0xDC, 0x7E},
945         {0xDD, 0x22},
946
947         {0xE7, 0x00},
948         {0xE8, 0xca},
949         {0xE9, 0x00},
950         {0xEA, 0x62},
951         {0xEB, 0x00},
952         {0xEC, 0x00},
953         {0xEE, 0x97},
954
955         /*================================= */
956         /* Pixel Filter Setting */
957         /*================================= */
958         {0xFC, 0x07},
959         {0x95, 0x8F},
960
961         {0xfc, 0x01},
962         {0xD3, 0x4B},
963         {0xD4, 0x00},
964         {0xD5, 0x38},
965         {0xD6, 0x00},
966         {0xD7, 0x60},
967         {0xD8, 0x00},
968         {0xD9, 0x4E},
969         {0xDA, 0x00},
970         {0xDB, 0x27},
971         {0xDC, 0x15},
972         {0xDD, 0x23},
973         {0xDE, 0xAD},
974         {0xDF, 0x24},
975         {0xE0, 0x01},
976         {0xE1, 0x17},
977         {0xE2, 0x4A},
978         {0xE3, 0x36},
979         {0xE4, 0x40},
980         {0xE5, 0x40},
981         {0xE6, 0x40},
982         {0xE7, 0x40},
983         {0xE8, 0x30},
984         {0xE9, 0x3D},
985         {0xEA, 0x17},
986         {0xEB, 0x01},
987
988         /*================================= */
989         /* Polygon AWB Region Tune */
990         /*================================= */
991         {0xfc, 0x22},
992         {0x18, 0x00},   /* 1 */
993         {0x19, 0x5a},
994         {0x1a, 0xf8},
995         {0x1b, 0x00},   /* 2 */
996         {0x1c, 0x59},
997         {0x1d, 0xCC},
998         {0x1e, 0x00},   /* 3 */
999         {0x1f, 0x74},
1000         {0x20, 0xB3},
1001         {0x21, 0x00},   /* 4 */
1002         {0x22, 0x86},
1003         {0x23, 0xA2},
1004         {0x24, 0x00},   /* 5 */
1005         {0x25, 0x94},
1006         {0x26, 0x89},
1007         {0x27, 0x00},   /* 6 */
1008         {0x28, 0xA6},
1009         {0x29, 0x76},
1010         {0x2A, 0x00},   /* 7 */
1011         {0x2B, 0xd0},
1012         {0x2C, 0x5e},
1013         {0x2D, 0x00},   /* 8 */
1014         {0x2E, 0xfa},
1015         {0x2F, 0x47},
1016         {0x30, 0x00},   /* 9 */
1017         {0x31, 0xfD},
1018         {0x32, 0x5D},
1019         {0x33, 0x00},   /* 10 */
1020         {0x34, 0xBB},
1021         {0x35, 0x7c},
1022         {0x36, 0x00},   /* 11 */
1023         {0x37, 0xAD},
1024         {0x38, 0x88},
1025         {0x39, 0x00},   /* 12 */
1026         {0x3A, 0x9A},
1027         {0x3B, 0xA3},
1028         {0x3C, 0x00},   /* 13 */
1029         {0x3D, 0x7C},
1030         {0x3E, 0xDD},
1031         {0x3F, 0x00},   /* 14 */
1032         {0x40, 0x00},
1033         {0x41, 0x00},
1034
1035         /*================================= */
1036         /* Moving Equation Weight */
1037         /*================================= */
1038         {0xfc, 0x22},
1039         {0x98, 0x07},
1040
1041         /*================================= */
1042         /* EIT Threshold */
1043         /*================================= */
1044         {0xfc, 0x22},
1045         {0xb1, 0x00},   /* {0xunny */
1046         {0xb2, 0x03},
1047         {0xb3, 0x00},
1048         {0xb4, 0xc1},
1049
1050         {0xb5, 0x00},   /* Cloudy */
1051         {0xb6, 0x05},
1052         {0xb7, 0xc9},
1053         {0xb9, 0x81},
1054
1055         {0xd7, 0x00},   /* Shade */
1056         {0xd8, 0x35},
1057         {0xd9, 0x20},
1058         {0xda, 0x81},
1059
1060         /*================================= */
1061         /* Gain Offset */
1062         /*================================= */
1063         {0xfc, 0x00},
1064         {0x79, 0xF9},
1065         {0x7A, 0x02},   /* Global AWB gain off{0xet */
1066
1067         {0xfc, 0x22},
1068         {0x58, 0xf6},   /* D65 R Off{0xet */
1069         {0x59, 0xff},   /* D65 B Off{0xet */
1070         {0x5A, 0xfa},   /* 5000K R Off{0xet */
1071         {0x5B, 0xFe},   /* 5000K B Off{0xet */
1072         {0x5C, 0xfb},   /* CWF R Off{0xet */
1073         {0x5D, 0xFe},   /* CWF B Off{0xet */
1074         {0x5E, 0xfb},   /* 3000K R Off{0xet */
1075         {0x5F, 0xFb},   /* 3000K B Off{0xet */
1076         {0x60, 0xfb},   /* A R Off0xet */
1077         {0x61, 0xfb},   /* A B Off0xet */
1078         {0x62, 0xfb},   /* 2000K R Off0xet */
1079         {0x63, 0xfb},   /* 2000K B Off0xet */
1080
1081         {0xde, 0x00},   /* LARGE OBJECT BUG FIX */
1082         {0xf0, 0x6a},   /* RB Ratio */
1083         /*================================= */
1084         /* Green Stablity Enhance */
1085         /*================================= */
1086         {0xfc, 0x22},
1087         {0xb9, 0x00},
1088         {0xba, 0x00},
1089         {0xbb, 0x00},
1090         {0xbc, 0x00},
1091         {0xe5, 0x01},
1092         {0xe6, 0xff},
1093
1094         {0xbd, 0x90},
1095
1096         /*========================================================== */
1097         /*      Special Effect */
1098         /*========================================================== */
1099         {0xfc, 0x07},   /* Special Effect */
1100         {0x30, 0xc0},
1101         {0x31, 0x20},
1102         {0x32, 0x40},
1103         {0x33, 0xc0},
1104         {0x34, 0x00},
1105         {0x35, 0xb0},
1106
1107         {0xfc, 0x00},
1108         {0x73, 0x21},   /* Frame AE Enable */
1109
1110         {0xfc, 0x04},
1111         {0xc0, 0x06},
1112         {0xc1, 0x70},
1113         {0xFF, 0xFF}    /* REGISTER END */
1114 };
1115
1116 #define S5K4BA_INIT_REGS        \
1117         (sizeof(s5k4ba_init_reg) / sizeof(s5k4ba_init_reg[0]))
1118
1119 /*
1120  * EV bias
1121  */
1122
1123 static const struct s5k4ba_reg s5k4ba_ev_m6[] = {
1124 };
1125
1126 static const struct s5k4ba_reg s5k4ba_ev_m5[] = {
1127 };
1128
1129 static const struct s5k4ba_reg s5k4ba_ev_m4[] = {
1130 };
1131
1132 static const struct s5k4ba_reg s5k4ba_ev_m3[] = {
1133 };
1134
1135 static const struct s5k4ba_reg s5k4ba_ev_m2[] = {
1136 };
1137
1138 static const struct s5k4ba_reg s5k4ba_ev_m1[] = {
1139 };
1140
1141 static const struct s5k4ba_reg s5k4ba_ev_default[] = {
1142 };
1143
1144 static const struct s5k4ba_reg s5k4ba_ev_p1[] = {
1145 };
1146
1147 static const struct s5k4ba_reg s5k4ba_ev_p2[] = {
1148 };
1149
1150 static const struct s5k4ba_reg s5k4ba_ev_p3[] = {
1151 };
1152
1153 static const struct s5k4ba_reg s5k4ba_ev_p4[] = {
1154 };
1155
1156 static const struct s5k4ba_reg s5k4ba_ev_p5[] = {
1157 };
1158
1159 static const struct s5k4ba_reg s5k4ba_ev_p6[] = {
1160 };
1161
1162 #ifdef S5K4BA_COMPLETE
1163 /* Order of this array should be following the querymenu data */
1164 static const unsigned char *s5k4ba_regs_ev_bias[] = {
1165         (unsigned char *)s5k4ba_ev_m6, (unsigned char *)s5k4ba_ev_m5,
1166         (unsigned char *)s5k4ba_ev_m4, (unsigned char *)s5k4ba_ev_m3,
1167         (unsigned char *)s5k4ba_ev_m2, (unsigned char *)s5k4ba_ev_m1,
1168         (unsigned char *)s5k4ba_ev_default, (unsigned char *)s5k4ba_ev_p1,
1169         (unsigned char *)s5k4ba_ev_p2, (unsigned char *)s5k4ba_ev_p3,
1170         (unsigned char *)s5k4ba_ev_p4, (unsigned char *)s5k4ba_ev_p5,
1171         (unsigned char *)s5k4ba_ev_p6,
1172 };
1173
1174 /*
1175  * Auto White Balance configure
1176  */
1177 static const struct s5k4ba_reg s5k4ba_awb_off[] = {
1178 };
1179
1180 static const struct s5k4ba_reg s5k4ba_awb_on[] = {
1181 };
1182
1183 static const unsigned char *s5k4ba_regs_awb_enable[] = {
1184         (unsigned char *)s5k4ba_awb_off,
1185         (unsigned char *)s5k4ba_awb_on,
1186 };
1187
1188 /*
1189  * Manual White Balance (presets)
1190  */
1191 static const struct s5k4ba_reg s5k4ba_wb_tungsten[] = {
1192
1193 };
1194
1195 static const struct s5k4ba_reg s5k4ba_wb_fluorescent[] = {
1196
1197 };
1198
1199 static const struct s5k4ba_reg s5k4ba_wb_sunny[] = {
1200
1201 };
1202
1203 static const struct s5k4ba_reg s5k4ba_wb_cloudy[] = {
1204
1205 };
1206
1207 /* Order of this array should be following the querymenu data */
1208 static const unsigned char *s5k4ba_regs_wb_preset[] = {
1209         (unsigned char *)s5k4ba_wb_tungsten,
1210         (unsigned char *)s5k4ba_wb_fluorescent,
1211         (unsigned char *)s5k4ba_wb_sunny,
1212         (unsigned char *)s5k4ba_wb_cloudy,
1213 };
1214
1215 /*
1216  * Color Effect (COLORFX)
1217  */
1218 static const struct s5k4ba_reg s5k4ba_color_sepia[] = {
1219 };
1220
1221 static const struct s5k4ba_reg s5k4ba_color_aqua[] = {
1222 };
1223
1224 static const struct s5k4ba_reg s5k4ba_color_monochrome[] = {
1225 };
1226
1227 static const struct s5k4ba_reg s5k4ba_color_negative[] = {
1228 };
1229
1230 static const struct s5k4ba_reg s5k4ba_color_sketch[] = {
1231 };
1232
1233 /* Order of this array should be following the querymenu data */
1234 static const unsigned char *s5k4ba_regs_color_effect[] = {
1235         (unsigned char *)s5k4ba_color_sepia,
1236         (unsigned char *)s5k4ba_color_aqua,
1237         (unsigned char *)s5k4ba_color_monochrome,
1238         (unsigned char *)s5k4ba_color_negative,
1239         (unsigned char *)s5k4ba_color_sketch,
1240 };
1241
1242 /*
1243  * Contrast bias
1244  */
1245 static const struct s5k4ba_reg s5k4ba_contrast_m2[] = {
1246 };
1247
1248 static const struct s5k4ba_reg s5k4ba_contrast_m1[] = {
1249 };
1250
1251 static const struct s5k4ba_reg s5k4ba_contrast_default[] = {
1252 };
1253
1254 static const struct s5k4ba_reg s5k4ba_contrast_p1[] = {
1255 };
1256
1257 static const struct s5k4ba_reg s5k4ba_contrast_p2[] = {
1258 };
1259
1260 static const unsigned char *s5k4ba_regs_contrast_bias[] = {
1261         (unsigned char *)s5k4ba_contrast_m2,
1262         (unsigned char *)s5k4ba_contrast_m1,
1263         (unsigned char *)s5k4ba_contrast_default,
1264         (unsigned char *)s5k4ba_contrast_p1,
1265         (unsigned char *)s5k4ba_contrast_p2,
1266 };
1267
1268 /*
1269  * Saturation bias
1270  */
1271 static const struct s5k4ba_reg s5k4ba_saturation_m2[] = {
1272 };
1273
1274 static const struct s5k4ba_reg s5k4ba_saturation_m1[] = {
1275 };
1276
1277 static const struct s5k4ba_reg s5k4ba_saturation_default[] = {
1278 };
1279
1280 static const struct s5k4ba_reg s5k4ba_saturation_p1[] = {
1281 };
1282
1283 static const struct s5k4ba_reg s5k4ba_saturation_p2[] = {
1284 };
1285
1286 static const unsigned char *s5k4ba_regs_saturation_bias[] = {
1287         (unsigned char *)s5k4ba_saturation_m2,
1288         (unsigned char *)s5k4ba_saturation_m1,
1289         (unsigned char *)s5k4ba_saturation_default,
1290         (unsigned char *)s5k4ba_saturation_p1,
1291         (unsigned char *)s5k4ba_saturation_p2,
1292 };
1293
1294 /*
1295  * Sharpness bias
1296  */
1297 static const struct s5k4ba_reg s5k4ba_sharpness_m2[] = {
1298 };
1299
1300 static const struct s5k4ba_reg s5k4ba_sharpness_m1[] = {
1301 };
1302
1303 static const struct s5k4ba_reg s5k4ba_sharpness_default[] = {
1304 };
1305
1306 static const struct s5k4ba_reg s5k4ba_sharpness_p1[] = {
1307 };
1308
1309 static const struct s5k4ba_reg s5k4ba_sharpness_p2[] = {
1310 };
1311
1312 static const unsigned char *s5k4ba_regs_sharpness_bias[] = {
1313         (unsigned char *)s5k4ba_sharpness_m2,
1314         (unsigned char *)s5k4ba_sharpness_m1,
1315         (unsigned char *)s5k4ba_sharpness_default,
1316         (unsigned char *)s5k4ba_sharpness_p1,
1317         (unsigned char *)s5k4ba_sharpness_p2,
1318 };
1319 #endif /* S5K4BA_COMPLETE */
1320
1321 #endif