diff options
Diffstat (limited to 'sound/pci/hda/patch_hdmi.c')
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 641408dc28c0..69b928449789 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -877,6 +877,8 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, | |||
877 | struct hdmi_eld *eld; | 877 | struct hdmi_eld *eld; |
878 | struct hdmi_spec_per_cvt *per_cvt = NULL; | 878 | struct hdmi_spec_per_cvt *per_cvt = NULL; |
879 | 879 | ||
880 | hinfo->nid = 0; /* clear the leftover value */ | ||
881 | |||
880 | /* Validate hinfo */ | 882 | /* Validate hinfo */ |
881 | pin_idx = hinfo_to_pin_index(spec, hinfo); | 883 | pin_idx = hinfo_to_pin_index(spec, hinfo); |
882 | if (snd_BUG_ON(pin_idx < 0)) | 884 | if (snd_BUG_ON(pin_idx < 0)) |
@@ -1161,9 +1163,9 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo, | |||
1161 | return hdmi_setup_stream(codec, cvt_nid, pin_nid, stream_tag, format); | 1163 | return hdmi_setup_stream(codec, cvt_nid, pin_nid, stream_tag, format); |
1162 | } | 1164 | } |
1163 | 1165 | ||
1164 | static int generic_hdmi_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, | 1166 | static int hdmi_pcm_close(struct hda_pcm_stream *hinfo, |
1165 | struct hda_codec *codec, | 1167 | struct hda_codec *codec, |
1166 | struct snd_pcm_substream *substream) | 1168 | struct snd_pcm_substream *substream) |
1167 | { | 1169 | { |
1168 | struct hdmi_spec *spec = codec->spec; | 1170 | struct hdmi_spec *spec = codec->spec; |
1169 | int cvt_idx, pin_idx; | 1171 | int cvt_idx, pin_idx; |
@@ -1171,8 +1173,6 @@ static int generic_hdmi_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, | |||
1171 | struct hdmi_spec_per_pin *per_pin; | 1173 | struct hdmi_spec_per_pin *per_pin; |
1172 | int pinctl; | 1174 | int pinctl; |
1173 | 1175 | ||
1174 | snd_hda_codec_cleanup_stream(codec, hinfo->nid); | ||
1175 | |||
1176 | if (hinfo->nid) { | 1176 | if (hinfo->nid) { |
1177 | cvt_idx = cvt_nid_to_cvt_index(spec, hinfo->nid); | 1177 | cvt_idx = cvt_nid_to_cvt_index(spec, hinfo->nid); |
1178 | if (snd_BUG_ON(cvt_idx < 0)) | 1178 | if (snd_BUG_ON(cvt_idx < 0)) |
@@ -1195,14 +1195,13 @@ static int generic_hdmi_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, | |||
1195 | pinctl & ~PIN_OUT); | 1195 | pinctl & ~PIN_OUT); |
1196 | snd_hda_spdif_ctls_unassign(codec, pin_idx); | 1196 | snd_hda_spdif_ctls_unassign(codec, pin_idx); |
1197 | } | 1197 | } |
1198 | |||
1199 | return 0; | 1198 | return 0; |
1200 | } | 1199 | } |
1201 | 1200 | ||
1202 | static const struct hda_pcm_ops generic_ops = { | 1201 | static const struct hda_pcm_ops generic_ops = { |
1203 | .open = hdmi_pcm_open, | 1202 | .open = hdmi_pcm_open, |
1203 | .close = hdmi_pcm_close, | ||
1204 | .prepare = generic_hdmi_playback_pcm_prepare, | 1204 | .prepare = generic_hdmi_playback_pcm_prepare, |
1205 | .cleanup = generic_hdmi_playback_pcm_cleanup, | ||
1206 | }; | 1205 | }; |
1207 | 1206 | ||
1208 | static int generic_hdmi_build_pcms(struct hda_codec *codec) | 1207 | static int generic_hdmi_build_pcms(struct hda_codec *codec) |
@@ -1221,6 +1220,7 @@ static int generic_hdmi_build_pcms(struct hda_codec *codec) | |||
1221 | pstr = &info->stream[SNDRV_PCM_STREAM_PLAYBACK]; | 1220 | pstr = &info->stream[SNDRV_PCM_STREAM_PLAYBACK]; |
1222 | pstr->substreams = 1; | 1221 | pstr->substreams = 1; |
1223 | pstr->ops = generic_ops; | 1222 | pstr->ops = generic_ops; |
1223 | pstr->nid = 1; /* FIXME: just for avoiding a debug WARNING */ | ||
1224 | /* other pstr fields are set in open */ | 1224 | /* other pstr fields are set in open */ |
1225 | } | 1225 | } |
1226 | 1226 | ||