--- /dev/null
+From faafd03d23c913633d2ef7e6ffebdce01b164409 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 29 Mar 2016 12:29:24 +0200
+Subject: ALSA: hda - Clear the leftover component assignment at snd_hdac_i915_exit()
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit faafd03d23c913633d2ef7e6ffebdce01b164409 upstream.
+
+The commit [d745f5e7b8b2: ALSA: hda - Add the pin / port mapping on
+Intel ILK and VLV] introduced a WARN_ON() to check the pointer for
+avoiding the double initializations. But hdac_acomp pointer wasn't
+cleared at snd_hdac_i915_exit(), thus after reloading the HD-audio
+driver, it may result in the false positive warning. This patch makes
+sure to clear the leftover pointer at exit.
+
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94736
+Reported-by: Daniela Doras-prodan <daniela.doras-prodan@intel.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Cc: Kouta Okamoto <kouta.okamoto@toshiba.co.jp>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/hda/hdac_i915.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/hda/hdac_i915.c
++++ b/sound/hda/hdac_i915.c
+@@ -273,6 +273,7 @@ int snd_hdac_i915_exit(struct hdac_bus *
+
+ kfree(acomp);
+ bus->audio_component = NULL;
++ hdac_acomp = NULL;
+
+ return 0;
+ }
--- /dev/null
+From bed2e98e1f4db8b827df507abc30be7b11b0613d Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 20 Jan 2016 15:00:26 +0100
+Subject: ALSA: hda - Degrade i915 binding failure message
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit bed2e98e1f4db8b827df507abc30be7b11b0613d upstream.
+
+Currently HD-audio driver on Intel Skylake or Broxteon gives an error
+message when binding with i915 audio component fails. However, this
+isn't any serious error on a system without Intel graphics. Indeed
+there are such systems, where a third-party codec (e.g. Creative) is
+put on the mobo while using other discrete GPU (e.g. Nvidia).
+Printing a kernel "error" message is overreaction in such a case.
+
+This patch downgrades the print level for that message. For systems
+that mandate the i915 binding (e.g. Haswell or Broadwell HDMI/DP),
+another kernel error message is shown in addition to make clear what
+went wrong.
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=111021
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Cc: Kouta Okamoto <kouta.okamoto@toshiba.co.jp>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/hda/hdac_i915.c | 2 +-
+ sound/pci/hda/hda_intel.c | 6 ++++--
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+--- a/sound/hda/hdac_i915.c
++++ b/sound/hda/hdac_i915.c
+@@ -240,7 +240,7 @@ out_master_del:
+ out_err:
+ kfree(acomp);
+ bus->audio_component = NULL;
+- dev_err(dev, "failed to add i915 component master (%d)\n", ret);
++ dev_info(dev, "failed to add i915 component master (%d)\n", ret);
+
+ return ret;
+ }
+--- a/sound/pci/hda/hda_intel.c
++++ b/sound/pci/hda/hda_intel.c
+@@ -2088,9 +2088,11 @@ static int azx_probe_continue(struct azx
+ * for other chips, still continue probing as other
+ * codecs can be on the same link.
+ */
+- if (CONTROLLER_IN_GPU(pci))
++ if (CONTROLLER_IN_GPU(pci)) {
++ dev_err(chip->card->dev,
++ "HSW/BDW HD-audio HDMI/DP requires binding with gfx driver\n");
+ goto out_free;
+- else
++ } else
+ goto skip_i915;
+ }
+
--- /dev/null
+From 6603249dcdbb6aab0b726bdf372d6f20c0d2d611 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 1 Dec 2015 16:49:35 +0100
+Subject: ALSA: hda - Enable audio component for old Intel PCH devices
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 6603249dcdbb6aab0b726bdf372d6f20c0d2d611 upstream.
+
+As i915 graphics driver provides the notification via audio component,
+not only the currently implemented HSW+ and VLV+ platforms but also
+all other PCH-based platforms (e.g. Cougar Point, Panther Point, etc)
+can use this infrastructure. It'll improve the reliability and the
+power consumption significantly, especially once when we implement the
+ELD notification via component. As a preliminary, this patch enables
+the usage of audio component for all PCH platforms.
+
+The HDA controller just needs to set AZX_DCAPS_I915_POWERWELL flag
+appropriately. The name of the flag is a bit confusing, but this
+actually works even on the chips without the powerwell but accesses
+only the other component ops.
+
+In the HDMI/DP codec driver side, we just need to register/unregister
+the notifier for such chips. This can be identified by checking the
+audio_component field in the assigned hdac_bus.
+
+One caveat is that PCH for Haswell and Broadwell must not be bound
+with i915 audio component, as there are dedicated HD-audio HDMI
+controllers on these platforms. Ditto for Poulsbo and Oaktrail as
+they use gma500 graphics, not i915.
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Cc: Kouta Okamoto <kouta.okamoto@toshiba.co.jp>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/hda_intel.c | 14 ++++++++++----
+ sound/pci/hda/patch_hdmi.c | 6 ++++--
+ 2 files changed, 14 insertions(+), 6 deletions(-)
+
+--- a/sound/pci/hda/hda_intel.c
++++ b/sound/pci/hda/hda_intel.c
+@@ -286,13 +286,19 @@ enum {
+ (AZX_DCAPS_OLD_SSYNC | AZX_DCAPS_NO_ALIGN_BUFSIZE)
+
+ /* quirks for Intel PCH */
+-#define AZX_DCAPS_INTEL_PCH_NOPM \
++#define AZX_DCAPS_INTEL_PCH_BASE \
+ (AZX_DCAPS_NO_ALIGN_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY |\
+ AZX_DCAPS_REVERSE_ASSIGN | AZX_DCAPS_SNOOP_TYPE(SCH))
+
++/* PCH up to IVB; bound with i915 audio component for HDMI, no runtime PM */
++#define AZX_DCAPS_INTEL_PCH_NOPM \
++ (AZX_DCAPS_INTEL_PCH_BASE | AZX_DCAPS_I915_POWERWELL)
++
++/* PCH for HSW/BDW; with runtime PM, but no i915 binding */
+ #define AZX_DCAPS_INTEL_PCH \
+- (AZX_DCAPS_INTEL_PCH_NOPM | AZX_DCAPS_PM_RUNTIME)
++ (AZX_DCAPS_INTEL_PCH_BASE | AZX_DCAPS_PM_RUNTIME)
+
++/* HSW HDMI */
+ #define AZX_DCAPS_INTEL_HASWELL \
+ (/*AZX_DCAPS_ALIGN_BUFSIZE |*/ AZX_DCAPS_COUNT_LPIB_DELAY |\
+ AZX_DCAPS_PM_RUNTIME | AZX_DCAPS_I915_POWERWELL |\
+@@ -2271,10 +2277,10 @@ static const struct pci_device_id azx_id
+ .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM },
+ /* Poulsbo */
+ { PCI_DEVICE(0x8086, 0x811b),
+- .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM },
++ .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_BASE },
+ /* Oaktrail */
+ { PCI_DEVICE(0x8086, 0x080a),
+- .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM },
++ .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_BASE },
+ /* BayTrail */
+ { PCI_DEVICE(0x8086, 0x0f04),
+ .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_BAYTRAIL },
+--- a/sound/pci/hda/patch_hdmi.c
++++ b/sound/pci/hda/patch_hdmi.c
+@@ -154,6 +154,8 @@ struct hdmi_spec {
+ struct i915_audio_component_audio_ops i915_audio_ops;
+ };
+
++#define codec_has_acomp(codec) \
++ ((codec)->bus->core.audio_component != NULL)
+
+ struct hdmi_audio_infoframe {
+ u8 type; /* 0x84 */
+@@ -2222,7 +2224,7 @@ static void generic_hdmi_free(struct hda
+ struct hdmi_spec *spec = codec->spec;
+ int pin_idx;
+
+- if (is_haswell_plus(codec) || is_valleyview_plus(codec))
++ if (codec_has_acomp(codec))
+ snd_hdac_i915_register_notifier(NULL);
+
+ for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
+@@ -2395,7 +2397,7 @@ static int patch_generic_hdmi(struct hda
+ is_broxton(codec))
+ codec->core.link_power_control = 1;
+
+- if (is_haswell_plus(codec) || is_valleyview_plus(codec)) {
++ if (codec_has_acomp(codec)) {
+ codec->depop_delay = 0;
+ spec->i915_audio_ops.audio_ptr = codec;
+ spec->i915_audio_ops.pin_eld_notify = intel_pin_eld_notify;
--- /dev/null
+From 97cc2ed27e5a168cf423f67c3bc7c6cc41d12f82 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 29 Mar 2016 18:48:07 +0200
+Subject: ALSA: hda - Fix yet another i915 pointer leftover in error path
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 97cc2ed27e5a168cf423f67c3bc7c6cc41d12f82 upstream.
+
+The hdac_acomp object in hdac_i915.c is left as assigned even after
+binding with i915 actually fails, and this leads to the WARN_ON() at
+the next load of the module.
+
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94736
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Cc: Kouta Okamoto <kouta.okamoto@toshiba.co.jp>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/hda/hdac_i915.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/hda/hdac_i915.c
++++ b/sound/hda/hdac_i915.c
+@@ -240,6 +240,7 @@ out_master_del:
+ out_err:
+ kfree(acomp);
+ bus->audio_component = NULL;
++ hdac_acomp = NULL;
+ dev_info(dev, "failed to add i915 component master (%d)\n", ret);
+
+ return ret;
thermal-hisilicon-handle-return-value-of-clk_prepare_enable.patch
mips-math-emu-fix-final-emulation-phase-for-certain-instructions.patch
revert-bluetooth-btusb-driver-to-enable-the-usb-wakeup.patch
+alsa-hda-clear-the-leftover-component-assignment-at-snd_hdac_i915_exit.patch
+alsa-hda-degrade-i915-binding-failure-message.patch
+alsa-hda-fix-yet-another-i915-pointer-leftover-in-error-path.patch
+alsa-hda-enable-audio-component-for-old-intel-pch-devices.patch