diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2007-03-24 14:23:50 -0400 |
---|---|---|
committer | Michael Krufky <mkrufky@linuxtv.org> | 2007-03-24 14:23:50 -0400 |
commit | 9aa6c43d4def3e381b869d7a7b6ce15f21e430b9 (patch) | |
tree | 2b6baaaba75b23ce0d7aa4d0923f6e6293c4717b /linux/drivers/media/video | |
parent | 00b6dbf1372a8f3f77f2d5ff9b2cfd47797826d3 (diff) | |
download | mediapointer-dvb-s2-9aa6c43d4def3e381b869d7a7b6ce15f21e430b9.tar.gz mediapointer-dvb-s2-9aa6c43d4def3e381b869d7a7b6ce15f21e430b9.tar.bz2 |
bttv: automatically load dvb-bt8xx for bttv cards with dvb support
From: Jarod Wilson <jwilson@redhat.com>
This patch causes the bttv driver to automatically load the dvb-bt8xx module
for bttv/dvb hybrid cards. Successfully tested with a pcHDTV HD-2000 card.
This patch is based on the recent patches to enable autoloading of cx88-dvb,
cx88-blackbird and saa7134-dvb.
Signed-off-by: Jarod Wilson <jwilson@redhat.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/bt8xx/bttv-driver.c | 36 | ||||
-rw-r--r-- | linux/drivers/media/video/bt8xx/bttvp.h | 3 |
2 files changed, 37 insertions, 2 deletions
diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c index 25a61e379..2aad57b5a 100644 --- a/linux/drivers/media/video/bt8xx/bttv-driver.c +++ b/linux/drivers/media/video/bt8xx/bttv-driver.c @@ -177,6 +177,36 @@ static CLASS_DEVICE_ATTR(card, S_IRUGO, show_card, NULL); #endif /* ----------------------------------------------------------------------- */ +/* dvb auto-load setup */ +#if defined(CONFIG_MODULES) && defined(MODULE) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) +static void request_module_async(void *ptr) +#else +static void request_module_async(struct work_struct *work) +#endif +{ + request_module("dvb-bt8xx"); +} + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +#define request_modules(dev) +#else +static void request_modules(struct bttv *dev) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) + INIT_WORK(&dev->request_module_wk, request_module_async, (void*)dev); +#else + INIT_WORK(&dev->request_module_wk, request_module_async); +#endif + schedule_work(&dev->request_module_wk); +} +#endif +#else +#define request_modules(dev) +#endif /* CONFIG_MODULES */ + + +/* ----------------------------------------------------------------------- */ /* static data */ /* special timing tables from conexant... */ @@ -4811,9 +4841,11 @@ static int __devinit bttv_probe(struct pci_dev *dev, } #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - /* add subdevices */ - if (bttv_tvcards[btv->c.type].has_dvb) + /* add subdevices and autoload dvb-bt8xx if needed */ + if (bttv_tvcards[btv->c.type].has_dvb) { bttv_sub_add_device(&btv->c, "dvb"); + request_modules(btv); + } #endif bttv_input_init(btv); diff --git a/linux/drivers/media/video/bt8xx/bttvp.h b/linux/drivers/media/video/bt8xx/bttvp.h index a273c424b..eee6f5ae3 100644 --- a/linux/drivers/media/video/bt8xx/bttvp.h +++ b/linux/drivers/media/video/bt8xx/bttvp.h @@ -452,6 +452,9 @@ struct bttv { unsigned int users; struct bttv_fh init; + /* used to make dvb-bt8xx autoloadable */ + struct work_struct request_module_wk; + /* Default (0) and current (1) video capturing and overlay cropping parameters in bttv_tvnorm.cropcap units. Protected by bttv.lock. */ |