Lines Matching +full:0 +full:x4001

7  * V0.0X01.0X00 first version.
8 * V0.0X01.0X01 support conversion gain switch.
9 * V0.0X01.0X02 add debug interface for conversion gain switch.
10 * V0.0X01.0X03 support enum sensor fmt
11 * V0.0X01.0X04 add quick stream on/off
12 * V0.0X01.0X05 support get dcg ratio from sensor
37 #define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x05)
55 #define CHIP_ID 0x530441
56 #define OS04A10_REG_CHIP_ID 0x300a
58 #define OS04A10_REG_CTRL_MODE 0x0100
59 #define OS04A10_MODE_SW_STANDBY 0x0
60 #define OS04A10_MODE_STREAMING BIT(0)
64 #define OS04A10_VTS_MAX 0xffff
66 #define OS04A10_REG_EXP_LONG_H 0x3501
67 #define OS04A10_REG_EXP_MID_H 0x3541
68 #define OS04A10_REG_EXP_VS_H 0x3581
70 #define OS04A10_REG_HCG_SWITCH 0x376C
71 #define OS04A10_REG_AGAIN_LONG_H 0x3508
72 #define OS04A10_REG_AGAIN_MID_H 0x3548
73 #define OS04A10_REG_AGAIN_VS_H 0x3588
74 #define OS04A10_REG_DGAIN_LONG_H 0x350A
75 #define OS04A10_REG_DGAIN_MID_H 0x354A
76 #define OS04A10_REG_DGAIN_VS_H 0x358A
77 #define OS04A10_GAIN_MIN 0x10
78 #define OS04A10_GAIN_MAX 0xF7C
80 #define OS04A10_GAIN_DEFAULT 0x10
82 #define OS04A10_GROUP_UPDATE_ADDRESS 0x3208
83 #define OS04A10_GROUP_UPDATE_START_DATA 0x00
84 #define OS04A10_GROUP_UPDATE_END_DATA 0x10
85 #define OS04A10_GROUP_UPDATE_END_LAUNCH 0xA0
87 #define OS04A10_SOFTWARE_RESET_REG 0x0103
89 #define OS04A10_FETCH_MSB_BYTE_EXP(VAL) (((VAL) >> 8) & 0xFF) /* 8 Bits */
90 #define OS04A10_FETCH_LSB_BYTE_EXP(VAL) ((VAL) & 0xFF) /* 8 Bits */
92 #define OS04A10_FETCH_LSB_GAIN(VAL) (((VAL) << 4) & 0xf0)
93 #define OS04A10_FETCH_MSB_GAIN(VAL) (((VAL) >> 4) & 0x1f)
95 #define OS04A10_REG_TEST_PATTERN 0x5080
96 #define OS04A10_TEST_PATTERN_ENABLE 0x80
97 #define OS04A10_TEST_PATTERN_DISABLE 0x0
99 #define OS04A10_REG_VTS 0x380e
101 #define REG_NULL 0xFFFF
122 #define OS04A10_FLIP_REG 0x3820
200 {0x0109, 0x01},
201 {0x0104, 0x02},
202 {0x0102, 0x00},
203 {0x0306, 0x00},
204 {0x0307, 0x00},
205 {0x030a, 0x01},
206 {0x0322, 0x01},
207 {0x0323, 0x02},
208 {0x0324, 0x00},
209 {0x0327, 0x05},
210 {0x0329, 0x02},
211 {0x032c, 0x02},
212 {0x032d, 0x02},
213 {0x300f, 0x11},
214 {0x3012, 0x41},
215 {0x3026, 0x10},
216 {0x3027, 0x08},
217 {0x302d, 0x24},
218 {0x3104, 0x01},
219 {0x3106, 0x11},
220 {0x3400, 0x00},
221 {0x3408, 0x05},
222 {0x340c, 0x0c},
223 {0x340d, 0xb0},
224 {0x3425, 0x51},
225 {0x3426, 0x50},
226 {0x3427, 0x15},
227 {0x3428, 0x50},
228 {0x3429, 0x10},
229 {0x342a, 0x10},
230 {0x342b, 0x04},
231 {0x3501, 0x02},
232 {0x3504, 0x08},
233 {0x3508, 0x01},
234 {0x3509, 0x00},
235 {0x350a, 0x01},
236 {0x3544, 0x08},
237 {0x3548, 0x01},
238 {0x3549, 0x00},
239 {0x3584, 0x08},
240 {0x3588, 0x01},
241 {0x3589, 0x00},
242 {0x3601, 0x70},
243 {0x3604, 0xe3},
244 {0x3608, 0xa8},
245 {0x360a, 0xd0},
246 {0x360b, 0x08},
247 {0x360e, 0xc8},
248 {0x360f, 0x66},
249 {0x3610, 0x89},
250 {0x3611, 0x8a},
251 {0x3612, 0x4e},
252 {0x3613, 0xbd},
253 {0x3614, 0x9b},
254 {0x362a, 0x0e},
255 {0x362b, 0x0e},
256 {0x362c, 0x0e},
257 {0x362e, 0x1a},
258 {0x362f, 0x34},
259 {0x3630, 0x67},
260 {0x3631, 0x7f},
261 {0x3638, 0x00},
262 {0x3643, 0x00},
263 {0x3644, 0x00},
264 {0x3645, 0x00},
265 {0x3646, 0x00},
266 {0x3647, 0x00},
267 {0x3648, 0x00},
268 {0x3649, 0x00},
269 {0x364a, 0x04},
270 {0x364c, 0x0e},
271 {0x364d, 0x0e},
272 {0x364e, 0x0e},
273 {0x364f, 0x0e},
274 {0x3650, 0xff},
275 {0x3651, 0xff},
276 {0x365a, 0x00},
277 {0x365b, 0x00},
278 {0x365c, 0x00},
279 {0x365d, 0x00},
280 {0x3661, 0x07},
281 {0x3663, 0x20},
282 {0x3665, 0x12},
283 {0x3668, 0x80},
284 {0x366c, 0x00},
285 {0x366d, 0x00},
286 {0x366e, 0x00},
287 {0x366f, 0x00},
288 {0x3673, 0x2a},
289 {0x3681, 0x80},
290 {0x3700, 0x2d},
291 {0x3701, 0x22},
292 {0x3702, 0x25},
293 {0x3705, 0x00},
294 {0x3707, 0x0a},
295 {0x3708, 0x36},
296 {0x3709, 0x57},
297 {0x3714, 0x01},
298 {0x371c, 0x00},
299 {0x371d, 0x08},
300 {0x373f, 0x63},
301 {0x3740, 0x63},
302 {0x3741, 0x63},
303 {0x3742, 0x63},
304 {0x3762, 0x1c},
305 {0x3776, 0x05},
306 {0x3777, 0x22},
307 {0x3779, 0x60},
308 {0x377c, 0x48},
309 {0x3784, 0x06},
310 {0x3785, 0x0a},
311 {0x3790, 0x10},
312 {0x3793, 0x04},
313 {0x3794, 0x07},
314 {0x3796, 0x00},
315 {0x3797, 0x02},
316 {0x379c, 0x4d},
317 {0x37a1, 0x80},
318 {0x37bb, 0x88},
319 {0x37be, 0x48},
320 {0x37bf, 0x01},
321 {0x37c0, 0x01},
322 {0x37c4, 0x72},
323 {0x37c5, 0x72},
324 {0x37c6, 0x72},
325 {0x37ca, 0x21},
326 {0x37cd, 0x90},
327 {0x37cf, 0x02},
328 {0x37d0, 0x00},
329 {0x37d8, 0x01},
330 {0x37dc, 0x00},
331 {0x37dd, 0x00},
332 {0x37da, 0x00},
333 {0x37db, 0x00},
334 {0x3800, 0x00},
335 {0x3802, 0x00},
336 {0x3804, 0x0a},
337 {0x3806, 0x05},
338 {0x3808, 0x0a},
339 {0x380a, 0x05},
340 {0x3811, 0x08},
341 {0x3813, 0x08},
342 {0x3814, 0x01},
343 {0x3815, 0x01},
344 {0x3816, 0x01},
345 {0x3817, 0x01},
346 {0x3821, 0x00},
347 {0x3822, 0x14},
348 {0x3823, 0x18},
349 {0x3826, 0x00},
350 {0x3827, 0x00},
351 {0x3858, 0x3c},
352 {0x3865, 0x02},
353 {0x3866, 0x00},
354 {0x3867, 0x00},
355 {0x3868, 0x02},
356 {0x3900, 0x13},
357 {0x3940, 0x13},
358 {0x3980, 0x13},
359 {0x3c01, 0x11},
360 {0x3c05, 0x00},
361 {0x3c0f, 0x1c},
362 {0x3c12, 0x0d},
363 {0x3c19, 0x00},
364 {0x3c21, 0x00},
365 {0x3c3a, 0x10},
366 {0x3c3b, 0x18},
367 {0x3c3d, 0xc6},
368 {0x3c55, 0xcb},
369 {0x3c5d, 0xcf},
370 {0x3c5e, 0xcf},
371 {0x3d8c, 0x70},
372 {0x3d8d, 0x10},
373 {0x4000, 0xf9},
374 {0x4008, 0x02},
375 {0x4009, 0x11},
376 {0x400e, 0x40},
377 {0x4030, 0x00},
378 {0x4033, 0x80},
379 {0x4050, 0x00},
380 {0x4051, 0x07},
381 {0x4011, 0xbb},
382 {0x410f, 0x01},
383 {0x4289, 0x00},
384 {0x428a, 0x46},
385 {0x430d, 0x00},
386 {0x430e, 0x00},
387 {0x4314, 0x04},
388 {0x4500, 0x18},
389 {0x4501, 0x18},
390 {0x4503, 0x10},
391 {0x4504, 0x00},
392 {0x4506, 0x32},
393 {0x4601, 0x30},
394 {0x4603, 0x00},
395 {0x460a, 0x50},
396 {0x460c, 0x60},
397 {0x4640, 0x62},
398 {0x4646, 0xaa},
399 {0x4647, 0x55},
400 {0x4648, 0x99},
401 {0x4649, 0x66},
402 {0x464d, 0x00},
403 {0x4654, 0x11},
404 {0x4655, 0x22},
405 {0x4800, 0x44},
406 {0x4810, 0xff},
407 {0x4811, 0xff},
408 {0x481f, 0x30},
409 {0x4d00, 0x4d},
410 {0x4d01, 0x9d},
411 {0x4d02, 0xb9},
412 {0x4d03, 0x2e},
413 {0x4d04, 0x4a},
414 {0x4d05, 0x3d},
415 {0x4d09, 0x4f},
416 {0x5080, 0x00},
417 {0x50c0, 0x00},
418 {0x5100, 0x00},
419 {0x5200, 0x00},
420 {0x5201, 0x00},
421 {0x5202, 0x03},
422 {0x5203, 0xff},
423 {0x5780, 0x53},
424 {0x5786, 0x01},
425 {0x5792, 0x11},
426 {0x5793, 0x33},
427 {0x5857, 0xff},
428 {0x5858, 0xff},
429 {0x5859, 0xff},
430 {0x58d7, 0xff},
431 {0x58d8, 0xff},
432 {0x58d9, 0xff},
433 {REG_NULL, 0x00},
437 {0x0305, 0x3c},
438 {0x0308, 0x04},
439 {0x0317, 0x09},
440 {0x0325, 0x90},
441 {0x032e, 0x02},
442 {0x3605, 0x7f},
443 {0x3606, 0x80},
444 {0x362d, 0x0e},
445 {0x3662, 0x02},
446 {0x3667, 0xd4},
447 {0x3671, 0x08},
448 {0x3703, 0x20},
449 {0x3706, 0x72},
450 {0x370a, 0x01},
451 {0x370b, 0x14},
452 {0x3719, 0x1f},
453 {0x371b, 0x16},
454 {0x3756, 0x9d},
455 {0x3757, 0x9d},
456 {0x376c, 0x04},
457 {0x37cc, 0x13},
458 {0x37d1, 0x72},
459 {0x37d2, 0x01},
460 {0x37d3, 0x14},
461 {0x37d4, 0x00},
462 {0x37d5, 0x6c},
463 {0x37d6, 0x00},
464 {0x37d7, 0xf7},
465 {0x3801, 0x00},
466 {0x3803, 0x00},
467 {0x3805, 0x8f},
468 {0x3807, 0xff},
469 {0x3809, 0x80},
470 {0x380b, 0xf0},
471 {0x380c, 0x02},
472 {0x380d, 0xdc},
473 {0x380e, 0x0c},
474 {0x380f, 0xb0},
475 {0x381c, 0x00},
476 {0x3820, 0x00},
477 {0x3833, 0x40},
478 {0x384c, 0x02},
479 {0x384d, 0xdc},
480 {0x3c5a, 0x55},
481 {0x4004, 0x00},
482 {0x4001, 0x2f},
483 {0x4005, 0x40},
484 {0x400a, 0x06},
485 {0x400b, 0x40},
486 {0x402e, 0x00},
487 {0x402f, 0x40},
488 {0x4031, 0x40},
489 {0x4032, 0x0f},
490 {0x4288, 0xcf},
491 {0x430b, 0x0f},
492 {0x430c, 0xfc},
493 {0x4507, 0x02},
494 {0x480e, 0x00},
495 {0x4813, 0x00},
496 {0x4837, 0x0e},
497 {0x484b, 0x27},
498 {0x5000, 0x1f},
499 {0x5001, 0x0d},
500 {0x5782, 0x18},
501 {0x5783, 0x3c},
502 {0x5788, 0x18},
503 {0x5789, 0x3c},
504 {REG_NULL, 0x00},
508 {0x0305, 0x6c},
509 {0x0308, 0x05},
510 {0x0317, 0x0a},
511 {0x0325, 0xd8},
512 {0x032e, 0x02},
513 {0x3605, 0xff},
514 {0x3606, 0x01},
515 {0x362d, 0x09},
516 {0x3662, 0x00},
517 {0x3667, 0xd4},
518 {0x3671, 0x08},
519 {0x3703, 0x28},
520 {0x3706, 0xf0},
521 {0x370a, 0x03},
522 {0x370b, 0x15},
523 {0x3719, 0x24},
524 {0x371b, 0x1f},
525 {0x3756, 0xe7},
526 {0x3757, 0xe7},
527 {0x376c, 0x00},
528 {0x37cc, 0x15},
529 {0x37d1, 0xf0},
530 {0x37d2, 0x03},
531 {0x37d3, 0x15},
532 {0x37d4, 0x01},
533 {0x37d5, 0x00},
534 {0x37d6, 0x03},
535 {0x37d7, 0x15},
536 {0x3801, 0x00},
537 {0x3803, 0x00},
538 {0x3805, 0x8f},
539 {0x3807, 0xff},
540 {0x3809, 0x80},
541 {0x380b, 0xf0},
542 {0x380c, 0x05},
543 {0x380d, 0xc4},
544 {0x380e, 0x09},
545 {0x380f, 0x84},
546 {0x381c, 0x00},
547 {0x3820, 0x00},
548 {0x3833, 0x40},
549 {0x384c, 0x05},
550 {0x384d, 0xc4},
551 {0x3c5a, 0xe5},
552 {0x4001, 0x2f},
553 {0x4004, 0x01},
554 {0x4005, 0x00},
555 {0x400a, 0x03},
556 {0x400b, 0x27},
557 {0x402e, 0x01},
558 {0x402f, 0x00},
559 {0x4031, 0x80},
560 {0x4032, 0x9f},
561 {0x4288, 0xcf},
562 {0x430b, 0xff},
563 {0x430c, 0xff},
564 {0x4507, 0x02},
565 {0x480e, 0x00},
566 {0x4813, 0x00},
567 {0x4837, 0x0c},
568 {0x484b, 0x27},
569 {0x5000, 0x1f},
570 {0x5001, 0x0d},
571 {0x5782, 0x60},
572 {0x5783, 0xf0},
573 {0x5788, 0x60},
574 {0x5789, 0xf0},
575 {REG_NULL, 0x00},
579 {0x0305, 0x3c},
580 {0x0308, 0x04},
581 {0x0317, 0x09},
582 {0x0325, 0x90},
583 {0x032e, 0x02},
584 {0x3605, 0x7f},
585 {0x3606, 0x80},
586 {0x362d, 0x0e},
587 {0x3662, 0x02},
588 {0x3667, 0x54},
589 {0x3671, 0x09},
590 {0x3703, 0x20},
591 {0x3706, 0x72},
592 {0x370a, 0x01},
593 {0x370b, 0x14},
594 {0x3719, 0x1f},
595 {0x371b, 0x16},
596 {0x3756, 0x9d},
597 {0x3757, 0x9d},
598 {0x376c, 0x04},
599 {0x37cc, 0x13},
600 {0x37d1, 0x72},
601 {0x37d2, 0x01},
602 {0x37d3, 0x14},
603 {0x37d4, 0x00},
604 {0x37d5, 0x6c},
605 {0x37d6, 0x00},
606 {0x37d7, 0xf7},
607 {0x3801, 0x00},
608 {0x3803, 0x00},
609 {0x3805, 0x8f},
610 {0x3807, 0xff},
611 {0x3809, 0x80},
612 {0x380b, 0xf0},
613 {0x380c, 0x02},
614 {0x380d, 0xdc},
615 {0x380e, 0x06},
616 {0x380f, 0x58},
617 //{0x380e, 0x0c},
618 //{0x380f, 0xb0},
619 {0x381c, 0x08},
620 {0x3820, 0x01},
621 {0x3833, 0x41},
622 {0x384c, 0x02},
623 {0x384d, 0xdc},
624 {0x3c5a, 0x55},
625 {0x4001, 0xef},
626 {0x4004, 0x00},
627 {0x4005, 0x40},
628 {0x400a, 0x06},
629 {0x400b, 0x40},
630 {0x402e, 0x00},
631 {0x402f, 0x40},
632 {0x4031, 0x40},
633 {0x4032, 0x0f},
634 {0x4288, 0xce},
635 {0x430b, 0x0f},
636 {0x430c, 0xfc},
637 {0x4507, 0x03},
638 {0x480e, 0x04},
639 {0x4813, 0x84},
640 {0x4837, 0x0e},
641 {0x484b, 0x67},
642 {0x5000, 0x1f},
643 {0x5001, 0x0c},
644 {0x5782, 0x18},
645 {0x5783, 0x3c},
646 {0x5788, 0x18},
647 {0x5789, 0x3c},
648 {REG_NULL, 0x00},
652 {0x0305, 0x6c},
653 {0x0308, 0x05},
654 {0x0317, 0x0a},
655 {0x0325, 0xd8},
656 {0x032e, 0x05},
657 {0x3605, 0xff},
658 {0x3606, 0x01},
659 {0x362d, 0x09},
660 {0x3662, 0x00},
661 {0x3667, 0x54},
662 {0x3671, 0x09},
663 {0x3703, 0x28},
664 {0x3706, 0xf0},
665 {0x370a, 0x03},
666 {0x370b, 0x15},
667 {0x3719, 0x24},
668 {0x371b, 0x1f},
669 {0x3756, 0xe7},
670 {0x3757, 0xe7},
671 {0x376c, 0x00},
672 {0x37cc, 0x15},
673 {0x37d1, 0xf0},
674 {0x37d2, 0x03},
675 {0x37d3, 0x15},
676 {0x37d4, 0x01},
677 {0x37d5, 0x00},
678 {0x37d6, 0x03},
679 {0x37d7, 0x15},
680 {0x3801, 0x00},
681 {0x3803, 0x00},
682 {0x3805, 0x8f},
683 {0x3807, 0xff},
684 {0x3809, 0x80},
685 {0x380b, 0xf0},
686 {0x380c, 0x05},
687 {0x380d, 0xc4},
688 {0x380e, 0x06},
689 {0x380f, 0x58},
690 {0x381c, 0x08},
691 {0x3820, 0x01},
692 {0x3833, 0x41},
693 {0x384c, 0x05},
694 {0x384d, 0xc4},
695 {0x3c5a, 0xe5},
696 {0x4001, 0xef},
697 {0x4004, 0x01},
698 {0x4005, 0x00},
699 {0x400a, 0x03},
700 {0x400b, 0x27},
701 {0x402e, 0x01},
702 {0x402f, 0x00},
703 {0x4031, 0x80},
704 {0x4032, 0x9f},
705 {0x4288, 0xce},
706 {0x430b, 0xff},
707 {0x430c, 0xff},
708 {0x4507, 0x03},
709 {0x480e, 0x04},
710 {0x4813, 0x84},
711 {0x4837, 0x0c},
712 {0x484b, 0x67},
713 {0x5000, 0x7f},
714 {0x5001, 0x0c},
715 {0x5782, 0x60},
716 {0x5783, 0xf0},
717 {0x5788, 0x60},
718 {0x5789, 0xf0},
719 {REG_NULL, 0x00},
723 {0x0305, 0x6c},
724 {0x0308, 0x05},
725 {0x0317, 0x0a},
726 {0x0325, 0xd8},
727 {0x032e, 0x05},
728 {0x3605, 0xff},
729 {0x3606, 0x01},
730 {0x362d, 0x09},
731 {0x3662, 0x00},
732 {0x3667, 0x54},
733 {0x3671, 0x09},
734 {0x3703, 0x28},
735 {0x3706, 0xf0},
736 {0x370a, 0x03},
737 {0x370b, 0x15},
738 {0x3719, 0x24},
739 {0x371b, 0x1f},
740 {0x3756, 0xe7},
741 {0x3757, 0xe7},
742 {0x376c, 0x00},
743 {0x37cc, 0x15},
744 {0x37d1, 0xf0},
745 {0x37d2, 0x03},
746 {0x37d3, 0x15},
747 {0x37d4, 0x01},
748 {0x37d5, 0x00},
749 {0x37d6, 0x03},
750 {0x37d7, 0x15},
751 {0x3801, 0x40},
752 {0x3803, 0x28},
753 {0x3805, 0x4f},
754 {0x3807, 0xd7},
755 {0x3809, 0x00},
756 {0x380b, 0xa0},
757 {0x380c, 0x05},
758 {0x380d, 0xa0},
759 {0x380e, 0x05},
760 {0x380f, 0xdc},
761 {0x381c, 0x08},
762 {0x3820, 0x01},
763 {0x3833, 0x41},
764 {0x384c, 0x05},
765 {0x384d, 0xa0},
766 {0x3c5a, 0xe5},
767 {0x4001, 0xef},
768 {0x4004, 0x00},
769 {0x4005, 0x80},
770 {0x400a, 0x03},
771 {0x400b, 0x27},
772 {0x402e, 0x00},
773 {0x402f, 0x80},
774 {0x4031, 0x80},
775 {0x4032, 0x9f},
776 {0x4288, 0xce},
777 {0x430b, 0xff},
778 {0x430c, 0xff},
779 {0x4507, 0x03},
780 {0x480e, 0x04},
781 {0x4813, 0x84},
782 {0x4837, 0x0c},
783 {0x484b, 0x67},
784 {0x5000, 0x7f},
785 {0x5001, 0x0c},
786 {0x5782, 0x60},
787 {0x5783, 0xf0},
788 {0x5788, 0x60},
789 {0x5789, 0xf0},
790 {REG_NULL, 0x00},
794 {0x0109, 0x01},
795 {0x0104, 0x02},
796 {0x0102, 0x00},
797 {0x0306, 0x00},
798 {0x0307, 0x00},
799 {0x0308, 0x04},
800 {0x030a, 0x01},
801 {0x0317, 0x09},
802 {0x0322, 0x01},
803 {0x0323, 0x02},
804 {0x0324, 0x00},
805 {0x0327, 0x05},
806 {0x0329, 0x02},
807 {0x032c, 0x02},
808 {0x032d, 0x02},
809 {0x032e, 0x02},
810 {0x300f, 0x11},
811 {0x3012, 0x21},
812 {0x3026, 0x10},
813 {0x3027, 0x08},
814 {0x302d, 0x24},
815 {0x3104, 0x01},
816 {0x3106, 0x11},
817 {0x3400, 0x00},
818 {0x3408, 0x05},
819 {0x340c, 0x0c},
820 {0x340d, 0xb0},
821 {0x3425, 0x51},
822 {0x3426, 0x10},
823 {0x3427, 0x14},
824 {0x3428, 0x10},
825 {0x3429, 0x10},
826 {0x342a, 0x10},
827 {0x342b, 0x04},
828 {0x3501, 0x02},
829 {0x3504, 0x08},
830 {0x3508, 0x01},
831 {0x3509, 0x00},
832 {0x350a, 0x01},
833 {0x3544, 0x08},
834 {0x3548, 0x01},
835 {0x3549, 0x00},
836 {0x3584, 0x08},
837 {0x3588, 0x01},
838 {0x3589, 0x00},
839 {0x3601, 0x70},
840 {0x3604, 0xe3},
841 {0x3605, 0x7f},
842 {0x3606, 0x80},
843 {0x3608, 0xa8},
844 {0x360a, 0xd0},
845 {0x360b, 0x08},
846 {0x360e, 0xc8},
847 {0x360f, 0x66},
848 {0x3610, 0x89},
849 {0x3611, 0x8a},
850 {0x3612, 0x4e},
851 {0x3613, 0xbd},
852 {0x3614, 0x9b},
853 {0x362a, 0x0e},
854 {0x362b, 0x0e},
855 {0x362c, 0x0e},
856 {0x362d, 0x0e},
857 {0x362e, 0x1a},
858 {0x362f, 0x34},
859 {0x3630, 0x67},
860 {0x3631, 0x7f},
861 {0x3638, 0x00},
862 {0x3643, 0x00},
863 {0x3644, 0x00},
864 {0x3645, 0x00},
865 {0x3646, 0x00},
866 {0x3647, 0x00},
867 {0x3648, 0x00},
868 {0x3649, 0x00},
869 {0x364a, 0x04},
870 {0x364c, 0x0e},
871 {0x364d, 0x0e},
872 {0x364e, 0x0e},
873 {0x364f, 0x0e},
874 {0x3650, 0xff},
875 {0x3651, 0xff},
876 {0x365a, 0x00},
877 {0x365b, 0x00},
878 {0x365c, 0x00},
879 {0x365d, 0x00},
880 {0x3661, 0x07},
881 {0x3662, 0x02},
882 {0x3663, 0x20},
883 {0x3665, 0x12},
884 {0x3668, 0x80},
885 {0x366c, 0x00},
886 {0x366d, 0x00},
887 {0x366e, 0x00},
888 {0x366f, 0x00},
889 {0x3673, 0x2a},
890 {0x3681, 0x80},
891 {0x3700, 0x2d},
892 {0x3701, 0x22},
893 {0x3702, 0x25},
894 {0x3703, 0x20},
895 {0x3705, 0x00},
896 {0x3706, 0x72},
897 {0x3707, 0x0a},
898 {0x3708, 0x36},
899 {0x3709, 0x57},
900 {0x370a, 0x01},
901 {0x370b, 0x14},
902 {0x3714, 0x01},
903 {0x3719, 0x1f},
904 {0x371b, 0x16},
905 {0x371c, 0x00},
906 {0x371d, 0x08},
907 {0x373f, 0x63},
908 {0x3740, 0x63},
909 {0x3741, 0x63},
910 {0x3742, 0x63},
911 {0x3743, 0x01},
912 {0x3756, 0x9d},
913 {0x3757, 0x9d},
914 {0x3762, 0x1c},
915 {0x3673, 0x2a},
916 {0x3681, 0x80},
917 {0x3700, 0x2d},
918 {0x3701, 0x22},
919 {0x3702, 0x25},
920 {0x3703, 0x20},
921 {0x3705, 0x00},
922 {0x3706, 0x72},
923 {0x3707, 0x0a},
924 {0x3708, 0x36},
925 {0x3709, 0x57},
926 {0x370a, 0x01},
927 {0x370b, 0x14},
928 {0x3714, 0x01},
929 {0x3719, 0x1f},
930 {0x371b, 0x16},
931 {0x371c, 0x00},
932 {0x371d, 0x08},
933 {0x373f, 0x63},
934 {0x3740, 0x63},
935 {0x3741, 0x63},
936 {0x3742, 0x63},
937 {0x3743, 0x01},
938 {0x3756, 0x9d},
939 {0x3757, 0x9d},
940 {0x3762, 0x1c},
941 {0x3776, 0x05},
942 {0x3777, 0x22},
943 {0x3779, 0x60},
944 {0x377c, 0x48},
945 {0x3784, 0x06},
946 {0x3785, 0x0a},
947 {0x3790, 0x10},
948 {0x3793, 0x04},
949 {0x3794, 0x07},
950 {0x3796, 0x00},
951 {0x3797, 0x02},
952 {0x379c, 0x4d},
953 {0x37a1, 0x80},
954 {0x37bb, 0x88},
955 {0x37be, 0x48},
956 {0x37bf, 0x01},
957 {0x37c0, 0x01},
958 {0x37c4, 0x72},
959 {0x37c5, 0x72},
960 {0x37c6, 0x72},
961 {0x37ca, 0x21},
962 {0x37cc, 0x13},
963 {0x37cd, 0x90},
964 {0x37cf, 0x02},
965 {0x37d0, 0x00},
966 {0x37d1, 0x72},
967 {0x37d2, 0x01},
968 {0x37d3, 0x14},
969 {0x37d4, 0x00},
970 {0x37d5, 0x6c},
971 {0x37d6, 0x00},
972 {0x37d7, 0xf7},
973 {0x37d8, 0x01},
974 {0x37dc, 0x00},
975 {0x37dd, 0x00},
976 {0x37da, 0x00},
977 {0x37db, 0x00},
978 {0x3800, 0x00},
979 {0x3801, 0x00},
980 {0x3802, 0x00},
981 {0x3803, 0x00},
982 {0x3804, 0x0a},
983 {0x3805, 0x8f},
984 {0x3806, 0x05},
985 {0x3807, 0xff},
986 {0x3808, 0x0a},
987 {0x3809, 0x80},
988 {0x380a, 0x05},
989 {0x380b, 0xf0},
990 {0x380e, 0x06},
991 {0x380f, 0x58},
992 {0x3811, 0x08},
993 {0x3813, 0x08},
994 {0x3814, 0x01},
995 {0x3815, 0x01},
996 {0x3816, 0x01},
997 {0x3817, 0x01},
998 {0x3821, 0x00},
999 {0x3822, 0x14},
1000 {0x3823, 0x18},
1001 {0x3826, 0x00},
1002 {0x3827, 0x00},
1003 {0x384c, 0x02},
1004 {0x384d, 0xdc},
1005 {0x3858, 0x3c},
1006 {0x3865, 0x02},
1007 {0x3866, 0x00},
1008 {0x3867, 0x00},
1009 {0x3868, 0x02},
1010 {0x3900, 0x13},
1011 {0x3940, 0x13},
1012 {0x3980, 0x13},
1013 {0x3c01, 0x11},
1014 {0x3c05, 0x00},
1015 {0x3c0f, 0x1c},
1016 {0x3c12, 0x0d},
1017 {0x3c19, 0x00},
1018 {0x3c21, 0x00},
1019 {0x3c3a, 0x10},
1020 {0x3c3b, 0x18},
1021 {0x3c3d, 0xc6},
1022 {0x3c5a, 0x55},
1023 {0x3c5d, 0xcf},
1024 {0x3c5e, 0xcf},
1025 {0x3d8c, 0x70},
1026 {0x3d8d, 0x10},
1027 {0x4000, 0xf9},
1028 {0x4004, 0x00},
1029 {0x4005, 0x40},
1030 {0x4008, 0x02},
1031 {0x4009, 0x11},
1032 {0x400a, 0x06},
1033 {0x400b, 0x40},
1034 {0x400e, 0x40},
1035 {0x402e, 0x00},
1036 {0x402f, 0x40},
1037 {0x4030, 0x00},
1038 {0x4031, 0x40},
1039 {0x4032, 0x0f},
1040 {0x4033, 0x80},
1041 {0x4050, 0x00},
1042 {0x4051, 0x07},
1043 {0x4011, 0xbb},
1044 {0x410f, 0x01},
1045 {0x4289, 0x00},
1046 {0x428a, 0x46},
1047 {0x430b, 0x0f},
1048 {0x430c, 0xfc},
1049 {0x430d, 0x00},
1050 {0x430e, 0x00},
1051 {0x4314, 0x04},
1052 {0x4500, 0x18},
1053 {0x4501, 0x18},
1054 {0x4503, 0x10},
1055 {0x4504, 0x00},
1056 {0x4506, 0x32},
1057 {0x4601, 0x30},
1058 {0x4603, 0x00},
1059 {0x460a, 0x50},
1060 {0x460c, 0x60},
1061 {0x4640, 0x62},
1062 {0x4646, 0xaa},
1063 {0x4647, 0x55},
1064 {0x4648, 0x99},
1065 {0x4649, 0x66},
1066 {0x464d, 0x00},
1067 {0x4654, 0x11},
1068 {0x4655, 0x22},
1069 {0x4800, 0x44},
1070 {0x4810, 0xff},
1071 {0x4811, 0xff},
1072 {0x481f, 0x30},
1073 {0x4d00, 0x4d},
1074 {0x4d01, 0x9d},
1075 {0x4d02, 0xb9},
1076 {0x4d03, 0x2e},
1077 {0x4d04, 0x4a},
1078 {0x4d05, 0x3d},
1079 {0x4d09, 0x4f},
1080 {0x5000, 0x1f},
1081 {0x5080, 0x00},
1082 {0x50c0, 0x00},
1083 {0x5100, 0x00},
1084 {0x5200, 0x00},
1085 {0x5201, 0x00},
1086 {0x5202, 0x03},
1087 {0x5203, 0xff},
1088 {0x5780, 0x53},
1089 {0x5782, 0x18},
1090 {0x5783, 0x3c},
1091 {0x5786, 0x01},
1092 {0x5788, 0x18},
1093 {0x5789, 0x3c},
1094 {0x5792, 0x11},
1095 {0x5793, 0x33},
1096 {0x5857, 0xff},
1097 {0x5858, 0xff},
1098 {0x5859, 0xff},
1099 {0x58d7, 0xff},
1100 {0x58d8, 0xff},
1101 {0x58d9, 0xff},
1102 {REG_NULL, 0x00},
1106 {0x0305, 0x5c},
1107 {0x0325, 0xd8},
1108 {0x3667, 0xd4},
1109 {0x3671, 0x08},
1110 {0x376c, 0x14},
1111 {0x380c, 0x08},
1112 {0x380d, 0x94},
1113 {0x381c, 0x00},
1114 {0x3820, 0x02},
1115 {0x3833, 0x40},
1116 {0x3c55, 0x08},
1117 {0x4001, 0x2f},
1118 {0x4288, 0xcf},
1119 {0x4507, 0x02},
1120 {0x480e, 0x00},
1121 {0x4813, 0x00},
1122 {0x4837, 0x0e},
1123 {0x484b, 0x27},
1124 {0x5001, 0x0d},
1125 {REG_NULL, 0x00},
1129 {0x0305, 0x78},
1130 {0x0325, 0x90},
1131 {0x3667, 0x54},
1132 {0x3671, 0x09},
1133 {0x376c, 0x04},
1134 {0x380c, 0x02},
1135 {0x380d, 0xdc},
1136 {0x381c, 0x08},
1137 {0x3820, 0x03},
1138 {0x3833, 0x41},
1139 {0x3c55, 0xcb},
1140 {0x4001, 0xef},
1141 {0x4288, 0xce},
1142 {0x4507, 0x03},
1143 {0x480e, 0x04},
1144 {0x4813, 0x84},
1145 {0x4837, 0x07},
1146 {0x484b, 0x67},
1147 {0x4883, 0x05},
1148 {0x4884, 0x08},
1149 {0x4885, 0x03},
1150 {0x5001, 0x0c},
1151 {REG_NULL, 0x00},
1175 .exp_def = 0x0240,
1176 .hts_def = 0x02dc * 4,
1177 .vts_def = 0x0cb0,
1181 .link_freq_idx = 0,
1194 .exp_def = 0x0240,
1195 .hts_def = 0x02dc * 4,
1196 .vts_def = 0x0658,
1197 /*.vts_def = 0x0cb0,*/
1201 .link_freq_idx = 0,
1216 .exp_def = 0x0240,
1217 .hts_def = 0x05c4 * 2,
1218 .vts_def = 0x0984,
1234 .exp_def = 0x0240,
1235 .hts_def = 0x05c4 * 2,
1236 .vts_def = 0x0658,
1255 .exp_def = 0x0200,
1256 .hts_def = 0x05a0 * 2,
1257 .vts_def = 0x05dc,
1279 .exp_def = 0x0640,
1280 .hts_def = 0x0894,
1281 .vts_def = 0x0658,
1285 .link_freq_idx = 0,
1298 .exp_def = 0x0640,
1299 .hts_def = 0x02dc * 4,
1300 .vts_def = 0x0658,
1301 /*.vts_def = 0x0cb0,*/
1342 buf[0] = reg >> 8; in os04a10_write_reg()
1343 buf[1] = reg & 0xff; in os04a10_write_reg()
1356 return 0; in os04a10_write_reg()
1363 int ret = 0; in os04a10_write_array()
1365 for (i = 0; ret == 0 && regs[i].addr != REG_NULL; i++) { in os04a10_write_array()
1380 __be32 data_be = 0; in os04a10_read_reg()
1389 msgs[0].addr = client->addr; in os04a10_read_reg()
1390 msgs[0].flags = 0; in os04a10_read_reg()
1391 msgs[0].len = 2; in os04a10_read_reg()
1392 msgs[0].buf = (u8 *)&reg_addr_be; in os04a10_read_reg()
1406 return 0; in os04a10_read_reg()
1421 int cur_best_fit = 0; in os04a10_find_best_fit()
1425 for (i = 0; i < os04a10->cfg_num; i++) { in os04a10_find_best_fit()
1444 u64 dst_link_freq = 0; in os04a10_set_fmt()
1445 u64 dst_pixel_rate = 0; in os04a10_set_fmt()
1482 return 0; in os04a10_set_fmt()
1506 fmt->reserved[0] = mode->vc[fmt->pad]; in os04a10_get_fmt()
1508 fmt->reserved[0] = mode->vc[PAD0]; in os04a10_get_fmt()
1512 return 0; in os04a10_get_fmt()
1521 if (code->index != 0) in os04a10_enum_mbus_code()
1525 return 0; in os04a10_enum_mbus_code()
1545 return 0; in os04a10_enum_frame_sizes()
1551 int ret = 0; in os04a10_enable_test_pattern()
1559 ret |= os04a10_write_reg(os04a10->client, OS04A10_REG_TEST_PATTERN + 0x40, in os04a10_enable_test_pattern()
1572 return 0; in os04a10_g_frame_interval()
1580 u32 val = 0; in os04a10_g_mbus_config()
1596 return 0; in os04a10_g_mbus_config()
1602 memset(inf, 0, sizeof(*inf)); in os04a10_get_module_inf()
1617 int ret = 0; in os04a10_set_hdrae()
1618 u8 l_cg_mode = 0; in os04a10_set_hdrae()
1619 u8 m_cg_mode = 0; in os04a10_set_hdrae()
1620 u8 s_cg_mode = 0; in os04a10_set_hdrae()
1621 u32 gain_switch = 0; in os04a10_set_hdrae()
1622 u8 is_need_switch = 0; in os04a10_set_hdrae()
1627 if (os04a10->init_hdrae_exp.short_exp_reg >= 0x90) { in os04a10_set_hdrae()
1628 dev_err(&os04a10->client->dev, "short exposure must less than 0x90 before start stream!\n"); in os04a10_set_hdrae()
1644 "rev exp req: L_exp: 0x%x, 0x%x, M_exp: 0x%x, 0x%x S_exp: 0x%x, 0x%x\n", in os04a10_set_hdrae()
1662 gain_switch |= 0x10; in os04a10_set_hdrae()
1666 gain_switch &= 0xef; in os04a10_set_hdrae()
1671 gain_switch |= 0x20; in os04a10_set_hdrae()
1675 gain_switch &= 0xdf; in os04a10_set_hdrae()
1699 (l_a_gain << 4) & 0x1ff0); in os04a10_set_hdrae()
1703 (l_d_gain << 6) & 0xfffc0); in os04a10_set_hdrae()
1711 (m_a_gain << 4) & 0x1ff0); in os04a10_set_hdrae()
1715 (m_d_gain << 6) & 0xfffc0); in os04a10_set_hdrae()
1725 (s_a_gain << 4) & 0x1ff0); in os04a10_set_hdrae()
1733 (s_d_gain << 6) & 0xfffc0); in os04a10_set_hdrae()
1735 gain_switch |= 0x40; in os04a10_set_hdrae()
1739 gain_switch &= 0xbf; in os04a10_set_hdrae()
1762 int ret = 0; in os04a10_set_conversion_gain()
1765 u32 val = 0; in os04a10_set_conversion_gain()
1766 s32 is_need_change = 0; in os04a10_set_conversion_gain()
1780 val |= 0x10; in os04a10_set_conversion_gain()
1784 val &= 0xef; in os04a10_set_conversion_gain()
1809 //ag: echo 0 > /sys/devices/platform/ff510000.i2c/i2c-1/1-0036-1/cam_s_cg
1818 int status = 0; in set_conversion_gain_status()
1819 int ret = 0; in set_conversion_gain_status()
1821 ret = kstrtoint(buf, 0, &status); in set_conversion_gain_status()
1822 if (!ret && status >= 0 && status < 2) in set_conversion_gain_status()
1825 dev_err(dev, "input 0 for LCG, 1 for HCG, cur %d\n", status); in set_conversion_gain_status()
1837 for (i = 0; i < ARRAY_SIZE(attributes); i++) in add_sysfs_interfaces()
1840 return 0; in add_sysfs_interfaces()
1842 for (i--; i >= 0 ; i--) in add_sysfs_interfaces()
1854 long ret = 0; in os04a10_ioctl()
1856 u32 stream = 0; in os04a10_ioctl()
1857 u64 dst_link_freq = 0; in os04a10_ioctl()
1858 u64 dst_pixel_rate = 0; in os04a10_ioctl()
1869 for (i = 0; i < os04a10->cfg_num; i++) { in os04a10_ioctl()
1925 if (os04a10->dcg_ratio == 0) in os04a10_ioctl()
1928 dcg->integer = (os04a10->dcg_ratio >> 8) & 0xff; in os04a10_ioctl()
1929 dcg->decimal = os04a10->dcg_ratio & 0xff; in os04a10_ioctl()
1953 u32 cg = 0; in os04a10_compat_ioctl32()
1954 u32 stream = 0; in os04a10_compat_ioctl32()
2051 int ret = 0; in os04a10_init_conversion_gain()
2053 u32 val = 0; in os04a10_init_conversion_gain()
2059 val &= ~0x70; in os04a10_init_conversion_gain()
2061 val |= 0x10; in os04a10_init_conversion_gain()
2063 val |= 0x20; in os04a10_init_conversion_gain()
2065 val |= 0x40; in os04a10_init_conversion_gain()
2116 int ret = 0; in os04a10_s_stream()
2129 if (ret < 0) { in os04a10_s_stream()
2157 int ret = 0; in os04a10_s_power()
2167 if (ret < 0) { in os04a10_s_power()
2176 0x01); in os04a10_s_power()
2212 return 0; in __os04a10_power_on()
2217 if (ret < 0) in __os04a10_power_on()
2221 if (ret < 0) in __os04a10_power_on()
2226 if (ret < 0) { in __os04a10_power_on()
2234 if (ret < 0) { in __os04a10_power_on()
2240 gpiod_direction_output(os04a10->reset_gpio, 0); in __os04a10_power_on()
2258 return 0; in __os04a10_power_on()
2281 gpiod_direction_output(os04a10->pwdn_gpio, 0); in __os04a10_power_off()
2286 gpiod_direction_output(os04a10->reset_gpio, 0); in __os04a10_power_off()
2290 if (ret < 0) in __os04a10_power_off()
2318 return 0; in os04a10_runtime_suspend()
2326 v4l2_subdev_get_try_format(sd, fh->pad, 0); in os04a10_open()
2327 const struct os04a10_mode *def_mode = &os04a10->supported_modes[0]; in os04a10_open()
2339 return 0; in os04a10_open()
2356 fie->reserved[0] = os04a10->supported_modes[fie->index].hdr_mode; in os04a10_enum_frame_interval()
2357 return 0; in os04a10_enum_frame_interval()
2405 int ret = 0; in os04a10_set_ctrl()
2407 u32 val = 0; in os04a10_set_ctrl()
2422 return 0; in os04a10_set_ctrl()
2430 dev_dbg(&client->dev, "set exposure 0x%x\n", in os04a10_set_ctrl()
2444 (again << 4) & 0x1ff0); in os04a10_set_ctrl()
2448 (dgain << 6) & 0xfffc0); in os04a10_set_ctrl()
2449 dev_dbg(&client->dev, "set analog gain 0x%x\n", in os04a10_set_ctrl()
2456 dev_dbg(&client->dev, "set vblank 0x%x\n", in os04a10_set_ctrl()
2473 if (ret == 0) in os04a10_set_ctrl()
2487 if (ret == 0) in os04a10_set_ctrl()
2491 dev_warn(&client->dev, "%s Unhandled id:0x%x, val:0x%x\n", in os04a10_set_ctrl()
2512 u64 dst_link_freq = 0; in os04a10_initialize_controls()
2513 u64 dst_pixel_rate = 0; in os04a10_initialize_controls()
2525 ARRAY_SIZE(link_freq_menu_items) - 1, 0, link_freq_menu_items); in os04a10_initialize_controls()
2533 0, PIXEL_RATE_WITH_648M, in os04a10_initialize_controls()
2564 0, 0, os04a10_test_pattern_menu); in os04a10_initialize_controls()
2567 V4L2_CID_HFLIP, 0, 1, 1, 0); in os04a10_initialize_controls()
2570 V4L2_CID_VFLIP, 0, 1, 1, 0); in os04a10_initialize_controls()
2571 os04a10->flip = 0; in os04a10_initialize_controls()
2587 return 0; in os04a10_initialize_controls()
2599 u32 id = 0; in os04a10_check_sensor_id()
2604 return 0; in os04a10_check_sensor_id()
2616 return 0; in os04a10_check_sensor_id()
2623 for (i = 0; i < OS04A10_NUM_SUPPLIES; i++) in os04a10_configure_regulators()
2634 u32 val = 0; in os04a10_get_dcg_ratio()
2635 int ret = 0; in os04a10_get_dcg_ratio()
2638 ret = os04a10_read_reg(os04a10->client, 0x77fe, in os04a10_get_dcg_ratio()
2644 ret |= os04a10_read_reg(os04a10->client, 0x77fe, in os04a10_get_dcg_ratio()
2650 if (ret != 0 || val == 0) { in os04a10_get_dcg_ratio()
2651 os04a10->dcg_ratio = 0; in os04a10_get_dcg_ratio()
2655 dev_info(dev, "get dcg ratio reg val 0x%04x\n", val); in os04a10_get_dcg_ratio()
2671 u32 i, hdr_mode = 0; in os04a10_probe()
2675 (DRIVER_VERSION & 0xff00) >> 8, in os04a10_probe()
2676 DRIVER_VERSION & 0x00ff); in os04a10_probe()
2726 for (i = 0; i < os04a10->cfg_num; i++) { in os04a10_probe()
2799 if (ret < 0) in os04a10_probe()
2803 memset(facing, 0, sizeof(facing)); in os04a10_probe()
2804 if (strcmp(os04a10->module_facing, "back") == 0) in os04a10_probe()
2805 facing[0] = 'b'; in os04a10_probe()
2807 facing[0] = 'f'; in os04a10_probe()
2824 return 0; in os04a10_probe()
2857 return 0; in os04a10_remove()
2869 { "ovti,os04a10", 0 },