summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-core.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-core.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 4275d2ddb864..0aca7229f3ce 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -88,6 +88,9 @@ LIST_HEAD(saa7134_devlist);
static LIST_HEAD(mops_list);
static unsigned int saa7134_devcount;
+int (*dmasound_init)(struct saa7134_dev *dev);
+int (*dmasound_exit)(struct saa7134_dev *dev);
+
#define dprintk(fmt, arg...) if (core_debug) \
printk(KERN_DEBUG "%s/core: " fmt, dev->name , ## arg)
@@ -1017,6 +1020,10 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
/* check for signal */
saa7134_irq_video_intl(dev);
+ if (dmasound_init && !dev->dmasound.priv_data) {
+ dmasound_init(dev);
+ }
+
return 0;
fail4:
@@ -1040,6 +1047,11 @@ static void __devexit saa7134_finidev(struct pci_dev *pci_dev)
struct list_head *item;
struct saa7134_mpeg_ops *mops;
+ /* Release DMA sound modules if present */
+ if (dmasound_exit && dev->dmasound.priv_data) {
+ dmasound_exit(dev);
+ }
+
/* debugging ... */
if (irq_debug) {
u32 report = saa_readl(SAA7134_IRQ_REPORT);
@@ -1071,6 +1083,7 @@ static void __devexit saa7134_finidev(struct pci_dev *pci_dev)
saa7134_i2c_unregister(dev);
saa7134_unregister_video(dev);
+
/* the DMA sound modules should be unloaded before reaching
this, but just in case they are still present... */
if (dev->dmasound.priv_data != NULL) {
@@ -1078,6 +1091,7 @@ static void __devexit saa7134_finidev(struct pci_dev *pci_dev)
dev->dmasound.priv_data = NULL;
}
+
/* release resources */
free_irq(pci_dev->irq, dev);
iounmap(dev->lmmio);
@@ -1168,6 +1182,8 @@ EXPORT_SYMBOL(saa7134_boards);
/* ----------------- for the DMA sound modules --------------- */
+EXPORT_SYMBOL(dmasound_init);
+EXPORT_SYMBOL(dmasound_exit);
EXPORT_SYMBOL(saa7134_pgtable_free);
EXPORT_SYMBOL(saa7134_pgtable_build);
EXPORT_SYMBOL(saa7134_pgtable_alloc);
OpenPOWER on IntegriCloud