emupcm.c (3eb66e91a25497065c5322b1268cbc3953642227) emupcm.c (5116b94af07a9775ed694562f354e931b2cc04d4)
1/*
2 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
3 * Creative Labs, Inc.
4 * Routines for control of EMU10K1 chips / PCM routines
5 * Multichannel PCM support Copyright (c) Lee Revell <rlrevell@joe-job.com>
6 *
7 * BUGS:
8 * --

--- 1413 unchanged lines hidden (view full) ---

1422 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_emu10k1_capture_ops);
1423
1424 pcm->info_flags = 0;
1425 pcm->dev_subclass = SNDRV_PCM_SUBCLASS_GENERIC_MIX;
1426 strcpy(pcm->name, "ADC Capture/Standard PCM Playback");
1427 emu->pcm = pcm;
1428
1429 for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream; substream = substream->next)
1/*
2 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
3 * Creative Labs, Inc.
4 * Routines for control of EMU10K1 chips / PCM routines
5 * Multichannel PCM support Copyright (c) Lee Revell <rlrevell@joe-job.com>
6 *
7 * BUGS:
8 * --

--- 1413 unchanged lines hidden (view full) ---

1422 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_emu10k1_capture_ops);
1423
1424 pcm->info_flags = 0;
1425 pcm->dev_subclass = SNDRV_PCM_SUBCLASS_GENERIC_MIX;
1426 strcpy(pcm->name, "ADC Capture/Standard PCM Playback");
1427 emu->pcm = pcm;
1428
1429 for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream; substream = substream->next)
1430 if ((err = snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV_SG, snd_dma_pci_data(emu->pci), 64*1024, 64*1024)) < 0)
1431 return err;
1430 snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV_SG,
1431 snd_dma_pci_data(emu->pci),
1432 64*1024, 64*1024);
1432
1433 for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; substream; substream = substream->next)
1433
1434 for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; substream; substream = substream->next)
1434 snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(emu->pci), 64*1024, 64*1024);
1435 snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV,
1436 snd_dma_pci_data(emu->pci),
1437 64*1024, 64*1024);
1435
1436 return 0;
1437}
1438
1439int snd_emu10k1_pcm_multi(struct snd_emu10k1 *emu, int device)
1440{
1441 struct snd_pcm *pcm;
1442 struct snd_pcm_substream *substream;

--- 7 unchanged lines hidden (view full) ---

1450 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_emu10k1_efx_playback_ops);
1451
1452 pcm->info_flags = 0;
1453 pcm->dev_subclass = SNDRV_PCM_SUBCLASS_GENERIC_MIX;
1454 strcpy(pcm->name, "Multichannel Playback");
1455 emu->pcm_multi = pcm;
1456
1457 for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream; substream = substream->next)
1438
1439 return 0;
1440}
1441
1442int snd_emu10k1_pcm_multi(struct snd_emu10k1 *emu, int device)
1443{
1444 struct snd_pcm *pcm;
1445 struct snd_pcm_substream *substream;

--- 7 unchanged lines hidden (view full) ---

1453 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_emu10k1_efx_playback_ops);
1454
1455 pcm->info_flags = 0;
1456 pcm->dev_subclass = SNDRV_PCM_SUBCLASS_GENERIC_MIX;
1457 strcpy(pcm->name, "Multichannel Playback");
1458 emu->pcm_multi = pcm;
1459
1460 for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream; substream = substream->next)
1458 if ((err = snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV_SG, snd_dma_pci_data(emu->pci), 64*1024, 64*1024)) < 0)
1459 return err;
1461 snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV_SG,
1462 snd_dma_pci_data(emu->pci),
1463 64*1024, 64*1024);
1460
1461 return 0;
1462}
1463
1464
1465static const struct snd_pcm_ops snd_emu10k1_capture_mic_ops = {
1466 .open = snd_emu10k1_capture_mic_open,
1467 .close = snd_emu10k1_capture_mic_close,

--- 16 unchanged lines hidden (view full) ---

1484 pcm->private_data = emu;
1485
1486 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_emu10k1_capture_mic_ops);
1487
1488 pcm->info_flags = 0;
1489 strcpy(pcm->name, "Mic Capture");
1490 emu->pcm_mic = pcm;
1491
1464
1465 return 0;
1466}
1467
1468
1469static const struct snd_pcm_ops snd_emu10k1_capture_mic_ops = {
1470 .open = snd_emu10k1_capture_mic_open,
1471 .close = snd_emu10k1_capture_mic_close,

--- 16 unchanged lines hidden (view full) ---

1488 pcm->private_data = emu;
1489
1490 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_emu10k1_capture_mic_ops);
1491
1492 pcm->info_flags = 0;
1493 strcpy(pcm->name, "Mic Capture");
1494 emu->pcm_mic = pcm;
1495
1492 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(emu->pci), 64*1024, 64*1024);
1496 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
1497 snd_dma_pci_data(emu->pci),
1498 64*1024, 64*1024);
1493
1494 return 0;
1495}
1496
1497static int snd_emu10k1_pcm_efx_voices_mask_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1498{
1499 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1500 int nefx = emu->audigy ? 64 : 32;

--- 356 unchanged lines hidden (view full) ---

1857 kctl = snd_ctl_new1(&snd_emu10k1_pcm_efx_voices_mask, emu);
1858 if (!kctl)
1859 return -ENOMEM;
1860 kctl->id.device = device;
1861 err = snd_ctl_add(emu->card, kctl);
1862 if (err < 0)
1863 return err;
1864
1499
1500 return 0;
1501}
1502
1503static int snd_emu10k1_pcm_efx_voices_mask_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1504{
1505 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1506 int nefx = emu->audigy ? 64 : 32;

--- 356 unchanged lines hidden (view full) ---

1863 kctl = snd_ctl_new1(&snd_emu10k1_pcm_efx_voices_mask, emu);
1864 if (!kctl)
1865 return -ENOMEM;
1866 kctl->id.device = device;
1867 err = snd_ctl_add(emu->card, kctl);
1868 if (err < 0)
1869 return err;
1870
1865 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(emu->pci), 64*1024, 64*1024);
1871 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
1872 snd_dma_pci_data(emu->pci),
1873 64*1024, 64*1024);
1866
1867 return 0;
1868}
1874
1875 return 0;
1876}