V4L/DVB: gspca - ov534: Allow enumerating supported framerates
authorAntonio Ospite <ospite@studenti.unina.it>
Sun, 17 Jan 2010 06:27:04 +0000 (03:27 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 26 Feb 2010 18:10:47 +0000 (15:10 -0300)
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/gspca.h
drivers/media/video/gspca/ov534.c

index 790dad736888f0a272adb86a6dbb009e0af0c4de..53c034ea84adf8d66cb522ca6a2e25fcc43d708e 100644 (file)
@@ -48,7 +48,7 @@ extern int gspca_debug;
 
 /* used to list framerates supported by a camera mode (resolution) */
 struct framerates {
-       int *rates;
+       const u8 *rates;
        int nrates;
 };
 
index 0878c09e2485bbb5b5287332e1475220118bbd8f..c02784bbe95a6fe08f22e3c279333e09b61d4152 100644 (file)
@@ -282,6 +282,20 @@ static const struct v4l2_pix_format ov772x_mode[] = {
         .priv = 0},
 };
 
+static const u8 qvga_rates[] = {125, 100, 75, 60, 50, 40, 30};
+static const u8 vga_rates[] = {60, 50, 40, 30, 15};
+
+static const struct framerates ov772x_framerates[] = {
+       { /* 320x240 */
+               .rates = qvga_rates,
+               .nrates = ARRAY_SIZE(qvga_rates),
+       },
+       { /* 640x480 */
+               .rates = vga_rates,
+               .nrates = ARRAY_SIZE(vga_rates),
+       },
+};
+
 static const u8 bridge_init[][2] = {
        { 0xc2, 0x0c },
        { 0x88, 0xf8 },
@@ -799,6 +813,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
 
        cam->cam_mode = ov772x_mode;
        cam->nmodes = ARRAY_SIZE(ov772x_mode);
+       cam->mode_framerates = ov772x_framerates;
 
        cam->bulk = 1;
        cam->bulk_size = 16384;