From patchwork Sat Oct 31 23:16:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOpbWV0aCBNw6FydG9u?= X-Patchwork-Id: 1930 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Sat, 31 Oct 2009 23:16:38 +0000 Received: from bombadil.infradead.org [18.85.46.34] by caramujo.chehab.org with IMAP (fetchmail-6.3.6) for (single-drop); Sat, 31 Oct 2009 21:22:08 -0200 (BRST) Received: from vger.kernel.org ([209.132.176.167]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1N4NBV-0002BA-R8; Sat, 31 Oct 2009 23:16:38 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933384AbZJaXQb (ORCPT + 1 other); Sat, 31 Oct 2009 19:16:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933383AbZJaXQb (ORCPT ); Sat, 31 Oct 2009 19:16:31 -0400 Received: from mail01a.mail.t-online.hu ([84.2.40.6]:52796 "EHLO mail01a.mail.t-online.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933380AbZJaXQb (ORCPT ); Sat, 31 Oct 2009 19:16:31 -0400 X-Authuid: nmarci Received: from [192.168.1.64] (dsl5402C4D0.pool.t-online.hu [84.2.196.208]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail01a.mail.t-online.hu (Postfix) with ESMTPSA id BEE857978FC; Sun, 1 Nov 2009 00:16:24 +0100 (CET) Message-ID: <4AECC54C.3020108@freemail.hu> Date: Sun, 01 Nov 2009 00:16:28 +0100 From: =?UTF-8?B?TsOpbWV0aCBNw6FydG9u?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; hu-HU; rv:1.8.1.21) Gecko/20090402 SeaMonkey/1.1.16 MIME-Version: 1.0 To: Jean-Francois Moine , Hans de Goede , V4L Mailing List CC: Thomas Kaiser , Theodore Kilgore , Kyle Guinn Subject: [PATCH 17/21] gspca pac7302/pac7311: separate format descriptors X-DCC-mail.t-online.hu-Metrics: mail01a.mail.t-online.hu 32721; Body=6 Fuz1=6 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Márton Németh Separate supported format descriptors and supported resolutions. Signed-off-by: Márton Németh Cc: Thomas Kaiser Cc: Theodore Kilgore Cc: Kyle Guinn --- -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -uprN q/drivers/media/video/gspca/pac7311.c r/drivers/media/video/gspca/pac7311.c --- q/drivers/media/video/gspca/pac7311.c 2009-10-31 08:26:17.000000000 +0100 +++ r/drivers/media/video/gspca/pac7311.c 2009-10-31 09:07:56.000000000 +0100 @@ -349,7 +349,15 @@ static struct ctrl pac7311_sd_ctrls[] = }, }; -static const struct v4l2_pix_format vga_mode[] = { +static const struct v4l2_pix_format pac7302_vga_mode[] = { + {640, 480, V4L2_PIX_FMT_PJPG, V4L2_FIELD_NONE, + .bytesperline = 640, + .sizeimage = 640 * 480 * 3 / 8 + 590, + .colorspace = V4L2_COLORSPACE_JPEG, + .priv = 0}, +}; + +static const struct v4l2_pix_format pac7311_vga_mode[] = { {160, 120, V4L2_PIX_FMT_PJPG, V4L2_FIELD_NONE, .bytesperline = 160, .sizeimage = 160 * 120 * 3 / 8 + 590, @@ -642,8 +650,8 @@ static int pac7302_sd_config(struct gspc cam = &gspca_dev->cam; PDEBUG(D_CONF, "Find Sensor PAC7302"); - cam->cam_mode = &vga_mode[2]; /* only 640x480 */ - cam->nmodes = 1; + cam->cam_mode = pac7302_vga_mode; /* only 640x480 */ + cam->nmodes = ARRAY_SIZE(pac7302_vga_mode); sd->brightness = BRIGHTNESS_DEF; sd->contrast = CONTRAST_DEF; @@ -666,8 +674,8 @@ static int pac7311_sd_config(struct gspc cam = &gspca_dev->cam; PDEBUG(D_CONF, "Find Sensor PAC7311"); - cam->cam_mode = vga_mode; - cam->nmodes = ARRAY_SIZE(vga_mode); + cam->cam_mode = pac7311_vga_mode; + cam->nmodes = ARRAY_SIZE(pac7311_vga_mode); sd->contrast = CONTRAST_DEF; sd->gain = GAIN_DEF;