Commit 8c441982 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Assign proper digital I/O type for STAC/IDT

Assign the proper PCM digital I/O type (HDA_PCM_TYPE_*) for the digital
I/O on STAC/IDT codecs.  HDA_PCM_TYPE_HDMI is assigned for the HDMI I/O.

A similar framework is implemented to patch_realtek.c, but it's not
set up and still using only HDA_PCM_TYPE_SPDIF yet.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 2297bd6e
...@@ -269,6 +269,7 @@ struct alc_spec { ...@@ -269,6 +269,7 @@ struct alc_spec {
* dig_out_nid and hp_nid are optional * dig_out_nid and hp_nid are optional
*/ */
hda_nid_t alt_dac_nid; hda_nid_t alt_dac_nid;
int dig_out_type;
/* capture */ /* capture */
unsigned int num_adc_nids; unsigned int num_adc_nids;
...@@ -3087,7 +3088,10 @@ static int alc_build_pcms(struct hda_codec *codec) ...@@ -3087,7 +3088,10 @@ static int alc_build_pcms(struct hda_codec *codec)
codec->num_pcms = 2; codec->num_pcms = 2;
info = spec->pcm_rec + 1; info = spec->pcm_rec + 1;
info->name = spec->stream_name_digital; info->name = spec->stream_name_digital;
info->pcm_type = HDA_PCM_TYPE_SPDIF; if (spec->dig_out_type)
info->pcm_type = spec->dig_out_type;
else
info->pcm_type = HDA_PCM_TYPE_SPDIF;
if (spec->multiout.dig_out_nid && if (spec->multiout.dig_out_nid &&
spec->stream_digital_playback) { spec->stream_digital_playback) {
info->stream[SNDRV_PCM_STREAM_PLAYBACK] = *(spec->stream_digital_playback); info->stream[SNDRV_PCM_STREAM_PLAYBACK] = *(spec->stream_digital_playback);
......
...@@ -2553,7 +2553,7 @@ static int stac92xx_build_pcms(struct hda_codec *codec) ...@@ -2553,7 +2553,7 @@ static int stac92xx_build_pcms(struct hda_codec *codec)
codec->num_pcms++; codec->num_pcms++;
info++; info++;
info->name = "STAC92xx Digital"; info->name = "STAC92xx Digital";
info->pcm_type = HDA_PCM_TYPE_SPDIF; info->pcm_type = spec->autocfg.dig_out_type;
if (spec->multiout.dig_out_nid) { if (spec->multiout.dig_out_nid) {
info->stream[SNDRV_PCM_STREAM_PLAYBACK] = stac92xx_pcm_digital_playback; info->stream[SNDRV_PCM_STREAM_PLAYBACK] = stac92xx_pcm_digital_playback;
info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->multiout.dig_out_nid; info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->multiout.dig_out_nid;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment