Skip to contentSkip to conversation

gspca pac7302/pac7311: separate format descriptors

PATCH In review Németh Márton 1 participant 1 message Oct 31, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 17/21 gspca pac7302/pac7311: separate format descriptors

From: Márton Németh <[email protected]>

Separate supported format descriptors and supported resolutions.

Cc Thomas Kaiser <[email protected]>
Cc Theodore Kilgore <[email protected]>
Cc Kyle Guinn <[email protected]>

---

drivers/media/video/gspca/pac7311.c +13 -5
diff -uprN q/drivers/media/video/gspca/pac7311.c r/drivers/media/video/gspca/pac7311.c
@@ -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;