aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-07-13 14:36:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-07-13 14:36:46 -0400
commita0092e5ec66b122b5fd4f4997f2284fcc4cd1389 (patch)
tree2c095be4a0bd3a29f73ce8d515c83aec27df005b
parent4596f55476b5b861ca37e525460d2e43e90f1f2e (diff)
parentc5a59d2477abf04e1b77152bef49383fd212da8d (diff)
Merge tag 'sound-4.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Just a few HD-auio fixes: one fix for a possible mutex deadlock at HDMI hotplug handling is somewhat subtle and delicate, while the rest are usual device-specific quirks" * tag 'sound-4.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/ca0132: Update a pci quirk device name ALSA: hda/ca0132: Add Recon3Di quirk for Gigabyte G1.Sniper Z97 ALSA: hda/realtek - two more lenovo models need fixup of MIC_LOCATION ALSA: hda - Handle pm failure during hotplug
-rw-r--r--sound/pci/hda/patch_ca0132.c3
-rw-r--r--sound/pci/hda/patch_hdmi.c19
-rw-r--r--sound/pci/hda/patch_realtek.c6
3 files changed, 21 insertions, 7 deletions
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index 4ff5320378e2..321e95c409c1 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -1048,7 +1048,8 @@ static const struct snd_pci_quirk ca0132_quirks[] = {
1048 SND_PCI_QUIRK(0x1102, 0x0010, "Sound Blaster Z", QUIRK_SBZ), 1048 SND_PCI_QUIRK(0x1102, 0x0010, "Sound Blaster Z", QUIRK_SBZ),
1049 SND_PCI_QUIRK(0x1102, 0x0023, "Sound Blaster Z", QUIRK_SBZ), 1049 SND_PCI_QUIRK(0x1102, 0x0023, "Sound Blaster Z", QUIRK_SBZ),
1050 SND_PCI_QUIRK(0x1458, 0xA016, "Recon3Di", QUIRK_R3DI), 1050 SND_PCI_QUIRK(0x1458, 0xA016, "Recon3Di", QUIRK_R3DI),
1051 SND_PCI_QUIRK(0x1458, 0xA036, "Recon3Di", QUIRK_R3DI), 1051 SND_PCI_QUIRK(0x1458, 0xA026, "Gigabyte G1.Sniper Z97", QUIRK_R3DI),
1052 SND_PCI_QUIRK(0x1458, 0xA036, "Gigabyte GA-Z170X-Gaming 7", QUIRK_R3DI),
1052 {} 1053 {}
1053}; 1054};
1054 1055
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 98e1c411c56a..8a49415aebac 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -33,6 +33,7 @@
33#include <linux/delay.h> 33#include <linux/delay.h>
34#include <linux/slab.h> 34#include <linux/slab.h>
35#include <linux/module.h> 35#include <linux/module.h>
36#include <linux/pm_runtime.h>
36#include <sound/core.h> 37#include <sound/core.h>
37#include <sound/jack.h> 38#include <sound/jack.h>
38#include <sound/asoundef.h> 39#include <sound/asoundef.h>
@@ -764,8 +765,10 @@ static void check_presence_and_report(struct hda_codec *codec, hda_nid_t nid,
764 765
765 if (pin_idx < 0) 766 if (pin_idx < 0)
766 return; 767 return;
768 mutex_lock(&spec->pcm_lock);
767 if (hdmi_present_sense(get_pin(spec, pin_idx), 1)) 769 if (hdmi_present_sense(get_pin(spec, pin_idx), 1))
768 snd_hda_jack_report_sync(codec); 770 snd_hda_jack_report_sync(codec);
771 mutex_unlock(&spec->pcm_lock);
769} 772}
770 773
771static void jack_callback(struct hda_codec *codec, 774static void jack_callback(struct hda_codec *codec,
@@ -1628,21 +1631,23 @@ static void sync_eld_via_acomp(struct hda_codec *codec,
1628static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll) 1631static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
1629{ 1632{
1630 struct hda_codec *codec = per_pin->codec; 1633 struct hda_codec *codec = per_pin->codec;
1631 struct hdmi_spec *spec = codec->spec;
1632 int ret; 1634 int ret;
1633 1635
1634 /* no temporary power up/down needed for component notifier */ 1636 /* no temporary power up/down needed for component notifier */
1635 if (!codec_has_acomp(codec)) 1637 if (!codec_has_acomp(codec)) {
1636 snd_hda_power_up_pm(codec); 1638 ret = snd_hda_power_up_pm(codec);
1639 if (ret < 0 && pm_runtime_suspended(hda_codec_dev(codec))) {
1640 snd_hda_power_down_pm(codec);
1641 return false;
1642 }
1643 }
1637 1644
1638 mutex_lock(&spec->pcm_lock);
1639 if (codec_has_acomp(codec)) { 1645 if (codec_has_acomp(codec)) {
1640 sync_eld_via_acomp(codec, per_pin); 1646 sync_eld_via_acomp(codec, per_pin);
1641 ret = false; /* don't call snd_hda_jack_report_sync() */ 1647 ret = false; /* don't call snd_hda_jack_report_sync() */
1642 } else { 1648 } else {
1643 ret = hdmi_present_sense_via_verbs(per_pin, repoll); 1649 ret = hdmi_present_sense_via_verbs(per_pin, repoll);
1644 } 1650 }
1645 mutex_unlock(&spec->pcm_lock);
1646 1651
1647 if (!codec_has_acomp(codec)) 1652 if (!codec_has_acomp(codec))
1648 snd_hda_power_down_pm(codec); 1653 snd_hda_power_down_pm(codec);
@@ -1654,12 +1659,16 @@ static void hdmi_repoll_eld(struct work_struct *work)
1654{ 1659{
1655 struct hdmi_spec_per_pin *per_pin = 1660 struct hdmi_spec_per_pin *per_pin =
1656 container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work); 1661 container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work);
1662 struct hda_codec *codec = per_pin->codec;
1663 struct hdmi_spec *spec = codec->spec;
1657 1664
1658 if (per_pin->repoll_count++ > 6) 1665 if (per_pin->repoll_count++ > 6)
1659 per_pin->repoll_count = 0; 1666 per_pin->repoll_count = 0;
1660 1667
1668 mutex_lock(&spec->pcm_lock);
1661 if (hdmi_present_sense(per_pin, per_pin->repoll_count)) 1669 if (hdmi_present_sense(per_pin, per_pin->repoll_count))
1662 snd_hda_jack_report_sync(per_pin->codec); 1670 snd_hda_jack_report_sync(per_pin->codec);
1671 mutex_unlock(&spec->pcm_lock);
1663} 1672}
1664 1673
1665static void intel_haswell_fixup_connect_list(struct hda_codec *codec, 1674static void intel_haswell_fixup_connect_list(struct hda_codec *codec,
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 5ad6c7e5f92e..7496be4491b1 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6612,7 +6612,6 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
6612 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 6612 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6613 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 6613 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6614 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 6614 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6615 SND_PCI_QUIRK(0x17aa, 0x3136, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6616 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), 6615 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6617 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), 6616 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
6618 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), 6617 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
@@ -6796,6 +6795,11 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
6796 {0x1a, 0x02a11040}, 6795 {0x1a, 0x02a11040},
6797 {0x1b, 0x01014020}, 6796 {0x1b, 0x01014020},
6798 {0x21, 0x0221101f}), 6797 {0x21, 0x0221101f}),
6798 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
6799 {0x14, 0x90170110},
6800 {0x19, 0x02a11020},
6801 {0x1a, 0x02a11030},
6802 {0x21, 0x0221101f}),
6799 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 6803 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
6800 {0x12, 0x90a60140}, 6804 {0x12, 0x90a60140},
6801 {0x14, 0x90170110}, 6805 {0x14, 0x90170110},