aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-02-26 12:27:21 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-02-26 12:27:21 -0500
commitc213341e4962c798274e024e89dd4b14d4826872 (patch)
tree2a2a2f3bb7bafa00d0c31b13d212530728bd46ac
parentbb134ff50709fda187027c2263036ccb41024ca5 (diff)
parent473f414564528a819f0c2bb6b4bf26366b64c9ab (diff)
Merge tag 'sound-4.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Things got calmed down for rc6, as it seems, and we have only a few HD-audio fixes at this time: a fix for Skylake codec probe errors, a fix for missing interrupt handling, and a few Dell and HP quirks" * tag 'sound-4.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda - Loop interrupt handling until really cleared ALSA: hda - Fix headset support and noise on HP EliteBook 755 G2 ALSA: hda - Fixup speaker pass-through control for nid 0x14 on ALC225 ALSA: hda - Fixing background noise on Dell Inspiron 3162 ALSA: hda - Apply clock gate workaround to Skylake, too
-rw-r--r--include/sound/hdaudio.h2
-rw-r--r--sound/hda/hdac_controller.c7
-rw-r--r--sound/pci/hda/hda_controller.c47
-rw-r--r--sound/pci/hda/hda_intel.c16
-rw-r--r--sound/pci/hda/patch_realtek.c39
5 files changed, 77 insertions, 34 deletions
diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h
index e2b712c90d3f..c21c38ce7450 100644
--- a/include/sound/hdaudio.h
+++ b/include/sound/hdaudio.h
@@ -343,7 +343,7 @@ void snd_hdac_bus_enter_link_reset(struct hdac_bus *bus);
343void snd_hdac_bus_exit_link_reset(struct hdac_bus *bus); 343void snd_hdac_bus_exit_link_reset(struct hdac_bus *bus);
344 344
345void snd_hdac_bus_update_rirb(struct hdac_bus *bus); 345void snd_hdac_bus_update_rirb(struct hdac_bus *bus);
346void snd_hdac_bus_handle_stream_irq(struct hdac_bus *bus, unsigned int status, 346int snd_hdac_bus_handle_stream_irq(struct hdac_bus *bus, unsigned int status,
347 void (*ack)(struct hdac_bus *, 347 void (*ack)(struct hdac_bus *,
348 struct hdac_stream *)); 348 struct hdac_stream *));
349 349
diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c
index b5a17cb510a0..8c486235c905 100644
--- a/sound/hda/hdac_controller.c
+++ b/sound/hda/hdac_controller.c
@@ -426,18 +426,22 @@ EXPORT_SYMBOL_GPL(snd_hdac_bus_stop_chip);
426 * @bus: HD-audio core bus 426 * @bus: HD-audio core bus
427 * @status: INTSTS register value 427 * @status: INTSTS register value
428 * @ask: callback to be called for woken streams 428 * @ask: callback to be called for woken streams
429 *
430 * Returns the bits of handled streams, or zero if no stream is handled.
429 */ 431 */
430void snd_hdac_bus_handle_stream_irq(struct hdac_bus *bus, unsigned int status, 432int snd_hdac_bus_handle_stream_irq(struct hdac_bus *bus, unsigned int status,
431 void (*ack)(struct hdac_bus *, 433 void (*ack)(struct hdac_bus *,
432 struct hdac_stream *)) 434 struct hdac_stream *))
433{ 435{
434 struct hdac_stream *azx_dev; 436 struct hdac_stream *azx_dev;
435 u8 sd_status; 437 u8 sd_status;
438 int handled = 0;
436 439
437 list_for_each_entry(azx_dev, &bus->stream_list, list) { 440 list_for_each_entry(azx_dev, &bus->stream_list, list) {
438 if (status & azx_dev->sd_int_sta_mask) { 441 if (status & azx_dev->sd_int_sta_mask) {
439 sd_status = snd_hdac_stream_readb(azx_dev, SD_STS); 442 sd_status = snd_hdac_stream_readb(azx_dev, SD_STS);
440 snd_hdac_stream_writeb(azx_dev, SD_STS, SD_INT_MASK); 443 snd_hdac_stream_writeb(azx_dev, SD_STS, SD_INT_MASK);
444 handled |= 1 << azx_dev->index;
441 if (!azx_dev->substream || !azx_dev->running || 445 if (!azx_dev->substream || !azx_dev->running ||
442 !(sd_status & SD_INT_COMPLETE)) 446 !(sd_status & SD_INT_COMPLETE))
443 continue; 447 continue;
@@ -445,6 +449,7 @@ void snd_hdac_bus_handle_stream_irq(struct hdac_bus *bus, unsigned int status,
445 ack(bus, azx_dev); 449 ack(bus, azx_dev);
446 } 450 }
447 } 451 }
452 return handled;
448} 453}
449EXPORT_SYMBOL_GPL(snd_hdac_bus_handle_stream_irq); 454EXPORT_SYMBOL_GPL(snd_hdac_bus_handle_stream_irq);
450 455
diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c
index 37cf9cee9835..27de8015717d 100644
--- a/sound/pci/hda/hda_controller.c
+++ b/sound/pci/hda/hda_controller.c
@@ -930,6 +930,8 @@ irqreturn_t azx_interrupt(int irq, void *dev_id)
930 struct azx *chip = dev_id; 930 struct azx *chip = dev_id;
931 struct hdac_bus *bus = azx_bus(chip); 931 struct hdac_bus *bus = azx_bus(chip);
932 u32 status; 932 u32 status;
933 bool active, handled = false;
934 int repeat = 0; /* count for avoiding endless loop */
933 935
934#ifdef CONFIG_PM 936#ifdef CONFIG_PM
935 if (azx_has_pm_runtime(chip)) 937 if (azx_has_pm_runtime(chip))
@@ -939,33 +941,36 @@ irqreturn_t azx_interrupt(int irq, void *dev_id)
939 941
940 spin_lock(&bus->reg_lock); 942 spin_lock(&bus->reg_lock);
941 943
942 if (chip->disabled) { 944 if (chip->disabled)
943 spin_unlock(&bus->reg_lock); 945 goto unlock;
944 return IRQ_NONE;
945 }
946
947 status = azx_readl(chip, INTSTS);
948 if (status == 0 || status == 0xffffffff) {
949 spin_unlock(&bus->reg_lock);
950 return IRQ_NONE;
951 }
952 946
953 snd_hdac_bus_handle_stream_irq(bus, status, stream_update); 947 do {
948 status = azx_readl(chip, INTSTS);
949 if (status == 0 || status == 0xffffffff)
950 break;
954 951
955 /* clear rirb int */ 952 handled = true;
956 status = azx_readb(chip, RIRBSTS); 953 active = false;
957 if (status & RIRB_INT_MASK) { 954 if (snd_hdac_bus_handle_stream_irq(bus, status, stream_update))
958 if (status & RIRB_INT_RESPONSE) { 955 active = true;
959 if (chip->driver_caps & AZX_DCAPS_CTX_WORKAROUND) 956
960 udelay(80); 957 /* clear rirb int */
961 snd_hdac_bus_update_rirb(bus); 958 status = azx_readb(chip, RIRBSTS);
959 if (status & RIRB_INT_MASK) {
960 active = true;
961 if (status & RIRB_INT_RESPONSE) {
962 if (chip->driver_caps & AZX_DCAPS_CTX_WORKAROUND)
963 udelay(80);
964 snd_hdac_bus_update_rirb(bus);
965 }
966 azx_writeb(chip, RIRBSTS, RIRB_INT_MASK);
962 } 967 }
963 azx_writeb(chip, RIRBSTS, RIRB_INT_MASK); 968 } while (active && ++repeat < 10);
964 }
965 969
970 unlock:
966 spin_unlock(&bus->reg_lock); 971 spin_unlock(&bus->reg_lock);
967 972
968 return IRQ_HANDLED; 973 return IRQ_RETVAL(handled);
969} 974}
970EXPORT_SYMBOL_GPL(azx_interrupt); 975EXPORT_SYMBOL_GPL(azx_interrupt);
971 976
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index ce6b97f31390..e5240cb3749f 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -363,7 +363,10 @@ enum {
363 ((pci)->device == 0x0d0c) || \ 363 ((pci)->device == 0x0d0c) || \
364 ((pci)->device == 0x160c)) 364 ((pci)->device == 0x160c))
365 365
366#define IS_BROXTON(pci) ((pci)->device == 0x5a98) 366#define IS_SKL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa170)
367#define IS_SKL_LP(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x9d70)
368#define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98)
369#define IS_SKL_PLUS(pci) (IS_SKL(pci) || IS_SKL_LP(pci) || IS_BXT(pci))
367 370
368static char *driver_short_names[] = { 371static char *driver_short_names[] = {
369 [AZX_DRIVER_ICH] = "HDA Intel", 372 [AZX_DRIVER_ICH] = "HDA Intel",
@@ -540,13 +543,13 @@ static void hda_intel_init_chip(struct azx *chip, bool full_reset)
540 543
541 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) 544 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
542 snd_hdac_set_codec_wakeup(bus, true); 545 snd_hdac_set_codec_wakeup(bus, true);
543 if (IS_BROXTON(pci)) { 546 if (IS_SKL_PLUS(pci)) {
544 pci_read_config_dword(pci, INTEL_HDA_CGCTL, &val); 547 pci_read_config_dword(pci, INTEL_HDA_CGCTL, &val);
545 val = val & ~INTEL_HDA_CGCTL_MISCBDCGE; 548 val = val & ~INTEL_HDA_CGCTL_MISCBDCGE;
546 pci_write_config_dword(pci, INTEL_HDA_CGCTL, val); 549 pci_write_config_dword(pci, INTEL_HDA_CGCTL, val);
547 } 550 }
548 azx_init_chip(chip, full_reset); 551 azx_init_chip(chip, full_reset);
549 if (IS_BROXTON(pci)) { 552 if (IS_SKL_PLUS(pci)) {
550 pci_read_config_dword(pci, INTEL_HDA_CGCTL, &val); 553 pci_read_config_dword(pci, INTEL_HDA_CGCTL, &val);
551 val = val | INTEL_HDA_CGCTL_MISCBDCGE; 554 val = val | INTEL_HDA_CGCTL_MISCBDCGE;
552 pci_write_config_dword(pci, INTEL_HDA_CGCTL, val); 555 pci_write_config_dword(pci, INTEL_HDA_CGCTL, val);
@@ -555,7 +558,7 @@ static void hda_intel_init_chip(struct azx *chip, bool full_reset)
555 snd_hdac_set_codec_wakeup(bus, false); 558 snd_hdac_set_codec_wakeup(bus, false);
556 559
557 /* reduce dma latency to avoid noise */ 560 /* reduce dma latency to avoid noise */
558 if (IS_BROXTON(pci)) 561 if (IS_BXT(pci))
559 bxt_reduce_dma_latency(chip); 562 bxt_reduce_dma_latency(chip);
560} 563}
561 564
@@ -977,11 +980,6 @@ static int azx_resume(struct device *dev)
977/* put codec down to D3 at hibernation for Intel SKL+; 980/* put codec down to D3 at hibernation for Intel SKL+;
978 * otherwise BIOS may still access the codec and screw up the driver 981 * otherwise BIOS may still access the codec and screw up the driver
979 */ 982 */
980#define IS_SKL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa170)
981#define IS_SKL_LP(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x9d70)
982#define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98)
983#define IS_SKL_PLUS(pci) (IS_SKL(pci) || IS_SKL_LP(pci) || IS_BXT(pci))
984
985static int azx_freeze_noirq(struct device *dev) 983static int azx_freeze_noirq(struct device *dev)
986{ 984{
987 struct pci_dev *pci = to_pci_dev(dev); 985 struct pci_dev *pci = to_pci_dev(dev);
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index efd4980cffb8..1f357cd72d9c 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3801,6 +3801,10 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
3801 3801
3802static void alc_headset_mode_default(struct hda_codec *codec) 3802static void alc_headset_mode_default(struct hda_codec *codec)
3803{ 3803{
3804 static struct coef_fw coef0225[] = {
3805 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
3806 {}
3807 };
3804 static struct coef_fw coef0255[] = { 3808 static struct coef_fw coef0255[] = {
3805 WRITE_COEF(0x45, 0xc089), 3809 WRITE_COEF(0x45, 0xc089),
3806 WRITE_COEF(0x45, 0xc489), 3810 WRITE_COEF(0x45, 0xc489),
@@ -3842,6 +3846,9 @@ static void alc_headset_mode_default(struct hda_codec *codec)
3842 }; 3846 };
3843 3847
3844 switch (codec->core.vendor_id) { 3848 switch (codec->core.vendor_id) {
3849 case 0x10ec0225:
3850 alc_process_coef_fw(codec, coef0225);
3851 break;
3845 case 0x10ec0255: 3852 case 0x10ec0255:
3846 case 0x10ec0256: 3853 case 0x10ec0256:
3847 alc_process_coef_fw(codec, coef0255); 3854 alc_process_coef_fw(codec, coef0255);
@@ -4749,6 +4756,9 @@ enum {
4749 ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE, 4756 ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE,
4750 ALC293_FIXUP_LENOVO_SPK_NOISE, 4757 ALC293_FIXUP_LENOVO_SPK_NOISE,
4751 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, 4758 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
4759 ALC255_FIXUP_DELL_SPK_NOISE,
4760 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
4761 ALC280_FIXUP_HP_HEADSET_MIC,
4752}; 4762};
4753 4763
4754static const struct hda_fixup alc269_fixups[] = { 4764static const struct hda_fixup alc269_fixups[] = {
@@ -5368,6 +5378,29 @@ static const struct hda_fixup alc269_fixups[] = {
5368 .type = HDA_FIXUP_FUNC, 5378 .type = HDA_FIXUP_FUNC,
5369 .v.func = alc233_fixup_lenovo_line2_mic_hotkey, 5379 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
5370 }, 5380 },
5381 [ALC255_FIXUP_DELL_SPK_NOISE] = {
5382 .type = HDA_FIXUP_FUNC,
5383 .v.func = alc_fixup_disable_aamix,
5384 .chained = true,
5385 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
5386 },
5387 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
5388 .type = HDA_FIXUP_VERBS,
5389 .v.verbs = (const struct hda_verb[]) {
5390 /* Disable pass-through path for FRONT 14h */
5391 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
5392 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
5393 {}
5394 },
5395 .chained = true,
5396 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
5397 },
5398 [ALC280_FIXUP_HP_HEADSET_MIC] = {
5399 .type = HDA_FIXUP_FUNC,
5400 .v.func = alc_fixup_disable_aamix,
5401 .chained = true,
5402 .chain_id = ALC269_FIXUP_HEADSET_MIC,
5403 },
5371}; 5404};
5372 5405
5373static const struct snd_pci_quirk alc269_fixup_tbl[] = { 5406static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -5410,6 +5443,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
5410 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), 5443 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
5411 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK), 5444 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
5412 SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE), 5445 SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE),
5446 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
5413 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 5447 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
5414 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), 5448 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
5415 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), 5449 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
@@ -5470,6 +5504,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
5470 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 5504 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
5471 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 5505 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
5472 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 5506 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
5507 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
5473 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), 5508 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
5474 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 5509 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
5475 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 5510 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
@@ -5638,10 +5673,10 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
5638 {0x21, 0x03211020} 5673 {0x21, 0x03211020}
5639 5674
5640static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { 5675static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
5641 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 5676 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
5642 ALC225_STANDARD_PINS, 5677 ALC225_STANDARD_PINS,
5643 {0x14, 0x901701a0}), 5678 {0x14, 0x901701a0}),
5644 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 5679 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
5645 ALC225_STANDARD_PINS, 5680 ALC225_STANDARD_PINS,
5646 {0x14, 0x901701b0}), 5681 {0x14, 0x901701b0}),
5647 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, 5682 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,