aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Zary <linux@rainbow-software.org>2012-10-14 15:09:19 -0400
committerTakashi Iwai <tiwai@suse.de>2012-10-17 03:01:26 -0400
commit267bccaf0409e2a4e17591bb31e8d1ceb866988c (patch)
treeae57d01b21e2957adc076701d8c2e5658a361b5b
parentdcda5806165c155d90b9aa466a1602cf4726012b (diff)
ALSA: ice1712: add chip_exit callback
Add chip_exit callback to allow card subdrivers to do cleanup work on module removal. Needed by Philips PSC724 subdriver to cancel delayed work. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/ice1712/ice1712.c8
-rw-r--r--sound/pci/ice1712/ice1712.h3
-rw-r--r--sound/pci/ice1712/ice1724.c8
3 files changed, 17 insertions, 2 deletions
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index 5be2e120a14e..f42b5b1c1d24 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -2686,6 +2686,7 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
2686 for (tbl = card_tables; *tbl; tbl++) { 2686 for (tbl = card_tables; *tbl; tbl++) {
2687 for (c = *tbl; c->subvendor; c++) { 2687 for (c = *tbl; c->subvendor; c++) {
2688 if (c->subvendor == ice->eeprom.subvendor) { 2688 if (c->subvendor == ice->eeprom.subvendor) {
2689 ice->card_info = c;
2689 strcpy(card->shortname, c->name); 2690 strcpy(card->shortname, c->name);
2690 if (c->driver) /* specific driver? */ 2691 if (c->driver) /* specific driver? */
2691 strcpy(card->driver, c->driver); 2692 strcpy(card->driver, c->driver);
@@ -2799,7 +2800,12 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
2799 2800
2800static void __devexit snd_ice1712_remove(struct pci_dev *pci) 2801static void __devexit snd_ice1712_remove(struct pci_dev *pci)
2801{ 2802{
2802 snd_card_free(pci_get_drvdata(pci)); 2803 struct snd_card *card = pci_get_drvdata(pci);
2804 struct snd_ice1712 *ice = card->private_data;
2805
2806 if (ice->card_info && ice->card_info->chip_exit)
2807 ice->card_info->chip_exit(ice);
2808 snd_card_free(card);
2803 pci_set_drvdata(pci, NULL); 2809 pci_set_drvdata(pci, NULL);
2804} 2810}
2805 2811
diff --git a/sound/pci/ice1712/ice1712.h b/sound/pci/ice1712/ice1712.h
index d0e7d87f09f0..5149568b8fc1 100644
--- a/sound/pci/ice1712/ice1712.h
+++ b/sound/pci/ice1712/ice1712.h
@@ -288,6 +288,7 @@ struct snd_ice1712_spdif {
288 } ops; 288 } ops;
289}; 289};
290 290
291struct snd_ice1712_card_info;
291 292
292struct snd_ice1712 { 293struct snd_ice1712 {
293 unsigned long conp_dma_size; 294 unsigned long conp_dma_size;
@@ -324,6 +325,7 @@ struct snd_ice1712 {
324 struct snd_info_entry *proc_entry; 325 struct snd_info_entry *proc_entry;
325 326
326 struct snd_ice1712_eeprom eeprom; 327 struct snd_ice1712_eeprom eeprom;
328 struct snd_ice1712_card_info *card_info;
327 329
328 unsigned int pro_volumes[20]; 330 unsigned int pro_volumes[20];
329 unsigned int omni:1; /* Delta Omni I/O */ 331 unsigned int omni:1; /* Delta Omni I/O */
@@ -517,6 +519,7 @@ struct snd_ice1712_card_info {
517 char *model; 519 char *model;
518 char *driver; 520 char *driver;
519 int (*chip_init)(struct snd_ice1712 *); 521 int (*chip_init)(struct snd_ice1712 *);
522 void (*chip_exit)(struct snd_ice1712 *);
520 int (*build_controls)(struct snd_ice1712 *); 523 int (*build_controls)(struct snd_ice1712 *);
521 unsigned int no_mpu401:1; 524 unsigned int no_mpu401:1;
522 unsigned int mpu401_1_info_flags; 525 unsigned int mpu401_1_info_flags;
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index 3050a5279253..287df68a9df8 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -2348,6 +2348,7 @@ static int __devinit snd_vt1724_read_eeprom(struct snd_ice1712 *ice,
2348 ice->eeprom.subvendor = c->subvendor; 2348 ice->eeprom.subvendor = c->subvendor;
2349 } else if (c->subvendor != ice->eeprom.subvendor) 2349 } else if (c->subvendor != ice->eeprom.subvendor)
2350 continue; 2350 continue;
2351 ice->card_info = c;
2351 if (!c->eeprom_size || !c->eeprom_data) 2352 if (!c->eeprom_size || !c->eeprom_data)
2352 goto found; 2353 goto found;
2353 /* if the EEPROM is given by the driver, use it */ 2354 /* if the EEPROM is given by the driver, use it */
@@ -2788,7 +2789,12 @@ __found:
2788 2789
2789static void __devexit snd_vt1724_remove(struct pci_dev *pci) 2790static void __devexit snd_vt1724_remove(struct pci_dev *pci)
2790{ 2791{
2791 snd_card_free(pci_get_drvdata(pci)); 2792 struct snd_card *card = pci_get_drvdata(pci);
2793 struct snd_ice1712 *ice = card->private_data;
2794
2795 if (ice->card_info && ice->card_info->chip_exit)
2796 ice->card_info->chip_exit(ice);
2797 snd_card_free(card);
2792 pci_set_drvdata(pci, NULL); 2798 pci_set_drvdata(pci, NULL);
2793} 2799}
2794 2800