]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Jan 2016 22:35:01 +0000 (14:35 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Jan 2016 22:35:01 +0000 (14:35 -0800)
added patches:
alsa-hda-add-a-fixup-for-thinkpad-x1-carbon-2nd.patch
alsa-hda-add-fixup-for-acer-aspire-one-cloudbook-14.patch
alsa-hda-add-inverted-dmic-for-packard-bell-dots.patch
alsa-hda-apply-click-noise-workaround-for-thinkpads-generically.patch
alsa-hda-apply-hp-headphone-fixups-more-generically.patch
alsa-hda-fix-noise-on-gigabyte-z170x-mobo.patch
alsa-hda-fix-noise-problems-on-thinkpad-t440s.patch
alsa-hda-realtek-fix-silent-headphone-output-on-macpro-4-1-v2.patch
alsa-hda-set-codec-to-d3-at-reboot-shutdown-on-thinkpads.patch
alsa-hda-set-skl-hda-controller-power-at-freeze-and-thaw.patch
alsa-rme96-fix-unexpected-volume-reset-after-rate-changes.patch
alsa-usb-audio-add-a-more-accurate-volume-quirk-for-audioquest-dragonfly.patch
alsa-usb-audio-add-sample-rate-inquiry-quirk-for-audioquest-dragonfly.patch

14 files changed:
queue-4.1/alsa-hda-add-a-fixup-for-thinkpad-x1-carbon-2nd.patch [new file with mode: 0644]
queue-4.1/alsa-hda-add-fixup-for-acer-aspire-one-cloudbook-14.patch [new file with mode: 0644]
queue-4.1/alsa-hda-add-inverted-dmic-for-packard-bell-dots.patch [new file with mode: 0644]
queue-4.1/alsa-hda-apply-click-noise-workaround-for-thinkpads-generically.patch [new file with mode: 0644]
queue-4.1/alsa-hda-apply-hp-headphone-fixups-more-generically.patch [new file with mode: 0644]
queue-4.1/alsa-hda-fix-noise-on-gigabyte-z170x-mobo.patch [new file with mode: 0644]
queue-4.1/alsa-hda-fix-noise-problems-on-thinkpad-t440s.patch [new file with mode: 0644]
queue-4.1/alsa-hda-realtek-fix-silent-headphone-output-on-macpro-4-1-v2.patch [new file with mode: 0644]
queue-4.1/alsa-hda-set-codec-to-d3-at-reboot-shutdown-on-thinkpads.patch [new file with mode: 0644]
queue-4.1/alsa-hda-set-skl-hda-controller-power-at-freeze-and-thaw.patch [new file with mode: 0644]
queue-4.1/alsa-rme96-fix-unexpected-volume-reset-after-rate-changes.patch [new file with mode: 0644]
queue-4.1/alsa-usb-audio-add-a-more-accurate-volume-quirk-for-audioquest-dragonfly.patch [new file with mode: 0644]
queue-4.1/alsa-usb-audio-add-sample-rate-inquiry-quirk-for-audioquest-dragonfly.patch [new file with mode: 0644]
queue-4.1/series

diff --git a/queue-4.1/alsa-hda-add-a-fixup-for-thinkpad-x1-carbon-2nd.patch b/queue-4.1/alsa-hda-add-a-fixup-for-thinkpad-x1-carbon-2nd.patch
new file mode 100644 (file)
index 0000000..49b92fe
--- /dev/null
@@ -0,0 +1,32 @@
+From b6903c0ed9f0bcbbe88f67f7ed43d1721cbc6235 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Thu, 10 Dec 2015 12:20:20 +0100
+Subject: ALSA: hda - Add a fixup for Thinkpad X1 Carbon 2nd
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit b6903c0ed9f0bcbbe88f67f7ed43d1721cbc6235 upstream.
+
+Apply the same fixup for Thinkpad with dock to Thinkpad X1 Carbon 2nd,
+too.  This reduces the annoying loud cracking noise problem, as well
+as the support of missing docking port.
+
+Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=958439
+Reported-and-tested-by: Benjamin Poirier <bpoirier@suse.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -5261,6 +5261,7 @@ static const struct snd_pci_quirk alc269
+       SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
+       SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
+       SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
++      SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
+       SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
+       SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
+       SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
diff --git a/queue-4.1/alsa-hda-add-fixup-for-acer-aspire-one-cloudbook-14.patch b/queue-4.1/alsa-hda-add-fixup-for-acer-aspire-one-cloudbook-14.patch
new file mode 100644 (file)
index 0000000..0a457ca
--- /dev/null
@@ -0,0 +1,31 @@
+From b9c2fa52135d49a931c56ed2bfc17d61f771b412 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Thu, 19 Nov 2015 16:39:50 +0100
+Subject: ALSA: hda - Add fixup for Acer Aspire One Cloudbook 14
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit b9c2fa52135d49a931c56ed2bfc17d61f771b412 upstream.
+
+For making the speakers on Acer Aspire One Cloudbook 14 to work, we
+need the as same quirk as for another Chromebook.  This patch adds the
+corresponding fixup entry.
+
+Reported-by: Patrick <epictetus@gmail.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -5107,6 +5107,7 @@ static const struct snd_pci_quirk alc269
+       SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
+       SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
+       SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
++      SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
+       SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
+       SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
+       SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
diff --git a/queue-4.1/alsa-hda-add-inverted-dmic-for-packard-bell-dots.patch b/queue-4.1/alsa-hda-add-inverted-dmic-for-packard-bell-dots.patch
new file mode 100644 (file)
index 0000000..d31e9a1
--- /dev/null
@@ -0,0 +1,31 @@
+From 02f6ff90400d055f08b0ba0b5f0707630b6faed7 Mon Sep 17 00:00:00 2001
+From: David Henningsson <david.henningsson@canonical.com>
+Date: Mon, 7 Dec 2015 11:29:31 +0100
+Subject: ALSA: hda - Add inverted dmic for Packard Bell DOTS
+
+From: David Henningsson <david.henningsson@canonical.com>
+
+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 <david.henningsson@canonical.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -6465,6 +6465,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-4.1/alsa-hda-apply-click-noise-workaround-for-thinkpads-generically.patch b/queue-4.1/alsa-hda-apply-click-noise-workaround-for-thinkpads-generically.patch
new file mode 100644 (file)
index 0000000..725f7d4
--- /dev/null
@@ -0,0 +1,62 @@
+From 157f0b7f6c0cc0bc88647390006e959e267a0143 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Thu, 10 Dec 2015 23:30:43 +0100
+Subject: ALSA: hda - Apply click noise workaround for Thinkpads generically
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 157f0b7f6c0cc0bc88647390006e959e267a0143 upstream.
+
+It seems that a workaround for Thinkpad T440s crackling noise can be
+applied generically to all Thinkpad models: namely, disabling the
+default alc269 shutup callback.  This patch moves it to the existing
+alc_fixup_tpt440_dock() while also replacing the rest code with
+another existing alc_fixup_disable_aamix().  It resulted in a good
+code reduction.
+
+Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=958439
+Reported-and-tested-by: Benjamin Poirier <bpoirier@suse.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c |   15 ++-------------
+ 1 file changed, 2 insertions(+), 13 deletions(-)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -4202,24 +4202,13 @@ static void alc_fixup_tpt440_dock(struct
+       struct alc_spec *spec = codec->spec;
+       if (action == HDA_FIXUP_ACT_PRE_PROBE) {
++              spec->shutup = alc_no_shutup; /* reduce click noise */
+               spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
+               codec->power_save_node = 0; /* avoid click noises */
+               snd_hda_apply_pincfgs(codec, pincfgs);
+       }
+ }
+-/* additional fixup for Thinkpad T440s noise problem */
+-static void alc_fixup_tpt440(struct hda_codec *codec,
+-                                const struct hda_fixup *fix, int action)
+-{
+-      struct alc_spec *spec = codec->spec;
+-
+-      if (action == HDA_FIXUP_ACT_PRE_PROBE) {
+-              spec->shutup = alc_no_shutup; /* reduce click noise */
+-              spec->gen.mixer_nid = 0; /* reduce background noise */
+-      }
+-}
+-
+ static void alc_shutup_dell_xps13(struct hda_codec *codec)
+ {
+       struct alc_spec *spec = codec->spec;
+@@ -5016,7 +5005,7 @@ static const struct hda_fixup alc269_fix
+       },
+       [ALC292_FIXUP_TPT440] = {
+               .type = HDA_FIXUP_FUNC,
+-              .v.func = alc_fixup_tpt440,
++              .v.func = alc_fixup_disable_aamix,
+               .chained = true,
+               .chain_id = ALC292_FIXUP_TPT440_DOCK,
+       },
diff --git a/queue-4.1/alsa-hda-apply-hp-headphone-fixups-more-generically.patch b/queue-4.1/alsa-hda-apply-hp-headphone-fixups-more-generically.patch
new file mode 100644 (file)
index 0000000..6460847
--- /dev/null
@@ -0,0 +1,88 @@
+From 196543d54574f50e3fd04df4e3048181e006a9da Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 9 Nov 2015 14:46:35 +0100
+Subject: ALSA: hda - Apply HP headphone fixups more generically
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 196543d54574f50e3fd04df4e3048181e006a9da upstream.
+
+It turned out that many HP laptops suffer from the same problem as
+fixed in commit [c932b98c1e47: ALSA: hda - Apply pin fixup for HP
+ProBook 6550b].  But, it's tiresome to list up all such PCI SSIDs, as
+there are really lots of HP machines.
+
+Instead, we do a bit more clever, try to check the supposedly dock and
+built-in headphone pins, and apply the fixup when both seem valid.
+This rule can be applied generically to all models using the same
+quirk, so we'll fix all in a shot.
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=107491
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_sigmatel.c |   45 ++++++++++++++++++++++++++---------------
+ 1 file changed, 29 insertions(+), 16 deletions(-)
+
+--- a/sound/pci/hda/patch_sigmatel.c
++++ b/sound/pci/hda/patch_sigmatel.c
+@@ -3110,6 +3110,29 @@ static void stac92hd71bxx_fixup_hp_hdx(s
+       spec->gpio_led = 0x08;
+ }
++static bool is_hp_output(struct hda_codec *codec, hda_nid_t pin)
++{
++      unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, pin);
++
++      /* count line-out, too, as BIOS sets often so */
++      return get_defcfg_connect(pin_cfg) != AC_JACK_PORT_NONE &&
++              (get_defcfg_device(pin_cfg) == AC_JACK_LINE_OUT ||
++               get_defcfg_device(pin_cfg) == AC_JACK_HP_OUT);
++}
++
++static void fixup_hp_headphone(struct hda_codec *codec, hda_nid_t pin)
++{
++      unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, pin);
++
++      /* It was changed in the BIOS to just satisfy MS DTM.
++       * Lets turn it back into slaved HP
++       */
++      pin_cfg = (pin_cfg & (~AC_DEFCFG_DEVICE)) |
++              (AC_JACK_HP_OUT << AC_DEFCFG_DEVICE_SHIFT);
++      pin_cfg = (pin_cfg & (~(AC_DEFCFG_DEF_ASSOC | AC_DEFCFG_SEQUENCE))) |
++              0x1f;
++      snd_hda_codec_set_pincfg(codec, pin, pin_cfg);
++}
+ static void stac92hd71bxx_fixup_hp(struct hda_codec *codec,
+                                  const struct hda_fixup *fix, int action)
+@@ -3119,22 +3142,12 @@ static void stac92hd71bxx_fixup_hp(struc
+       if (action != HDA_FIXUP_ACT_PRE_PROBE)
+               return;
+-      if (hp_blike_system(codec->core.subsystem_id)) {
+-              unsigned int pin_cfg = snd_hda_codec_get_pincfg(codec, 0x0f);
+-              if (get_defcfg_device(pin_cfg) == AC_JACK_LINE_OUT ||
+-                      get_defcfg_device(pin_cfg) == AC_JACK_SPEAKER  ||
+-                      get_defcfg_device(pin_cfg) == AC_JACK_HP_OUT) {
+-                      /* It was changed in the BIOS to just satisfy MS DTM.
+-                       * Lets turn it back into slaved HP
+-                       */
+-                      pin_cfg = (pin_cfg & (~AC_DEFCFG_DEVICE))
+-                                      | (AC_JACK_HP_OUT <<
+-                                              AC_DEFCFG_DEVICE_SHIFT);
+-                      pin_cfg = (pin_cfg & (~(AC_DEFCFG_DEF_ASSOC
+-                                                      | AC_DEFCFG_SEQUENCE)))
+-                                                              | 0x1f;
+-                      snd_hda_codec_set_pincfg(codec, 0x0f, pin_cfg);
+-              }
++      /* when both output A and F are assigned, these are supposedly
++       * dock and built-in headphones; fix both pin configs
++       */
++      if (is_hp_output(codec, 0x0a) && is_hp_output(codec, 0x0f)) {
++              fixup_hp_headphone(codec, 0x0a);
++              fixup_hp_headphone(codec, 0x0f);
+       }
+       if (find_mute_led_cfg(codec, 1))
diff --git a/queue-4.1/alsa-hda-fix-noise-on-gigabyte-z170x-mobo.patch b/queue-4.1/alsa-hda-fix-noise-on-gigabyte-z170x-mobo.patch
new file mode 100644 (file)
index 0000000..b184885
--- /dev/null
@@ -0,0 +1,59 @@
+From 0c25ad80408e95e0a4fbaf0056950206e95f726f Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 24 Nov 2015 20:02:12 +0100
+Subject: ALSA: hda - Fix noise on Gigabyte Z170X mobo
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 0c25ad80408e95e0a4fbaf0056950206e95f726f upstream.
+
+Gigabyte Z710X mobo with ALC1150 codec gets significant noises from
+the analog loopback routes even if their inputs are all muted.
+Simply kill the aamix for fixing it.
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=108301
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c |    8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -1771,6 +1771,7 @@ enum {
+       ALC882_FIXUP_NO_PRIMARY_HP,
+       ALC887_FIXUP_ASUS_BASS,
+       ALC887_FIXUP_BASS_CHMAP,
++      ALC882_FIXUP_DISABLE_AAMIX,
+ };
+ static void alc889_fixup_coef(struct hda_codec *codec,
+@@ -1932,6 +1933,8 @@ static void alc882_fixup_no_primary_hp(s
+ static void alc_fixup_bass_chmap(struct hda_codec *codec,
+                                const struct hda_fixup *fix, int action);
++static void alc_fixup_disable_aamix(struct hda_codec *codec,
++                                  const struct hda_fixup *fix, int action);
+ static const struct hda_fixup alc882_fixups[] = {
+       [ALC882_FIXUP_ABIT_AW9D_MAX] = {
+@@ -2163,6 +2166,10 @@ static const struct hda_fixup alc882_fix
+               .type = HDA_FIXUP_FUNC,
+               .v.func = alc_fixup_bass_chmap,
+       },
++      [ALC882_FIXUP_DISABLE_AAMIX] = {
++              .type = HDA_FIXUP_FUNC,
++              .v.func = alc_fixup_disable_aamix,
++      },
+ };
+ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
+@@ -2230,6 +2237,7 @@ static const struct snd_pci_quirk alc882
+       SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
+       SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
+       SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
++      SND_PCI_QUIRK(0x1458, 0xa182, "Gigabyte Z170X-UD3", ALC882_FIXUP_DISABLE_AAMIX),
+       SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
+       SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
+       SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
diff --git a/queue-4.1/alsa-hda-fix-noise-problems-on-thinkpad-t440s.patch b/queue-4.1/alsa-hda-fix-noise-problems-on-thinkpad-t440s.patch
new file mode 100644 (file)
index 0000000..902294d
--- /dev/null
@@ -0,0 +1,95 @@
+From 9a811230481243f384b8036c6a558bfdbd961f78 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 9 Dec 2015 15:17:43 +0100
+Subject: ALSA: hda - Fix noise problems on Thinkpad T440s
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 9a811230481243f384b8036c6a558bfdbd961f78 upstream.
+
+Lenovo Thinkpad T440s suffers from constant background noises, and it
+seems to be a generic hardware issue on this model:
+  https://forums.lenovo.com/t5/ThinkPad-T400-T500-and-newer-T/T440s-speaker-noise/td-p/1339883
+
+As the noise comes from the analog loopback path, disabling the path
+is the easy workaround.
+
+Also, the machine gives significant cracking noises at PM suspend.  A
+workaround found by trial-and-error is to disable the shutup callback
+currently used for ALC269-variant.
+
+This patch addresses these noise issues by introducing a new fixup
+chain.  Although the same workaround might be applicable to other
+Thinkpad models, it's applied only to T440s (17aa:220c) in this patch,
+so far, just to be safe (you chicken!).  As a compromise, a new model
+option string "tp440" is provided now, though, so that owners of other
+Thinkpad models can test it more easily.
+
+Bugzilla: https://bugzilla.opensuse.org/show_bug.cgi?id=958504
+Reported-and-tested-by: Tim Hardeck <thardeck@suse.de>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c |   22 +++++++++++++++++++++-
+ 1 file changed, 21 insertions(+), 1 deletion(-)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -4208,6 +4208,18 @@ static void alc_fixup_tpt440_dock(struct
+       }
+ }
++/* additional fixup for Thinkpad T440s noise problem */
++static void alc_fixup_tpt440(struct hda_codec *codec,
++                                const struct hda_fixup *fix, int action)
++{
++      struct alc_spec *spec = codec->spec;
++
++      if (action == HDA_FIXUP_ACT_PRE_PROBE) {
++              spec->shutup = alc_no_shutup; /* reduce click noise */
++              spec->gen.mixer_nid = 0; /* reduce background noise */
++      }
++}
++
+ static void alc_shutup_dell_xps13(struct hda_codec *codec)
+ {
+       struct alc_spec *spec = codec->spec;
+@@ -4533,6 +4545,7 @@ enum {
+       ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
+       ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
+       ALC292_FIXUP_TPT440_DOCK,
++      ALC292_FIXUP_TPT440,
+       ALC283_FIXUP_BXBT2807_MIC,
+       ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED,
+       ALC282_FIXUP_ASPIRE_V5_PINS,
+@@ -5001,6 +5014,12 @@ static const struct hda_fixup alc269_fix
+               .chained = true,
+               .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
+       },
++      [ALC292_FIXUP_TPT440] = {
++              .type = HDA_FIXUP_FUNC,
++              .v.func = alc_fixup_tpt440,
++              .chained = true,
++              .chain_id = ALC292_FIXUP_TPT440_DOCK,
++      },
+       [ALC283_FIXUP_BXBT2807_MIC] = {
+               .type = HDA_FIXUP_PINS,
+               .v.pins = (const struct hda_pintbl[]) {
+@@ -5236,7 +5255,7 @@ static const struct snd_pci_quirk alc269
+       SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
+       SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
+       SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
+-      SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440_DOCK),
++      SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
+       SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
+       SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
+       SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
+@@ -5331,6 +5350,7 @@ static const struct hda_model_fixup alc2
+       {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
+       {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
+       {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
++      {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
+       {}
+ };
diff --git a/queue-4.1/alsa-hda-realtek-fix-silent-headphone-output-on-macpro-4-1-v2.patch b/queue-4.1/alsa-hda-realtek-fix-silent-headphone-output-on-macpro-4-1-v2.patch
new file mode 100644 (file)
index 0000000..6d4ae18
--- /dev/null
@@ -0,0 +1,70 @@
+From 9f660a1c43890c2cdd1f423fd73654e7ca08fe56 Mon Sep 17 00:00:00 2001
+From: Mario Kleiner <mario.kleiner.de@gmail.com>
+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 <mario.kleiner.de@gmail.com>
+
+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 <mario.kleiner.de@gmail.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -1787,6 +1787,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,
+@@ -1875,7 +1876,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)
+@@ -2165,6 +2166,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,
+@@ -2247,7 +2254,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-4.1/alsa-hda-set-codec-to-d3-at-reboot-shutdown-on-thinkpads.patch b/queue-4.1/alsa-hda-set-codec-to-d3-at-reboot-shutdown-on-thinkpads.patch
new file mode 100644 (file)
index 0000000..166ccb8
--- /dev/null
@@ -0,0 +1,84 @@
+From 70a0976b0c0d90f4246d7e63359d796ec82b87d6 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 15 Dec 2015 14:59:58 +0100
+Subject: ALSA: hda - Set codec to D3 at reboot/shutdown on Thinkpads
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 70a0976b0c0d90f4246d7e63359d796ec82b87d6 upstream.
+
+Lenovo Thinkpads with Realtek codecs may still have some loud
+crackling noises at reboot/shutdown even though a few previous fixes
+have been applied.  It's because the previous fix (disabling the
+default shutup callback) takes effect only at transition of the codec
+power state.  Meanwhile, at reboot or shutdown, we don't take down the
+codec power as default, thus it triggers the same problem unless the
+codec is powered down casually by runtime PM.
+
+This patch tries to address the issue.  It gives two things:
+- implement the separate reboot_notify hook to struct alc_spec, and
+  call it optionally if defined.
+- turn off the codec to D3 for Thinkpad models via this new callback
+
+Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=958439
+Reported-and-tested-by: Benjamin Poirier <bpoirier@suse.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c |   23 ++++++++++++++++++++++-
+ 1 file changed, 22 insertions(+), 1 deletion(-)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -111,6 +111,7 @@ struct alc_spec {
+       void (*power_hook)(struct hda_codec *codec);
+ #endif
+       void (*shutup)(struct hda_codec *codec);
++      void (*reboot_notify)(struct hda_codec *codec);
+       int init_amp;
+       int codec_variant;      /* flag for other variants */
+@@ -773,6 +774,25 @@ static inline void alc_shutup(struct hda
+               snd_hda_shutup_pins(codec);
+ }
++static void alc_reboot_notify(struct hda_codec *codec)
++{
++      struct alc_spec *spec = codec->spec;
++
++      if (spec && spec->reboot_notify)
++              spec->reboot_notify(codec);
++      else
++              alc_shutup(codec);
++}
++
++/* power down codec to D3 at reboot/shutdown; set as reboot_notify ops */
++static void alc_d3_at_reboot(struct hda_codec *codec)
++{
++      snd_hda_codec_set_power_to_all(codec, codec->core.afg, AC_PWRST_D3);
++      snd_hda_codec_write(codec, codec->core.afg, 0,
++                          AC_VERB_SET_POWER_STATE, AC_PWRST_D3);
++      msleep(10);
++}
++
+ #define alc_free      snd_hda_gen_free
+ #ifdef CONFIG_PM
+@@ -818,7 +838,7 @@ static const struct hda_codec_ops alc_pa
+       .suspend = alc_suspend,
+       .check_power_status = snd_hda_gen_check_power_status,
+ #endif
+-      .reboot_notify = alc_shutup,
++      .reboot_notify = alc_reboot_notify,
+ };
+@@ -4203,6 +4223,7 @@ static void alc_fixup_tpt440_dock(struct
+       if (action == HDA_FIXUP_ACT_PRE_PROBE) {
+               spec->shutup = alc_no_shutup; /* reduce click noise */
++              spec->reboot_notify = alc_d3_at_reboot; /* reduce noise */
+               spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
+               codec->power_save_node = 0; /* avoid click noises */
+               snd_hda_apply_pincfgs(codec, pincfgs);
diff --git a/queue-4.1/alsa-hda-set-skl-hda-controller-power-at-freeze-and-thaw.patch b/queue-4.1/alsa-hda-set-skl-hda-controller-power-at-freeze-and-thaw.patch
new file mode 100644 (file)
index 0000000..2d3a27e
--- /dev/null
@@ -0,0 +1,85 @@
+From 3e6db33aaf1d42a30339f831ec4850570d6cc7a3 Mon Sep 17 00:00:00 2001
+From: Xiong Zhang <xiong.y.zhang@intel.com>
+Date: Fri, 18 Dec 2015 13:29:18 +0800
+Subject: ALSA: hda - Set SKL+ hda controller power at freeze() and thaw()
+
+From: Xiong Zhang <xiong.y.zhang@intel.com>
+
+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 <xiong.y.zhang@intel.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -840,6 +840,36 @@ static int azx_resume(struct device *dev
+ }
+ #endif /* CONFIG_PM_SLEEP || SUPPORT_VGA_SWITCHEROO */
++#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 int azx_runtime_suspend(struct device *dev)
+ {
+@@ -940,6 +970,10 @@ static int azx_runtime_idle(struct devic
+ 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-4.1/alsa-rme96-fix-unexpected-volume-reset-after-rate-changes.patch b/queue-4.1/alsa-rme96-fix-unexpected-volume-reset-after-rate-changes.patch
new file mode 100644 (file)
index 0000000..65c282e
--- /dev/null
@@ -0,0 +1,107 @@
+From a74a821624c0c75388a193337babd17a8c02c740 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Fri, 4 Dec 2015 16:44:24 +0100
+Subject: ALSA: rme96: Fix unexpected volume reset after rate changes
+
+From: Takashi Iwai <tiwai@suse.de>
+
+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 <maeda1@free.fr>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/rme96.c |   41 ++++++++++++++++++++++++++---------------
+ 1 file changed, 26 insertions(+), 15 deletions(-)
+
+--- a/sound/pci/rme96.c
++++ b/sound/pci/rme96.c
+@@ -741,10 +741,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
+@@ -980,6 +981,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);
+@@ -993,24 +995,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 =
+@@ -1021,9 +1025,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-4.1/alsa-usb-audio-add-a-more-accurate-volume-quirk-for-audioquest-dragonfly.patch b/queue-4.1/alsa-usb-audio-add-a-more-accurate-volume-quirk-for-audioquest-dragonfly.patch
new file mode 100644 (file)
index 0000000..f7bf5e7
--- /dev/null
@@ -0,0 +1,146 @@
+From 42e3121d90f42e57f6dbd6083dff2f57b3ec7daa Mon Sep 17 00:00:00 2001
+From: Anssi Hannula <anssi.hannula@iki.fi>
+Date: Sun, 13 Dec 2015 20:49:58 +0200
+Subject: ALSA: usb-audio: Add a more accurate volume quirk for AudioQuest DragonFly
+
+From: Anssi Hannula <anssi.hannula@iki.fi>
+
+commit 42e3121d90f42e57f6dbd6083dff2f57b3ec7daa upstream.
+
+AudioQuest DragonFly DAC reports a volume control range of 0..50
+(0x0000..0x0032) which in USB Audio means a range of 0 .. 0.2dB, which
+is obviously incorrect and would cause software using the dB information
+in e.g. volume sliders to have a massive volume difference in 100..102%
+range.
+
+Commit 2d1cb7f658fb ("ALSA: usb-audio: add dB range mapping for some
+devices") added a dB range mapping for it with range 0..50 dB.
+
+However, the actual volume mapping seems to be neither linear volume nor
+linear dB scale, but instead quite close to the cubic mapping e.g.
+alsamixer uses, with a range of approx. -53...0 dB.
+
+Replace the previous quirk with a custom dB mapping based on some basic
+output measurements, using a 10-item range TLV (which will still fit in
+alsa-lib MAX_TLV_RANGE_SIZE).
+
+Tested on AudioQuest DragonFly HW v1.2. The quirk is only applied if the
+range is 0..50, so if this gets fixed/changed in later HW revisions it
+will no longer be applied.
+
+v2: incorporated Takashi Iwai's suggestion for the quirk application
+method
+
+Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/mixer.c        |    2 ++
+ sound/usb/mixer_maps.c   |   12 ------------
+ sound/usb/mixer_quirks.c |   37 +++++++++++++++++++++++++++++++++++++
+ sound/usb/mixer_quirks.h |    4 ++++
+ 4 files changed, 43 insertions(+), 12 deletions(-)
+
+--- a/sound/usb/mixer.c
++++ b/sound/usb/mixer.c
+@@ -1336,6 +1336,8 @@ static void build_feature_ctl(struct mix
+               }
+       }
++      snd_usb_mixer_fu_apply_quirk(state->mixer, cval, unitid, kctl);
++
+       range = (cval->max - cval->min) / cval->res;
+       /*
+        * Are there devices with volume range more than 255? I use a bit more
+--- a/sound/usb/mixer_maps.c
++++ b/sound/usb/mixer_maps.c
+@@ -348,13 +348,6 @@ static struct usbmix_name_map bose_compa
+       { 0 }   /* terminator */
+ };
+-/* Dragonfly DAC 1.2, the dB conversion factor is 1 instead of 256 */
+-static struct usbmix_dB_map dragonfly_1_2_dB = {0, 5000};
+-static struct usbmix_name_map dragonfly_1_2_map[] = {
+-      { 7, NULL, .dB = &dragonfly_1_2_dB },
+-      { 0 }   /* terminator */
+-};
+-
+ /*
+  * Control map entries
+  */
+@@ -470,11 +463,6 @@ static struct usbmix_ctl_map usbmix_ctl_
+               .id = USB_ID(0x05a7, 0x1020),
+               .map = bose_companion5_map,
+       },
+-      {
+-              /* Dragonfly DAC 1.2 */
+-              .id = USB_ID(0x21b4, 0x0081),
+-              .map = dragonfly_1_2_map,
+-      },
+       { 0 } /* terminator */
+ };
+--- a/sound/usb/mixer_quirks.c
++++ b/sound/usb/mixer_quirks.c
+@@ -37,6 +37,7 @@
+ #include <sound/control.h>
+ #include <sound/hwdep.h>
+ #include <sound/info.h>
++#include <sound/tlv.h>
+ #include "usbaudio.h"
+ #include "mixer.h"
+@@ -1842,4 +1843,40 @@ void snd_usb_mixer_rc_memory_change(stru
+               break;
+       }
+ }
++
++static void snd_dragonfly_quirk_db_scale(struct usb_mixer_interface *mixer,
++                                       struct snd_kcontrol *kctl)
++{
++      /* Approximation using 10 ranges based on output measurement on hw v1.2.
++       * This seems close to the cubic mapping e.g. alsamixer uses. */
++      static const DECLARE_TLV_DB_RANGE(scale,
++               0,  1, TLV_DB_MINMAX_ITEM(-5300, -4970),
++               2,  5, TLV_DB_MINMAX_ITEM(-4710, -4160),
++               6,  7, TLV_DB_MINMAX_ITEM(-3884, -3710),
++               8, 14, TLV_DB_MINMAX_ITEM(-3443, -2560),
++              15, 16, TLV_DB_MINMAX_ITEM(-2475, -2324),
++              17, 19, TLV_DB_MINMAX_ITEM(-2228, -2031),
++              20, 26, TLV_DB_MINMAX_ITEM(-1910, -1393),
++              27, 31, TLV_DB_MINMAX_ITEM(-1322, -1032),
++              32, 40, TLV_DB_MINMAX_ITEM(-968, -490),
++              41, 50, TLV_DB_MINMAX_ITEM(-441, 0),
++      );
++
++      usb_audio_info(mixer->chip, "applying DragonFly dB scale quirk\n");
++      kctl->tlv.p = scale;
++      kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ;
++      kctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK;
++}
++
++void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer,
++                                struct usb_mixer_elem_info *cval, int unitid,
++                                struct snd_kcontrol *kctl)
++{
++      switch (mixer->chip->usb_id) {
++      case USB_ID(0x21b4, 0x0081): /* AudioQuest DragonFly */
++              if (unitid == 7 && cval->min == 0 && cval->max == 50)
++                      snd_dragonfly_quirk_db_scale(mixer, kctl);
++              break;
++      }
++}
+--- a/sound/usb/mixer_quirks.h
++++ b/sound/usb/mixer_quirks.h
+@@ -9,5 +9,9 @@ void snd_emuusb_set_samplerate(struct sn
+ void snd_usb_mixer_rc_memory_change(struct usb_mixer_interface *mixer,
+                                   int unitid);
++void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer,
++                                struct usb_mixer_elem_info *cval, int unitid,
++                                struct snd_kcontrol *kctl);
++
+ #endif /* SND_USB_MIXER_QUIRKS_H */
diff --git a/queue-4.1/alsa-usb-audio-add-sample-rate-inquiry-quirk-for-audioquest-dragonfly.patch b/queue-4.1/alsa-usb-audio-add-sample-rate-inquiry-quirk-for-audioquest-dragonfly.patch
new file mode 100644 (file)
index 0000000..48b498e
--- /dev/null
@@ -0,0 +1,31 @@
+From 12a6116e66695a728bcb9616416c508ce9c051a1 Mon Sep 17 00:00:00 2001
+From: Anssi Hannula <anssi.hannula@iki.fi>
+Date: Sun, 13 Dec 2015 20:49:59 +0200
+Subject: ALSA: usb-audio: Add sample rate inquiry quirk for AudioQuest DragonFly
+
+From: Anssi Hannula <anssi.hannula@iki.fi>
+
+commit 12a6116e66695a728bcb9616416c508ce9c051a1 upstream.
+
+Avoid getting sample rate on AudioQuest DragonFly as it is unsupported
+and causes noisy "cannot get freq at ep 0x1" messages when playback
+starts.
+
+Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/quirks.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/usb/quirks.c
++++ b/sound/usb/quirks.c
+@@ -1122,6 +1122,7 @@ bool snd_usb_get_sample_rate_quirk(struc
+       case USB_ID(0x045E, 0x0779): /* MS Lifecam HD-3000 */
+       case USB_ID(0x04D8, 0xFEEA): /* Benchmark DAC1 Pre */
+       case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */
++      case USB_ID(0x21B4, 0x0081): /* AudioQuest DragonFly */
+               return true;
+       }
+       return false;
index 2f6d108f64b2934d7251647ee2aa011cfc73cf89..03fbaeb13ecf4ab47e85965c94044ff658456a11 100644 (file)
@@ -17,3 +17,16 @@ alsa-hda-disable-64bit-address-for-creative-hda-controllers.patch
 alsa-hda-add-intel-lewisburg-device-ids-audio.patch
 alsa-hda-apply-pin-fixup-for-hp-probook-6550b.patch
 alsa-fireworks-bebob-oxfw-dice-enable-to-make-as-built-in.patch
+alsa-hda-apply-hp-headphone-fixups-more-generically.patch
+alsa-hda-add-fixup-for-acer-aspire-one-cloudbook-14.patch
+alsa-hda-fix-noise-on-gigabyte-z170x-mobo.patch
+alsa-rme96-fix-unexpected-volume-reset-after-rate-changes.patch
+alsa-hda-add-inverted-dmic-for-packard-bell-dots.patch
+alsa-hda-fix-noise-problems-on-thinkpad-t440s.patch
+alsa-hda-add-a-fixup-for-thinkpad-x1-carbon-2nd.patch
+alsa-hda-apply-click-noise-workaround-for-thinkpads-generically.patch
+alsa-hda-set-codec-to-d3-at-reboot-shutdown-on-thinkpads.patch
+alsa-usb-audio-add-a-more-accurate-volume-quirk-for-audioquest-dragonfly.patch
+alsa-usb-audio-add-sample-rate-inquiry-quirk-for-audioquest-dragonfly.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