Merge branch 'topic/hda' into for-linus

+879 -487
+5
Documentation/sound/alsa/HD-Audio-Models.txt
··· 124 124 asus-a7m ASUS A7M 125 125 macpro MacPro support 126 126 mb5 Macbook 5,1 127 + macmini3 Macmini 3,1 128 + mba21 Macbook Air 2,1 127 129 mbp3 Macbook Pro rev3 128 130 imac24 iMac 24'' with jack detection 129 131 imac91 iMac 9,1 ··· 281 279 laptop Basic Laptop config (default) 282 280 hp HP Spartan laptop 283 281 hp-dv6736 HP dv6736 282 + hp-f700 HP Compaq Presario F700 284 283 lenovo-x200 Lenovo X200 laptop 284 + toshiba Toshiba Satellite M300 285 285 286 286 Conexant 5066 287 287 ============= 288 288 laptop Basic Laptop config (default) 289 289 dell-laptop Dell laptops 290 290 olpc-xo-1_5 OLPC XO 1.5 291 + ideapad Lenovo IdeaPad U150 291 292 292 293 STAC9200 293 294 ========
+27
Documentation/sound/alsa/HD-Audio.txt
··· 452 452 sysfs entries, and the lines after `[hint]` are parsed as `hints` 453 453 sysfs entries, respectively. 454 454 455 + Another example to override the codec vendor id from 0x12345678 to 456 + 0xdeadbeef is like below: 457 + ------------------------------------------------------------------------ 458 + [codec] 459 + 0x12345678 0xabcd1234 2 460 + 461 + [vendor_id] 462 + 0xdeadbeef 463 + ------------------------------------------------------------------------ 464 + 465 + In the similar way, you can override the codec subsystem_id via 466 + `[subsystem_id]`, the revision id via `[revision_id]` line. 467 + Also, the codec chip name can be rewritten via `[chip_name]` line. 468 + ------------------------------------------------------------------------ 469 + [codec] 470 + 0x12345678 0xabcd1234 2 471 + 472 + [subsystem_id] 473 + 0xffff1111 474 + 475 + [revision_id] 476 + 0x10 477 + 478 + [chip_name] 479 + My-own NEWS-0002 480 + ------------------------------------------------------------------------ 481 + 455 482 The hd-audio driver reads the file via request_firmware(). Thus, 456 483 a patch file has to be located on the appropriate firmware path, 457 484 typically, /lib/firmware. For example, when you pass the option
+4 -2
sound/pci/hda/hda_codec.c
··· 2767 2767 snd_hda_codec_read(codec, fg, 0, AC_VERB_SET_POWER_STATE, 2768 2768 power_state); 2769 2769 /* partial workaround for "azx_get_response timeout" */ 2770 - if (power_state == AC_PWRST_D0) 2770 + if (power_state == AC_PWRST_D0 && 2771 + (codec->vendor_id & 0xffff0000) == 0x14f10000) 2771 2772 msleep(10); 2772 2773 2773 2774 nid = codec->start_nid; ··· 2802 2801 if (power_state == AC_PWRST_D0) { 2803 2802 unsigned long end_time; 2804 2803 int state; 2805 - msleep(10); 2806 2804 /* wait until the codec reachs to D0 */ 2807 2805 end_time = jiffies + msecs_to_jiffies(500); 2808 2806 do { ··· 3275 3275 3276 3276 /* 3277 3277 * get the empty PCM device number to assign 3278 + * 3279 + * note the max device number is limited by HDA_MAX_PCMS, currently 10 3278 3280 */ 3279 3281 static int get_empty_pcm_device(struct hda_bus *bus, int type) 3280 3282 {
+3
sound/pci/hda/hda_codec.h
··· 527 527 /* max. codec address */ 528 528 #define HDA_MAX_CODEC_ADDRESS 0x0f 529 529 530 + /* max number of PCM devics per card */ 531 + #define HDA_MAX_PCMS 10 532 + 530 533 /* 531 534 * generic arrays 532 535 */
+38 -15
sound/pci/hda/hda_hwdep.c
··· 625 625 LINE_MODE_PINCFG, 626 626 LINE_MODE_VERB, 627 627 LINE_MODE_HINT, 628 + LINE_MODE_VENDOR_ID, 629 + LINE_MODE_SUBSYSTEM_ID, 630 + LINE_MODE_REVISION_ID, 631 + LINE_MODE_CHIP_NAME, 628 632 NUM_LINE_MODES, 629 633 }; 630 634 ··· 658 654 } 659 655 660 656 /* parse the contents after the other command tags, [pincfg], [verb], 661 - * [hint] and [model] 657 + * [vendor_id], [subsystem_id], [revision_id], [chip_name], [hint] and [model] 662 658 * just pass to the sysfs helper (only when any codec was specified) 663 659 */ 664 660 static void parse_pincfg_mode(char *buf, struct hda_bus *bus, 665 661 struct hda_codec **codecp) 666 662 { 667 - if (!*codecp) 668 - return; 669 663 parse_user_pin_configs(*codecp, buf); 670 664 } 671 665 672 666 static void parse_verb_mode(char *buf, struct hda_bus *bus, 673 667 struct hda_codec **codecp) 674 668 { 675 - if (!*codecp) 676 - return; 677 669 parse_init_verbs(*codecp, buf); 678 670 } 679 671 680 672 static void parse_hint_mode(char *buf, struct hda_bus *bus, 681 673 struct hda_codec **codecp) 682 674 { 683 - if (!*codecp) 684 - return; 685 675 parse_hints(*codecp, buf); 686 676 } 687 677 688 678 static void parse_model_mode(char *buf, struct hda_bus *bus, 689 679 struct hda_codec **codecp) 690 680 { 691 - if (!*codecp) 692 - return; 693 681 kfree((*codecp)->modelname); 694 682 (*codecp)->modelname = kstrdup(buf, GFP_KERNEL); 695 683 } 696 684 685 + static void parse_chip_name_mode(char *buf, struct hda_bus *bus, 686 + struct hda_codec **codecp) 687 + { 688 + kfree((*codecp)->chip_name); 689 + (*codecp)->chip_name = kstrdup(buf, GFP_KERNEL); 690 + } 691 + 692 + #define DEFINE_PARSE_ID_MODE(name) \ 693 + static void parse_##name##_mode(char *buf, struct hda_bus *bus, \ 694 + struct hda_codec **codecp) \ 695 + { \ 696 + unsigned long val; \ 697 + if (!strict_strtoul(buf, 0, &val)) \ 698 + (*codecp)->name = val; \ 699 + } 700 + 701 + DEFINE_PARSE_ID_MODE(vendor_id); 702 + DEFINE_PARSE_ID_MODE(subsystem_id); 703 + DEFINE_PARSE_ID_MODE(revision_id); 704 + 705 + 697 706 struct hda_patch_item { 698 707 const char *tag; 699 708 void (*parser)(char *buf, struct hda_bus *bus, struct hda_codec **retc); 709 + int need_codec; 700 710 }; 701 711 702 712 static struct hda_patch_item patch_items[NUM_LINE_MODES] = { 703 - [LINE_MODE_CODEC] = { "[codec]", parse_codec_mode }, 704 - [LINE_MODE_MODEL] = { "[model]", parse_model_mode }, 705 - [LINE_MODE_VERB] = { "[verb]", parse_verb_mode }, 706 - [LINE_MODE_PINCFG] = { "[pincfg]", parse_pincfg_mode }, 707 - [LINE_MODE_HINT] = { "[hint]", parse_hint_mode }, 713 + [LINE_MODE_CODEC] = { "[codec]", parse_codec_mode, 0 }, 714 + [LINE_MODE_MODEL] = { "[model]", parse_model_mode, 1 }, 715 + [LINE_MODE_VERB] = { "[verb]", parse_verb_mode, 1 }, 716 + [LINE_MODE_PINCFG] = { "[pincfg]", parse_pincfg_mode, 1 }, 717 + [LINE_MODE_HINT] = { "[hint]", parse_hint_mode, 1 }, 718 + [LINE_MODE_VENDOR_ID] = { "[vendor_id]", parse_vendor_id_mode, 1 }, 719 + [LINE_MODE_SUBSYSTEM_ID] = { "[subsystem_id]", parse_subsystem_id_mode, 1 }, 720 + [LINE_MODE_REVISION_ID] = { "[revision_id]", parse_revision_id_mode, 1 }, 721 + [LINE_MODE_CHIP_NAME] = { "[chip_name]", parse_chip_name_mode, 1 }, 708 722 }; 709 723 710 724 /* check the line starting with '[' -- change the parser mode accodingly */ ··· 805 783 continue; 806 784 if (*buf == '[') 807 785 line_mode = parse_line_mode(buf, bus); 808 - else if (patch_items[line_mode].parser) 786 + else if (patch_items[line_mode].parser && 787 + (codec || !patch_items[line_mode].need_codec)) 809 788 patch_items[line_mode].parser(buf, bus, &codec); 810 789 } 811 790 release_firmware(fw);
+17 -11
sound/pci/hda/hda_intel.c
··· 125 125 "{Intel, ICH9}," 126 126 "{Intel, ICH10}," 127 127 "{Intel, PCH}," 128 + "{Intel, CPT}," 128 129 "{Intel, SCH}," 129 130 "{ATI, SB450}," 130 131 "{ATI, SB600}," ··· 260 259 #define AZX_MAX_FRAG 32 261 260 /* max buffer size - no h/w limit, you can increase as you like */ 262 261 #define AZX_MAX_BUF_SIZE (1024*1024*1024) 263 - /* max number of PCM devics per card */ 264 - #define AZX_MAX_PCMS 8 265 262 266 263 /* RIRB int mask: overrun[2], response[0] */ 267 264 #define RIRB_INT_RESPONSE 0x01 ··· 407 408 struct azx_dev *azx_dev; 408 409 409 410 /* PCM */ 410 - struct snd_pcm *pcm[AZX_MAX_PCMS]; 411 + struct snd_pcm *pcm[HDA_MAX_PCMS]; 411 412 412 413 /* HD codec */ 413 414 unsigned short codec_mask; ··· 448 449 /* driver types */ 449 450 enum { 450 451 AZX_DRIVER_ICH, 452 + AZX_DRIVER_PCH, 451 453 AZX_DRIVER_SCH, 452 454 AZX_DRIVER_ATI, 453 455 AZX_DRIVER_ATIHDMI, ··· 463 463 464 464 static char *driver_short_names[] __devinitdata = { 465 465 [AZX_DRIVER_ICH] = "HDA Intel", 466 + [AZX_DRIVER_PCH] = "HDA Intel PCH", 466 467 [AZX_DRIVER_SCH] = "HDA Intel MID", 467 468 [AZX_DRIVER_ATI] = "HDA ATI SB", 468 469 [AZX_DRIVER_ATIHDMI] = "HDA ATI HDMI", ··· 969 968 azx_dev->insufficient = 1; 970 969 971 970 /* enable SIE */ 972 - azx_writeb(chip, INTCTL, 973 - azx_readb(chip, INTCTL) | (1 << azx_dev->index)); 971 + azx_writel(chip, INTCTL, 972 + azx_readl(chip, INTCTL) | (1 << azx_dev->index)); 974 973 /* set DMA start and interrupt mask */ 975 974 azx_sd_writeb(azx_dev, SD_CTL, azx_sd_readb(azx_dev, SD_CTL) | 976 975 SD_CTL_DMA_START | SD_INT_MASK); ··· 989 988 { 990 989 azx_stream_clear(chip, azx_dev); 991 990 /* disable SIE */ 992 - azx_writeb(chip, INTCTL, 993 - azx_readb(chip, INTCTL) & ~(1 << azx_dev->index)); 991 + azx_writel(chip, INTCTL, 992 + azx_readl(chip, INTCTL) & ~(1 << azx_dev->index)); 994 993 } 995 994 996 995 ··· 1066 1065 0x01, NVIDIA_HDA_ENABLE_COHBIT); 1067 1066 break; 1068 1067 case AZX_DRIVER_SCH: 1068 + case AZX_DRIVER_PCH: 1069 1069 pci_read_config_word(chip->pci, INTEL_SCH_HDA_DEVC, &snoop); 1070 1070 if (snoop & INTEL_SCH_HDA_DEVC_NOSNOOP) { 1071 1071 pci_write_config_word(chip->pci, INTEL_SCH_HDA_DEVC, ··· 1352 1350 if (chip->initialized) { 1353 1351 int i; 1354 1352 1355 - for (i = 0; i < AZX_MAX_PCMS; i++) 1353 + for (i = 0; i < HDA_MAX_PCMS; i++) 1356 1354 snd_pcm_suspend_all(chip->pcm[i]); 1357 1355 snd_hda_suspend(chip->bus); 1358 1356 snd_hda_resume(chip->bus); ··· 1414 1412 chip->codec_mask &= ~(1 << c); 1415 1413 /* More badly, accessing to a non-existing 1416 1414 * codec often screws up the controller chip, 1417 - * and distrubs the further communications. 1415 + * and disturbs the further communications. 1418 1416 * Thus if an error occurs during probing, 1419 1417 * better to reset the controller chip to 1420 1418 * get back to the sanity state. ··· 1985 1983 int pcm_dev = cpcm->device; 1986 1984 int s, err; 1987 1985 1988 - if (pcm_dev >= AZX_MAX_PCMS) { 1986 + if (pcm_dev >= HDA_MAX_PCMS) { 1989 1987 snd_printk(KERN_ERR SFX "Invalid PCM device number %d\n", 1990 1988 pcm_dev); 1991 1989 return -EINVAL; ··· 2141 2139 2142 2140 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 2143 2141 azx_clear_irq_pending(chip); 2144 - for (i = 0; i < AZX_MAX_PCMS; i++) 2142 + for (i = 0; i < HDA_MAX_PCMS; i++) 2145 2143 snd_pcm_suspend_all(chip->pcm[i]); 2146 2144 if (chip->initialized) 2147 2145 snd_hda_suspend(chip->bus); ··· 2264 2262 SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB), 2265 2263 SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB), 2266 2264 SND_PCI_QUIRK(0x103c, 0x306d, "HP dv3", POS_FIX_LPIB), 2265 + SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB), 2267 2266 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB), 2268 2267 SND_PCI_QUIRK(0x1462, 0x1002, "MSI Wind U115", POS_FIX_LPIB), 2269 2268 {} ··· 2421 2418 if (bdl_pos_adj[dev] < 0) { 2422 2419 switch (chip->driver_type) { 2423 2420 case AZX_DRIVER_ICH: 2421 + case AZX_DRIVER_PCH: 2424 2422 bdl_pos_adj[dev] = 1; 2425 2423 break; 2426 2424 default: ··· 2700 2696 { PCI_DEVICE(0x8086, 0x3a6e), .driver_data = AZX_DRIVER_ICH }, 2701 2697 /* PCH */ 2702 2698 { PCI_DEVICE(0x8086, 0x3b56), .driver_data = AZX_DRIVER_ICH }, 2699 + /* CPT */ 2700 + { PCI_DEVICE(0x8086, 0x1c20), .driver_data = AZX_DRIVER_PCH }, 2703 2701 /* SCH */ 2704 2702 { PCI_DEVICE(0x8086, 0x811b), .driver_data = AZX_DRIVER_SCH }, 2705 2703 /* ATI SB 450/600 */
+1 -1
sound/pci/hda/patch_analog.c
··· 1098 1098 SND_PCI_QUIRK(0x1043, 0x81cb, "ASUS M2N", AD1986A_3STACK), 1099 1099 SND_PCI_QUIRK(0x1043, 0x8234, "ASUS M2N", AD1986A_3STACK), 1100 1100 SND_PCI_QUIRK(0x10de, 0xcb84, "ASUS A8N-VM", AD1986A_3STACK), 1101 - SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba", AD1986A_LAPTOP_EAPD), 1101 + SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba Satellite L40-10Q", AD1986A_3STACK), 1102 1102 SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK), 1103 1103 SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP), 1104 1104 SND_PCI_QUIRK(0x144d, 0xc024, "Samsung P50", AD1986A_SAMSUNG_P50),
+194 -61
sound/pci/hda/patch_conexant.c
··· 42 42 43 43 /* Conexant 5051 specific */ 44 44 45 - #define CXT5051_SPDIF_OUT 0x1C 45 + #define CXT5051_SPDIF_OUT 0x12 46 46 #define CXT5051_PORTB_EVENT 0x38 47 47 #define CXT5051_PORTC_EVENT 0x39 48 48 49 + #define AUTO_MIC_PORTB (1 << 1) 50 + #define AUTO_MIC_PORTC (1 << 2) 49 51 50 52 struct conexant_jack { 51 53 ··· 76 74 */ 77 75 unsigned int cur_eapd; 78 76 unsigned int hp_present; 79 - unsigned int no_auto_mic; 77 + unsigned int auto_mic; 80 78 unsigned int need_dac_fix; 81 79 82 80 /* capture */ ··· 113 111 114 112 unsigned int dell_automute; 115 113 unsigned int port_d_mode; 116 - unsigned int dell_vostro; 114 + unsigned int dell_vostro:1; 115 + unsigned int ideapad:1; 117 116 118 117 unsigned int ext_mic_present; 119 118 unsigned int recording; ··· 1606 1603 { 1607 1604 struct conexant_spec *spec = codec->spec; 1608 1605 unsigned int pinctl; 1606 + /* headphone pin */ 1607 + pinctl = (spec->hp_present && spec->cur_eapd) ? PIN_HP : 0; 1608 + snd_hda_codec_write(codec, 0x16, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 1609 + pinctl); 1610 + /* speaker pin */ 1609 1611 pinctl = (!spec->hp_present && spec->cur_eapd) ? PIN_OUT : 0; 1610 1612 snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 1611 1613 pinctl); ··· 1634 1626 struct conexant_spec *spec = codec->spec; 1635 1627 unsigned int present; 1636 1628 1637 - if (spec->no_auto_mic) 1629 + if (!(spec->auto_mic & AUTO_MIC_PORTB)) 1638 1630 return; 1639 1631 present = snd_hda_jack_detect(codec, 0x17); 1640 1632 snd_hda_codec_write(codec, 0x14, 0, ··· 1649 1641 unsigned int present; 1650 1642 hda_nid_t new_adc; 1651 1643 1652 - if (spec->no_auto_mic) 1644 + if (!(spec->auto_mic & AUTO_MIC_PORTC)) 1653 1645 return; 1654 1646 present = snd_hda_jack_detect(codec, 0x18); 1655 1647 if (present) ··· 1695 1687 conexant_report_jack(codec, nid); 1696 1688 } 1697 1689 1698 - static struct snd_kcontrol_new cxt5051_mixers[] = { 1699 - HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT), 1700 - HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT), 1701 - HDA_CODEC_VOLUME("External Mic Volume", 0x14, 0x01, HDA_INPUT), 1702 - HDA_CODEC_MUTE("External Mic Switch", 0x14, 0x01, HDA_INPUT), 1703 - HDA_CODEC_VOLUME("Docking Mic Volume", 0x15, 0x00, HDA_INPUT), 1704 - HDA_CODEC_MUTE("Docking Mic Switch", 0x15, 0x00, HDA_INPUT), 1690 + static struct snd_kcontrol_new cxt5051_playback_mixers[] = { 1705 1691 HDA_CODEC_VOLUME("Master Playback Volume", 0x10, 0x00, HDA_OUTPUT), 1706 1692 { 1707 1693 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, ··· 1705 1703 .put = cxt5051_hp_master_sw_put, 1706 1704 .private_value = 0x1a, 1707 1705 }, 1706 + {} 1707 + }; 1708 1708 1709 + static struct snd_kcontrol_new cxt5051_capture_mixers[] = { 1710 + HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT), 1711 + HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT), 1712 + HDA_CODEC_VOLUME("External Mic Volume", 0x14, 0x01, HDA_INPUT), 1713 + HDA_CODEC_MUTE("External Mic Switch", 0x14, 0x01, HDA_INPUT), 1714 + HDA_CODEC_VOLUME("Docking Mic Volume", 0x15, 0x00, HDA_INPUT), 1715 + HDA_CODEC_MUTE("Docking Mic Switch", 0x15, 0x00, HDA_INPUT), 1709 1716 {} 1710 1717 }; 1711 1718 ··· 1723 1712 HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT), 1724 1713 HDA_CODEC_VOLUME("External Mic Volume", 0x15, 0x00, HDA_INPUT), 1725 1714 HDA_CODEC_MUTE("External Mic Switch", 0x15, 0x00, HDA_INPUT), 1726 - HDA_CODEC_VOLUME("Master Playback Volume", 0x10, 0x00, HDA_OUTPUT), 1727 - { 1728 - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1729 - .name = "Master Playback Switch", 1730 - .info = cxt_eapd_info, 1731 - .get = cxt_eapd_get, 1732 - .put = cxt5051_hp_master_sw_put, 1733 - .private_value = 0x1a, 1734 - }, 1735 - 1736 1715 {} 1737 1716 }; 1738 1717 1739 1718 static struct snd_kcontrol_new cxt5051_hp_dv6736_mixers[] = { 1740 - HDA_CODEC_VOLUME("Mic Volume", 0x14, 0x00, HDA_INPUT), 1741 - HDA_CODEC_MUTE("Mic Switch", 0x14, 0x00, HDA_INPUT), 1742 - HDA_CODEC_VOLUME("Master Playback Volume", 0x10, 0x00, HDA_OUTPUT), 1743 - { 1744 - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1745 - .name = "Master Playback Switch", 1746 - .info = cxt_eapd_info, 1747 - .get = cxt_eapd_get, 1748 - .put = cxt5051_hp_master_sw_put, 1749 - .private_value = 0x1a, 1750 - }, 1751 - 1719 + HDA_CODEC_VOLUME("Capture Volume", 0x14, 0x00, HDA_INPUT), 1720 + HDA_CODEC_MUTE("Capture Switch", 0x14, 0x00, HDA_INPUT), 1752 1721 {} 1753 1722 }; 1754 1723 1755 1724 static struct snd_kcontrol_new cxt5051_f700_mixers[] = { 1756 - HDA_CODEC_VOLUME("Mic Volume", 0x14, 0x01, HDA_INPUT), 1757 - HDA_CODEC_MUTE("Mic Switch", 0x14, 0x01, HDA_INPUT), 1758 - HDA_CODEC_VOLUME("Master Playback Volume", 0x10, 0x00, HDA_OUTPUT), 1759 - { 1760 - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1761 - .name = "Master Playback Switch", 1762 - .info = cxt_eapd_info, 1763 - .get = cxt_eapd_get, 1764 - .put = cxt5051_hp_master_sw_put, 1765 - .private_value = 0x1a, 1766 - }, 1725 + HDA_CODEC_VOLUME("Capture Volume", 0x14, 0x01, HDA_INPUT), 1726 + HDA_CODEC_MUTE("Capture Switch", 0x14, 0x01, HDA_INPUT), 1727 + {} 1728 + }; 1767 1729 1730 + static struct snd_kcontrol_new cxt5051_toshiba_mixers[] = { 1731 + HDA_CODEC_VOLUME("Internal Mic Volume", 0x14, 0x00, HDA_INPUT), 1732 + HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT), 1733 + HDA_CODEC_VOLUME("External Mic Volume", 0x14, 0x01, HDA_INPUT), 1734 + HDA_CODEC_MUTE("External Mic Switch", 0x14, 0x01, HDA_INPUT), 1768 1735 {} 1769 1736 }; 1770 1737 ··· 1771 1782 /* EAPD */ 1772 1783 {0x1a, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ 1773 1784 {0x16, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CONEXANT_HP_EVENT}, 1774 - {0x17, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CXT5051_PORTB_EVENT}, 1775 - {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CXT5051_PORTC_EVENT}, 1776 1785 { } /* end */ 1777 1786 }; 1778 1787 ··· 1796 1809 /* EAPD */ 1797 1810 {0x1a, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ 1798 1811 {0x16, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CONEXANT_HP_EVENT}, 1799 - {0x17, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CXT5051_PORTB_EVENT}, 1800 1812 { } /* end */ 1801 1813 }; 1802 1814 ··· 1827 1841 /* EAPD */ 1828 1842 {0x1a, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ 1829 1843 {0x16, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CONEXANT_HP_EVENT}, 1830 - {0x17, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CXT5051_PORTB_EVENT}, 1831 - {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CXT5051_PORTC_EVENT}, 1832 1844 {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CONEXANT_HP_EVENT}, 1833 1845 { } /* end */ 1834 1846 }; 1835 1847 1836 1848 static struct hda_verb cxt5051_f700_init_verbs[] = { 1837 1849 /* Line in, Mic */ 1838 - {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x03}, 1850 + {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x03}, 1839 1851 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, 1840 1852 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0}, 1841 1853 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0}, ··· 1853 1869 /* EAPD */ 1854 1870 {0x1a, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ 1855 1871 {0x16, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CONEXANT_HP_EVENT}, 1856 - {0x17, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CXT5051_PORTB_EVENT}, 1857 1872 { } /* end */ 1858 1873 }; 1874 + 1875 + static void cxt5051_init_mic_port(struct hda_codec *codec, hda_nid_t nid, 1876 + unsigned int event) 1877 + { 1878 + snd_hda_codec_write(codec, nid, 0, 1879 + AC_VERB_SET_UNSOLICITED_ENABLE, 1880 + AC_USRSP_EN | event); 1881 + #ifdef CONFIG_SND_HDA_INPUT_JACK 1882 + conexant_add_jack(codec, nid, SND_JACK_MICROPHONE); 1883 + conexant_report_jack(codec, nid); 1884 + #endif 1885 + } 1859 1886 1860 1887 /* initialize jack-sensing, too */ 1861 1888 static int cxt5051_init(struct hda_codec *codec) 1862 1889 { 1890 + struct conexant_spec *spec = codec->spec; 1891 + 1863 1892 conexant_init(codec); 1864 1893 conexant_init_jacks(codec); 1894 + 1895 + if (spec->auto_mic & AUTO_MIC_PORTB) 1896 + cxt5051_init_mic_port(codec, 0x17, CXT5051_PORTB_EVENT); 1897 + if (spec->auto_mic & AUTO_MIC_PORTC) 1898 + cxt5051_init_mic_port(codec, 0x18, CXT5051_PORTC_EVENT); 1899 + 1865 1900 if (codec->patch_ops.unsol_event) { 1866 1901 cxt5051_hp_automute(codec); 1867 1902 cxt5051_portb_automic(codec); ··· 1896 1893 CXT5051_HP_DV6736, /* HP without mic switch */ 1897 1894 CXT5051_LENOVO_X200, /* Lenovo X200 laptop */ 1898 1895 CXT5051_F700, /* HP Compaq Presario F700 */ 1896 + CXT5051_TOSHIBA, /* Toshiba M300 & co */ 1899 1897 CXT5051_MODELS 1900 1898 }; 1901 1899 ··· 1905 1901 [CXT5051_HP] = "hp", 1906 1902 [CXT5051_HP_DV6736] = "hp-dv6736", 1907 1903 [CXT5051_LENOVO_X200] = "lenovo-x200", 1908 - [CXT5051_F700] = "hp 700" 1904 + [CXT5051_F700] = "hp-700", 1905 + [CXT5051_TOSHIBA] = "toshiba", 1909 1906 }; 1910 1907 1911 1908 static struct snd_pci_quirk cxt5051_cfg_tbl[] = { 1912 1909 SND_PCI_QUIRK(0x103c, 0x30cf, "HP DV6736", CXT5051_HP_DV6736), 1913 1910 SND_PCI_QUIRK(0x103c, 0x360b, "Compaq Presario CQ60", CXT5051_HP), 1911 + SND_PCI_QUIRK(0x103c, 0x30ea, "Compaq Presario F700", CXT5051_F700), 1912 + SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba M30x", CXT5051_TOSHIBA), 1914 1913 SND_PCI_QUIRK(0x14f1, 0x0101, "Conexant Reference board", 1915 1914 CXT5051_LAPTOP), 1916 1915 SND_PCI_QUIRK(0x14f1, 0x5051, "HP Spartan 1.1", CXT5051_HP), 1917 1916 SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo X200", CXT5051_LENOVO_X200), 1918 - SND_PCI_QUIRK(0x103c, 0x30ea, "Compaq Presario F700", CXT5051_F700), 1919 1917 {} 1920 1918 }; 1921 1919 ··· 1941 1935 spec->multiout.dig_out_nid = CXT5051_SPDIF_OUT; 1942 1936 spec->num_adc_nids = 1; /* not 2; via auto-mic switch */ 1943 1937 spec->adc_nids = cxt5051_adc_nids; 1944 - spec->num_mixers = 1; 1945 - spec->mixers[0] = cxt5051_mixers; 1938 + spec->num_mixers = 2; 1939 + spec->mixers[0] = cxt5051_capture_mixers; 1940 + spec->mixers[1] = cxt5051_playback_mixers; 1946 1941 spec->num_init_verbs = 1; 1947 1942 spec->init_verbs[0] = cxt5051_init_verbs; 1948 1943 spec->spdif_route = 0; ··· 1957 1950 board_config = snd_hda_check_board_config(codec, CXT5051_MODELS, 1958 1951 cxt5051_models, 1959 1952 cxt5051_cfg_tbl); 1953 + spec->auto_mic = AUTO_MIC_PORTB | AUTO_MIC_PORTC; 1960 1954 switch (board_config) { 1961 1955 case CXT5051_HP: 1962 1956 spec->mixers[0] = cxt5051_hp_mixers; ··· 1965 1957 case CXT5051_HP_DV6736: 1966 1958 spec->init_verbs[0] = cxt5051_hp_dv6736_init_verbs; 1967 1959 spec->mixers[0] = cxt5051_hp_dv6736_mixers; 1968 - spec->no_auto_mic = 1; 1960 + spec->auto_mic = 0; 1969 1961 break; 1970 1962 case CXT5051_LENOVO_X200: 1971 1963 spec->init_verbs[0] = cxt5051_lenovo_x200_init_verbs; ··· 1973 1965 case CXT5051_F700: 1974 1966 spec->init_verbs[0] = cxt5051_f700_init_verbs; 1975 1967 spec->mixers[0] = cxt5051_f700_mixers; 1976 - spec->no_auto_mic = 1; 1968 + spec->auto_mic = 0; 1969 + break; 1970 + case CXT5051_TOSHIBA: 1971 + spec->mixers[0] = cxt5051_toshiba_mixers; 1972 + spec->auto_mic = AUTO_MIC_PORTB; 1977 1973 break; 1978 1974 } 1979 1975 ··· 2168 2156 } 2169 2157 } 2170 2158 2159 + /* toggle input of built-in digital mic and mic jack appropriately */ 2160 + static void cxt5066_ideapad_automic(struct hda_codec *codec) 2161 + { 2162 + unsigned int present; 2163 + 2164 + struct hda_verb ext_mic_present[] = { 2165 + {0x14, AC_VERB_SET_CONNECT_SEL, 0}, 2166 + {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, 2167 + {0x23, AC_VERB_SET_PIN_WIDGET_CONTROL, 0}, 2168 + {} 2169 + }; 2170 + static struct hda_verb ext_mic_absent[] = { 2171 + {0x14, AC_VERB_SET_CONNECT_SEL, 2}, 2172 + {0x23, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 2173 + {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0}, 2174 + {} 2175 + }; 2176 + 2177 + present = snd_hda_jack_detect(codec, 0x1b); 2178 + if (present) { 2179 + snd_printdd("CXT5066: external microphone detected\n"); 2180 + snd_hda_sequence_write(codec, ext_mic_present); 2181 + } else { 2182 + snd_printdd("CXT5066: external microphone absent\n"); 2183 + snd_hda_sequence_write(codec, ext_mic_absent); 2184 + } 2185 + } 2186 + 2171 2187 /* mute internal speaker if HP is plugged */ 2172 2188 static void cxt5066_hp_automute(struct hda_codec *codec) 2173 2189 { ··· 2245 2205 } 2246 2206 } 2247 2207 2208 + /* unsolicited event for jack sensing */ 2209 + static void cxt5066_ideapad_event(struct hda_codec *codec, unsigned int res) 2210 + { 2211 + snd_printdd("CXT5066_ideapad: unsol event %x (%x)\n", res, res >> 26); 2212 + switch (res >> 26) { 2213 + case CONEXANT_HP_EVENT: 2214 + cxt5066_hp_automute(codec); 2215 + break; 2216 + case CONEXANT_MIC_EVENT: 2217 + cxt5066_ideapad_automic(codec); 2218 + break; 2219 + } 2220 + } 2221 + 2248 2222 static const struct hda_input_mux cxt5066_analog_mic_boost = { 2249 2223 .num_items = 5, 2250 2224 .items = { ··· 2270 2216 }, 2271 2217 }; 2272 2218 2273 - static int cxt5066_set_mic_boost(struct hda_codec *codec) 2219 + static void cxt5066_set_mic_boost(struct hda_codec *codec) 2274 2220 { 2275 2221 struct conexant_spec *spec = codec->spec; 2276 - return snd_hda_codec_write_cache(codec, 0x17, 0, 2222 + snd_hda_codec_write_cache(codec, 0x17, 0, 2277 2223 AC_VERB_SET_AMP_GAIN_MUTE, 2278 2224 AC_AMP_SET_RIGHT | AC_AMP_SET_LEFT | AC_AMP_SET_OUTPUT | 2279 2225 cxt5066_analog_mic_boost.items[spec->mic_boost].index); 2226 + if (spec->ideapad) { 2227 + /* adjust the internal mic as well...it is not through 0x17 */ 2228 + snd_hda_codec_write_cache(codec, 0x23, 0, 2229 + AC_VERB_SET_AMP_GAIN_MUTE, 2230 + AC_AMP_SET_RIGHT | AC_AMP_SET_LEFT | AC_AMP_SET_INPUT | 2231 + cxt5066_analog_mic_boost. 2232 + items[spec->mic_boost].index); 2233 + } 2280 2234 } 2281 2235 2282 2236 static int cxt5066_mic_boost_mux_enum_info(struct snd_kcontrol *kcontrol, ··· 2715 2653 { } /* end */ 2716 2654 }; 2717 2655 2656 + static struct hda_verb cxt5066_init_verbs_ideapad[] = { 2657 + {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* Port B */ 2658 + {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* Port C */ 2659 + {0x1e, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* Port F */ 2660 + {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* Port E */ 2661 + 2662 + /* Speakers */ 2663 + {0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 2664 + {0x1f, AC_VERB_SET_CONNECT_SEL, 0x00}, /* DAC1 */ 2665 + 2666 + /* HP, Amp */ 2667 + {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 2668 + {0x19, AC_VERB_SET_CONNECT_SEL, 0x00}, /* DAC1 */ 2669 + 2670 + {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 2671 + {0x1c, AC_VERB_SET_CONNECT_SEL, 0x00}, /* DAC1 */ 2672 + 2673 + /* DAC1 */ 2674 + {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 2675 + 2676 + /* Node 14 connections: 0x17 0x18 0x23 0x24 0x27 */ 2677 + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x50}, 2678 + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 2679 + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2) | 0x50}, 2680 + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, 2681 + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, 2682 + {0x14, AC_VERB_SET_CONNECT_SEL, 2}, /* default to internal mic */ 2683 + 2684 + /* Audio input selector */ 2685 + {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x2}, 2686 + {0x17, AC_VERB_SET_CONNECT_SEL, 1}, /* route ext mic */ 2687 + 2688 + /* SPDIF route: PCM */ 2689 + {0x20, AC_VERB_SET_CONNECT_SEL, 0x0}, 2690 + {0x22, AC_VERB_SET_CONNECT_SEL, 0x0}, 2691 + 2692 + {0x20, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 2693 + {0x22, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 2694 + 2695 + /* internal microphone */ 2696 + {0x23, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, /* enable int mic */ 2697 + 2698 + /* EAPD */ 2699 + {0x1d, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ 2700 + 2701 + {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_HP_EVENT}, 2702 + {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | CONEXANT_MIC_EVENT}, 2703 + { } /* end */ 2704 + }; 2705 + 2718 2706 static struct hda_verb cxt5066_init_verbs_portd_lo[] = { 2719 2707 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 2720 2708 { } /* end */ ··· 2781 2669 cxt5066_hp_automute(codec); 2782 2670 if (spec->dell_vostro) 2783 2671 cxt5066_vostro_automic(codec); 2672 + else if (spec->ideapad) 2673 + cxt5066_ideapad_automic(codec); 2784 2674 } 2785 2675 cxt5066_set_mic_boost(codec); 2786 2676 return 0; ··· 2808 2694 CXT5066_DELL_LAPTOP, /* Dell Laptop */ 2809 2695 CXT5066_OLPC_XO_1_5, /* OLPC XO 1.5 */ 2810 2696 CXT5066_DELL_VOSTO, /* Dell Vostro 1015i */ 2697 + CXT5066_IDEAPAD, /* Lenovo IdeaPad U150 */ 2811 2698 CXT5066_MODELS 2812 2699 }; 2813 2700 ··· 2816 2701 [CXT5066_LAPTOP] = "laptop", 2817 2702 [CXT5066_DELL_LAPTOP] = "dell-laptop", 2818 2703 [CXT5066_OLPC_XO_1_5] = "olpc-xo-1_5", 2819 - [CXT5066_DELL_VOSTO] = "dell-vostro" 2704 + [CXT5066_DELL_VOSTO] = "dell-vostro", 2705 + [CXT5066_IDEAPAD] = "ideapad", 2820 2706 }; 2821 2707 2822 2708 static struct snd_pci_quirk cxt5066_cfg_tbl[] = { ··· 2827 2711 CXT5066_DELL_LAPTOP), 2828 2712 SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5), 2829 2713 SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTO), 2714 + SND_PCI_QUIRK(0x17aa, 0x3a0d, "ideapad", CXT5066_IDEAPAD), 2830 2715 {} 2831 2716 }; 2832 2717 ··· 2912 2795 spec->dell_vostro = 1; 2913 2796 spec->mic_boost = 3; /* default 30dB gain */ 2914 2797 snd_hda_attach_beep_device(codec, 0x13); 2798 + 2799 + /* no S/PDIF out */ 2800 + spec->multiout.dig_out_nid = 0; 2801 + 2802 + /* input source automatically selected */ 2803 + spec->input_mux = NULL; 2804 + break; 2805 + case CXT5066_IDEAPAD: 2806 + codec->patch_ops.init = cxt5066_init; 2807 + codec->patch_ops.unsol_event = cxt5066_ideapad_event; 2808 + spec->mixers[spec->num_mixers++] = cxt5066_mixer_master; 2809 + spec->mixers[spec->num_mixers++] = cxt5066_mixers; 2810 + spec->init_verbs[0] = cxt5066_init_verbs_ideapad; 2811 + spec->port_d_mode = 0; 2812 + spec->ideapad = 1; 2813 + spec->mic_boost = 2; /* default 20dB gain */ 2915 2814 2916 2815 /* no S/PDIF out */ 2917 2816 spec->multiout.dig_out_nid = 0;
+507 -329
sound/pci/hda/patch_realtek.c
··· 131 131 enum { 132 132 ALC269_BASIC, 133 133 ALC269_QUANTA_FL1, 134 - ALC269_ASUS_AMIC, 135 - ALC269_ASUS_DMIC, 134 + ALC269_AMIC, 135 + ALC269_DMIC, 136 + ALC269VB_AMIC, 137 + ALC269VB_DMIC, 136 138 ALC269_FUJITSU, 137 139 ALC269_LIFEBOOK, 138 140 ALC269_AUTO, ··· 209 207 ALC882_ASUS_A7J, 210 208 ALC882_ASUS_A7M, 211 209 ALC885_MACPRO, 210 + ALC885_MBA21, 212 211 ALC885_MBP3, 213 212 ALC885_MB5, 213 + ALC885_MACMINI3, 214 214 ALC885_IMAC24, 215 215 ALC885_IMAC91, 216 216 ALC883_3ST_2ch_DIG, ··· 845 841 spec->init_verbs[spec->num_init_verbs++] = verb; 846 842 } 847 843 848 - #ifdef CONFIG_PROC_FS 849 - /* 850 - * hook for proc 851 - */ 852 - static void print_realtek_coef(struct snd_info_buffer *buffer, 853 - struct hda_codec *codec, hda_nid_t nid) 854 - { 855 - int coeff; 856 - 857 - if (nid != 0x20) 858 - return; 859 - coeff = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0); 860 - snd_iprintf(buffer, " Processing Coefficient: 0x%02x\n", coeff); 861 - coeff = snd_hda_codec_read(codec, nid, 0, 862 - AC_VERB_GET_COEF_INDEX, 0); 863 - snd_iprintf(buffer, " Coefficient Index: 0x%02x\n", coeff); 864 - } 865 - #else 866 - #define print_realtek_coef NULL 867 - #endif 868 - 869 844 /* 870 845 * set up from the preset table 871 846 */ ··· 1149 1166 case 0x10ec0888: 1150 1167 alc888_coef_init(codec); 1151 1168 break; 1169 + #if 0 /* XXX: This may cause the silent output on speaker on some machines */ 1152 1170 case 0x10ec0267: 1153 1171 case 0x10ec0268: 1154 1172 snd_hda_codec_write(codec, 0x20, 0, ··· 1162 1178 AC_VERB_SET_PROC_COEF, 1163 1179 tmp | 0x3000); 1164 1180 break; 1181 + #endif /* XXX */ 1165 1182 } 1166 1183 break; 1167 1184 } ··· 1254 1269 */ 1255 1270 static int alc_subsystem_id(struct hda_codec *codec, 1256 1271 hda_nid_t porta, hda_nid_t porte, 1257 - hda_nid_t portd) 1272 + hda_nid_t portd, hda_nid_t porti) 1258 1273 { 1259 1274 unsigned int ass, tmp, i; 1260 1275 unsigned nid; ··· 1280 1295 snd_printd("realtek: No valid SSID, " 1281 1296 "checking pincfg 0x%08x for NID 0x%x\n", 1282 1297 ass, nid); 1283 - if (!(ass & 1) && !(ass & 0x100000)) 1298 + if (!(ass & 1)) 1284 1299 return 0; 1285 1300 if ((ass >> 30) != 1) /* no physical connection */ 1286 1301 return 0; ··· 1340 1355 nid = porte; 1341 1356 else if (tmp == 2) 1342 1357 nid = portd; 1358 + else if (tmp == 3) 1359 + nid = porti; 1343 1360 else 1344 1361 return 1; 1345 1362 for (i = 0; i < spec->autocfg.line_outs; i++) ··· 1356 1369 } 1357 1370 1358 1371 static void alc_ssid_check(struct hda_codec *codec, 1359 - hda_nid_t porta, hda_nid_t porte, hda_nid_t portd) 1372 + hda_nid_t porta, hda_nid_t porte, 1373 + hda_nid_t portd, hda_nid_t porti) 1360 1374 { 1361 - if (!alc_subsystem_id(codec, porta, porte, portd)) { 1375 + if (!alc_subsystem_id(codec, porta, porte, portd, porti)) { 1362 1376 struct alc_spec *spec = codec->spec; 1363 1377 snd_printd("realtek: " 1364 1378 "Enable default setup for auto mode as fallback\n"); ··· 3717 3729 /* We currently only handle front, HP */ 3718 3730 switch (codec->vendor_id) { 3719 3731 case 0x10ec0260: 3720 - snd_hda_codec_write(codec, 0x0f, 0, 3721 - AC_VERB_SET_EAPD_BTLENABLE, 0x00); 3722 - snd_hda_codec_write(codec, 0x10, 0, 3723 - AC_VERB_SET_EAPD_BTLENABLE, 0x00); 3732 + set_eapd(codec, 0x0f, 0); 3733 + set_eapd(codec, 0x10, 0); 3724 3734 break; 3725 3735 case 0x10ec0262: 3726 3736 case 0x10ec0267: 3727 3737 case 0x10ec0268: 3728 3738 case 0x10ec0269: 3739 + case 0x10ec0270: 3729 3740 case 0x10ec0272: 3730 3741 case 0x10ec0660: 3731 3742 case 0x10ec0662: 3732 3743 case 0x10ec0663: 3733 3744 case 0x10ec0862: 3734 3745 case 0x10ec0889: 3735 - snd_hda_codec_write(codec, 0x14, 0, 3736 - AC_VERB_SET_EAPD_BTLENABLE, 0x00); 3737 - snd_hda_codec_write(codec, 0x15, 0, 3738 - AC_VERB_SET_EAPD_BTLENABLE, 0x00); 3746 + set_eapd(codec, 0x14, 0); 3747 + set_eapd(codec, 0x15, 0); 3739 3748 break; 3740 3749 } 3741 3750 } ··· 4862 4877 spec->num_mux_defs = 1; 4863 4878 spec->input_mux = &spec->private_imux[0]; 4864 4879 4865 - alc_ssid_check(codec, 0x15, 0x1b, 0x14); 4880 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 4866 4881 4867 4882 return 1; 4868 4883 } ··· 5066 5081 if (!spec->loopback.amplist) 5067 5082 spec->loopback.amplist = alc880_loopbacks; 5068 5083 #endif 5069 - codec->proc_widget_hook = print_realtek_coef; 5070 5084 5071 5085 return 0; 5072 5086 } ··· 6396 6412 spec->num_mux_defs = 1; 6397 6413 spec->input_mux = &spec->private_imux[0]; 6398 6414 6399 - alc_ssid_check(codec, 0x10, 0x15, 0x0f); 6415 + alc_ssid_check(codec, 0x10, 0x15, 0x0f, 0); 6400 6416 6401 6417 return 1; 6402 6418 } ··· 6675 6691 if (!spec->loopback.amplist) 6676 6692 spec->loopback.amplist = alc260_loopbacks; 6677 6693 #endif 6678 - codec->proc_widget_hook = print_realtek_coef; 6679 6694 6680 6695 return 0; 6681 6696 } ··· 6751 6768 .num_items = 3, 6752 6769 .items = { 6753 6770 { "Mic", 0x1 }, 6771 + { "Line", 0x2 }, 6772 + { "CD", 0x4 }, 6773 + }, 6774 + }; 6775 + 6776 + static struct hda_input_mux macmini3_capture_source = { 6777 + .num_items = 2, 6778 + .items = { 6754 6779 { "Line", 0x2 }, 6755 6780 { "CD", 0x4 }, 6756 6781 }, ··· 6952 6961 { 8, alc882_sixstack_ch8_init }, 6953 6962 }; 6954 6963 6964 + 6965 + /* Macbook Air 2,1 */ 6966 + 6967 + static struct hda_channel_mode alc885_mba21_ch_modes[1] = { 6968 + { 2, NULL }, 6969 + }; 6970 + 6955 6971 /* 6956 6972 * macbook pro ALC885 can switch LineIn to LineOut without losing Mic 6957 6973 */ ··· 7019 7021 { 6, alc885_mb5_ch6_init }, 7020 7022 }; 7021 7023 7024 + #define alc885_macmini3_6ch_modes alc885_mb5_6ch_modes 7022 7025 7023 7026 /* 7024 7027 * 2ch mode ··· 7231 7232 { } /* end */ 7232 7233 }; 7233 7234 7235 + /* Macbook Air 2,1 same control for HP and internal Speaker */ 7236 + 7237 + static struct snd_kcontrol_new alc885_mba21_mixer[] = { 7238 + HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT), 7239 + HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 0x02, HDA_OUTPUT), 7240 + { } 7241 + }; 7242 + 7243 + 7234 7244 static struct snd_kcontrol_new alc885_mbp3_mixer[] = { 7235 7245 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT), 7236 7246 HDA_BIND_MUTE ("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT), ··· 7270 7262 HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x01, HDA_INPUT), 7271 7263 HDA_CODEC_VOLUME("Line Boost", 0x15, 0x00, HDA_INPUT), 7272 7264 HDA_CODEC_VOLUME("Mic Boost", 0x19, 0x00, HDA_INPUT), 7265 + { } /* end */ 7266 + }; 7267 + 7268 + static struct snd_kcontrol_new alc885_macmini3_mixer[] = { 7269 + HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT), 7270 + HDA_BIND_MUTE ("Front Playback Switch", 0x0c, 0x02, HDA_INPUT), 7271 + HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT), 7272 + HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT), 7273 + HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT), 7274 + HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT), 7275 + HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0f, 0x00, HDA_OUTPUT), 7276 + HDA_BIND_MUTE ("Headphone Playback Switch", 0x0f, 0x02, HDA_INPUT), 7277 + HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x07, HDA_INPUT), 7278 + HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x07, HDA_INPUT), 7279 + HDA_CODEC_VOLUME("Line Boost", 0x15, 0x00, HDA_INPUT), 7273 7280 { } /* end */ 7274 7281 }; 7275 7282 ··· 7379 7356 7380 7357 static struct hda_verb alc882_base_init_verbs[] = { 7381 7358 /* Front mixer: unmute input/output amp left and right (volume = 0) */ 7382 - {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 7383 7359 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7384 7360 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7385 7361 /* Rear mixer */ 7386 - {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 7387 7362 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7388 7363 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7389 7364 /* CLFE mixer */ 7390 - {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 7391 7365 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7392 7366 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7393 7367 /* Side mixer */ 7394 - {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 7395 7368 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7396 7369 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7397 - 7398 - /* mute analog input loopbacks */ 7399 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7400 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7401 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, 7402 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, 7403 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, 7404 7370 7405 7371 /* Front Pin: output 0 (0x0c) */ 7406 7372 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, ··· 7427 7415 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */ 7428 7416 /* Input mixer2 */ 7429 7417 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7430 - {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, 7431 - {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, 7432 - {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, 7433 7418 /* Input mixer3 */ 7434 7419 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7435 - {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, 7436 - {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, 7437 - {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, 7438 7420 /* ADC2: mute amp left and right */ 7439 7421 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7440 7422 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00}, ··· 7472 7466 7473 7467 static struct hda_verb alc885_init_verbs[] = { 7474 7468 /* Front mixer: unmute input/output amp left and right (volume = 0) */ 7475 - {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 7476 - {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7477 - {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7469 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7470 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 7478 7471 /* Rear mixer */ 7479 - {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 7480 - {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7481 - {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7472 + {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7473 + {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 7482 7474 /* CLFE mixer */ 7483 - {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 7484 - {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7485 - {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7475 + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7476 + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 7486 7477 /* Side mixer */ 7487 - {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 7488 - {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7489 - {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7490 - 7491 - /* mute analog input loopbacks */ 7492 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7493 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, 7494 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, 7478 + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7479 + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 7495 7480 7496 7481 /* Front HP Pin: output 0 (0x0c) */ 7497 7482 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, ··· 7516 7519 7517 7520 /* Mixer elements: 0x18, , 0x1a, 0x1b */ 7518 7521 /* Input mixer1 */ 7519 - {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)}, 7520 - {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7521 - {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, 7522 + {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7522 7523 /* Input mixer2 */ 7523 7524 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7524 - {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, 7525 - {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, 7526 7525 /* Input mixer3 */ 7527 - {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)}, 7528 - {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7529 - {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, 7526 + {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7530 7527 /* ADC2: mute amp left and right */ 7531 7528 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7532 7529 /* ADC3: mute amp left and right */ ··· 7661 7670 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, 7662 7671 { } 7663 7672 }; 7673 + 7674 + /* Macmini 3,1 */ 7675 + static struct hda_verb alc885_macmini3_init_verbs[] = { 7676 + /* DACs */ 7677 + {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 7678 + {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 7679 + {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 7680 + {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 7681 + /* Front mixer */ 7682 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 7683 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7684 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7685 + /* Surround mixer */ 7686 + {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 7687 + {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7688 + {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7689 + /* LFE mixer */ 7690 + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 7691 + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7692 + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7693 + /* HP mixer */ 7694 + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 7695 + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7696 + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7697 + /* Front Pin (0x0c) */ 7698 + {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01}, 7699 + {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 7700 + {0x18, AC_VERB_SET_CONNECT_SEL, 0x00}, 7701 + /* LFE Pin (0x0e) */ 7702 + {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01}, 7703 + {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 7704 + {0x1a, AC_VERB_SET_CONNECT_SEL, 0x02}, 7705 + /* HP Pin (0x0f) */ 7706 + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 7707 + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 7708 + {0x14, AC_VERB_SET_CONNECT_SEL, 0x03}, 7709 + {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, 7710 + /* Line In pin */ 7711 + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 7712 + {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 7713 + 7714 + {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 7715 + {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, 7716 + {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, 7717 + {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, 7718 + { } 7719 + }; 7720 + 7721 + 7722 + static struct hda_verb alc885_mba21_init_verbs[] = { 7723 + /*Internal and HP Speaker Mixer*/ 7724 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 7725 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7726 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 7727 + /*Internal Speaker Pin (0x0c)*/ 7728 + {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) }, 7729 + {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 7730 + {0x18, AC_VERB_SET_CONNECT_SEL, 0x00}, 7731 + /* HP Pin: output 0 (0x0e) */ 7732 + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc4}, 7733 + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 7734 + {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, 7735 + {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, (ALC880_HP_EVENT | AC_USRSP_EN)}, 7736 + /* Line in (is hp when jack connected)*/ 7737 + {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_VREF_50}, 7738 + {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 7739 + 7740 + { } 7741 + }; 7742 + 7664 7743 7665 7744 /* Macbook Pro rev3 */ 7666 7745 static struct hda_verb alc885_mbp3_init_verbs[] = { ··· 7894 7833 spec->autocfg.speaker_pins[1] = 0x1a; 7895 7834 } 7896 7835 7836 + #define alc885_mb5_setup alc885_imac24_setup 7837 + #define alc885_macmini3_setup alc885_imac24_setup 7838 + 7839 + /* Macbook Air 2,1 */ 7840 + static void alc885_mba21_setup(struct hda_codec *codec) 7841 + { 7842 + struct alc_spec *spec = codec->spec; 7843 + 7844 + spec->autocfg.hp_pins[0] = 0x14; 7845 + spec->autocfg.speaker_pins[0] = 0x18; 7846 + } 7847 + 7848 + 7849 + 7897 7850 static void alc885_mbp3_setup(struct hda_codec *codec) 7898 7851 { 7899 7852 struct alc_spec *spec = codec->spec; ··· 7916 7841 spec->autocfg.speaker_pins[0] = 0x14; 7917 7842 } 7918 7843 7919 - static void alc885_mb5_automute(struct hda_codec *codec) 7844 + static void alc885_imac91_setup(struct hda_codec *codec) 7920 7845 { 7921 - unsigned int present; 7846 + struct alc_spec *spec = codec->spec; 7922 7847 7923 - present = snd_hda_codec_read(codec, 0x14, 0, 7924 - AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 7925 - snd_hda_codec_amp_stereo(codec, 0x18, HDA_OUTPUT, 0, 7926 - HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); 7927 - snd_hda_codec_amp_stereo(codec, 0x1a, HDA_OUTPUT, 0, 7928 - HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); 7929 - 7930 - } 7931 - 7932 - static void alc885_mb5_unsol_event(struct hda_codec *codec, 7933 - unsigned int res) 7934 - { 7935 - /* Headphone insertion or removal. */ 7936 - if ((res >> 26) == ALC880_HP_EVENT) 7937 - alc885_mb5_automute(codec); 7938 - } 7939 - 7940 - static void alc885_imac91_automute(struct hda_codec *codec) 7941 - { 7942 - unsigned int present; 7943 - 7944 - present = snd_hda_codec_read(codec, 0x14, 0, 7945 - AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; 7946 - snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0, 7947 - HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); 7948 - snd_hda_codec_amp_stereo(codec, 0x1a, HDA_OUTPUT, 0, 7949 - HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); 7950 - 7951 - } 7952 - 7953 - static void alc885_imac91_unsol_event(struct hda_codec *codec, 7954 - unsigned int res) 7955 - { 7956 - /* Headphone insertion or removal. */ 7957 - if ((res >> 26) == ALC880_HP_EVENT) 7958 - alc885_imac91_automute(codec); 7848 + spec->autocfg.hp_pins[0] = 0x14; 7849 + spec->autocfg.speaker_pins[0] = 0x15; 7850 + spec->autocfg.speaker_pins[1] = 0x1a; 7959 7851 } 7960 7852 7961 7853 static struct hda_verb alc882_targa_verbs[] = { ··· 8057 8015 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 8058 8016 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 8059 8017 8060 - /* Mute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback 8061 - * mixer widget 8062 - * Note: PASD motherboards uses the Line In 2 as the input for 8063 - * front panel mic (mic 2) 8064 - */ 8065 - /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */ 8066 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 8067 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 8068 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, 8069 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, 8070 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, 8071 - 8072 8018 /* 8073 8019 * Set up output mixers (0x0c - 0x0f) 8074 8020 */ ··· 8081 8051 /* FIXME: use matrix-type input source selection */ 8082 8052 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */ 8083 8053 /* Input mixer2 */ 8084 - {0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))}, 8085 - {0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x03 << 8))}, 8086 - {0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x02 << 8))}, 8087 - {0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x04 << 8))}, 8054 + {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 8088 8055 /* Input mixer3 */ 8089 - {0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))}, 8090 - {0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x03 << 8))}, 8091 - {0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x02 << 8))}, 8092 - {0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x04 << 8))}, 8093 - 8056 + {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 8094 8057 { } 8095 8058 }; 8096 8059 ··· 9070 9047 [ALC882_ASUS_A7M] = "asus-a7m", 9071 9048 [ALC885_MACPRO] = "macpro", 9072 9049 [ALC885_MB5] = "mb5", 9050 + [ALC885_MACMINI3] = "macmini3", 9051 + [ALC885_MBA21] = "mba21", 9073 9052 [ALC885_MBP3] = "mbp3", 9074 9053 [ALC885_IMAC24] = "imac24", 9075 9054 [ALC885_IMAC91] = "imac91", ··· 9255 9230 */ 9256 9231 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC885_MB5), 9257 9232 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC885_MB5), 9233 + SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC885_MACMINI3), 9258 9234 {} /* terminator */ 9259 9235 }; 9260 9236 ··· 9307 9281 .input_mux = &alc882_capture_source, 9308 9282 .dig_out_nid = ALC882_DIGOUT_NID, 9309 9283 }, 9284 + [ALC885_MBA21] = { 9285 + .mixers = { alc885_mba21_mixer }, 9286 + .init_verbs = { alc885_mba21_init_verbs, alc880_gpio1_init_verbs }, 9287 + .num_dacs = 2, 9288 + .dac_nids = alc882_dac_nids, 9289 + .channel_mode = alc885_mba21_ch_modes, 9290 + .num_channel_mode = ARRAY_SIZE(alc885_mba21_ch_modes), 9291 + .input_mux = &alc882_capture_source, 9292 + .unsol_event = alc_automute_amp_unsol_event, 9293 + .setup = alc885_mba21_setup, 9294 + .init_hook = alc_automute_amp, 9295 + }, 9310 9296 [ALC885_MBP3] = { 9311 9297 .mixers = { alc885_mbp3_mixer, alc882_chmode_mixer }, 9312 9298 .init_verbs = { alc885_mbp3_init_verbs, ··· 9346 9308 .input_mux = &mb5_capture_source, 9347 9309 .dig_out_nid = ALC882_DIGOUT_NID, 9348 9310 .dig_in_nid = ALC882_DIGIN_NID, 9349 - .unsol_event = alc885_mb5_unsol_event, 9350 - .init_hook = alc885_mb5_automute, 9311 + .unsol_event = alc_automute_amp_unsol_event, 9312 + .setup = alc885_mb5_setup, 9313 + .init_hook = alc_automute_amp, 9314 + }, 9315 + [ALC885_MACMINI3] = { 9316 + .mixers = { alc885_macmini3_mixer, alc882_chmode_mixer }, 9317 + .init_verbs = { alc885_macmini3_init_verbs, 9318 + alc880_gpio1_init_verbs }, 9319 + .num_dacs = ARRAY_SIZE(alc882_dac_nids), 9320 + .dac_nids = alc882_dac_nids, 9321 + .channel_mode = alc885_macmini3_6ch_modes, 9322 + .num_channel_mode = ARRAY_SIZE(alc885_macmini3_6ch_modes), 9323 + .input_mux = &macmini3_capture_source, 9324 + .dig_out_nid = ALC882_DIGOUT_NID, 9325 + .dig_in_nid = ALC882_DIGIN_NID, 9326 + .unsol_event = alc_automute_amp_unsol_event, 9327 + .setup = alc885_macmini3_setup, 9328 + .init_hook = alc_automute_amp, 9351 9329 }, 9352 9330 [ALC885_MACPRO] = { 9353 9331 .mixers = { alc882_macpro_mixer }, ··· 9402 9348 .input_mux = &alc882_capture_source, 9403 9349 .dig_out_nid = ALC882_DIGOUT_NID, 9404 9350 .dig_in_nid = ALC882_DIGIN_NID, 9405 - .unsol_event = alc885_imac91_unsol_event, 9406 - .init_hook = alc885_imac91_automute, 9351 + .unsol_event = alc_automute_amp_unsol_event, 9352 + .setup = alc885_imac91_setup, 9353 + .init_hook = alc_automute_amp, 9407 9354 }, 9408 9355 [ALC882_TARGA] = { 9409 9356 .mixers = { alc882_targa_mixer, alc882_chmode_mixer }, ··· 10227 10172 spec->num_mux_defs = 1; 10228 10173 spec->input_mux = &spec->private_imux[0]; 10229 10174 10230 - alc_ssid_check(codec, 0x15, 0x1b, 0x14); 10175 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 10231 10176 10232 10177 err = alc_auto_add_mic_boost(codec); 10233 10178 if (err < 0) ··· 10365 10310 if (!spec->loopback.amplist) 10366 10311 spec->loopback.amplist = alc882_loopbacks; 10367 10312 #endif 10368 - codec->proc_widget_hook = print_realtek_coef; 10369 10313 10370 10314 return 0; 10371 10315 } ··· 11785 11731 if (err < 0) 11786 11732 return err; 11787 11733 11788 - alc_ssid_check(codec, 0x15, 0x14, 0x1b); 11734 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 11789 11735 11790 11736 return 1; 11791 11737 } ··· 12228 12174 if (!spec->loopback.amplist) 12229 12175 spec->loopback.amplist = alc262_loopbacks; 12230 12176 #endif 12231 - codec->proc_widget_hook = print_realtek_coef; 12232 12177 12233 12178 return 0; 12234 12179 } ··· 12736 12683 dac = 0x02; 12737 12684 break; 12738 12685 case 0x15: 12739 - case 0x21: 12740 12686 dac = 0x03; 12741 12687 break; 12742 12688 default: ··· 12956 12904 if (err < 0) 12957 12905 return err; 12958 12906 12959 - alc_ssid_check(codec, 0x15, 0x1b, 0x14); 12907 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 12960 12908 12961 12909 return 1; 12962 12910 } ··· 13293 13241 if (board_config == ALC268_AUTO) 13294 13242 spec->init_hook = alc268_auto_init; 13295 13243 13296 - codec->proc_widget_hook = print_realtek_coef; 13297 - 13298 13244 return 0; 13299 13245 } 13300 13246 ··· 13310 13260 13311 13261 static hda_nid_t alc269_capsrc_nids[1] = { 13312 13262 0x23, 13263 + }; 13264 + 13265 + static hda_nid_t alc269vb_adc_nids[1] = { 13266 + /* ADC1 */ 13267 + 0x09, 13268 + }; 13269 + 13270 + static hda_nid_t alc269vb_capsrc_nids[1] = { 13271 + 0x22, 13313 13272 }; 13314 13273 13315 13274 /* NOTE: ADC2 (0x07) is connected from a recording *MIXER* (0x24), ··· 13389 13330 { } 13390 13331 }; 13391 13332 13392 - static struct snd_kcontrol_new alc269_eeepc_mixer[] = { 13333 + static struct snd_kcontrol_new alc269_laptop_mixer[] = { 13393 13334 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT), 13394 13335 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT), 13395 13336 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT), ··· 13397 13338 { } /* end */ 13398 13339 }; 13399 13340 13341 + static struct snd_kcontrol_new alc269vb_laptop_mixer[] = { 13342 + HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT), 13343 + HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT), 13344 + HDA_CODEC_MUTE("Headphone Playback Switch", 0x21, 0x0, HDA_OUTPUT), 13345 + HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT), 13346 + { } /* end */ 13347 + }; 13348 + 13400 13349 /* capture mixer elements */ 13401 - static struct snd_kcontrol_new alc269_epc_capture_mixer[] = { 13350 + static struct snd_kcontrol_new alc269_laptop_analog_capture_mixer[] = { 13351 + HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), 13352 + HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), 13353 + HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 13354 + HDA_CODEC_VOLUME("IntMic Boost", 0x19, 0, HDA_INPUT), 13355 + { } /* end */ 13356 + }; 13357 + 13358 + static struct snd_kcontrol_new alc269_laptop_digital_capture_mixer[] = { 13402 13359 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), 13403 13360 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), 13404 13361 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 13405 13362 { } /* end */ 13406 13363 }; 13407 13364 13365 + static struct snd_kcontrol_new alc269vb_laptop_analog_capture_mixer[] = { 13366 + HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT), 13367 + HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT), 13368 + HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 13369 + HDA_CODEC_VOLUME("IntMic Boost", 0x19, 0, HDA_INPUT), 13370 + { } /* end */ 13371 + }; 13372 + 13373 + static struct snd_kcontrol_new alc269vb_laptop_digital_capture_mixer[] = { 13374 + HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT), 13375 + HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT), 13376 + HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 13377 + { } /* end */ 13378 + }; 13379 + 13408 13380 /* FSC amilo */ 13409 - #define alc269_fujitsu_mixer alc269_eeepc_mixer 13381 + #define alc269_fujitsu_mixer alc269_laptop_mixer 13410 13382 13411 13383 static struct hda_verb alc269_quanta_fl1_verbs[] = { 13412 13384 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, ··· 13580 13490 alc269_lifebook_mic_autoswitch(codec); 13581 13491 } 13582 13492 13583 - static struct hda_verb alc269_eeepc_dmic_init_verbs[] = { 13493 + static struct hda_verb alc269_laptop_dmic_init_verbs[] = { 13584 13494 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, 13585 13495 {0x23, AC_VERB_SET_CONNECT_SEL, 0x05}, 13586 13496 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 }, ··· 13591 13501 {} 13592 13502 }; 13593 13503 13594 - static struct hda_verb alc269_eeepc_amic_init_verbs[] = { 13504 + static struct hda_verb alc269_laptop_amic_init_verbs[] = { 13595 13505 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, 13596 13506 {0x23, AC_VERB_SET_CONNECT_SEL, 0x01}, 13597 13507 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 }, 13598 13508 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, (0x701b | (0x00 << 8))}, 13599 13509 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT}, 13600 13510 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, 13511 + {} 13512 + }; 13513 + 13514 + static struct hda_verb alc269vb_laptop_dmic_init_verbs[] = { 13515 + {0x21, AC_VERB_SET_CONNECT_SEL, 0x01}, 13516 + {0x22, AC_VERB_SET_CONNECT_SEL, 0x06}, 13517 + {0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 }, 13518 + {0x09, AC_VERB_SET_AMP_GAIN_MUTE, (0x7019 | (0x00 << 8))}, 13519 + {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 13520 + {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT}, 13521 + {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, 13522 + {} 13523 + }; 13524 + 13525 + static struct hda_verb alc269vb_laptop_amic_init_verbs[] = { 13526 + {0x21, AC_VERB_SET_CONNECT_SEL, 0x01}, 13527 + {0x22, AC_VERB_SET_CONNECT_SEL, 0x01}, 13528 + {0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 }, 13529 + {0x09, AC_VERB_SET_AMP_GAIN_MUTE, (0x7019 | (0x00 << 8))}, 13530 + {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 13531 + {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT}, 13532 + {0x21, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, 13601 13533 {} 13602 13534 }; 13603 13535 ··· 13640 13528 } 13641 13529 13642 13530 /* unsolicited event for HP jack sensing */ 13643 - static void alc269_eeepc_unsol_event(struct hda_codec *codec, 13531 + static void alc269_laptop_unsol_event(struct hda_codec *codec, 13644 13532 unsigned int res) 13645 13533 { 13646 13534 switch (res >> 26) { ··· 13653 13541 } 13654 13542 } 13655 13543 13656 - static void alc269_eeepc_dmic_setup(struct hda_codec *codec) 13544 + static void alc269_laptop_dmic_setup(struct hda_codec *codec) 13657 13545 { 13658 13546 struct alc_spec *spec = codec->spec; 13659 13547 spec->ext_mic.pin = 0x18; ··· 13663 13551 spec->auto_mic = 1; 13664 13552 } 13665 13553 13666 - static void alc269_eeepc_amic_setup(struct hda_codec *codec) 13554 + static void alc269vb_laptop_dmic_setup(struct hda_codec *codec) 13555 + { 13556 + struct alc_spec *spec = codec->spec; 13557 + spec->ext_mic.pin = 0x18; 13558 + spec->ext_mic.mux_idx = 0; 13559 + spec->int_mic.pin = 0x12; 13560 + spec->int_mic.mux_idx = 6; 13561 + spec->auto_mic = 1; 13562 + } 13563 + 13564 + static void alc269_laptop_amic_setup(struct hda_codec *codec) 13667 13565 { 13668 13566 struct alc_spec *spec = codec->spec; 13669 13567 spec->ext_mic.pin = 0x18; ··· 13683 13561 spec->auto_mic = 1; 13684 13562 } 13685 13563 13686 - static void alc269_eeepc_inithook(struct hda_codec *codec) 13564 + static void alc269_laptop_inithook(struct hda_codec *codec) 13687 13565 { 13688 13566 alc269_speaker_automute(codec); 13689 13567 alc_mic_automute(codec); ··· 13696 13574 /* 13697 13575 * Unmute ADC0 and set the default input to mic-in 13698 13576 */ 13699 - {0x07, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 13700 - 13701 - /* Mute input amps (PCBeep, Line In, Mic 1 & Mic 2) of the 13702 - * analog-loopback mixer widget 13703 - * Note: PASD motherboards uses the Line In 2 as the input for 13704 - * front panel mic (mic 2) 13705 - */ 13706 - /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */ 13707 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 13708 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 13709 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, 13710 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, 13711 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, 13577 + {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 13712 13578 13713 13579 /* 13714 - * Set up output mixers (0x0c - 0x0e) 13580 + * Set up output mixers (0x02 - 0x03) 13715 13581 */ 13716 13582 /* set vol=0 to output mixers */ 13717 13583 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, ··· 13724 13614 13725 13615 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 13726 13616 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 13727 - {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 13728 - {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 13729 - {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 13730 - {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 13731 - {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 13732 13617 13733 - {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, 13734 - {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, 13735 - 13736 - /* FIXME: use matrix-type input source selection */ 13618 + /* FIXME: use Mux-type input source selection */ 13737 13619 /* Mixer elements: 0x18, 19, 1a, 1b, 1d, 0b */ 13738 13620 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */ 13739 - {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 13740 - {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 13741 - {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, 13742 - {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, 13621 + {0x23, AC_VERB_SET_CONNECT_SEL, 0x00}, 13743 13622 13744 13623 /* set EAPD */ 13745 13624 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2}, 13746 - {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2}, 13625 + { } 13626 + }; 13627 + 13628 + static struct hda_verb alc269vb_init_verbs[] = { 13629 + /* 13630 + * Unmute ADC0 and set the default input to mic-in 13631 + */ 13632 + {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 13633 + 13634 + /* 13635 + * Set up output mixers (0x02 - 0x03) 13636 + */ 13637 + /* set vol=0 to output mixers */ 13638 + {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 13639 + {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 13640 + 13641 + /* set up input amps for analog loopback */ 13642 + /* Amp Indices: DAC = 0, mixer = 1 */ 13643 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 13644 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 13645 + {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 13646 + {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 13647 + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 13648 + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 13649 + 13650 + {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 13651 + {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 13652 + {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 13653 + {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, 13654 + {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, 13655 + {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 13656 + {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 13657 + 13658 + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 13659 + {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 13660 + 13661 + /* FIXME: use Mux-type input source selection */ 13662 + /* Mixer elements: 0x18, 19, 1a, 1b, 1d, 0b */ 13663 + /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */ 13664 + {0x22, AC_VERB_SET_CONNECT_SEL, 0x00}, 13665 + 13666 + /* set EAPD */ 13667 + {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2}, 13747 13668 { } 13748 13669 }; 13749 13670 ··· 13822 13681 struct alc_spec *spec = codec->spec; 13823 13682 int err; 13824 13683 static hda_nid_t alc269_ignore[] = { 0x1d, 0 }; 13684 + hda_nid_t real_capsrc_nids; 13825 13685 13826 13686 err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, 13827 13687 alc269_ignore); ··· 13844 13702 if (spec->kctls.list) 13845 13703 add_mixer(spec, spec->kctls.list); 13846 13704 13847 - add_verb(spec, alc269_init_verbs); 13705 + if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010) { 13706 + add_verb(spec, alc269vb_init_verbs); 13707 + real_capsrc_nids = alc269vb_capsrc_nids[0]; 13708 + alc_ssid_check(codec, 0, 0x1b, 0x14, 0x21); 13709 + } else { 13710 + add_verb(spec, alc269_init_verbs); 13711 + real_capsrc_nids = alc269_capsrc_nids[0]; 13712 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 13713 + } 13714 + 13848 13715 spec->num_mux_defs = 1; 13849 13716 spec->input_mux = &spec->private_imux[0]; 13850 13717 /* set default input source */ 13851 - snd_hda_codec_write_cache(codec, alc269_capsrc_nids[0], 13718 + snd_hda_codec_write_cache(codec, real_capsrc_nids, 13852 13719 0, AC_VERB_SET_CONNECT_SEL, 13853 13720 spec->input_mux->items[0].index); 13854 13721 ··· 13867 13716 13868 13717 if (!spec->cap_mixer && !spec->no_analog) 13869 13718 set_capture_mixer(codec); 13870 - 13871 - alc_ssid_check(codec, 0x15, 0x1b, 0x14); 13872 13719 13873 13720 return 1; 13874 13721 } ··· 13893 13744 static const char *alc269_models[ALC269_MODEL_LAST] = { 13894 13745 [ALC269_BASIC] = "basic", 13895 13746 [ALC269_QUANTA_FL1] = "quanta", 13896 - [ALC269_ASUS_AMIC] = "asus-amic", 13897 - [ALC269_ASUS_DMIC] = "asus-dmic", 13747 + [ALC269_AMIC] = "laptop-amic", 13748 + [ALC269_DMIC] = "laptop-dmic", 13898 13749 [ALC269_FUJITSU] = "fujitsu", 13899 13750 [ALC269_LIFEBOOK] = "lifebook", 13900 13751 [ALC269_AUTO] = "auto", ··· 13903 13754 static struct snd_pci_quirk alc269_cfg_tbl[] = { 13904 13755 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_QUANTA_FL1), 13905 13756 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", 13906 - ALC269_ASUS_AMIC), 13907 - SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_ASUS_AMIC), 13908 - SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80JT", ALC269_ASUS_AMIC), 13909 - SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_ASUS_AMIC), 13910 - SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82Jv", ALC269_ASUS_AMIC), 13911 - SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_ASUS_AMIC), 13912 - SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_ASUS_AMIC), 13913 - SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_ASUS_AMIC), 13914 - SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_ASUS_AMIC), 13915 - SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_ASUS_AMIC), 13916 - SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_ASUS_AMIC), 13917 - SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_ASUS_AMIC), 13918 - SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_ASUS_AMIC), 13919 - SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_ASUS_AMIC), 13920 - SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_ASUS_AMIC), 13921 - SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_ASUS_AMIC), 13922 - SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_ASUS_AMIC), 13923 - SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_ASUS_AMIC), 13924 - SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_ASUS_AMIC), 13925 - SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_ASUS_AMIC), 13926 - SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_ASUS_AMIC), 13927 - SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_ASUS_AMIC), 13928 - SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_ASUS_AMIC), 13929 - SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_ASUS_AMIC), 13930 - SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_ASUS_DMIC), 13931 - SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_ASUS_AMIC), 13932 - SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_ASUS_AMIC), 13933 - SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_ASUS_AMIC), 13934 - SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_ASUS_AMIC), 13757 + ALC269_AMIC), 13758 + SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269VB_AMIC), 13759 + SND_PCI_QUIRK(0x1043, 0x1113, "ASUS N63Jn", ALC269VB_AMIC), 13760 + SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269VB_AMIC), 13761 + SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_AMIC), 13762 + SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269VB_AMIC), 13763 + SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269VB_AMIC), 13764 + SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269VB_AMIC), 13765 + SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269VB_AMIC), 13766 + SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_AMIC), 13767 + SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82Jv", ALC269_AMIC), 13768 + SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_AMIC), 13769 + SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_AMIC), 13770 + SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_AMIC), 13771 + SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_AMIC), 13772 + SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_AMIC), 13773 + SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_AMIC), 13774 + SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_AMIC), 13775 + SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_AMIC), 13776 + SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_AMIC), 13777 + SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_AMIC), 13778 + SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_AMIC), 13779 + SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_AMIC), 13780 + SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_AMIC), 13781 + SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_AMIC), 13782 + SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_AMIC), 13783 + SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_AMIC), 13784 + SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_AMIC), 13785 + SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_AMIC), 13786 + SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_AMIC), 13787 + SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_AMIC), 13788 + SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_AMIC), 13789 + SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_DMIC), 13790 + SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_AMIC), 13791 + SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_AMIC), 13792 + SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_AMIC), 13793 + SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_AMIC), 13935 13794 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS Eeepc P901", 13936 - ALC269_ASUS_DMIC), 13795 + ALC269_DMIC), 13937 13796 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS Eeepc S101", 13938 - ALC269_ASUS_DMIC), 13939 - SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005HA", ALC269_ASUS_DMIC), 13940 - SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005HA", ALC269_ASUS_DMIC), 13941 - SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU), 13797 + ALC269_DMIC), 13798 + SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005HA", ALC269_DMIC), 13799 + SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005HA", ALC269_DMIC), 13800 + SND_PCI_QUIRK(0x104d, 0x9071, "SONY XTB", ALC269_DMIC), 13942 13801 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK), 13802 + SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_DMIC), 13803 + SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU), 13804 + SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_AMIC), 13805 + SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_AMIC), 13806 + SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_DMIC), 13807 + SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_DMIC), 13943 13808 {} 13944 13809 }; 13945 13810 ··· 13981 13818 .setup = alc269_quanta_fl1_setup, 13982 13819 .init_hook = alc269_quanta_fl1_init_hook, 13983 13820 }, 13984 - [ALC269_ASUS_AMIC] = { 13985 - .mixers = { alc269_eeepc_mixer }, 13986 - .cap_mixer = alc269_epc_capture_mixer, 13821 + [ALC269_AMIC] = { 13822 + .mixers = { alc269_laptop_mixer }, 13823 + .cap_mixer = alc269_laptop_analog_capture_mixer, 13987 13824 .init_verbs = { alc269_init_verbs, 13988 - alc269_eeepc_amic_init_verbs }, 13825 + alc269_laptop_amic_init_verbs }, 13989 13826 .num_dacs = ARRAY_SIZE(alc269_dac_nids), 13990 13827 .dac_nids = alc269_dac_nids, 13991 13828 .hp_nid = 0x03, 13992 13829 .num_channel_mode = ARRAY_SIZE(alc269_modes), 13993 13830 .channel_mode = alc269_modes, 13994 - .unsol_event = alc269_eeepc_unsol_event, 13995 - .setup = alc269_eeepc_amic_setup, 13996 - .init_hook = alc269_eeepc_inithook, 13831 + .unsol_event = alc269_laptop_unsol_event, 13832 + .setup = alc269_laptop_amic_setup, 13833 + .init_hook = alc269_laptop_inithook, 13997 13834 }, 13998 - [ALC269_ASUS_DMIC] = { 13999 - .mixers = { alc269_eeepc_mixer }, 14000 - .cap_mixer = alc269_epc_capture_mixer, 13835 + [ALC269_DMIC] = { 13836 + .mixers = { alc269_laptop_mixer }, 13837 + .cap_mixer = alc269_laptop_digital_capture_mixer, 14001 13838 .init_verbs = { alc269_init_verbs, 14002 - alc269_eeepc_dmic_init_verbs }, 13839 + alc269_laptop_dmic_init_verbs }, 14003 13840 .num_dacs = ARRAY_SIZE(alc269_dac_nids), 14004 13841 .dac_nids = alc269_dac_nids, 14005 13842 .hp_nid = 0x03, 14006 13843 .num_channel_mode = ARRAY_SIZE(alc269_modes), 14007 13844 .channel_mode = alc269_modes, 14008 - .unsol_event = alc269_eeepc_unsol_event, 14009 - .setup = alc269_eeepc_dmic_setup, 14010 - .init_hook = alc269_eeepc_inithook, 13845 + .unsol_event = alc269_laptop_unsol_event, 13846 + .setup = alc269_laptop_dmic_setup, 13847 + .init_hook = alc269_laptop_inithook, 13848 + }, 13849 + [ALC269VB_AMIC] = { 13850 + .mixers = { alc269vb_laptop_mixer }, 13851 + .cap_mixer = alc269vb_laptop_analog_capture_mixer, 13852 + .init_verbs = { alc269vb_init_verbs, 13853 + alc269vb_laptop_amic_init_verbs }, 13854 + .num_dacs = ARRAY_SIZE(alc269_dac_nids), 13855 + .dac_nids = alc269_dac_nids, 13856 + .hp_nid = 0x03, 13857 + .num_channel_mode = ARRAY_SIZE(alc269_modes), 13858 + .channel_mode = alc269_modes, 13859 + .unsol_event = alc269_laptop_unsol_event, 13860 + .setup = alc269_laptop_amic_setup, 13861 + .init_hook = alc269_laptop_inithook, 13862 + }, 13863 + [ALC269VB_DMIC] = { 13864 + .mixers = { alc269vb_laptop_mixer }, 13865 + .cap_mixer = alc269vb_laptop_digital_capture_mixer, 13866 + .init_verbs = { alc269vb_init_verbs, 13867 + alc269vb_laptop_dmic_init_verbs }, 13868 + .num_dacs = ARRAY_SIZE(alc269_dac_nids), 13869 + .dac_nids = alc269_dac_nids, 13870 + .hp_nid = 0x03, 13871 + .num_channel_mode = ARRAY_SIZE(alc269_modes), 13872 + .channel_mode = alc269_modes, 13873 + .unsol_event = alc269_laptop_unsol_event, 13874 + .setup = alc269vb_laptop_dmic_setup, 13875 + .init_hook = alc269_laptop_inithook, 14011 13876 }, 14012 13877 [ALC269_FUJITSU] = { 14013 13878 .mixers = { alc269_fujitsu_mixer }, 14014 - .cap_mixer = alc269_epc_capture_mixer, 13879 + .cap_mixer = alc269_laptop_digital_capture_mixer, 14015 13880 .init_verbs = { alc269_init_verbs, 14016 - alc269_eeepc_dmic_init_verbs }, 13881 + alc269_laptop_dmic_init_verbs }, 14017 13882 .num_dacs = ARRAY_SIZE(alc269_dac_nids), 14018 13883 .dac_nids = alc269_dac_nids, 14019 13884 .hp_nid = 0x03, 14020 13885 .num_channel_mode = ARRAY_SIZE(alc269_modes), 14021 13886 .channel_mode = alc269_modes, 14022 - .unsol_event = alc269_eeepc_unsol_event, 14023 - .setup = alc269_eeepc_dmic_setup, 14024 - .init_hook = alc269_eeepc_inithook, 13887 + .unsol_event = alc269_laptop_unsol_event, 13888 + .setup = alc269_laptop_dmic_setup, 13889 + .init_hook = alc269_laptop_inithook, 14025 13890 }, 14026 13891 [ALC269_LIFEBOOK] = { 14027 13892 .mixers = { alc269_lifebook_mixer }, ··· 14070 13879 struct alc_spec *spec; 14071 13880 int board_config; 14072 13881 int err; 13882 + int is_alc269vb = 0; 14073 13883 14074 13884 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 14075 13885 if (spec == NULL) ··· 14087 13895 alc_free(codec); 14088 13896 return -ENOMEM; 14089 13897 } 13898 + is_alc269vb = 1; 14090 13899 } 14091 13900 14092 13901 board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST, ··· 14123 13930 if (board_config != ALC269_AUTO) 14124 13931 setup_preset(codec, &alc269_presets[board_config]); 14125 13932 14126 - if (codec->subsystem_id == 0x17aa3bf8) { 13933 + if (board_config == ALC269_QUANTA_FL1) { 14127 13934 /* Due to a hardware problem on Lenovo Ideadpad, we need to 14128 13935 * fix the sample rate of analog I/O to 44.1kHz 14129 13936 */ ··· 14136 13943 spec->stream_digital_playback = &alc269_pcm_digital_playback; 14137 13944 spec->stream_digital_capture = &alc269_pcm_digital_capture; 14138 13945 14139 - spec->adc_nids = alc269_adc_nids; 14140 - spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids); 14141 - spec->capsrc_nids = alc269_capsrc_nids; 13946 + if (!is_alc269vb) { 13947 + spec->adc_nids = alc269_adc_nids; 13948 + spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids); 13949 + spec->capsrc_nids = alc269_capsrc_nids; 13950 + } else { 13951 + spec->adc_nids = alc269vb_adc_nids; 13952 + spec->num_adc_nids = ARRAY_SIZE(alc269vb_adc_nids); 13953 + spec->capsrc_nids = alc269vb_capsrc_nids; 13954 + } 13955 + 14142 13956 if (!spec->cap_mixer) 14143 13957 set_capture_mixer(codec); 14144 13958 set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); ··· 14159 13959 if (!spec->loopback.amplist) 14160 13960 spec->loopback.amplist = alc269_loopbacks; 14161 13961 #endif 14162 - codec->proc_widget_hook = print_realtek_coef; 14163 13962 14164 13963 return 0; 14165 13964 } ··· 15021 14822 spec->num_adc_nids = ARRAY_SIZE(alc861_adc_nids); 15022 14823 set_capture_mixer(codec); 15023 14824 15024 - alc_ssid_check(codec, 0x0e, 0x0f, 0x0b); 14825 + alc_ssid_check(codec, 0x0e, 0x0f, 0x0b, 0); 15025 14826 15026 14827 return 1; 15027 14828 } ··· 15286 15087 if (!spec->loopback.amplist) 15287 15088 spec->loopback.amplist = alc861_loopbacks; 15288 15089 #endif 15289 - codec->proc_widget_hook = print_realtek_coef; 15290 15090 15291 15091 return 0; 15292 15092 } ··· 15912 15714 static int alc861vd_auto_create_input_ctls(struct hda_codec *codec, 15913 15715 const struct auto_pin_cfg *cfg) 15914 15716 { 15915 - return alc_auto_create_input_ctls(codec, cfg, 0x15, 0x22, 0); 15717 + return alc_auto_create_input_ctls(codec, cfg, 0x15, 0x09, 0); 15916 15718 } 15917 15719 15918 15720 ··· 16148 15950 if (err < 0) 16149 15951 return err; 16150 15952 16151 - alc_ssid_check(codec, 0x15, 0x1b, 0x14); 15953 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 16152 15954 16153 15955 return 1; 16154 15956 } ··· 16265 16067 if (!spec->loopback.amplist) 16266 16068 spec->loopback.amplist = alc861vd_loopbacks; 16267 16069 #endif 16268 - codec->proc_widget_hook = print_realtek_coef; 16269 16070 16270 16071 return 0; 16271 16072 } ··· 16731 16534 /* ADC: mute amp left and right */ 16732 16535 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 16733 16536 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 16734 - /* Front mixer: unmute input/output amp left and right (volume = 0) */ 16735 - 16736 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 16737 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 16738 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, 16739 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, 16740 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, 16741 16537 16742 16538 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 16743 16539 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, ··· 16780 16590 { } 16781 16591 }; 16782 16592 16593 + static struct hda_verb alc663_init_verbs[] = { 16594 + {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 16595 + {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 16596 + {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 16597 + {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 16598 + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 16599 + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 16600 + { } 16601 + }; 16602 + 16603 + static struct hda_verb alc272_init_verbs[] = { 16604 + {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, 16605 + {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 16606 + {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 16607 + {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 16608 + {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 16609 + {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 16610 + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 16611 + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 16612 + { } 16613 + }; 16614 + 16783 16615 static struct hda_verb alc662_sue_init_verbs[] = { 16784 16616 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC880_FRONT_EVENT}, 16785 16617 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC880_HP_EVENT}, ··· 16819 16607 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 16820 16608 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, 16821 16609 {} 16822 - }; 16823 - 16824 - /* 16825 - * generic initialization of ADC, input mixers and output mixers 16826 - */ 16827 - static struct hda_verb alc662_auto_init_verbs[] = { 16828 - /* 16829 - * Unmute ADC and set the default input to mic-in 16830 - */ 16831 - {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 16832 - {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 16833 - 16834 - /* Unmute input amps (CD, Line In, Mic 1 & Mic 2) of the analog-loopback 16835 - * mixer widget 16836 - * Note: PASD motherboards uses the Line In 2 as the input for front 16837 - * panel mic (mic 2) 16838 - */ 16839 - /* Amp Indices: Mic1 = 0, Mic2 = 1, Line1 = 2, Line2 = 3, CD = 4 */ 16840 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 16841 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 16842 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, 16843 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, 16844 - {0x0b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, 16845 - 16846 - /* 16847 - * Set up output mixers (0x0c - 0x0f) 16848 - */ 16849 - /* set vol=0 to output mixers */ 16850 - {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 16851 - {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 16852 - {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 16853 - 16854 - /* set up input amps for analog loopback */ 16855 - /* Amp Indices: DAC = 0, mixer = 1 */ 16856 - {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 16857 - {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 16858 - {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 16859 - {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 16860 - {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 16861 - {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 16862 - 16863 - 16864 - /* FIXME: use matrix-type input source selection */ 16865 - /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */ 16866 - /* Input mixer */ 16867 - {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 16868 - {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 16869 - { } 16870 - }; 16871 - 16872 - /* additional verbs for ALC663 */ 16873 - static struct hda_verb alc663_auto_init_verbs[] = { 16874 - {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 16875 - {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 16876 - { } 16877 16610 }; 16878 16611 16879 16612 static struct hda_verb alc663_m51va_init_verbs[] = { ··· 17571 17414 SND_PCI_QUIRK(0x1028, 0x02f4, "DELL ZM1", ALC272_DELL_ZM1), 17572 17415 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC663_ASUS_MODE1), 17573 17416 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC663_ASUS_MODE3), 17417 + SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC663_ASUS_MODE1), 17574 17418 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC663_ASUS_MODE3), 17575 17419 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC663_ASUS_MODE1), 17576 17420 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_ASUS_MODE2), ··· 17607 17449 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC663_ASUS_MODE3), 17608 17450 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC663_ASUS_MODE3), 17609 17451 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC663_ASUS_MODE1), 17452 + SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC663_ASUS_MODE1), 17610 17453 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC663_ASUS_MODE1), 17611 17454 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC663_ASUS_MODE1), 17612 17455 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC663_ASUS_MODE1), ··· 17635 17476 SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10), 17636 17477 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L", 17637 17478 ALC662_3ST_6ch_DIG), 17479 + SND_PCI_QUIRK(0x152d, 0x2304, "Quanta WH1", ALC663_ASUS_H13), 17638 17480 SND_PCI_QUIRK(0x1565, 0x820f, "Biostar TA780G M2+", ALC662_3ST_6ch_DIG), 17639 17481 SND_PCI_QUIRK(0x1631, 0xc10c, "PB RS65", ALC663_ASUS_M51VA), 17640 17482 SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo", ALC662_LENOVO_101E), ··· 18254 18094 spec->num_mux_defs = 1; 18255 18095 spec->input_mux = &spec->private_imux[0]; 18256 18096 18257 - add_verb(spec, alc662_auto_init_verbs); 18258 - if (codec->vendor_id == 0x10ec0663) 18259 - add_verb(spec, alc663_auto_init_verbs); 18097 + add_verb(spec, alc662_init_verbs); 18098 + if (codec->vendor_id == 0x10ec0272 || codec->vendor_id == 0x10ec0663 || 18099 + codec->vendor_id == 0x10ec0665) 18100 + add_verb(spec, alc663_init_verbs); 18101 + 18102 + if (codec->vendor_id == 0x10ec0272) 18103 + add_verb(spec, alc272_init_verbs); 18260 18104 18261 18105 err = alc_auto_add_mic_boost(codec); 18262 18106 if (err < 0) 18263 18107 return err; 18264 18108 18265 - alc_ssid_check(codec, 0x15, 0x1b, 0x14); 18109 + if (codec->vendor_id == 0x10ec0272 || codec->vendor_id == 0x10ec0663 || 18110 + codec->vendor_id == 0x10ec0665 || codec->vendor_id == 0x10ec0670) 18111 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0x21); 18112 + else 18113 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 18266 18114 18267 18115 return 1; 18268 18116 } ··· 18356 18188 18357 18189 if (!spec->cap_mixer) 18358 18190 set_capture_mixer(codec); 18359 - if (codec->vendor_id == 0x10ec0662) 18360 - set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 18361 - else 18362 - set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); 18363 18191 18192 + switch (codec->vendor_id) { 18193 + case 0x10ec0662: 18194 + set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 18195 + break; 18196 + case 0x10ec0272: 18197 + case 0x10ec0663: 18198 + case 0x10ec0665: 18199 + set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); 18200 + break; 18201 + case 0x10ec0273: 18202 + set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); 18203 + break; 18204 + } 18364 18205 spec->vmaster_nid = 0x02; 18365 18206 18366 18207 codec->patch_ops = alc_patch_ops; ··· 18379 18202 if (!spec->loopback.amplist) 18380 18203 spec->loopback.amplist = alc662_loopbacks; 18381 18204 #endif 18382 - codec->proc_widget_hook = print_realtek_coef; 18383 18205 18384 18206 return 0; 18385 18207 } ··· 18419 18243 { .id = 0x10ec0662, .rev = 0x100101, .name = "ALC662 rev1", 18420 18244 .patch = patch_alc662 }, 18421 18245 { .id = 0x10ec0663, .name = "ALC663", .patch = patch_alc662 }, 18246 + { .id = 0x10ec0665, .name = "ALC665", .patch = patch_alc662 }, 18247 + { .id = 0x10ec0670, .name = "ALC670", .patch = patch_alc662 }, 18422 18248 { .id = 0x10ec0880, .name = "ALC880", .patch = patch_alc880 }, 18423 18249 { .id = 0x10ec0882, .name = "ALC882", .patch = patch_alc882 }, 18424 18250 { .id = 0x10ec0883, .name = "ALC883", .patch = patch_alc882 },
+83 -68
sound/pci/hda/patch_sigmatel.c
··· 568 568 0x0f, 0x10, 0x11, 0x1f, 0x20, 569 569 }; 570 570 571 + static hda_nid_t stac92hd88xxx_pin_nids[10] = { 572 + 0x0a, 0x0b, 0x0c, 0x0d, 573 + 0x0f, 0x11, 0x1f, 0x20, 574 + }; 575 + 571 576 #define STAC92HD71BXX_NUM_PINS 13 572 577 static hda_nid_t stac92hd71bxx_pin_nids_4port[STAC92HD71BXX_NUM_PINS] = { 573 578 0x0a, 0x0b, 0x0c, 0x0d, 0x00, ··· 2878 2873 2879 2874 conn_len = snd_hda_get_connections(codec, nid, conn, 2880 2875 HDA_MAX_CONNECTIONS); 2876 + /* 92HD88: trace back up the link of nids to find the DAC */ 2877 + while (conn_len == 1 && (get_wcaps_type(get_wcaps(codec, conn[0])) 2878 + != AC_WID_AUD_OUT)) { 2879 + nid = conn[0]; 2880 + conn_len = snd_hda_get_connections(codec, nid, conn, 2881 + HDA_MAX_CONNECTIONS); 2882 + } 2881 2883 for (j = 0; j < conn_len; j++) { 2882 2884 wcaps = get_wcaps(codec, conn[j]); 2883 2885 wtype = get_wcaps_type(wcaps); ··· 4363 4351 if (enable_pin_detect(codec, nid, STAC_PWR_EVENT)) 4364 4352 stac_issue_unsol_event(codec, nid); 4365 4353 } 4354 + 4355 + #ifdef CONFIG_SND_HDA_POWER_SAVE 4356 + /* sync mute LED */ 4357 + if (spec->gpio_led && codec->patch_ops.check_power_status) 4358 + codec->patch_ops.check_power_status(codec, 0x01); 4359 + #endif 4366 4360 if (spec->dac_list) 4367 4361 stac92xx_power_down(codec); 4368 4362 return 0; ··· 4760 4742 static void set_hp_led_gpio(struct hda_codec *codec) 4761 4743 { 4762 4744 struct sigmatel_spec *spec = codec->spec; 4763 - switch (codec->vendor_id) { 4764 - case 0x111d7608: 4765 - /* GPIO 0 */ 4766 - spec->gpio_led = 0x01; 4767 - break; 4768 - case 0x111d7600: 4769 - case 0x111d7601: 4770 - case 0x111d7602: 4771 - case 0x111d7603: 4772 - /* GPIO 3 */ 4773 - spec->gpio_led = 0x08; 4774 - break; 4775 - } 4745 + unsigned int gpio; 4746 + 4747 + gpio = snd_hda_param_read(codec, codec->afg, AC_PAR_GPIO_CAP); 4748 + gpio &= AC_GPIO_IO_COUNT; 4749 + if (gpio > 3) 4750 + spec->gpio_led = 0x08; /* GPIO 3 */ 4751 + else 4752 + spec->gpio_led = 0x01; /* GPIO 0 */ 4776 4753 } 4777 4754 4778 4755 /* ··· 4790 4777 * Need more information on whether it is true across the entire series. 4791 4778 * -- kunal 4792 4779 */ 4793 - static int find_mute_led_gpio(struct hda_codec *codec) 4780 + static int find_mute_led_gpio(struct hda_codec *codec, int default_polarity) 4794 4781 { 4795 4782 struct sigmatel_spec *spec = codec->spec; 4796 4783 const struct dmi_device *dev = NULL; ··· 4817 4804 */ 4818 4805 if (!hp_blike_system(codec->subsystem_id)) { 4819 4806 set_hp_led_gpio(codec); 4820 - spec->gpio_led_polarity = 1; 4807 + spec->gpio_led_polarity = default_polarity; 4821 4808 return 1; 4822 4809 } 4823 4810 } ··· 4915 4902 stac_issue_unsol_event(codec, 4916 4903 spec->autocfg.line_out_pins[0]); 4917 4904 } 4905 + #ifdef CONFIG_SND_HDA_POWER_SAVE 4906 + /* sync mute LED */ 4907 + if (spec->gpio_led && codec->patch_ops.check_power_status) 4908 + codec->patch_ops.check_power_status(codec, 0x01); 4909 + #endif 4918 4910 return 0; 4919 4911 } 4920 4912 ··· 4939 4921 hda_nid_t nid) 4940 4922 { 4941 4923 struct sigmatel_spec *spec = codec->spec; 4924 + int i, muted = 1; 4942 4925 4943 - if (nid == 0x10) { 4944 - if (snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) & 4945 - HDA_AMP_MUTE) 4946 - spec->gpio_data &= ~spec->gpio_led; /* orange */ 4947 - else 4948 - spec->gpio_data |= spec->gpio_led; /* white */ 4949 - 4950 - if (!spec->gpio_led_polarity) { 4951 - /* LED state is inverted on these systems */ 4952 - spec->gpio_data ^= spec->gpio_led; 4926 + for (i = 0; i < spec->multiout.num_dacs; i++) { 4927 + nid = spec->multiout.dac_nids[i]; 4928 + if (!(snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) & 4929 + HDA_AMP_MUTE)) { 4930 + muted = 0; /* something heard */ 4931 + break; 4953 4932 } 4933 + } 4934 + if (muted) 4935 + spec->gpio_data &= ~spec->gpio_led; /* orange */ 4936 + else 4937 + spec->gpio_data |= spec->gpio_led; /* white */ 4954 4938 4955 - stac_gpio_set(codec, spec->gpio_mask, 4956 - spec->gpio_dir, 4957 - spec->gpio_data); 4939 + if (!spec->gpio_led_polarity) { 4940 + /* LED state is inverted on these systems */ 4941 + spec->gpio_data ^= spec->gpio_led; 4958 4942 } 4959 4943 4960 - return 0; 4961 - } 4962 - 4963 - static int idt92hd83xxx_hp_check_power_status(struct hda_codec *codec, 4964 - hda_nid_t nid) 4965 - { 4966 - struct sigmatel_spec *spec = codec->spec; 4967 - 4968 - if (nid != 0x13) 4969 - return 0; 4970 - if (snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) & HDA_AMP_MUTE) 4971 - spec->gpio_data |= spec->gpio_led; /* mute LED on */ 4972 - else 4973 - spec->gpio_data &= ~spec->gpio_led; /* mute LED off */ 4974 4944 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data); 4975 - 4976 4945 return 0; 4977 4946 } 4978 - 4979 4947 #endif 4980 4948 4981 4949 static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state) ··· 5283 5279 hda_nid_t conn[STAC92HD83_DAC_COUNT + 1]; 5284 5280 int err; 5285 5281 int num_dacs; 5286 - hda_nid_t nid; 5287 5282 5288 5283 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 5289 5284 if (spec == NULL) ··· 5321 5318 stac92hd83xxx_brd_tbl[spec->board_config]); 5322 5319 5323 5320 switch (codec->vendor_id) { 5321 + case 0x111d7666: 5322 + case 0x111d7667: 5323 + case 0x111d7668: 5324 + case 0x111d7669: 5325 + spec->num_pins = ARRAY_SIZE(stac92hd88xxx_pin_nids); 5326 + spec->pin_nids = stac92hd88xxx_pin_nids; 5327 + spec->mono_nid = 0; 5328 + spec->digbeep_nid = 0; 5329 + spec->num_pwrs = 0; 5330 + break; 5324 5331 case 0x111d7604: 5332 + case 0x111d76d4: 5325 5333 case 0x111d7605: 5326 5334 case 0x111d76d5: 5327 5335 if (spec->board_config == STAC_92HD83XXX_PWR_REF) ··· 5343 5329 5344 5330 codec->patch_ops = stac92xx_patch_ops; 5345 5331 5346 - if (spec->board_config == STAC_92HD83XXX_HP) 5347 - spec->gpio_led = 0x01; 5332 + if (find_mute_led_gpio(codec, 0)) 5333 + snd_printd("mute LED gpio %d polarity %d\n", 5334 + spec->gpio_led, 5335 + spec->gpio_led_polarity); 5348 5336 5349 5337 #ifdef CONFIG_SND_HDA_POWER_SAVE 5350 5338 if (spec->gpio_led) { ··· 5355 5339 spec->gpio_data |= spec->gpio_led; 5356 5340 /* register check_power_status callback. */ 5357 5341 codec->patch_ops.check_power_status = 5358 - idt92hd83xxx_hp_check_power_status; 5342 + stac92xx_hp_check_power_status; 5359 5343 } 5360 5344 #endif 5361 5345 ··· 5375 5359 return err; 5376 5360 } 5377 5361 5378 - switch (spec->board_config) { 5379 - case STAC_DELL_S14: 5380 - nid = 0xf; 5381 - break; 5382 - default: 5383 - nid = 0xe; 5384 - break; 5385 - } 5386 - 5387 - num_dacs = snd_hda_get_connections(codec, nid, 5362 + /* docking output support */ 5363 + num_dacs = snd_hda_get_connections(codec, 0xF, 5388 5364 conn, STAC92HD83_DAC_COUNT + 1) - 1; 5389 - if (num_dacs < 0) 5390 - num_dacs = STAC92HD83_DAC_COUNT; 5391 - 5392 - /* set port X to select the last DAC 5393 - */ 5394 - snd_hda_codec_write_cache(codec, nid, 0, 5365 + /* skip non-DAC connections */ 5366 + while (num_dacs >= 0 && 5367 + (get_wcaps_type(get_wcaps(codec, conn[num_dacs])) 5368 + != AC_WID_AUD_OUT)) 5369 + num_dacs--; 5370 + /* set port E and F to select the last DAC */ 5371 + if (num_dacs >= 0) { 5372 + snd_hda_codec_write_cache(codec, 0xE, 0, 5395 5373 AC_VERB_SET_CONNECT_SEL, num_dacs); 5374 + snd_hda_codec_write_cache(codec, 0xF, 0, 5375 + AC_VERB_SET_CONNECT_SEL, num_dacs); 5376 + } 5396 5377 5397 5378 codec->proc_widget_hook = stac92hd_proc_hook; 5398 5379 ··· 5670 5657 */ 5671 5658 spec->num_smuxes = 1; 5672 5659 spec->num_dmuxes = 1; 5673 - spec->gpio_led = 0x01; 5674 5660 /* fallthrough */ 5675 5661 case STAC_HP_DV5: 5676 5662 snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010); ··· 5684 5672 spec->num_dmics = 1; 5685 5673 spec->num_dmuxes = 1; 5686 5674 spec->num_smuxes = 1; 5687 - /* orange/white mute led on GPIO3, orange=0, white=1 */ 5688 - spec->gpio_led = 0x08; 5689 5675 break; 5690 5676 } 5691 5677 ··· 5705 5695 } 5706 5696 } 5707 5697 5708 - if (find_mute_led_gpio(codec)) 5698 + if (find_mute_led_gpio(codec, 1)) 5709 5699 snd_printd("mute LED gpio %d polarity %d\n", 5710 5700 spec->gpio_led, 5711 5701 spec->gpio_led_polarity); ··· 6246 6236 { .id = 0x838476a7, .name = "STAC9254D", .patch = patch_stac9205 }, 6247 6237 { .id = 0x111d7603, .name = "92HD75B3X5", .patch = patch_stac92hd71bxx}, 6248 6238 { .id = 0x111d7604, .name = "92HD83C1X5", .patch = patch_stac92hd83xxx}, 6239 + { .id = 0x111d76d4, .name = "92HD83C1C5", .patch = patch_stac92hd83xxx}, 6249 6240 { .id = 0x111d7605, .name = "92HD81B1X5", .patch = patch_stac92hd83xxx}, 6250 6241 { .id = 0x111d76d5, .name = "92HD81B1C5", .patch = patch_stac92hd83xxx}, 6242 + { .id = 0x111d7666, .name = "92HD88B3", .patch = patch_stac92hd83xxx}, 6243 + { .id = 0x111d7667, .name = "92HD88B1", .patch = patch_stac92hd83xxx}, 6244 + { .id = 0x111d7668, .name = "92HD88B2", .patch = patch_stac92hd83xxx}, 6245 + { .id = 0x111d7669, .name = "92HD88B4", .patch = patch_stac92hd83xxx}, 6251 6246 { .id = 0x111d7608, .name = "92HD75B2X5", .patch = patch_stac92hd71bxx}, 6252 6247 { .id = 0x111d7674, .name = "92HD73D1X5", .patch = patch_stac92hd73xx }, 6253 6248 { .id = 0x111d7675, .name = "92HD73C1X5", .patch = patch_stac92hd73xx },