From patchwork Wed May 20 16:39:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Towle X-Patchwork-Id: 29743 X-Patchwork-Delegate: g.liakhovetski@gmx.de Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1YvMNV-0002hF-Lz; Thu, 21 May 2015 11:02:57 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.76/mailfrontend-5) with esmtp id 1YvMNT-0000Ck-9E; Thu, 21 May 2015 11:02:57 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932112AbbEUJCv (ORCPT + 1 other); Thu, 21 May 2015 05:02:51 -0400 Received: from 82-70-136-246.dsl.in-addr.zen.co.uk ([82.70.136.246]:56267 "EHLO xk120.dyn.ducie.codethink.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754455AbbEUJCt (ORCPT ); Thu, 21 May 2015 05:02:49 -0400 Received: from william by xk120.dyn.ducie.codethink.co.uk with local (Exim 4.80) (envelope-from ) id 1Yv72J-0004Dn-NH; Wed, 20 May 2015 17:40:03 +0100 From: William Towle To: linux-kernel@lists.codethink.co.uk, linux-media@vger.kernel.org Cc: g.liakhovetski@gmx.de, sergei.shtylyov@cogentembedded.com, hverkuil@xs4all.nl, rob.taylor@codethink.co.uk Subject: [PATCH 20/20] media: soc_camera: Add debugging for get_formats Date: Wed, 20 May 2015 17:39:40 +0100 Message-Id: <1432139980-12619-21-git-send-email-william.towle@codethink.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1432139980-12619-1-git-send-email-william.towle@codethink.co.uk> References: <1432139980-12619-1-git-send-email-william.towle@codethink.co.uk> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2015.5.21.85416 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, REFERENCES 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __REFERENCES 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' From: Rob Taylor Some helpful debugging for get_formats use, useful for debugging v4l2-compliance issues. Signed-off-by: Rob Taylor Reviewed-by: William Towle --- drivers/media/platform/soc_camera/soc_camera.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c index 583c5e6..503e9b6 100644 --- a/drivers/media/platform/soc_camera/soc_camera.c +++ b/drivers/media/platform/soc_camera/soc_camera.c @@ -522,7 +522,7 @@ static int soc_camera_init_user_formats(struct soc_camera_device *icd) /* Second pass - actually fill data formats */ fmts = 0; - for (i = 0; i < raw_fmts; i++) + for (i = 0; i < raw_fmts; i++) { if (!ici->ops->get_formats) { code.index = i; v4l2_subdev_call(sd, pad, enum_mbus_code, NULL, &code); @@ -537,6 +537,8 @@ static int soc_camera_init_user_formats(struct soc_camera_device *icd) goto egfmt; fmts += ret; } + dev_dbg(icd->pdev, " Format: %x %c%c%c%c", icd->user_formats[fmts-1].code, pixfmtstr(icd->user_formats[fmts-1].host_fmt->fourcc)); + } icd->num_user_formats = fmts; icd->current_fmt = &icd->user_formats[0]; @@ -732,6 +734,8 @@ static int soc_camera_open(struct file *file) * apart from someone else calling open() simultaneously, but * .host_lock is protecting us against it. */ + + dev_dbg(icd->pdev, "%s:%d calling set_fmt with size %d x %d",__func__, __LINE__, f.fmt.pix.width, f.fmt.pix.height); ret = soc_camera_set_fmt(icd, &f); if (ret < 0) goto esfmt; @@ -2234,6 +2238,7 @@ static int soc_camera_pdrv_probe(struct platform_device *pdev) icd->user_width = DEFAULT_WIDTH; icd->user_height = DEFAULT_HEIGHT; + dev_dbg(icd->pdev, "%s:%d setting default user size to %d x %d",__func__, __LINE__, icd->user_width, icd->user_height); return soc_camera_device_register(icd); }