CHROMIUM: ALSA: ASoC: exynos hdmi - disable audio in DVI mode
authorYuly Novikov <ynovikov@chromium.org>
Thu, 9 May 2013 22:47:53 +0000 (18:47 -0400)
committerChromeBot <chrome-bot@google.com>
Fri, 10 May 2013 18:12:54 +0000 (11:12 -0700)
exynos-hdmi-audio used to configure HDMI to send ACR and AUI infoframes
even when DVI sink was plugged using HDMI-DVI cable.
This would cause monitor to go to sleep.

So, don't configure audio if HDMI is in DVI mode,
assuming the graphics driver already disabled it.

Also, if HDMI audio jack hotplugging was previously reported,
report that it was unplugged when DVI mode is detected.

BUG=chromium:222145
TEST=Unplug/plug HDMI-DVI cable, observe monitor working properly.
     Boot with HDMI-HDMI cable plugged in, unplug/plug,
     play sound and hear it on monitor's speakers.

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

index 446925d..7eef7c8 100644 (file)
@@ -438,6 +438,21 @@ static void hdmi_audio_hotplug_func(struct work_struct *work)
                        __LINE__, __func__, atomic_read(&ctx->plugged));
 
        plugged = atomic_read(&ctx->plugged);
+
+       if (hdmi_reg_read(ctx, HDMI_MODE_SEL) & HDMI_DVI_MODE_EN) {
+               /* If HDMI operates in DVI mode,
+                * for audio purposes it is the same as nothing plugged.
+                * Unfortunately, hotplug interrupt is received multiple times,
+                * and HDMI_DVI_MODE_EN is set only in the last one.
+                * So, we have already reported that HDMI audio was plugged.
+                * So, update ctx, report now that it was unplugged and return.
+                */
+               atomic_set(&ctx->plugged, 0);
+               if (plugged && ctx->plugin.jack_cb)
+                       ctx->plugin.jack_cb(false);
+               return;
+       }
+
        if (plugged) {
                hdmi_audio_control(ctx, false);
                hdmi_conf_init(ctx);