1 /*****************************************************************************
13 * Source code of Sensor driver
20 *============================================================================
22 * Below this line, this part is controlled by CC/CQ. DO NOT MODIFY!!
23 *------------------------------------------------------------------------------
28 * 09 07 2012 qihao.geng
29 * [ALPS00351342] [6577JB][Camera]HDR photo is black when set anti-flicker as 60HZ
30 * Correct the write shutter function, max_shutter = frame_length - 4 + vts_differ.
32 * 09 07 2012 qihao.geng
33 * [ALPS00351342] [6577JB][Camera]HDR photo is black when set anti-flicker as 60HZ
34 * Enlarge frame length before write shutter to make sure it can take effect
37 * [ALPS00237113] [Performance][Video recording]Recording preview the screen have flash
38 * [Camera] 1. Modify the AE converge speed in the video mode.
39 * 2. Modify the isp gain delay frame with sensor exposure time and gain synchronization.
41 *------------------------------------------------------------------------------
42 * Upper this line, this part is controlled by CC/CQ. DO NOT MODIFY!!
43 *============================================================================
44 ****************************************************************************/
45 #warning "compile ov5647_Sensor_p4.c"
47 #include <linux/videodev2.h>
48 #include <linux/i2c.h>
49 #include <linux/platform_device.h>
50 #include <linux/delay.h>
51 #include <linux/cdev.h>
52 #include <linux/uaccess.h>
54 #include <asm/atomic.h>
56 #include "kd_camera_hw.h"
57 #include "kd_imgsensor.h"
58 #include "kd_imgsensor_define.h"
59 #include "kd_imgsensor_errcode.h"
61 #include "ov5647_Sensor_p4.h"
62 #include "ov5647_Camera_Sensor_para.h"
63 #include "ov5647_CameraCustomized.h"
65 MSDK_SCENARIO_ID_ENUM CurrentScenarioId
= MSDK_SCENARIO_ID_CAMERA_PREVIEW
;
66 static kal_bool OV5647AutoFlicKerMode
= KAL_FALSE
;
68 #define OV5647_TEST_PATTERN_CHECKSUM (0x53ba2977)
69 #define OV5647_DRIVER_TRACE
74 #define SENSORDB printk
76 #define SENSORDB(x,...)
80 static DEFINE_SPINLOCK(ov5647_drv_lock
);
82 extern int iReadRegI2C(u8
*a_pSendData
, u16 a_sizeSendData
, u8
* a_pRecvData
, u16 a_sizeRecvData
, u16 i2cId
);
83 extern int iWriteRegI2C(u8
*a_pSendData
, u16 a_sizeSendData
, u16 i2cId
);
84 UINT32
OV5647SetMaxFrameRate(UINT16 u2FrameRate
);
87 static OV5647_sensor_struct OV5647_sensor
=
91 // .reg = OV5647_CAMERA_SENSOR_REG_DEFAULT_VALUE,
92 // .cct = OV5647_CAMERA_SENSOR_CCT_DEFAULT_VALUE,
97 .SensorType
= CMOS_SENSOR
,
98 .SensorOutputDataFormat
= OV5647_COLOR_FORMAT
,
102 .pclk
= OV5647_PREVIEW_CLK
,
103 .frame_height
= OV5647_PV_PERIOD_LINE_NUMS
,
104 .line_length
= OV5647_PV_PERIOD_PIXEL_NUMS
,
108 kal_uint16
OV5647_write_cmos_sensor(kal_uint32 addr
, kal_uint32 para
)
110 char puSendCmd
[3] = {(char)(addr
>> 8) , (char)(addr
& 0xFF) ,(char)(para
& 0xFF)};
112 iWriteRegI2C(puSendCmd
, 3,OV5647_WRITE_ID
);
113 return (kal_uint16
)1;
115 kal_uint16
OV5647_read_cmos_sensor(kal_uint32 addr
)
117 kal_uint16 get_byte
=0;
118 char puSendCmd
[2] = {(char)(addr
>> 8) , (char)(addr
& 0xFF) };
119 iReadRegI2C(puSendCmd
, 2, (u8
*)&get_byte
,1,OV5647_WRITE_ID
);
125 static void OV5647_Write_Shutter(kal_uint16 iShutter
)
127 kal_uint16 extra_line
= 0;
129 /* 0x3500,0x3501, 0x3502 will increase VBLANK to get exposure larger than frame exposure */
130 /* AE doesn't update sensor gain at capture mode, thus extra exposure lines must be updated here. */
131 if (!iShutter
) iShutter
= 1; /* avoid 0 */
133 if(OV5647AutoFlicKerMode
){
134 //Change frame 29.5fps ~ 29.8fps to do auto flick
135 if(OV5647_sensor
.video_mode
== KAL_FALSE
){
136 if(CurrentScenarioId
== MSDK_SCENARIO_ID_CAMERA_ZSD
){
137 OV5647SetMaxFrameRate(148);
140 OV5647SetMaxFrameRate(296);
145 if(iShutter
> (OV5647_sensor
.frame_height
-4))
146 extra_line
= iShutter
- (OV5647_sensor
.frame_height
- 4);
148 // Update Extra shutter
149 OV5647_write_cmos_sensor(0x350c, (extra_line
>> 8) & 0xFF);
150 OV5647_write_cmos_sensor(0x350d, (extra_line
) & 0xFF);
153 OV5647_write_cmos_sensor(0x3500, (iShutter
>> 12) & 0xF);
154 OV5647_write_cmos_sensor(0x3501, (iShutter
>> 4) & 0xFF);
155 OV5647_write_cmos_sensor(0x3502, (iShutter
<< 4) & 0xFF);
157 } /* OV5647_Write_Shutter */
159 static void OV5647_Set_Dummy(const kal_uint16 iPixels
, const kal_uint16 iLines
)
161 kal_uint16 line_length
, frame_height
;
163 if (OV5647_sensor
.pv_mode
){
164 line_length
= OV5647_PV_PERIOD_PIXEL_NUMS
+ iPixels
;
165 frame_height
= OV5647_PV_PERIOD_LINE_NUMS
+ iLines
;
167 line_length
= OV5647_FULL_PERIOD_PIXEL_NUMS
+ iPixels
;
168 frame_height
= OV5647_FULL_PERIOD_LINE_NUMS
+ iLines
;
171 if ((line_length
>= 0x1FFF)||(frame_height
>= 0xFFF))
174 /* Add dummy pixels: */
175 /* 0x380c [0:4], 0x380d defines the PCLKs in one line of OV5647 */
176 /* Add dummy lines:*/
177 /* 0x380e [0:1], 0x380f defines total lines in one frame of OV5647 */
178 OV5647_write_cmos_sensor(0x380c, line_length
>> 8);
179 OV5647_write_cmos_sensor(0x380d, line_length
& 0xFF);
180 OV5647_write_cmos_sensor(0x380e, frame_height
>> 8);
181 OV5647_write_cmos_sensor(0x380f, frame_height
& 0xFF);
183 } /* OV5647_Set_Dummy */
185 /*Avoid Folat, frame rate =10 * u2FrameRate */
186 UINT32
OV5647SetMaxFrameRate(UINT16 u2FrameRate
)
188 kal_int16 dummy_line
;
189 kal_uint16 FrameHeight
= OV5647_sensor
.frame_height
;
192 //dummy_line = OV5647_sensor.pclk / u2FrameRate / OV5647_PV_PERIOD_PIXEL_NUMS - OV5647_PV_PERIOD_LINE_NUMS;
193 printk("10*OV5647_sensor.pclk= %d, u2FrameRate = %d,OV5647_sensor.line_length = %d\n", (10 * OV5647_sensor
.pclk
), u2FrameRate
, OV5647_sensor
.line_length
);
194 FrameHeight
= (10 * OV5647_sensor
.pclk
) / u2FrameRate
/ OV5647_sensor
.line_length
;
195 //if(FrameHeight>OV5647_sensor.frame_height){
196 spin_lock_irqsave(&ov5647_drv_lock
,flags
);
197 OV5647_sensor
.frame_height
= FrameHeight
;
198 spin_unlock_irqrestore(&ov5647_drv_lock
,flags
);
199 dummy_line
= FrameHeight
- OV5647_PV_PERIOD_LINE_NUMS
;
204 /* to fix VSYNC, to fix frame rate */
205 OV5647_Set_Dummy(0, dummy_line
); /* modify dummy_pixel must gen AE table again */
207 printk("FrameHeight = %d, dummy_line = %d, OV5647_PV_PERIOD_LINE_NUMS = %d, OV5647_FULL_PERIOD_LINE_NUMS = %d\n",FrameHeight
,dummy_line
,OV5647_PV_PERIOD_LINE_NUMS
,OV5647_FULL_PERIOD_LINE_NUMS
);
208 return (UINT32
)u2FrameRate
;
211 /*************************************************************************
216 * This function set e-shutter of OV5647 to change exposure time.
219 * iShutter : exposured lines
226 *************************************************************************/
227 void set_OV5647_shutter(kal_uint16 iShutter
)
229 spin_lock(&ov5647_drv_lock
);
230 OV5647_sensor
.shutter
= iShutter
;
231 spin_unlock(&ov5647_drv_lock
);
232 OV5647_Write_Shutter(iShutter
);
233 } /* Set_OV5647_Shutter */
236 static kal_uint16
OV5647Reg2Gain(const kal_uint8 iReg
)
239 /* Range: 1x to 32x */
240 iGain
= (iReg
>> 4) * BASEGAIN
+ (iReg
& 0xF) * BASEGAIN
/ 16;
244 kal_uint8
OV5647Gain2Reg(const kal_uint16 iGain
)
246 kal_uint16 iReg
= 0x00;
247 iReg
= ((iGain
/ BASEGAIN
) << 4) + ((iGain
% BASEGAIN
) * 16 / BASEGAIN
);
249 return (kal_uint8
)iReg
;
252 /*************************************************************************
257 * This function is to set global gain to sensor.
260 * iGain : sensor global gain(base: 0x40)
263 * the actually gain set to sensor.
267 *************************************************************************/
268 kal_uint16
OV5647_SetGain(kal_uint16 iGain
)
271 //V5647_sensor.gain = iGain;
272 /* 0x350a[0:1], 0x350b AGC real gain */
273 /* [0:3] = N meams N /16 X */
274 /* [4:9] = M meams M X */
275 /* Total gain = M + N /16 X */
276 iReg
= OV5647Gain2Reg(iGain
);
277 if (iReg
< 0x10) iReg
= 0x10;
278 //OV5647_write_cmos_sensor(0x350a, iReg);
279 OV5647_write_cmos_sensor(0x350b, iReg
);
282 /*************************************************************************
287 * This function night mode of OV5647.
290 * bEnable: KAL_TRUE -> enable night mode, otherwise, disable night mode
297 *************************************************************************/
298 void OV5647_night_mode(kal_bool enable
)
300 /*No Need to implement this function*/
302 const kal_uint16 dummy_pixel
= OV5647_sensor
.line_length
- OV5647_PV_PERIOD_PIXEL_NUMS
;
303 const kal_uint16 pv_min_fps
= enable
? OV5647_sensor
.night_fps
: OV5647_sensor
.normal_fps
;
304 kal_uint16 dummy_line
= OV5647_sensor
.frame_height
- OV5647_PV_PERIOD_LINE_NUMS
;
305 kal_uint16 max_exposure_lines
;
307 printk("[soso][OV5647_night_mode]enable=%d",enable
);
308 if (!OV5647_sensor
.video_mode
) return;
309 max_exposure_lines
= OV5647_sensor
.pclk
* OV5647_FPS(1) / (pv_min_fps
* OV5647_sensor
.line_length
);
310 if (max_exposure_lines
> OV5647_sensor
.frame_height
) /* fix max frame rate, AE table will fix min frame rate */
312 // dummy_line = max_exposure_lines - OV5647_PV_PERIOD_LINE_NUMS;
313 // OV5647_Set_Dummy(dummy_pixel, dummy_line);
316 } /* OV5647_NightMode */
319 /* write camera_para to sensor register */
320 static void OV5647_camera_para_to_sensor(void)
323 #ifdef OV5647_DRIVER_TRACE
324 SENSORDB("OV5647_camera_para_to_sensor\n");
326 for (i
= 0; 0xFFFFFFFF != OV5647_sensor
.eng
.reg
[i
].Addr
; i
++)
328 OV5647_write_cmos_sensor(OV5647_sensor
.eng
.reg
[i
].Addr
, OV5647_sensor
.eng
.reg
[i
].Para
);
330 for (i
= OV5647_FACTORY_START_ADDR
; 0xFFFFFFFF != OV5647_sensor
.eng
.reg
[i
].Addr
; i
++)
332 OV5647_write_cmos_sensor(OV5647_sensor
.eng
.reg
[i
].Addr
, OV5647_sensor
.eng
.reg
[i
].Para
);
334 OV5647_SetGain(OV5647_sensor
.gain
); /* update gain */
337 /* update camera_para from sensor register */
338 static void OV5647_sensor_to_camera_para(void)
340 kal_uint32 i
,temp_data
;
341 #ifdef OV5647_DRIVER_TRACE
342 SENSORDB("OV5647_sensor_to_camera_para\n");
344 for (i
= 0; 0xFFFFFFFF != OV5647_sensor
.eng
.reg
[i
].Addr
; i
++)
346 temp_data
= OV5647_read_cmos_sensor(OV5647_sensor
.eng
.reg
[i
].Addr
);
347 spin_lock(&ov5647_drv_lock
);
348 OV5647_sensor
.eng
.reg
[i
].Para
= temp_data
;
349 spin_unlock(&ov5647_drv_lock
);
351 for (i
= OV5647_FACTORY_START_ADDR
; 0xFFFFFFFF != OV5647_sensor
.eng
.reg
[i
].Addr
; i
++)
353 temp_data
= OV5647_read_cmos_sensor(OV5647_sensor
.eng
.reg
[i
].Addr
);
354 spin_lock(&ov5647_drv_lock
);
355 OV5647_sensor
.eng
.reg
[i
].Para
= temp_data
;
356 spin_unlock(&ov5647_drv_lock
);
360 /* ------------------------ Engineer mode ------------------------ */
361 inline static void OV5647_get_sensor_group_count(kal_int32
*sensor_count_ptr
)
363 #ifdef OV5647_DRIVER_TRACE
364 SENSORDB("OV5647_get_sensor_group_count\n");
366 *sensor_count_ptr
= OV5647_GROUP_TOTAL_NUMS
;
369 inline static void OV5647_get_sensor_group_info(MSDK_SENSOR_GROUP_INFO_STRUCT
*para
)
371 #ifdef OV5647_DRIVER_TRACE
372 SENSORDB("OV5647_get_sensor_group_info\n");
374 switch (para
->GroupIdx
)
376 case OV5647_PRE_GAIN
:
377 sprintf(para
->GroupNamePtr
, "CCT");
380 case OV5647_CMMCLK_CURRENT
:
381 sprintf(para
->GroupNamePtr
, "CMMCLK Current");
384 case OV5647_FRAME_RATE_LIMITATION
:
385 sprintf(para
->GroupNamePtr
, "Frame Rate Limitation");
388 case OV5647_REGISTER_EDITOR
:
389 sprintf(para
->GroupNamePtr
, "Register Editor");
397 inline static void OV5647_get_sensor_item_info(MSDK_SENSOR_ITEM_INFO_STRUCT
*para
)
400 const static kal_char
*cct_item_name
[] = {"SENSOR_BASEGAIN", "Pregain-R", "Pregain-Gr", "Pregain-Gb", "Pregain-B"};
401 const static kal_char
*editer_item_name
[] = {"REG addr", "REG value"};
403 #ifdef OV5647_DRIVER_TRACE
404 SENSORDB("OV5647_get_sensor_item_info\n");
406 switch (para
->GroupIdx
)
408 case OV5647_PRE_GAIN
:
409 switch (para
->ItemIdx
)
411 case OV5647_SENSOR_BASEGAIN
:
412 case OV5647_PRE_GAIN_R_INDEX
:
413 case OV5647_PRE_GAIN_Gr_INDEX
:
414 case OV5647_PRE_GAIN_Gb_INDEX
:
415 case OV5647_PRE_GAIN_B_INDEX
:
420 sprintf(para
->ItemNamePtr
, cct_item_name
[para
->ItemIdx
- OV5647_SENSOR_BASEGAIN
]);
421 para
->ItemValue
= OV5647_sensor
.eng
.cct
[para
->ItemIdx
].Para
* 1000 / BASEGAIN
;
422 para
->IsTrueFalse
= para
->IsReadOnly
= para
->IsNeedRestart
= KAL_FALSE
;
423 para
->Min
= OV5647_MIN_ANALOG_GAIN
* 1000;
424 para
->Max
= OV5647_MAX_ANALOG_GAIN
* 1000;
426 case OV5647_CMMCLK_CURRENT
:
427 switch (para
->ItemIdx
)
430 sprintf(para
->ItemNamePtr
, "Drv Cur[2,4,6,8]mA");
431 switch (OV5647_sensor
.eng
.reg
[OV5647_CMMCLK_CURRENT_INDEX
].Para
)
433 case ISP_DRIVING_2MA
:
436 case ISP_DRIVING_4MA
:
439 case ISP_DRIVING_6MA
:
442 case ISP_DRIVING_8MA
:
448 para
->IsTrueFalse
= para
->IsReadOnly
= KAL_FALSE
;
449 para
->IsNeedRestart
= KAL_TRUE
;
457 case OV5647_FRAME_RATE_LIMITATION
:
458 switch (para
->ItemIdx
)
461 sprintf(para
->ItemNamePtr
, "Max Exposure Lines");
462 para
->ItemValue
= 5998;
465 sprintf(para
->ItemNamePtr
, "Min Frame Rate");
471 para
->IsTrueFalse
= para
->IsNeedRestart
= KAL_FALSE
;
472 para
->IsReadOnly
= KAL_TRUE
;
473 para
->Min
= para
->Max
= 0;
475 case OV5647_REGISTER_EDITOR
:
476 switch (para
->ItemIdx
)
480 sprintf(para
->ItemNamePtr
, editer_item_name
[para
->ItemIdx
]);
482 para
->IsTrueFalse
= para
->IsReadOnly
= para
->IsNeedRestart
= KAL_FALSE
;
484 para
->Max
= (para
->ItemIdx
== 0 ? 0xFFFF : 0xFF);
495 inline static kal_bool
OV5647_set_sensor_item_info(MSDK_SENSOR_ITEM_INFO_STRUCT
*para
)
497 kal_uint16 temp_para
;
498 #ifdef OV5647_DRIVER_TRACE
499 SENSORDB("OV5647_set_sensor_item_info\n");
501 switch (para
->GroupIdx
)
503 case OV5647_PRE_GAIN
:
504 switch (para
->ItemIdx
)
506 case OV5647_SENSOR_BASEGAIN
:
507 case OV5647_PRE_GAIN_R_INDEX
:
508 case OV5647_PRE_GAIN_Gr_INDEX
:
509 case OV5647_PRE_GAIN_Gb_INDEX
:
510 case OV5647_PRE_GAIN_B_INDEX
:
511 spin_lock(&ov5647_drv_lock
);
512 OV5647_sensor
.eng
.cct
[para
->ItemIdx
].Para
= para
->ItemValue
* BASEGAIN
/ 1000;
513 spin_unlock(&ov5647_drv_lock
);
514 OV5647_SetGain(OV5647_sensor
.gain
); /* update gain */
520 case OV5647_CMMCLK_CURRENT
:
521 switch (para
->ItemIdx
)
524 switch (para
->ItemValue
)
527 temp_para
= ISP_DRIVING_2MA
;
531 temp_para
= ISP_DRIVING_4MA
;
535 temp_para
= ISP_DRIVING_6MA
;
538 temp_para
= ISP_DRIVING_8MA
;
541 //OV5647_set_isp_driving_current(temp_para);
542 spin_lock(&ov5647_drv_lock
);
543 OV5647_sensor
.eng
.reg
[OV5647_CMMCLK_CURRENT_INDEX
].Para
= temp_para
;
544 spin_unlock(&ov5647_drv_lock
);
550 case OV5647_FRAME_RATE_LIMITATION
:
553 case OV5647_REGISTER_EDITOR
:
554 switch (para
->ItemIdx
)
556 static kal_uint32 fac_sensor_reg
;
558 if (para
->ItemValue
< 0 || para
->ItemValue
> 0xFFFF) return KAL_FALSE
;
559 fac_sensor_reg
= para
->ItemValue
;
562 if (para
->ItemValue
< 0 || para
->ItemValue
> 0xFF) return KAL_FALSE
;
563 OV5647_write_cmos_sensor(fac_sensor_reg
, para
->ItemValue
);
575 static void OV5647_Sensor_Init(void)
577 OV5647_write_cmos_sensor(0x0100, 0x00);
578 OV5647_write_cmos_sensor(0x0103, 0x01);
580 OV5647_write_cmos_sensor(0x0100, 0x00);
581 OV5647_write_cmos_sensor(0x0100, 0x00);
582 OV5647_write_cmos_sensor(0x0100, 0x00);
583 OV5647_write_cmos_sensor(0x0100, 0x00);
585 OV5647_write_cmos_sensor(0x3011, 0x62); // Houston 20130917 increase sensor IO capability
586 OV5647_write_cmos_sensor(0x3013, 0x08);//0x04-->0x00-->0x08 Turn off internal LDO
587 OV5647_write_cmos_sensor(0x4708, 0x01/*0x00*/); // Houston 20130917 change pclk polarity
588 OV5647_write_cmos_sensor(0x5000, 0x06);
589 OV5647_write_cmos_sensor(0x5003, 0x08);
590 OV5647_write_cmos_sensor(0x5a00, 0x08);
591 OV5647_write_cmos_sensor(0x3000, 0xff);
592 OV5647_write_cmos_sensor(0x3001, 0xff);
593 OV5647_write_cmos_sensor(0x3002, 0xff);
594 OV5647_write_cmos_sensor(0x3a18, 0x01);
595 OV5647_write_cmos_sensor(0x3a19, 0xe0);
596 OV5647_write_cmos_sensor(0x3c01, 0x80);
597 OV5647_write_cmos_sensor(0x3b07, 0x0c);
598 OV5647_write_cmos_sensor(0x3630, 0x2e);
599 OV5647_write_cmos_sensor(0x3632, 0xe2);
600 OV5647_write_cmos_sensor(0x3633, 0x23);
601 OV5647_write_cmos_sensor(0x3634, 0x44);
602 OV5647_write_cmos_sensor(0x3620, 0x64);
603 OV5647_write_cmos_sensor(0x3621, 0xe0);
604 OV5647_write_cmos_sensor(0x3600, 0x37);
605 OV5647_write_cmos_sensor(0x3704, 0xa0);
606 OV5647_write_cmos_sensor(0x3703, 0x5a);
607 OV5647_write_cmos_sensor(0x3715, 0x78);
608 OV5647_write_cmos_sensor(0x3717, 0x01);
609 OV5647_write_cmos_sensor(0x3731, 0x02);
610 OV5647_write_cmos_sensor(0x370b, 0x60);
611 OV5647_write_cmos_sensor(0x3705, 0x1a);
612 OV5647_write_cmos_sensor(0x3f05, 0x02);
613 OV5647_write_cmos_sensor(0x3f06, 0x10);
614 OV5647_write_cmos_sensor(0x3f01, 0x0a);
615 OV5647_write_cmos_sensor(0x3a08, 0x00);
616 OV5647_write_cmos_sensor(0x3a0a, 0x00);
617 OV5647_write_cmos_sensor(0x3a0f, 0x58);
618 OV5647_write_cmos_sensor(0x3a10, 0x50);
619 OV5647_write_cmos_sensor(0x3a1b, 0x58);
620 OV5647_write_cmos_sensor(0x3a1e, 0x50);
621 OV5647_write_cmos_sensor(0x3a11, 0x60);
622 OV5647_write_cmos_sensor(0x3a1f, 0x28);
623 OV5647_write_cmos_sensor(0x4001, 0x02);
624 OV5647_write_cmos_sensor(0x4000, 0x09);
625 OV5647_write_cmos_sensor(0x4003, 0x08);
626 // manual AWB,manual AE,close Lenc,open WBC
627 OV5647_write_cmos_sensor(0x3503, 0x07); //;manual AE
628 OV5647_write_cmos_sensor(0x3501, 0x3c);
629 OV5647_write_cmos_sensor(0x3502, 0x00);
630 OV5647_write_cmos_sensor(0x350a, 0x00);
631 OV5647_write_cmos_sensor(0x350b, 0x7f);
632 OV5647_write_cmos_sensor(0x5001, 0x01); //;manual AWB
633 OV5647_write_cmos_sensor(0x5180, 0x08);
634 OV5647_write_cmos_sensor(0x5186, 0x04);
635 OV5647_write_cmos_sensor(0x5187, 0x00);
636 OV5647_write_cmos_sensor(0x5188, 0x04);
637 OV5647_write_cmos_sensor(0x5189, 0x00);
638 OV5647_write_cmos_sensor(0x518a, 0x04);
639 OV5647_write_cmos_sensor(0x518b, 0x00);
640 OV5647_write_cmos_sensor(0x5000, 0x06); //;No lenc,WBC on
642 OV5647_write_cmos_sensor(0x3034, 0x1a); /* PLL ctrl0 */
643 OV5647_write_cmos_sensor(0x3035, 0x21); /* Debug mode */
644 OV5647_write_cmos_sensor(0x3036, 0x4a); /* 48.1M */
645 OV5647_write_cmos_sensor(0x3037, 0x02); /* PLL ctrl3 */
647 OV5647_write_cmos_sensor(0x3106, 0xf9);
648 OV5647_write_cmos_sensor(0x303c, 0x11); /* PLLS control2 0x12*/
650 #ifdef OV5647_TEST_PATTEM
651 OV5647_write_cmos_sensor(0x503D, 0x92);
654 OV5647_write_cmos_sensor(0x0100, 0x01);
656 } /* OV5647_Sensor_Init */ /* OV5647_Sensor_Init */
659 static void OV5647_Sensor_1M(void)
661 //-------------------------------------------------------------------------------
662 // PLL MY_OUTPUT clock(fclk)
663 // fclk = (0x40 - 0x300E[5:0]) x N x Bit8Div x MCLK / M, where
664 // N = 1, 1.5, 2, 3 for 0x300F[7:6] = 0~3, respectively
665 // M = 1, 1.5, 2, 3 for 0x300F[1:0] = 0~3, respectively
666 // Bit8Div = 1, 1, 4, 5 for 0x300F[5:4] = 0~3, respectively
667 // Sys Clk = fclk / Bit8Div / SenDiv
668 // Sensor MY_OUTPUT clock(DVP PCLK)
669 // DVP PCLK = ISP CLK / DVPDiv, where
670 // ISP CLK = fclk / Bit8Div / SenDiv / CLKDiv / 2, where
671 // Bit8Div = 1, 1, 4, 5 for 0x300F[5:4] = 0~3, respectively
672 // SenDiv = 1, 2 for 0x3010[4] = 0 or 1 repectively
673 // CLKDiv = (0x3011[5:0] + 1)
674 // DVPDiv = 0x304C[3:0] * (2 ^ 0x304C[4]), if 0x304C[3:0] = 0, use 16 instead
676 // Base shutter calculation
677 // 60Hz: (1/120) * ISP Clk / QXGA_MODE_WITHOUT_DUMMY_PIXELS
678 // 50Hz: (1/100) * ISP Clk / QXGA_MODE_WITHOUT_DUMMY_PIXELS
679 //-------------------------------------------------------------------------------
680 //26M MCLK 48.1M PCLK
681 OV5647_write_cmos_sensor(0x0100, 0x00);
682 //OV5647_write_cmos_sensor(0x4005, 0x18); // update BLC, Jason
683 //OV5647_write_cmos_sensor(0x4005, 0x1A); // update BLC, mtk70677
684 OV5647_write_cmos_sensor(0x4005, 0x18);//mtk70677,Upate BLC when gain changed
685 OV5647_write_cmos_sensor(0x4051, 0x8F);
686 #ifdef OV5647_DRIVER_TRACE
687 SENSORDB("Write Reg 0x4005 = 0x18");
689 //OV5647_write_cmos_sensor(0x350c, 0x00);
690 //OV5647_write_cmos_sensor(0x350d, 0x00);
691 //OV5647_write_cmos_sensor(0x3503, 0x03); //;manual AE
692 //OV5647_write_cmos_sensor(0x3035, 0x11); /* Debug mode */
693 //OV5647_write_cmos_sensor(0x3036, 0x46); /* PLL muitiplier */
694 OV5647_write_cmos_sensor(0x3821, 0x07); /* timing tc reg21 */
695 OV5647_write_cmos_sensor(0x3820, 0x41); /* timing tc reg20 */
696 OV5647_write_cmos_sensor(0x370c, 0x03); /* Reserved */
697 OV5647_write_cmos_sensor(0x3612, 0x09); /* Reserved */
698 OV5647_write_cmos_sensor(0x3618, 0x00); /* Reserved */
699 OV5647_write_cmos_sensor(0x380c, 0x07); /* TIMING HTS 0x065e */
700 OV5647_write_cmos_sensor(0x380d, 0x68); /* TIMING HTS 1630 */
701 OV5647_write_cmos_sensor(0x380e, 0x03); /* TIMING VTS 0x03d8 */
702 OV5647_write_cmos_sensor(0x380f, 0xd8); /* TIMING VTS 984 */
703 OV5647_write_cmos_sensor(0x3814, 0x31); /* TIMING X INC */
704 OV5647_write_cmos_sensor(0x3815, 0x31); /* TIMING Y INC */
705 OV5647_write_cmos_sensor(0x3708, 0x22); /* Reserved */
706 OV5647_write_cmos_sensor(0x3709, 0x52); /* Reserved */
707 OV5647_write_cmos_sensor(0x3815, 0x31); /* ??????? */
708 OV5647_write_cmos_sensor(0x3808, 0x05); /* TIMING X OUTPUT SIZE 0x0500 */
709 OV5647_write_cmos_sensor(0x3809, 0x10); /* TIMING X OUTPUT SIZE 1280 */
710 OV5647_write_cmos_sensor(0x380a, 0x03); /* TIMING Y OUTPUT SIZE 0x03c0 */
711 OV5647_write_cmos_sensor(0x380b, 0xcc); /* TIMING Y OUTPUT SIZE 960 */
712 OV5647_write_cmos_sensor(0x3800, 0x00); /* TIMING X ADDR START */
713 OV5647_write_cmos_sensor(0x3801, 0x08); /* TIMING X ADDR START */
714 OV5647_write_cmos_sensor(0x3802, 0x00); /* TIMING Y ADDR START */
715 OV5647_write_cmos_sensor(0x3803, 0x02); /* TIMING Y ADDR START */
716 OV5647_write_cmos_sensor(0x3804, 0x0a); /* TIMING X ADDR END */
717 OV5647_write_cmos_sensor(0x3805, 0x37); /* TIMING X ADDR END */
718 OV5647_write_cmos_sensor(0x3806, 0x07); /* TIMING Y ADDR END */
719 OV5647_write_cmos_sensor(0x3807, 0xa1); /* TIMING Y ADDR END */
720 OV5647_write_cmos_sensor(0x3a09, 0x27); /* B50 STEP */
721 OV5647_write_cmos_sensor(0x3a0b, 0xf6); /* B60 STEP */
722 OV5647_write_cmos_sensor(0x3a0d, 0x04); /* B60 MAX */
723 OV5647_write_cmos_sensor(0x3a0e, 0x03); /* B50 MAX */
724 OV5647_write_cmos_sensor(0x4004, 0x02); /* BLC CTRL04 */
725 //OV5647_write_cmos_sensor(0x3106, 0xf9);
726 OV5647_write_cmos_sensor(0x3a08, 0x01); /* B50 STEP */
727 OV5647_write_cmos_sensor(0x3a09, 0x27); /* ??????? */
728 OV5647_write_cmos_sensor(0x3a0a, 0x00); /* B60 STEP */
729 OV5647_write_cmos_sensor(0x3a0b, 0xf6); /* ??????? */
730 OV5647_write_cmos_sensor(0x3a0d, 0x04); /* ??????? */
731 OV5647_write_cmos_sensor(0x3a0e, 0x03); /* ??????? */
732 //OV5647_write_cmos_sensor(0x3503, 0x07); //;manual AE
735 #if defined(__OV5647_48M__)
736 OV5647_write_cmos_sensor(0x3034, 0x1a); /* PLL ctrl0 */
737 OV5647_write_cmos_sensor(0x3035, 0x21); /* Debug mode */
738 OV5647_write_cmos_sensor(0x3036, 0x4a); /* 48.1M */
739 OV5647_write_cmos_sensor(0x3037, 0x02); /* PLL ctrl3 */
741 OV5647_write_cmos_sensor(0x3106, 0xf9);
742 OV5647_write_cmos_sensor(0x303c, 0x11); /* PLLS control2 0x12*/
743 #elif defined(__OV5647_52M__)
744 OV5647_write_cmos_sensor(0x3034, 0x1a); /* PLL ctrl0 */
745 OV5647_write_cmos_sensor(0x3035, 0x11); /* Debug mode */
746 OV5647_write_cmos_sensor(0x3036, 0x3D); /* 52.867M */
747 OV5647_write_cmos_sensor(0x3037, 0x03); /* PLL ctrl3 */
749 OV5647_write_cmos_sensor(0x3106, 0xf9);
750 OV5647_write_cmos_sensor(0x303c, 0x11); /* PLLS control2 0x12*/
751 #elif defined(__OV5647_54M__)
752 OV5647_write_cmos_sensor(0x3034, 0x1a); /* PLL ctrl0 */
753 OV5647_write_cmos_sensor(0x3035, 0x11); /* Debug mode */
754 OV5647_write_cmos_sensor(0x3036, 0x3F); /* 54.67M */
755 OV5647_write_cmos_sensor(0x3037, 0x03); /* PLL ctrl3 */
757 OV5647_write_cmos_sensor(0x3106, 0xf9);
758 OV5647_write_cmos_sensor(0x303c, 0x11); /* PLLS control2 0x12*/
760 #elif defined(__OV5647_56M__)
761 OV5647_write_cmos_sensor(0x3034, 0x1a); /* PLL ctrl0 */
762 OV5647_write_cmos_sensor(0x3035, 0x11); /* Debug mode */
763 OV5647_write_cmos_sensor(0x3036, 0x41); /* 56.333M */
764 OV5647_write_cmos_sensor(0x3037, 0x03); /* PLL ctrl3 */
766 OV5647_write_cmos_sensor(0x3106, 0xf9);
767 OV5647_write_cmos_sensor(0x303c, 0x11); /* PLLS control2 0x12*/
770 OV5647_write_cmos_sensor(0x0100, 0x01);
773 #if 1 // Houston 20131003 decrease capture frame rate due to pclk can't reach to 80MHz
774 static void OV5647_Sensor_5M(void)
776 OV5647_write_cmos_sensor(0x0100, 0x00);
777 //OV5647_write_cmos_sensor(0x350c, 0x00);
778 //OV5647_write_cmos_sensor(0x350d, 0x00);
779 //OV5647_write_cmos_sensor(0x3503, 0x03); //;manual AE
780 OV5647_write_cmos_sensor(0x3821, 0x06);
781 OV5647_write_cmos_sensor(0x3820, 0x00);
782 OV5647_write_cmos_sensor(0x370c, 0x00);
783 OV5647_write_cmos_sensor(0x3612, 0x0b);
784 OV5647_write_cmos_sensor(0x3618, 0x04);
785 //OV5647_write_cmos_sensor(0x380c, 0x0a); /* TIMING HTS 0x0a8c */
786 //OV5647_write_cmos_sensor(0x380d, 0x8c); /* TIMING HTS 2700 */
787 OV5647_write_cmos_sensor(0x380c, 0x0b); /* TIMING HTS 0x0bfe */
788 OV5647_write_cmos_sensor(0x380d, 0xef); /* TIMING HTS 3055 */
789 OV5647_write_cmos_sensor(0x380e, 0x07); /* TIMING VTS 0x07b0 */
790 OV5647_write_cmos_sensor(0x380f, 0xb0); /* TIMING VTS 1968 */
791 OV5647_write_cmos_sensor(0x3814, 0x11);
792 //OV5647_write_cmos_sensor(0x3815, 0x11); //0909 for test
793 OV5647_write_cmos_sensor(0x3708, 0x24);
794 OV5647_write_cmos_sensor(0x3709, 0x12);
795 OV5647_write_cmos_sensor(0x3815, 0x11);
797 OV5647_write_cmos_sensor(0x3808, 0x0a); /* TIMING X OUTPUT SIZE 0x0a20 */
798 OV5647_write_cmos_sensor(0x3809, 0x20); /* TIMING X OUTPUT SIZE 2592 */
799 OV5647_write_cmos_sensor(0x380a, 0x07); /* TIMING Y OUTPUT SIZE 0x0798*/
800 OV5647_write_cmos_sensor(0x380b, 0x98); /* TIMING Y OUTPUT SIZE 1944 */
801 OV5647_write_cmos_sensor(0x3800, 0x00); /* TIMING X ADDR START */
802 OV5647_write_cmos_sensor(0x3801, 0x0c); /* TIMING X ADDR START */
803 OV5647_write_cmos_sensor(0x3802, 0x00); /* TIMING Y ADDR START */
804 OV5647_write_cmos_sensor(0x3803, 0x04); /* TIMING Y ADDR START */
805 OV5647_write_cmos_sensor(0x3804, 0x0a); /* TIMING X ADDR END */
806 OV5647_write_cmos_sensor(0x3805, 0x33); /* TIMING X ADDR END */
807 OV5647_write_cmos_sensor(0x3806, 0x07); /* TIMING Y ADDR END */
808 OV5647_write_cmos_sensor(0x3807, 0xa3); /* TIMING Y ADDR END */
810 OV5647_write_cmos_sensor(0x3a09, 0x27);
811 OV5647_write_cmos_sensor(0x3a0b, 0xf6);
812 OV5647_write_cmos_sensor(0x3a0d, 0x08);
813 OV5647_write_cmos_sensor(0x3a0e, 0x06);
814 OV5647_write_cmos_sensor(0x4004, 0x04);
815 OV5647_write_cmos_sensor(0x3a08, 0x00);
816 OV5647_write_cmos_sensor(0x3a09, 0x94);
817 OV5647_write_cmos_sensor(0x3a0a, 0x00);
818 OV5647_write_cmos_sensor(0x3a0b, 0x7b);
819 OV5647_write_cmos_sensor(0x3a0d, 0x10);
820 OV5647_write_cmos_sensor(0x3a0e, 0x0d);
821 //OV5647_write_cmos_sensor(0x3503, 0x07); //;manual AE
822 OV5647_write_cmos_sensor(0x0100, 0x01);
827 static void OV5647_Sensor_5M_15fps(void)
829 //kal_uint8 iTemp1 = OV5647_read_cmos_sensor(0x3820) & 0x06;
830 //kal_uint8 iTemp2 = OV5647_read_cmos_sensor(0x3821) & 0x06;
831 OV5647_write_cmos_sensor( 0x0100, 0x00); //15fps
832 OV5647_write_cmos_sensor(0x4005, 0x1a); // update BLC, Jason
834 #ifdef OV5647_DRIVER_TRACE
835 SENSORDB("Write Reg 0x4005 = 0x1a");
837 OV5647_write_cmos_sensor( 0x303c, 0x11);
838 //OV5647_write_cmos_sensor( 0x3821, iTemp2);
839 //OV5647_write_cmos_sensor( 0x3820, iTemp1);
840 OV5647_write_cmos_sensor(0x3821, 0x07); /* timing tc reg21 */
841 OV5647_write_cmos_sensor(0x3820, 0x41); /* timing tc reg20 */
842 OV5647_write_cmos_sensor( 0x370c, 0x00);
843 OV5647_write_cmos_sensor( 0x3612, 0x0b);
844 OV5647_write_cmos_sensor( 0x3618, 0x04);
845 OV5647_write_cmos_sensor( 0x380c, 0x0a);
846 OV5647_write_cmos_sensor( 0x380d, 0x8c); //2700
847 OV5647_write_cmos_sensor( 0x380e, 0x07);
848 OV5647_write_cmos_sensor( 0x380f, 0xb0);//1968
849 OV5647_write_cmos_sensor( 0x3814, 0x11);
850 OV5647_write_cmos_sensor( 0x3815, 0x11);
851 OV5647_write_cmos_sensor( 0x3708, 0x24);
852 OV5647_write_cmos_sensor( 0x3709, 0x12);
853 OV5647_write_cmos_sensor( 0x3815, 0x11);
855 OV5647_write_cmos_sensor(0x3808, 0x0a); /* TIMING X OUTPUT SIZE 0x0a20 */
856 OV5647_write_cmos_sensor(0x3809, 0x20); /* TIMING X OUTPUT SIZE 2592 */
857 OV5647_write_cmos_sensor(0x380a, 0x07); /* TIMING Y OUTPUT SIZE 0x0798*/
858 OV5647_write_cmos_sensor(0x380b, 0x98); /* TIMING Y OUTPUT SIZE 1944 */
859 OV5647_write_cmos_sensor(0x3800, 0x00); /* TIMING X ADDR START */
860 OV5647_write_cmos_sensor(0x3801, 0x0c); /* TIMING X ADDR START */
861 OV5647_write_cmos_sensor(0x3802, 0x00); /* TIMING Y ADDR START */
862 OV5647_write_cmos_sensor(0x3803, 0x04); /* TIMING Y ADDR START */
863 OV5647_write_cmos_sensor(0x3804, 0x0a); /* TIMING X ADDR END */
864 OV5647_write_cmos_sensor(0x3805, 0x33); /* TIMING X ADDR END */
865 OV5647_write_cmos_sensor(0x3806, 0x07); /* TIMING Y ADDR END */
866 OV5647_write_cmos_sensor(0x3807, 0xa3); /* TIMING Y ADDR END */
868 OV5647_write_cmos_sensor( 0x3a09, 0x27);
869 OV5647_write_cmos_sensor( 0x3a0b, 0xf6);
870 OV5647_write_cmos_sensor( 0x3a0d, 0x08);
871 OV5647_write_cmos_sensor( 0x3a0e, 0x06);
872 OV5647_write_cmos_sensor( 0x4004, 0x04);
873 OV5647_write_cmos_sensor( 0x3034, 0x1a);
874 OV5647_write_cmos_sensor( 0x3035, 0x11);
875 OV5647_write_cmos_sensor( 0x3036, 0x3e);
876 OV5647_write_cmos_sensor( 0x3037, 0x02);
877 OV5647_write_cmos_sensor( 0x303c, 0x11);
878 OV5647_write_cmos_sensor( 0x3a08, 0x01);
879 OV5647_write_cmos_sensor( 0x3a09, 0x27);
880 OV5647_write_cmos_sensor( 0x3a0a, 0x00);
881 OV5647_write_cmos_sensor( 0x3a0b, 0xf6);
882 OV5647_write_cmos_sensor( 0x3a0d, 0x08);
883 OV5647_write_cmos_sensor( 0x3a0e, 0x06);
884 OV5647_write_cmos_sensor( 0x3503, 0x07);//soso
885 OV5647_write_cmos_sensor( 0x0100, 0x01);
889 /*****************************************************************************/
890 /* Windows Mobile Sensor Interface */
891 /*****************************************************************************/
892 /*************************************************************************
897 * This function initialize the registers of CMOS sensor
907 *************************************************************************/
909 UINT32
OV5647Open(void)
911 kal_uint16 sensor_id
=0;
913 // check if sensor ID correct
914 sensor_id
=((OV5647_read_cmos_sensor(0x300A) << 8) | OV5647_read_cmos_sensor(0x300B));
915 #ifdef OV5647_DRIVER_TRACE
916 SENSORDB("OV5647Open, sensor_id:%x \n",sensor_id
);
918 if (sensor_id
!= OV5647_SENSOR_ID
)
919 return ERROR_SENSOR_CONNECT_FAIL
;
921 /* initail sequence write in */
922 OV5647_Sensor_Init();
923 spin_lock(&ov5647_drv_lock
);
924 OV5647AutoFlicKerMode
= KAL_FALSE
;
925 OV5647_sensor
.Prv_line_length
= OV5647_PV_PERIOD_PIXEL_NUMS
;//For ZSD
926 spin_unlock(&ov5647_drv_lock
);
930 /*************************************************************************
935 * This function get the sensor ID
938 * *sensorID : return the sensor ID
945 *************************************************************************/
946 UINT32
OV5647GetSensorID(UINT32
*sensorID
)
948 // check if sensor ID correct
949 *sensorID
=((OV5647_read_cmos_sensor(0x300A) << 8) | OV5647_read_cmos_sensor(0x300B));
950 #ifdef OV5647_DRIVER_TRACE
951 SENSORDB("OV5647GetSensorID, sensor_id:%x \n",*sensorID
);
953 if (*sensorID
!= OV5647_SENSOR_ID
) {
954 *sensorID
= 0xFFFFFFFF;
955 return ERROR_SENSOR_CONNECT_FAIL
;
961 /*************************************************************************
966 * This function is to turn off sensor module power.
976 *************************************************************************/
977 UINT32
OV5647Close(void)
979 #ifdef OV5647_DRIVER_TRACE
980 SENSORDB("OV5647Close\n");
982 //CISModulePowerOn(FALSE);
983 // DRV_I2CClose(OV5647hDrvI2C);
987 /*************************************************************************
992 * This function start the sensor preview.
995 * *image_window : address pointer of pixel numbers in one period of HSYNC
996 * *sensor_config_data : address pointer of line numbers in one period of VSYNC
1003 *************************************************************************/
1004 UINT32
OV5647Preview(MSDK_SENSOR_EXPOSURE_WINDOW_STRUCT
*image_window
,
1005 MSDK_SENSOR_CONFIG_STRUCT
*sensor_config_data
)
1007 kal_uint16 dummy_line
;
1008 #ifdef OV5647_DRIVER_TRACE
1009 SENSORDB("[%s]\n",__FUNCTION__
);
1014 spin_lock(&ov5647_drv_lock
);
1015 OV5647_sensor
.pv_mode
= KAL_TRUE
;
1017 //OV5647_set_mirror(sensor_config_data->SensorImageMirror);
1018 switch (sensor_config_data
->SensorOperationMode
)
1020 case MSDK_SENSOR_OPERATION_MODE_VIDEO
:
1021 OV5647_sensor
.video_mode
= KAL_TRUE
;
1023 default: /* ISP_PREVIEW_MODE */
1024 OV5647_sensor
.video_mode
= KAL_FALSE
;
1028 OV5647_sensor
.line_length
= OV5647_PV_PERIOD_PIXEL_NUMS
;
1029 OV5647_sensor
.Prv_line_length
=OV5647_sensor
.line_length
;//For Capture Funtion to calculate capture shutter
1030 OV5647_sensor
.frame_height
= OV5647_PV_PERIOD_LINE_NUMS
+dummy_line
;
1032 #ifdef CAPTURE_15FPS
1033 OV5647_sensor
.pclk
= OV5647_PREVIEW_CLK
;
1035 spin_unlock(&ov5647_drv_lock
);
1036 OV5647_Set_Dummy(0, dummy_line
); /* modify dummy_pixel must gen AE table again */
1037 //OV5647_Write_Shutter(OV5647_sensor.shutter);
1039 //printk("[soso][OV5647Preview]shutter=%x,shutter=%d\n",OV5647_sensor.shutter,OV5647_sensor.shutter);
1042 } /* OV5647Preview */
1044 /*************************************************************************
1049 * This function setup the CMOS sensor in capture MY_OUTPUT mode
1058 *************************************************************************/
1059 UINT32
OV5647Capture(MSDK_SENSOR_EXPOSURE_WINDOW_STRUCT
*image_window
,
1060 MSDK_SENSOR_CONFIG_STRUCT
*sensor_config_data
)
1062 const kal_uint32 pv_line_length
= (kal_uint32
)OV5647_sensor
.Prv_line_length
;
1063 kal_uint32 shutter
= (kal_uint32
)OV5647_sensor
.shutter
;
1065 kal_uint16 dummy_pixel
;
1067 spin_lock(&ov5647_drv_lock
);
1068 OV5647_sensor
.video_mode
= KAL_FALSE
;
1069 OV5647AutoFlicKerMode
= KAL_FALSE
;
1070 spin_unlock(&ov5647_drv_lock
);
1071 //if(OV5647_sensor.pv_mode == KAL_TRUE)
1073 spin_lock(&ov5647_drv_lock
);
1074 OV5647_sensor
.pv_mode
= KAL_FALSE
;
1075 spin_unlock(&ov5647_drv_lock
);
1076 #ifdef CAPTURE_15FPS
1077 OV5647_Sensor_5M_15fps();
1078 spin_lock(&ov5647_drv_lock
);
1079 OV5647_sensor
.pclk
= 80600000;
1080 spin_unlock(&ov5647_drv_lock
);
1081 cap_fps
= OV5647_FPS(15);
1084 OV5647_Set_Dummy(0, 0);
1085 spin_lock(&ov5647_drv_lock
);
1086 OV5647_sensor
.line_length
= OV5647_FULL_PERIOD_PIXEL_NUMS
;
1087 OV5647_sensor
.frame_height
= OV5647_FULL_PERIOD_LINE_NUMS
;
1088 spin_unlock(&ov5647_drv_lock
);
1089 //806 is cpature PCLK 481 is preivew PCLK
1090 //shutter = shutter * pv_line_length * 806/OV5647_sensor.line_length/481;
1091 //shutter = shutter * (((kal_uint32)(pv_line_length * 806))/((kal_uint32)(OV5647_sensor.line_length * 481)));
1092 //shutter = shutter * (((kal_uint32)(pv_line_length * 806 ))/((kal_uint32)(OV5647_sensor.line_length * 481)));
1093 //shutter = (shutter * (((kal_uint32)(pv_line_length * 806 * 1000))/((kal_uint32)(OV5647_sensor.line_length * 481))))/1000 - 3;
1094 //shutter = shutter * (((kal_uint32)(pv_line_length * 806000))/((kal_uint32)(OV5647_sensor.line_length * 563333)));
1095 //shutter = shutter * (((kal_uint32)(pv_line_length * 806000))/((kal_uint32)(OV5647_sensor.line_length * 481000)));
1096 #if defined(__OV5647_48M__)
1097 shutter
= (shutter
* (((kal_uint32
)(pv_line_length
* 806 * 1000))/((kal_uint32
)(OV5647_sensor
.line_length
* 481))))/1000;
1098 #elif defined(__OV5647_52M__)
1099 shutter
= (shutter
* (((kal_uint32
)(pv_line_length
* 806 * 1000))/((kal_uint32
)(OV5647_sensor
.line_length
* 528667))));
1100 #elif defined(__OV5647_54M__)
1101 shutter
= (shutter
* (((kal_uint32
)(pv_line_length
* 806 * 1000))/((kal_uint32
)(OV5647_sensor
.line_length
* 546))))/1000;
1102 #elif defined(__OV5647_56M__)
1103 shutter
= (shutter
* (((kal_uint32
)(pv_line_length
* 806 * 1000))/((kal_uint32
)(OV5647_sensor
.line_length
* 563))))/1000;
1109 spin_lock(&ov5647_drv_lock
);
1110 OV5647_sensor
.pclk
= OV5647_PREVIEW_CLK
;
1111 spin_unlock(&ov5647_drv_lock
);
1113 cap_fps
= OV5647_FPS(8);
1114 dummy_pixel
= OV5647_sensor
.pclk
* OV5647_FPS(1) / (OV5647_FULL_PERIOD_LINE_NUMS
* cap_fps
);
1115 dummy_pixel
= dummy_pixel
< OV5647_FULL_PERIOD_PIXEL_NUMS
? 0 : dummy_pixel
- OV5647_FULL_PERIOD_PIXEL_NUMS
;
1116 OV5647_Set_Dummy(dummy_pixel
, 0);
1117 spin_lock(&ov5647_drv_lock
);
1118 OV5647_sensor
.line_length
= OV5647_FULL_PERIOD_PIXEL_NUMS
+dummy_pixel
;
1119 OV5647_sensor
.frame_height
= OV5647_FULL_PERIOD_LINE_NUMS
;
1120 spin_unlock(&ov5647_drv_lock
);
1122 /* shutter translation */
1123 shutter
= shutter
* pv_line_length
/ OV5647_sensor
.line_length
;
1125 printk("[soso][capture]shutter=%x",shutter
);
1126 OV5647_Write_Shutter((kal_uint16
)shutter
);
1131 } /* OV5647_Capture() */
1133 UINT32
OV5647GetResolution(MSDK_SENSOR_RESOLUTION_INFO_STRUCT
*pSensorResolution
)
1135 pSensorResolution
->SensorFullWidth
=OV5647_IMAGE_SENSOR_FULL_WIDTH
;
1136 pSensorResolution
->SensorFullHeight
=OV5647_IMAGE_SENSOR_FULL_HEIGHT
;
1137 pSensorResolution
->SensorPreviewWidth
=OV5647_IMAGE_SENSOR_PV_WIDTH
;
1138 pSensorResolution
->SensorPreviewHeight
=OV5647_IMAGE_SENSOR_PV_HEIGHT
;
1139 pSensorResolution
->SensorVideoWidth
=OV5647_IMAGE_SENSOR_VIDEO_WIDTH
;
1140 pSensorResolution
->SensorVideoHeight
=OV5647_IMAGE_SENSOR_VIDEO_HEIGHT
;
1141 #ifdef OV5647_DRIVER_TRACE
1142 SENSORDB("[%s] ===> Full(%d x %d) , Preview (%d x %d) , Video (%d x %d)\n",__FUNCTION__
,
1143 pSensorResolution
->SensorFullWidth
, pSensorResolution
->SensorFullHeight
,
1144 pSensorResolution
->SensorPreviewWidth
, pSensorResolution
->SensorPreviewHeight
,
1145 pSensorResolution
->SensorVideoWidth
, pSensorResolution
->SensorVideoHeight
);
1148 } /* OV5647GetResolution() */
1150 UINT32
OV5647GetInfo(MSDK_SCENARIO_ID_ENUM ScenarioId
,
1151 MSDK_SENSOR_INFO_STRUCT
*pSensorInfo
,
1152 MSDK_SENSOR_CONFIG_STRUCT
*pSensorConfigData
)
1155 #ifdef OV5647_DRIVER_TRACE
1156 char scenario_str
[10][20]={"PREVIEW","CAPTURE_JPEG","VIDEO_PREVIEW","HIGH SPEED VIDEO","ZSD","3D PREVIEW","3D CAPTURE", "3D VIDEO", "TV OUT", "MAX" };
1157 SENSORDB("[%s] ===> ScenarioId(%d):%s , SensorType: %d\n",__FUNCTION__
, ScenarioId
, scenario_str
[ScenarioId
] , pSensorInfo
->SensroInterfaceType
);
1161 pSensorInfo
->SensorPreviewResolutionX
=OV5647_IMAGE_SENSOR_PV_WIDTH
;
1162 pSensorInfo
->SensorPreviewResolutionY
=OV5647_IMAGE_SENSOR_PV_HEIGHT
;
1163 pSensorInfo
->SensorFullResolutionX
=OV5647_IMAGE_SENSOR_FULL_WIDTH
;
1164 pSensorInfo
->SensorFullResolutionY
=OV5647_IMAGE_SENSOR_FULL_HEIGHT
;
1167 pSensorInfo
->SensorCameraPreviewFrameRate
=30;
1168 pSensorInfo
->SensorVideoFrameRate
=30;
1169 pSensorInfo
->SensorStillCaptureFrameRate
=10;
1170 pSensorInfo
->SensorWebCamCaptureFrameRate
=15;
1171 pSensorInfo
->SensorResetActiveHigh
=TRUE
; //low active
1172 pSensorInfo
->SensorResetDelayCount
=5;
1173 pSensorInfo
->SensorOutputDataFormat
=OV5647_COLOR_FORMAT
;
1174 pSensorInfo
->SensorClockPolarity
=SENSOR_CLOCK_POLARITY_LOW
;
1175 pSensorInfo
->SensorClockFallingPolarity
=SENSOR_CLOCK_POLARITY_LOW
;
1176 pSensorInfo
->SensorHsyncPolarity
= SENSOR_CLOCK_POLARITY_LOW
;
1177 pSensorInfo
->SensorVsyncPolarity
= SENSOR_CLOCK_POLARITY_LOW
;
1179 // Houston 20130916 add SensorInterfaceType +++
1180 pSensorInfo
->SensorInterruptDelayLines
= 3;
1181 pSensorInfo
->SensroInterfaceType
=SENSOR_INTERFACE_TYPE_PARALLEL
;
1182 // Houston 20130916 add SensorInterfaceType ---
1184 pSensorInfo
->CaptureDelayFrame
= 2;
1185 pSensorInfo
->PreviewDelayFrame
= 2;//1; // Houston 20130917 increase pv delay frame to fix pclk phase shift
1186 pSensorInfo
->VideoDelayFrame
= 1;
1188 pSensorInfo
->SensorMasterClockSwitch
= 0;
1189 pSensorInfo
->SensorDrivingCurrent
= ISP_DRIVING_2MA
;//ISP_DRIVING_4MA;//ISP_DRIVING_6MA;//ISP_DRIVING_8MA; // Houston 20130917 increase pv delay frame to fix pclk phase shift
1190 pSensorInfo
->AEShutDelayFrame
= 0; /* The frame of setting shutter default 0 for TG int */
1191 pSensorInfo
->AESensorGainDelayFrame
= 0; /* The frame of setting sensor gain */
1192 pSensorInfo
->AEISPGainDelayFrame
= 2;
1195 case MSDK_SCENARIO_ID_CAMERA_PREVIEW
:
1196 case MSDK_SCENARIO_ID_VIDEO_PREVIEW
:
1197 //case MSDK_SCENARIO_ID_VIDEO_CAPTURE_MPEG4:
1198 pSensorInfo
->SensorClockFreq
= 26;
1199 pSensorInfo
->SensorClockDividCount
= 3;
1200 pSensorInfo
->SensorClockRisingCount
= 0;
1201 pSensorInfo
->SensorClockFallingCount
= 2;
1202 pSensorInfo
->SensorPixelClockCount
= 3;
1203 pSensorInfo
->SensorDataLatchCount
= 2;
1204 pSensorInfo
->SensorGrabStartX
= OV5647_PV_X_START
;
1205 pSensorInfo
->SensorGrabStartY
= OV5647_PV_Y_START
;
1208 case MSDK_SCENARIO_ID_CAMERA_CAPTURE_JPEG
:
1209 //case MSDK_SCENARIO_ID_CAMERA_CAPTURE_MEM:
1210 case MSDK_SCENARIO_ID_CAMERA_ZSD
:
1211 pSensorInfo
->SensorClockFreq
=26;
1212 pSensorInfo
->SensorClockDividCount
= 3;
1213 pSensorInfo
->SensorClockRisingCount
=0;
1214 pSensorInfo
->SensorClockFallingCount
=2;
1215 pSensorInfo
->SensorPixelClockCount
=3;
1216 pSensorInfo
->SensorDataLatchCount
=2;
1217 pSensorInfo
->SensorGrabStartX
= OV5647_FULL_X_START
;
1218 pSensorInfo
->SensorGrabStartY
= OV5647_FULL_Y_START
;
1221 pSensorInfo
->SensorClockFreq
=26;
1222 pSensorInfo
->SensorClockDividCount
=3;
1223 pSensorInfo
->SensorClockRisingCount
=0;
1224 pSensorInfo
->SensorClockFallingCount
=2;
1225 pSensorInfo
->SensorPixelClockCount
=3;
1226 pSensorInfo
->SensorDataLatchCount
=2;
1227 pSensorInfo
->SensorGrabStartX
= OV5647_PV_X_START
;
1228 pSensorInfo
->SensorGrabStartY
= OV5647_PV_Y_START
;
1232 OV5647PixelClockDivider
=pSensorInfo
->SensorPixelClockCount
;
1233 memcpy(pSensorConfigData
, &OV5647SensorConfigData
, sizeof(MSDK_SENSOR_CONFIG_STRUCT
));
1236 } /* OV5647GetInfo() */
1239 UINT32
OV5647Control(MSDK_SCENARIO_ID_ENUM ScenarioId
, MSDK_SENSOR_EXPOSURE_WINDOW_STRUCT
*pImageWindow
,
1240 MSDK_SENSOR_CONFIG_STRUCT
*pSensorConfigData
)
1243 #ifdef OV5647_DRIVER_TRACE
1244 char scenario_str
[10][20]={"PREVIEW","CAPTURE_JPEG","VIDEO_PREVIEW","HIGH SPEED VIDEO","ZSD","3D PREVIEW","3D CAPTURE", "3D VIDEO", "TV OUT", "MAX" };
1245 SENSORDB("[%s] ===> ScenarioId(%d):%s\n",__FUNCTION__
, ScenarioId
, scenario_str
[ScenarioId
]);
1248 CurrentScenarioId
= ScenarioId
;
1251 case MSDK_SCENARIO_ID_CAMERA_PREVIEW
:
1252 case MSDK_SCENARIO_ID_VIDEO_PREVIEW
:
1253 //case MSDK_SCENARIO_ID_VIDEO_CAPTURE_MPEG4:
1254 OV5647Preview(pImageWindow
, pSensorConfigData
);
1256 case MSDK_SCENARIO_ID_CAMERA_CAPTURE_JPEG
:
1257 //case MSDK_SCENARIO_ID_CAMERA_CAPTURE_MEM:
1258 case MSDK_SCENARIO_ID_CAMERA_ZSD
:
1259 OV5647Capture(pImageWindow
, pSensorConfigData
);
1262 #ifdef OV5647_DRIVER_TRACE
1263 SENSORDB("\nOV5647Control <== return ERROR_INVALID_SCENARIO_ID (0x%x) \n", ERROR_INVALID_SCENARIO_ID
);
1265 return ERROR_INVALID_SCENARIO_ID
;
1267 #ifdef OV5647_DRIVER_TRACE
1268 SENSORDB("\nOV5647Control <== return TRUE \n");
1271 } /* OV5647Control() */
1275 UINT32
OV5647SetVideoMode(UINT16 u2FrameRate
)
1277 //printk("[soso][OV5647SetMaxFrameRate]u2FrameRate=%d",u2FrameRate);
1278 spin_lock(&ov5647_drv_lock
);
1280 if(u2FrameRate
== 30){
1281 OV5647_sensor
.NightMode
= KAL_FALSE
;
1282 }else if(u2FrameRate
== 15){
1283 OV5647_sensor
.NightMode
= KAL_TRUE
;
1284 }else if(u2FrameRate
== 0){
1285 //For Dynamic frame rate,Nothing to do
1286 OV5647_sensor
.video_mode
= KAL_FALSE
;
1287 spin_unlock(&ov5647_drv_lock
);
1294 OV5647_sensor
.video_mode
= KAL_TRUE
;
1295 OV5647_sensor
.FixedFps
= u2FrameRate
;
1296 spin_unlock(&ov5647_drv_lock
);
1298 if((u2FrameRate
== 30)&&(OV5647AutoFlicKerMode
==KAL_TRUE
))
1301 u2FrameRate
= 10 * u2FrameRate
;
1303 OV5647SetMaxFrameRate(u2FrameRate
);
1304 OV5647_Write_Shutter(OV5647_sensor
.shutter
);//From Meimei Video issue
1308 UINT32
OV5647SetAutoFlickerMode(kal_bool bEnable
, UINT16 u2FrameRate
)
1312 spin_lock(&ov5647_drv_lock
);
1313 OV5647AutoFlicKerMode
= KAL_TRUE
;
1314 spin_unlock(&ov5647_drv_lock
);
1315 /*Change frame rate 29.5fps to 29.8fps to do Auto flick*/
1316 if((OV5647_sensor
.FixedFps
== 30)&&(OV5647_sensor
.video_mode
==KAL_TRUE
))
1317 OV5647SetMaxFrameRate(296);
1318 if((OV5647_sensor
.FixedFps
== 15)&&(OV5647_sensor
.video_mode
==KAL_TRUE
))
1319 OV5647SetMaxFrameRate(148);
1320 }else{//Cancel Auto flick
1321 spin_lock(&ov5647_drv_lock
);
1322 OV5647AutoFlicKerMode
= KAL_FALSE
;
1323 spin_unlock(&ov5647_drv_lock
);
1324 if((OV5647_sensor
.FixedFps
== 30)&&(OV5647_sensor
.video_mode
==KAL_TRUE
))
1325 OV5647SetMaxFrameRate(300);
1326 if((OV5647_sensor
.FixedFps
== 15)&&(OV5647_sensor
.video_mode
==KAL_TRUE
))
1327 OV5647SetMaxFrameRate(150);
1332 UINT32
OV5647SetTestPatternMode(kal_bool bEnable
)
1334 SENSORDB("[OV5647SetTestPatternMode] Test pattern enable:%d\n", bEnable
);
1337 OV5647_write_cmos_sensor(0x503D,0x80);
1341 OV5647_write_cmos_sensor(0x503D,0x00);
1347 UINT32
OV5647FeatureControl(MSDK_SENSOR_FEATURE_ENUM FeatureId
,
1348 UINT8
*pFeaturePara
,UINT32
*pFeatureParaLen
)
1350 UINT16
*pFeatureReturnPara16
=(UINT16
*) pFeaturePara
;
1351 UINT16
*pFeatureData16
=(UINT16
*) pFeaturePara
;
1352 UINT32
*pFeatureReturnPara32
=(UINT32
*) pFeaturePara
;
1353 // UINT32 *pFeatureData32=(UINT32 *) pFeaturePara;
1354 // UINT32 OV5647SensorRegNumber;
1356 //PNVRAM_SENSOR_DATA_STRUCT pSensorDefaultData=(PNVRAM_SENSOR_DATA_STRUCT) pFeaturePara;
1357 //MSDK_SENSOR_CONFIG_STRUCT *pSensorConfigData=(MSDK_SENSOR_CONFIG_STRUCT *) pFeaturePara;
1358 MSDK_SENSOR_REG_INFO_STRUCT
*pSensorRegData
=(MSDK_SENSOR_REG_INFO_STRUCT
*) pFeaturePara
;
1359 //MSDK_SENSOR_GROUP_INFO_STRUCT *pSensorGroupInfo=(MSDK_SENSOR_GROUP_INFO_STRUCT *) pFeaturePara;
1360 //MSDK_SENSOR_ITEM_INFO_STRUCT *pSensorItemInfo=(MSDK_SENSOR_ITEM_INFO_STRUCT *) pFeaturePara;
1361 //MSDK_SENSOR_ENG_INFO_STRUCT *pSensorEngInfo=(MSDK_SENSOR_ENG_INFO_STRUCT *) pFeaturePara;
1363 #ifdef OV5647_DRIVER_TRACE
1364 SENSORDB("[%s] ===> FeatureId: %d\n", __FUNCTION__
, FeatureId
);
1369 case SENSOR_FEATURE_GET_RESOLUTION
:
1370 *pFeatureReturnPara16
++=OV5647_IMAGE_SENSOR_FULL_WIDTH
;
1371 *pFeatureReturnPara16
=OV5647_IMAGE_SENSOR_FULL_HEIGHT
;
1374 case SENSOR_FEATURE_GET_PERIOD
: /* 3 */
1375 *pFeatureReturnPara16
++=OV5647_sensor
.line_length
;
1376 *pFeatureReturnPara16
=OV5647_sensor
.frame_height
;
1379 case SENSOR_FEATURE_GET_PIXEL_CLOCK_FREQ
: /* 3 */
1380 *pFeatureReturnPara32
= OV5647_sensor
.pclk
;
1383 case SENSOR_FEATURE_SET_ESHUTTER
: /* 4 */
1384 set_OV5647_shutter(*pFeatureData16
);
1386 case SENSOR_FEATURE_SET_NIGHTMODE
:
1387 OV5647_night_mode((BOOL
) *pFeatureData16
);
1389 case SENSOR_FEATURE_SET_GAIN
: /* 6 */
1390 OV5647_SetGain((UINT16
) *pFeatureData16
);
1392 case SENSOR_FEATURE_SET_FLASHLIGHT
:
1394 case SENSOR_FEATURE_SET_ISP_MASTER_CLOCK_FREQ
:
1396 case SENSOR_FEATURE_SET_REGISTER
:
1397 OV5647_write_cmos_sensor(pSensorRegData
->RegAddr
, pSensorRegData
->RegData
);
1399 case SENSOR_FEATURE_GET_REGISTER
:
1400 pSensorRegData
->RegData
= OV5647_read_cmos_sensor(pSensorRegData
->RegAddr
);
1402 case SENSOR_FEATURE_SET_CCT_REGISTER
:
1403 memcpy(&OV5647_sensor
.eng
.cct
, pFeaturePara
, sizeof(OV5647_sensor
.eng
.cct
));
1406 case SENSOR_FEATURE_GET_CCT_REGISTER
: /* 12 */
1407 if (*pFeatureParaLen
>= sizeof(OV5647_sensor
.eng
.cct
) + sizeof(kal_uint32
))
1409 *((kal_uint32
*)pFeaturePara
++) = sizeof(OV5647_sensor
.eng
.cct
);
1410 memcpy(pFeaturePara
, &OV5647_sensor
.eng
.cct
, sizeof(OV5647_sensor
.eng
.cct
));
1413 case SENSOR_FEATURE_SET_ENG_REGISTER
:
1414 memcpy(&OV5647_sensor
.eng
.reg
, pFeaturePara
, sizeof(OV5647_sensor
.eng
.reg
));
1416 case SENSOR_FEATURE_GET_ENG_REGISTER
: /* 14 */
1417 if (*pFeatureParaLen
>= sizeof(OV5647_sensor
.eng
.reg
) + sizeof(kal_uint32
))
1419 *((kal_uint32
*)pFeaturePara
++) = sizeof(OV5647_sensor
.eng
.reg
);
1420 memcpy(pFeaturePara
, &OV5647_sensor
.eng
.reg
, sizeof(OV5647_sensor
.eng
.reg
));
1422 case SENSOR_FEATURE_GET_REGISTER_DEFAULT
:
1423 ((PNVRAM_SENSOR_DATA_STRUCT
)pFeaturePara
)->Version
= NVRAM_CAMERA_SENSOR_FILE_VERSION
;
1424 ((PNVRAM_SENSOR_DATA_STRUCT
)pFeaturePara
)->SensorId
= OV5647_SENSOR_ID
;
1425 memcpy(((PNVRAM_SENSOR_DATA_STRUCT
)pFeaturePara
)->SensorEngReg
, &OV5647_sensor
.eng
.reg
, sizeof(OV5647_sensor
.eng
.reg
));
1426 memcpy(((PNVRAM_SENSOR_DATA_STRUCT
)pFeaturePara
)->SensorCCTReg
, &OV5647_sensor
.eng
.cct
, sizeof(OV5647_sensor
.eng
.cct
));
1427 *pFeatureParaLen
= sizeof(NVRAM_SENSOR_DATA_STRUCT
);
1429 case SENSOR_FEATURE_GET_CONFIG_PARA
:
1430 memcpy(pFeaturePara
, &OV5647_sensor
.cfg_data
, sizeof(OV5647_sensor
.cfg_data
));
1431 *pFeatureParaLen
= sizeof(OV5647_sensor
.cfg_data
);
1433 case SENSOR_FEATURE_CAMERA_PARA_TO_SENSOR
:
1434 OV5647_camera_para_to_sensor();
1436 case SENSOR_FEATURE_SENSOR_TO_CAMERA_PARA
:
1437 OV5647_sensor_to_camera_para();
1439 case SENSOR_FEATURE_GET_GROUP_COUNT
:
1440 OV5647_get_sensor_group_count((kal_uint32
*)pFeaturePara
);
1441 *pFeatureParaLen
= 4;
1443 OV5647_get_sensor_group_info((MSDK_SENSOR_GROUP_INFO_STRUCT
*)pFeaturePara
);
1444 *pFeatureParaLen
= sizeof(MSDK_SENSOR_GROUP_INFO_STRUCT
);
1446 case SENSOR_FEATURE_GET_ITEM_INFO
:
1447 OV5647_get_sensor_item_info((MSDK_SENSOR_ITEM_INFO_STRUCT
*)pFeaturePara
);
1448 *pFeatureParaLen
= sizeof(MSDK_SENSOR_ITEM_INFO_STRUCT
);
1450 case SENSOR_FEATURE_SET_ITEM_INFO
:
1451 OV5647_set_sensor_item_info((MSDK_SENSOR_ITEM_INFO_STRUCT
*)pFeaturePara
);
1452 *pFeatureParaLen
= sizeof(MSDK_SENSOR_ITEM_INFO_STRUCT
);
1454 case SENSOR_FEATURE_GET_ENG_INFO
:
1455 memcpy(pFeaturePara
, &OV5647_sensor
.eng_info
, sizeof(OV5647_sensor
.eng_info
));
1456 *pFeatureParaLen
= sizeof(OV5647_sensor
.eng_info
);
1458 case SENSOR_FEATURE_GET_LENS_DRIVER_ID
:
1459 // get the lens driver ID from EEPROM or just return LENS_DRIVER_ID_DO_NOT_CARE
1460 // if EEPROM does not exist in camera module.
1461 *pFeatureReturnPara32
=LENS_DRIVER_ID_DO_NOT_CARE
;
1464 case SENSOR_FEATURE_SET_VIDEO_MODE
:
1465 OV5647SetVideoMode(*pFeatureData16
);
1467 case SENSOR_FEATURE_CHECK_SENSOR_ID
:
1468 OV5647GetSensorID(pFeatureReturnPara32
);
1470 case SENSOR_FEATURE_SET_AUTO_FLICKER_MODE
:
1471 OV5647SetAutoFlickerMode((BOOL
)*pFeatureData16
,*(pFeatureData16
+1));
1473 case SENSOR_FEATURE_SET_TEST_PATTERN
:
1474 OV5647SetTestPatternMode((BOOL
)*pFeatureData16
);
1476 case SENSOR_FEATURE_GET_TEST_PATTERN_CHECKSUM_VALUE
:
1477 *pFeatureReturnPara32
= OV5647_TEST_PATTERN_CHECKSUM
;
1482 #ifdef OV5647_DRIVER_TRACE
1483 SENSORDB("[%s] ===> FeatureId: %d , Not Implement !!! \n", __FUNCTION__
, FeatureId
);
1488 } /* OV5647FeatureControl() */
1489 SENSOR_FUNCTION_STRUCT SensorFuncOV5647
=
1493 OV5647GetResolution
,
1494 OV5647FeatureControl
,
1499 UINT32
OV5647SensorInit(PSENSOR_FUNCTION_STRUCT
*pfFunc
)
1501 /* To Do : Check Sensor status here */
1503 *pfFunc
=&SensorFuncOV5647
;
1506 } /* SensorInit() */