Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f992a497c71981e215b1415759fc13593ed2919f
Commit:     f992a497c71981e215b1415759fc13593ed2919f
Parent:     fbc8408a0d9deeba8926e041db0bb1ef7f1b2cd6
Author:     Jarod Wilson <[EMAIL PROTECTED]>
AuthorDate: Sat Mar 24 15:23:50 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 15:45:14 2007 -0300

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Michael Krufky <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/bt8xx/bttv-driver.c |   24 ++++++++++++++++++++++--
 drivers/media/video/bt8xx/bttvp.h       |    3 +++
 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 5720b77..1c38723 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)
 static CLASS_DEVICE_ATTR(card, S_IRUGO, show_card, NULL);
 
 /* ----------------------------------------------------------------------- */
+/* dvb auto-load setup                                                     */
+#if defined(CONFIG_MODULES) && defined(MODULE)
+static void request_module_async(struct work_struct *work)
+{
+       request_module("dvb-bt8xx");
+}
+
+static void request_modules(struct bttv *dev)
+{
+       INIT_WORK(&dev->request_module_wk, request_module_async);
+       schedule_work(&dev->request_module_wk);
+}
+#else
+#define request_modules(dev)
+#endif /* CONFIG_MODULES */
+
+
+/* ----------------------------------------------------------------------- */
 /* static data                                                             */
 
 /* special timing tables from conexant... */
@@ -4769,9 +4787,11 @@ static int __devinit bttv_probe(struct pci_dev *dev,
                disclaim_video_lines(btv);
        }
 
-       /* 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);
+       }
 
        bttv_input_init(btv);
 
diff --git a/drivers/media/video/bt8xx/bttvp.h 
b/drivers/media/video/bt8xx/bttvp.h
index ad79b8d..8f44f02 100644
--- a/drivers/media/video/bt8xx/bttvp.h
+++ b/drivers/media/video/bt8xx/bttvp.h
@@ -434,6 +434,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. */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to