diff options
author | Michael Hunold <devnull@localhost> | 2003-01-08 17:41:32 +0000 |
---|---|---|
committer | Michael Hunold <devnull@localhost> | 2003-01-08 17:41:32 +0000 |
commit | d166085ef7eea32af71c4c20321f067a38bb394a (patch) | |
tree | 1cb9582a6374cdd92b69bd264d7fc7e1b1a43459 /linux/drivers/media/dvb/ttpci/av7110.c | |
parent | c968f1b52110e481ca9e183729b3a6ad6a2d3aeb (diff) | |
download | mediapointer-dvb-s2-d166085ef7eea32af71c4c20321f067a38bb394a.tar.gz mediapointer-dvb-s2-d166085ef7eea32af71c4c20321f067a38bb394a.tar.bz2 |
Removed the whole "device<=>extension" matching crap, the pci subsystem
can do this much better. We now simply register one pci driver for
every extension and are done with it -- if a device actually exists, the
pci subsystem calls us back. That's it.
Warning: this triggers a bug in the 2.5.x module subsystem -- you should
*not* use the driver.av7110 script and modprobe the driver. You can
a) build your kernel staticall
b) insert the modules one by one with *insmod*
I already filed a bug report to lkml.
Fixed a bug in Kconfig which prevented the saa7146 modules from being build.
Diffstat (limited to 'linux/drivers/media/dvb/ttpci/av7110.c')
-rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110.c | 201 |
1 files changed, 112 insertions, 89 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c index 4c09c2eba..fbc0606e9 100644 --- a/linux/drivers/media/dvb/ttpci/av7110.c +++ b/linux/drivers/media/dvb/ttpci/av7110.c @@ -4124,67 +4124,8 @@ struct saa7146_extension_ioctls ioctls[] = { { 0, 0 } }; -static char *fs_1_5 = { "Siemens cable card PCI rev1.5" }; -static char *fs_1_3 = { "Siemens/Technotrend/Hauppauge PCI rev1.3" }; -static char *unkwn = { "Technotrend/Hauppauge PCI rev?(unknown0)?"}; -static char *tt_1_6 = { "Technotrend/Hauppauge PCI rev1.3 or 1.6" }; -static char *tt_2_1 = { "Technotrend/Hauppauge PCI rev2.1" }; -static char *tt_t = { "Technotrend/Hauppauge PCI DVB-T" }; - -static struct saa7146_sub_info sub_data[] = { - { - .subvendor = 0x110a, - .subdevice = 0xffff, - .name = &fs_1_5 - }, { - .subvendor = 0x110a, - .subdevice = 0x0000, - .name = &fs_1_5 - }, { - .subvendor = 0x13c2, - .subdevice = 0x0000, - .name = &fs_1_3 - }, { - .subvendor = 0x13c2, - .subdevice = 0x1002, - .name = &unkwn - }, { - .subvendor = 0x13c2, - .subdevice = 0x0001, - .name = &tt_1_6 - }, { - .subvendor = 0x13c2, - .subdevice = 0x0002, - .name = &tt_2_1 - }, { - .subvendor = 0x13c2, - .subdevice = 0x0003, - .name = &tt_2_1 - }, { - .subvendor = 0x13c2, - .subdevice = 0x0004, - .name = &tt_2_1 - }, { - .subvendor = 0x13c2, - .subdevice = 0x0006, - .name = &tt_1_6 - }, { - .subvendor = 0x13c2, - .subdevice = 0x0008, - .name = &tt_t - }, { - .subvendor = 0xffc2, - .subdevice = 0x0000, - .name = &unkwn - }, { - .subvendor = 0xffff, - .subdevice = 0xffff, - .name = NULL - } -}; - static -int av7110_attach (struct saa7146_dev* dev, struct saa7146_sub_info *info) +int av7110_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_data *pci_ext) { av7110_t *av7110 = NULL; int ret = 0; @@ -4195,7 +4136,7 @@ int av7110_attach (struct saa7146_dev* dev, struct saa7146_sub_info *info) } memset(av7110, 0, sizeof(av7110_t)); - av7110->card_name = *info->name; + av7110->card_name = (char*)pci_ext->ext_priv; (av7110_t*)dev->ext_priv = av7110; DEB_EE(("dev: %p, av7110: %p\n",dev,av7110)); @@ -4431,21 +4372,6 @@ void av7110_irq(struct saa7146_dev* dev, u32 *isr) } } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51) -static -void av7110_inc_use(struct saa7146_dev* adap) -{ - MOD_INC_USE_COUNT; -} - -static -void av7110_dec_use(struct saa7146_dev* adap) -{ - MOD_DEC_USE_COUNT; -} -#endif - - /* FIXME: these values are experimental values that look better than the values from the latest "official" driver -- at least for me... (MiHu) */ static @@ -4456,6 +4382,113 @@ struct saa7146_standard standard[] = { }; static +struct saa7146_extension av7110_extension; + +static +struct saa7146_pci_extension_data fs_1_5 = { + .ext_priv = "Siemens cable card PCI rev1.5", + .ext = &av7110_extension, +}; +static +struct saa7146_pci_extension_data fs_1_3 = { + .ext_priv = "Siemens/Technotrend/Hauppauge PCI rev1.3", + .ext = &av7110_extension, +}; +static +struct saa7146_pci_extension_data unkwn = { + .ext_priv = "Technotrend/Hauppauge PCI rev?(unknown0)?", + .ext = &av7110_extension, +}; +static +struct saa7146_pci_extension_data tt_1_6 = { + .ext_priv = "Technotrend/Hauppauge PCI rev1.3 or 1.6", + .ext = &av7110_extension, +}; +static +struct saa7146_pci_extension_data tt_2_1 = { + .ext_priv = "Technotrend/Hauppauge PCI rev2.1", + .ext = &av7110_extension, +}; +static +struct saa7146_pci_extension_data tt_t = { + .ext_priv = "Technotrend/Hauppauge PCI DVB-T", + .ext = &av7110_extension, +}; + +static +struct pci_device_id pci_tbl[] = { + { + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7146, + .subvendor = 0x110a, + .subdevice = 0xffff, + .driver_data = (unsigned long)&fs_1_5 + }, { + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7146, + .subvendor = 0x110a, + .subdevice = 0x0000, + .driver_data = (unsigned long)&fs_1_5 + }, { + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7146, + .subvendor = 0x13c2, + .subdevice = 0x0000, + .driver_data = (unsigned long)&fs_1_3 + }, { + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7146, + .subvendor = 0x13c2, + .subdevice = 0x1002, + .driver_data = (unsigned long)&unkwn + }, { + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7146, + .subvendor = 0x13c2, + .subdevice = 0x0001, + .driver_data = (unsigned long)&tt_1_6 + }, { + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7146, + .subvendor = 0x13c2, + .subdevice = 0x0002, + .driver_data = (unsigned long)&tt_2_1 + }, { + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7146, + .subvendor = 0x13c2, + .subdevice = 0x0003, + .driver_data = (unsigned long)&tt_2_1 + }, { + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7146, + .subvendor = 0x13c2, + .subdevice = 0x0004, + .driver_data = (unsigned long)&tt_2_1 + }, { + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7146, + .subvendor = 0x13c2, + .subdevice = 0x0006, + .driver_data = (unsigned long)&tt_1_6 + }, { + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7146, + .subvendor = 0x13c2, + .subdevice = 0x0008, + .driver_data = (unsigned long)&tt_t + }, { + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7146, + .subvendor = 0xffc2, + .subdevice = 0x0000, + .driver_data = (unsigned long)&unkwn + }, { + .vendor = 0, + } +}; + +static struct saa7146_ext_vv av7110_vv_data = { .inputs = 1, .audios = 1, @@ -4473,15 +4506,10 @@ struct saa7146_ext_vv av7110_vv_data = { static struct saa7146_extension av7110_extension = { .name = "dvb\0", - .flags = 0, + .ext_vv_data = &av7110_vv_data, - .devices = &sub_data[0], .module = THIS_MODULE, - .ext_vv_data = &av7110_vv_data, -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51) - .inc_use = av7110_inc_use, - .dec_use = av7110_dec_use, -#endif + .pci_tbl = &pci_tbl[0], .attach = av7110_attach, .detach = av7110_detach, @@ -4493,8 +4521,6 @@ struct saa7146_extension av7110_extension = { static int __init av7110_init(void) { - DEB_EE((".\n")); - if (saa7146_register_extension(&av7110_extension)) return -ENODEV; @@ -4505,10 +4531,7 @@ int __init av7110_init(void) static void __exit av7110_exit(void) { - DEB_EE((".\n")); - - if (saa7146_unregister_extension(&av7110_extension)) - printk(KERN_ERR "dvb: extension deregistration failed.\n"); + saa7146_unregister_extension(&av7110_extension); } module_init(av7110_init); |