diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-09-12 09:52:47 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-09-12 09:52:47 -0400 |
commit | 3adc497f98dd062bcf4d832c659a3d706ece5249 (patch) | |
tree | dcb2405613ef3aba804037a14b2593e9a4444fa6 /sound/pci | |
parent | 21147f91f1be57c4cfc24e538e93c30636513ce8 (diff) |
ALSA: emu10k1x: Define channel maps
Provide channel maps for individual stereo streams of emu10k1x.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/emu10k1/emu10k1x.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c index 5c8978b2c4d9..556fd6f456e3 100644 --- a/sound/pci/emu10k1/emu10k1x.c +++ b/sound/pci/emu10k1/emu10k1x.c | |||
@@ -830,9 +830,22 @@ static irqreturn_t snd_emu10k1x_interrupt(int irq, void *dev_id) | |||
830 | return IRQ_HANDLED; | 830 | return IRQ_HANDLED; |
831 | } | 831 | } |
832 | 832 | ||
833 | static const struct snd_pcm_chmap_elem surround_map[] = { | ||
834 | { .channels = 2, | ||
835 | .map = { SNDRV_CHMAP_RL, SNDRV_CHMAP_RR } }, | ||
836 | { } | ||
837 | }; | ||
838 | |||
839 | static const struct snd_pcm_chmap_elem clfe_map[] = { | ||
840 | { .channels = 2, | ||
841 | .map = { SNDRV_CHMAP_FC, SNDRV_CHMAP_LFE } }, | ||
842 | { } | ||
843 | }; | ||
844 | |||
833 | static int __devinit snd_emu10k1x_pcm(struct emu10k1x *emu, int device, struct snd_pcm **rpcm) | 845 | static int __devinit snd_emu10k1x_pcm(struct emu10k1x *emu, int device, struct snd_pcm **rpcm) |
834 | { | 846 | { |
835 | struct snd_pcm *pcm; | 847 | struct snd_pcm *pcm; |
848 | const struct snd_pcm_chmap_elem *map = NULL; | ||
836 | int err; | 849 | int err; |
837 | int capture = 0; | 850 | int capture = 0; |
838 | 851 | ||
@@ -861,12 +874,15 @@ static int __devinit snd_emu10k1x_pcm(struct emu10k1x *emu, int device, struct s | |||
861 | switch(device) { | 874 | switch(device) { |
862 | case 0: | 875 | case 0: |
863 | strcpy(pcm->name, "EMU10K1X Front"); | 876 | strcpy(pcm->name, "EMU10K1X Front"); |
877 | map = snd_pcm_std_chmaps; | ||
864 | break; | 878 | break; |
865 | case 1: | 879 | case 1: |
866 | strcpy(pcm->name, "EMU10K1X Rear"); | 880 | strcpy(pcm->name, "EMU10K1X Rear"); |
881 | map = surround_map; | ||
867 | break; | 882 | break; |
868 | case 2: | 883 | case 2: |
869 | strcpy(pcm->name, "EMU10K1X Center/LFE"); | 884 | strcpy(pcm->name, "EMU10K1X Center/LFE"); |
885 | map = clfe_map; | ||
870 | break; | 886 | break; |
871 | } | 887 | } |
872 | emu->pcm = pcm; | 888 | emu->pcm = pcm; |
@@ -875,6 +891,11 @@ static int __devinit snd_emu10k1x_pcm(struct emu10k1x *emu, int device, struct s | |||
875 | snd_dma_pci_data(emu->pci), | 891 | snd_dma_pci_data(emu->pci), |
876 | 32*1024, 32*1024); | 892 | 32*1024, 32*1024); |
877 | 893 | ||
894 | err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK, map, 2, | ||
895 | 1 << 2, NULL); | ||
896 | if (err < 0) | ||
897 | return err; | ||
898 | |||
878 | if (rpcm) | 899 | if (rpcm) |
879 | *rpcm = pcm; | 900 | *rpcm = pcm; |
880 | 901 | ||