From patchwork Tue Mar 22 12:56:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Jones X-Patchwork-Id: 652591 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 p2MCu6Mn005844 for ; Tue, 22 Mar 2011 12:56:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755981Ab1CVM4E (ORCPT ); Tue, 22 Mar 2011 08:56:04 -0400 Received: from mail2.matrix-vision.com ([85.214.244.251]:38393 "EHLO mail2.matrix-vision.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755923Ab1CVM4D (ORCPT ); Tue, 22 Mar 2011 08:56:03 -0400 Received: from mail2.matrix-vision.com (localhost [127.0.0.1]) by mail2.matrix-vision.com (Postfix) with ESMTP id 3B2263F66F; Tue, 22 Mar 2011 13:56:02 +0100 (CET) Received: from erinome (g2.matrix-vision.com [80.152.136.245]) by mail2.matrix-vision.com (Postfix) with ESMTPA id ED4E33F64D; Tue, 22 Mar 2011 13:56:01 +0100 (CET) Received: from erinome (localhost [127.0.0.1]) by erinome (Postfix) with ESMTP id 974126F8A; Tue, 22 Mar 2011 13:56:01 +0100 (CET) Received: by erinome (Postfix, from userid 108) id 8C7AA6F9C; Tue, 22 Mar 2011 13:56:01 +0100 (CET) Received: from [192.168.65.46] (host65-46.intern.matrix-vision.de [192.168.65.46]) by erinome (Postfix) with ESMTPA id 7A8C36F8A; Tue, 22 Mar 2011 13:56:01 +0100 (CET) Message-ID: <4D889C61.905@matrix-vision.de> Date: Tue, 22 Mar 2011 13:56:01 +0100 From: Michael Jones User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Linux Media Mailing List CC: =?ISO-8859-1?Q?Lo=EFc_Akue?= , Laurent Pinchart Subject: [PATCH] omap3isp: implement ENUM_FMT X-MV-Disclaimer: true (erinome) X-AV-Checked: ClamAV using ClamSMTP (erinome) X-AV-Checked: ClamAV using ClamSMTP (mail2) 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 12:56:18 +0000 (UTC) diff --git a/drivers/media/video/omap3isp/ispvideo.c b/drivers/media/video/omap3isp/ispvideo.c index a0bb5db..8e25f47 100644 --- a/drivers/media/video/omap3isp/ispvideo.c +++ b/drivers/media/video/omap3isp/ispvideo.c @@ -642,6 +642,28 @@ isp_video_get_format(struct file *file, void *fh, struct v4l2_format *format) } static int +isp_video_enum_format(struct file *file, void *fh, struct v4l2_fmtdesc *fmtdesc) +{ + struct isp_video_fh *vfh = to_isp_video_fh(fh); + struct isp_video *video = video_drvdata(file); + + if (fmtdesc->index) + return -EINVAL; + + if (fmtdesc->type != video->type) + return -EINVAL; + + fmtdesc->flags = 0; + fmtdesc->description[0] = 0; + + mutex_lock(&video->mutex); + fmtdesc->pixelformat = vfh->format.fmt.pix.pixelformat; + mutex_unlock(&video->mutex); + + return 0; +} + +static int isp_video_set_format(struct file *file, void *fh, struct v4l2_format *format) { struct isp_video_fh *vfh = to_isp_video_fh(fh); @@ -1059,6 +1081,7 @@ isp_video_s_input(struct file *file, void *fh, unsigned int input) static const struct v4l2_ioctl_ops isp_video_ioctl_ops = { .vidioc_querycap = isp_video_querycap, + .vidioc_enum_fmt_vid_cap = isp_video_enum_format, .vidioc_g_fmt_vid_cap = isp_video_get_format, .vidioc_s_fmt_vid_cap = isp_video_set_format, .vidioc_try_fmt_vid_cap = isp_video_try_format,