ALSA: hda/hdmi - Don't report spurious jack state changes
authorTakashi Iwai <tiwai@suse.de>
Wed, 17 Jul 2019 12:30:23 +0000 (14:30 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 22 Jul 2019 07:13:56 +0000 (09:13 +0200)
commit551626ec0ad28dc43cae3094c35be7088cc625ab
treef71b904072d30b12cf98f3d28f21202909276791
parent5f9e832c137075045d15cd6899ab0505cfb2ca4b
ALSA: hda/hdmi - Don't report spurious jack state changes

The HDMI jack handling reports the state change always via
snd_jack_report() whenever hdmi_present_sense() is called, even if the
state itself doesn't change from the previous time.  This is mostly
harmless but still a bit confusing to user-space.

This patch reduces such spurious jack state changes and reports only
when the state really changed.  Also, as a minor optimization, avoid
overwriting the pin ELD data when the state is identical.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_hdmi.c