From patchwork Mon Jun 21 05:19:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 107127 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 o5L5KFgA009638 for ; Mon, 21 Jun 2010 05:20:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752788Ab0FUFUO (ORCPT ); Mon, 21 Jun 2010 01:20:14 -0400 Received: from tango.tkos.co.il ([62.219.50.35]:35044 "EHLO tango.tkos.co.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752513Ab0FUFUN (ORCPT ); Mon, 21 Jun 2010 01:20:13 -0400 Received: from jasper (89-139-13-28.bb.netvision.net.il [89.139.13.28]) (authenticated bits=0) by tango.tkos.co.il (8.14.4/8.12.11) with ESMTP id o5L5K8Ys031599; Mon, 21 Jun 2010 08:20:10 +0300 From: Baruch Siach To: Linux Media Mailing List Cc: Baruch Siach Subject: [PATCH] soc_camera_platform: add set_fmt callback Date: Mon, 21 Jun 2010 08:19:57 +0300 Message-Id: <266c646d111590fda11bd3bbecfe49dea6789e4e.1277097465.git.baruch@tkos.co.il> X-Mailer: git-send-email 1.7.1 X-Spam-Level: -2.212 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.62 on 62.219.50.35 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]); Mon, 21 Jun 2010 05:20:16 +0000 (UTC) diff --git a/drivers/media/video/soc_camera_platform.c b/drivers/media/video/soc_camera_platform.c index 248c986..208fd42 100644 --- a/drivers/media/video/soc_camera_platform.c +++ b/drivers/media/video/soc_camera_platform.c @@ -61,6 +61,9 @@ static int soc_camera_platform_try_fmt(struct v4l2_subdev *sd, { struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd); + if (p->try_fmt) + return p->try_fmt(p, mf); + mf->width = p->format.width; mf->height = p->format.height; mf->code = p->format.code; diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h index 0ecefe2..0558ffc 100644 --- a/include/media/soc_camera_platform.h +++ b/include/media/soc_camera_platform.h @@ -22,6 +22,8 @@ struct soc_camera_platform_info { struct v4l2_mbus_framefmt format; unsigned long bus_param; struct device *dev; + int (*try_fmt)(struct soc_camera_platform_info *info, + struct v4l2_mbus_framefmt *mf); int (*set_capture)(struct soc_camera_platform_info *info, int enable); };