Skip to content

Commit

Permalink
ALSA: hda - Fix conflict of sticky PCM parameter in HDMI codecs
Browse files Browse the repository at this point in the history
Intel and Nvidia HDMI codec drivers have own implementations of
sticky PCM parameters.  Now HD-audio core part already has it,
thus both setups conflict.  The fix is simply remove the part in
patch_intelhdmi.c and patch_nvhdmi.c and simply call
snd_hda_codec_setup_stream() as usual.

Reported-and-tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Aug 20, 2010
1 parent 274714f commit 4f34760
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 36 deletions.
21 changes: 1 addition & 20 deletions sound/pci/hda/patch_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,6 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t nid,
u32 stream_tag, int format)
{
struct hdmi_spec *spec = codec->spec;
int tag;
int fmt;
int pinctl;
int new_pinctl = 0;
int i;
Expand Down Expand Up @@ -745,24 +743,7 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t nid,
return -EINVAL;
}

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);
snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format);
return 0;
}

Expand Down
8 changes: 0 additions & 8 deletions sound/pci/hda/patch_intelhdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,12 @@ static int intel_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
return hdmi_setup_stream(codec, hinfo->nid, stream_tag, format);
}

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

static struct hda_pcm_stream intel_hdmi_pcm_playback = {
.substreams = 1,
.channels_min = 2,
.ops = {
.open = hdmi_pcm_open,
.prepare = intel_hdmi_playback_pcm_prepare,
.cleanup = intel_hdmi_playback_pcm_cleanup,
},
};

Expand Down
8 changes: 0 additions & 8 deletions sound/pci/hda/patch_nvhdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,6 @@ static int nvhdmi_dig_playback_pcm_prepare_8ch(struct hda_pcm_stream *hinfo,
return 0;
}

static int nvhdmi_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream)
{
return 0;
}

static int nvhdmi_dig_playback_pcm_prepare_2ch(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
unsigned int stream_tag,
Expand All @@ -350,7 +343,6 @@ static struct hda_pcm_stream nvhdmi_pcm_digital_playback_8ch_89 = {
.ops = {
.open = hdmi_pcm_open,
.prepare = nvhdmi_dig_playback_pcm_prepare_8ch_89,
.cleanup = nvhdmi_playback_pcm_cleanup,
},
};

Expand Down

0 comments on commit 4f34760

Please sign in to comment.