summaryrefslogtreecommitdiff
path: root/drivers/media/video/wmt_v4l2/sensors/bf3920/bf3920.h
blob: 96eefa19f623092b9a4a4e8c0f28da07e54a62b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
#ifndef BF3920_H
#define BF3920_H

// Scene Mode
uint8_t bf3920_scene_mode_auto[] = {
	0x89,0x55,
	0xff,0xff,
};

uint8_t bf3920_scene_mode_night[] = {
          0x89,0x75,
	0xff,0xff,
};


// White Balance
uint8_t bf3920_wb_auto [] = {
	0x13, 0x07, 
	0x01, 0x12,
	0x02, 0x22,
	0xff,0xff,
};

uint8_t bf3920_wb_incandescent [] = {
	0x13, 0x05, 
	0x01, 0x28,
	0x02, 0x0a,
	
	0xff,0xff,
};

uint8_t bf3920_wb_fluorescent [] = {
	0x13, 0x05, 
	0x01, 0x1a,
	0x02, 0x1e,
	0xff,0xff,
};

uint8_t bf3920_wb_daylight [] = {
	0x13, 0x05, 
	0x01, 0x10,
	0x02, 0x20,
	0xff,0xff,
};

uint8_t bf3920_wb_cloudy [] = {
	0x13, 0x05, 
	0x01, 0x0e,
	0x02, 0x24,
	0xff,0xff,
};


// Exposure
uint8_t bf3920_exposure_neg6[] = {
	0x56,0x28,
	0x55,0xb0,
};

uint8_t bf3920_exposure_neg3[] = {
	0x56,0x28,
	0x55,0x98,
};

uint8_t bf3920_exposure_zero[] = {
	0x56,0x28,
	0x55,0x00,
};

uint8_t bf3920_exposure_pos3[] = {
	0x56,0x28,
	0x55,0x18,
};

uint8_t bf3920_exposure_pos6[] = {
	0x56,0x28,
	0x55,0x38,
};


// Resolution
uint8_t bf3920_1600_1200_rets[]={
	/* 1600X1200 UXGA */
 
	0x1b,0x2c,
	0x11,0x30,//38
	0x8a,0x7f,//0XBF
	0x2a,0x0c,
	0x2b,0x1c,
	0x92,0x02,
	0x93,0x00,
						
						
	//window 	
	0x4a,0x80, 
	0xcc,0x00, 
	0xca,0x00, 
	0xcb,0x00, 
	0xcf,0x00, 
	0xcd,0x00, 
	0xce,0x00, 
	0xc0,0x00, 
	0xc1,0x00, 
	0xc2,0x00, 
	0xc3,0x00, 
	0xc4,0x00, 
	0xb5,0x00, 
	0x03,0x60, 
	0x17,0x00, 
	0x18,0x40, 
	0x10,0x40, 
	0x19,0x00, 
	0x1a,0xb0, 
	0x0B,0x00,
	0xff, 0xff,
};

uint8_t bf3920_1280_720_regs[]={
};

uint8_t bf3920_800_600_regs[]={

	0x1b,0x2c,
	0x11,0x30,//38
	0x8a,0x7f,//0XBF
	0x2a,0x0c,
	0x2b,0x1c,
	0x92,0x02,
	0x93,0x00,
						
						
	//window 	
	0x4a,0x80, 
	0xcc,0x00, 
	0xca,0x00, 
	0xcb,0x00, 
	0xcf,0x00, 
	0xcd,0x00, 
	0xce,0x00, 
	0xc0,0x00, 
	0xc1,0x00, 
	0xc2,0x00, 
	0xc3,0x00, 
	0xc4,0x00, 
	0xb5,0x00, 
	0x03,0x60, 
	0x17,0x00, 
	0x18,0x40, 
	0x10,0x40, 
	0x19,0x00, 
	0x1a,0xb0, 
	0x0B,0x10,
	0xff, 0xff,
};

uint8_t bf3920_640_480_regs[]={
	0x1b,0x2c,
	0x11,0x30,//38
	0x8a,0x7f,//0XBF
	0x2a,0x0c,
	0x2b,0x1c,
	0x92,0x02,
	0x93,0x00,
						
						
	//window 	
	0x4a,0x80, 
	0xcc,0x00, 
	0xca,0x00, 
	0xcb,0x00, 
	0xcf,0x00, 
	0xcd,0x00, 
	0xce,0x00, 
	0xc0,0xd3, 
	0xc1,0x04, 
	0xc2,0xc4, 
	0xc3,0x11, 
	0xc4,0x3f, 
	0xb5,0x3f, 
	0x03,0x50, 
	0x17,0x00, 
	0x18,0x00, 
	0x10,0x30, 
	0x19,0x00, 
	0x1a,0xc0,
	0x0B,0x10,
	0xff, 0xff,
};

uint8_t bf3920_320_240_regs[]= {
	
	0x1b,0x2c,
	0x11,0x30,//38
	0x8a,0x7f,//0XBF
	0x2a,0x0c,
	0x2b,0x1c,
	0x92,0x02,
	0x93,0x00,
						
						
	//window 	
	0x4a,0x80, 
	0xcc,0x00, 
	0xca,0x00, 
	0xcb,0x00, 
	0xcf,0x00, 
	0xcd,0x00, 
	0xce,0x00, 
	0xc0,0xd3, 
	0xc1,0x04, 
	0xc2,0xc4, 
	0xc3,0x11, 
	0xc4,0x3f, 
	0xb5,0x3f, 
	0x03,0x50, 
	0x17,0x00, 
	0x18,0x00, 
	0x10,0x30, 
	0x19,0x00, 
	0x1a,0xc0,
	0x0B,0x30,
	0xff, 0xff,







};

uint8_t bf3920_default_regs_init[]={


	0x09,0x42,
	0x29,0x60,
	0x12,0x00,
	0x13,0x07,
	0xe2,0xc4,                
	0xe7,0x4e,  
	0x29,0x60,
	0x08,0x16, 
	0x16,0x28,  
	0x1c,0x00,                
	0x1d,0xf1,   
	0xbb,0x30,
	0x3e,0x80,   
	0x27,0x98,
	0x11,0x30,
	0x15,0x80,
	0x3a,0x00,

	//lens shading											   
	0x1e,0x46,
	0x35,0x30, //lens shading gain of R               
	0x65,0x30, //lens shading gain of G                
	0x66,0x2a, //lens shading gain of B
	0xbc,0xd3,                 
	0xbd,0x5c,                
	0xbe,0x24,                 
	0xbf,0x13,	              
	0x9b,0x5c,                 
	0x9c,0x24,      
	0x36,0x13,				  
	0x37,0x5c,				   
	0x38,0x24,	

	0x92,0x02,//Dummy Line Insert LSB
	0x93,0x00,
	0x2a,0x0c,
	0x2b,0x13,//Dummy Pixel Insert LSB

	//initial AWB and AE  
	0x13,0x00,
	0x8c,0x0b,  
	0x8d,0xc4,  
	0x24,0xc8,
	0x87,0x2d,
	0x01,0x12,
	0x02,0x22,
	0x13,0x07,



	//black sun 
	/*
	0xfb,0x06, //72M
	0xfb,0x0a,//48M    
	0xfb,0x0c, //36M
	0xfb,0x12, //24M
	*/
								  


	//denoise and edge enhancement															   
	0x70,0x01,                 
	0x72,0x62,//0x72[7:6]: Bright edge enhancement; 0x72[5:4]: Dark edge enhancement      
	0x78,0x37,				  
	0x7a,0x29,//0x7a[7:4]: The bigger, the smaller noise; 0x7a[3:0]: The smaller, the smaller noise				   
	0x7d,0x85,	//	

	0x39,0xa8, //0xa0 zzg  0xa8
	0x3f,0x28, //0x20 zzg  0x28


	// gamma default(low noise)
	
	0x40,0x20,
	0x41,0x25,
	0x42,0x23,
	0x43,0x1f,
	0x44,0x18,
	0x45,0x15,
	0x46,0x12,
	0x47,0x10,
	0x48,0x10,
	0x49,0x0f,
	0x4b,0x0e,
	0x4c,0x0c,
	0x4e,0x0b,
	0x4f,0x09,
	0x50,0x07,
	

	//gammaÇåÎúÁÁÀö
	/*
	0x40,0x28,
	0x41,0x26,
	0x42,0x24,
	0x43,0x22,
	0x44,0x1c,
	0x45,0x19,
	0x46,0x11,
	0x47,0x10,
	0x48,0x0f,
	0x49,0x0e,
	0x4b,0x0c,
	0x4c,0x0a,
	0x4e,0x09,
	0x4f,0x08,
	0x50,0x04,
	*/

	/*
	//gamma ¹ýÆØÁÁ¶ÈºÃ£¬¸ßÁÁ

	0x40,0x28,
	0x41,0x28,
	0x42,0x30,
	0x43,0x29,
	0x44,0x23,
	0x45,0x1b,
	0x46,0x17,
	0x47,0x0f,
	0x48,0x0d,
	0x49,0x0b,
	0x4b,0x09,
	0x4c,0x08,
	0x4e,0x07,
	0x4f,0x05,
	0x50,0x04,
	
	//// from ryx   zzg
	0x40,0x25,
	0x41,0x28,
	0x42,0x25,
	0x43,0x23,
	0x44,0x1b,
	0x45,0x18,
	0x46,0x15,
	0x47,0x11,
	0x48,0x10,
	0x49,0x0f,
	0x4b,0x0e,
	0x4c,0x0c,
	0x4e,0x0a,
	0x4f,0x06,
	0x50,0x05,
*/




	//color default
	/*
	0x5c,0x00,
	0x51,0x32,
	0x52,0x17,
	0x53,0x8C,
	0x54,0x79,
	0x57,0x6E,
	0x58,0x01,
	0x5a,0x36,
	0x5e,0x38,
	*/

	//color ÂÌÉ«ºÃºìÉ«Ö÷ϵÊý¸ß

	0x5c,0x00,
	0x51,0x24,//16
	0x52,0x0b,//e
	0x53,0x77,//6f
	0x54,0x65,//66
	0x57,0x5e,//76
	0x58,0x19,//15
	0x5a,0x16,//16
	0x5e,0x60,//0x38  zzg

	/*
	//color ÑÞÀö

	0x5c,0x00,
	0x51,0x2b,
	0x52,0x0e,
	0x53,0x9f,
	0x54,0x7d,
	0x57,0x91,
	0x58,0x21,
	0x5a,0x16,
	0x5e,0x38,   
	*/


	//color É«²Êµ­
	/*
	0x5c,0x00,
	0x51,0x24,
	0x52,0x0b,
	0x53,0x77,
	0x54,0x65,
	0x57,0x5e,
	0x58,0x19,
	0x5a,0x16,
	0x5e,0x38,
	*/
	//A color
	0x5c,0x80,
	0x51,0x22,
	0x52,0x00,
	0x53,0x96,
	0x54,0x8C,
	0x57,0x7F,
	0x58,0x0B,
	0x5a,0x14,
	0x5e,0x60, ////0x38 zzg 
	// saturn  and auto contrast  
	0x56,0x28,
	0x55,0x00,//when 0x56[7:6]=2'b0x,0x55[7:0]:Brightness control.bit[7]: 0:positive  1:negative [6:0]:value	 
	0xb0,0x8d,
	0xb1,0x15,//when 0x56[7:6]=2'b0x,0xb1[7]:auto contrast switch(0:on 1:off)		      
	0x56,0xe8,
	0x55,0xf0,//when 0x56[7:6]=2'b11,cb coefficient of F light
	0xb0,0xb8,//when 0x56[7:6]=2'b11,cr coefficient of F light
	0x56,0xa8,
	0x55,0xb8,//when 0x56[7:6]=2'b10,cb coefficient of !F light
	0xb0,0xa8,//when 0x56[7:6]=2'b10,cr coefficient of !F light 
	// manual rast
	
	0x56,0x28,
	0xb1,0x95,//when 0x56[7:6]=2'b0x,0xb1[7]:auto contrast switch(0:on 1:off)
         0x56,0xe8,
	0xb4,0x40,//when 0x56[7:6]=2'b11,manual contrast coefficient 
	
	//AE
	0x13,0x07,
	0x24,0x40,// AE Target   
	0x25,0x88,// Bit[7:4]: AE_LOC_INT; Bit[3:0]:AE_LOC_GLB  
	0x97,0x30,// Y target value1.   
	0x98,0x18,// AE ´°¿ÚºÍȨÖØ  0x0a zzg 
	0x80,0xd2,//Bit[3:2]: the bigger, Y_AVER_MODIFY is smaller     0x92
	0x81,0xff,//AE speed  //0xe0
	0x82,0x30,//minimum global gain   0x30 zzg 
	0x83,0x60, //0x60 zzg 
	0x84,0x45, ///0x65 zzg 
	0x85,0x7d, ///0x90 zzg 
	0x86,0xa0,//maximum gain zzg 0xc0 0x97
	0x89,0x6d,//INT_MAX_MID    9d zzg   
	0x94,0x82,//Bit[7:4]: Threshold for over exposure pixels, the smaller, the more over exposure pixels; Bit[3:0]: Control the start of AE. 0x42 zzg b2

	//AWB
	0x6a,0x81,
	0x23,0x66,// green gain 
	0xa1,0x31,
	0xa2,0x0b,//the low limit of blue gain for indoor scene
	0xa3,0x25,//the upper limit of blue gain for indoor scene
	0xa4,0x09,//the low limit of red gain for indoor scene
	0xa5,0x26,//the upper limit of red gain for indoor scene
	0xa7,0x9a,//Base B gain²»½¨ÒéÐÞ¸Ä      
	0xa8,0x15,//Base R gain²»½¨ÒéÐÞ¸Ä         
	0xa9,0x13,
	0xaa,0x12,
	0xab,0x16,
	0xac,0x20, //avoiding red scence when openning
	0xc8,0x10,
	0xc9,0x15,
	0xd2,0x78,
	0xd4,0x20,

	///awb base gain offset
	0xd0,0x11, 
	0xd1,0x09, ///0x01 zzg  


	0x0b,0x10,	//800*600
	0x09,0x72, ///0x42  HSYNC delay    bit[5:4]:  HREF delay select,     0:no delay£¬01£ºdelay 2ns£¬10£ºdelay 4ns£¬11£ºdelay 6ns
	//skin
	0xee,0x2a,
	0xef,0x1b,		

 
};

#endif