aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/c-qcam.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-24 14:21:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-24 14:21:08 -0400
commitc328d54cd4ad120d76284e46dcca6c6cf996154a (patch)
tree104c023be66faa5fce6e0a56c0a6d13c62fd21e5 /drivers/media/video/c-qcam.c
parent346ad4b7fe392571f19314f153db9151dbc1d82b (diff)
parentb0166ab3a6ae6d7af8d9a21a7836154963c69a11 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (452 commits) V4L/DVB (7731): tuner-xc2028: fix signal strength calculus V4L/DVB (7730): tuner-xc2028: Fix SCODE load for MTS firmwares V4L/DVB (7729): Fix VIDIOCGAP corruption in ivtv V4L/DVB (7728): tea5761: bugzilla #10462: tea5761 autodetection code were broken V4L/DVB (7726): cx23885: Enable cx23417 support on the HVR1800 V4L/DVB (7725): cx23885: Add generic cx23417 hardware encoder support V4L/DVB (7723): pvrusb2: Clean up input selection list generation in V4L interface V4L/DVB (7722): pvrusb2: Implement FM radio support for Gotview USB2.0 DVD 2 V4L/DVB (7721): pvrusb2: Restructure cx23416 firmware loading to have a common exit point V4L/DVB (7720): pvrusb2: Fix bad error code on cx23416 firmware load failure V4L/DVB (7719): pvrusb2: Implement input selection enforcement V4L/DVB (7718): pvrusb2-dvb: update Kbuild selections V4L/DVB (7717): pvrusb2-dvb: add DVB-T support for Hauppauge pvrusb2 model 73xxx V4L/DVB (7716): pvrusb2: clean up global functions V4L/DVB (7715): pvrusb2: Clean out all use of __FUNCTION__ V4L/DVB (7714): pvrusb2: Fix hang on module removal V4L/DVB (7713): pvrusb2: Implement cleaner DVB kernel thread shutdown V4L/DVB (7712): pvrusb2: Close connect/disconnect race V4L/DVB (7711): pvrusb2: Fix race on module unload V4L/DVB (7710): pvrusb2: Implement critical digital streaming quirk for onair devices ...
Diffstat (limited to 'drivers/media/video/c-qcam.c')
-rw-r--r--drivers/media/video/c-qcam.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/media/video/c-qcam.c b/drivers/media/video/c-qcam.c
index cf1546b5a7f1..fe1e67bb1ca8 100644
--- a/drivers/media/video/c-qcam.c
+++ b/drivers/media/video/c-qcam.c
@@ -36,6 +36,7 @@
36#include <linux/videodev.h> 36#include <linux/videodev.h>
37#include <media/v4l2-common.h> 37#include <media/v4l2-common.h>
38#include <linux/mutex.h> 38#include <linux/mutex.h>
39#include <linux/jiffies.h>
39 40
40#include <asm/uaccess.h> 41#include <asm/uaccess.h>
41 42
@@ -69,7 +70,7 @@ struct qcam_device {
69 70
70static int parport[MAX_CAMS] = { [1 ... MAX_CAMS-1] = -1 }; 71static int parport[MAX_CAMS] = { [1 ... MAX_CAMS-1] = -1 };
71static int probe = 2; 72static int probe = 2;
72static int force_rgb = 0; 73static int force_rgb;
73static int video_nr = -1; 74static int video_nr = -1;
74 75
75static inline void qcam_set_ack(struct qcam_device *qcam, unsigned int i) 76static inline void qcam_set_ack(struct qcam_device *qcam, unsigned int i)
@@ -95,7 +96,8 @@ static unsigned int qcam_await_ready1(struct qcam_device *qcam,
95 unsigned long oldjiffies = jiffies; 96 unsigned long oldjiffies = jiffies;
96 unsigned int i; 97 unsigned int i;
97 98
98 for (oldjiffies = jiffies; (jiffies - oldjiffies) < msecs_to_jiffies(40); ) 99 for (oldjiffies = jiffies;
100 time_before(jiffies, oldjiffies + msecs_to_jiffies(40)); )
99 if (qcam_ready1(qcam) == value) 101 if (qcam_ready1(qcam) == value)
100 return 0; 102 return 0;
101 103
@@ -120,7 +122,8 @@ static unsigned int qcam_await_ready2(struct qcam_device *qcam, int value)
120 unsigned long oldjiffies = jiffies; 122 unsigned long oldjiffies = jiffies;
121 unsigned int i; 123 unsigned int i;
122 124
123 for (oldjiffies = jiffies; (jiffies - oldjiffies) < msecs_to_jiffies(40); ) 125 for (oldjiffies = jiffies;
126 time_before(jiffies, oldjiffies + msecs_to_jiffies(40)); )
124 if (qcam_ready2(qcam) == value) 127 if (qcam_ready2(qcam) == value)
125 return 0; 128 return 0;
126 129
@@ -689,7 +692,9 @@ static const struct file_operations qcam_fops = {
689 .open = video_exclusive_open, 692 .open = video_exclusive_open,
690 .release = video_exclusive_release, 693 .release = video_exclusive_release,
691 .ioctl = qcam_ioctl, 694 .ioctl = qcam_ioctl,
695#ifdef CONFIG_COMPAT
692 .compat_ioctl = v4l_compat_ioctl32, 696 .compat_ioctl = v4l_compat_ioctl32,
697#endif
693 .read = qcam_read, 698 .read = qcam_read,
694 .llseek = no_llseek, 699 .llseek = no_llseek,
695}; 700};
@@ -741,7 +746,7 @@ static struct qcam_device *qcam_init(struct parport *port)
741} 746}
742 747
743static struct qcam_device *qcams[MAX_CAMS]; 748static struct qcam_device *qcams[MAX_CAMS];
744static unsigned int num_cams = 0; 749static unsigned int num_cams;
745 750
746static int init_cqcam(struct parport *port) 751static int init_cqcam(struct parport *port)
747{ 752{