From patchwork Fri Jan 23 03:09:35 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 444 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Fri, 23 Jan 2009 04:05:17 +0000 Received: from vger.kernel.org ([209.132.176.167]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1LQDID-0006Wy-Gf for mchehab@infradead.org; Fri, 23 Jan 2009 04:05:17 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754309AbZAWEFQ (ORCPT ); Thu, 22 Jan 2009 23:05:16 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754643AbZAWEFQ (ORCPT ); Thu, 22 Jan 2009 23:05:16 -0500 Received: from mail.renesas.com ([202.234.163.13]:52946 "EHLO mail06.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754309AbZAWEFO (ORCPT ); Thu, 22 Jan 2009 23:05:14 -0500 X-AuditID: ac14038a-0000000500001ca1-9b-497941f5156e Received: from guardian01.idc.renesas.com ([172.20.8.200]) by mail06.idc.renesas.com (sendmail) with ESMTP id n0N459GR010045; Fri, 23 Jan 2009 13:05:09 +0900 (JST) Received: (from root@localhost) by guardian01.idc.renesas.com with id n0N459oQ016448; Fri, 23 Jan 2009 13:05:09 +0900 (JST) Received: from mta01.idc.renesas.com (localhost [127.0.0.1]) by mta01.idc.renesas.com with ESMTP id n0N459gI013472; Fri, 23 Jan 2009 13:05:09 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0KDW00C67OOLMJ@ims05.idc.renesas.com>; Fri, 23 Jan 2009 13:05:09 +0900 (JST) Date: Fri, 23 Jan 2009 12:09:35 +0900 From: Kuninori Morimoto Subject: [PATCH] ov772x: add support S_CROP operation. To: Guennadi Liakhovetski Cc: Linux Media 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.1 (i386-mingw-nt5.1.2600) MULE/5.0 (SAKAKI) Meadow/3.00-dev (KIKU) X-Brightmail-Tracker: AAAAAA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org ov772x_set_fmt had returned NULL when pixfmt is 0, although it mean only geometry change. This patch modify this problem. Signed-off-by: Kuninori Morimoto --- drivers/media/video/ov772x.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/media/video/ov772x.c b/drivers/media/video/ov772x.c index 681a11b..30eb80e 100644 --- a/drivers/media/video/ov772x.c +++ b/drivers/media/video/ov772x.c @@ -792,12 +792,15 @@ static int ov772x_set_fmt(struct soc_camera_device *icd, /* * select format + * when pixfmt is 0, only geometry change */ - priv->fmt = NULL; - for (i = 0; i < ARRAY_SIZE(ov772x_cfmts); i++) { - if (pixfmt == ov772x_cfmts[i].fourcc) { - priv->fmt = ov772x_cfmts + i; - break; + if (pixfmt) { + priv->fmt = NULL; + for (i = 0; i < ARRAY_SIZE(ov772x_cfmts); i++) { + if (pixfmt == ov772x_cfmts[i].fourcc) { + priv->fmt = ov772x_cfmts + i; + break; + } } } if (!priv->fmt)