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/mxb.c87
-rw-r--r--linux/drivers/media/video/saa7111.c16
-rw-r--r--linux/drivers/media/video/tda9840.c27
-rw-r--r--linux/drivers/media/video/tea6415c.c37
-rw-r--r--linux/drivers/media/video/tea6420.c27
5 files changed, 61 insertions, 133 deletions
diff --git a/linux/drivers/media/video/mxb.c b/linux/drivers/media/video/mxb.c
index a65f6ebff..29be50726 100644
--- a/linux/drivers/media/video/mxb.c
+++ b/linux/drivers/media/video/mxb.c
@@ -1,7 +1,7 @@
/*
mxb.c - v4l2 driver for the Multimedia eXtension Board
- Copyright (C) 1998-2002 Michael Hunold <michael@mihu.de>
+ Copyright (C) 1998-2003 Michael Hunold <michael@mihu.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -70,15 +70,8 @@ static int mxb_num = 0;
channel called "phoenix" */
static int freq = 4148;
-/* debug verbosity */
-static int debug = 0;
-
-#ifdef MODULE
MODULE_PARM(freq,"i");
MODULE_PARM_DESC(freq, "initial frequency the tuner will be tuned to while setup");
-MODULE_PARM(debug,"i");
-MODULE_PARM_DESC(debug, "debug verbosity");
-#endif
#define MXB_INPUTS 4
enum { TUNER, AUX1, AUX3, AUX3_YC };
@@ -201,7 +194,7 @@ static int mxb_vbi_bypass(struct saa7146_dev* dev)
return 0;
}
-static int mxb_probe(struct saa7146_dev* dev, unsigned int subvendor, unsigned int subdevice)
+static int mxb_probe(struct saa7146_dev* dev)
{
struct mxb* mxb = 0;
@@ -361,7 +354,7 @@ static int mxb_init_done(struct saa7146_dev* dev)
/* write configuration to saa7111a */
i = i2c_master_send(mxb->saa7111a, init, sizeof(init));
if (i < 0) {
- DEB_D(("failed to initialize saa7111a. this should never happen.\n"));
+ printk("failed to initialize saa7111a. this should never happen.\n");
}
/* select tuner-output on saa7111a */
@@ -457,7 +450,7 @@ void mxb_irq_bh(struct saa7146_dev* dev, u32* irq_mask)
*/
/* this function only gets called when the probing was successful */
-static int mxb_attach(struct saa7146_dev* dev, struct saa7146_sub_info *info)
+static int mxb_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_data *info)
{
struct mxb* mxb = (struct mxb*)dev->ext_priv;
@@ -479,15 +472,18 @@ static int mxb_attach(struct saa7146_dev* dev, struct saa7146_sub_info *info)
}
}
- i2c_inc_use_client(mxb->tea6420_1);
- i2c_inc_use_client(mxb->tea6420_2);
- i2c_inc_use_client(mxb->tea6415c);
- i2c_inc_use_client(mxb->tda9840);
- i2c_inc_use_client(mxb->saa7111a);
- i2c_inc_use_client(mxb->tuner);
+ i2c_use_client(mxb->tea6420_1);
+ i2c_use_client(mxb->tea6420_2);
+ i2c_use_client(mxb->tea6415c);
+ i2c_use_client(mxb->tda9840);
+ i2c_use_client(mxb->saa7111a);
+ i2c_use_client(mxb->tuner);
+
+ printk("mxb: found 'Multimedia eXtension Board'-%d.\n",mxb_num);
mxb_num++;
- return mxb_init_done(dev);
+ mxb_init_done(dev);
+ return 0;
}
static int mxb_detach(struct saa7146_dev* dev)
@@ -496,12 +492,12 @@ static int mxb_detach(struct saa7146_dev* dev)
DEB_EE(("dev:%p\n",dev));
- i2c_dec_use_client(mxb->tea6420_1);
- i2c_dec_use_client(mxb->tea6420_2);
- i2c_dec_use_client(mxb->tea6415c);
- i2c_dec_use_client(mxb->tda9840);
- i2c_dec_use_client(mxb->saa7111a);
- i2c_dec_use_client(mxb->tuner);
+ i2c_release_client(mxb->tea6420_1);
+ i2c_release_client(mxb->tea6420_2);
+ i2c_release_client(mxb->tea6415c);
+ i2c_release_client(mxb->tda9840);
+ i2c_release_client(mxb->saa7111a);
+ i2c_release_client(mxb->tuner);
saa7146_unregister_device(&mxb->video_dev,dev);
if( 0 != MXB_BOARD_CAN_DO_VBI(dev)) {
@@ -989,28 +985,30 @@ static struct saa7146_standard standard[] = {
{ "SECAM", V4L2_STD_SECAM, SAA7146_SECAM_VALUES },
};
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51)
-static void mxb_inc_use(struct saa7146_dev *dev)
-{
- MOD_INC_USE_COUNT;
-}
+static
+struct saa7146_extension extension;
-static void mxb_dec_use(struct saa7146_dev *dev)
-{
- MOD_DEC_USE_COUNT;
-}
-#endif
+static
+struct saa7146_pci_extension_data mxb = {
+ .ext_priv = "Multimedia eXtension Board",
+ .ext = &extension,
+};
-static struct saa7146_sub_info sub_data[] = {
- { 0x0000, 0x0000 },
- { 0xffff, 0xffff },
+static
+struct pci_device_id pci_tbl[] = {
+ {
+ .vendor = PCI_VENDOR_ID_PHILIPS,
+ .device = PCI_DEVICE_ID_PHILIPS_SAA7146,
+ .subvendor = 0x0000,
+ .subdevice = 0x0000,
+ .driver_data = (unsigned long)&mxb,
+ }
};
static
struct saa7146_ext_vv vv_data = {
.inputs = MXB_INPUTS,
.capabilities = V4L2_CAP_TUNER | V4L2_CAP_VBI_CAPTURE,
- .flags = 0,
.stds = &standard[0],
.num_stds = sizeof(standard)/sizeof(struct saa7146_standard),
.std_callback = &std_callback,
@@ -1023,15 +1021,10 @@ struct saa7146_extension extension = {
.name = MXB_IDENTIFIER,
.flags = SAA7146_USE_I2C_IRQ,
- .devices = &sub_data[0],
+ .pci_tbl = &pci_tbl[0],
.module = THIS_MODULE,
.ext_vv_data = &vv_data,
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51)
- .inc_use = mxb_inc_use,
- .dec_use = mxb_dec_use,
-#endif
-
.probe = mxb_probe,
.attach = mxb_attach,
.detach = mxb_detach,
@@ -1042,8 +1035,6 @@ struct saa7146_extension extension = {
int __init mxb_init_module(void)
{
- struct saa7146_dev *dev = NULL;
-
if( 0 != saa7146_register_extension(&extension)) {
DEB_S(("failed to register extension.\n"));
return -ENODEV;
@@ -1054,14 +1045,12 @@ int __init mxb_init_module(void)
void __exit mxb_cleanup_module(void)
{
- struct saa7146_dev *dev = NULL;
-
saa7146_unregister_extension(&extension);
}
module_init(mxb_init_module);
module_exit(mxb_cleanup_module);
-MODULE_DESCRIPTION("video4linux driver for the Siemens-Nixdorf 'Multimedia eXtension board'");
+MODULE_DESCRIPTION("video4linux-2 driver for the Siemens-Nixdorf 'Multimedia eXtension board'");
MODULE_AUTHOR("Michael Hunold <michael@mihu.de>");
MODULE_LICENSE("GPL");
diff --git a/linux/drivers/media/video/saa7111.c b/linux/drivers/media/video/saa7111.c
index 461e797cc..7dc3bae14 100644
--- a/linux/drivers/media/video/saa7111.c
+++ b/linux/drivers/media/video/saa7111.c
@@ -57,8 +57,6 @@ struct saa7111 {
int sat;
};
-/* hmm, the saa7111(a) specs don't say anything about address 34>>1 (= 17 = 0x11),
- only for 0x24 and 0x25 ... */
static unsigned short normal_i2c[] = { 0x24, 0x25, I2C_CLIENT_END };
static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
@@ -205,17 +203,6 @@ static int saa7111_command(struct i2c_client *client, unsigned int cmd,
cap->outputs = 1;
}
break;
- case DECODER_INIT:
- {
- int i = 0;
- struct video_decoder_init *init = arg;
- i = i2c_master_send(client, init->data, init->count);
- if (i < 0) {
- return -EFAULT;
- } else {
- }
- }
- break;
case DECODER_GET_STATUS:
{
int *iarg = arg;
@@ -401,6 +388,9 @@ static int saa7111_command(struct i2c_client *client, unsigned int cmd,
/* ----------------------------------------------------------------------- */
static struct i2c_driver i2c_driver_saa7111 = {
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,54)
+ .owner = THIS_MODULE,
+#endif
.name = "saa7111", /* name */
.id = I2C_DRIVERID_SAA7111A, /* ID */
.flags = I2C_DF_NOTIFY,
diff --git a/linux/drivers/media/video/tda9840.c b/linux/drivers/media/video/tda9840.c
index 116b59f74..dfdf04968 100644
--- a/linux/drivers/media/video/tda9840.c
+++ b/linux/drivers/media/video/tda9840.c
@@ -1,3 +1,4 @@
+#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/poll.h>
@@ -7,11 +8,8 @@
#include "tda9840.h"
-#ifdef MODULE
-MODULE_PARM(debug,"i");
-#endif
-
static int debug = 0; /* insmod parameter */
+MODULE_PARM(debug,"i");
#define dprintk if (debug) printk
#define SWITCH 0x00
@@ -227,29 +225,16 @@ static int tda9840_detach(struct i2c_client *client)
return 0;
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51)
-static void tda9840_inc_use(struct i2c_client *client)
-{
- MOD_INC_USE_COUNT;
-}
-
-static void tda9840_dec_use(struct i2c_client *client)
-{
- MOD_DEC_USE_COUNT;
-}
-#endif
-
static struct i2c_driver driver = {
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,54)
+ .owner = THIS_MODULE,
+#endif
.name = "tda9840 driver",
.id = I2C_DRIVERID_TDA9840,
.flags = I2C_DF_NOTIFY,
.attach_adapter = tda9840_attach,
.detach_client = tda9840_detach,
.command = tda9840_command,
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51)
- .inc_use = tda9840_inc_use,
- .dec_use = tda9840_dec_use,
-#endif
};
static int tda9840_init_module(void)
@@ -266,9 +251,7 @@ static void tda9840_cleanup_module(void)
module_init(tda9840_init_module);
module_exit(tda9840_cleanup_module);
-#ifdef MODULE
MODULE_AUTHOR("Michael Hunold <michael@mihu.de>");
MODULE_DESCRIPTION("tda9840 driver");
MODULE_LICENSE("GPL");
-#endif
diff --git a/linux/drivers/media/video/tea6415c.c b/linux/drivers/media/video/tea6415c.c
index d6d8b5c97..dd65664d4 100644
--- a/linux/drivers/media/video/tea6415c.c
+++ b/linux/drivers/media/video/tea6415c.c
@@ -1,3 +1,4 @@
+#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/poll.h>
@@ -6,11 +7,8 @@
#include <linux/init.h>
#include "tea6415c.h"
-#ifdef MODULE
-MODULE_PARM(debug,"i");
-#endif
-
static int debug = 0; /* insmod parameter */
+MODULE_PARM(debug,"i");
#define dprintk if (debug) printk
#define TEA6415C_NUM_INPUTS 8
@@ -174,29 +172,16 @@ static int tea6415c_command(struct i2c_client *client, unsigned int cmd, void* a
return 0;
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51)
-static void tea6415c_inc_use(struct i2c_client *client)
-{
- MOD_INC_USE_COUNT;
-}
-
-static void tea6415c_dec_use(struct i2c_client *client)
-{
- MOD_DEC_USE_COUNT;
-}
-#endif
-
static struct i2c_driver driver = {
- "tea6415c driver",
- I2C_DRIVERID_TEA6415C,
- I2C_DF_NOTIFY,
- tea6415c_attach,
- tea6415c_detach,
- tea6415c_command,
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51)
- tea6415c_inc_use,
- tea6415c_dec_use,
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,54)
+ .owner = THIS_MODULE,
#endif
+ .name = "tea6415c driver",
+ .id = I2C_DRIVERID_TEA6415C,
+ .flags = I2C_DF_NOTIFY,
+ .attach_adapter = tea6415c_attach,
+ .detach_client = tea6415c_detach,
+ .command = tea6415c_command,
};
static int tea6415c_init_module(void)
@@ -213,9 +198,7 @@ static void tea6415c_cleanup_module(void)
module_init(tea6415c_init_module);
module_exit(tea6415c_cleanup_module);
-#ifdef MODULE
MODULE_AUTHOR("Michael Hunold <michael@mihu.de>");
MODULE_DESCRIPTION("tea6415c driver");
MODULE_LICENSE("GPL");
-#endif
diff --git a/linux/drivers/media/video/tea6420.c b/linux/drivers/media/video/tea6420.c
index 4f1aff624..38bd85b6a 100644
--- a/linux/drivers/media/video/tea6420.c
+++ b/linux/drivers/media/video/tea6420.c
@@ -1,3 +1,4 @@
+#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/poll.h>
@@ -7,11 +8,8 @@
#include "tea6420.h"
-#ifdef MODULE
-MODULE_PARM(debug,"i");
-#endif
-
static int debug = 0; /* insmod parameter */
+MODULE_PARM(debug,"i");
#define dprintk if (debug) printk
/* addresses to scan, found only at 0x4c and/or 0x4d (7-Bit) */
@@ -154,29 +152,16 @@ static int tea6420_command(struct i2c_client *client, unsigned int cmd, void* ar
return 0;
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51)
-static void tea6420_inc_use(struct i2c_client *client)
-{
- MOD_INC_USE_COUNT;
-}
-
-static void tea6420_dec_use(struct i2c_client *client)
-{
- MOD_DEC_USE_COUNT;
-}
-#endif
-
static struct i2c_driver driver = {
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,54)
+ .owner = THIS_MODULE,
+#endif
.name = "tea6420 driver",
.id = I2C_DRIVERID_TEA6420,
.flags = I2C_DF_NOTIFY,
.attach_adapter = tea6420_attach,
.detach_client = tea6420_detach,
.command = tea6420_command,
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51)
- .inc_use = tea6420_inc_use,
- .dec_use = tea6420_dec_use,
-#endif
};
static int tea6420_init_module(void)
@@ -193,8 +178,6 @@ static void tea6420_cleanup_module(void)
module_init(tea6420_init_module);
module_exit(tea6420_cleanup_module);
-#ifdef MODULE
MODULE_AUTHOR("Michael Hunold <michael@mihu.de>");
MODULE_DESCRIPTION("tea6420 driver");
MODULE_LICENSE("GPL");
-#endif