Loading sound/pci/hda/patch_hdmi.c +27 −42 Original line number Diff line number Diff line Loading @@ -1364,26 +1364,22 @@ static int simple_playback_build_pcms(struct hda_codec *codec) { struct hdmi_spec *spec = codec->spec; struct hda_pcm *info = spec->pcm_rec; int i; codec->num_pcms = spec->num_cvts; codec->pcm_info = info; for (i = 0; i < codec->num_pcms; i++, info++) { unsigned int chans; struct hda_pcm_stream *pstr; chans = get_wcaps(codec, spec->cvts[i].cvt_nid); codec->num_pcms = 1; codec->pcm_info = info; chans = get_wcaps(codec, spec->cvts[0].cvt_nid); chans = get_wcaps_channels(chans); info->name = get_hdmi_pcm_name(i); info->name = get_hdmi_pcm_name(0); info->pcm_type = HDA_PCM_TYPE_HDMI; pstr = &info->stream[SNDRV_PCM_STREAM_PLAYBACK]; *pstr = spec->pcm_playback; pstr->nid = spec->cvts[i].cvt_nid; pstr->nid = spec->cvts[0].cvt_nid; if (pstr->channels_max <= 2 && chans && chans <= 16) pstr->channels_max = chans; } return 0; } Loading @@ -1405,38 +1401,27 @@ static int simple_playback_build_controls(struct hda_codec *codec) { struct hdmi_spec *spec = codec->spec; int err; int i; for (i = 0; i < codec->num_pcms; i++) { err = snd_hda_create_spdif_out_ctls(codec, spec->cvts[i].cvt_nid, spec->cvts[i].cvt_nid); spec->cvts[0].cvt_nid, spec->cvts[0].cvt_nid); if (err < 0) return err; err = simple_hdmi_build_jack(codec, i); if (err < 0) return err; } return 0; return simple_hdmi_build_jack(codec, 0); } static int simple_playback_init(struct hda_codec *codec) { struct hdmi_spec *spec = codec->spec; int i; hda_nid_t pin = spec->pins[0].pin_nid; for (i = 0; i < spec->num_pins; i++) { hda_nid_t pin = spec->pins[i].pin_nid; snd_hda_codec_write(codec, pin, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); /* some codecs require to unmute the pin */ if (get_wcaps(codec, pin) & AC_WCAP_OUT_AMP) snd_hda_codec_write(codec, pin, 0, AC_VERB_SET_AMP_GAIN_MUTE, snd_hda_codec_write(codec, pin, 0, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); snd_hda_jack_detect_enable(codec, pin, pin); } snd_hda_jack_report_sync(codec); return 0; } Loading Loading
sound/pci/hda/patch_hdmi.c +27 −42 Original line number Diff line number Diff line Loading @@ -1364,26 +1364,22 @@ static int simple_playback_build_pcms(struct hda_codec *codec) { struct hdmi_spec *spec = codec->spec; struct hda_pcm *info = spec->pcm_rec; int i; codec->num_pcms = spec->num_cvts; codec->pcm_info = info; for (i = 0; i < codec->num_pcms; i++, info++) { unsigned int chans; struct hda_pcm_stream *pstr; chans = get_wcaps(codec, spec->cvts[i].cvt_nid); codec->num_pcms = 1; codec->pcm_info = info; chans = get_wcaps(codec, spec->cvts[0].cvt_nid); chans = get_wcaps_channels(chans); info->name = get_hdmi_pcm_name(i); info->name = get_hdmi_pcm_name(0); info->pcm_type = HDA_PCM_TYPE_HDMI; pstr = &info->stream[SNDRV_PCM_STREAM_PLAYBACK]; *pstr = spec->pcm_playback; pstr->nid = spec->cvts[i].cvt_nid; pstr->nid = spec->cvts[0].cvt_nid; if (pstr->channels_max <= 2 && chans && chans <= 16) pstr->channels_max = chans; } return 0; } Loading @@ -1405,38 +1401,27 @@ static int simple_playback_build_controls(struct hda_codec *codec) { struct hdmi_spec *spec = codec->spec; int err; int i; for (i = 0; i < codec->num_pcms; i++) { err = snd_hda_create_spdif_out_ctls(codec, spec->cvts[i].cvt_nid, spec->cvts[i].cvt_nid); spec->cvts[0].cvt_nid, spec->cvts[0].cvt_nid); if (err < 0) return err; err = simple_hdmi_build_jack(codec, i); if (err < 0) return err; } return 0; return simple_hdmi_build_jack(codec, 0); } static int simple_playback_init(struct hda_codec *codec) { struct hdmi_spec *spec = codec->spec; int i; hda_nid_t pin = spec->pins[0].pin_nid; for (i = 0; i < spec->num_pins; i++) { hda_nid_t pin = spec->pins[i].pin_nid; snd_hda_codec_write(codec, pin, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT); /* some codecs require to unmute the pin */ if (get_wcaps(codec, pin) & AC_WCAP_OUT_AMP) snd_hda_codec_write(codec, pin, 0, AC_VERB_SET_AMP_GAIN_MUTE, snd_hda_codec_write(codec, pin, 0, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); snd_hda_jack_detect_enable(codec, pin, pin); } snd_hda_jack_report_sync(codec); return 0; } Loading