summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-07-02 16:55:02 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-07-02 16:55:02 -0300
commit24b1cf4ab4be6bebbdc0c76a2ad7d25a39ce7d3f (patch)
treeb326863f704290d43c8861f13bd773f9cca798d6
parentd531e1dbeb7dad87f971e1d651c925b11e99b9cb (diff)
parentb08432f588a4161f12dd8419a2673ba582c9d3ab (diff)
downloadmediapointer-dvb-s2-24b1cf4ab4be6bebbdc0c76a2ad7d25a39ce7d3f.tar.gz
mediapointer-dvb-s2-24b1cf4ab4be6bebbdc0c76a2ad7d25a39ce7d3f.tar.bz2
merge: http://www.linuxtv.org/hg/~tmerle/v4l-dvb
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--linux/drivers/media/common/saa7146_hlp.c2
-rw-r--r--linux/drivers/media/dvb/cinergyT2/cinergyT2.c80
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_frontend.c2
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvbdev.h1
-rw-r--r--linux/drivers/media/dvb/frontends/dvb-pll.c1
-rw-r--r--linux/drivers/media/dvb/frontends/tda10086.c1
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-core.c2
-rw-r--r--linux/drivers/media/radio/dsbr100.c2
-rw-r--r--linux/drivers/media/radio/radio-maestro.c2
-rw-r--r--linux/drivers/media/radio/radio-maxiradio.c2
-rw-r--r--linux/drivers/media/video/Kconfig3
-rw-r--r--linux/drivers/media/video/Makefile4
-rw-r--r--linux/drivers/media/video/adv7170.c8
-rw-r--r--linux/drivers/media/video/adv7175.c10
-rw-r--r--linux/drivers/media/video/bt819.c11
-rw-r--r--linux/drivers/media/video/bt856.c8
-rw-r--r--linux/drivers/media/video/bt8xx/bttv-driver.c35
-rw-r--r--linux/drivers/media/video/bt8xx/bttv-input.c1
-rw-r--r--linux/drivers/media/video/bt8xx/bttv.h2
-rw-r--r--linux/drivers/media/video/bt8xx/bttvp.h4
-rw-r--r--linux/drivers/media/video/cpia.c1
-rw-r--r--linux/drivers/media/video/cpia.h2
-rw-r--r--linux/drivers/media/video/cx88/cx88-blackbird.c3
-rw-r--r--linux/drivers/media/video/cx88/cx88-i2c.c30
-rw-r--r--linux/drivers/media/video/cx88/cx88-mpeg.c1
-rw-r--r--linux/drivers/media/video/cx88/cx88-tvaudio.c2
-rw-r--r--linux/drivers/media/video/cx88/cx88-vbi.c1
-rw-r--r--linux/drivers/media/video/cx88/cx88-vp3054-i2c.c17
-rw-r--r--linux/drivers/media/video/ks0127.c1
-rw-r--r--linux/drivers/media/video/ks0127.h1
-rw-r--r--linux/drivers/media/video/ov7670.c2
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h2
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c2
-rw-r--r--linux/drivers/media/video/pwc/pwc-if.c12
-rw-r--r--linux/drivers/media/video/pwc/pwc.h8
-rw-r--r--linux/drivers/media/video/saa7111.c10
-rw-r--r--linux/drivers/media/video/saa7114.c12
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-alsa.c1
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-cards.c1
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-core.c1
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-dvb.c1
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-empress.c1
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-i2c.c1
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-input.c2
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-ts.c1
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-tvaudio.c1
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-vbi.c1
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-video.c1
-rw-r--r--linux/drivers/media/video/saa7185.c10
-rw-r--r--linux/drivers/media/video/stradis.c2
-rw-r--r--linux/drivers/media/video/stv680.c2
-rw-r--r--linux/drivers/media/video/tda7432.c2
-rw-r--r--linux/drivers/media/video/tda9875.c2
-rw-r--r--linux/drivers/media/video/tvaudio.c2
-rw-r--r--linux/drivers/media/video/usbvideo/vicam.c1
-rw-r--r--linux/drivers/media/video/usbvision/usbvision-cards.c1
-rw-r--r--linux/drivers/media/video/usbvision/usbvision-core.c1
-rw-r--r--linux/drivers/media/video/usbvision/usbvision-video.c1
-rw-r--r--linux/drivers/media/video/usbvision/usbvision.h1
-rw-r--r--linux/drivers/media/video/videodev.c2
-rw-r--r--linux/drivers/media/video/vivi.c21
-rw-r--r--linux/drivers/media/video/w9968cf.h2
62 files changed, 181 insertions, 169 deletions
diff --git a/linux/drivers/media/common/saa7146_hlp.c b/linux/drivers/media/common/saa7146_hlp.c
index 3f85c99a3..602c9c4be 100644
--- a/linux/drivers/media/common/saa7146_hlp.c
+++ b/linux/drivers/media/common/saa7146_hlp.c
@@ -1,6 +1,6 @@
#include <linux/kernel.h>
-#include "compat.h"
#include <media/saa7146_vv.h>
+#include "compat.h"
static void calculate_output_format_register(struct saa7146_dev* saa, u32 palette, u32* clip_format)
{
diff --git a/linux/drivers/media/dvb/cinergyT2/cinergyT2.c b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c
index f495251d6..cca6b7985 100644
--- a/linux/drivers/media/dvb/cinergyT2/cinergyT2.c
+++ b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c
@@ -132,8 +132,10 @@ struct cinergyt2 {
struct usb_device *udev;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
struct mutex sem;
+ struct mutex wq_sem;
#else
struct semaphore sem;
+ struct semaphore wq_sem;
#endif
struct dvb_adapter adapter;
struct dvb_device *fedev;
@@ -515,14 +517,14 @@ static int cinergyt2_open (struct inode *inode, struct file *file)
struct cinergyt2 *cinergyt2 = dvbdev->priv;
int err = -ERESTARTSYS;
- if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
- return -ERESTARTSYS;
+ if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->wq_sem))
+ goto out;
- if ((err = dvb_generic_open(inode, file))) {
- mutex_unlock(&cinergyt2->sem);
- return err;
- }
+ if (mutex_lock_interruptible(&cinergyt2->sem))
+ goto out_unlock1;
+ if ((err = dvb_generic_open(inode, file)))
+ goto out_unlock2;
if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
cinergyt2_sleep(cinergyt2, 0);
@@ -531,8 +533,12 @@ static int cinergyt2_open (struct inode *inode, struct file *file)
atomic_inc(&cinergyt2->inuse);
+out_unlock2:
mutex_unlock(&cinergyt2->sem);
- return 0;
+out_unlock1:
+ mutex_unlock(&cinergyt2->wq_sem);
+out:
+ return err;
}
static void cinergyt2_unregister(struct cinergyt2 *cinergyt2)
@@ -552,15 +558,17 @@ static int cinergyt2_release (struct inode *inode, struct file *file)
struct dvb_device *dvbdev = file->private_data;
struct cinergyt2 *cinergyt2 = dvbdev->priv;
- mutex_lock(&cinergyt2->sem);
+ mutex_lock(&cinergyt2->wq_sem);
if (!cinergyt2->disconnect_pending && (file->f_flags & O_ACCMODE) != O_RDONLY) {
- cancel_delayed_work(&cinergyt2->query_work);
- flush_scheduled_work();
+ cancel_rearming_delayed_work(&cinergyt2->query_work);
+
+ mutex_lock(&cinergyt2->sem);
cinergyt2_sleep(cinergyt2, 1);
+ mutex_unlock(&cinergyt2->sem);
}
- mutex_unlock(&cinergyt2->sem);
+ mutex_unlock(&cinergyt2->wq_sem);
if (atomic_dec_and_test(&cinergyt2->inuse) && cinergyt2->disconnect_pending) {
warn("delayed unregister in release");
@@ -891,13 +899,13 @@ static int cinergyt2_register_rc(struct cinergyt2 *cinergyt2)
static void cinergyt2_unregister_rc(struct cinergyt2 *cinergyt2)
{
- cancel_delayed_work(&cinergyt2->rc_query_work);
+ cancel_rearming_delayed_work(&cinergyt2->rc_query_work);
input_unregister_device(cinergyt2->rc_input_dev);
}
static inline void cinergyt2_suspend_rc(struct cinergyt2 *cinergyt2)
{
- cancel_delayed_work(&cinergyt2->rc_query_work);
+ cancel_rearming_delayed_work(&cinergyt2->rc_query_work);
}
static inline void cinergyt2_resume_rc(struct cinergyt2 *cinergyt2)
@@ -968,6 +976,7 @@ static int cinergyt2_probe (struct usb_interface *intf,
usb_set_intfdata (intf, (void *) cinergyt2);
mutex_init(&cinergyt2->sem);
+ mutex_init(&cinergyt2->wq_sem);
init_waitqueue_head (&cinergyt2->poll_wq);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
INIT_WORK(&cinergyt2->query_work, cinergyt2_query, cinergyt2);
@@ -1039,11 +1048,8 @@ static void cinergyt2_disconnect (struct usb_interface *intf)
{
struct cinergyt2 *cinergyt2 = usb_get_intfdata (intf);
- flush_scheduled_work();
-
cinergyt2_unregister_rc(cinergyt2);
-
- cancel_delayed_work(&cinergyt2->query_work);
+ cancel_rearming_delayed_work(&cinergyt2->query_work);
wake_up_interruptible(&cinergyt2->poll_wq);
cinergyt2->demux.dmx.close(&cinergyt2->demux.dmx);
@@ -1057,25 +1063,24 @@ static int cinergyt2_suspend (struct usb_interface *intf, pm_message_t state)
{
struct cinergyt2 *cinergyt2 = usb_get_intfdata (intf);
- if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
+ if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->wq_sem))
return -ERESTARTSYS;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
- if (state > 0) {
-#else
- if (1) {
-#endif
- struct cinergyt2 *cinergyt2 = usb_get_intfdata (intf);
-
- cinergyt2_suspend_rc(cinergyt2);
- cancel_delayed_work(&cinergyt2->query_work);
- if (cinergyt2->streaming)
- cinergyt2_stop_stream_xfer(cinergyt2);
- flush_scheduled_work();
- cinergyt2_sleep(cinergyt2, 1);
+ if (state <= 0) {
+ mutex_unlock(&cinergyt2->wq_sem);
+ return 0;
}
+#endif
+ cinergyt2_suspend_rc(cinergyt2);
+ cancel_rearming_delayed_work(&cinergyt2->query_work);
+ mutex_lock(&cinergyt2->sem);
+ if (cinergyt2->streaming)
+ cinergyt2_stop_stream_xfer(cinergyt2);
+ cinergyt2_sleep(cinergyt2, 1);
mutex_unlock(&cinergyt2->sem);
+
return 0;
}
@@ -1083,9 +1088,15 @@ static int cinergyt2_resume (struct usb_interface *intf)
{
struct cinergyt2 *cinergyt2 = usb_get_intfdata (intf);
struct dvbt_set_parameters_msg *param = &cinergyt2->param;
+ int err = -ERESTARTSYS;
- if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
- return -ERESTARTSYS;
+ if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->wq_sem))
+ goto out;
+
+ if (mutex_lock_interruptible(&cinergyt2->sem))
+ goto out_unlock1;
+
+ err = 0;
if (!cinergyt2->sleeping) {
cinergyt2_sleep(cinergyt2, 0);
@@ -1098,7 +1109,10 @@ static int cinergyt2_resume (struct usb_interface *intf)
cinergyt2_resume_rc(cinergyt2);
mutex_unlock(&cinergyt2->sem);
- return 0;
+out_unlock1:
+ mutex_unlock(&cinergyt2->wq_sem);
+out:
+ return err;
}
static const struct usb_device_id cinergyt2_table [] __devinitdata = {
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
index 2cad44fb2..90093c965 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -34,7 +34,6 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/list.h>
-#include "compat.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
#include <linux/suspend.h>
#else
@@ -46,6 +45,7 @@
#include "dvb_frontend.h"
#include "dvbdev.h"
+#include "compat.h"
static int dvb_frontend_debug;
static int dvb_shutdown_timeout = 5;
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.h b/linux/drivers/media/dvb/dvb-core/dvbdev.h
index cb76869bd..6dff10ebf 100644
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.h
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.h
@@ -28,7 +28,6 @@
#include <linux/fs.h>
#include <linux/list.h>
#include <linux/smp_lock.h>
-#include "compat.h"
#define DVB_MAJOR 212
diff --git a/linux/drivers/media/dvb/frontends/dvb-pll.c b/linux/drivers/media/dvb/frontends/dvb-pll.c
index f3d500eb5..0c0b94767 100644
--- a/linux/drivers/media/dvb/frontends/dvb-pll.c
+++ b/linux/drivers/media/dvb/frontends/dvb-pll.c
@@ -606,7 +606,6 @@ static int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf,
// calculate the frequency we set it to
return (div * desc->entries[i].stepsize) - desc->iffreq;
}
-EXPORT_SYMBOL(dvb_pll_configure);
static int dvb_pll_release(struct dvb_frontend *fe)
{
diff --git a/linux/drivers/media/dvb/frontends/tda10086.c b/linux/drivers/media/dvb/frontends/tda10086.c
index 0f2d4b415..d5838df74 100644
--- a/linux/drivers/media/dvb/frontends/tda10086.c
+++ b/linux/drivers/media/dvb/frontends/tda10086.c
@@ -30,6 +30,7 @@
#include "dvb_frontend.h"
#include "tda10086.h"
+#include "compat.h"
#define SACLK 96000000
diff --git a/linux/drivers/media/dvb/ttpci/budget-core.c b/linux/drivers/media/dvb/ttpci/budget-core.c
index 2557ac962..b611f2b1f 100644
--- a/linux/drivers/media/dvb/ttpci/budget-core.c
+++ b/linux/drivers/media/dvb/ttpci/budget-core.c
@@ -529,7 +529,7 @@ int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev,
if (bi->type != BUDGET_FS_ACTIVY)
saa7146_setgpio(dev, 2, SAA7146_GPIO_OUTHI);
- if (budget_register(budget) == 0)
+ if ((ret = budget_register(budget)) == 0)
return 0; /* Everything OK */
/* An error occurred, cleanup resources */
diff --git a/linux/drivers/media/radio/dsbr100.c b/linux/drivers/media/radio/dsbr100.c
index 95f1f4051..7f9ceb3cf 100644
--- a/linux/drivers/media/radio/dsbr100.c
+++ b/linux/drivers/media/radio/dsbr100.c
@@ -80,10 +80,10 @@
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/input.h>
-#include "compat.h"
#include <linux/videodev2.h>
#include <media/v4l2-common.h>
#include <linux/usb.h>
+#include "compat.h"
/*
* Version Information
diff --git a/linux/drivers/media/radio/radio-maestro.c b/linux/drivers/media/radio/radio-maestro.c
index 5867ccd9d..158819686 100644
--- a/linux/drivers/media/radio/radio-maestro.c
+++ b/linux/drivers/media/radio/radio-maestro.c
@@ -24,10 +24,10 @@
#include <linux/delay.h>
#include <asm/io.h>
#include <asm/uaccess.h>
-#include "compat.h"
#include <linux/pci.h>
#include <linux/videodev2.h>
#include <media/v4l2-common.h>
+#include "compat.h"
#include <linux/version.h> /* for KERNEL_VERSION MACRO */
#define RADIO_VERSION KERNEL_VERSION(0,0,6)
diff --git a/linux/drivers/media/radio/radio-maxiradio.c b/linux/drivers/media/radio/radio-maxiradio.c
index 4755f8fe2..5cebaea53 100644
--- a/linux/drivers/media/radio/radio-maxiradio.c
+++ b/linux/drivers/media/radio/radio-maxiradio.c
@@ -39,7 +39,6 @@
#include <linux/delay.h>
#include <asm/io.h>
#include <asm/uaccess.h>
-#include "compat.h"
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
#include <linux/mutex.h>
#endif
@@ -47,6 +46,7 @@
#include <linux/pci.h>
#include <linux/videodev2.h>
#include <media/v4l2-common.h>
+#include "compat.h"
#define DRIVER_VERSION "0.77"
diff --git a/linux/drivers/media/video/Kconfig b/linux/drivers/media/video/Kconfig
index e88d5d7de..bec790faf 100644
--- a/linux/drivers/media/video/Kconfig
+++ b/linux/drivers/media/video/Kconfig
@@ -490,7 +490,8 @@ config TUNER_3036
If in doubt, say N.
config TUNER_TEA5761
- tristate "TEA 5761 radio tuner (EXPERIMENTAL)"
+ bool "TEA 5761 radio tuner (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
depends on I2C
select VIDEO_TUNER
help
diff --git a/linux/drivers/media/video/Makefile b/linux/drivers/media/video/Makefile
index 4cddc8cbd..10b4d4469 100644
--- a/linux/drivers/media/video/Makefile
+++ b/linux/drivers/media/video/Makefile
@@ -7,9 +7,7 @@ zr36067-objs := zoran_procfs.o zoran_device.o \
tuner-objs := tuner-core.o tuner-types.o tuner-simple.o \
mt20xx.o tda8290.o tea5767.o tda9887.o
-ifneq ($(CONFIG_TUNER_TEA5761),)
- tuner-objs += tea5761.o
-endif
+tuner-$(CONFIG_TUNER_TEA5761) += tea5761.o
msp3400-objs := msp3400-driver.o msp3400-kthreads.o
diff --git a/linux/drivers/media/video/adv7170.c b/linux/drivers/media/video/adv7170.c
index 90a48b507..190744da1 100644
--- a/linux/drivers/media/video/adv7170.c
+++ b/linux/drivers/media/video/adv7170.c
@@ -38,24 +38,24 @@
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/signal.h>
+#include <linux/types.h>
+#include <linux/i2c.h>
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/page.h>
-#include <linux/types.h>
+#include <asm/uaccess.h>
#include "compat.h"
#include <linux/videodev.h>
-#include <asm/uaccess.h>
+#include <linux/video_encoder.h>
MODULE_DESCRIPTION("Analog Devices ADV7170 video encoder driver");
MODULE_AUTHOR("Maxim Yevtyushkin");
MODULE_LICENSE("GPL");
-#include <linux/i2c.h>
#define I2C_NAME(x) (x)->name
-#include <linux/video_encoder.h>
static int debug = 0;
module_param(debug, int, 0);
diff --git a/linux/drivers/media/video/adv7175.c b/linux/drivers/media/video/adv7175.c
index e8487b745..aa53c5d60 100644
--- a/linux/drivers/media/video/adv7175.c
+++ b/linux/drivers/media/video/adv7175.c
@@ -34,24 +34,24 @@
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/signal.h>
+#include <linux/types.h>
+#include <linux/i2c.h>
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/page.h>
-#include <linux/types.h>
+#include <asm/uaccess.h>
-#include "compat.h"
#include <linux/videodev.h>
-#include <asm/uaccess.h>
+#include <linux/video_encoder.h>
+#include "compat.h"
MODULE_DESCRIPTION("Analog Devices ADV7175 video encoder driver");
MODULE_AUTHOR("Dave Perks");
MODULE_LICENSE("GPL");
-#include <linux/i2c.h>
#define I2C_NAME(s) (s)->name
-#include <linux/video_encoder.h>
static int debug = 0;
module_param(debug, int, 0);
diff --git a/linux/drivers/media/video/bt819.c b/linux/drivers/media/video/bt819.c
index 7e705c3d8..580b838d5 100644
--- a/linux/drivers/media/video/bt819.c
+++ b/linux/drivers/media/video/bt819.c
@@ -38,24 +38,25 @@
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/signal.h>
+#include <linux/types.h>
+#include <linux/i2c.h>
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/page.h>
-#include <linux/types.h>
+#include <asm/uaccess.h>
-#include "compat.h"
#include <linux/videodev.h>
-#include <asm/uaccess.h>
+#include <linux/video_decoder.h>
+
+#include "compat.h"
MODULE_DESCRIPTION("Brooktree-819 video decoder driver");
MODULE_AUTHOR("Mike Bernson & Dave Perks");
MODULE_LICENSE("GPL");
-#include <linux/i2c.h>
#define I2C_NAME(s) (s)->name
-#include <linux/video_decoder.h>
static int debug = 0;
module_param(debug, int, 0);
diff --git a/linux/drivers/media/video/bt856.c b/linux/drivers/media/video/bt856.c
index 5b487acd1..9c1d3d145 100644
--- a/linux/drivers/media/video/bt856.c
+++ b/linux/drivers/media/video/bt856.c
@@ -38,24 +38,24 @@
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/signal.h>
+#include <linux/types.h>
+#include <linux/i2c.h>
+#include <linux/video_encoder.h>
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/page.h>
-#include <linux/types.h>
+#include <asm/uaccess.h>
#include "compat.h"
#include <linux/videodev.h>
-#include <asm/uaccess.h>
MODULE_DESCRIPTION("Brooktree-856A video encoder driver");
MODULE_AUTHOR("Mike Bernson & Dave Perks");
MODULE_LICENSE("GPL");
-#include <linux/i2c.h>
#define I2C_NAME(s) (s)->name
-#include <linux/video_encoder.h>
static int debug = 0;
module_param(debug, int, 0);
diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c
index 73c080c09..94dc7f867 100644
--- a/linux/drivers/media/video/bt8xx/bttv-driver.c
+++ b/linux/drivers/media/video/bt8xx/bttv-driver.c
@@ -1376,7 +1376,7 @@ set_tvnorm(struct bttv *btv, unsigned int norm)
/* Call with btv->lock down. */
static void
-set_input(struct bttv *btv, unsigned int input)
+set_input(struct bttv *btv, unsigned int input, unsigned int norm)
{
unsigned long flags;
@@ -1395,7 +1395,7 @@ set_input(struct bttv *btv, unsigned int input)
}
audio_input(btv,(input == bttv_tvcards[btv->c.type].tuner ?
TVAUDIO_INPUT_TUNER : TVAUDIO_INPUT_EXTERN));
- set_tvnorm(btv,btv->tvnorm);
+ set_tvnorm(btv, norm);
i2c_vidiocschan(btv);
}
@@ -1486,7 +1486,7 @@ static void bttv_reinit_bt848(struct bttv *btv)
init_bt848(btv);
btv->pll.pll_current = -1;
- set_input(btv,btv->input);
+ set_input(btv, btv->input, btv->tvnorm);
}
static int get_control(struct bttv *btv, struct v4l2_control *c)
@@ -2056,8 +2056,7 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
return 0;
}
- btv->tvnorm = v->norm;
- set_input(btv,v->channel);
+ set_input(btv, v->channel, v->norm);
mutex_unlock(&btv->lock);
return 0;
}
@@ -2193,7 +2192,7 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
if (*i > bttv_tvcards[btv->c.type].video_inputs)
return -EINVAL;
mutex_lock(&btv->lock);
- set_input(btv,*i);
+ set_input(btv, *i, btv->tvnorm);
mutex_unlock(&btv->lock);
return 0;
}
@@ -2297,6 +2296,24 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
printk(KERN_INFO "bttv%d: ================== END STATUS CARD #%d ==================\n", btv->c.nr, btv->c.nr);
return 0;
}
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+ case VIDIOC_DBG_G_REGISTER:
+ case VIDIOC_DBG_S_REGISTER:
+ {
+ struct v4l2_register *reg = arg;
+ if (!capable(CAP_SYS_ADMIN))
+ return -EPERM;
+ if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
+ return -EINVAL;
+ /* bt848 has a 12-bit register space */
+ reg->reg &= 0xfff;
+ if (cmd == VIDIOC_DBG_G_REGISTER)
+ reg->val = btread(reg->reg);
+ else
+ btwrite(reg->val, reg->reg);
+ return 0;
+ }
+#endif
default:
return -ENOIOCTLCMD;
@@ -3607,6 +3624,8 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
case VIDIOC_G_FREQUENCY:
case VIDIOC_S_FREQUENCY:
case VIDIOC_LOG_STATUS:
+ case VIDIOC_DBG_G_REGISTER:
+ case VIDIOC_DBG_S_REGISTER:
return bttv_common_ioctls(btv,cmd,arg);
default:
@@ -3991,6 +4010,8 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
case VIDIOCGAUDIO:
case VIDIOCSAUDIO:
case VIDIOC_LOG_STATUS:
+ case VIDIOC_DBG_G_REGISTER:
+ case VIDIOC_DBG_S_REGISTER:
return bttv_common_ioctls(btv,cmd,arg);
default:
@@ -4841,7 +4862,7 @@ static int __devinit bttv_probe(struct pci_dev *dev,
bt848_hue(btv,32768);
bt848_sat(btv,32768);
audio_mute(btv, 1);
- set_input(btv,0);
+ set_input(btv, 0, btv->tvnorm);
bttv_crop_reset(&btv->crop[0], btv->tvnorm);
btv->crop[1] = btv->crop[0]; /* current = default */
disclaim_vbi_lines(btv);
diff --git a/linux/drivers/media/video/bt8xx/bttv-input.c b/linux/drivers/media/video/bt8xx/bttv-input.c
index fb5df7238..5a5fdd8e2 100644
--- a/linux/drivers/media/video/bt8xx/bttv-input.c
+++ b/linux/drivers/media/video/bt8xx/bttv-input.c
@@ -25,7 +25,6 @@
#include <linux/interrupt.h>
#include <linux/input.h>
-#include "compat.h"
#include "bttv.h"
#include "bttvp.h"
diff --git a/linux/drivers/media/video/bt8xx/bttv.h b/linux/drivers/media/video/bt8xx/bttv.h
index 582ac6c90..b6ee3cd0f 100644
--- a/linux/drivers/media/video/bt8xx/bttv.h
+++ b/linux/drivers/media/video/bt8xx/bttv.h
@@ -14,9 +14,9 @@
#ifndef _BTTV_H_
#define _BTTV_H_
-#include "compat.h"
#include <linux/videodev.h>
#include <linux/i2c.h>
+#include "compat.h"
#include <media/ir-common.h>
#include <media/ir-kbd-i2c.h>
#include <media/i2c-addr.h>
diff --git a/linux/drivers/media/video/bt8xx/bttvp.h b/linux/drivers/media/video/bt8xx/bttvp.h
index eee6f5ae3..9428a665d 100644
--- a/linux/drivers/media/video/bt8xx/bttvp.h
+++ b/linux/drivers/media/video/bt8xx/bttvp.h
@@ -25,7 +25,6 @@
#ifndef _BTTVP_H_
#define _BTTVP_H_
-#include "compat.h"
#include <linux/version.h>
#define BTTV_VERSION_CODE KERNEL_VERSION(0,9,17)
@@ -34,7 +33,6 @@
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>
#include <linux/videodev.h>
-#include <media/v4l2-common.h>
#include <linux/pci.h>
#include <linux/input.h>
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
@@ -42,6 +40,8 @@
#endif
#include <asm/scatterlist.h>
#include <asm/io.h>
+#include "compat.h"
+#include <media/v4l2-common.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#include "i2c-compat.h"
diff --git a/linux/drivers/media/video/cpia.c b/linux/drivers/media/video/cpia.c
index 369e1144a..eba73919e 100644
--- a/linux/drivers/media/video/cpia.c
+++ b/linux/drivers/media/video/cpia.c
@@ -38,7 +38,6 @@
#include <linux/pagemap.h>
#include <linux/delay.h>
#include <asm/io.h>
-#include "compat.h"
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
#include <linux/mutex.h>
#endif
diff --git a/linux/drivers/media/video/cpia.h b/linux/drivers/media/video/cpia.h
index ed6201abe..107234853 100644
--- a/linux/drivers/media/video/cpia.h
+++ b/linux/drivers/media/video/cpia.h
@@ -44,13 +44,13 @@
#ifdef __KERNEL__
#include <asm/uaccess.h>
-#include "compat.h"
#include <linux/videodev.h>
#include <media/v4l2-common.h>
#include <linux/list.h>
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
#include <linux/mutex.h>
#endif
+#include "compat.h"
struct cpia_camera_ops
{
diff --git a/linux/drivers/media/video/cx88/cx88-blackbird.c b/linux/drivers/media/video/cx88/cx88-blackbird.c
index 9103d9567..049b9a5eb 100644
--- a/linux/drivers/media/video/cx88/cx88-blackbird.c
+++ b/linux/drivers/media/video/cx88/cx88-blackbird.c
@@ -31,7 +31,6 @@
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/delay.h>
-#include "compat.h"
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#include <linux/device.h>
#endif
@@ -1057,6 +1056,8 @@ static int vidioc_g_tuner (struct file *file, void *priv,
if (unlikely(UNSET == core->tuner_type))
return -EINVAL;
+ if (0 != t->index)
+ return -EINVAL;
strcpy(t->name, "Television");
t->type = V4L2_TUNER_ANALOG_TV;
diff --git a/linux/drivers/media/video/cx88/cx88-i2c.c b/linux/drivers/media/video/cx88/cx88-i2c.c
index 30fd0776a..f290c4b2c 100644
--- a/linux/drivers/media/video/cx88/cx88-i2c.c
+++ b/linux/drivers/media/video/cx88/cx88-i2c.c
@@ -33,7 +33,6 @@
#include <asm/io.h>
-#include "compat.h"
#include "cx88.h"
#include <media/v4l2-common.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
@@ -169,7 +168,7 @@ void cx88_call_i2c_clients(struct cx88_core *core, unsigned int cmd, void *arg)
i2c_clients_command(&core->i2c_adap, cmd, arg);
}
-static struct i2c_algo_bit_data cx8800_i2c_algo_template = {
+static const struct i2c_algo_bit_data cx8800_i2c_algo_template = {
.setsda = cx8800_bit_setsda,
.setscl = cx8800_bit_setscl,
.getsda = cx8800_bit_getsda,
@@ -180,20 +179,6 @@ static struct i2c_algo_bit_data cx8800_i2c_algo_template = {
/* ----------------------------------------------------------------------- */
-static struct i2c_adapter cx8800_i2c_adap_template = {
- .name = "cx2388x",
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- .owner = THIS_MODULE,
-#endif
- .id = I2C_HW_B_CX2388x,
- .client_register = attach_inform,
- .client_unregister = detach_inform,
-};
-
-static struct i2c_client cx8800_i2c_client_template = {
- .name = "cx88xx internal",
-};
-
static char *i2c_devs[128] = {
[ 0x1c >> 1 ] = "lgdt330x",
[ 0x86 >> 1 ] = "tda9887/cx22702",
@@ -223,14 +208,9 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci)
/* Prevents usage of invalid delay values */
if (i2c_udelay<5)
i2c_udelay=5;
- cx8800_i2c_algo_template.udelay=i2c_udelay;
- memcpy(&core->i2c_adap, &cx8800_i2c_adap_template,
- sizeof(core->i2c_adap));
memcpy(&core->i2c_algo, &cx8800_i2c_algo_template,
sizeof(core->i2c_algo));
- memcpy(&core->i2c_client, &cx8800_i2c_client_template,
- sizeof(core->i2c_client));
#ifdef I2C_CLASS_TV_ANALOG
if (core->tuner_type != TUNER_ABSENT)
@@ -245,10 +225,18 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci)
core->i2c_adap.dev.parent = &pci->dev;
#endif
strlcpy(core->i2c_adap.name,core->name,sizeof(core->i2c_adap.name));
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ core->i2c_adap.owner = THIS_MODULE;
+#endif
+ core->i2c_adap.id = I2C_HW_B_CX2388x;
+ core->i2c_adap.client_register = attach_inform;
+ core->i2c_adap.client_unregister = detach_inform;
+ core->i2c_algo.udelay = i2c_udelay;
core->i2c_algo.data = core;
i2c_set_adapdata(&core->i2c_adap,core);
core->i2c_adap.algo_data = &core->i2c_algo;
core->i2c_client.adapter = &core->i2c_adap;
+ strlcpy(core->i2c_client.name, "cx88xx internal", I2C_NAME_SIZE);
cx8800_bit_setscl(core,1);
cx8800_bit_setsda(core,1);
diff --git a/linux/drivers/media/video/cx88/cx88-mpeg.c b/linux/drivers/media/video/cx88/cx88-mpeg.c
index 268e253e9..32ea481b2 100644
--- a/linux/drivers/media/video/cx88/cx88-mpeg.c
+++ b/linux/drivers/media/video/cx88/cx88-mpeg.c
@@ -25,7 +25,6 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
-#include "compat.h"
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
#include <linux/device.h>
#endif
diff --git a/linux/drivers/media/video/cx88/cx88-tvaudio.c b/linux/drivers/media/video/cx88/cx88-tvaudio.c
index f69b4752d..19e34e883 100644
--- a/linux/drivers/media/video/cx88/cx88-tvaudio.c
+++ b/linux/drivers/media/video/cx88/cx88-tvaudio.c
@@ -38,7 +38,6 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/errno.h>
-#include "compat.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
#include <linux/suspend.h>
#else
@@ -55,7 +54,6 @@
#include <linux/vmalloc.h>
#include <linux/init.h>
#include <linux/delay.h>
-#include "compat.h"
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#include <linux/kthread.h>
#endif
diff --git a/linux/drivers/media/video/cx88/cx88-vbi.c b/linux/drivers/media/video/cx88/cx88-vbi.c
index d22c5f8cf..86c1cf833 100644
--- a/linux/drivers/media/video/cx88/cx88-vbi.c
+++ b/linux/drivers/media/video/cx88/cx88-vbi.c
@@ -6,7 +6,6 @@
#include <linux/init.h>
#include <linux/slab.h>
-#include "compat.h"
#include "cx88.h"
static unsigned int vbibufs = 4;
diff --git a/linux/drivers/media/video/cx88/cx88-vp3054-i2c.c b/linux/drivers/media/video/cx88/cx88-vp3054-i2c.c
index dc97f4686..9b28ae688 100644
--- a/linux/drivers/media/video/cx88/cx88-vp3054-i2c.c
+++ b/linux/drivers/media/video/cx88/cx88-vp3054-i2c.c
@@ -28,7 +28,6 @@
#include <asm/io.h>
-#include "compat.h"
#include "cx88.h"
#include "cx88-vp3054-i2c.h"
@@ -98,7 +97,7 @@ static int vp3054_bit_getsda(void *data)
/* ----------------------------------------------------------------------- */
-static struct i2c_algo_bit_data vp3054_i2c_algo_template = {
+static const struct i2c_algo_bit_data vp3054_i2c_algo_template = {
.setsda = vp3054_bit_setsda,
.setscl = vp3054_bit_setscl,
.getsda = vp3054_bit_getsda,
@@ -109,14 +108,6 @@ static struct i2c_algo_bit_data vp3054_i2c_algo_template = {
/* ----------------------------------------------------------------------- */
-static struct i2c_adapter vp3054_i2c_adap_template = {
- .name = "cx2388x",
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- .owner = THIS_MODULE,
-#endif
- .id = I2C_HW_B_CX2388x,
-};
-
int vp3054_i2c_probe(struct cx8802_dev *dev)
{
struct cx88_core *core = dev->core;
@@ -131,8 +122,6 @@ int vp3054_i2c_probe(struct cx8802_dev *dev)
return -ENOMEM;
vp3054_i2c = dev->card_priv;
- memcpy(&vp3054_i2c->adap, &vp3054_i2c_adap_template,
- sizeof(vp3054_i2c->adap));
memcpy(&vp3054_i2c->algo, &vp3054_i2c_algo_template,
sizeof(vp3054_i2c->algo));
@@ -145,6 +134,10 @@ int vp3054_i2c_probe(struct cx8802_dev *dev)
#endif
strlcpy(vp3054_i2c->adap.name, core->name,
sizeof(vp3054_i2c->adap.name));
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ vp3054_i2c->adap.owner = THIS_MODULE;
+#endif
+ vp3054_i2c->adap.id = I2C_HW_B_CX2388x;
vp3054_i2c->algo.data = dev;
i2c_set_adapdata(&vp3054_i2c->adap, dev);
vp3054_i2c->adap.algo_data = &vp3054_i2c->algo;
diff --git a/linux/drivers/media/video/ks0127.c b/linux/drivers/media/video/ks0127.c
index b6cd21e6d..b1d965bcd 100644
--- a/linux/drivers/media/video/ks0127.c
+++ b/linux/drivers/media/video/ks0127.c
@@ -48,6 +48,7 @@
#include <linux/i2c.h>
#include <linux/video_decoder.h>
+#include "compat.h"
#define dprintk if (debug) printk
diff --git a/linux/drivers/media/video/ks0127.h b/linux/drivers/media/video/ks0127.h
index 841717a21..1ec578833 100644
--- a/linux/drivers/media/video/ks0127.h
+++ b/linux/drivers/media/video/ks0127.h
@@ -24,7 +24,6 @@
#ifndef KS0127_H
#define KS0127_H
-#include "compat.h"
#include <linux/videodev.h>
/* input channels */
diff --git a/linux/drivers/media/video/ov7670.c b/linux/drivers/media/video/ov7670.c
index 4c5813969..5532ea260 100644
--- a/linux/drivers/media/video/ov7670.c
+++ b/linux/drivers/media/video/ov7670.c
@@ -16,10 +16,10 @@
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/videodev.h>
-#include "compat.h"
#include <media/v4l2-common.h>
#include <media/v4l2-chip-ident.h>
#include <linux/i2c.h>
+#include "compat.h"
MODULE_AUTHOR("Jonathan Corbet <corbet@lwn.net>");
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h
index 6e4cd7976..772af7376 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h
@@ -21,11 +21,11 @@
#ifndef __PVRUSB2_HDW_H
#define __PVRUSB2_HDW_H
-#include "compat.h"
#include <linux/usb.h>
#include <linux/videodev2.h>
#include "pvrusb2-io.h"
#include "pvrusb2-ctrl.h"
+#include "compat.h"
/* Private internal control ids, look these up with
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
index e28cc23ea..4e9429408 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
@@ -22,13 +22,13 @@
#include <linux/string.h>
#include <linux/slab.h>
#include <asm/semaphore.h>
-#include "compat.h"
#include "pvrusb2-sysfs.h"
#include "pvrusb2-hdw.h"
#include "pvrusb2-debug.h"
#ifdef CONFIG_VIDEO_PVRUSB2_DEBUGIFC
#include "pvrusb2-debugifc.h"
#endif /* CONFIG_VIDEO_PVRUSB2_DEBUGIFC */
+#include "compat.h"
#define pvr2_sysfs_trace(...) pvr2_trace(PVR2_TRACE_SYSFS,__VA_ARGS__)
diff --git a/linux/drivers/media/video/pwc/pwc-if.c b/linux/drivers/media/video/pwc/pwc-if.c
index 282ec2153..5e1755ecf 100644
--- a/linux/drivers/media/video/pwc/pwc-if.c
+++ b/linux/drivers/media/video/pwc/pwc-if.c
@@ -1136,7 +1136,7 @@ static int pwc_video_open(struct inode *inode, struct file *file)
return -EBUSY;
}
- down(&pdev->modlock);
+ mutex_lock(&pdev->modlock);
if (!pdev->usb_init) {
PWC_DEBUG_OPEN("Doing first time initialization.\n");
pdev->usb_init = 1;
@@ -1168,7 +1168,7 @@ static int pwc_video_open(struct inode *inode, struct file *file)
if (i < 0) {
PWC_DEBUG_OPEN("Failed to allocate buffers memory.\n");
pwc_free_buffers(pdev);
- up(&pdev->modlock);
+ mutex_unlock(&pdev->modlock);
return i;
}
@@ -1209,7 +1209,7 @@ static int pwc_video_open(struct inode *inode, struct file *file)
if (i) {
PWC_DEBUG_OPEN("Second attempt at set_video_mode failed.\n");
pwc_free_buffers(pdev);
- up(&pdev->modlock);
+ mutex_unlock(&pdev->modlock);
return i;
}
@@ -1218,7 +1218,7 @@ static int pwc_video_open(struct inode *inode, struct file *file)
PWC_DEBUG_OPEN("Failed to init ISOC stuff = %d.\n", i);
pwc_isoc_cleanup(pdev);
pwc_free_buffers(pdev);
- up(&pdev->modlock);
+ mutex_unlock(&pdev->modlock);
return i;
}
@@ -1228,7 +1228,7 @@ static int pwc_video_open(struct inode *inode, struct file *file)
pdev->vopen++;
file->private_data = vdev;
- up(&pdev->modlock);
+ mutex_unlock(&pdev->modlock);
PWC_DEBUG_OPEN("<< video_open() returns 0.\n");
return 0;
}
@@ -1733,7 +1733,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
pdev->angle_range.tilt_max = 2500;
}
- init_MUTEX(&pdev->modlock);
+ mutex_init(&pdev->modlock);
spin_lock_init(&pdev->ptrlock);
pdev->udev = udev;
diff --git a/linux/drivers/media/video/pwc/pwc.h b/linux/drivers/media/video/pwc/pwc.h
index acbb93129..0c77c3019 100644
--- a/linux/drivers/media/video/pwc/pwc.h
+++ b/linux/drivers/media/video/pwc/pwc.h
@@ -31,7 +31,11 @@
#include <linux/wait.h>
#include <linux/smp_lock.h>
#include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+#include <linux/mutex.h>
+#else
#include <asm/semaphore.h>
+#endif
#include <asm/errno.h>
#include <linux/videodev.h>
#include <media/v4l2-common.h>
@@ -244,7 +248,11 @@ struct pwc_device
int image_read_pos; /* In case we read data in pieces, keep track of were we are in the imagebuffer */
int image_used[MAX_IMAGES]; /* For MCAPTURE and SYNC */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+ struct mutex modlock; /* to prevent races in video_open(), etc */
+#else
struct semaphore modlock; /* to prevent races in video_open(), etc */
+#endif
spinlock_t ptrlock; /* for manipulating the buffer pointers */
/*** motorized pan/tilt feature */
diff --git a/linux/drivers/media/video/saa7111.c b/linux/drivers/media/video/saa7111.c
index 4c201e4bb..edd035470 100644
--- a/linux/drivers/media/video/saa7111.c
+++ b/linux/drivers/media/video/saa7111.c
@@ -37,24 +37,24 @@
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/signal.h>
+#include <linux/types.h>
+#include <linux/i2c.h>
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/page.h>
-#include <linux/types.h>
+#include <asm/uaccess.h>
-#include "compat.h"
#include <linux/videodev.h>
-#include <asm/uaccess.h>
+#include <linux/video_decoder.h>
+#include "compat.h"
MODULE_DESCRIPTION("Philips SAA7111 video decoder driver");
MODULE_AUTHOR("Dave Perks");
MODULE_LICENSE("GPL");
-#include <linux/i2c.h>
#define I2C_NAME(s) (s)->name
-#include <linux/video_decoder.h>
static int debug = 0;
module_param(debug, int, 0644);
diff --git a/linux/drivers/media/video/saa7114.c b/linux/drivers/media/video/saa7114.c
index 4ac79add1..6ac610562 100644
--- a/linux/drivers/media/video/saa7114.c
+++ b/linux/drivers/media/video/saa7114.c
@@ -35,29 +35,27 @@
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/major.h>
-
#include <linux/slab.h>
-
#include <linux/mm.h>
#include <linux/signal.h>
+#include <linux/types.h>
+#include <linux/i2c.h>
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/page.h>
-#include <linux/types.h>
+#include <asm/uaccess.h>
-#include "compat.h"
#include <linux/videodev.h>
-#include <asm/uaccess.h>
+#include <linux/video_decoder.h>
+#include "compat.h"
MODULE_DESCRIPTION("Philips SAA7114H video decoder driver");
MODULE_AUTHOR("Maxim Yevtyushkin");
MODULE_LICENSE("GPL");
-#include <linux/i2c.h>
#define I2C_NAME(x) (x)->name
-#include <linux/video_decoder.h>
static int debug = 0;
module_param(debug, int, 0);
diff --git a/linux/drivers/media/video/saa7134/saa7134-alsa.c b/linux/drivers/media/video/saa7134/saa7134-alsa.c
index ec3844e29..13916f207 100644
--- a/linux/drivers/media/video/saa7134/saa7134-alsa.c
+++ b/linux/drivers/media/video/saa7134/saa7134-alsa.c
@@ -30,7 +30,6 @@
#include <sound/pcm_params.h>
#include <sound/initval.h>
#include <linux/interrupt.h>
-#include "compat.h"
#include "saa7134.h"
#include "saa7134-reg.h"
diff --git a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c
index 12ce44738..110f56618 100644
--- a/linux/drivers/media/video/saa7134/saa7134-cards.c
+++ b/linux/drivers/media/video/saa7134/saa7134-cards.c
@@ -23,7 +23,6 @@
#include <linux/init.h>
#include <linux/module.h>
-#include "compat.h"
#include "saa7134-reg.h"
#include "saa7134.h"
#include <media/v4l2-common.h>
diff --git a/linux/drivers/media/video/saa7134/saa7134-core.c b/linux/drivers/media/video/saa7134/saa7134-core.c
index 324fceb3c..ba509ceea 100644
--- a/linux/drivers/media/video/saa7134/saa7134-core.c
+++ b/linux/drivers/media/video/saa7134/saa7134-core.c
@@ -30,7 +30,6 @@
#include <linux/sound.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
-#include "compat.h"
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
#include <linux/mutex.h>
#endif
diff --git a/linux/drivers/media/video/saa7134/saa7134-dvb.c b/linux/drivers/media/video/saa7134/saa7134-dvb.c
index d3423d2b5..1f6bd3300 100644
--- a/linux/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/linux/drivers/media/video/saa7134/saa7134-dvb.c
@@ -28,7 +28,6 @@
#include <linux/delay.h>
#include <linux/kthread.h>
#include <linux/suspend.h>
-#include "compat.h"
#include "saa7134-reg.h"
#include "saa7134.h"
diff --git a/linux/drivers/media/video/saa7134/saa7134-empress.c b/linux/drivers/media/video/saa7134/saa7134-empress.c
index 398f36b98..29927eabb 100644
--- a/linux/drivers/media/video/saa7134/saa7134-empress.c
+++ b/linux/drivers/media/video/saa7134/saa7134-empress.c
@@ -25,7 +25,6 @@
#include <linux/slab.h>
#include <linux/delay.h>
-#include "compat.h"
#include "saa7134-reg.h"
#include "saa7134.h"
diff --git a/linux/drivers/media/video/saa7134/saa7134-i2c.c b/linux/drivers/media/video/saa7134/saa7134-i2c.c
index f470c85e7..1be0a2edf 100644
--- a/linux/drivers/media/video/saa7134/saa7134-i2c.c
+++ b/linux/drivers/media/video/saa7134/saa7134-i2c.c
@@ -28,7 +28,6 @@
#include <linux/slab.h>
#include <linux/delay.h>
-#include "compat.h"
#include "saa7134-reg.h"
#include "saa7134.h"
#include <media/v4l2-common.h>
diff --git a/linux/drivers/media/video/saa7134/saa7134-input.c b/linux/drivers/media/video/saa7134/saa7134-input.c
index 2e32a86b4..5dc74a516 100644
--- a/linux/drivers/media/video/saa7134/saa7134-input.c
+++ b/linux/drivers/media/video/saa7134/saa7134-input.c
@@ -25,7 +25,6 @@
#include <linux/interrupt.h>
#include <linux/input.h>
-#include "compat.h"
#include "saa7134-reg.h"
#include "saa7134.h"
@@ -312,6 +311,7 @@ int saa7134_input_init1(struct saa7134_dev *dev)
mask_keycode = 0x003F00;
mask_keyup = 0x040000;
break;
+ case SAA7134_BOARD_FLYDVBS_LR300:
case SAA7134_BOARD_FLYDVBT_LR301:
case SAA7134_BOARD_FLYDVBTDUO:
ir_codes = ir_codes_flydvb;
diff --git a/linux/drivers/media/video/saa7134/saa7134-ts.c b/linux/drivers/media/video/saa7134/saa7134-ts.c
index 46413ebb0..60a90a261 100644
--- a/linux/drivers/media/video/saa7134/saa7134-ts.c
+++ b/linux/drivers/media/video/saa7134/saa7134-ts.c
@@ -28,7 +28,6 @@
#include <linux/slab.h>
#include <linux/delay.h>
-#include "compat.h"
#include "saa7134-reg.h"
#include "saa7134.h"
diff --git a/linux/drivers/media/video/saa7134/saa7134-tvaudio.c b/linux/drivers/media/video/saa7134/saa7134-tvaudio.c
index b4d741aef..c5ce33988 100644
--- a/linux/drivers/media/video/saa7134/saa7134-tvaudio.c
+++ b/linux/drivers/media/video/saa7134/saa7134-tvaudio.c
@@ -30,7 +30,6 @@
#include <linux/delay.h>
#include <asm/div64.h>
-#include "compat.h"
#include "saa7134-reg.h"
#include "saa7134.h"
diff --git a/linux/drivers/media/video/saa7134/saa7134-vbi.c b/linux/drivers/media/video/saa7134/saa7134-vbi.c
index 1a2ab1f88..f592974ff 100644
--- a/linux/drivers/media/video/saa7134/saa7134-vbi.c
+++ b/linux/drivers/media/video/saa7134/saa7134-vbi.c
@@ -27,7 +27,6 @@
#include <linux/kernel.h>
#include <linux/slab.h>
-#include "compat.h"
#include "saa7134-reg.h"
#include "saa7134.h"
diff --git a/linux/drivers/media/video/saa7134/saa7134-video.c b/linux/drivers/media/video/saa7134/saa7134-video.c
index 4a80e6d9a..f10137551 100644
--- a/linux/drivers/media/video/saa7134/saa7134-video.c
+++ b/linux/drivers/media/video/saa7134/saa7134-video.c
@@ -28,7 +28,6 @@
#include <linux/slab.h>
#include <linux/sort.h>
-#include "compat.h"
#include "saa7134-reg.h"
#include "saa7134.h"
#include <media/v4l2-common.h>
diff --git a/linux/drivers/media/video/saa7185.c b/linux/drivers/media/video/saa7185.c
index 04dad000d..552553dab 100644
--- a/linux/drivers/media/video/saa7185.c
+++ b/linux/drivers/media/video/saa7185.c
@@ -34,24 +34,24 @@
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/signal.h>
+#include <linux/types.h>
+#include <linux/i2c.h>
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/page.h>
-#include <linux/types.h>
+#include <asm/uaccess.h>
-#include "compat.h"
#include <linux/videodev.h>
-#include <asm/uaccess.h>
+#include <linux/video_encoder.h>
+#include "compat.h"
MODULE_DESCRIPTION("Philips SAA7185 video encoder driver");
MODULE_AUTHOR("Dave Perks");
MODULE_LICENSE("GPL");
-#include <linux/i2c.h>
#define I2C_NAME(s) (s)->name
-#include <linux/video_encoder.h>
static int debug = 0;
module_param(debug, int, 0);
diff --git a/linux/drivers/media/video/stradis.c b/linux/drivers/media/video/stradis.c
index 53256ea47..22289cf95 100644
--- a/linux/drivers/media/video/stradis.c
+++ b/linux/drivers/media/video/stradis.c
@@ -41,7 +41,6 @@
#include <linux/interrupt.h>
#include <asm/uaccess.h>
#include <linux/vmalloc.h>
-#include "compat.h"
#include <linux/videodev.h>
#include <media/v4l2-common.h>
@@ -50,6 +49,7 @@
#include "ibmmpeg2.h"
#include "saa7121.h"
#include "cs8420.h"
+#include "compat.h"
#define DEBUG(x) /* debug driver */
#undef IDEBUG /* debug irq handler */
diff --git a/linux/drivers/media/video/stv680.c b/linux/drivers/media/video/stv680.c
index e09a0c012..3410759f4 100644
--- a/linux/drivers/media/video/stv680.c
+++ b/linux/drivers/media/video/stv680.c
@@ -64,13 +64,13 @@
#include <linux/slab.h>
#include <linux/pagemap.h>
#include <linux/errno.h>
-#include "compat.h"
#include <linux/videodev.h>
#include <media/v4l2-common.h>
#include <linux/usb.h>
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
#include <linux/mutex.h>
#endif
+#include "compat.h"
#include "stv680.h"
diff --git a/linux/drivers/media/video/tda7432.c b/linux/drivers/media/video/tda7432.c
index 3e9ca9ace..580f571ca 100644
--- a/linux/drivers/media/video/tda7432.c
+++ b/linux/drivers/media/video/tda7432.c
@@ -43,7 +43,6 @@
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/slab.h>
-#include "compat.h"
#include <linux/videodev.h>
#include <linux/i2c.h>
@@ -53,6 +52,7 @@
#endif
#include <media/v4l2-common.h>
#include <media/i2c-addr.h>
+#include "compat.h"
#ifndef VIDEO_AUDIO_BALANCE
# define VIDEO_AUDIO_BALANCE 32
diff --git a/linux/drivers/media/video/tda9875.c b/linux/drivers/media/video/tda9875.c
index 12abefad7..8b0988cba 100644
--- a/linux/drivers/media/video/tda9875.c
+++ b/linux/drivers/media/video/tda9875.c
@@ -24,11 +24,11 @@
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/slab.h>
-#include "compat.h"
#include <linux/videodev.h>
#include <media/v4l2-common.h>
#include <linux/i2c.h>
#include <linux/init.h>
+#include "compat.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#include "id.h"
diff --git a/linux/drivers/media/video/tvaudio.c b/linux/drivers/media/video/tvaudio.c
index 210db55e6..9c8cd609a 100644
--- a/linux/drivers/media/video/tvaudio.c
+++ b/linux/drivers/media/video/tvaudio.c
@@ -23,7 +23,6 @@
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/slab.h>
-#include "compat.h"
#include <linux/videodev.h>
#include <linux/i2c.h>
#include <linux/init.h>
@@ -31,6 +30,7 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
#include <linux/freezer.h>
#endif
+#include "compat.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#include "i2c-compat.h"
diff --git a/linux/drivers/media/video/usbvideo/vicam.c b/linux/drivers/media/video/usbvideo/vicam.c
index 8c5e9eff9..7b988ae64 100644
--- a/linux/drivers/media/video/usbvideo/vicam.c
+++ b/linux/drivers/media/video/usbvideo/vicam.c
@@ -38,7 +38,6 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
-#include "compat.h"
#include <linux/videodev.h>
#include <linux/usb.h>
#include <linux/vmalloc.h>
diff --git a/linux/drivers/media/video/usbvision/usbvision-cards.c b/linux/drivers/media/video/usbvision/usbvision-cards.c
index 5ded513dc..380564cd3 100644
--- a/linux/drivers/media/video/usbvision/usbvision-cards.c
+++ b/linux/drivers/media/video/usbvision/usbvision-cards.c
@@ -24,7 +24,6 @@
#include <linux/list.h>
-#include "compat.h"
#include <media/v4l2-dev.h>
#include <media/tuner.h>
#include "usbvision.h"
diff --git a/linux/drivers/media/video/usbvision/usbvision-core.c b/linux/drivers/media/video/usbvision/usbvision-core.c
index 8f38a3e5b..f39c5c61b 100644
--- a/linux/drivers/media/video/usbvision/usbvision-core.c
+++ b/linux/drivers/media/video/usbvision/usbvision-core.c
@@ -29,7 +29,6 @@
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/utsname.h>
-#include "compat.h"
#include <linux/highmem.h>
#include <linux/videodev.h>
#include <linux/vmalloc.h>
diff --git a/linux/drivers/media/video/usbvision/usbvision-video.c b/linux/drivers/media/video/usbvision/usbvision-video.c
index fcc0807f5..c5314a15c 100644
--- a/linux/drivers/media/video/usbvision/usbvision-video.c
+++ b/linux/drivers/media/video/usbvision/usbvision-video.c
@@ -52,7 +52,6 @@
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/utsname.h>
-#include "compat.h"
#include <linux/highmem.h>
#include <linux/videodev.h>
#include <linux/vmalloc.h>
diff --git a/linux/drivers/media/video/usbvision/usbvision.h b/linux/drivers/media/video/usbvision/usbvision.h
index 717e3e6c9..0cd172e1a 100644
--- a/linux/drivers/media/video/usbvision/usbvision.h
+++ b/linux/drivers/media/video/usbvision/usbvision.h
@@ -37,6 +37,7 @@
#include <media/v4l2-common.h>
#include <media/tuner.h>
#include <linux/videodev2.h>
+#include "compat.h"
#define USBVISION_DEBUG /* Turn on debug messages */
diff --git a/linux/drivers/media/video/videodev.c b/linux/drivers/media/video/videodev.c
index 063f02159..61c59ac41 100644
--- a/linux/drivers/media/video/videodev.c
+++ b/linux/drivers/media/video/videodev.c
@@ -38,7 +38,6 @@
#include <linux/slab.h>
#include <asm/uaccess.h>
#include <asm/system.h>
-#include "compat.h"
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
#include <asm/semaphore.h>
#endif
@@ -50,6 +49,7 @@
#include <linux/videodev.h>
#endif
#include <media/v4l2-common.h>
+#include "compat.h"
#define VIDEO_NUM_DEVICES 256
#define VIDEO_NAME "video4linux"
diff --git a/linux/drivers/media/video/vivi.c b/linux/drivers/media/video/vivi.c
index 0cea7c28b..bd418e590 100644
--- a/linux/drivers/media/video/vivi.c
+++ b/linux/drivers/media/video/vivi.c
@@ -25,6 +25,11 @@
#include <linux/pci.h>
#include <linux/random.h>
#include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+#include <linux/mutex.h>
+#else
+#include <asm/semaphore.h>
+#endif
#include "compat.h"
#include <linux/videodev2.h>
#include <linux/dma-mapping.h>
@@ -177,7 +182,11 @@ static LIST_HEAD(vivi_devlist);
struct vivi_dev {
struct list_head vivi_devlist;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+ struct mutex lock;
+#else
struct semaphore lock;
+#endif
int users;
@@ -970,16 +979,16 @@ static struct videobuf_queue_ops vivi_video_qops = {
static int res_get(struct vivi_dev *dev, struct vivi_fh *fh)
{
/* is it free? */
- down(&dev->lock);
+ mutex_lock(&dev->lock);
if (dev->resources) {
/* no, someone else uses it */
- up(&dev->lock);
+ mutex_unlock(&dev->lock);
return 0;
}
/* it's free, grab it */
dev->resources =1;
dprintk(1,"res: get\n");
- up(&dev->lock);
+ mutex_unlock(&dev->lock);
return 1;
}
@@ -990,10 +999,10 @@ static int res_locked(struct vivi_dev *dev)
static void res_free(struct vivi_dev *dev, struct vivi_fh *fh)
{
- down(&dev->lock);
+ mutex_lock(&dev->lock);
dev->resources = 0;
dprintk(1,"res: put\n");
- up(&dev->lock);
+ mutex_lock(&dev->lock);
}
/* ------------------------------------------------------------------
@@ -1506,7 +1515,7 @@ static int __init vivi_init(void)
init_waitqueue_head(&dev->vidq.wq);
/* initialize locks */
- init_MUTEX(&dev->lock);
+ mutex_init(&dev->lock);
dev->vidq.timeout.function = vivi_vid_timeout;
dev->vidq.timeout.data = (unsigned long)dev;
diff --git a/linux/drivers/media/video/w9968cf.h b/linux/drivers/media/video/w9968cf.h
index 769315527..c2e609bac 100644
--- a/linux/drivers/media/video/w9968cf.h
+++ b/linux/drivers/media/video/w9968cf.h
@@ -21,7 +21,6 @@
#ifndef _W9968CF_H_
#define _W9968CF_H_
-#include "compat.h"
#include <linux/videodev.h>
#include <linux/usb.h>
#include <linux/i2c.h>
@@ -40,6 +39,7 @@
#endif
#include <media/ovcamchip.h>
+#include "compat.h"
#include "w9968cf_vpp.h"