From patchwork Fri Sep 24 17:17:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 206952 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 o8OISSA3016693 for ; Fri, 24 Sep 2010 18:28:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757382Ab0IXS21 (ORCPT ); Fri, 24 Sep 2010 14:28:27 -0400 Received: from queueout02-winn.ispmail.ntl.com ([81.103.221.56]:63822 "EHLO queueout02-winn.ispmail.ntl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757370Ab0IXS20 (ORCPT ); Fri, 24 Sep 2010 14:28:26 -0400 Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20100924171739.MSFE3075.mtaout03-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com>; Fri, 24 Sep 2010 18:17:39 +0100 Received: from zog.reactivated.net ([86.14.215.141]) by aamtaout01-winn.ispmail.ntl.com (InterMail vG.3.00.04.00 201-2196-133-20080908) with ESMTP id <20100924171739.ZZJG16999.aamtaout01-winn.ispmail.ntl.com@zog.reactivated.net>; Fri, 24 Sep 2010 18:17:39 +0100 Received: by zog.reactivated.net (Postfix, from userid 1000) id 9C15F9D401B; Fri, 24 Sep 2010 18:17:37 +0100 (BST) From: Daniel Drake To: mchehab@infradead.org Cc: linux-media@vger.kernel.org Cc: corbet@lwn.net Subject: [PATCH 3/4] ov7670: implement VIDIOC_ENUM_FRAMESIZES Message-Id: <20100924171737.9C15F9D401B@zog.reactivated.net> Date: Fri, 24 Sep 2010 18:17:37 +0100 (BST) X-Cloudmark-Analysis: v=1.1 cv=4QByPj+6Iq2k/6L54d+eVKTdgQxdscpRskJJReCfdXo= c=1 sm=0 a=MAzPhCgRXowA:10 a=Op-mwl0xAAAA:8 a=PcbD2dD59V6xSX-g-5gA:9 a=bzf-2uIYN0gQUiA2aTIA:7 a=ypt-7ygFSB8W0KX01yhRWygYV_MA:4 a=d4CUUju0HPYA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 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.3 (demeter1.kernel.org [140.211.167.41]); Fri, 24 Sep 2010 18:28:28 +0000 (UTC) diff --git a/drivers/media/video/ov7670.c b/drivers/media/video/ov7670.c index f551f63..214cebf 100644 --- a/drivers/media/video/ov7670.c +++ b/drivers/media/video/ov7670.c @@ -916,6 +916,22 @@ static int ov7670_enum_frameintervals(struct v4l2_subdev *sd, } /* + * Frame size enumeration + */ +static int ov7670_enum_framesizes(struct v4l2_subdev *sd, + struct v4l2_frmsizeenum *fsize) +{ + __u32 index = fsize->index; + if (index >= N_WIN_SIZES) + return -EINVAL; + + fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; + fsize->discrete.width = ov7670_win_sizes[index].width; + fsize->discrete.height = ov7670_win_sizes[index].height; + return 0; +} + +/* * Code for dealing with controls. */ @@ -1462,6 +1478,7 @@ static const struct v4l2_subdev_video_ops ov7670_video_ops = { .s_parm = ov7670_s_parm, .g_parm = ov7670_g_parm, .enum_frameintervals = ov7670_enum_frameintervals, + .enum_framesizes = ov7670_enum_framesizes, }; static const struct v4l2_subdev_ops ov7670_ops = {