All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ov519.c - allow setting i2c_detect_tries
@ 2015-07-15 22:51 Valdis Kletnieks
  2016-07-03 21:18 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: Valdis Kletnieks @ 2015-07-15 22:51 UTC (permalink / raw)
  To: Hans de Goede, Mauro Carvalho Chehab; +Cc: contact, linux-media, linux-kernel

I encountered a user who was having troubles getting a PlayStation EyeToy
(USB ID 054c:0155) working as a webcam. They reported that repeated attempts
would often make it work.  Looking at the code, there was support for
repeated attempts at I2C transactions - but only if you rebuilt the
module from source.

Added module parameter support so that users running a distro kernel
can tune it for recalcitrant devices.

While we're at it, fix the comment to reflect the error message actually issued.

Testing:

[/usr/src/linux-next] insmod drivers/media/usb/gspca/gspca_ov519.ko
[/usr/src/linux-next] cat /sys/module/gspca_ov519/parameters/i2c_detect_tries
10
[/usr/src/linux-next] rmmod gspca_ov519
[/usr/src/linux-next] insmod drivers/media/usb/gspca/gspca_ov519.ko i2c_detect_tries=50
[/usr/src/linux-next] cat /sys/module/gspca_ov519/parameters/i2c_detect_tries
50
[/usr/src/linux-next] modinfo drivers/media/usb/gspca/gspca_ov519.ko | grep parm
parm:           i2c_detect_tries:Number of times to try to init I2C (default 10) (int)
parm:           frame_rate:Frame rate (5, 10, 15, 20 or 30 fps) (int)

Reported-By: Demhlyr <contact@demhlyr.de>
Signed-Off-By: Valdis Kletnieks <valdis.kletnieks@vt.edu>

--- a/drivers/media/usb/gspca/ov519.c	2014-10-21 10:06:09.359806243 -0400
+++ b/drivers/media/usb/gspca/ov519.c	2015-07-15 18:35:21.063790541 -0400
@@ -57,8 +57,10 @@ MODULE_LICENSE("GPL");
 static int frame_rate;
 
 /* Number of times to retry a failed I2C transaction. Increase this if you
- * are getting "Failed to read sensor ID..." */
+ * are getting "Can't determine sensor slave IDs" */
 static int i2c_detect_tries = 10;
+module_param(i2c_detect_tries, int, 0644);
+MODULE_PARM_DESC(i2c_detect_tries,"Number of times to try to init I2C (default 10)");
 
 /* ov519 device descriptor */
 struct sd {


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ov519.c - allow setting i2c_detect_tries
  2015-07-15 22:51 [PATCH] ov519.c - allow setting i2c_detect_tries Valdis Kletnieks
@ 2016-07-03 21:18 ` Hans de Goede
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2016-07-03 21:18 UTC (permalink / raw)
  To: Valdis.Kletnieks, Mauro Carvalho Chehab
  Cc: contact, linux-media, linux-kernel

Hi,

On 16-07-15 00:51, Valdis.Kletnieks@vt.edu wrote:
> I encountered a user who was having troubles getting a PlayStation EyeToy
> (USB ID 054c:0155) working as a webcam. They reported that repeated attempts
> would often make it work.  Looking at the code, there was support for
> repeated attempts at I2C transactions - but only if you rebuilt the
> module from source.
>
> Added module parameter support so that users running a distro kernel
> can tune it for recalcitrant devices.

That is not necessary, this should be fixed by this commit:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/media/usb/gspca?id=f7c7ac480d246f2f625a70f56ea6650710c23f30

Regards,

Hans


>
> While we're at it, fix the comment to reflect the error message actually issued.
>
> Testing:
>
> [/usr/src/linux-next] insmod drivers/media/usb/gspca/gspca_ov519.ko
> [/usr/src/linux-next] cat /sys/module/gspca_ov519/parameters/i2c_detect_tries
> 10
> [/usr/src/linux-next] rmmod gspca_ov519
> [/usr/src/linux-next] insmod drivers/media/usb/gspca/gspca_ov519.ko i2c_detect_tries=50
> [/usr/src/linux-next] cat /sys/module/gspca_ov519/parameters/i2c_detect_tries
> 50
> [/usr/src/linux-next] modinfo drivers/media/usb/gspca/gspca_ov519.ko | grep parm
> parm:           i2c_detect_tries:Number of times to try to init I2C (default 10) (int)
> parm:           frame_rate:Frame rate (5, 10, 15, 20 or 30 fps) (int)
>
> Reported-By: Demhlyr <contact@demhlyr.de>
> Signed-Off-By: Valdis Kletnieks <valdis.kletnieks@vt.edu>
> ---
> 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
>
> --- a/drivers/media/usb/gspca/ov519.c	2014-10-21 10:06:09.359806243 -0400
> +++ b/drivers/media/usb/gspca/ov519.c	2015-07-15 18:35:21.063790541 -0400
> @@ -57,8 +57,10 @@ MODULE_LICENSE("GPL");
>  static int frame_rate;
>
>  /* Number of times to retry a failed I2C transaction. Increase this if you
> - * are getting "Failed to read sensor ID..." */
> + * are getting "Can't determine sensor slave IDs" */
>  static int i2c_detect_tries = 10;
> +module_param(i2c_detect_tries, int, 0644);
> +MODULE_PARM_DESC(i2c_detect_tries,"Number of times to try to init I2C (default 10)");
>
>  /* ov519 device descriptor */
>  struct sd {
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-03 21:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-15 22:51 [PATCH] ov519.c - allow setting i2c_detect_tries Valdis Kletnieks
2016-07-03 21:18 ` Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.