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>
This commit is contained in:
Takashi Iwai
2012-08-03 18:01:40 +02:00
parent 833a493b7e
commit e36e3b86c7
4 changed files with 59 additions and 0 deletions

View File

@@ -1541,6 +1541,26 @@ static int __devinit snd_intel8x0_pcm1(struct intel8x0 *chip, int device,
snd_dma_pci_data(chip->pci),
rec->prealloc_size, rec->prealloc_max_size);
if (rec->ac97_idx == ICHD_PCMOUT && rec->playback_ops) {
struct snd_pcm_chmap *chmap;
int chs = 2;
if (rec->ac97_idx == ICHD_PCMOUT) {
if (chip->multi8)
chs = 8;
else if (chip->multi6)
chs = 6;
else if (chip->multi4)
chs = 4;
}
err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
snd_pcm_alt_chmaps, chs, 0,
&chmap);
if (err < 0)
return err;
chmap->channel_mask = SND_PCM_CHMAP_MASK_2468;
chip->ac97[0]->chmaps[SNDRV_PCM_STREAM_PLAYBACK] = chmap;
}
return 0;
}