aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx
diff options
context:
space:
mode:
authorJarod Wilson <jwilson@redhat.com>2007-03-24 14:23:50 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-04-27 14:45:14 -0400
commitf992a497c71981e215b1415759fc13593ed2919f (patch)
tree7bcf199c6c004f592ce85518eacf32ed4cfbacc5 /drivers/media/video/bt8xx
parentfbc8408a0d9deeba8926e041db0bb1ef7f1b2cd6 (diff)
V4L/DVB (5482): Bttv: automatically load dvb-bt8xx for bttv cards with dvb
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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/bt8xx')
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c24
-rw-r--r--drivers/media/video/bt8xx/bttvp.h3
2 files changed, 25 insertions, 2 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 5720b77ac9a7..1c38723d3169 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -164,6 +164,24 @@ static ssize_t show_card(struct class_device *cd, char *buf)
164static CLASS_DEVICE_ATTR(card, S_IRUGO, show_card, NULL); 164static CLASS_DEVICE_ATTR(card, S_IRUGO, show_card, NULL);
165 165
166/* ----------------------------------------------------------------------- */ 166/* ----------------------------------------------------------------------- */
167/* dvb auto-load setup */
168#if defined(CONFIG_MODULES) && defined(MODULE)
169static void request_module_async(struct work_struct *work)
170{
171 request_module("dvb-bt8xx");
172}
173
174static void request_modules(struct bttv *dev)
175{
176 INIT_WORK(&dev->request_module_wk, request_module_async);
177 schedule_work(&dev->request_module_wk);
178}
179#else
180#define request_modules(dev)
181#endif /* CONFIG_MODULES */
182
183
184/* ----------------------------------------------------------------------- */
167/* static data */ 185/* static data */
168 186
169/* special timing tables from conexant... */ 187/* special timing tables from conexant... */
@@ -4769,9 +4787,11 @@ static int __devinit bttv_probe(struct pci_dev *dev,
4769 disclaim_video_lines(btv); 4787 disclaim_video_lines(btv);
4770 } 4788 }
4771 4789
4772 /* add subdevices */ 4790 /* add subdevices and autoload dvb-bt8xx if needed */
4773 if (bttv_tvcards[btv->c.type].has_dvb) 4791 if (bttv_tvcards[btv->c.type].has_dvb) {
4774 bttv_sub_add_device(&btv->c, "dvb"); 4792 bttv_sub_add_device(&btv->c, "dvb");
4793 request_modules(btv);
4794 }
4775 4795
4776 bttv_input_init(btv); 4796 bttv_input_init(btv);
4777 4797
diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h
index ad79b8d53430..8f44f02029be 100644
--- a/drivers/media/video/bt8xx/bttvp.h
+++ b/drivers/media/video/bt8xx/bttvp.h
@@ -434,6 +434,9 @@ struct bttv {
434 unsigned int users; 434 unsigned int users;
435 struct bttv_fh init; 435 struct bttv_fh init;
436 436
437 /* used to make dvb-bt8xx autoloadable */
438 struct work_struct request_module_wk;
439
437 /* Default (0) and current (1) video capturing and overlay 440 /* Default (0) and current (1) video capturing and overlay
438 cropping parameters in bttv_tvnorm.cropcap units. Protected 441 cropping parameters in bttv_tvnorm.cropcap units. Protected
439 by bttv.lock. */ 442 by bttv.lock. */