diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-08-03 12:01:40 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-09-06 12:08:31 -0400 |
commit | e36e3b86c78cee9c7435eb33e0ef8a788193e812 (patch) | |
tree | a44ed8a8f0e7b832048d4fbd94a9041823cf1979 /sound/pci/atiixp.c | |
parent | 833a493b7ed2eb8f9059338a0ebf06bebbb6ae93 (diff) |
ALSA: Implement channel maps for standard onboard AC97 drivers
Just set the channel maps depending on the hardware availability.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/atiixp.c')
-rw-r--r-- | sound/pci/atiixp.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index c744df5bb1c6..368df8b0853e 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c | |||
@@ -1250,6 +1250,7 @@ static struct atiixp_dma_ops snd_atiixp_spdif_dma_ops = { | |||
1250 | static int __devinit snd_atiixp_pcm_new(struct atiixp *chip) | 1250 | static int __devinit snd_atiixp_pcm_new(struct atiixp *chip) |
1251 | { | 1251 | { |
1252 | struct snd_pcm *pcm; | 1252 | struct snd_pcm *pcm; |
1253 | struct snd_pcm_chmap *chmap; | ||
1253 | struct snd_ac97_bus *pbus = chip->ac97_bus; | 1254 | struct snd_ac97_bus *pbus = chip->ac97_bus; |
1254 | int err, i, num_pcms; | 1255 | int err, i, num_pcms; |
1255 | 1256 | ||
@@ -1293,6 +1294,14 @@ static int __devinit snd_atiixp_pcm_new(struct atiixp *chip) | |||
1293 | snd_dma_pci_data(chip->pci), | 1294 | snd_dma_pci_data(chip->pci), |
1294 | 64*1024, 128*1024); | 1295 | 64*1024, 128*1024); |
1295 | 1296 | ||
1297 | err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK, | ||
1298 | snd_pcm_alt_chmaps, chip->max_channels, 0, | ||
1299 | &chmap); | ||
1300 | if (err < 0) | ||
1301 | return err; | ||
1302 | chmap->channel_mask = SND_PCM_CHMAP_MASK_2468; | ||
1303 | chip->ac97[0]->chmaps[SNDRV_PCM_STREAM_PLAYBACK] = chmap; | ||
1304 | |||
1296 | /* no SPDIF support on codec? */ | 1305 | /* no SPDIF support on codec? */ |
1297 | if (chip->pcms[ATI_PCM_SPDIF] && ! chip->pcms[ATI_PCM_SPDIF]->rates) | 1306 | if (chip->pcms[ATI_PCM_SPDIF] && ! chip->pcms[ATI_PCM_SPDIF]->rates) |
1298 | return 0; | 1307 | return 0; |