Commit 81bf31e2 authored by Wu Fengguang's avatar Wu Fengguang Committed by Takashi Iwai

ALSA: intelhdmi - sticky channel count

Don't change channel count if not necessary.
Signed-off-by: default avatarWu Fengguang <fengguang.wu@intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 5779191e
...@@ -422,24 +422,18 @@ static void hdmi_stop_infoframe_trans(struct hda_codec *codec, ...@@ -422,24 +422,18 @@ static void hdmi_stop_infoframe_trans(struct hda_codec *codec,
AC_DIPXMIT_DISABLE); AC_DIPXMIT_DISABLE);
} }
#ifdef CONFIG_SND_DEBUG_VERBOSE
static int hdmi_get_channel_count(struct hda_codec *codec, hda_nid_t nid) static int hdmi_get_channel_count(struct hda_codec *codec, hda_nid_t nid)
{ {
return 1 + snd_hda_codec_read(codec, nid, 0, return 1 + snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_CVT_CHAN_COUNT, 0); AC_VERB_GET_CVT_CHAN_COUNT, 0);
} }
#endif
static void hdmi_set_channel_count(struct hda_codec *codec, static void hdmi_set_channel_count(struct hda_codec *codec,
hda_nid_t nid, int chs) hda_nid_t nid, int chs)
{ {
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CVT_CHAN_COUNT, chs - 1);
#ifdef CONFIG_SND_DEBUG_VERBOSE
if (chs != hdmi_get_channel_count(codec, nid)) if (chs != hdmi_get_channel_count(codec, nid))
snd_printd(KERN_INFO "HDMI channel count: expect %d, get %d\n", snd_hda_codec_write(codec, nid, 0,
chs, hdmi_get_channel_count(codec, nid)); AC_VERB_SET_CVT_CHAN_COUNT, chs - 1);
#endif
} }
static void hdmi_debug_channel_mapping(struct hda_codec *codec, hda_nid_t nid) static void hdmi_debug_channel_mapping(struct hda_codec *codec, hda_nid_t 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