Commit 6acce400 authored by Anssi Hannula's avatar Anssi Hannula Committed by Takashi Iwai

ALSA: hda - hdmi: Fix missing ELD change event on plug/unplug

The ELD ALSA control change event is sent by hdmi_present_sense() when
eld_changed is true.

Currently, it is only true when the ELD buffer contents have been
modified. However, the user-visible ELD controls also change to a
zero-length value and back when eld_valid is unset/set, and no event is
currently sent in such cases (such as when unplugging or replugging a
sink).

Fix the code to always set eld_changed if eld_valid value is changed,
and therefore to always send the change event when the user-visible
value changes.
Signed-off-by: default avatarAnssi Hannula <anssi.hannula@iki.fi>
Cc: David Henningsson <david.henningsson@canonical.com>
Cc: <stable@vger.kernel.org> # 3.9+
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent f0b127fb
...@@ -1583,19 +1583,22 @@ static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll) ...@@ -1583,19 +1583,22 @@ static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
} }
} }
if (pin_eld->eld_valid && !eld->eld_valid) { if (pin_eld->eld_valid != eld->eld_valid)
update_eld = true;
eld_changed = true; eld_changed = true;
}
if (pin_eld->eld_valid && !eld->eld_valid)
update_eld = true;
if (update_eld) { if (update_eld) {
bool old_eld_valid = pin_eld->eld_valid; bool old_eld_valid = pin_eld->eld_valid;
pin_eld->eld_valid = eld->eld_valid; pin_eld->eld_valid = eld->eld_valid;
eld_changed = pin_eld->eld_size != eld->eld_size || if (pin_eld->eld_size != eld->eld_size ||
memcmp(pin_eld->eld_buffer, eld->eld_buffer, memcmp(pin_eld->eld_buffer, eld->eld_buffer,
eld->eld_size) != 0; eld->eld_size) != 0) {
if (eld_changed)
memcpy(pin_eld->eld_buffer, eld->eld_buffer, memcpy(pin_eld->eld_buffer, eld->eld_buffer,
eld->eld_size); eld->eld_size);
eld_changed = true;
}
pin_eld->eld_size = eld->eld_size; pin_eld->eld_size = eld->eld_size;
pin_eld->info = eld->info; pin_eld->info = eld->info;
......
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