Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'sound-3.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"This update contains mostly only fixes for Realtek HD-audio codec
driver in addition to a long-standing sysfs warning bug fix for
USB-audio.

One significant fix for Realtek codecs is the update of EAPD init
codes. This avoids invalid COEF setups for some codec models and may
fix "lost sound" in some cases.

The rest are a bit high volume but only new quirks and ALC668-specific
COEF tables"

* tag 'sound-3.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda/realtek - Restore default value for ALC668
ALSA: usb-audio: Fix device_del() sysfs warnings at disconnect
ALSA: hda - fix mute led problem for three HP laptops
ALSA: hda/realtek - Update Initial AMP for EAPD control
ALSA: hda - change three SSID quirks to one pin quirk
ALSA: hda - Set GPIO 4 low for a few HP machines
ALSA: hda - Add ultra dock support for Thinkpad X240.

+95 -36
+88 -34
sound/pci/hda/patch_realtek.c
··· 291 291 /* additional initialization for ALC888 variants */ 292 292 static void alc888_coef_init(struct hda_codec *codec) 293 293 { 294 - if (alc_get_coef0(codec) == 0x20) 295 - /* alc888S-VC */ 296 - alc_write_coef_idx(codec, 7, 0x830); 297 - else 298 - /* alc888-VB */ 299 - alc_write_coef_idx(codec, 7, 0x3030); 300 - } 301 - 302 - /* additional initialization for ALC889 variants */ 303 - static void alc889_coef_init(struct hda_codec *codec) 304 - { 305 - alc_update_coef_idx(codec, 7, 0, 0x2010); 294 + switch (alc_get_coef0(codec) & 0x00f0) { 295 + /* alc888-VA */ 296 + case 0x00: 297 + /* alc888-VB */ 298 + case 0x10: 299 + alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */ 300 + break; 301 + } 306 302 } 307 303 308 304 /* turn on/off EAPD control (only if available) */ ··· 355 359 case 0x10ec0260: 356 360 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010); 357 361 break; 358 - case 0x10ec0262: 359 362 case 0x10ec0880: 360 363 case 0x10ec0882: 361 364 case 0x10ec0883: 362 365 case 0x10ec0885: 363 - case 0x10ec0887: 364 - /*case 0x10ec0889:*/ /* this causes an SPDIF problem */ 365 - case 0x10ec0900: 366 - alc889_coef_init(codec); 366 + alc_update_coef_idx(codec, 7, 0, 0x2030); 367 367 break; 368 368 case 0x10ec0888: 369 369 alc888_coef_init(codec); 370 370 break; 371 - #if 0 /* XXX: This may cause the silent output on speaker on some machines */ 372 - case 0x10ec0267: 373 - case 0x10ec0268: 374 - alc_update_coef_idx(codec, 7, 0, 0x3000); 375 - break; 376 - #endif /* XXX */ 377 371 } 378 372 break; 379 373 } ··· 1696 1710 { 1697 1711 if (action != HDA_FIXUP_ACT_INIT) 1698 1712 return; 1699 - alc889_coef_init(codec); 1713 + alc_update_coef_idx(codec, 7, 0, 0x2030); 1700 1714 } 1701 1715 1702 1716 /* toggle speaker-output according to the hp-jack state */ ··· 3336 3350 } 3337 3351 } 3338 3352 3353 + static void alc280_fixup_hp_gpio4(struct hda_codec *codec, 3354 + const struct hda_fixup *fix, int action) 3355 + { 3356 + /* Like hp_gpio_mic1_led, but also needs GPIO4 low to enable headphone amp */ 3357 + struct alc_spec *spec = codec->spec; 3358 + static const struct hda_verb gpio_init[] = { 3359 + { 0x01, AC_VERB_SET_GPIO_MASK, 0x18 }, 3360 + { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x18 }, 3361 + {} 3362 + }; 3363 + 3364 + if (action == HDA_FIXUP_ACT_PRE_PROBE) { 3365 + spec->gen.vmaster_mute.hook = alc269_fixup_hp_gpio_mute_hook; 3366 + spec->gen.cap_sync_hook = alc269_fixup_hp_cap_mic_mute_hook; 3367 + spec->gpio_led = 0; 3368 + spec->cap_mute_led_nid = 0x18; 3369 + snd_hda_add_verbs(codec, gpio_init); 3370 + codec->power_filter = led_power_filter; 3371 + } 3372 + } 3373 + 3339 3374 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, 3340 3375 const struct hda_fixup *fix, int action) 3341 3376 { ··· 4224 4217 ALC283_FIXUP_BXBT2807_MIC, 4225 4218 ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED, 4226 4219 ALC282_FIXUP_ASPIRE_V5_PINS, 4220 + ALC280_FIXUP_HP_GPIO4, 4227 4221 }; 4228 4222 4229 4223 static const struct hda_fixup alc269_fixups[] = { ··· 4688 4680 { }, 4689 4681 }, 4690 4682 }, 4691 - 4683 + [ALC280_FIXUP_HP_GPIO4] = { 4684 + .type = HDA_FIXUP_FUNC, 4685 + .v.func = alc280_fixup_hp_gpio4, 4686 + }, 4692 4687 }; 4693 4688 4694 4689 static const struct snd_pci_quirk alc269_fixup_tbl[] = { ··· 4739 4728 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4740 4729 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4741 4730 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4742 - SND_PCI_QUIRK(0x103c, 0x8004, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4743 4731 /* ALC290 */ 4744 4732 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4745 4733 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4746 4734 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4747 4735 SND_PCI_QUIRK(0x103c, 0x2246, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4748 - SND_PCI_QUIRK(0x103c, 0x2247, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4749 - SND_PCI_QUIRK(0x103c, 0x2248, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4750 - SND_PCI_QUIRK(0x103c, 0x2249, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4751 4736 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4752 4737 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4753 4738 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4754 4739 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4755 4740 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4756 - SND_PCI_QUIRK(0x103c, 0x2258, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4757 4741 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4758 4742 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4759 4743 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), ··· 4757 4751 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4758 4752 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4759 4753 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4760 - SND_PCI_QUIRK(0x103c, 0x2277, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4761 4754 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), 4762 4755 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4763 4756 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), ··· 4809 4804 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), 4810 4805 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK), 4811 4806 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK), 4812 - SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 4807 + SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK), 4813 4808 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 4814 4809 SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP), 4815 4810 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), ··· 4989 4984 {0x17, 0x40000000}, 4990 4985 {0x1d, 0x40700001}, 4991 4986 {0x21, 0x02211040}), 4987 + SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, 4988 + {0x12, 0x90a60130}, 4989 + {0x13, 0x40000000}, 4990 + {0x14, 0x90170110}, 4991 + {0x15, 0x0421101f}, 4992 + {0x16, 0x411111f0}, 4993 + {0x17, 0x411111f0}, 4994 + {0x18, 0x411111f0}, 4995 + {0x19, 0x411111f0}, 4996 + {0x1a, 0x04a11020}, 4997 + {0x1b, 0x411111f0}, 4998 + {0x1d, 0x40748605}, 4999 + {0x1e, 0x411111f0}), 4992 5000 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED, 4993 5001 {0x12, 0x90a60140}, 4994 5002 {0x13, 0x40000000}, ··· 5669 5651 } 5670 5652 } 5671 5653 5654 + static struct coef_fw alc668_coefs[] = { 5655 + WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0), 5656 + WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80), 5657 + WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0), 5658 + WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f), 5659 + WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001), 5660 + WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940), 5661 + WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0), 5662 + WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418), 5663 + WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468), 5664 + WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418), 5665 + WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00), 5666 + WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000), 5667 + WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0), 5668 + WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480), 5669 + WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0), 5670 + WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040), 5671 + WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697), 5672 + WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab), 5673 + WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02), 5674 + WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6), 5675 + {} 5676 + }; 5677 + 5678 + static void alc668_restore_default_value(struct hda_codec *codec) 5679 + { 5680 + alc_process_coef_fw(codec, alc668_coefs); 5681 + } 5682 + 5672 5683 enum { 5673 5684 ALC662_FIXUP_ASPIRE, 5674 5685 ALC662_FIXUP_LED_GPIO1, ··· 6165 6118 6166 6119 alc_fix_pll_init(codec, 0x20, 0x04, 15); 6167 6120 6168 - spec->init_hook = alc662_fill_coef; 6169 - alc662_fill_coef(codec); 6121 + switch (codec->vendor_id) { 6122 + case 0x10ec0668: 6123 + spec->init_hook = alc668_restore_default_value; 6124 + break; 6125 + default: 6126 + spec->init_hook = alc662_fill_coef; 6127 + alc662_fill_coef(codec); 6128 + break; 6129 + } 6170 6130 6171 6131 snd_hda_pick_fixup(codec, alc662_fixup_models, 6172 6132 alc662_fixup_tbl, alc662_fixups);
+7 -2
sound/usb/card.c
··· 591 591 { 592 592 struct snd_card *card; 593 593 struct list_head *p; 594 + bool was_shutdown; 594 595 595 596 if (chip == (void *)-1L) 596 597 return; 597 598 598 599 card = chip->card; 599 600 down_write(&chip->shutdown_rwsem); 601 + was_shutdown = chip->shutdown; 600 602 chip->shutdown = 1; 601 603 up_write(&chip->shutdown_rwsem); 602 604 603 605 mutex_lock(&register_mutex); 604 - chip->num_interfaces--; 605 - if (chip->num_interfaces <= 0) { 606 + if (!was_shutdown) { 606 607 struct snd_usb_endpoint *ep; 607 608 608 609 snd_card_disconnect(card); ··· 623 622 list_for_each(p, &chip->mixer_list) { 624 623 snd_usb_mixer_disconnect(p); 625 624 } 625 + } 626 + 627 + chip->num_interfaces--; 628 + if (chip->num_interfaces <= 0) { 626 629 usb_chip[chip->index] = NULL; 627 630 mutex_unlock(&register_mutex); 628 631 snd_card_free_when_closed(card);