ALSA: ymfpci: Define channel maps
Provide channel maps for individual stereo streams of YMFPCI. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
7fb6861d62
commit
0afdb8f286
1 changed files with 18 additions and 0 deletions
|
@ -1166,6 +1166,11 @@ int __devinit snd_ymfpci_pcm(struct snd_ymfpci *chip, int device, struct snd_pcm
|
||||||
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
|
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
|
||||||
snd_dma_pci_data(chip->pci), 64*1024, 256*1024);
|
snd_dma_pci_data(chip->pci), 64*1024, 256*1024);
|
||||||
|
|
||||||
|
err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
|
||||||
|
snd_pcm_std_chmaps, 2, 0, NULL);
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
if (rpcm)
|
if (rpcm)
|
||||||
*rpcm = pcm;
|
*rpcm = pcm;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1257,6 +1262,14 @@ static struct snd_pcm_ops snd_ymfpci_playback_4ch_ops = {
|
||||||
.pointer = snd_ymfpci_playback_pointer,
|
.pointer = snd_ymfpci_playback_pointer,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct snd_pcm_chmap_elem surround_map[] = {
|
||||||
|
{ .channels = 1,
|
||||||
|
.map = { SNDRV_CHMAP_UNKNOWN } },
|
||||||
|
{ .channels = 2,
|
||||||
|
.map = { SNDRV_CHMAP_RL, SNDRV_CHMAP_RR } },
|
||||||
|
{ }
|
||||||
|
};
|
||||||
|
|
||||||
int __devinit snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device, struct snd_pcm ** rpcm)
|
int __devinit snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device, struct snd_pcm ** rpcm)
|
||||||
{
|
{
|
||||||
struct snd_pcm *pcm;
|
struct snd_pcm *pcm;
|
||||||
|
@ -1278,6 +1291,11 @@ int __devinit snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device, struct snd
|
||||||
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
|
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
|
||||||
snd_dma_pci_data(chip->pci), 64*1024, 256*1024);
|
snd_dma_pci_data(chip->pci), 64*1024, 256*1024);
|
||||||
|
|
||||||
|
err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
|
||||||
|
surround_map, 2, 0, NULL);
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
if (rpcm)
|
if (rpcm)
|
||||||
*rpcm = pcm;
|
*rpcm = pcm;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue