aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ymfpci/ymfpci_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ymfpci/ymfpci_main.c')
-rw-r--r--sound/pci/ymfpci/ymfpci_main.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
index 62b23635b754..3a6f03f9b02f 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
@@ -1166,6 +1166,11 @@ int __devinit snd_ymfpci_pcm(struct snd_ymfpci *chip, int device, struct snd_pcm
1166 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 1166 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
1167 snd_dma_pci_data(chip->pci), 64*1024, 256*1024); 1167 snd_dma_pci_data(chip->pci), 64*1024, 256*1024);
1168 1168
1169 err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
1170 snd_pcm_std_chmaps, 2, 0, NULL);
1171 if (err < 0)
1172 return err;
1173
1169 if (rpcm) 1174 if (rpcm)
1170 *rpcm = pcm; 1175 *rpcm = pcm;
1171 return 0; 1176 return 0;
@@ -1257,6 +1262,14 @@ static struct snd_pcm_ops snd_ymfpci_playback_4ch_ops = {
1257 .pointer = snd_ymfpci_playback_pointer, 1262 .pointer = snd_ymfpci_playback_pointer,
1258}; 1263};
1259 1264
1265static const struct snd_pcm_chmap_elem surround_map[] = {
1266 { .channels = 1,
1267 .map = { SNDRV_CHMAP_MONO } },
1268 { .channels = 2,
1269 .map = { SNDRV_CHMAP_RL, SNDRV_CHMAP_RR } },
1270 { }
1271};
1272
1260int __devinit snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device, struct snd_pcm ** rpcm) 1273int __devinit snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device, struct snd_pcm ** rpcm)
1261{ 1274{
1262 struct snd_pcm *pcm; 1275 struct snd_pcm *pcm;
@@ -1278,6 +1291,11 @@ int __devinit snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device, struct snd
1278 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 1291 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
1279 snd_dma_pci_data(chip->pci), 64*1024, 256*1024); 1292 snd_dma_pci_data(chip->pci), 64*1024, 256*1024);
1280 1293
1294 err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
1295 surround_map, 2, 0, NULL);
1296 if (err < 0)
1297 return err;
1298
1281 if (rpcm) 1299 if (rpcm)
1282 *rpcm = pcm; 1300 *rpcm = pcm;
1283 return 0; 1301 return 0;
@@ -2242,7 +2260,7 @@ static int snd_ymfpci_free(struct snd_ymfpci *chip)
2242 pci_set_power_state(chip->pci, 3); 2260 pci_set_power_state(chip->pci, 3);
2243#endif 2261#endif
2244 2262
2245#ifdef CONFIG_PM 2263#ifdef CONFIG_PM_SLEEP
2246 vfree(chip->saved_regs); 2264 vfree(chip->saved_regs);
2247#endif 2265#endif
2248 if (chip->irq >= 0) 2266 if (chip->irq >= 0)
@@ -2272,7 +2290,7 @@ static int snd_ymfpci_dev_free(struct snd_device *device)
2272 return snd_ymfpci_free(chip); 2290 return snd_ymfpci_free(chip);
2273} 2291}
2274 2292
2275#ifdef CONFIG_PM 2293#ifdef CONFIG_PM_SLEEP
2276static int saved_regs_index[] = { 2294static int saved_regs_index[] = {
2277 /* spdif */ 2295 /* spdif */
2278 YDSXGR_SPDIFOUTCTRL, 2296 YDSXGR_SPDIFOUTCTRL,
@@ -2374,7 +2392,7 @@ static int snd_ymfpci_resume(struct device *dev)
2374} 2392}
2375 2393
2376SIMPLE_DEV_PM_OPS(snd_ymfpci_pm, snd_ymfpci_suspend, snd_ymfpci_resume); 2394SIMPLE_DEV_PM_OPS(snd_ymfpci_pm, snd_ymfpci_suspend, snd_ymfpci_resume);
2377#endif /* CONFIG_PM */ 2395#endif /* CONFIG_PM_SLEEP */
2378 2396
2379int __devinit snd_ymfpci_create(struct snd_card *card, 2397int __devinit snd_ymfpci_create(struct snd_card *card,
2380 struct pci_dev * pci, 2398 struct pci_dev * pci,
@@ -2452,7 +2470,7 @@ int __devinit snd_ymfpci_create(struct snd_card *card,
2452 return err; 2470 return err;
2453 } 2471 }
2454 2472
2455#ifdef CONFIG_PM 2473#ifdef CONFIG_PM_SLEEP
2456 chip->saved_regs = vmalloc(YDSXGR_NUM_SAVED_REGS * sizeof(u32)); 2474 chip->saved_regs = vmalloc(YDSXGR_NUM_SAVED_REGS * sizeof(u32));
2457 if (chip->saved_regs == NULL) { 2475 if (chip->saved_regs == NULL) {
2458 snd_ymfpci_free(chip); 2476 snd_ymfpci_free(chip);