aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/usbvision/usbvision-i2c.c
diff options
context:
space:
mode:
authorThierry MERLE <thierry.merle@free.fr>2006-12-04 06:31:04 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-12-10 06:05:41 -0500
commitc8400c700723936d9333c977e51fa77062d26dd4 (patch)
tree24d1f234c3fb67d3e58c21dbf0a7c975aa0db23a /drivers/media/video/usbvision/usbvision-i2c.c
parent6714b01263b06b2e7d054625486451a9fd8e03f4 (diff)
V4L/DVB (4924): Fix some bugs on usbvision due to the merge into one module
Found the bug that prevented the driver from loading : a module param conflict between usbvision-i2c and usbvision-core (debug parameter). - correct the module param "debug" conflics in usbvision-i2c.c and usbvision-core.c - add some debug printouts in usbvision-core.c VDIOC_QBUF/VIDIOC_DQBUF - usbvision-core.c : add vb->field = V4L2_FIELD_NONE in VIDIOC_DQBUF Signed-off-by: Thierry MERLE <thierry.merle@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/usbvision/usbvision-i2c.c')
-rw-r--r--drivers/media/video/usbvision/usbvision-i2c.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/media/video/usbvision/usbvision-i2c.c b/drivers/media/video/usbvision/usbvision-i2c.c
index e050e5559ac5..466e11f4584e 100644
--- a/drivers/media/video/usbvision/usbvision-i2c.c
+++ b/drivers/media/video/usbvision/usbvision-i2c.c
@@ -39,18 +39,14 @@
39#include <linux/i2c.h> 39#include <linux/i2c.h>
40#include "usbvision-i2c.h" 40#include "usbvision-i2c.h"
41 41
42static int debug = 0; 42static int debug_i2c_usb = 0;
43 43
44#if defined(module_param) // Showing parameters under SYSFS 44#if defined(module_param) // Showing parameters under SYSFS
45module_param (debug, int, 0444); // debug mode of the device driver 45module_param (debug_i2c_usb, int, 0444); // debug_i2c_usb mode of the device driver
46#else 46#else
47MODULE_PARM(debug, "i"); // debug mode of the device driver 47MODULE_PARM(debug_i2c_usb, "i"); // debug_i2c_usb mode of the device driver
48#endif 48#endif
49 49
50MODULE_AUTHOR("Joerg Heckenbach");
51MODULE_DESCRIPTION("I2C algorithm for USB-I2C-bridges");
52MODULE_LICENSE("GPL");
53
54 50
55static inline int try_write_address(struct i2c_adapter *i2c_adap, 51static inline int try_write_address(struct i2c_adapter *i2c_adap,
56 unsigned char addr, int retries) 52 unsigned char addr, int retries)
@@ -71,7 +67,7 @@ static inline int try_write_address(struct i2c_adapter *i2c_adap,
71 break; 67 break;
72 udelay(adap->udelay); 68 udelay(adap->udelay);
73 } 69 }
74 if (debug) { 70 if (debug_i2c_usb) {
75 if (i) { 71 if (i) {
76 info("%s: Needed %d retries for address %#2x", __FUNCTION__, i, addr); 72 info("%s: Needed %d retries for address %#2x", __FUNCTION__, i, addr);
77 info("%s: Maybe there's no device at this address", __FUNCTION__); 73 info("%s: Maybe there's no device at this address", __FUNCTION__);
@@ -98,7 +94,7 @@ static inline int try_read_address(struct i2c_adapter *i2c_adap,
98 break; 94 break;
99 udelay(adap->udelay); 95 udelay(adap->udelay);
100 } 96 }
101 if (debug) { 97 if (debug_i2c_usb) {
102 if (i) { 98 if (i) {
103 info("%s: Needed %d retries for address %#2x", __FUNCTION__, i, addr); 99 info("%s: Needed %d retries for address %#2x", __FUNCTION__, i, addr);
104 info("%s: Maybe there's no device at this address", __FUNCTION__); 100 info("%s: Maybe there's no device at this address", __FUNCTION__);
@@ -170,7 +166,7 @@ usb_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
170 pmsg = &msgs[i]; 166 pmsg = &msgs[i];
171 ret = usb_find_address(i2c_adap, pmsg, i2c_adap->retries, &addr); 167 ret = usb_find_address(i2c_adap, pmsg, i2c_adap->retries, &addr);
172 if (ret != 0) { 168 if (ret != 0) {
173 if (debug) { 169 if (debug_i2c_usb) {
174 info("%s: got NAK from device, message #%d\n", __FUNCTION__, i); 170 info("%s: got NAK from device, message #%d\n", __FUNCTION__, i);
175 } 171 }
176 return (ret < 0) ? ret : -EREMOTEIO; 172 return (ret < 0) ? ret : -EREMOTEIO;
@@ -236,7 +232,7 @@ int usbvision_i2c_usb_add_bus(struct i2c_adapter *adap)
236 232
237 i2c_add_adapter(adap); 233 i2c_add_adapter(adap);
238 234
239 if (debug) { 235 if (debug_i2c_usb) {
240 info("i2c bus for %s registered", adap->name); 236 info("i2c bus for %s registered", adap->name);
241 } 237 }
242 238
@@ -249,7 +245,7 @@ int usbvision_i2c_usb_del_bus(struct i2c_adapter *adap)
249 245
250 i2c_del_adapter(adap); 246 i2c_del_adapter(adap);
251 247
252 if (debug) { 248 if (debug_i2c_usb) {
253 info("i2c bus for %s unregistered", adap->name); 249 info("i2c bus for %s unregistered", adap->name);
254 } 250 }
255#ifdef MODULE 251#ifdef MODULE