From patchwork Fri Feb 25 06:21:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kim, HeungJun" X-Patchwork-Id: 589341 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 p1P6MDZW029562 for ; Fri, 25 Feb 2011 06:22:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753313Ab1BYGWL (ORCPT ); Fri, 25 Feb 2011 01:22:11 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:26061 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752136Ab1BYGWL (ORCPT ); Fri, 25 Feb 2011 01:22:11 -0500 Received: from epmmp1 (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LH500GWKTNQ6WA0@mailout2.samsung.com> for linux-media@vger.kernel.org; Fri, 25 Feb 2011 15:21:26 +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 <0LH500MM3TNQA4@mmp1.samsung.com> for linux-media@vger.kernel.org; Fri, 25 Feb 2011 15:21:26 +0900 (KST) Received: from [165.213.219.118] ([165.213.219.118]) by TNRNDGASPAPP1.tn.corp.samsungelectronics.net with Microsoft SMTPSVC(6.0.3790.4675); Fri, 25 Feb 2011 15:21:26 +0900 Date: Fri, 25 Feb 2011 15:21:27 +0900 From: "Kim, HeungJun" Subject: [RFC PATCH v2 1/3] v4l2-ctrls: change the boolean type of V4L2_CID_FOCUS_AUTO to menu type To: "linux-media@vger.kernel.org" Cc: Hans Verkuil , Laurent Pinchart , Sylwester Nawrocki , "kyungmin.park@samsung.com" Reply-to: riverful.kim@samsung.com Message-id: <4D674A67.3000504@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7BIT User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; ko; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 X-OriginalArrivalTime: 25 Feb 2011 06:21:26.0810 (UTC) FILETIME=[3B870FA0:01CBD4B4] 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]); Fri, 25 Feb 2011 06:22:13 +0000 (UTC) diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c index 2412f08..0b1cce0 100644 --- a/drivers/media/video/v4l2-ctrls.c +++ b/drivers/media/video/v4l2-ctrls.c @@ -197,6 +197,13 @@ const char * const *v4l2_ctrl_get_menu(u32 id) "Aperture Priority Mode", NULL }; + static const char * const camera_focus_auto[] = { + "Manual Mode", + "Auto Mode", + "Macro Mode", + "Continuous Mode", + NULL + }; static const char * const colorfx[] = { "None", "Black & White", @@ -252,6 +259,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: + return camera_focus_auto; case V4L2_CID_COLORFX: return colorfx; case V4L2_CID_TUNE_PREEMPHASIS: @@ -416,7 +425,6 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_MPEG_VIDEO_GOP_CLOSURE: case V4L2_CID_MPEG_VIDEO_PULLDOWN: case V4L2_CID_EXPOSURE_AUTO_PRIORITY: - case V4L2_CID_FOCUS_AUTO: case V4L2_CID_PRIVACY: case V4L2_CID_AUDIO_LIMITER_ENABLED: case V4L2_CID_AUDIO_COMPRESSION_ENABLED: @@ -450,6 +458,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: 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 a94c4d5..959d59e 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -1374,6 +1374,12 @@ enum v4l2_exposure_auto_type { #define V4L2_CID_FOCUS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+10) #define V4L2_CID_FOCUS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+11) #define V4L2_CID_FOCUS_AUTO (V4L2_CID_CAMERA_CLASS_BASE+12) +enum v4l2_focus_auto_type { + V4L2_FOCUS_MANUAL = 0, + V4L2_FOCUS_AUTO = 1, + V4L2_FOCUS_MACRO = 2, + V4L2_FOCUS_CONTINUOUS = 3 +}; #define V4L2_CID_ZOOM_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+13) #define V4L2_CID_ZOOM_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+14)