diff options
author | Thierry MERLE <thierry.merle@free.fr> | 2006-12-04 06:31:04 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-12-10 06:05:41 -0500 |
commit | c8400c700723936d9333c977e51fa77062d26dd4 (patch) | |
tree | 24d1f234c3fb67d3e58c21dbf0a7c975aa0db23a /drivers | |
parent | 6714b01263b06b2e7d054625486451a9fd8e03f4 (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')
-rw-r--r-- | drivers/media/video/usbvision/usbvision-core.c | 6 | ||||
-rw-r--r-- | drivers/media/video/usbvision/usbvision-i2c.c | 20 |
2 files changed, 12 insertions, 14 deletions
diff --git a/drivers/media/video/usbvision/usbvision-core.c b/drivers/media/video/usbvision/usbvision-core.c index a23fcd15a1d0..da422e7793ad 100644 --- a/drivers/media/video/usbvision/usbvision-core.c +++ b/drivers/media/video/usbvision/usbvision-core.c | |||
@@ -4240,6 +4240,7 @@ static int usbvision_v4l2_do_ioctl(struct inode *inode, struct file *file, | |||
4240 | 4240 | ||
4241 | /* set v4l2_format index */ | 4241 | /* set v4l2_format index */ |
4242 | frame->v4l2_format = usbvision->palette; | 4242 | frame->v4l2_format = usbvision->palette; |
4243 | PDEBUG(DBG_IOCTL, "VIDIOC_QBUF frame=%d",vb->index); | ||
4243 | 4244 | ||
4244 | return usbvision_new_frame(usbvision, vb->index); | 4245 | return usbvision_new_frame(usbvision, vb->index); |
4245 | } | 4246 | } |
@@ -4269,8 +4270,8 @@ static int usbvision_v4l2_do_ioctl(struct inode *inode, struct file *file, | |||
4269 | if (vb->index == -1) | 4270 | if (vb->index == -1) |
4270 | return -EINVAL; | 4271 | return -EINVAL; |
4271 | 4272 | ||
4272 | PDEBUG(DBG_IOCTL, "VIDIOC_DQBUF frame=%d, grabstate=%d", | 4273 | PDEBUG(DBG_IOCTL, "VIDIOC_DQBUF frame=%d, grabstate=%d, curframeNum=%d", |
4273 | vb->index, usbvision->frame[vb->index].grabstate); | 4274 | vb->index, usbvision->frame[vb->index].grabstate,usbvision->curFrameNum); |
4274 | 4275 | ||
4275 | switch (usbvision->frame[vb->index].grabstate) { | 4276 | switch (usbvision->frame[vb->index].grabstate) { |
4276 | case FrameState_Unused: | 4277 | case FrameState_Unused: |
@@ -4295,6 +4296,7 @@ static int usbvision_v4l2_do_ioctl(struct inode *inode, struct file *file, | |||
4295 | errCode = (usbvision->frame[vb->index].grabstate == FrameState_Error) ? -EIO : 0; | 4296 | errCode = (usbvision->frame[vb->index].grabstate == FrameState_Error) ? -EIO : 0; |
4296 | vb->memory = V4L2_MEMORY_MMAP; | 4297 | vb->memory = V4L2_MEMORY_MMAP; |
4297 | vb->flags = V4L2_BUF_FLAG_MAPPED | V4L2_BUF_FLAG_QUEUED | V4L2_BUF_FLAG_DONE; | 4298 | vb->flags = V4L2_BUF_FLAG_MAPPED | V4L2_BUF_FLAG_QUEUED | V4L2_BUF_FLAG_DONE; |
4299 | vb->field = V4L2_FIELD_NONE; | ||
4298 | vb->sequence = usbvision->frame[vb->index].sequence; | 4300 | vb->sequence = usbvision->frame[vb->index].sequence; |
4299 | usbvision->frame[vb->index].grabstate = FrameState_Unused; | 4301 | usbvision->frame[vb->index].grabstate = FrameState_Unused; |
4300 | break; | 4302 | break; |
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 | ||
42 | static int debug = 0; | 42 | static 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 |
45 | module_param (debug, int, 0444); // debug mode of the device driver | 45 | module_param (debug_i2c_usb, int, 0444); // debug_i2c_usb mode of the device driver |
46 | #else | 46 | #else |
47 | MODULE_PARM(debug, "i"); // debug mode of the device driver | 47 | MODULE_PARM(debug_i2c_usb, "i"); // debug_i2c_usb mode of the device driver |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | MODULE_AUTHOR("Joerg Heckenbach"); | ||
51 | MODULE_DESCRIPTION("I2C algorithm for USB-I2C-bridges"); | ||
52 | MODULE_LICENSE("GPL"); | ||
53 | |||
54 | 50 | ||
55 | static inline int try_write_address(struct i2c_adapter *i2c_adap, | 51 | static 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 |