CHROMIUM: ALSA: ASoC: exynos hdmi - fix audio transfer on unplug
authorYuly Novikov <ynovikov@chromium.org>
Tue, 14 May 2013 20:59:01 +0000 (16:59 -0400)
committerChromeBot <chrome-bot@google.com>
Tue, 14 May 2013 23:38:20 +0000 (16:38 -0700)
commitc17dd45a794c63db0b66faa2e3eddff3104cd6d0
tree786d26bdf9da5a60209cb0a8bd46cb0a0013e5b9
parent10d31b935f26abbfbe7c929c43c2817e2eaeaa80
CHROMIUM: ALSA: ASoC: exynos hdmi - fix audio transfer on unplug

Because hotplug handling timeout was increased,
it is no longer safe to read HDMI_MODE_SEL in hdmi_audio_hotplug_func,
since HDMI might be off at that time.

This broke transferring audio to internal speakers on HDMI unplug,
since bogus value was read.

So, move the code that handles DVI plugging inside "if (plugged)",
where reading HDMI registers is safe, since it is powered on.

BUG=chromium:222145,chromium:239641
TEST=Various HDMI/DVI plug/unplug scenarios, the most complex being:
play music, plug HDMI, suspend, unplug HDMI, plug DVI, resume,
listen to sound on internal speakers.

Signed-off-by: Yuly Novikov <ynovikov@chromium.org>
Change-Id: I9d27d0e388f444756576e643e20811901c6afe85
Reviewed-on: https://gerrit.chromium.org/gerrit/51178
Reviewed-by: Dylan Reid <dgreid@chromium.org>
sound/soc/samsung/hdmi_audio.c