Commit 2d1b439b authored by Wu Fengguang's avatar Wu Fengguang Committed by Takashi Iwai

ALSA: hda - move eld->spk_alloc fixup to hdmi_update_eld()

It looks more natural and saves two lines of code.
Signed-off-by: default avatarWu Fengguang <fengguang.wu@intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 744626da
...@@ -297,6 +297,14 @@ static int hdmi_update_eld(struct hdmi_eld *e, ...@@ -297,6 +297,14 @@ static int hdmi_update_eld(struct hdmi_eld *e,
buf + ELD_FIXED_BYTES + mnl + 3 * i); buf + ELD_FIXED_BYTES + mnl + 3 * i);
} }
/*
* HDMI sink's ELD info cannot always be retrieved for now, e.g.
* in console or for audio devices. Assume the highest speakers
* configuration, to _not_ prohibit multi-channel audio playback.
*/
if (!e->spk_alloc)
e->spk_alloc = 0xffff;
e->eld_valid = true; e->eld_valid = true;
return 0; return 0;
......
...@@ -757,7 +757,6 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) ...@@ -757,7 +757,6 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
int pd = !!(res & AC_UNSOL_RES_PD); int pd = !!(res & AC_UNSOL_RES_PD);
int eldv = !!(res & AC_UNSOL_RES_ELDV); int eldv = !!(res & AC_UNSOL_RES_ELDV);
int pin_idx; int pin_idx;
struct hdmi_eld *eld;
printk(KERN_INFO printk(KERN_INFO
"HDMI hot plug event: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n", "HDMI hot plug event: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n",
...@@ -766,17 +765,8 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) ...@@ -766,17 +765,8 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
pin_idx = pin_nid_to_pin_index(spec, pin_nid); pin_idx = pin_nid_to_pin_index(spec, pin_nid);
if (pin_idx < 0) if (pin_idx < 0)
return; return;
eld = &spec->pins[pin_idx].sink_eld;
hdmi_present_sense(&spec->pins[pin_idx], true); hdmi_present_sense(&spec->pins[pin_idx], true);
/*
* HDMI sink's ELD info cannot always be retrieved for now, e.g.
* in console or for audio devices. Assume the highest speakers
* configuration, to _not_ prohibit multi-channel audio playback.
*/
if (!eld->spk_alloc)
eld->spk_alloc = 0xffff;
} }
static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res) static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res)
......
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