summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorGerd Knorr <devnull@localhost>2004-11-26 12:59:22 +0000
committerGerd Knorr <devnull@localhost>2004-11-26 12:59:22 +0000
commit369f6a99e8b434f596aa16349757d2203f0d9c67 (patch)
tree2a7f0524830c43a69add9cdffe90d8032cfcee48 /linux
parenta6a0a0d60a40e401e82c9a40d9216d925a4eabbf (diff)
downloadmediapointer-dvb-s2-369f6a99e8b434f596aa16349757d2203f0d9c67.tar.gz
mediapointer-dvb-s2-369f6a99e8b434f596aa16349757d2203f0d9c67.tar.bz2
- delayed module loading for saa7134.
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-cards.c4
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-core.c51
2 files changed, 50 insertions, 5 deletions
diff --git a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c
index 1b211911e..d2e411dac 100644
--- a/linux/drivers/media/video/saa7134/saa7134-cards.c
+++ b/linux/drivers/media/video/saa7134/saa7134-cards.c
@@ -1,5 +1,5 @@
/*
- * $Id: saa7134-cards.c,v 1.42 2004/11/22 18:10:55 kraxel Exp $
+ * $Id: saa7134-cards.c,v 1.43 2004/11/26 12:59:22 kraxel Exp $
*
* device driver for philips saa7134 based TV cards
* card-specific stuff.
@@ -749,7 +749,7 @@ struct saa7134_board saa7134_boards[] = {
},{
.name = name_tv,
.vmux = 3,
- .amux = LINE2,
+ .amux = TV,
.tv = 1,
}},
.mpeg = SAA7134_MPEG_EMPRESS,
diff --git a/linux/drivers/media/video/saa7134/saa7134-core.c b/linux/drivers/media/video/saa7134/saa7134-core.c
index 484bad66b..87190a5e0 100644
--- a/linux/drivers/media/video/saa7134/saa7134-core.c
+++ b/linux/drivers/media/video/saa7134/saa7134-core.c
@@ -1,5 +1,5 @@
/*
- * $Id: saa7134-core.c,v 1.20 2004/11/23 17:29:09 kraxel Exp $
+ * $Id: saa7134-core.c,v 1.21 2004/11/26 12:59:23 kraxel Exp $
*
* device driver for philips saa7134 based TV cards
* driver core
@@ -233,6 +233,49 @@ static void dump_statusregs(struct saa7134_dev *dev)
}
#endif
+/* ----------------------------------------------------------- */
+/* delayed request_module */
+
+static int need_empress;
+static int need_dvb;
+
+static int pending_call(struct notifier_block *self, unsigned long state,
+ void *module)
+{
+ if (module != THIS_MODULE || state != MODULE_STATE_LIVE)
+ return NOTIFY_DONE;
+
+ if (need_empress)
+ request_module("saa7134-empress");
+ if (need_dvb)
+ request_module("saa7134-dvb");
+ return NOTIFY_DONE;
+}
+
+static int pending_registered;
+static struct notifier_block pending_notifier = {
+ .notifier_call = pending_call,
+};
+
+static void request_module_depend(char *name, int *flag)
+{
+ switch (THIS_MODULE->state) {
+ case MODULE_STATE_COMING:
+ if (!pending_registered) {
+ register_module_notifier(&pending_notifier);
+ pending_registered = 1;
+ }
+ *flag = 1;
+ break;
+ case MODULE_STATE_LIVE:
+ request_module(name);
+ break;
+ default:
+ /* nothing */;
+ break;
+ }
+}
+
/* ------------------------------------------------------------------ */
/* nr of (saa7134-)pages for the given buffer size */
@@ -955,11 +998,11 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
if (dev->tda9887_conf)
request_module("tda9887");
if (card_is_empress(dev)) {
- request_module("saa7134-empress");
request_module("saa6752hs");
+ request_module_depend("saa7134-empress",&need_empress);
}
if (card_is_dvb(dev))
- request_module("saa7134-dvb");
+ request_module_depend("saa7134-dvb",&need_dvb);
v4l2_prio_init(&dev->prio);
@@ -1180,6 +1223,8 @@ static int saa7134_init(void)
static void saa7134_fini(void)
{
+ if (pending_registered)
+ unregister_module_notifier(&pending_notifier);
pci_unregister_driver(&saa7134_pci_driver);
}