Skip to content

Commit

Permalink
ALSA: hda - Fix superfluous HDMI jack repoll
Browse files Browse the repository at this point in the history
The recent commit [e90247f: ALSA: hda - Split ELD update code
from hdmi_present_sense()] rewrote the HDMI jack handling code, but a
slight behavior change sneaked in unexpectedly.  When the jack isn't
connected, it tries repoll unnecessarily.

This patch addresses the flaw, to the right behavior as before.

Fixes: e90247f ('ALSA: hda - Split ELD update code from hdmi_present_sense()')
Reported-and-tested-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Dec 10, 2015
1 parent 5591311 commit 9a5e523
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sound/pci/hda/patch_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,7 @@ static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
*/
int present;
bool ret;
bool do_repoll = false;

snd_hda_power_up_pm(codec);
present = snd_hda_pin_sense(codec, pin_nid);
Expand All @@ -1629,9 +1630,11 @@ static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
eld->eld_size) < 0)
eld->eld_valid = false;
}
if (!eld->eld_valid && repoll)
do_repoll = true;
}

if (!eld->eld_valid && repoll)
if (do_repoll)
schedule_delayed_work(&per_pin->work, msecs_to_jiffies(300));
else
update_eld(codec, per_pin, eld);
Expand Down

0 comments on commit 9a5e523

Please sign in to comment.