Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34946
b: refs/heads/master
c: e08a007
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Sep 23, 2006
1 parent 8964801 commit cd7161e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dafbbb1fdbf103b24d0f7aa645625b6bd558c896
refs/heads/master: e08a007d1041e0bc3df6b855043d8efde91851aa
10 changes: 8 additions & 2 deletions trunk/sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,12 @@ static int __devinit create_codec_pcm(struct azx *chip, struct hda_codec *codec,
struct snd_pcm *pcm;
struct azx_pcm *apcm;

snd_assert(cpcm->stream[0].substreams || cpcm->stream[1].substreams, return -EINVAL);
/* if no substreams are defined for both playback and capture,
* it's just a placeholder. ignore it.
*/
if (!cpcm->stream[0].substreams && !cpcm->stream[1].substreams)
return 0;

snd_assert(cpcm->name, return -EINVAL);

err = snd_pcm_new(chip->card, cpcm->name, pcm_dev,
Expand All @@ -1268,7 +1273,8 @@ static int __devinit create_codec_pcm(struct azx *chip, struct hda_codec *codec,
snd_dma_pci_data(chip->pci),
1024 * 64, 1024 * 128);
chip->pcm[pcm_dev] = pcm;
chip->pcm_devs = pcm_dev + 1;
if (chip->pcm_devs < pcm_dev + 1)
chip->pcm_devs = pcm_dev + 1;

return 0;
}
Expand Down
38 changes: 20 additions & 18 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -1796,25 +1796,9 @@ static int alc_build_pcms(struct hda_codec *codec)
}
}

/* If the use of more than one ADC is requested for the current
* model, configure a second analog capture-only PCM.
*/
if (spec->num_adc_nids > 1) {
codec->num_pcms++;
info++;
info->name = spec->stream_name_analog;
/* No playback stream for second PCM */
info->stream[SNDRV_PCM_STREAM_PLAYBACK] = alc_pcm_null_playback;
info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = 0;
if (spec->stream_analog_capture) {
snd_assert(spec->adc_nids, return -EINVAL);
info->stream[SNDRV_PCM_STREAM_CAPTURE] = *(spec->stream_analog_capture);
info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adc_nids[1];
}
}

/* SPDIF for stream index #1 */
if (spec->multiout.dig_out_nid || spec->dig_in_nid) {
codec->num_pcms++;
codec->num_pcms = 2;
info++;
info->name = spec->stream_name_digital;
if (spec->multiout.dig_out_nid &&
Expand All @@ -1829,6 +1813,24 @@ static int alc_build_pcms(struct hda_codec *codec)
}
}

/* If the use of more than one ADC is requested for the current
* model, configure a second analog capture-only PCM.
*/
/* Additional Analaog capture for index #2 */
if (spec->num_adc_nids > 1 && spec->stream_analog_capture &&
spec->adc_nids) {
codec->num_pcms = 3;
info++;
info->name = spec->stream_name_analog;
/* No playback stream for second PCM */
info->stream[SNDRV_PCM_STREAM_PLAYBACK] = alc_pcm_null_playback;
info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = 0;
if (spec->stream_analog_capture) {
info->stream[SNDRV_PCM_STREAM_CAPTURE] = *(spec->stream_analog_capture);
info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adc_nids[1];
}
}

return 0;
}

Expand Down

0 comments on commit cd7161e

Please sign in to comment.