diff options
Diffstat (limited to 'sound/pci/ice1712')
-rw-r--r-- | sound/pci/ice1712/ak4xxx.c | 2 | ||||
-rw-r--r-- | sound/pci/ice1712/ice1712.c | 42 | ||||
-rw-r--r-- | sound/pci/ice1712/ice1724.c | 16 | ||||
-rw-r--r-- | sound/pci/ice1712/juli.c | 4 | ||||
-rw-r--r-- | sound/pci/ice1712/wm8766.c | 16 | ||||
-rw-r--r-- | sound/pci/ice1712/wm8766.h | 2 | ||||
-rw-r--r-- | sound/pci/ice1712/wm8776.c | 15 | ||||
-rw-r--r-- | sound/pci/ice1712/wm8776.h | 3 |
8 files changed, 10 insertions, 90 deletions
diff --git a/sound/pci/ice1712/ak4xxx.c b/sound/pci/ice1712/ak4xxx.c index 3981823f9094..179ef7a5f0d1 100644 --- a/sound/pci/ice1712/ak4xxx.c +++ b/sound/pci/ice1712/ak4xxx.c | |||
@@ -21,7 +21,7 @@ | |||
21 | * | 21 | * |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <asm/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index b039b46152c6..f7b1523e8a82 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c | |||
@@ -880,13 +880,11 @@ static struct snd_pcm_ops snd_ice1712_capture_ops = { | |||
880 | .pointer = snd_ice1712_capture_pointer, | 880 | .pointer = snd_ice1712_capture_pointer, |
881 | }; | 881 | }; |
882 | 882 | ||
883 | static int snd_ice1712_pcm(struct snd_ice1712 *ice, int device, struct snd_pcm **rpcm) | 883 | static int snd_ice1712_pcm(struct snd_ice1712 *ice, int device) |
884 | { | 884 | { |
885 | struct snd_pcm *pcm; | 885 | struct snd_pcm *pcm; |
886 | int err; | 886 | int err; |
887 | 887 | ||
888 | if (rpcm) | ||
889 | *rpcm = NULL; | ||
890 | err = snd_pcm_new(ice->card, "ICE1712 consumer", device, 1, 1, &pcm); | 888 | err = snd_pcm_new(ice->card, "ICE1712 consumer", device, 1, 1, &pcm); |
891 | if (err < 0) | 889 | if (err < 0) |
892 | return err; | 890 | return err; |
@@ -902,22 +900,17 @@ static int snd_ice1712_pcm(struct snd_ice1712 *ice, int device, struct snd_pcm * | |||
902 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, | 900 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, |
903 | snd_dma_pci_data(ice->pci), 64*1024, 64*1024); | 901 | snd_dma_pci_data(ice->pci), 64*1024, 64*1024); |
904 | 902 | ||
905 | if (rpcm) | ||
906 | *rpcm = pcm; | ||
907 | |||
908 | dev_warn(ice->card->dev, | 903 | dev_warn(ice->card->dev, |
909 | "Consumer PCM code does not work well at the moment --jk\n"); | 904 | "Consumer PCM code does not work well at the moment --jk\n"); |
910 | 905 | ||
911 | return 0; | 906 | return 0; |
912 | } | 907 | } |
913 | 908 | ||
914 | static int snd_ice1712_pcm_ds(struct snd_ice1712 *ice, int device, struct snd_pcm **rpcm) | 909 | static int snd_ice1712_pcm_ds(struct snd_ice1712 *ice, int device) |
915 | { | 910 | { |
916 | struct snd_pcm *pcm; | 911 | struct snd_pcm *pcm; |
917 | int err; | 912 | int err; |
918 | 913 | ||
919 | if (rpcm) | ||
920 | *rpcm = NULL; | ||
921 | err = snd_pcm_new(ice->card, "ICE1712 consumer (DS)", device, 6, 0, &pcm); | 914 | err = snd_pcm_new(ice->card, "ICE1712 consumer (DS)", device, 6, 0, &pcm); |
922 | if (err < 0) | 915 | if (err < 0) |
923 | return err; | 916 | return err; |
@@ -932,9 +925,6 @@ static int snd_ice1712_pcm_ds(struct snd_ice1712 *ice, int device, struct snd_pc | |||
932 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, | 925 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, |
933 | snd_dma_pci_data(ice->pci), 64*1024, 128*1024); | 926 | snd_dma_pci_data(ice->pci), 64*1024, 128*1024); |
934 | 927 | ||
935 | if (rpcm) | ||
936 | *rpcm = pcm; | ||
937 | |||
938 | return 0; | 928 | return 0; |
939 | } | 929 | } |
940 | 930 | ||
@@ -1260,13 +1250,11 @@ static struct snd_pcm_ops snd_ice1712_capture_pro_ops = { | |||
1260 | .pointer = snd_ice1712_capture_pro_pointer, | 1250 | .pointer = snd_ice1712_capture_pro_pointer, |
1261 | }; | 1251 | }; |
1262 | 1252 | ||
1263 | static int snd_ice1712_pcm_profi(struct snd_ice1712 *ice, int device, struct snd_pcm **rpcm) | 1253 | static int snd_ice1712_pcm_profi(struct snd_ice1712 *ice, int device) |
1264 | { | 1254 | { |
1265 | struct snd_pcm *pcm; | 1255 | struct snd_pcm *pcm; |
1266 | int err; | 1256 | int err; |
1267 | 1257 | ||
1268 | if (rpcm) | ||
1269 | *rpcm = NULL; | ||
1270 | err = snd_pcm_new(ice->card, "ICE1712 multi", device, 1, 1, &pcm); | 1258 | err = snd_pcm_new(ice->card, "ICE1712 multi", device, 1, 1, &pcm); |
1271 | if (err < 0) | 1259 | if (err < 0) |
1272 | return err; | 1260 | return err; |
@@ -1282,8 +1270,6 @@ static int snd_ice1712_pcm_profi(struct snd_ice1712 *ice, int device, struct snd | |||
1282 | snd_dma_pci_data(ice->pci), 256*1024, 256*1024); | 1270 | snd_dma_pci_data(ice->pci), 256*1024, 256*1024); |
1283 | 1271 | ||
1284 | ice->pcm_pro = pcm; | 1272 | ice->pcm_pro = pcm; |
1285 | if (rpcm) | ||
1286 | *rpcm = pcm; | ||
1287 | 1273 | ||
1288 | if (ice->cs8427) { | 1274 | if (ice->cs8427) { |
1289 | /* assign channels to iec958 */ | 1275 | /* assign channels to iec958 */ |
@@ -2691,14 +2677,14 @@ static int snd_ice1712_probe(struct pci_dev *pci, | |||
2691 | c = &no_matched; | 2677 | c = &no_matched; |
2692 | __found: | 2678 | __found: |
2693 | 2679 | ||
2694 | err = snd_ice1712_pcm_profi(ice, pcm_dev++, NULL); | 2680 | err = snd_ice1712_pcm_profi(ice, pcm_dev++); |
2695 | if (err < 0) { | 2681 | if (err < 0) { |
2696 | snd_card_free(card); | 2682 | snd_card_free(card); |
2697 | return err; | 2683 | return err; |
2698 | } | 2684 | } |
2699 | 2685 | ||
2700 | if (ice_has_con_ac97(ice)) { | 2686 | if (ice_has_con_ac97(ice)) { |
2701 | err = snd_ice1712_pcm(ice, pcm_dev++, NULL); | 2687 | err = snd_ice1712_pcm(ice, pcm_dev++); |
2702 | if (err < 0) { | 2688 | if (err < 0) { |
2703 | snd_card_free(card); | 2689 | snd_card_free(card); |
2704 | return err; | 2690 | return err; |
@@ -2726,7 +2712,7 @@ static int snd_ice1712_probe(struct pci_dev *pci, | |||
2726 | } | 2712 | } |
2727 | 2713 | ||
2728 | if (ice_has_con_ac97(ice)) { | 2714 | if (ice_has_con_ac97(ice)) { |
2729 | err = snd_ice1712_pcm_ds(ice, pcm_dev++, NULL); | 2715 | err = snd_ice1712_pcm_ds(ice, pcm_dev++); |
2730 | if (err < 0) { | 2716 | if (err < 0) { |
2731 | snd_card_free(card); | 2717 | snd_card_free(card); |
2732 | return err; | 2718 | return err; |
@@ -2798,7 +2784,6 @@ static void snd_ice1712_remove(struct pci_dev *pci) | |||
2798 | #ifdef CONFIG_PM_SLEEP | 2784 | #ifdef CONFIG_PM_SLEEP |
2799 | static int snd_ice1712_suspend(struct device *dev) | 2785 | static int snd_ice1712_suspend(struct device *dev) |
2800 | { | 2786 | { |
2801 | struct pci_dev *pci = to_pci_dev(dev); | ||
2802 | struct snd_card *card = dev_get_drvdata(dev); | 2787 | struct snd_card *card = dev_get_drvdata(dev); |
2803 | struct snd_ice1712 *ice = card->private_data; | 2788 | struct snd_ice1712 *ice = card->private_data; |
2804 | 2789 | ||
@@ -2820,16 +2805,11 @@ static int snd_ice1712_suspend(struct device *dev) | |||
2820 | 2805 | ||
2821 | if (ice->pm_suspend) | 2806 | if (ice->pm_suspend) |
2822 | ice->pm_suspend(ice); | 2807 | ice->pm_suspend(ice); |
2823 | |||
2824 | pci_disable_device(pci); | ||
2825 | pci_save_state(pci); | ||
2826 | pci_set_power_state(pci, PCI_D3hot); | ||
2827 | return 0; | 2808 | return 0; |
2828 | } | 2809 | } |
2829 | 2810 | ||
2830 | static int snd_ice1712_resume(struct device *dev) | 2811 | static int snd_ice1712_resume(struct device *dev) |
2831 | { | 2812 | { |
2832 | struct pci_dev *pci = to_pci_dev(dev); | ||
2833 | struct snd_card *card = dev_get_drvdata(dev); | 2813 | struct snd_card *card = dev_get_drvdata(dev); |
2834 | struct snd_ice1712 *ice = card->private_data; | 2814 | struct snd_ice1712 *ice = card->private_data; |
2835 | int rate; | 2815 | int rate; |
@@ -2837,16 +2817,6 @@ static int snd_ice1712_resume(struct device *dev) | |||
2837 | if (!ice->pm_suspend_enabled) | 2817 | if (!ice->pm_suspend_enabled) |
2838 | return 0; | 2818 | return 0; |
2839 | 2819 | ||
2840 | pci_set_power_state(pci, PCI_D0); | ||
2841 | pci_restore_state(pci); | ||
2842 | |||
2843 | if (pci_enable_device(pci) < 0) { | ||
2844 | snd_card_disconnect(card); | ||
2845 | return -EIO; | ||
2846 | } | ||
2847 | |||
2848 | pci_set_master(pci); | ||
2849 | |||
2850 | if (ice->cur_rate) | 2820 | if (ice->cur_rate) |
2851 | rate = ice->cur_rate; | 2821 | rate = ice->cur_rate; |
2852 | else | 2822 | else |
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index d73da157ea14..0b22c00642bb 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c | |||
@@ -2798,7 +2798,6 @@ static void snd_vt1724_remove(struct pci_dev *pci) | |||
2798 | #ifdef CONFIG_PM_SLEEP | 2798 | #ifdef CONFIG_PM_SLEEP |
2799 | static int snd_vt1724_suspend(struct device *dev) | 2799 | static int snd_vt1724_suspend(struct device *dev) |
2800 | { | 2800 | { |
2801 | struct pci_dev *pci = to_pci_dev(dev); | ||
2802 | struct snd_card *card = dev_get_drvdata(dev); | 2801 | struct snd_card *card = dev_get_drvdata(dev); |
2803 | struct snd_ice1712 *ice = card->private_data; | 2802 | struct snd_ice1712 *ice = card->private_data; |
2804 | 2803 | ||
@@ -2821,32 +2820,17 @@ static int snd_vt1724_suspend(struct device *dev) | |||
2821 | 2820 | ||
2822 | if (ice->pm_suspend) | 2821 | if (ice->pm_suspend) |
2823 | ice->pm_suspend(ice); | 2822 | ice->pm_suspend(ice); |
2824 | |||
2825 | pci_disable_device(pci); | ||
2826 | pci_save_state(pci); | ||
2827 | pci_set_power_state(pci, PCI_D3hot); | ||
2828 | return 0; | 2823 | return 0; |
2829 | } | 2824 | } |
2830 | 2825 | ||
2831 | static int snd_vt1724_resume(struct device *dev) | 2826 | static int snd_vt1724_resume(struct device *dev) |
2832 | { | 2827 | { |
2833 | struct pci_dev *pci = to_pci_dev(dev); | ||
2834 | struct snd_card *card = dev_get_drvdata(dev); | 2828 | struct snd_card *card = dev_get_drvdata(dev); |
2835 | struct snd_ice1712 *ice = card->private_data; | 2829 | struct snd_ice1712 *ice = card->private_data; |
2836 | 2830 | ||
2837 | if (!ice->pm_suspend_enabled) | 2831 | if (!ice->pm_suspend_enabled) |
2838 | return 0; | 2832 | return 0; |
2839 | 2833 | ||
2840 | pci_set_power_state(pci, PCI_D0); | ||
2841 | pci_restore_state(pci); | ||
2842 | |||
2843 | if (pci_enable_device(pci) < 0) { | ||
2844 | snd_card_disconnect(card); | ||
2845 | return -EIO; | ||
2846 | } | ||
2847 | |||
2848 | pci_set_master(pci); | ||
2849 | |||
2850 | snd_vt1724_chip_reset(ice); | 2834 | snd_vt1724_chip_reset(ice); |
2851 | 2835 | ||
2852 | if (snd_vt1724_chip_init(ice) < 0) { | 2836 | if (snd_vt1724_chip_init(ice) < 0) { |
diff --git a/sound/pci/ice1712/juli.c b/sound/pci/ice1712/juli.c index a1536c1a7ed4..4f0213427152 100644 --- a/sound/pci/ice1712/juli.c +++ b/sound/pci/ice1712/juli.c | |||
@@ -491,15 +491,17 @@ static int juli_resume(struct snd_ice1712 *ice) | |||
491 | /* akm4358 un-reset, un-mute */ | 491 | /* akm4358 un-reset, un-mute */ |
492 | snd_akm4xxx_reset(ak, 0); | 492 | snd_akm4xxx_reset(ak, 0); |
493 | /* reinit ak4114 */ | 493 | /* reinit ak4114 */ |
494 | snd_ak4114_reinit(spec->ak4114); | 494 | snd_ak4114_resume(spec->ak4114); |
495 | return 0; | 495 | return 0; |
496 | } | 496 | } |
497 | 497 | ||
498 | static int juli_suspend(struct snd_ice1712 *ice) | 498 | static int juli_suspend(struct snd_ice1712 *ice) |
499 | { | 499 | { |
500 | struct snd_akm4xxx *ak = ice->akm; | 500 | struct snd_akm4xxx *ak = ice->akm; |
501 | struct juli_spec *spec = ice->spec; | ||
501 | /* akm4358 reset and soft-mute */ | 502 | /* akm4358 reset and soft-mute */ |
502 | snd_akm4xxx_reset(ak, 1); | 503 | snd_akm4xxx_reset(ak, 1); |
504 | snd_ak4114_suspend(spec->ak4114); | ||
503 | return 0; | 505 | return 0; |
504 | } | 506 | } |
505 | #endif | 507 | #endif |
diff --git a/sound/pci/ice1712/wm8766.c b/sound/pci/ice1712/wm8766.c index 21b373b2e260..f7ac8d5e862c 100644 --- a/sound/pci/ice1712/wm8766.c +++ b/sound/pci/ice1712/wm8766.c | |||
@@ -183,22 +183,6 @@ void snd_wm8766_set_if(struct snd_wm8766 *wm, u16 dac) | |||
183 | snd_wm8766_write(wm, WM8766_REG_IFCTRL, val | dac); | 183 | snd_wm8766_write(wm, WM8766_REG_IFCTRL, val | dac); |
184 | } | 184 | } |
185 | 185 | ||
186 | void snd_wm8766_set_master_mode(struct snd_wm8766 *wm, u16 mode) | ||
187 | { | ||
188 | u16 val = wm->regs[WM8766_REG_DACCTRL3] & ~WM8766_DAC3_MSTR_MASK; | ||
189 | |||
190 | mode &= WM8766_DAC3_MSTR_MASK; | ||
191 | snd_wm8766_write(wm, WM8766_REG_DACCTRL3, val | mode); | ||
192 | } | ||
193 | |||
194 | void snd_wm8766_set_power(struct snd_wm8766 *wm, u16 power) | ||
195 | { | ||
196 | u16 val = wm->regs[WM8766_REG_DACCTRL3] & ~WM8766_DAC3_POWER_MASK; | ||
197 | |||
198 | power &= WM8766_DAC3_POWER_MASK; | ||
199 | snd_wm8766_write(wm, WM8766_REG_DACCTRL3, val | power); | ||
200 | } | ||
201 | |||
202 | void snd_wm8766_volume_restore(struct snd_wm8766 *wm) | 186 | void snd_wm8766_volume_restore(struct snd_wm8766 *wm) |
203 | { | 187 | { |
204 | u16 val = wm->regs[WM8766_REG_DACR1]; | 188 | u16 val = wm->regs[WM8766_REG_DACR1]; |
diff --git a/sound/pci/ice1712/wm8766.h b/sound/pci/ice1712/wm8766.h index c119f84bd2c2..18c8d9d47b38 100644 --- a/sound/pci/ice1712/wm8766.h +++ b/sound/pci/ice1712/wm8766.h | |||
@@ -155,8 +155,6 @@ struct snd_wm8766 { | |||
155 | void snd_wm8766_init(struct snd_wm8766 *wm); | 155 | void snd_wm8766_init(struct snd_wm8766 *wm); |
156 | void snd_wm8766_resume(struct snd_wm8766 *wm); | 156 | void snd_wm8766_resume(struct snd_wm8766 *wm); |
157 | void snd_wm8766_set_if(struct snd_wm8766 *wm, u16 dac); | 157 | void snd_wm8766_set_if(struct snd_wm8766 *wm, u16 dac); |
158 | void snd_wm8766_set_master_mode(struct snd_wm8766 *wm, u16 mode); | ||
159 | void snd_wm8766_set_power(struct snd_wm8766 *wm, u16 power); | ||
160 | void snd_wm8766_volume_restore(struct snd_wm8766 *wm); | 158 | void snd_wm8766_volume_restore(struct snd_wm8766 *wm); |
161 | int snd_wm8766_build_controls(struct snd_wm8766 *wm); | 159 | int snd_wm8766_build_controls(struct snd_wm8766 *wm); |
162 | 160 | ||
diff --git a/sound/pci/ice1712/wm8776.c b/sound/pci/ice1712/wm8776.c index e66c0da62014..ebd2fe4b4a57 100644 --- a/sound/pci/ice1712/wm8776.c +++ b/sound/pci/ice1712/wm8776.c | |||
@@ -452,21 +452,6 @@ void snd_wm8776_resume(struct snd_wm8776 *wm) | |||
452 | snd_wm8776_write(wm, i, wm->regs[i]); | 452 | snd_wm8776_write(wm, i, wm->regs[i]); |
453 | } | 453 | } |
454 | 454 | ||
455 | void snd_wm8776_set_dac_if(struct snd_wm8776 *wm, u16 dac) | ||
456 | { | ||
457 | snd_wm8776_write(wm, WM8776_REG_DACIFCTRL, dac); | ||
458 | } | ||
459 | |||
460 | void snd_wm8776_set_adc_if(struct snd_wm8776 *wm, u16 adc) | ||
461 | { | ||
462 | snd_wm8776_write(wm, WM8776_REG_ADCIFCTRL, adc); | ||
463 | } | ||
464 | |||
465 | void snd_wm8776_set_master_mode(struct snd_wm8776 *wm, u16 mode) | ||
466 | { | ||
467 | snd_wm8776_write(wm, WM8776_REG_MSTRCTRL, mode); | ||
468 | } | ||
469 | |||
470 | void snd_wm8776_set_power(struct snd_wm8776 *wm, u16 power) | 455 | void snd_wm8776_set_power(struct snd_wm8776 *wm, u16 power) |
471 | { | 456 | { |
472 | snd_wm8776_write(wm, WM8776_REG_PWRDOWN, power); | 457 | snd_wm8776_write(wm, WM8776_REG_PWRDOWN, power); |
diff --git a/sound/pci/ice1712/wm8776.h b/sound/pci/ice1712/wm8776.h index 93a2d6971154..42acef05540c 100644 --- a/sound/pci/ice1712/wm8776.h +++ b/sound/pci/ice1712/wm8776.h | |||
@@ -216,9 +216,6 @@ struct snd_wm8776 { | |||
216 | 216 | ||
217 | void snd_wm8776_init(struct snd_wm8776 *wm); | 217 | void snd_wm8776_init(struct snd_wm8776 *wm); |
218 | void snd_wm8776_resume(struct snd_wm8776 *wm); | 218 | void snd_wm8776_resume(struct snd_wm8776 *wm); |
219 | void snd_wm8776_set_dac_if(struct snd_wm8776 *wm, u16 dac); | ||
220 | void snd_wm8776_set_adc_if(struct snd_wm8776 *wm, u16 adc); | ||
221 | void snd_wm8776_set_master_mode(struct snd_wm8776 *wm, u16 mode); | ||
222 | void snd_wm8776_set_power(struct snd_wm8776 *wm, u16 power); | 219 | void snd_wm8776_set_power(struct snd_wm8776 *wm, u16 power); |
223 | void snd_wm8776_volume_restore(struct snd_wm8776 *wm); | 220 | void snd_wm8776_volume_restore(struct snd_wm8776 *wm); |
224 | int snd_wm8776_build_controls(struct snd_wm8776 *wm); | 221 | int snd_wm8776_build_controls(struct snd_wm8776 *wm); |