aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-mpeg.c
diff options
context:
space:
mode:
authorMarkus Rechberger <mrechberger@gmail.com>2007-04-27 11:31:06 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-04-27 14:43:25 -0400
commit77b7477467824098741351b6253a4ad292e28df9 (patch)
tree948ae57ed00c6f33400692100523256471fa5b37 /drivers/media/video/cx88/cx88-mpeg.c
parentacf2821282bdd912f9ca46780879a21679429f85 (diff)
V4L/DVB (5298): Added support for deferred module requesting to cx88
added support for deferred module requesting to cx88 Signed-off-by: Markus Rechberger <mrechberger@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx88/cx88-mpeg.c')
-rw-r--r--drivers/media/video/cx88/cx88-mpeg.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c
index 1fe1a833c7c7..cd01d23cd2f1 100644
--- a/drivers/media/video/cx88/cx88-mpeg.c
+++ b/drivers/media/video/cx88/cx88-mpeg.c
@@ -49,6 +49,35 @@ MODULE_PARM_DESC(debug,"enable debug messages [mpeg]");
49#define mpeg_dbg(level,fmt, arg...) if (debug >= level) \ 49#define mpeg_dbg(level,fmt, arg...) if (debug >= level) \
50 printk(KERN_DEBUG "%s/2-mpeg: " fmt, core->name, ## arg) 50 printk(KERN_DEBUG "%s/2-mpeg: " fmt, core->name, ## arg)
51 51
52#if defined(CONFIG_MODULES) && defined(MODULE)
53static void request_module_async(struct work_struct *work)
54{
55 struct cx8802_dev *dev=container_of(work, struct cx8802_dev, request_module_wk);
56 switch (cx88_boards[dev->core->board].mpeg) {
57 case CX88_MPEG_BLACKBIRD:
58 request_module("cx88-blackbird");
59 break;
60 case CX88_MPEG_DVB:
61 request_module("cx88-dvb");
62 break;
63 case CX88_BOARD_NONE:
64 /* reaching this one isn't possible */
65 break;
66 default:
67 printk("cx88-mpeg.c: WARNING extension [%d] is not supposed to be supported\n",cx88_boards[dev->core->board].mpeg);
68 }
69}
70
71static void request_modules(struct cx8802_dev *dev)
72{
73 INIT_WORK(&dev->request_module_wk, request_module_async);
74 schedule_work(&dev->request_module_wk);
75}
76#else
77#define request_modules(dev)
78#endif /* CONFIG_MODULES */
79
80
52static LIST_HEAD(cx8802_devlist); 81static LIST_HEAD(cx8802_devlist);
53/* ------------------------------------------------------------------ */ 82/* ------------------------------------------------------------------ */
54 83
@@ -778,6 +807,9 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev,
778 807
779 /* Maintain a reference so cx88-video can query the 8802 device. */ 808 /* Maintain a reference so cx88-video can query the 8802 device. */
780 core->dvbdev = dev; 809 core->dvbdev = dev;
810
811 /* now autoload cx88-dvb or cx88-blackbird */
812 request_modules(dev);
781 return 0; 813 return 0;
782 814
783 fail_free: 815 fail_free: