summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/mxb.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/mxb.c')
-rw-r--r--linux/drivers/media/video/mxb.c87
1 files changed, 38 insertions, 49 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");