diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-09-07 13:29:22 +0200 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-09-12 10:42:17 +0200 |
commit | ec9e1c5c9c7350cc8214f8b9c529f9678036d9a8 (patch) | |
tree | e21fe7f19a95aeaa98069713fabeddf9ad0369f5 /sound/pci/hda/hda_intel.c | |
parent | 821690cdc82e4090ef6f91947f76a231fad5cbb1 (diff) |
[ALSA] hda-codec - Assign audio PCMS first
HDA Codec driver,HDA Intel driver,HDA generic driver
Assign audio PCMs first before modem PCMs.
The modem stream is assigned up to device #6, to be consistent over
different models.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r-- | sound/pci/hda/hda_intel.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 96f9e8729192..2098de7c5679 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -164,7 +164,9 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 }; /* max buffer size - no h/w limit, you can increase as you like */ #define AZX_MAX_BUF_SIZE (1024*1024*1024) /* max number of PCM devics per card */ -#define AZX_MAX_PCMS 8 +#define AZX_MAX_AUDIO_PCMS 6 +#define AZX_MAX_MODEM_PCMS 2 +#define AZX_MAX_PCMS (AZX_MAX_AUDIO_PCMS + AZX_MAX_MODEM_PCMS) /* RIRB int mask: overrun[2], response[0] */ #define RIRB_INT_RESPONSE 0x01 @@ -1225,12 +1227,33 @@ static int __devinit azx_pcm_create(azx_t *chip) if ((err = snd_hda_build_pcms(chip->bus)) < 0) return err; + /* create audio PCMs */ pcm_dev = 0; list_for_each(p, &chip->bus->codec_list) { codec = list_entry(p, struct hda_codec, list); for (c = 0; c < codec->num_pcms; c++) { - if (pcm_dev >= AZX_MAX_PCMS) { - snd_printk(KERN_ERR SFX "Too many PCMs\n"); + if (codec->pcm_info[c].is_modem) + continue; /* create later */ + if (pcm_dev >= AZX_MAX_AUDIO_PCMS) { + snd_printk(KERN_ERR SFX "Too many audio PCMs\n"); + return -EINVAL; + } + err = create_codec_pcm(chip, codec, &codec->pcm_info[c], pcm_dev); + if (err < 0) + return err; + pcm_dev++; + } + } + + /* create modem PCMs */ + pcm_dev = AZX_MAX_AUDIO_PCMS; + list_for_each(p, &chip->bus->codec_list) { + codec = list_entry(p, struct hda_codec, list); + for (c = 0; c < codec->num_pcms; c++) { + if (! codec->pcm_info[c].is_modem) + continue; /* already created */ + if (pcm_dev >= AZX_MAX_MODEM_PCMS) { + snd_printk(KERN_ERR SFX "Too many modem PCMs\n"); return -EINVAL; } err = create_codec_pcm(chip, codec, &codec->pcm_info[c], pcm_dev); |