summaryrefslogtreecommitdiffstats
path: root/libcamera/SecCamera.cpp
diff options
context:
space:
mode:
authorJeong-Seok Yang <jseok.yang@samsung.com>2010-09-30 15:01:07 -0700
committerSimon Wilson <simonwilson@google.com>2010-10-04 12:56:59 -0700
commitdf1a5b0d586e0d684b22ca02c52da9d846ef374d (patch)
tree5ec193796bcf77635d08e24f4f98b3fe24f3cb77 /libcamera/SecCamera.cpp
parent7b8b6c31705402c57dae994060030bb90bad917d (diff)
downloaddevice_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/SecCamera.cpp')
-rw-r--r--libcamera/SecCamera.cpp34
1 files changed, 34 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