diff options
Diffstat (limited to 'sound/isa')
-rw-r--r-- | sound/isa/opti9xx/opti92x-ad1848.c | 86 | ||||
-rw-r--r-- | sound/isa/wss/wss_lib.c | 5 |
2 files changed, 76 insertions, 15 deletions
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index d7ccf28bd66a..f8fbe22515c9 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c | |||
@@ -135,10 +135,9 @@ struct snd_opti9xx { | |||
135 | unsigned long mc_base_size; | 135 | unsigned long mc_base_size; |
136 | #ifdef OPTi93X | 136 | #ifdef OPTi93X |
137 | unsigned long mc_indir_index; | 137 | unsigned long mc_indir_index; |
138 | unsigned long mc_indir_size; | ||
139 | struct resource *res_mc_indir; | 138 | struct resource *res_mc_indir; |
140 | struct snd_wss *codec; | ||
141 | #endif /* OPTi93X */ | 139 | #endif /* OPTi93X */ |
140 | struct snd_wss *codec; | ||
142 | unsigned long pwd_reg; | 141 | unsigned long pwd_reg; |
143 | 142 | ||
144 | spinlock_t lock; | 143 | spinlock_t lock; |
@@ -245,10 +244,8 @@ static int __devinit snd_opti9xx_init(struct snd_opti9xx *chip, | |||
245 | case OPTi9XX_HW_82C931: | 244 | case OPTi9XX_HW_82C931: |
246 | case OPTi9XX_HW_82C933: | 245 | case OPTi9XX_HW_82C933: |
247 | chip->mc_base = (hardware == OPTi9XX_HW_82C930) ? 0xf8f : 0xf8d; | 246 | chip->mc_base = (hardware == OPTi9XX_HW_82C930) ? 0xf8f : 0xf8d; |
248 | if (!chip->mc_indir_index) { | 247 | if (!chip->mc_indir_index) |
249 | chip->mc_indir_index = 0xe0e; | 248 | chip->mc_indir_index = 0xe0e; |
250 | chip->mc_indir_size = 2; | ||
251 | } | ||
252 | chip->password = 0xe4; | 249 | chip->password = 0xe4; |
253 | chip->pwd_reg = 0; | 250 | chip->pwd_reg = 0; |
254 | break; | 251 | break; |
@@ -351,7 +348,7 @@ static void snd_opti9xx_write(struct snd_opti9xx *chip, unsigned char reg, | |||
351 | (snd_opti9xx_read(chip, reg) & ~(mask)) | ((value) & (mask))) | 348 | (snd_opti9xx_read(chip, reg) & ~(mask)) | ((value) & (mask))) |
352 | 349 | ||
353 | 350 | ||
354 | static int __devinit snd_opti9xx_configure(struct snd_opti9xx *chip, | 351 | static int snd_opti9xx_configure(struct snd_opti9xx *chip, |
355 | long port, | 352 | long port, |
356 | int irq, int dma1, int dma2, | 353 | int irq, int dma1, int dma2, |
357 | long mpu_port, int mpu_irq) | 354 | long mpu_port, int mpu_irq) |
@@ -403,7 +400,9 @@ static int __devinit snd_opti9xx_configure(struct snd_opti9xx *chip, | |||
403 | 400 | ||
404 | #else /* OPTi93X */ | 401 | #else /* OPTi93X */ |
405 | case OPTi9XX_HW_82C931: | 402 | case OPTi9XX_HW_82C931: |
406 | case OPTi9XX_HW_82C933: | 403 | /* disable 3D sound (set GPIO1 as output, low) */ |
404 | snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(20), 0x04, 0x0c); | ||
405 | case OPTi9XX_HW_82C933: /* FALL THROUGH */ | ||
407 | /* | 406 | /* |
408 | * The BTC 1817DW has QS1000 wavetable which is connected | 407 | * The BTC 1817DW has QS1000 wavetable which is connected |
409 | * to the serial digital input of the OPTI931. | 408 | * to the serial digital input of the OPTI931. |
@@ -696,8 +695,7 @@ static int __devinit snd_opti9xx_read_check(struct snd_opti9xx *chip) | |||
696 | if (value == snd_opti9xx_read(chip, OPTi9XX_MC_REG(1))) | 695 | if (value == snd_opti9xx_read(chip, OPTi9XX_MC_REG(1))) |
697 | return 0; | 696 | return 0; |
698 | #else /* OPTi93X */ | 697 | #else /* OPTi93X */ |
699 | chip->res_mc_indir = request_region(chip->mc_indir_index, | 698 | chip->res_mc_indir = request_region(chip->mc_indir_index, 2, |
700 | chip->mc_indir_size, | ||
701 | "OPTi93x MC"); | 699 | "OPTi93x MC"); |
702 | if (chip->res_mc_indir == NULL) | 700 | if (chip->res_mc_indir == NULL) |
703 | return -EBUSY; | 701 | return -EBUSY; |
@@ -770,8 +768,9 @@ static int __devinit snd_card_opti9xx_pnp(struct snd_opti9xx *chip, | |||
770 | #ifdef OPTi93X | 768 | #ifdef OPTi93X |
771 | port = pnp_port_start(pdev, 0) - 4; | 769 | port = pnp_port_start(pdev, 0) - 4; |
772 | fm_port = pnp_port_start(pdev, 1) + 8; | 770 | fm_port = pnp_port_start(pdev, 1) + 8; |
773 | chip->mc_indir_index = pnp_port_start(pdev, 3) + 2; | 771 | /* adjust mc_indir_index - some cards report it at 0xe?d, |
774 | chip->mc_indir_size = pnp_port_len(pdev, 3) - 2; | 772 | other at 0xe?c but it really is always at 0xe?e */ |
773 | chip->mc_indir_index = (pnp_port_start(pdev, 3) & ~0xf) | 0xe; | ||
775 | #else | 774 | #else |
776 | devmc = pnp_request_card_device(card, pid->devs[2].id, NULL); | 775 | devmc = pnp_request_card_device(card, pid->devs[2].id, NULL); |
777 | if (devmc == NULL) | 776 | if (devmc == NULL) |
@@ -871,9 +870,7 @@ static int __devinit snd_opti9xx_probe(struct snd_card *card) | |||
871 | &codec); | 870 | &codec); |
872 | if (error < 0) | 871 | if (error < 0) |
873 | return error; | 872 | return error; |
874 | #ifdef OPTi93X | ||
875 | chip->codec = codec; | 873 | chip->codec = codec; |
876 | #endif | ||
877 | error = snd_wss_pcm(codec, 0, &pcm); | 874 | error = snd_wss_pcm(codec, 0, &pcm); |
878 | if (error < 0) | 875 | if (error < 0) |
879 | return error; | 876 | return error; |
@@ -1054,11 +1051,55 @@ static int __devexit snd_opti9xx_isa_remove(struct device *devptr, | |||
1054 | return 0; | 1051 | return 0; |
1055 | } | 1052 | } |
1056 | 1053 | ||
1054 | #ifdef CONFIG_PM | ||
1055 | static int snd_opti9xx_suspend(struct snd_card *card) | ||
1056 | { | ||
1057 | struct snd_opti9xx *chip = card->private_data; | ||
1058 | |||
1059 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | ||
1060 | chip->codec->suspend(chip->codec); | ||
1061 | return 0; | ||
1062 | } | ||
1063 | |||
1064 | static int snd_opti9xx_resume(struct snd_card *card) | ||
1065 | { | ||
1066 | struct snd_opti9xx *chip = card->private_data; | ||
1067 | int error, xdma2; | ||
1068 | #if defined(CS4231) || defined(OPTi93X) | ||
1069 | xdma2 = dma2; | ||
1070 | #else | ||
1071 | xdma2 = -1; | ||
1072 | #endif | ||
1073 | |||
1074 | error = snd_opti9xx_configure(chip, port, irq, dma1, xdma2, | ||
1075 | mpu_port, mpu_irq); | ||
1076 | if (error) | ||
1077 | return error; | ||
1078 | chip->codec->resume(chip->codec); | ||
1079 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | ||
1080 | return 0; | ||
1081 | } | ||
1082 | |||
1083 | static int snd_opti9xx_isa_suspend(struct device *dev, unsigned int n, | ||
1084 | pm_message_t state) | ||
1085 | { | ||
1086 | return snd_opti9xx_suspend(dev_get_drvdata(dev)); | ||
1087 | } | ||
1088 | |||
1089 | static int snd_opti9xx_isa_resume(struct device *dev, unsigned int n) | ||
1090 | { | ||
1091 | return snd_opti9xx_resume(dev_get_drvdata(dev)); | ||
1092 | } | ||
1093 | #endif | ||
1094 | |||
1057 | static struct isa_driver snd_opti9xx_driver = { | 1095 | static struct isa_driver snd_opti9xx_driver = { |
1058 | .match = snd_opti9xx_isa_match, | 1096 | .match = snd_opti9xx_isa_match, |
1059 | .probe = snd_opti9xx_isa_probe, | 1097 | .probe = snd_opti9xx_isa_probe, |
1060 | .remove = __devexit_p(snd_opti9xx_isa_remove), | 1098 | .remove = __devexit_p(snd_opti9xx_isa_remove), |
1061 | /* FIXME: suspend/resume */ | 1099 | #ifdef CONFIG_PM |
1100 | .suspend = snd_opti9xx_isa_suspend, | ||
1101 | .resume = snd_opti9xx_isa_resume, | ||
1102 | #endif | ||
1062 | .driver = { | 1103 | .driver = { |
1063 | .name = DEV_NAME | 1104 | .name = DEV_NAME |
1064 | }, | 1105 | }, |
@@ -1124,12 +1165,29 @@ static void __devexit snd_opti9xx_pnp_remove(struct pnp_card_link * pcard) | |||
1124 | snd_opti9xx_pnp_is_probed = 0; | 1165 | snd_opti9xx_pnp_is_probed = 0; |
1125 | } | 1166 | } |
1126 | 1167 | ||
1168 | #ifdef CONFIG_PM | ||
1169 | static int snd_opti9xx_pnp_suspend(struct pnp_card_link *pcard, | ||
1170 | pm_message_t state) | ||
1171 | { | ||
1172 | return snd_opti9xx_suspend(pnp_get_card_drvdata(pcard)); | ||
1173 | } | ||
1174 | |||
1175 | static int snd_opti9xx_pnp_resume(struct pnp_card_link *pcard) | ||
1176 | { | ||
1177 | return snd_opti9xx_resume(pnp_get_card_drvdata(pcard)); | ||
1178 | } | ||
1179 | #endif | ||
1180 | |||
1127 | static struct pnp_card_driver opti9xx_pnpc_driver = { | 1181 | static struct pnp_card_driver opti9xx_pnpc_driver = { |
1128 | .flags = PNP_DRIVER_RES_DISABLE, | 1182 | .flags = PNP_DRIVER_RES_DISABLE, |
1129 | .name = "opti9xx", | 1183 | .name = "opti9xx", |
1130 | .id_table = snd_opti9xx_pnpids, | 1184 | .id_table = snd_opti9xx_pnpids, |
1131 | .probe = snd_opti9xx_pnp_probe, | 1185 | .probe = snd_opti9xx_pnp_probe, |
1132 | .remove = __devexit_p(snd_opti9xx_pnp_remove), | 1186 | .remove = __devexit_p(snd_opti9xx_pnp_remove), |
1187 | #ifdef CONFIG_PM | ||
1188 | .suspend = snd_opti9xx_pnp_suspend, | ||
1189 | .resume = snd_opti9xx_pnp_resume, | ||
1190 | #endif | ||
1133 | }; | 1191 | }; |
1134 | #endif | 1192 | #endif |
1135 | 1193 | ||
diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c index 49c8a0c2442c..360b08b03e1d 100644 --- a/sound/isa/wss/wss_lib.c +++ b/sound/isa/wss/wss_lib.c | |||
@@ -1456,7 +1456,6 @@ static struct snd_pcm_hardware snd_wss_playback = | |||
1456 | { | 1456 | { |
1457 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 1457 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
1458 | SNDRV_PCM_INFO_MMAP_VALID | | 1458 | SNDRV_PCM_INFO_MMAP_VALID | |
1459 | SNDRV_PCM_INFO_RESUME | | ||
1460 | SNDRV_PCM_INFO_SYNC_START), | 1459 | SNDRV_PCM_INFO_SYNC_START), |
1461 | .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM | | 1460 | .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM | |
1462 | SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE), | 1461 | SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE), |
@@ -1657,6 +1656,10 @@ static void snd_wss_resume(struct snd_wss *chip) | |||
1657 | break; | 1656 | break; |
1658 | } | 1657 | } |
1659 | } | 1658 | } |
1659 | /* Yamaha needs this to resume properly */ | ||
1660 | if (chip->hardware == WSS_HW_OPL3SA2) | ||
1661 | snd_wss_out(chip, CS4231_PLAYBK_FORMAT, | ||
1662 | chip->image[CS4231_PLAYBK_FORMAT]); | ||
1660 | spin_unlock_irqrestore(&chip->reg_lock, flags); | 1663 | spin_unlock_irqrestore(&chip->reg_lock, flags); |
1661 | #if 1 | 1664 | #if 1 |
1662 | snd_wss_mce_down(chip); | 1665 | snd_wss_mce_down(chip); |