diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-09-07 07:29:22 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-09-12 04:42:17 -0400 |
commit | ec9e1c5c9c7350cc8214f8b9c529f9678036d9a8 (patch) | |
tree | e21fe7f19a95aeaa98069713fabeddf9ad0369f5 /sound/pci | |
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')
-rw-r--r-- | sound/pci/hda/hda_codec.h | 1 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 29 | ||||
-rw-r--r-- | sound/pci/hda/hda_proc.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_si3054.c | 1 |
4 files changed, 30 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 63a29a8a2860..bb53bcf76742 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -505,6 +505,7 @@ struct hda_pcm_stream { | |||
505 | struct hda_pcm { | 505 | struct hda_pcm { |
506 | char *name; | 506 | char *name; |
507 | struct hda_pcm_stream stream[2]; | 507 | struct hda_pcm_stream stream[2]; |
508 | unsigned int is_modem; /* modem codec? */ | ||
508 | }; | 509 | }; |
509 | 510 | ||
510 | /* codec information */ | 511 | /* codec information */ |
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 }; | |||
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); |
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index de1217bd8e68..08f6a6efc5e6 100644 --- a/sound/pci/hda/hda_proc.c +++ b/sound/pci/hda/hda_proc.c | |||
@@ -207,6 +207,8 @@ static void print_codec_info(snd_info_entry_t *entry, snd_info_buffer_t *buffer) | |||
207 | snd_iprintf(buffer, "Vendor Id: 0x%x\n", codec->vendor_id); | 207 | snd_iprintf(buffer, "Vendor Id: 0x%x\n", codec->vendor_id); |
208 | snd_iprintf(buffer, "Subsystem Id: 0x%x\n", codec->subsystem_id); | 208 | snd_iprintf(buffer, "Subsystem Id: 0x%x\n", codec->subsystem_id); |
209 | snd_iprintf(buffer, "Revision Id: 0x%x\n", codec->revision_id); | 209 | snd_iprintf(buffer, "Revision Id: 0x%x\n", codec->revision_id); |
210 | if (! codec->afg) | ||
211 | return; | ||
210 | snd_iprintf(buffer, "Default PCM: "); | 212 | snd_iprintf(buffer, "Default PCM: "); |
211 | print_pcm_caps(buffer, codec, codec->afg); | 213 | print_pcm_caps(buffer, codec, codec->afg); |
212 | snd_iprintf(buffer, "Default Amp-In caps: "); | 214 | snd_iprintf(buffer, "Default Amp-In caps: "); |
diff --git a/sound/pci/hda/patch_si3054.c b/sound/pci/hda/patch_si3054.c index b0270d1b64ce..c41fb9acdce4 100644 --- a/sound/pci/hda/patch_si3054.c +++ b/sound/pci/hda/patch_si3054.c | |||
@@ -214,6 +214,7 @@ static int si3054_build_pcms(struct hda_codec *codec) | |||
214 | info->name = "Si3054 Modem"; | 214 | info->name = "Si3054 Modem"; |
215 | info->stream[SNDRV_PCM_STREAM_PLAYBACK] = si3054_pcm; | 215 | info->stream[SNDRV_PCM_STREAM_PLAYBACK] = si3054_pcm; |
216 | info->stream[SNDRV_PCM_STREAM_CAPTURE] = si3054_pcm; | 216 | info->stream[SNDRV_PCM_STREAM_CAPTURE] = si3054_pcm; |
217 | info->is_modem = 1; | ||
217 | return 0; | 218 | return 0; |
218 | } | 219 | } |
219 | 220 | ||