aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorAnssi Hannula <anssi.hannula@iki.fi>2014-10-19 12:25:19 -0400
committerTakashi Iwai <tiwai@suse.de>2014-10-20 01:58:34 -0400
commit6acce400d9daf1353fbf497302670c90a3205e1d (patch)
tree6b9f2a74e4e941933681cd282adae29e76a1f69b /sound
parentf0b127fbfdc8756eba7437ab668f3169280bd358 (diff)
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: Anssi Hannula <anssi.hannula@iki.fi> Cc: David Henningsson <david.henningsson@canonical.com> Cc: <stable@vger.kernel.org> # 3.9+ Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_hdmi.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 39862e98551c..9dc9cf8c90e9 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1583,19 +1583,22 @@ static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
1583 } 1583 }
1584 } 1584 }
1585 1585
1586 if (pin_eld->eld_valid && !eld->eld_valid) { 1586 if (pin_eld->eld_valid != eld->eld_valid)
1587 update_eld = true;
1588 eld_changed = true; 1587 eld_changed = true;
1589 } 1588
1589 if (pin_eld->eld_valid && !eld->eld_valid)
1590 update_eld = true;
1591
1590 if (update_eld) { 1592 if (update_eld) {
1591 bool old_eld_valid = pin_eld->eld_valid; 1593 bool old_eld_valid = pin_eld->eld_valid;
1592 pin_eld->eld_valid = eld->eld_valid; 1594 pin_eld->eld_valid = eld->eld_valid;
1593 eld_changed = pin_eld->eld_size != eld->eld_size || 1595 if (pin_eld->eld_size != eld->eld_size ||
1594 memcmp(pin_eld->eld_buffer, eld->eld_buffer, 1596 memcmp(pin_eld->eld_buffer, eld->eld_buffer,
1595 eld->eld_size) != 0; 1597 eld->eld_size) != 0) {
1596 if (eld_changed)
1597 memcpy(pin_eld->eld_buffer, eld->eld_buffer, 1598 memcpy(pin_eld->eld_buffer, eld->eld_buffer,
1598 eld->eld_size); 1599 eld->eld_size);
1600 eld_changed = true;
1601 }
1599 pin_eld->eld_size = eld->eld_size; 1602 pin_eld->eld_size = eld->eld_size;
1600 pin_eld->info = eld->info; 1603 pin_eld->info = eld->info;
1601 1604