ov534: allow enumerating supported framerates

Message ID 1262997691-20651-1-git-send-email-ospite@studenti.unina.it (mailing list archive)
State Superseded, archived
Headers

Commit Message

Antonio Ospite Jan. 9, 2010, 12:41 a.m. UTC
  Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

---

Historical note:

This has been re-tested on a reliable machine and it works from guvcview for
all the framerates; on my old PC I am still having problems with 640x480@60fps
_regardless_ of this change, so it must be a USB problem.

Thanks,
   Antonio

--
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
  

Comments

Antonio Ospite Jan. 16, 2010, 2:23 p.m. UTC | #1
On Sat,  9 Jan 2010 01:41:31 +0100
Antonio Ospite <ospite@studenti.unina.it> wrote:

> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> 
> ---
> 
> Historical note:
> 
> This has been re-tested on a reliable machine and it works from guvcview for
> all the framerates; on my old PC I am still having problems with 640x480@60fps
> _regardless_ of this change, so it must be a USB problem.
> 
> Thanks,
>    Antonio

Ping? Jean-Francois.
  
Antonio Ospite Jan. 16, 2010, 2:33 p.m. UTC | #2
On Sat,  9 Jan 2010 01:41:31 +0100
Antonio Ospite <ospite@studenti.unina.it> wrote:



> Index: gspca/linux/drivers/media/video/gspca/ov534.c
> ===================================================================
> --- gspca.orig/linux/drivers/media/video/gspca/ov534.c
> +++ gspca/linux/drivers/media/video/gspca/ov534.c
> @@ -282,6 +282,21 @@
>  	 .priv = 0},
>  };
>  
> +static const int qvga_rates[] = {125, 100, 75, 60, 50, 40, 30};
> +static const int vga_rates[] = {60, 50, 40, 30, 15};
> +

Hmm, after double checking compilation messages, having these as 'const'
produces two:
  warning: initialization discards qualifiers from pointer target type
in the assignments below.

If I remove the 'const' qualifiers here, the messages go away, so I'd
say we can do also without them. If that's ok I'll send a v2 soon,
sorry.

Thanks,
   Antonio

> +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 +814,7 @@
>  
>  	cam->cam_mode = ov772x_mode;
>  	cam->nmodes = ARRAY_SIZE(ov772x_mode);
> +	cam->mode_framerates = ov772x_framerates;
>  
>  	cam->bulk = 1;
>  	cam->bulk_size = 16384;
  
Jean-Francois Moine Jan. 16, 2010, 4:47 p.m. UTC | #3
On Sat, 16 Jan 2010 15:33:45 +0100
Antonio Ospite <ospite@studenti.unina.it> wrote:

> > Index: gspca/linux/drivers/media/video/gspca/ov534.c
> > ===================================================================
> > --- gspca.orig/linux/drivers/media/video/gspca/ov534.c
> > +++ gspca/linux/drivers/media/video/gspca/ov534.c
> > @@ -282,6 +282,21 @@
> >  	 .priv = 0},
> >  };
> >  
> > +static const int qvga_rates[] = {125, 100, 75, 60, 50, 40, 30};
> > +static const int vga_rates[] = {60, 50, 40, 30, 15};
> > +
> 
> Hmm, after double checking compilation messages, having these as
> 'const' produces two:
>   warning: initialization discards qualifiers from pointer target type
> in the assignments below.
> 
> If I remove the 'const' qualifiers here, the messages go away, so I'd
> say we can do also without them. If that's ok I'll send a v2 soon,
> sorry.

Hi Antonio,

I recoded your patch with some changes, mainly in gspca.h. If it is
OK for you, may you sign it?

Best regards.
  
Antonio Ospite Jan. 16, 2010, 8:39 p.m. UTC | #4
On Sat, 16 Jan 2010 17:47:49 +0100
Jean-Francois Moine <moinejf@free.fr> wrote:

> Hi Antonio,
> 
> I recoded your patch with some changes, mainly in gspca.h. If it is
> OK for you, may you sign it?
> 

Ok, that's even better.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

> Best regards.
> 
> -- 
> Ken ar c'hentaƱ	|	      ** Breizh ha Linux atav! **
> Jef		|		http://moinejf.free.fr/

Thanks,
   Antonio
  

Patch

Index: gspca/linux/drivers/media/video/gspca/ov534.c
===================================================================
--- gspca.orig/linux/drivers/media/video/gspca/ov534.c
+++ gspca/linux/drivers/media/video/gspca/ov534.c
@@ -282,6 +282,21 @@ 
 	 .priv = 0},
 };
 
+static const int qvga_rates[] = {125, 100, 75, 60, 50, 40, 30};
+static const int 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 +814,7 @@ 
 
 	cam->cam_mode = ov772x_mode;
 	cam->nmodes = ARRAY_SIZE(ov772x_mode);
+	cam->mode_framerates = ov772x_framerates;
 
 	cam->bulk = 1;
 	cam->bulk_size = 16384;