diff options
author | Jeong-Seok Yang <jseok.yang@samsung.com> | 2010-09-30 15:01:07 -0700 |
---|---|---|
committer | Simon Wilson <simonwilson@google.com> | 2010-10-04 12:56:59 -0700 |
commit | df1a5b0d586e0d684b22ca02c52da9d846ef374d (patch) | |
tree | 5ec193796bcf77635d08e24f4f98b3fe24f3cb77 /libcamera | |
parent | 7b8b6c31705402c57dae994060030bb90bad917d (diff) | |
download | device_samsung_crespo-df1a5b0d586e0d684b22ca02c52da9d846ef374d.zip device_samsung_crespo-df1a5b0d586e0d684b22ca02c52da9d846ef374d.tar.gz device_samsung_crespo-df1a5b0d586e0d684b22ca02c52da9d846ef374d.tar.bz2 |
libcamera: defensive code for protecting ESD
Change-Id: I3333df8437bb54897df8594229ffcc1b23221f7f
Signed-off-by: Jeong-Seok Yang <jseok.yang@samsung.com>
Diffstat (limited to 'libcamera')
-rw-r--r-- | libcamera/SecCamera.cpp | 34 | ||||
-rw-r--r-- | libcamera/SecCamera.h | 7 |
2 files changed, 41 insertions, 0 deletions
diff --git a/libcamera/SecCamera.cpp b/libcamera/SecCamera.cpp index fb3ea77..59d9d27 100644 --- a/libcamera/SecCamera.cpp +++ b/libcamera/SecCamera.cpp @@ -706,6 +706,10 @@ SecCamera::SecCamera() : m_camera_af_flag(-1), m_shot_mode(0), m_flag_init(0) +#ifdef ENABLE_ESD_PREVIEW_CHECK + , + m_esd_check_count(0) +#endif // ENABLE_ESD_PREVIEW_CHECK { LOGV("%s()", __func__); #ifdef BOARD_USES_SDTV @@ -1405,6 +1409,15 @@ int SecCamera::getPreview() int ret; #endif +#ifdef ENABLE_ESD_PREVIEW_CHECK + int status = 0; + + if (!(++m_esd_check_count % 60)) { + status = getCameraSensorESDStatus(); + m_esd_check_count = 0; + } +#endif // ENABLE_ESD_PREVIEW_CHECK + #ifdef PERFORMANCE LOG_TIME_DEFINE(0) @@ -1422,7 +1435,12 @@ int SecCamera::getPreview() #else #ifdef SWP1_CAMERA_ADD_ADVANCED_FUNCTION + +#ifdef ENABLE_ESD_PREVIEW_CHECK + if (m_flag_camera_start == 0 || fimc_esd_poll(&m_events_c) == 0 || status) { +#else if (m_flag_camera_start == 0 || fimc_esd_poll(&m_events_c) == 0) { +#endif LOGE("ERR(%s):Start Camera Device Reset \n", __func__); /* GAUDI Project([arun.c@samsung.com]) 2010.05.20. [Implemented ESD code] */ /* @@ -1442,6 +1460,10 @@ int SecCamera::getPreview() //setCameraSensorReset(); ret = startPreview(); +#ifdef ENABLE_ESD_PREVIEW_CHECK + m_esd_check_count = 0; +#endif // ENABLE_ESD_PREVIEW_CHECK + if (ret < 0) { LOGE("ERR(%s): startPreview() return %d\n", __func__, ret); return 0; @@ -3305,6 +3327,18 @@ int SecCamera::setDataLineCheckStop(void) #endif +#ifdef ENABLE_ESD_PREVIEW_CHECK +int SecCamera::getCameraSensorESDStatus(void) +{ + LOGV("%s", __func__); + + // 0 : normal operation, 1 : abnormal operation + int status = fimc_v4l2_g_ctrl(m_cam_fd, V4L2_CID_ESD_INT); + + return status; +} +#endif // ENABLE_ESD_PREVIEW_CHECK + // ====================================================================== // Jpeg diff --git a/libcamera/SecCamera.h b/libcamera/SecCamera.h index 282eda7..38f706e 100644 --- a/libcamera/SecCamera.h +++ b/libcamera/SecCamera.h @@ -719,6 +719,9 @@ public: int setDataLineCheckStop(void); int setDefultIMEI(int imei); int getDefultIMEI(void); +#ifdef ENABLE_ESD_PREVIEW_CHECK + int getCameraSensorESDStatus(void); +#endif // ENABLE_ESD_PREVIEW_CHECK #endif void setFrameRate(int frame_rate); @@ -852,6 +855,10 @@ private: int m_postview_offset; +#ifdef ENABLE_ESD_PREVIEW_CHECK + int m_esd_check_count; +#endif // ENABLE_ESD_PREVIEW_CHECK + exif_attribute_t mExifInfo; struct fimc_buffer m_buffers_c[MAX_BUFFERS]; |