summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/bw-qcam.c10
-rw-r--r--linux/drivers/media/video/ivtv/ivtv-driver.c4
-rw-r--r--linux/drivers/media/video/videobuf-core.c15
3 files changed, 20 insertions, 9 deletions
diff --git a/linux/drivers/media/video/bw-qcam.c b/linux/drivers/media/video/bw-qcam.c
index 42df7701a..7c165c7cf 100644
--- a/linux/drivers/media/video/bw-qcam.c
+++ b/linux/drivers/media/video/bw-qcam.c
@@ -85,11 +85,16 @@ OTHER DEALINGS IN THE SOFTWARE.
static unsigned int maxpoll=250; /* Maximum busy-loop count for qcam I/O */
static unsigned int yieldlines=4; /* Yield after this many during capture */
static int video_nr = -1;
+static unsigned int force_init; /* Whether to probe aggressively */
module_param(maxpoll, int, 0);
module_param(yieldlines, int, 0);
module_param(video_nr, int, 0);
+/* Set force_init=1 to avoid detection by polling status register and
+ * immediately attempt to initialize qcam */
+module_param(force_init, int, 0);
+
static inline int read_lpstatus(struct qcam_device *q)
{
return parport_read_status(q->pport);
@@ -334,6 +339,9 @@ static int qc_detect(struct qcam_device *q)
int count = 0;
int i;
+ if (force_init)
+ return 1;
+
lastreg = reg = read_lpstatus(q) & 0xf0;
for (i = 0; i < 500; i++)
@@ -357,12 +365,12 @@ static int qc_detect(struct qcam_device *q)
/* Be (even more) liberal in what you accept... */
-/* if (count > 30 && count < 200) */
if (count > 20 && count < 400) {
return 1; /* found */
} else {
printk(KERN_ERR "No Quickcam found on port %s\n",
q->pport->name);
+ printk(KERN_DEBUG "Quickcam detection counter: %u\n", count);
return 0; /* not found */
}
}
diff --git a/linux/drivers/media/video/ivtv/ivtv-driver.c b/linux/drivers/media/video/ivtv/ivtv-driver.c
index 85dd27e4b..e7741a031 100644
--- a/linux/drivers/media/video/ivtv/ivtv-driver.c
+++ b/linux/drivers/media/video/ivtv/ivtv-driver.c
@@ -1077,10 +1077,6 @@ static int __devinit ivtv_probe(struct pci_dev *dev,
ivtv_process_eeprom(itv);
}
- /* The mspx4xx chips need a longer delay for some reason */
- if (!(itv->hw_flags & IVTV_HW_MSP34XX))
- itv->i2c_algo.udelay = 5;
-
if (itv->std == 0) {
itv->std = V4L2_STD_NTSC_M;
}
diff --git a/linux/drivers/media/video/videobuf-core.c b/linux/drivers/media/video/videobuf-core.c
index 1f6f20f46..792099865 100644
--- a/linux/drivers/media/video/videobuf-core.c
+++ b/linux/drivers/media/video/videobuf-core.c
@@ -99,13 +99,15 @@ int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb,
MAGIC_CHECK(vb->magic, MAGIC_BUFFER);
MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS);
- /* FIXME: This is required to avoid OOPS on some cases,
+ /* This is required to avoid OOPS on some cases,
since mmap_mapper() method should be called before _iolock.
On some cases, the mmap_mapper() is called only after scheduling.
-
- However, this way is just too dirty! Better to wait for some event.
*/
- schedule_timeout(HZ);
+ wait_event_timeout(vb->done, q->is_mmapped, msecs_to_jiffies(100));
+ if (!q->is_mmapped) {
+ printk(KERN_ERR "Error: mmap_mapper() never called!\n");
+ return -EINVAL;
+ }
return CALL(q, iolock, q, vb, fbuf);
}
@@ -301,7 +303,11 @@ static int __videobuf_mmap_free(struct videobuf_queue *q)
MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS);
+
rc = CALL(q, mmap_free, q);
+
+ q->is_mmapped = 0;
+
if (rc < 0)
return rc;
@@ -1023,6 +1029,7 @@ int videobuf_mmap_mapper(struct videobuf_queue *q,
mutex_lock(&q->lock);
retval = CALL(q, mmap_mapper, q, vma);
+ q->is_mmapped = 1;
mutex_unlock(&q->lock);
return retval;