summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDheeraj CVR <cvr.dheeraj@gmail.com>2014-01-31 23:07:16 +0530
committerDheeraj CVR <cvr.dheeraj@gmail.com>2014-02-01 03:16:34 +0530
commit58f00475ce3549e300e7c14e9453f68076925d7e (patch)
tree6fe927504a12a674732a451f3c654ad8066bafd9
parent1b58375e1ca59336b0fb2fc411ffe88e9bf1359d (diff)
downloaddevice_samsung_smdk4412-common-58f00475ce3549e300e7c14e9453f68076925d7e.zip
device_samsung_smdk4412-common-58f00475ce3549e300e7c14e9453f68076925d7e.tar.gz
device_samsung_smdk4412-common-58f00475ce3549e300e7c14e9453f68076925d7e.tar.bz2
smdk4412-common: camera: properly enable touch to focus mode
Touch to focus is not properly enforced unless the focus mode is set to FOCUS_MODE_TOUCH. https://github.com/CyanogenMod/android_kernel_samsung_smdk4412/blob/cm-11.0/drivers/media/video/s5c73m3.c#L1857 Change-Id: I67236ae7ae687fbc0b7450102d744472a81def99
-rw-r--r--camera/exynos_camera.c45
1 files changed, 25 insertions, 20 deletions
diff --git a/camera/exynos_camera.c b/camera/exynos_camera.c
index 9657eea..6b6bce3 100644
--- a/camera/exynos_camera.c
+++ b/camera/exynos_camera.c
@@ -653,7 +653,7 @@ int exynos_camera_params_apply(struct exynos_camera *exynos_camera, int force)
int fimc_is_mode = 0;
char *focus_mode_string;
- int focus_mode = 0;
+ int focus_mode = FOCUS_MODE_DEFAULT;
char *focus_areas_string;
int focus_left, focus_top, focus_right, focus_bottom, focus_weight;
int focus_x;
@@ -923,6 +923,9 @@ int exynos_camera_params_apply(struct exynos_camera *exynos_camera, int force)
ALOGE("%s: Unable to set object y position", __func__);
}
}
+
+ focus_mode = FOCUS_MODE_TOUCH;
+
}
// Zoom
@@ -1009,7 +1012,7 @@ int exynos_camera_params_apply(struct exynos_camera *exynos_camera, int force)
ALOGE("%s: Unable to set scene mode", __func__);
}
- if (scene_mode != SCENE_MODE_NONE && !flash_mode && !focus_mode) {
+ if (scene_mode != SCENE_MODE_NONE && !flash_mode && focus_mode == FOCUS_MODE_DEFAULT) {
flash_mode = FLASH_MODE_OFF;
focus_mode = FOCUS_MODE_AUTO;
}
@@ -1057,24 +1060,26 @@ int exynos_camera_params_apply(struct exynos_camera *exynos_camera, int force)
focus_mode_string = exynos_param_string_get(exynos_camera, "focus-mode");
if (focus_mode_string != NULL) {
- if (strcmp(focus_mode_string, "auto") == 0)
- focus_mode = FOCUS_MODE_AUTO;
- else if (strcmp(focus_mode_string, "infinity") == 0)
- focus_mode = FOCUS_MODE_INFINITY;
- else if (strcmp(focus_mode_string, "macro") == 0)
- focus_mode = FOCUS_MODE_MACRO;
- else if (strcmp(focus_mode_string, "fixed") == 0)
- focus_mode = FOCUS_MODE_FIXED;
- else if (strcmp(focus_mode_string, "facedetect") == 0)
- focus_mode = FOCUS_MODE_FACEDETECT;
- else if (strcmp(focus_mode_string, "continuous-video") == 0)
- focus_mode = FOCUS_MODE_CONTINOUS_VIDEO;
- else if (strcmp(focus_mode_string, "continuous-picture") == 0)
- focus_mode = FOCUS_MODE_CONTINOUS_PICTURE;
- else {
- exynos_param_string_set(exynos_camera, "focus-mode",
- exynos_camera->raw_focus_mode);
- return -EINVAL;
+ if (focus_mode == FOCUS_MODE_DEFAULT) {
+ if (strcmp(focus_mode_string, "auto") == 0)
+ focus_mode = FOCUS_MODE_AUTO;
+ else if (strcmp(focus_mode_string, "infinity") == 0)
+ focus_mode = FOCUS_MODE_INFINITY;
+ else if (strcmp(focus_mode_string, "macro") == 0)
+ focus_mode = FOCUS_MODE_MACRO;
+ else if (strcmp(focus_mode_string, "fixed") == 0)
+ focus_mode = FOCUS_MODE_FIXED;
+ else if (strcmp(focus_mode_string, "facedetect") == 0)
+ focus_mode = FOCUS_MODE_FACEDETECT;
+ else if (strcmp(focus_mode_string, "continuous-video") == 0)
+ focus_mode = FOCUS_MODE_CONTINOUS_VIDEO;
+ else if (strcmp(focus_mode_string, "continuous-picture") == 0)
+ focus_mode = FOCUS_MODE_CONTINOUS_PICTURE;
+ else {
+ exynos_param_string_set(exynos_camera, "focus-mode",
+ exynos_camera->raw_focus_mode);
+ return -EINVAL;
+ }
}
rc = exynos_v4l2_s_ctrl(exynos_camera, 0, V4L2_CID_CAMERA_FOCUS_MODE, focus_mode);