From 0896e5223f3412d6af251e7e74bb218c3ddbde0f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 25 Jan 2016 13:47:36 -0800 Subject: [PATCH] 3.10-stable patches added patches: alsa-hda-add-inverted-dmic-for-packard-bell-dots.patch alsa-hda-realtek-fix-silent-headphone-output-on-macpro-4-1-v2.patch alsa-hda-set-skl-hda-controller-power-at-freeze-and-thaw.patch alsa-rme96-fix-unexpected-volume-reset-after-rate-changes.patch --- ...-inverted-dmic-for-packard-bell-dots.patch | 31 +++++ ...nt-headphone-output-on-macpro-4-1-v2.patch | 70 ++++++++++++ ...-controller-power-at-freeze-and-thaw.patch | 85 ++++++++++++++ ...cted-volume-reset-after-rate-changes.patch | 107 ++++++++++++++++++ queue-3.10/series | 4 + 5 files changed, 297 insertions(+) create mode 100644 queue-3.10/alsa-hda-add-inverted-dmic-for-packard-bell-dots.patch create mode 100644 queue-3.10/alsa-hda-realtek-fix-silent-headphone-output-on-macpro-4-1-v2.patch create mode 100644 queue-3.10/alsa-hda-set-skl-hda-controller-power-at-freeze-and-thaw.patch create mode 100644 queue-3.10/alsa-rme96-fix-unexpected-volume-reset-after-rate-changes.patch diff --git a/queue-3.10/alsa-hda-add-inverted-dmic-for-packard-bell-dots.patch b/queue-3.10/alsa-hda-add-inverted-dmic-for-packard-bell-dots.patch new file mode 100644 index 00000000000..3edcb8d1cac --- /dev/null +++ b/queue-3.10/alsa-hda-add-inverted-dmic-for-packard-bell-dots.patch @@ -0,0 +1,31 @@ +From 02f6ff90400d055f08b0ba0b5f0707630b6faed7 Mon Sep 17 00:00:00 2001 +From: David Henningsson +Date: Mon, 7 Dec 2015 11:29:31 +0100 +Subject: ALSA: hda - Add inverted dmic for Packard Bell DOTS + +From: David Henningsson + +commit 02f6ff90400d055f08b0ba0b5f0707630b6faed7 upstream. + +On the internal mic of the Packard Bell DOTS, one channel +has an inverted signal. Add a quirk to fix this up. + +BugLink: https://bugs.launchpad.net/bugs/1523232 +Signed-off-by: David Henningsson +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_realtek.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -4446,6 +4446,7 @@ static const struct hda_fixup alc662_fix + static const struct snd_pci_quirk alc662_fixup_tbl[] = { + SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2), + SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC), ++ SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC), + SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), + SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), + SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), diff --git a/queue-3.10/alsa-hda-realtek-fix-silent-headphone-output-on-macpro-4-1-v2.patch b/queue-3.10/alsa-hda-realtek-fix-silent-headphone-output-on-macpro-4-1-v2.patch new file mode 100644 index 00000000000..30778cde140 --- /dev/null +++ b/queue-3.10/alsa-hda-realtek-fix-silent-headphone-output-on-macpro-4-1-v2.patch @@ -0,0 +1,70 @@ +From 9f660a1c43890c2cdd1f423fd73654e7ca08fe56 Mon Sep 17 00:00:00 2001 +From: Mario Kleiner +Date: Tue, 22 Dec 2015 00:45:43 +0100 +Subject: ALSA: hda/realtek - Fix silent headphone output on MacPro 4,1 (v2) + +From: Mario Kleiner + +commit 9f660a1c43890c2cdd1f423fd73654e7ca08fe56 upstream. + +Without this patch, internal speaker and line-out work, +but front headphone output jack stays silent on the +Mac Pro 4,1. + +This code path also gets executed on the MacPro 5,1 due +to identical codec SSID, but i don't know if it has any +positive or adverse effects there or not. + +(v2) Implement feedback from Takashi Iwai: Reuse + alc889_fixup_mbp_vref and just add a new nid + 0x19 for the MacPro 4,1. + +Signed-off-by: Mario Kleiner +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_realtek.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -1768,6 +1768,7 @@ enum { + ALC889_FIXUP_MBA11_VREF, + ALC889_FIXUP_MBA21_VREF, + ALC889_FIXUP_MP11_VREF, ++ ALC889_FIXUP_MP41_VREF, + ALC882_FIXUP_INV_DMIC, + ALC882_FIXUP_NO_PRIMARY_HP, + ALC887_FIXUP_ASUS_BASS, +@@ -1854,7 +1855,7 @@ static void alc889_fixup_mbp_vref(struct + const struct hda_fixup *fix, int action) + { + struct alc_spec *spec = codec->spec; +- static hda_nid_t nids[2] = { 0x14, 0x15 }; ++ static hda_nid_t nids[3] = { 0x14, 0x15, 0x19 }; + int i; + + if (action != HDA_FIXUP_ACT_INIT) +@@ -2128,6 +2129,12 @@ static const struct hda_fixup alc882_fix + .chained = true, + .chain_id = ALC885_FIXUP_MACPRO_GPIO, + }, ++ [ALC889_FIXUP_MP41_VREF] = { ++ .type = HDA_FIXUP_FUNC, ++ .v.func = alc889_fixup_mbp_vref, ++ .chained = true, ++ .chain_id = ALC885_FIXUP_MACPRO_GPIO, ++ }, + [ALC882_FIXUP_INV_DMIC] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc_fixup_inv_dmic_0x12, +@@ -2200,7 +2207,7 @@ static const struct snd_pci_quirk alc882 + SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF), + SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF), + SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF), +- SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 5,1", ALC885_FIXUP_MACPRO_GPIO), ++ SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF), + SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF), + SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF), + SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF), diff --git a/queue-3.10/alsa-hda-set-skl-hda-controller-power-at-freeze-and-thaw.patch b/queue-3.10/alsa-hda-set-skl-hda-controller-power-at-freeze-and-thaw.patch new file mode 100644 index 00000000000..7843817f5f6 --- /dev/null +++ b/queue-3.10/alsa-hda-set-skl-hda-controller-power-at-freeze-and-thaw.patch @@ -0,0 +1,85 @@ +From 3e6db33aaf1d42a30339f831ec4850570d6cc7a3 Mon Sep 17 00:00:00 2001 +From: Xiong Zhang +Date: Fri, 18 Dec 2015 13:29:18 +0800 +Subject: ALSA: hda - Set SKL+ hda controller power at freeze() and thaw() + +From: Xiong Zhang + +commit 3e6db33aaf1d42a30339f831ec4850570d6cc7a3 upstream. + +It takes three minutes to enter into hibernation on some OEM SKL +machines and we see many codec spurious response after thaw() opertion. +This is because HDA is still in D0 state after freeze() call and +pci_pm_freeze/pci_pm_freeze_noirq() don't set D3 hot in pci_bus driver. +It seems bios still access HDA when system enter into freeze state, +HDA will receive codec response interrupt immediately after thaw() call. +Because of this unexpected interrupt, HDA enter into a abnormal +state and slow down the system enter into hibernation. + +In this patch, we put HDA into D3 hot state in azx_freeze_noirq() and +put HDA into D0 state in azx_thaw_noirq(). + +V2: Only apply this fix to SKL+ + Fix compile error when CONFIG_PM_SLEEP isn't defined + +[Yet another fix for CONFIG_PM_SLEEP ifdef and the additional comment + by tiwai] + +Signed-off-by: Xiong Zhang +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/hda_intel.c | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -1104,6 +1104,36 @@ static unsigned int azx_get_response(str + return azx_rirb_get_response(bus, addr); + } + ++#ifdef CONFIG_PM_SLEEP ++/* put codec down to D3 at hibernation for Intel SKL+; ++ * otherwise BIOS may still access the codec and screw up the driver ++ */ ++#define IS_SKL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa170) ++#define IS_SKL_LP(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x9d70) ++#define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98) ++#define IS_SKL_PLUS(pci) (IS_SKL(pci) || IS_SKL_LP(pci) || IS_BXT(pci)) ++ ++static int azx_freeze_noirq(struct device *dev) ++{ ++ struct pci_dev *pci = to_pci_dev(dev); ++ ++ if (IS_SKL_PLUS(pci)) ++ pci_set_power_state(pci, PCI_D3hot); ++ ++ return 0; ++} ++ ++static int azx_thaw_noirq(struct device *dev) ++{ ++ struct pci_dev *pci = to_pci_dev(dev); ++ ++ if (IS_SKL_PLUS(pci)) ++ pci_set_power_state(pci, PCI_D0); ++ ++ return 0; ++} ++#endif /* CONFIG_PM_SLEEP */ ++ + #ifdef CONFIG_PM + static void azx_power_notify(struct hda_bus *bus, bool power_up); + #endif +@@ -2974,6 +3004,10 @@ static int azx_runtime_idle(struct devic + #ifdef CONFIG_PM + static const struct dev_pm_ops azx_pm = { + SET_SYSTEM_SLEEP_PM_OPS(azx_suspend, azx_resume) ++#ifdef CONFIG_PM_SLEEP ++ .freeze_noirq = azx_freeze_noirq, ++ .thaw_noirq = azx_thaw_noirq, ++#endif + SET_RUNTIME_PM_OPS(azx_runtime_suspend, azx_runtime_resume, azx_runtime_idle) + }; + diff --git a/queue-3.10/alsa-rme96-fix-unexpected-volume-reset-after-rate-changes.patch b/queue-3.10/alsa-rme96-fix-unexpected-volume-reset-after-rate-changes.patch new file mode 100644 index 00000000000..52f1d04b463 --- /dev/null +++ b/queue-3.10/alsa-rme96-fix-unexpected-volume-reset-after-rate-changes.patch @@ -0,0 +1,107 @@ +From a74a821624c0c75388a193337babd17a8c02c740 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Fri, 4 Dec 2015 16:44:24 +0100 +Subject: ALSA: rme96: Fix unexpected volume reset after rate changes + +From: Takashi Iwai + +commit a74a821624c0c75388a193337babd17a8c02c740 upstream. + +rme96 driver needs to reset DAC depending on the sample rate, and this +results in resetting to the max volume suddenly. It's because of the +missing call of snd_rme96_apply_dac_volume(). + +However, calling this function right after the DAC reset still may not +work, and we need some delay before this call. Since the DAC reset +and the procedure after that are performed in the spinlock, we delay +the DAC volume restore at the end after the spinlock. + +Reported-and-tested-by: Sylvain LABOISNE +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/rme96.c | 41 ++++++++++++++++++++++++++--------------- + 1 file changed, 26 insertions(+), 15 deletions(-) + +--- a/sound/pci/rme96.c ++++ b/sound/pci/rme96.c +@@ -703,10 +703,11 @@ snd_rme96_playback_setrate(struct rme96 + { + /* change to/from double-speed: reset the DAC (if available) */ + snd_rme96_reset_dac(rme96); ++ return 1; /* need to restore volume */ + } else { + writel(rme96->wcreg, rme96->iobase + RME96_IO_CONTROL_REGISTER); ++ return 0; + } +- return 0; + } + + static int +@@ -944,6 +945,7 @@ snd_rme96_playback_hw_params(struct snd_ + struct rme96 *rme96 = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; + int err, rate, dummy; ++ bool apply_dac_volume = false; + + runtime->dma_area = (void __force *)(rme96->iobase + + RME96_IO_PLAY_BUFFER); +@@ -957,24 +959,26 @@ snd_rme96_playback_hw_params(struct snd_ + { + /* slave clock */ + if ((int)params_rate(params) != rate) { +- spin_unlock_irq(&rme96->lock); +- return -EIO; +- } +- } else if ((err = snd_rme96_playback_setrate(rme96, params_rate(params))) < 0) { +- spin_unlock_irq(&rme96->lock); +- return err; +- } +- if ((err = snd_rme96_playback_setformat(rme96, params_format(params))) < 0) { +- spin_unlock_irq(&rme96->lock); +- return err; ++ err = -EIO; ++ goto error; ++ } ++ } else { ++ err = snd_rme96_playback_setrate(rme96, params_rate(params)); ++ if (err < 0) ++ goto error; ++ apply_dac_volume = err > 0; /* need to restore volume later? */ + } ++ ++ err = snd_rme96_playback_setformat(rme96, params_format(params)); ++ if (err < 0) ++ goto error; + snd_rme96_setframelog(rme96, params_channels(params), 1); + if (rme96->capture_periodsize != 0) { + if (params_period_size(params) << rme96->playback_frlog != + rme96->capture_periodsize) + { +- spin_unlock_irq(&rme96->lock); +- return -EBUSY; ++ err = -EBUSY; ++ goto error; + } + } + rme96->playback_periodsize = +@@ -985,9 +989,16 @@ snd_rme96_playback_hw_params(struct snd_ + rme96->wcreg &= ~(RME96_WCR_PRO | RME96_WCR_DOLBY | RME96_WCR_EMP); + writel(rme96->wcreg |= rme96->wcreg_spdif_stream, rme96->iobase + RME96_IO_CONTROL_REGISTER); + } ++ ++ err = 0; ++ error: + spin_unlock_irq(&rme96->lock); +- +- return 0; ++ if (apply_dac_volume) { ++ usleep_range(3000, 10000); ++ snd_rme96_apply_dac_volume(rme96); ++ } ++ ++ return err; + } + + static int diff --git a/queue-3.10/series b/queue-3.10/series index b77eecc139c..d00f6c3efde 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -8,3 +8,7 @@ x86-boot-double-boot_heap_size-to-64kb.patch ipmi-move-timer-init-to-before-irq-is-setup.patch alsa-hda-add-intel-lewisburg-device-ids-audio.patch alsa-hda-apply-pin-fixup-for-hp-probook-6550b.patch +alsa-rme96-fix-unexpected-volume-reset-after-rate-changes.patch +alsa-hda-add-inverted-dmic-for-packard-bell-dots.patch +alsa-hda-set-skl-hda-controller-power-at-freeze-and-thaw.patch +alsa-hda-realtek-fix-silent-headphone-output-on-macpro-4-1-v2.patch -- 2.47.2