aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/ice1712/ice1712.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index 291672fc4a99..da005493f060 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -1048,6 +1048,8 @@ __out:
1048 old = inb(ICEMT(ice, RATE)); 1048 old = inb(ICEMT(ice, RATE));
1049 if (!force && old == val) 1049 if (!force && old == val)
1050 goto __out; 1050 goto __out;
1051
1052 ice->cur_rate = rate;
1051 outb(val, ICEMT(ice, RATE)); 1053 outb(val, ICEMT(ice, RATE));
1052 spin_unlock_irqrestore(&ice->reg_lock, flags); 1054 spin_unlock_irqrestore(&ice->reg_lock, flags);
1053 1055
@@ -2832,6 +2834,12 @@ static int snd_ice1712_suspend(struct device *dev)
2832 snd_pcm_suspend_all(ice->pcm_ds); 2834 snd_pcm_suspend_all(ice->pcm_ds);
2833 snd_ac97_suspend(ice->ac97); 2835 snd_ac97_suspend(ice->ac97);
2834 2836
2837 spin_lock_irq(&ice->reg_lock);
2838 ice->pm_saved_is_spdif_master = is_spdif_master(ice);
2839 ice->pm_saved_spdif_ctrl = inw(ICEMT(ice, ROUTE_SPDOUT));
2840 ice->pm_saved_route = inw(ICEMT(ice, ROUTE_PSDOUT03));
2841 spin_unlock_irq(&ice->reg_lock);
2842
2835 if (ice->pm_suspend) 2843 if (ice->pm_suspend)
2836 ice->pm_suspend(ice); 2844 ice->pm_suspend(ice);
2837 2845
@@ -2846,6 +2854,7 @@ static int snd_ice1712_resume(struct device *dev)
2846 struct pci_dev *pci = to_pci_dev(dev); 2854 struct pci_dev *pci = to_pci_dev(dev);
2847 struct snd_card *card = dev_get_drvdata(dev); 2855 struct snd_card *card = dev_get_drvdata(dev);
2848 struct snd_ice1712 *ice = card->private_data; 2856 struct snd_ice1712 *ice = card->private_data;
2857 int rate;
2849 2858
2850 if (!ice->pm_suspend_enabled) 2859 if (!ice->pm_suspend_enabled)
2851 return 0; 2860 return 0;
@@ -2860,14 +2869,37 @@ static int snd_ice1712_resume(struct device *dev)
2860 2869
2861 pci_set_master(pci); 2870 pci_set_master(pci);
2862 2871
2872 if (ice->cur_rate)
2873 rate = ice->cur_rate;
2874 else
2875 rate = PRO_RATE_DEFAULT;
2876
2863 if (snd_ice1712_chip_init(ice) < 0) { 2877 if (snd_ice1712_chip_init(ice) < 0) {
2864 snd_card_disconnect(card); 2878 snd_card_disconnect(card);
2865 return -EIO; 2879 return -EIO;
2866 } 2880 }
2867 2881
2882 ice->cur_rate = rate;
2883
2868 if (ice->pm_resume) 2884 if (ice->pm_resume)
2869 ice->pm_resume(ice); 2885 ice->pm_resume(ice);
2870 2886
2887 if (ice->pm_saved_is_spdif_master) {
2888 /* switching to external clock via SPDIF */
2889 spin_lock_irq(&ice->reg_lock);
2890 outb(inb(ICEMT(ice, RATE)) | ICE1712_SPDIF_MASTER,
2891 ICEMT(ice, RATE));
2892 spin_unlock_irq(&ice->reg_lock);
2893 snd_ice1712_set_input_clock_source(ice, 1);
2894 } else {
2895 /* internal on-card clock */
2896 snd_ice1712_set_pro_rate(ice, rate, 1);
2897 snd_ice1712_set_input_clock_source(ice, 0);
2898 }
2899
2900 outw(ice->pm_saved_spdif_ctrl, ICEMT(ice, ROUTE_SPDOUT));
2901 outw(ice->pm_saved_route, ICEMT(ice, ROUTE_PSDOUT03));
2902
2871 if (ice->ac97) 2903 if (ice->ac97)
2872 snd_ac97_resume(ice->ac97); 2904 snd_ac97_resume(ice->ac97);
2873 2905