intelhdmi - dont power off HDA link
authorWu Fengguang <fengguang.wu@intel.com>
Fri, 11 Dec 2009 12:15:11 +0000 (20:15 +0800)
committerTakashi Iwai <tiwai@suse.de>
Fri, 11 Dec 2009 13:06:18 +0000 (14:06 +0100)
For codecs without EPSS support (G45/IbexPeak), the hotplug event will
be lost if the HDA is powered off during the time. After that the pin
presence detection verb returns inaccurate info.

So always power-on HDA link for !EPSS codecs.

KarL offers the fact and Takashi recommends to flag hda_bus. Thanks!

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_codec.h
sound/pci/hda/hda_intel.c
sound/pci/hda/patch_intelhdmi.c

index 9000d52fcccaa76d39ac33fbaae0ff6e32786e52..1d541b7f5547cde1e3871d45e44e7cae4931a435 100644 (file)
@@ -639,6 +639,7 @@ struct hda_bus {
        unsigned int rirb_error:1;      /* error in codec communication */
        unsigned int response_reset:1;  /* controller was reset */
        unsigned int in_reset:1;        /* during reset operation */
+       unsigned int power_keep_link_on:1; /* don't power off HDA link */
 };
 
 /*
index efcc4f7c57f20f7a85f159588b83daa784451a08..e54420e691ae7c9e41da79f26ee277b2f0786357 100644 (file)
@@ -2082,7 +2082,8 @@ static void azx_power_notify(struct hda_bus *bus)
        }
        if (power_on)
                azx_init_chip(chip);
-       else if (chip->running && power_save_controller)
+       else if (chip->running && power_save_controller &&
+                !bus->power_keep_link_on)
                azx_stop_chip(chip);
 }
 #endif /* CONFIG_SND_HDA_POWER_SAVE */
index 3990182777ee7a223a5f45c7c6b33fd8bba7f4d5..918f40378d5232e929b3034ac208164d338c3557 100644 (file)
@@ -391,6 +391,17 @@ static int intel_hdmi_parse_codec(struct hda_codec *codec)
                }
        }
 
+       /*
+        * G45/IbexPeak don't support EPSS: the unsolicited pin hot plug event
+        * can be lost and presence sense verb will become inaccurate if the
+        * HDA link is powered off at hot plug or hw initialization time.
+        */
+#ifdef CONFIG_SND_HDA_POWER_SAVE
+       if (!(snd_hda_param_read(codec, codec->afg, AC_PAR_POWER_STATE) &
+             AC_PWRST_EPSS))
+               codec->bus->power_keep_link_on = 1;
+#endif
+
        return 0;
 }