From patchwork Tue Mar 22 08:51:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kim, HeungJun" X-Patchwork-Id: 652021 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2M8rKK6015544 for ; Tue, 22 Mar 2011 08:53:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751634Ab1CVIxS (ORCPT ); Tue, 22 Mar 2011 04:53:18 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:49843 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751146Ab1CVIxS (ORCPT ); Tue, 22 Mar 2011 04:53:18 -0400 Received: from epmmp1 (mailout3.samsung.com [203.254.224.33]) by mailout3.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LIG001C2B9NKX10@mailout3.samsung.com> for linux-media@vger.kernel.org; Tue, 22 Mar 2011 17:51:23 +0900 (KST) Received: from TNRNDGASPAPP1.tn.corp.samsungelectronics.net ([165.213.149.150]) by mmp1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LIG003AGB9ND5@mmp1.samsung.com> for linux-media@vger.kernel.org; Tue, 22 Mar 2011 17:51:23 +0900 (KST) Received: from localhost.localdomain ([165.213.219.119]) by TNRNDGASPAPP1.tn.corp.samsungelectronics.net with Microsoft SMTPSVC(6.0.3790.4675); Tue, 22 Mar 2011 17:51:23 +0900 Date: Tue, 22 Mar 2011 17:51:19 +0900 From: "Kim, Heungjun" Subject: [RFC PATCH v3 1/2] v4l2-ctrls: support various modes and 4 coordinates of rectangle auto focus In-reply-to: <4D886294.5060300@samsung.com> To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com, s.nawrocki@samsung.com, kyungmin.park@samsung.com, "Kim, Heungjun" Message-id: <1300783880-15157-1-git-send-email-riverful.kim@samsung.com> X-Mailer: git-send-email 1.7.0.4 Content-transfer-encoding: 7BIT References: <4D886294.5060300@samsung.com> X-OriginalArrivalTime: 22 Mar 2011 08:51:23.0551 (UTC) FILETIME=[52548AF0:01CBE86E] Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 22 Mar 2011 08:53:21 +0000 (UTC) diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c index 2412f08..365540f 100644 --- a/drivers/media/video/v4l2-ctrls.c +++ b/drivers/media/video/v4l2-ctrls.c @@ -197,6 +197,14 @@ const char * const *v4l2_ctrl_get_menu(u32 id) "Aperture Priority Mode", NULL }; + static const char * const camera_focus_auto_mode[] = { + "Normal Mode", + "Macro Mode", + "Continuous Mode", + "Face Detection Mode", + "Rectangle Mode", + NULL + }; static const char * const colorfx[] = { "None", "Black & White", @@ -252,6 +260,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id) return camera_power_line_frequency; case V4L2_CID_EXPOSURE_AUTO: return camera_exposure_auto; + case V4L2_CID_FOCUS_AUTO_MODE: + return camera_focus_auto_mode; case V4L2_CID_COLORFX: return colorfx; case V4L2_CID_TUNE_PREEMPHASIS: @@ -365,6 +375,11 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_PRIVACY: return "Privacy"; case V4L2_CID_IRIS_ABSOLUTE: return "Iris, Absolute"; case V4L2_CID_IRIS_RELATIVE: return "Iris, Relative"; + case V4L2_CID_FOCUS_AUTO_MODE: return "Focus, Mode"; + case V4L2_CID_FOCUS_AUTO_RECTANGLE_LEFT: return "Focus, Rectangle Left"; + case V4L2_CID_FOCUS_AUTO_RECTANGLE_TOP: return "Focus, Rectangle Top"; + case V4L2_CID_FOCUS_AUTO_RECTANGLE_WIDTH: return "Focus, Rectangle Width"; + case V4L2_CID_FOCUS_AUTO_RECTANGLE_HEIGHT: return "Focus, Rectangle Height"; /* FM Radio Modulator control */ /* Keep the order of the 'case's the same as in videodev2.h! */ @@ -450,6 +465,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_MPEG_STREAM_TYPE: case V4L2_CID_MPEG_STREAM_VBI_FMT: case V4L2_CID_EXPOSURE_AUTO: + case V4L2_CID_FOCUS_AUTO_MODE: case V4L2_CID_COLORFX: case V4L2_CID_TUNE_PREEMPHASIS: *type = V4L2_CTRL_TYPE_MENU; diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index aa6c393..99cd1b7 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -1389,6 +1389,19 @@ enum v4l2_exposure_auto_type { #define V4L2_CID_IRIS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+17) #define V4L2_CID_IRIS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+18) +#define V4L2_CID_FOCUS_AUTO_MODE (V4L2_CID_CAMERA_CLASS_BASE+19) +enum v4l2_focus_mode_type { + V4L2_FOCUS_AUTO_NORMAL = 0, + V4L2_FOCUS_AUTO_MACRO = 1, + V4L2_FOCUS_AUTO_CONTINUOUS = 2, + V4L2_FOCUS_AUTO_FACE_DETECTION = 3, + V4L2_FOCUS_AUTO_RECTANGLE = 4 +}; +#define V4L2_CID_FOCUS_AUTO_RECTANGLE_LEFT (V4L2_CID_CAMERA_CLASS_BASE+20) +#define V4L2_CID_FOCUS_AUTO_RECTANGLE_TOP (V4L2_CID_CAMERA_CLASS_BASE+21) +#define V4L2_CID_FOCUS_AUTO_RECTANGLE_WIDTH (V4L2_CID_CAMERA_CLASS_BASE+22) +#define V4L2_CID_FOCUS_AUTO_RECTANGLE_HEIGHT (V4L2_CID_CAMERA_CLASS_BASE+23) + /* FM Modulator class control IDs */ #define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900) #define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1)