upload tizen1.0 source
[kernel/linux-2.6.36.git] / drivers / media / video / s5k3ba.h
1 /* linux/drivers/media/video/s5k3ba.h
2  *
3  * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4  *              http://www.samsung.com/
5  *
6  * Driver for S5K3BA (UXGA camera) from Samsung Electronics
7  * 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 S5K3BA_COMPLETE
15 #ifndef __S5K3BA_H__
16 #define __S5K3BA_H__
17
18 struct s5k3ba_reg {
19         unsigned char addr;
20         unsigned char val;
21 };
22
23 struct s5k3ba_regset_type {
24         unsigned char *regset;
25         int len;
26 };
27
28 /*
29  * Macro
30  */
31 #define REGSET_LENGTH(x)        (sizeof(x)/sizeof(s5k3ba_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_s5k3ba {
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 s5k3ba_regset[]
61  * These values indicates each controls and should be used
62  * to control each control
63  */
64 enum s5k3ba_control {
65         S5K3BA_INIT,
66         S5K3BA_EV,
67         S5K3BA_AWB,
68         S5K3BA_MWB,
69         S5K3BA_EFFECT,
70         S5K3BA_CONTRAST,
71         S5K3BA_SATURATION,
72         S5K3BA_SHARPNESS,
73 };
74
75 #define S5K3BA_REGSET(x)        {       \
76         .regset = x,                    \
77         .len = sizeof(x)/sizeof(s5k3ba_reg),}
78
79
80 /*
81  * User tuned register setting values
82  */
83 #if 1
84 static unsigned char s5k3ba_init_reg[][2] = {
85         {0xfc, 0x01},
86         {0x03, 0x01},/* sw reset */
87
88         {0xfc, 0x01},
89         {0x04, 0x01},
90
91         {0xfc, 0x02},
92         {0x52, 0x80},/* pll_m */
93
94         {0xfc, 0x02},
95         {0x50, 0x54},
96
97         {0xfc, 0x00},
98         {0x02, 0x02},
99
100         {0xfc, 0x01},
101         {0x02, 0x05},
102 };
103 #else
104 static unsigned char s5k3ba_init_reg[][2] = {
105         /* 1. initial setting */
106         {0xfc, 0x01},
107         {0x04, 0x03},/* ARM Clock divider(1/4) */
108
109         /* {0xfc, 0x02},*/
110         /* {0x52, 0x80},PLL M */
111         /* {0x50, 0x14},1b    PLL S,P (15fps) */
112         /* In case of PCLK = 64MHz */
113
114         {0xfc, 0x02},
115         {0x52, 0x80},/* PLL M M= 128 setting. */
116         /*
117            case 200:
118            {0xfc, 0x02},
119            {0x50, 0x19},PLL S= 0 ,P = 25 PCLK=128/2=64Mhz 15 Frmae Setting
120            {0x50, 0x14},PLL S= 0 ,P = 20 PCLK=128/2=64Mhz 15 Frmae Setting
121            {0x50, 0x59},PLL S= 1 ,P = 25 PCLK=64/2=32Mhz ,7~8Frame Setting
122            */
123         /* case 266: */
124         {0xfc, 0x02},
125         {0x50, 0x1A},
126
127         {0xfc, 0x07},
128         {0x58, 0x10},
129         {0x59, 0x00},
130         {0x5A, 0x00},
131         {0x5B, 0x6c},
132
133         {0xfc, 0xf0},
134         {0x00, 0x40},
135
136         {0xfc, 0x00},
137         {0x62, 0x02},
138         {0xbc, 0xe0},/*  AWB_AE_DIFF */
139
140         {0xfc, 0x03},/* ************************************************* */
141         {0x2d, 0x03},
142         {0xfc, 0x01},
143         {0x02, 0x02},/*  YCbCr Order */
144
145         {0xfc, 0x02},
146         {0x4a, 0xc1},/*  SC type selection */
147         {0x37, 0x18},/* 16 SC type global gain */
148         {0x47, 0xc4},/*  r-ramp  by chin */
149
150         {0xfc, 0x01},/* AWB Window Area (except sky) */
151         {0xc4, 0x01},
152         {0xc5, 0x4e},
153         {0xc7, 0x6e},
154
155         {0xfc, 0x02},
156         {0x30, 0x84},/* Analog offset */
157
158         {0xfc, 0x00},
159         {0x3d, 0x10},/* AWB Low Y limit */
160
161         {0xfc, 0x02},
162         {0x3d, 0x06},/* ADLC OFF */
163         {0x44, 0x5b},/* clamp enable */
164         {0x55, 0x03},
165
166         {0xfc, 0x06},
167         {0x0c, 0x01},
168         {0x0d, 0x4e},
169         {0x0f, 0x6e},
170
171         {0xfc, 0x00},
172         {0x78, 0x58},/* AGC MAX (30lux_Micron Y=60code) */
173
174         {0xfc, 0x02},
175         {0x45, 0x8c},/* CDS timing greenish(15fps) */
176         {0x49, 0x80},/*  APS Current 2uA */
177
178         {0xfc, 0x01},
179         {0x25, 0x14},/* 10 Digital Clamp */
180
181         {0xfc, 0x00},
182         {0x6d, 0x01},/* AE target high (Macbeth white=240) */
183         {0x6c, 0x00},/* AE target (Macbeth white=240) */
184         /* {0x6d, 0x00},*/
185
186         /* 2. ISP tuning */
187         /* ISP_tuning */
188         /*     {0xfc, 0x00},*/
189         /*     {0x01, 0x00},I2C hold mode off */
190
191         {0xfc, 0x01},
192         {0x00, 0x00},/*  ISP BPR Off */
193         {0x0c, 0x02},/*  Full YC */
194         {0xc8, 0x19},/*  AWB Y Max */
195
196         {0xfc, 0x00},
197         {0x81, 0x00},/*  AWB G gain suppress disable */
198         {0x29, 0x04},
199         {0x2a, 0x00},
200         {0x2b, 0x04},/*  color level */
201         {0x2c, 0x00},
202
203         {0xfc, 0x07},
204         {0x11, 0x00},/*  G offset */
205         {0x37, 0x00},/*  Flicker Add */
206
207         {0xfc, 0x00},
208         {0x72, 0xa0},/*  Flicker for 32MHz */
209         {0x74, 0x18},/*  Flicker */
210         {0x73, 0x00},/*  Frame AE */
211
212         {0xfc, 0x05},
213         {0x64, 0x00},/*  Darkslice R */
214         {0x65, 0x00},/*  Darkslice G */
215         {0x66, 0x00},/*  Darkslice B */
216
217         /* Edge */
218         {0xfc, 0x05},
219         {0x2c, 0x0a},/* 14    positive gain */
220         {0x30, 0x0a},/* 10    negative edge gain */
221         {0x34, 0x1a},/*  APTCLP */
222         {0x35, 0x10},/* 0a   APTSC */
223         {0x36, 0x0b},/*  ENHANCE */
224         {0x3f, 0x00},/*  NON-LIN */
225         {0x45, 0x30},/*  EGREF */
226         {0x47, 0x00},/*  LLREF */
227         {0x48, 0x08},/*  by chin */
228         {0x49, 0x39},/*  CSSEL  EGSEL  CS_DLY by */
229         {0x40, 0x41},/*  Y delay */
230
231         {0xfc, 0x00},
232         {0x7e, 0xfc},
233         /* s7e8c  NR GrGb off */
234         /*  [7]: BPR [6]:Noise Filter(1D/NR)
235          *  [4]: GrGb Enable [3]:BPR Data Threshold */
236         /*  [2]: color suppress [1]: Y gain suppress [0]: Digital Clamp */
237         /*  GrGb Correction setting */
238         {0xfc, 0x01},
239         {0x44, 0x0c},
240
241         /* s4400 */
242         /* / [4]: GrGb full [3]: GrGb On */
243         /* / [2]: GrGb Rb On */
244         {0xfc, 0x0b},
245         {0x21, 0x00},/*  Start AGC */
246         {0x22, 0x10},/*  AGCMIN */
247         {0x23, 0x50},/*  AGCMAX */
248         {0x24, 0x18},/*  G Th AGCMIN(23d) */
249         {0x25, 0x52},/*  G Th AGCMAX(50d) */
250         {0x26, 0x38},/*  RB Th AGCMIN */
251         {0x27, 0x52},/*  RB Th AGCMAX */
252         /*  GrGb Correction setting End */
253
254         /*  BPR Setting */
255         {0xfc, 0x01},
256         {0x3f, 0x00},/*  setting because S/W bug */
257
258         {0xfc, 0x0b},
259         {0x0b, 0x00},/*  ISP BPR On Start */
260         {0x0c, 0x00},/*  Th13 AGC Min */
261         {0x0d, 0x5a},/*  Th13 AGC Max */
262         {0x0e, 0x01},/* 00    Th1 Max H for AGCMIN */
263         {0x0f, 0xff},/* c0    Th1 Max L for AGCMIN */
264         {0x10, 0x00},/*  Th1 Min H for AGCMAX */
265         {0x11, 0x10},/* 00    Th1 Min L for AGCMAX */
266         {0x12, 0xff},/*  Th3 Max H for AGCMIN */
267         {0x13, 0xff},/*  Th3 Max L for AGCMIN */
268         {0x14, 0xff},/*  Th3 Min H for AGCMAX */
269         {0x15, 0xff},/*  Th3 Min L for AGCMAX */
270
271         /*  NR Setting */
272         {0xfc, 0x01},
273         {0x4b, 0x01},/*  NR Enable */
274         /* s4b00     NR Enable */
275
276         {0xfc, 0x0b},
277         {0x28, 0x00},/* NR Start AGC */
278         {0x29, 0x00},/*  SIG Th AGCMIN H */
279         {0x2a, 0x0a},/* 14    SIG Th AGCMIN L */
280         {0x2b, 0x00},/*  SIG Th AGCMAX H */
281         {0x2c, 0x0a},/* 14    SIG Th AGCMAX L */
282         {0x2d, 0x00},/*  PRE Th AGCMIN H */
283         {0x2e, 0xc0},/* 64    PRE Th AGCMIN L(100d) */
284         {0x2f, 0x01},/*  PRE Th AGCMAX H(300d) */
285         {0x30, 0x2c},/*  PRE Th AGCMAX L */
286         {0x31, 0x00},/*  POST Th AGCMIN H */
287         {0x32, 0xe0},/* 64    POST Th AGCMIN L(100d) */
288         {0x33, 0x01},/*  POST Th AGCMAX H(300d) */
289         {0x34, 0x2c},/*  POST Th AGCMAX L */
290         /*  NR Setting End */
291
292         /* */
293         /*  Color suppress setting */
294         {0xfc, 0x0b},
295         {0x08, 0x50},/*  C suppress AGC MIN */
296         {0x09, 0x03},/*  C suppress MIN H */
297         {0x0a, 0x80},/*  C suppress MIN L */
298         /*  C Suppress Setting End */
299
300         {0xfc, 0x05},
301         {0x4a, 0x00},/* 01   Edge Color Suppress,9/13 */
302
303         /*  1D Y LPF Filter */
304         {0xfc, 0x01},
305         /* s05e0     Default s60 */
306         {0x05, 0x60},/*  Default s60 */
307         /* [7]: Y LPF filter On [6]: Clap On */
308
309         {0xfc, 0x0b},
310         {0x35, 0x00},/*  YLPF Start AGC */
311         {0x36, 0x50},/*  YLPF01 AGCMIN */
312         {0x37, 0x50},/*  YLPF01 AGCMAX */
313         {0x38, 0x00},/*  YLPF SIG01 Th AGCMINH */
314         {0x39, 0x90},/* 00    YLPF SIG01 Th AGCMINL */
315         {0x3a, 0x01},/*  YLPF SIG01 Th AGCMAXH */
316         {0x3b, 0xa0},/*  YLPF SIG01 Th AGCMAXL */
317         {0x3c, 0x50},/*  YLPF02 AGCMIN */
318         {0x3d, 0x50},/*  YLPF02 AGCMAX */
319         {0x3e, 0x00},/*  YLPF SIG02 Th AGCMINH */
320         {0x3f, 0xa0},/* 00   YLPF SIG02 Th AGCMINL */
321         {0x40, 0x01},/*  YLPF SIG02 Th AGCMAXH   s73 */
322         {0x41, 0xb0},/*  YLPF SIG02 Th AGCMAXL */
323         /*  Y LPF Filter setting End */
324
325         /*  SET EDGE COLOR SUPPRESS AND Y-LPF */
326         {0xfc, 0x05},
327         {0x42, 0x1F},
328         {0x43, 0x1F},
329         {0x44, 0x0E},
330         {0x45, 0x8C},
331         {0x46, 0x7A},
332         {0x47, 0x60},
333         {0x48, 0x0C},
334         {0x49, 0x39},
335         {0x4A, 0x01},
336         {0x4B, 0xB1},
337         {0x4C, 0x3B},
338         {0x4D, 0x14},
339         /* ***************************************************************** */
340         /*  NR Setting */
341         {0xfc, 0x01},
342         {0x4b, 0x01},/*  NR Enable */
343         /*  Set multipliers (which are not suppressed)********************** */
344         {0xfc, 0x01},
345         {0x48, 0x11},
346         /*  Suppressed parameters */
347
348         {0xfc, 0x0B},
349         {0x21, 0x00},
350         {0x22, 0x10},
351         {0x23, 0x60},
352         {0x24, 0x10},
353         {0x25, 0x28},
354         {0x26, 0x08},
355         {0x27, 0x20},
356         {0x28, 0x00},/* NR Start AGC */
357         {0x29, 0x00},/*  SIG Th AGCMIN H */
358         {0x2A, 0x02},/*  SIG Th AGCMIN L */
359         {0x2B, 0x00},/*  SIG Th AGCMAX H */
360         {0x2C, 0x14},/*  SIG Th AGCMAX L */
361         {0x2D, 0x03},/*  PRE Th AGCMIN H */
362         {0x2E, 0x84},/*  PRE Th AGCMIN L */
363         {0x2F, 0x03},/*  PRE Th AGCMAX H */
364         {0x30, 0x84},/*  PRE Th AGCMAX L */
365         {0x31, 0x00},/*  POST Th AGCMIN H */
366         {0x32, 0x00},/*  POST Th AGCMIN L */
367         {0x33, 0x00},/*  POST Th AGCMAX H */
368         {0x34, 0xC8},/*  POST Th AGCMAX L */
369         {0x35, 0x00},/* 1D Y filter setting */
370         {0x36, 0x10},
371         {0x37, 0x50},
372         {0x38, 0x00},
373         {0x39, 0x14},
374         {0x3A, 0x00},
375         {0x3B, 0x50},
376         {0x3C, 0x10},
377         {0x3D, 0x50},
378         {0x3E, 0x00},
379         {0x3F, 0x28},
380         {0x40, 0x00},
381         {0x41, 0xA0},
382         /* ***************************************************************** */
383
384         /* To avoid AWB tracking @ max AGC gain even though
385          * AE is unstable state
386         */
387         {0xfc, 0x00},
388         {0xba, 0x50},/*  AE Target minus AE Average */
389         {0xbb, 0x00},
390         {0xbc, 0x00},
391         /* ***************************************************************** */
392
393         /* 3. AE weight & etc linear */
394         /*  AE Window Weight linear(EVT1)0929 */
395         {0xfc, 0x20},/*  upper window weight zero */
396         {0x60, 0x11},
397         {0x61, 0x11},
398         {0x62, 0x11},
399         {0x63, 0x11},
400         {0x64, 0x11},
401         {0x65, 0x11},
402         {0x66, 0x11},
403         {0x67, 0x11},
404         {0x68, 0x11},
405         {0x69, 0x11},
406         {0x6a, 0x11},
407         {0x6b, 0x11},
408         {0x6c, 0x11},
409         {0x6d, 0x11},
410         {0x6e, 0x11},
411         {0x6f, 0x11},
412         {0x70, 0x11},
413         {0x71, 0x11},
414         {0x72, 0x11},
415         {0x73, 0x11},
416         {0x74, 0x11},
417         {0x75, 0x11},
418         {0x76, 0x11},
419         {0x77, 0x11},
420         {0x78, 0x11},
421         {0x79, 0x11},
422         {0x7a, 0x11},
423         {0x7b, 0x11},
424         {0x7c, 0x11},
425         {0x7d, 0x11},
426         {0x7e, 0x11},
427         {0x7f, 0x11},
428
429         /*  AE window Weight setting End */
430         /* hue gain linear */
431         {0xfc, 0x00},
432         {0x48, 0x40},
433         {0x49, 0x40},
434         {0x4a, 0x00},
435         {0x4b, 0x00},
436         {0x4c, 0x40},
437         {0x4d, 0x40},
438         {0x4e, 0x00},
439         {0x4f, 0x00},
440         {0x50, 0x40},
441         {0x51, 0x40},
442         {0x52, 0x00},
443         {0x53, 0x00},
444         {0x54, 0x40},
445         {0x55, 0x40},
446         {0x56, 0x00},
447         {0x57, 0x00},
448         {0x58, 0x40},
449         {0x59, 0x40},
450         {0x5a, 0x00},
451         {0x5b, 0x00},
452         {0x5c, 0x40},
453         {0x5d, 0x40},
454         {0x5e, 0x00},
455         {0x5f, 0x00},
456         {0x62, 0x00},/* hue enable OFF */
457
458         /* 4. shading (Flex 3000K manual shading) */
459         {0xfc, 0x09},
460         /*  DSP9_SH_WIDTH_H */
461         {0x01, 0x06},
462         {0x02, 0x40},
463         /*  DSP9_SH_HEIGHT_H */
464         {0x03, 0x04},
465         {0x04, 0xB0},
466         {0x05, 0x03},
467         {0x06, 0x13},
468         {0x07, 0x02},
469         {0x08, 0x5A},
470         {0x09, 0x03},
471         {0x0A, 0x15},
472         {0x0B, 0x02},
473         {0x0C, 0x5B},
474         {0x0D, 0x03},
475         {0x0E, 0x0D},
476         {0x0F, 0x02},
477         {0x10, 0x5D},
478         {0x1D, 0x80},
479         {0x1E, 0x00},
480         {0x1F, 0x80},
481         {0x20, 0x00},
482         {0x23, 0x80},
483         {0x24, 0x00},
484         {0x21, 0x80},
485         {0x22, 0x00},
486         {0x25, 0x80},
487         {0x26, 0x00},
488         {0x27, 0x80},
489         {0x28, 0x00},
490         {0x2B, 0x80},
491         {0x2C, 0x00},
492         {0x29, 0x80},
493         {0x2A, 0x00},
494         {0x2D, 0x80},
495         {0x2E, 0x00},
496         {0x2F, 0x80},
497         {0x30, 0x00},
498         {0x33, 0x80},
499         {0x34, 0x00},
500         {0x31, 0x80},
501         {0x32, 0x00},
502         /*  DSP9_SH_VAL_R0H */
503         {0x35, 0x01},
504         {0x36, 0x00},
505         {0x37, 0x01},
506         {0x38, 0x0F},
507         {0x39, 0x01},
508         {0x3A, 0x42},
509         {0x3B, 0x01},
510         {0x3C, 0x9C},
511         {0x3D, 0x01},
512         {0x3E, 0xD0},
513         {0x3F, 0x02},
514         {0x40, 0x0F},
515         {0x41, 0x02},
516         {0x42, 0x3D},
517         {0x43, 0x02},
518         {0x44, 0x5E},
519         {0x45, 0x01},
520         {0x46, 0x00},
521         {0x47, 0x01},
522         {0x48, 0x0A},
523         {0x49, 0x01},
524         {0x4A, 0x2E},
525         {0x4B, 0x01},
526         {0x4C, 0x66},
527         {0x4D, 0x01},
528         {0x4E, 0x89},
529         {0x4F, 0x01},
530         {0x50, 0xB7},
531         {0x51, 0x01},
532         {0x52, 0xD8},
533         {0x53, 0x01},
534         {0x54, 0xFA},
535         /*  DS9_SH_VAL_B0H */
536         {0x55, 0x01},
537         {0x56, 0x00},
538         {0x57, 0x01},
539         {0x58, 0x0A},
540         {0x59, 0x01},
541         {0x5A, 0x28},
542         {0x5B, 0x01},
543         {0x5C, 0x59},
544         {0x5D, 0x01},
545         {0x5E, 0x7A},
546         {0x5F, 0x01},
547         {0x60, 0xA1},
548         {0x61, 0x01},
549         {0x62, 0xC0},
550         {0x63, 0x01},
551         {0x64, 0xDC},
552         /*  DSP9_SH_M_R2_R1H */
553         {0x65, 0x00},
554         {0x66, 0x9F},
555         {0x67, 0xE6},
556         {0x68, 0x02},
557         {0x69, 0x7F},
558         {0x6A, 0x9B},
559         {0x6B, 0x05},
560         {0x6C, 0x9F},
561         {0x6D, 0x1E},
562         {0x6E, 0x07},
563         {0x6F, 0xA6},
564         {0x70, 0xCC},
565         {0x71, 0x09},
566         {0x72, 0xFE},
567         {0x73, 0x6E},
568         {0x74, 0x0C},
569         {0x75, 0xA6},
570         {0x76, 0x04},
571         {0x77, 0x0F},
572         {0x78, 0x9D},
573         {0x79, 0x8C},
574         /*  DSP9_SH_M_R2_G1H */
575         {0x7A, 0x00},
576         {0x7B, 0x9F},
577         {0x7C, 0x95},
578         {0x7D, 0x02},
579         {0x7E, 0x7E},
580         {0x7F, 0x54},
581         {0x80, 0x05},
582         {0x81, 0x9C},
583         {0x82, 0x3E},
584         {0x83, 0x07},
585         {0x84, 0xA2},
586         {0x85, 0xE3},
587         {0x86, 0x09},
588         {0x87, 0xF9},
589         {0x88, 0x53},
590         {0x89, 0x0C},
591         {0x8A, 0x9F},
592         {0x8B, 0x8D},
593         {0x8C, 0x0F},
594         {0x8D, 0x95},
595         {0x8E, 0x91},
596         /*  DSP9_SH_M_R2_B1H */
597         {0x8F, 0x00},
598         {0x90, 0xA1},
599         {0x91, 0xFF},
600         {0x92, 0x02},
601         {0x93, 0x87},
602         {0x94, 0xFD},
603         {0x95, 0x05},
604         {0x96, 0xB1},
605         {0x97, 0xFA},
606         {0x98, 0x07},
607         {0x99, 0xC0},
608         {0x9A, 0x79},
609         {0x9B, 0x0A},
610         {0x9C, 0x1F},
611         {0x9D, 0xF6},
612         {0x9E, 0x0C},
613         {0x9F, 0xD0},
614         {0xA0, 0x74},
615         {0xA1, 0x0F},
616         {0xA2, 0xD1},
617         {0xA3, 0xF1},
618         /*  DSP9_SH_SUB_RR0H */
619         {0xA4, 0x66},
620         {0xA5, 0x76},
621         {0xA6, 0x22},
622         {0xA7, 0x27},
623         {0xA8, 0x14},
624         {0xA9, 0x7E},
625         {0xAA, 0x1F},
626         {0xAB, 0x86},
627         {0xAC, 0x1B},
628         {0xAD, 0x52},
629         {0xAE, 0x18},
630         {0xAF, 0x1B},
631         {0xB0, 0x15},
632         {0xB1, 0x92},
633         /*  DSP9_SH_SUB_RG0H */
634         {0xB2, 0x66},
635         {0xB3, 0xAA},
636         {0xB4, 0x22},
637         {0xB5, 0x38},
638         {0xB6, 0x14},
639         {0xB7, 0x88},
640         {0xB8, 0x1F},
641         {0xB9, 0x97},
642         {0xBA, 0x1B},
643         {0xBB, 0x60},
644         {0xBC, 0x18},
645         {0xBD, 0x28},
646         {0xBE, 0x15},
647         {0xBF, 0x9D},
648         /*  DSP9_SH_SUB_RB0H */
649         {0xC0, 0x65},
650         {0xC1, 0x23},
651         {0xC2, 0x21},
652         {0xC3, 0xB6},
653         {0xC4, 0x14},
654         {0xC5, 0x3A},
655         {0xC6, 0x1F},
656         {0xC7, 0x1E},
657         {0xC8, 0x1A},
658         {0xC9, 0xF8},
659         {0xCA, 0x17},
660         {0xCB, 0xCC},
661         {0xCC, 0x15},
662         {0xCD, 0x4A},
663         {0x00, 0x02},/*  shading on */
664
665         {0xfc, 0x00},
666         {0x79, 0xf4},
667         {0x7a, 0x09},
668
669         /* 5.color correction */
670         /* 1229 CCM */
671         /* 2.0251    -1.0203 -0.0048 */
672         /* -0.7080   1.8970  -0.1889 */
673         /* -0.468    -0.444  1.912 */
674         {0xfc, 0x01},
675         {0x51, 0x08},/* R */
676         {0x52, 0x18},
677         {0x53, 0xfb},
678         {0x54, 0xec},
679         {0x55, 0xff},
680         {0x56, 0xfc},
681         {0x57, 0xfd},/* G */
682         {0x58, 0x2c},
683         {0x59, 0x07},
684         {0x5a, 0x95},
685         {0x5b, 0xff},
686         {0x5c, 0x3f},
687         {0x5d, 0xfe},/* B */
688         {0x5e, 0x22},
689         {0x5f, 0xfe},
690         {0x60, 0x3a},
691         {0x61, 0x07},
692         {0x62, 0xa5},
693
694         /* 6.gamma */
695         /* Gamma */
696         {0xfc, 0x01},
697         /*  R */
698         {0x6F, 0x05},
699         {0x70, 0x14},
700         {0x71, 0x3c},
701         {0x72, 0x96},
702         {0x73, 0x00},
703         {0x74, 0x2c},
704         {0x75, 0xa2},
705         {0x76, 0xfc},
706         {0x77, 0x44},
707         {0x78, 0x56},
708         {0x79, 0x80},
709         {0x7A, 0xb7},
710         {0x7B, 0xed},
711         {0x7C, 0x16},
712         {0x7D, 0xab},
713         {0x7E, 0x3c},
714         {0x7F, 0x61},
715         {0x80, 0x83},
716         {0x81, 0xa4},
717         {0x82, 0xff},
718         {0x83, 0xc4},
719         {0x84, 0xe2},
720         {0x85, 0xff},
721         {0x86, 0xff},
722         /*  G */
723         {0x87, 0x05},
724         {0x88, 0x14},
725         {0x89, 0x3c},
726         {0x8A, 0x96},
727         {0x8B, 0x00},
728         {0x8C, 0x2c},
729         {0x8D, 0xa2},
730         {0x8E, 0xfc},
731         {0x8F, 0x44},
732         {0x90, 0x56},
733         {0x91, 0x80},
734         {0x92, 0xb7},
735         {0x93, 0xed},
736         {0x94, 0x16},
737         {0x95, 0xab},
738         {0x96, 0x3c},
739         {0x97, 0x61},
740         {0x98, 0x83},
741         {0x99, 0xa4},
742         {0x9A, 0xff},
743         {0x9B, 0xc4},
744         {0x9C, 0xe2},
745         {0x9D, 0xff},
746         {0x9E, 0xff},
747         /* B */
748         {0x9F, 0x05},
749         {0xA0, 0x10},
750         {0xA1, 0x30},
751         {0xA2, 0x70},
752         {0xA3, 0x00},
753         {0xA4, 0x2c},
754         {0xA5, 0xa2},
755         {0xA6, 0xfc},
756         {0xA7, 0x44},
757         {0xA8, 0x56},
758
759         {0xA9, 0x80},
760         {0xAA, 0xb7},
761         {0xAB, 0xed},
762         {0xAC, 0x16},
763         {0xAD, 0xab},
764
765         {0xAE, 0x3c},
766         {0xAF, 0x61},
767         {0xB0, 0x83},
768         {0xB1, 0xa4},
769         {0xB2, 0xff},
770
771         {0xB3, 0xc4},
772         {0xB4, 0xe2},
773         {0xB5, 0xff},
774         {0xB6, 0xff},
775
776         /* 7.hue */
777         {0xFC, 0x00},
778         {0x62, 0x00},/*  hue auto control off */
779
780         {0xFC, 0x05},
781         {0x4E, 0x60},
782         {0x4F, 0xA0},
783         {0x50, 0x35},
784         {0x51, 0xA0},
785         {0x52, 0x20},
786         {0x53, 0x01},
787         {0x54, 0xE0},
788         {0x55, 0xE0},
789         {0x56, 0x54},
790         {0x57, 0x20},
791         {0x58, 0x20},
792         {0x59, 0xF0},
793
794         /* 8.white point */
795         /* AWB Start Point */
796         {0xfc, 0x07},
797         {0x05, 0x00},
798         {0x06, 0x08},
799         {0x07, 0x1b},
800         {0x08, 0xf0},
801         {0x09, 0x00},/*  R */
802         {0x0a, 0xa8},
803         {0x0b, 0x00},/*  B */
804         {0x0c, 0xb0},
805         {0x0d, 0x00},/*  G */
806         {0x0e, 0x40},
807
808         {0xfc, 0x00},
809         {0x70, 0x02},
810
811         {0x40, 0x8a},/* 2000K */
812         {0x41, 0xe5},
813         {0x42, 0x95},/* 3100K */
814         {0x43, 0xba},
815         {0x44, 0xbc},/* 5100K */
816         {0x45, 0x99},
817
818         {0x34, 0x24},
819         {0x35, 0x10},
820         {0x36, 0x13},
821         {0x37, 0x04},
822         {0x38, 0x10},
823         {0x39, 0x28},
824         {0x3a, 0x1e},
825         {0x3b, 0x2a},
826
827         {0x31, 0x00},/*  skin tone[6],CW delete[5] */
828 };
829 #endif
830
831 #define S5K3BA_INIT_REGS        \
832         (sizeof(s5k3ba_init_reg) / sizeof(s5k3ba_init_reg[0]))
833
834 /*
835  * EV bias
836  */
837
838 static const struct s5k3ba_reg s5k3ba_ev_m6[] = {
839 };
840
841 static const struct s5k3ba_reg s5k3ba_ev_m5[] = {
842 };
843
844 static const struct s5k3ba_reg s5k3ba_ev_m4[] = {
845 };
846
847 static const struct s5k3ba_reg s5k3ba_ev_m3[] = {
848 };
849
850 static const struct s5k3ba_reg s5k3ba_ev_m2[] = {
851 };
852
853 static const struct s5k3ba_reg s5k3ba_ev_m1[] = {
854 };
855
856 static const struct s5k3ba_reg s5k3ba_ev_default[] = {
857 };
858
859 static const struct s5k3ba_reg s5k3ba_ev_p1[] = {
860 };
861
862 static const struct s5k3ba_reg s5k3ba_ev_p2[] = {
863 };
864
865 static const struct s5k3ba_reg s5k3ba_ev_p3[] = {
866 };
867
868 static const struct s5k3ba_reg s5k3ba_ev_p4[] = {
869 };
870
871 static const struct s5k3ba_reg s5k3ba_ev_p5[] = {
872 };
873
874 static const struct s5k3ba_reg s5k3ba_ev_p6[] = {
875 };
876
877 #ifdef S5K3BA_COMPLETE
878 /* Order of this array should be following the querymenu data */
879 static const unsigned char *s5k3ba_regs_ev_bias[] = {
880         (unsigned char *)s5k3ba_ev_m6, (unsigned char *)s5k3ba_ev_m5,
881         (unsigned char *)s5k3ba_ev_m4, (unsigned char *)s5k3ba_ev_m3,
882         (unsigned char *)s5k3ba_ev_m2, (unsigned char *)s5k3ba_ev_m1,
883         (unsigned char *)s5k3ba_ev_default, (unsigned char *)s5k3ba_ev_p1,
884         (unsigned char *)s5k3ba_ev_p2, (unsigned char *)s5k3ba_ev_p3,
885         (unsigned char *)s5k3ba_ev_p4, (unsigned char *)s5k3ba_ev_p5,
886         (unsigned char *)s5k3ba_ev_p6,
887 };
888
889 /*
890  * Auto White Balance configure
891  */
892 static const struct s5k3ba_reg s5k3ba_awb_off[] = {
893 };
894
895 static const struct s5k3ba_reg s5k3ba_awb_on[] = {
896 };
897
898 static const unsigned char *s5k3ba_regs_awb_enable[] = {
899         (unsigned char *)s5k3ba_awb_off,
900         (unsigned char *)s5k3ba_awb_on,
901 };
902
903 /*
904  * Manual White Balance (presets)
905  */
906 static const struct s5k3ba_reg s5k3ba_wb_tungsten[] = {
907
908 };
909
910 static const struct s5k3ba_reg s5k3ba_wb_fluorescent[] = {
911
912 };
913
914 static const struct s5k3ba_reg s5k3ba_wb_sunny[] = {
915
916 };
917
918 static const struct s5k3ba_reg s5k3ba_wb_cloudy[] = {
919
920 };
921
922 /* Order of this array should be following the querymenu data */
923 static const unsigned char *s5k3ba_regs_wb_preset[] = {
924         (unsigned char *)s5k3ba_wb_tungsten,
925         (unsigned char *)s5k3ba_wb_fluorescent,
926         (unsigned char *)s5k3ba_wb_sunny,
927         (unsigned char *)s5k3ba_wb_cloudy,
928 };
929
930 /*
931  * Color Effect (COLORFX)
932  */
933 static const struct s5k3ba_reg s5k3ba_color_sepia[] = {
934 };
935
936 static const struct s5k3ba_reg s5k3ba_color_aqua[] = {
937 };
938
939 static const struct s5k3ba_reg s5k3ba_color_monochrome[] = {
940 };
941
942 static const struct s5k3ba_reg s5k3ba_color_negative[] = {
943 };
944
945 static const struct s5k3ba_reg s5k3ba_color_sketch[] = {
946 };
947
948 /* Order of this array should be following the querymenu data */
949 static const unsigned char *s5k3ba_regs_color_effect[] = {
950         (unsigned char *)s5k3ba_color_sepia,
951         (unsigned char *)s5k3ba_color_aqua,
952         (unsigned char *)s5k3ba_color_monochrome,
953         (unsigned char *)s5k3ba_color_negative,
954         (unsigned char *)s5k3ba_color_sketch,
955 };
956
957 /*
958  * Contrast bias
959  */
960 static const struct s5k3ba_reg s5k3ba_contrast_m2[] = {
961 };
962
963 static const struct s5k3ba_reg s5k3ba_contrast_m1[] = {
964 };
965
966 static const struct s5k3ba_reg s5k3ba_contrast_default[] = {
967 };
968
969 static const struct s5k3ba_reg s5k3ba_contrast_p1[] = {
970 };
971
972 static const struct s5k3ba_reg s5k3ba_contrast_p2[] = {
973 };
974
975 static const unsigned char *s5k3ba_regs_contrast_bias[] = {
976         (unsigned char *)s5k3ba_contrast_m2,
977         (unsigned char *)s5k3ba_contrast_m1,
978         (unsigned char *)s5k3ba_contrast_default,
979         (unsigned char *)s5k3ba_contrast_p1,
980         (unsigned char *)s5k3ba_contrast_p2,
981 };
982
983 /*
984  * Saturation bias
985  */
986 static const struct s5k3ba_reg s5k3ba_saturation_m2[] = {
987 };
988
989 static const struct s5k3ba_reg s5k3ba_saturation_m1[] = {
990 };
991
992 static const struct s5k3ba_reg s5k3ba_saturation_default[] = {
993 };
994
995 static const struct s5k3ba_reg s5k3ba_saturation_p1[] = {
996 };
997
998 static const struct s5k3ba_reg s5k3ba_saturation_p2[] = {
999 };
1000
1001 static const unsigned char *s5k3ba_regs_saturation_bias[] = {
1002         (unsigned char *)s5k3ba_saturation_m2,
1003         (unsigned char *)s5k3ba_saturation_m1,
1004         (unsigned char *)s5k3ba_saturation_default,
1005         (unsigned char *)s5k3ba_saturation_p1,
1006         (unsigned char *)s5k3ba_saturation_p2,
1007 };
1008
1009 /*
1010  * Sharpness bias
1011  */
1012 static const struct s5k3ba_reg s5k3ba_sharpness_m2[] = {
1013 };
1014
1015 static const struct s5k3ba_reg s5k3ba_sharpness_m1[] = {
1016 };
1017
1018 static const struct s5k3ba_reg s5k3ba_sharpness_default[] = {
1019 };
1020
1021 static const struct s5k3ba_reg s5k3ba_sharpness_p1[] = {
1022 };
1023
1024 static const struct s5k3ba_reg s5k3ba_sharpness_p2[] = {
1025 };
1026
1027 static const unsigned char *s5k3ba_regs_sharpness_bias[] = {
1028         (unsigned char *)s5k3ba_sharpness_m2,
1029         (unsigned char *)s5k3ba_sharpness_m1,
1030         (unsigned char *)s5k3ba_sharpness_default,
1031         (unsigned char *)s5k3ba_sharpness_p1,
1032         (unsigned char *)s5k3ba_sharpness_p2,
1033 };
1034 #endif /* S5K3BA_COMPLETE */
1035
1036 #endif