aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/maestro3.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/maestro3.c')
-rw-r--r--sound/pci/maestro3.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index 04fa0a68416c..a536c59fbea1 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -2068,7 +2068,7 @@ static int __devinit snd_m3_mixer(struct snd_m3 *chip)
2068{ 2068{
2069 struct snd_ac97_bus *pbus; 2069 struct snd_ac97_bus *pbus;
2070 struct snd_ac97_template ac97; 2070 struct snd_ac97_template ac97;
2071 struct snd_ctl_elem_id id; 2071 struct snd_ctl_elem_id elem_id;
2072 int err; 2072 int err;
2073 static struct snd_ac97_bus_ops ops = { 2073 static struct snd_ac97_bus_ops ops = {
2074 .write = snd_m3_ac97_write, 2074 .write = snd_m3_ac97_write,
@@ -2088,14 +2088,14 @@ static int __devinit snd_m3_mixer(struct snd_m3 *chip)
2088 schedule_timeout_uninterruptible(msecs_to_jiffies(100)); 2088 schedule_timeout_uninterruptible(msecs_to_jiffies(100));
2089 snd_ac97_write(chip->ac97, AC97_PCM, 0); 2089 snd_ac97_write(chip->ac97, AC97_PCM, 0);
2090 2090
2091 memset(&id, 0, sizeof(id)); 2091 memset(&elem_id, 0, sizeof(elem_id));
2092 id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; 2092 elem_id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
2093 strcpy(id.name, "Master Playback Switch"); 2093 strcpy(elem_id.name, "Master Playback Switch");
2094 chip->master_switch = snd_ctl_find_id(chip->card, &id); 2094 chip->master_switch = snd_ctl_find_id(chip->card, &elem_id);
2095 memset(&id, 0, sizeof(id)); 2095 memset(&elem_id, 0, sizeof(elem_id));
2096 id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; 2096 elem_id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
2097 strcpy(id.name, "Master Playback Volume"); 2097 strcpy(elem_id.name, "Master Playback Volume");
2098 chip->master_volume = snd_ctl_find_id(chip->card, &id); 2098 chip->master_volume = snd_ctl_find_id(chip->card, &elem_id);
2099 2099
2100 return 0; 2100 return 0;
2101} 2101}
@@ -2542,10 +2542,8 @@ static int snd_m3_free(struct snd_m3 *chip)
2542 vfree(chip->suspend_mem); 2542 vfree(chip->suspend_mem);
2543#endif 2543#endif
2544 2544
2545 if (chip->irq >= 0) { 2545 if (chip->irq >= 0)
2546 synchronize_irq(chip->irq);
2547 free_irq(chip->irq, chip); 2546 free_irq(chip->irq, chip);
2548 }
2549 2547
2550 if (chip->iobase) 2548 if (chip->iobase)
2551 pci_release_regions(chip->pci); 2549 pci_release_regions(chip->pci);
@@ -2569,7 +2567,7 @@ static int m3_suspend(struct pci_dev *pci, pm_message_t state)
2569{ 2567{
2570 struct snd_card *card = pci_get_drvdata(pci); 2568 struct snd_card *card = pci_get_drvdata(pci);
2571 struct snd_m3 *chip = card->private_data; 2569 struct snd_m3 *chip = card->private_data;
2572 int i, index; 2570 int i, dsp_index;
2573 2571
2574 if (chip->suspend_mem == NULL) 2572 if (chip->suspend_mem == NULL)
2575 return 0; 2573 return 0;
@@ -2583,12 +2581,12 @@ static int m3_suspend(struct pci_dev *pci, pm_message_t state)
2583 snd_m3_assp_halt(chip); 2581 snd_m3_assp_halt(chip);
2584 2582
2585 /* save dsp image */ 2583 /* save dsp image */
2586 index = 0; 2584 dsp_index = 0;
2587 for (i = REV_B_CODE_MEMORY_BEGIN; i <= REV_B_CODE_MEMORY_END; i++) 2585 for (i = REV_B_CODE_MEMORY_BEGIN; i <= REV_B_CODE_MEMORY_END; i++)
2588 chip->suspend_mem[index++] = 2586 chip->suspend_mem[dsp_index++] =
2589 snd_m3_assp_read(chip, MEMTYPE_INTERNAL_CODE, i); 2587 snd_m3_assp_read(chip, MEMTYPE_INTERNAL_CODE, i);
2590 for (i = REV_B_DATA_MEMORY_BEGIN ; i <= REV_B_DATA_MEMORY_END; i++) 2588 for (i = REV_B_DATA_MEMORY_BEGIN ; i <= REV_B_DATA_MEMORY_END; i++)
2591 chip->suspend_mem[index++] = 2589 chip->suspend_mem[dsp_index++] =
2592 snd_m3_assp_read(chip, MEMTYPE_INTERNAL_DATA, i); 2590 snd_m3_assp_read(chip, MEMTYPE_INTERNAL_DATA, i);
2593 2591
2594 pci_disable_device(pci); 2592 pci_disable_device(pci);
@@ -2601,7 +2599,7 @@ static int m3_resume(struct pci_dev *pci)
2601{ 2599{
2602 struct snd_card *card = pci_get_drvdata(pci); 2600 struct snd_card *card = pci_get_drvdata(pci);
2603 struct snd_m3 *chip = card->private_data; 2601 struct snd_m3 *chip = card->private_data;
2604 int i, index; 2602 int i, dsp_index;
2605 2603
2606 if (chip->suspend_mem == NULL) 2604 if (chip->suspend_mem == NULL)
2607 return 0; 2605 return 0;
@@ -2625,13 +2623,13 @@ static int m3_resume(struct pci_dev *pci)
2625 snd_m3_ac97_reset(chip); 2623 snd_m3_ac97_reset(chip);
2626 2624
2627 /* restore dsp image */ 2625 /* restore dsp image */
2628 index = 0; 2626 dsp_index = 0;
2629 for (i = REV_B_CODE_MEMORY_BEGIN; i <= REV_B_CODE_MEMORY_END; i++) 2627 for (i = REV_B_CODE_MEMORY_BEGIN; i <= REV_B_CODE_MEMORY_END; i++)
2630 snd_m3_assp_write(chip, MEMTYPE_INTERNAL_CODE, i, 2628 snd_m3_assp_write(chip, MEMTYPE_INTERNAL_CODE, i,
2631 chip->suspend_mem[index++]); 2629 chip->suspend_mem[dsp_index++]);
2632 for (i = REV_B_DATA_MEMORY_BEGIN ; i <= REV_B_DATA_MEMORY_END; i++) 2630 for (i = REV_B_DATA_MEMORY_BEGIN ; i <= REV_B_DATA_MEMORY_END; i++)
2633 snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA, i, 2631 snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA, i,
2634 chip->suspend_mem[index++]); 2632 chip->suspend_mem[dsp_index++]);
2635 2633
2636 /* tell the dma engine to restart itself */ 2634 /* tell the dma engine to restart itself */
2637 snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA, 2635 snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,