Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170348
b: refs/heads/master
c: 5779191
h: refs/heads/master
v: v3
  • Loading branch information
Wu Fengguang authored and Takashi Iwai committed Nov 18, 2009
1 parent 8c4d48b commit a871a9a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 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: 848de598eef9603d6f2c174f90fded4e63ac5e23
refs/heads/master: 5779191e0efd851fb0d54698c13cb4f5325caca6
28 changes: 26 additions & 2 deletions trunk/sound/pci/hda/patch_intelhdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,31 @@ static void intel_hdmi_unsol_event(struct hda_codec *codec, unsigned int res)
* Callbacks
*/

static void hdmi_setup_stream(struct hda_codec *codec, hda_nid_t nid,
u32 stream_tag, int format)
{
int tag;
int fmt;

tag = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONV, 0) >> 4;
fmt = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_STREAM_FORMAT, 0);

snd_printdd("hdmi_setup_stream: "
"NID=0x%x, %sstream=0x%x, %sformat=0x%x\n",
nid,
tag == stream_tag ? "" : "new-",
stream_tag,
fmt == format ? "" : "new-",
format);

if (tag != stream_tag)
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_CHANNEL_STREAMID, stream_tag << 4);
if (fmt != format)
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_STREAM_FORMAT, format);
}

static int intel_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
unsigned int stream_tag,
Expand All @@ -783,15 +808,14 @@ static int intel_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,

hdmi_setup_audio_infoframe(codec, hinfo->nid, substream);

snd_hda_codec_setup_stream(codec, hinfo->nid, stream_tag, 0, format);
hdmi_setup_stream(codec, hinfo->nid, stream_tag, format);
return 0;
}

static int intel_hdmi_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream)
{
snd_hda_codec_cleanup_stream(codec, hinfo->nid);
return 0;
}

Expand Down

0 comments on commit a871a9a

Please sign in to comment.