aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_intel.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-09-07 07:29:22 -0400
committerJaroslav Kysela <perex@suse.cz>2005-09-12 04:42:17 -0400
commitec9e1c5c9c7350cc8214f8b9c529f9678036d9a8 (patch)
treee21fe7f19a95aeaa98069713fabeddf9ad0369f5 /sound/pci/hda/hda_intel.c
parent821690cdc82e4090ef6f91947f76a231fad5cbb1 (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.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 96f9e872919..2098de7c567 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 };
164/* max buffer size - no h/w limit, you can increase as you like */ 164/* max buffer size - no h/w limit, you can increase as you like */
165#define AZX_MAX_BUF_SIZE (1024*1024*1024) 165#define AZX_MAX_BUF_SIZE (1024*1024*1024)
166/* max number of PCM devics per card */ 166/* max number of PCM devics per card */
167#define AZX_MAX_PCMS 8 167#define AZX_MAX_AUDIO_PCMS 6
168#define AZX_MAX_MODEM_PCMS 2
169#define AZX_MAX_PCMS (AZX_MAX_AUDIO_PCMS + AZX_MAX_MODEM_PCMS)
168 170
169/* RIRB int mask: overrun[2], response[0] */ 171/* RIRB int mask: overrun[2], response[0] */
170#define RIRB_INT_RESPONSE 0x01 172#define RIRB_INT_RESPONSE 0x01
@@ -1225,12 +1227,33 @@ static int __devinit azx_pcm_create(azx_t *chip)
1225 if ((err = snd_hda_build_pcms(chip->bus)) < 0) 1227 if ((err = snd_hda_build_pcms(chip->bus)) < 0)
1226 return err; 1228 return err;
1227 1229
1230 /* create audio PCMs */
1228 pcm_dev = 0; 1231 pcm_dev = 0;
1229 list_for_each(p, &chip->bus->codec_list) { 1232 list_for_each(p, &chip->bus->codec_list) {
1230 codec = list_entry(p, struct hda_codec, list); 1233 codec = list_entry(p, struct hda_codec, list);
1231 for (c = 0; c < codec->num_pcms; c++) { 1234 for (c = 0; c < codec->num_pcms; c++) {
1232 if (pcm_dev >= AZX_MAX_PCMS) { 1235 if (codec->pcm_info[c].is_modem)
1233 snd_printk(KERN_ERR SFX "Too many PCMs\n"); 1236 continue; /* create later */
1237 if (pcm_dev >= AZX_MAX_AUDIO_PCMS) {
1238 snd_printk(KERN_ERR SFX "Too many audio PCMs\n");
1239 return -EINVAL;
1240 }
1241 err = create_codec_pcm(chip, codec, &codec->pcm_info[c], pcm_dev);
1242 if (err < 0)
1243 return err;
1244 pcm_dev++;
1245 }
1246 }
1247
1248 /* create modem PCMs */
1249 pcm_dev = AZX_MAX_AUDIO_PCMS;
1250 list_for_each(p, &chip->bus->codec_list) {
1251 codec = list_entry(p, struct hda_codec, list);
1252 for (c = 0; c < codec->num_pcms; c++) {
1253 if (! codec->pcm_info[c].is_modem)
1254 continue; /* already created */
1255 if (pcm_dev >= AZX_MAX_MODEM_PCMS) {
1256 snd_printk(KERN_ERR SFX "Too many modem PCMs\n");
1234 return -EINVAL; 1257 return -EINVAL;
1235 } 1258 }
1236 err = create_codec_pcm(chip, codec, &codec->pcm_info[c], pcm_dev); 1259 err = create_codec_pcm(chip, codec, &codec->pcm_info[c], pcm_dev);