summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-12-04 09:31:04 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-12-04 09:31:04 -0200
commitdad3fa59e7ecf24b57197b66d78a41a2e496a43f (patch)
tree64ceefcaef1758850f2b9e7308791241ec5a6aaa /linux
parente0bececa6efcacc07bb9069f8cba8b66dc492dff (diff)
downloadmediapointer-dvb-s2-dad3fa59e7ecf24b57197b66d78a41a2e496a43f.tar.gz
mediapointer-dvb-s2-dad3fa59e7ecf24b57197b66d78a41a2e496a43f.tar.bz2
Fix some bugs on usbvision due to the merge into one module
From: Thierry MERLE <thierry.merle@free.fr> 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 'linux')
-rw-r--r--linux/drivers/media/video/usbvision/usbvision-core.c6
-rw-r--r--linux/drivers/media/video/usbvision/usbvision-i2c.c20
2 files changed, 12 insertions, 14 deletions
diff --git a/linux/drivers/media/video/usbvision/usbvision-core.c b/linux/drivers/media/video/usbvision/usbvision-core.c
index c8344ad78..f5ebf39fe 100644
--- a/linux/drivers/media/video/usbvision/usbvision-core.c
+++ b/linux/drivers/media/video/usbvision/usbvision-core.c
@@ -4495,6 +4495,7 @@ static int usbvision_v4l2_do_ioctl(struct inode *inode, struct file *file,
/* set v4l2_format index */
frame->v4l2_format = usbvision->palette;
+ PDEBUG(DBG_IOCTL, "VIDIOC_QBUF frame=%d",vb->index);
return usbvision_new_frame(usbvision, vb->index);
}
@@ -4524,8 +4525,8 @@ static int usbvision_v4l2_do_ioctl(struct inode *inode, struct file *file,
if (vb->index == -1)
return -EINVAL;
- PDEBUG(DBG_IOCTL, "VIDIOC_DQBUF frame=%d, grabstate=%d",
- vb->index, usbvision->frame[vb->index].grabstate);
+ PDEBUG(DBG_IOCTL, "VIDIOC_DQBUF frame=%d, grabstate=%d, curframeNum=%d",
+ vb->index, usbvision->frame[vb->index].grabstate,usbvision->curFrameNum);
switch (usbvision->frame[vb->index].grabstate) {
case FrameState_Unused:
@@ -4550,6 +4551,7 @@ static int usbvision_v4l2_do_ioctl(struct inode *inode, struct file *file,
errCode = (usbvision->frame[vb->index].grabstate == FrameState_Error) ? -EIO : 0;
vb->memory = V4L2_MEMORY_MMAP;
vb->flags = V4L2_BUF_FLAG_MAPPED | V4L2_BUF_FLAG_QUEUED | V4L2_BUF_FLAG_DONE;
+ vb->field = V4L2_FIELD_NONE;
vb->sequence = usbvision->frame[vb->index].sequence;
usbvision->frame[vb->index].grabstate = FrameState_Unused;
break;
diff --git a/linux/drivers/media/video/usbvision/usbvision-i2c.c b/linux/drivers/media/video/usbvision/usbvision-i2c.c
index fe768f7d5..1b53911d6 100644
--- a/linux/drivers/media/video/usbvision/usbvision-i2c.c
+++ b/linux/drivers/media/video/usbvision/usbvision-i2c.c
@@ -41,18 +41,14 @@
#include <linux/i2c.h>
#include "usbvision-i2c.h"
-static int debug = 0;
+static int debug_i2c_usb = 0;
#if defined(module_param) // Showing parameters under SYSFS
-module_param (debug, int, 0444); // debug mode of the device driver
+module_param (debug_i2c_usb, int, 0444); // debug_i2c_usb mode of the device driver
#else
-MODULE_PARM(debug, "i"); // debug mode of the device driver
+MODULE_PARM(debug_i2c_usb, "i"); // debug_i2c_usb mode of the device driver
#endif
-MODULE_AUTHOR("Joerg Heckenbach");
-MODULE_DESCRIPTION("I2C algorithm for USB-I2C-bridges");
-MODULE_LICENSE("GPL");
-
static inline int try_write_address(struct i2c_adapter *i2c_adap,
unsigned char addr, int retries)
@@ -73,7 +69,7 @@ static inline int try_write_address(struct i2c_adapter *i2c_adap,
break;
udelay(adap->udelay);
}
- if (debug) {
+ if (debug_i2c_usb) {
if (i) {
info("%s: Needed %d retries for address %#2x", __FUNCTION__, i, addr);
info("%s: Maybe there's no device at this address", __FUNCTION__);
@@ -100,7 +96,7 @@ static inline int try_read_address(struct i2c_adapter *i2c_adap,
break;
udelay(adap->udelay);
}
- if (debug) {
+ if (debug_i2c_usb) {
if (i) {
info("%s: Needed %d retries for address %#2x", __FUNCTION__, i, addr);
info("%s: Maybe there's no device at this address", __FUNCTION__);
@@ -172,7 +168,7 @@ usb_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
pmsg = &msgs[i];
ret = usb_find_address(i2c_adap, pmsg, i2c_adap->retries, &addr);
if (ret != 0) {
- if (debug) {
+ if (debug_i2c_usb) {
info("%s: got NAK from device, message #%d\n", __FUNCTION__, i);
}
return (ret < 0) ? ret : -EREMOTEIO;
@@ -250,7 +246,7 @@ int usbvision_i2c_usb_add_bus(struct i2c_adapter *adap)
i2c_add_adapter(adap);
- if (debug) {
+ if (debug_i2c_usb) {
info("i2c bus for %s registered", adap->name);
}
@@ -263,7 +259,7 @@ int usbvision_i2c_usb_del_bus(struct i2c_adapter *adap)
i2c_del_adapter(adap);
- if (debug) {
+ if (debug_i2c_usb) {
info("i2c bus for %s unregistered", adap->name);
}
#ifdef MODULE