From patchwork Tue May 11 08:33:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 98639 X-Patchwork-Delegate: dougsland@redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4B8XHH7027482 for ; Tue, 11 May 2010 08:33:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753994Ab0EKIdO (ORCPT ); Tue, 11 May 2010 04:33:14 -0400 Received: from mail.renesas.com ([202.234.163.13]:57044 "EHLO mail07.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753762Ab0EKIdK (ORCPT ); Tue, 11 May 2010 04:33:10 -0400 X-AuditID: ac14038b-0000000400000202-c7-4be916416205 Received: from guardian02.idc.renesas.com ([172.20.8.201]) by mail07.idc.renesas.com (sendmail) with ESMTP id o4B8X5ms025674; Tue, 11 May 2010 17:33:05 +0900 (JST) Received: (from root@localhost) by guardian02.idc.renesas.com with id o4B8X5cj024427; Tue, 11 May 2010 17:33:05 +0900 (JST) Received: from mta02.idc.renesas.com (localhost [127.0.0.1]) by mta02.idc.renesas.com with ESMTP id o4B8X7hM027881; Tue, 11 May 2010 17:33:07 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0L280085EYF4DI@ims05.idc.renesas.com>; Tue, 11 May 2010 17:33:05 +0900 (JST) Date: Tue, 11 May 2010 17:33:05 +0900 (JST) Date-warning: Date header was inserted by ims05.idc.renesas.com From: Kuninori Morimoto Subject: [PATCH v2] soc_camera_platform: Add necessary v4l2_subdev_video_ops method To: Guennadi Cc: Linux-V4L2 Message-id: MIME-version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-type: text/plain; charset=US-ASCII User-Agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.3 (i386-msvc-nt5.1.2600) MULE/5.0 (SAKAKI) Meadow/3.02-dev (RINDOU) (2009-06-17 Rev.4261) X-Brightmail-Tracker: AAAAAA== 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 (demeter.kernel.org [140.211.167.41]); Tue, 11 May 2010 08:33:17 +0000 (UTC) diff --git a/drivers/media/video/soc_camera_platform.c b/drivers/media/video/soc_camera_platform.c index 10b003a..fd4612e 100644 --- a/drivers/media/video/soc_camera_platform.c +++ b/drivers/media/video/soc_camera_platform.c @@ -56,8 +56,8 @@ soc_camera_platform_query_bus_param(struct soc_camera_device *icd) return p->bus_param; } -static int soc_camera_platform_try_fmt(struct v4l2_subdev *sd, - struct v4l2_mbus_framefmt *mf) +static int soc_camera_platform_fill_fmt(struct v4l2_subdev *sd, + struct v4l2_mbus_framefmt *mf) { struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd); @@ -65,6 +65,7 @@ static int soc_camera_platform_try_fmt(struct v4l2_subdev *sd, mf->height = p->format.height; mf->code = p->format.code; mf->colorspace = p->format.colorspace; + mf->field = V4L2_FIELD_NONE; return 0; } @@ -83,10 +84,45 @@ static int soc_camera_platform_enum_fmt(struct v4l2_subdev *sd, int index, return 0; } +static int soc_camera_platform_g_crop(struct v4l2_subdev *sd, + struct v4l2_crop *a) +{ + struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd); + + a->c.left = 0; + a->c.top = 0; + a->c.width = p->format.width; + a->c.height = p->format.height; + a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + + return 0; +} + +static int soc_camera_platform_cropcap(struct v4l2_subdev *sd, + struct v4l2_cropcap *a) +{ + struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd); + + a->bounds.left = 0; + a->bounds.top = 0; + a->bounds.width = p->format.width; + a->bounds.height = p->format.height; + a->defrect = a->bounds; + a->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + a->pixelaspect.numerator = 1; + a->pixelaspect.denominator = 1; + + return 0; +} + static struct v4l2_subdev_video_ops platform_subdev_video_ops = { .s_stream = soc_camera_platform_s_stream, - .try_mbus_fmt = soc_camera_platform_try_fmt, .enum_mbus_fmt = soc_camera_platform_enum_fmt, + .cropcap = soc_camera_platform_cropcap, + .g_crop = soc_camera_platform_g_crop, + .try_mbus_fmt = soc_camera_platform_fill_fmt, + .g_mbus_fmt = soc_camera_platform_fill_fmt, + .s_mbus_fmt = soc_camera_platform_fill_fmt, }; static struct v4l2_subdev_ops platform_subdev_ops = {