From patchwork Tue Mar 22 08:50:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kim, HeungJun" X-Patchwork-Id: 652011 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 p2M8p0Bp014262 for ; Tue, 22 Mar 2011 08:51:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752644Ab1CVIu5 (ORCPT ); Tue, 22 Mar 2011 04:50:57 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:54986 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752221Ab1CVIu5 (ORCPT ); Tue, 22 Mar 2011 04:50:57 -0400 Received: from epmmp2 (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LIG00EUEB8VXB10@mailout4.samsung.com> for linux-media@vger.kernel.org; Tue, 22 Mar 2011 17:50:55 +0900 (KST) Received: from TNRNDGASPAPP1.tn.corp.samsungelectronics.net ([165.213.149.150]) by mmp2.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LIG00KHAB8WT0@mmp2.samsung.com> for linux-media@vger.kernel.org; Tue, 22 Mar 2011 17:50:56 +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:50:55 +0900 Date: Tue, 22 Mar 2011 17:50:45 +0900 From: "Kim, Heungjun" Subject: [RFC PATCH v3 1/2] v4l2-ctrls: support various modes and 4 coordinates of rectangle auto focus 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: <1300783846-15083-1-git-send-email-riverful.kim@samsung.com> X-Mailer: git-send-email 1.7.0.4 Content-transfer-encoding: 7BIT X-OriginalArrivalTime: 22 Mar 2011 08:50:55.0769 (UTC) FILETIME=[41C55890: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:51:00 +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)