Merge branch 'topic/hda' into for-linus

+879 -487
+5
Documentation/sound/alsa/HD-Audio-Models.txt
··· 124 asus-a7m ASUS A7M 125 macpro MacPro support 126 mb5 Macbook 5,1 127 mbp3 Macbook Pro rev3 128 imac24 iMac 24'' with jack detection 129 imac91 iMac 9,1 ··· 281 laptop Basic Laptop config (default) 282 hp HP Spartan laptop 283 hp-dv6736 HP dv6736 284 lenovo-x200 Lenovo X200 laptop 285 286 Conexant 5066 287 ============= 288 laptop Basic Laptop config (default) 289 dell-laptop Dell laptops 290 olpc-xo-1_5 OLPC XO 1.5 291 292 STAC9200 293 ========
··· 124 asus-a7m ASUS A7M 125 macpro MacPro support 126 mb5 Macbook 5,1 127 + macmini3 Macmini 3,1 128 + mba21 Macbook Air 2,1 129 mbp3 Macbook Pro rev3 130 imac24 iMac 24'' with jack detection 131 imac91 iMac 9,1 ··· 279 laptop Basic Laptop config (default) 280 hp HP Spartan laptop 281 hp-dv6736 HP dv6736 282 + hp-f700 HP Compaq Presario F700 283 lenovo-x200 Lenovo X200 laptop 284 + toshiba Toshiba Satellite M300 285 286 Conexant 5066 287 ============= 288 laptop Basic Laptop config (default) 289 dell-laptop Dell laptops 290 olpc-xo-1_5 OLPC XO 1.5 291 + ideapad Lenovo IdeaPad U150 292 293 STAC9200 294 ========
+27
Documentation/sound/alsa/HD-Audio.txt
··· 452 sysfs entries, and the lines after `[hint]` are parsed as `hints` 453 sysfs entries, respectively. 454 455 The hd-audio driver reads the file via request_firmware(). Thus, 456 a patch file has to be located on the appropriate firmware path, 457 typically, /lib/firmware. For example, when you pass the option
··· 452 sysfs entries, and the lines after `[hint]` are parsed as `hints` 453 sysfs entries, respectively. 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 + 482 The hd-audio driver reads the file via request_firmware(). Thus, 483 a patch file has to be located on the appropriate firmware path, 484 typically, /lib/firmware. For example, when you pass the option
+4 -2
sound/pci/hda/hda_codec.c
··· 2767 snd_hda_codec_read(codec, fg, 0, AC_VERB_SET_POWER_STATE, 2768 power_state); 2769 /* partial workaround for "azx_get_response timeout" */ 2770 - if (power_state == AC_PWRST_D0) 2771 msleep(10); 2772 2773 nid = codec->start_nid; ··· 2802 if (power_state == AC_PWRST_D0) { 2803 unsigned long end_time; 2804 int state; 2805 - msleep(10); 2806 /* wait until the codec reachs to D0 */ 2807 end_time = jiffies + msecs_to_jiffies(500); 2808 do { ··· 3275 3276 /* 3277 * get the empty PCM device number to assign 3278 */ 3279 static int get_empty_pcm_device(struct hda_bus *bus, int type) 3280 {
··· 2767 snd_hda_codec_read(codec, fg, 0, AC_VERB_SET_POWER_STATE, 2768 power_state); 2769 /* partial workaround for "azx_get_response timeout" */ 2770 + if (power_state == AC_PWRST_D0 && 2771 + (codec->vendor_id & 0xffff0000) == 0x14f10000) 2772 msleep(10); 2773 2774 nid = codec->start_nid; ··· 2801 if (power_state == AC_PWRST_D0) { 2802 unsigned long end_time; 2803 int state; 2804 /* wait until the codec reachs to D0 */ 2805 end_time = jiffies + msecs_to_jiffies(500); 2806 do { ··· 3275 3276 /* 3277 * get the empty PCM device number to assign 3278 + * 3279 + * note the max device number is limited by HDA_MAX_PCMS, currently 10 3280 */ 3281 static int get_empty_pcm_device(struct hda_bus *bus, int type) 3282 {
+3
sound/pci/hda/hda_codec.h
··· 527 /* max. codec address */ 528 #define HDA_MAX_CODEC_ADDRESS 0x0f 529 530 /* 531 * generic arrays 532 */
··· 527 /* max. codec address */ 528 #define HDA_MAX_CODEC_ADDRESS 0x0f 529 530 + /* max number of PCM devics per card */ 531 + #define HDA_MAX_PCMS 10 532 + 533 /* 534 * generic arrays 535 */
+38 -15
sound/pci/hda/hda_hwdep.c
··· 625 LINE_MODE_PINCFG, 626 LINE_MODE_VERB, 627 LINE_MODE_HINT, 628 NUM_LINE_MODES, 629 }; 630 ··· 658 } 659 660 /* parse the contents after the other command tags, [pincfg], [verb], 661 - * [hint] and [model] 662 * just pass to the sysfs helper (only when any codec was specified) 663 */ 664 static void parse_pincfg_mode(char *buf, struct hda_bus *bus, 665 struct hda_codec **codecp) 666 { 667 - if (!*codecp) 668 - return; 669 parse_user_pin_configs(*codecp, buf); 670 } 671 672 static void parse_verb_mode(char *buf, struct hda_bus *bus, 673 struct hda_codec **codecp) 674 { 675 - if (!*codecp) 676 - return; 677 parse_init_verbs(*codecp, buf); 678 } 679 680 static void parse_hint_mode(char *buf, struct hda_bus *bus, 681 struct hda_codec **codecp) 682 { 683 - if (!*codecp) 684 - return; 685 parse_hints(*codecp, buf); 686 } 687 688 static void parse_model_mode(char *buf, struct hda_bus *bus, 689 struct hda_codec **codecp) 690 { 691 - if (!*codecp) 692 - return; 693 kfree((*codecp)->modelname); 694 (*codecp)->modelname = kstrdup(buf, GFP_KERNEL); 695 } 696 697 struct hda_patch_item { 698 const char *tag; 699 void (*parser)(char *buf, struct hda_bus *bus, struct hda_codec **retc); 700 }; 701 702 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 }, 708 }; 709 710 /* check the line starting with '[' -- change the parser mode accodingly */ ··· 805 continue; 806 if (*buf == '[') 807 line_mode = parse_line_mode(buf, bus); 808 - else if (patch_items[line_mode].parser) 809 patch_items[line_mode].parser(buf, bus, &codec); 810 } 811 release_firmware(fw);
··· 625 LINE_MODE_PINCFG, 626 LINE_MODE_VERB, 627 LINE_MODE_HINT, 628 + LINE_MODE_VENDOR_ID, 629 + LINE_MODE_SUBSYSTEM_ID, 630 + LINE_MODE_REVISION_ID, 631 + LINE_MODE_CHIP_NAME, 632 NUM_LINE_MODES, 633 }; 634 ··· 654 } 655 656 /* parse the contents after the other command tags, [pincfg], [verb], 657 + * [vendor_id], [subsystem_id], [revision_id], [chip_name], [hint] and [model] 658 * just pass to the sysfs helper (only when any codec was specified) 659 */ 660 static void parse_pincfg_mode(char *buf, struct hda_bus *bus, 661 struct hda_codec **codecp) 662 { 663 parse_user_pin_configs(*codecp, buf); 664 } 665 666 static void parse_verb_mode(char *buf, struct hda_bus *bus, 667 struct hda_codec **codecp) 668 { 669 parse_init_verbs(*codecp, buf); 670 } 671 672 static void parse_hint_mode(char *buf, struct hda_bus *bus, 673 struct hda_codec **codecp) 674 { 675 parse_hints(*codecp, buf); 676 } 677 678 static void parse_model_mode(char *buf, struct hda_bus *bus, 679 struct hda_codec **codecp) 680 { 681 kfree((*codecp)->modelname); 682 (*codecp)->modelname = kstrdup(buf, GFP_KERNEL); 683 } 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 + 706 struct hda_patch_item { 707 const char *tag; 708 void (*parser)(char *buf, struct hda_bus *bus, struct hda_codec **retc); 709 + int need_codec; 710 }; 711 712 static struct hda_patch_item patch_items[NUM_LINE_MODES] = { 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 }, 722 }; 723 724 /* check the line starting with '[' -- change the parser mode accodingly */ ··· 783 continue; 784 if (*buf == '[') 785 line_mode = parse_line_mode(buf, bus); 786 + else if (patch_items[line_mode].parser && 787 + (codec || !patch_items[line_mode].need_codec)) 788 patch_items[line_mode].parser(buf, bus, &codec); 789 } 790 release_firmware(fw);
+17 -11
sound/pci/hda/hda_intel.c
··· 125 "{Intel, ICH9}," 126 "{Intel, ICH10}," 127 "{Intel, PCH}," 128 "{Intel, SCH}," 129 "{ATI, SB450}," 130 "{ATI, SB600}," ··· 260 #define AZX_MAX_FRAG 32 261 /* max buffer size - no h/w limit, you can increase as you like */ 262 #define AZX_MAX_BUF_SIZE (1024*1024*1024) 263 - /* max number of PCM devics per card */ 264 - #define AZX_MAX_PCMS 8 265 266 /* RIRB int mask: overrun[2], response[0] */ 267 #define RIRB_INT_RESPONSE 0x01 ··· 407 struct azx_dev *azx_dev; 408 409 /* PCM */ 410 - struct snd_pcm *pcm[AZX_MAX_PCMS]; 411 412 /* HD codec */ 413 unsigned short codec_mask; ··· 448 /* driver types */ 449 enum { 450 AZX_DRIVER_ICH, 451 AZX_DRIVER_SCH, 452 AZX_DRIVER_ATI, 453 AZX_DRIVER_ATIHDMI, ··· 463 464 static char *driver_short_names[] __devinitdata = { 465 [AZX_DRIVER_ICH] = "HDA Intel", 466 [AZX_DRIVER_SCH] = "HDA Intel MID", 467 [AZX_DRIVER_ATI] = "HDA ATI SB", 468 [AZX_DRIVER_ATIHDMI] = "HDA ATI HDMI", ··· 969 azx_dev->insufficient = 1; 970 971 /* enable SIE */ 972 - azx_writeb(chip, INTCTL, 973 - azx_readb(chip, INTCTL) | (1 << azx_dev->index)); 974 /* set DMA start and interrupt mask */ 975 azx_sd_writeb(azx_dev, SD_CTL, azx_sd_readb(azx_dev, SD_CTL) | 976 SD_CTL_DMA_START | SD_INT_MASK); ··· 989 { 990 azx_stream_clear(chip, azx_dev); 991 /* disable SIE */ 992 - azx_writeb(chip, INTCTL, 993 - azx_readb(chip, INTCTL) & ~(1 << azx_dev->index)); 994 } 995 996 ··· 1066 0x01, NVIDIA_HDA_ENABLE_COHBIT); 1067 break; 1068 case AZX_DRIVER_SCH: 1069 pci_read_config_word(chip->pci, INTEL_SCH_HDA_DEVC, &snoop); 1070 if (snoop & INTEL_SCH_HDA_DEVC_NOSNOOP) { 1071 pci_write_config_word(chip->pci, INTEL_SCH_HDA_DEVC, ··· 1352 if (chip->initialized) { 1353 int i; 1354 1355 - for (i = 0; i < AZX_MAX_PCMS; i++) 1356 snd_pcm_suspend_all(chip->pcm[i]); 1357 snd_hda_suspend(chip->bus); 1358 snd_hda_resume(chip->bus); ··· 1414 chip->codec_mask &= ~(1 << c); 1415 /* More badly, accessing to a non-existing 1416 * codec often screws up the controller chip, 1417 - * and distrubs the further communications. 1418 * Thus if an error occurs during probing, 1419 * better to reset the controller chip to 1420 * get back to the sanity state. ··· 1985 int pcm_dev = cpcm->device; 1986 int s, err; 1987 1988 - if (pcm_dev >= AZX_MAX_PCMS) { 1989 snd_printk(KERN_ERR SFX "Invalid PCM device number %d\n", 1990 pcm_dev); 1991 return -EINVAL; ··· 2141 2142 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 2143 azx_clear_irq_pending(chip); 2144 - for (i = 0; i < AZX_MAX_PCMS; i++) 2145 snd_pcm_suspend_all(chip->pcm[i]); 2146 if (chip->initialized) 2147 snd_hda_suspend(chip->bus); ··· 2264 SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB), 2265 SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB), 2266 SND_PCI_QUIRK(0x103c, 0x306d, "HP dv3", POS_FIX_LPIB), 2267 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB), 2268 SND_PCI_QUIRK(0x1462, 0x1002, "MSI Wind U115", POS_FIX_LPIB), 2269 {} ··· 2421 if (bdl_pos_adj[dev] < 0) { 2422 switch (chip->driver_type) { 2423 case AZX_DRIVER_ICH: 2424 bdl_pos_adj[dev] = 1; 2425 break; 2426 default: ··· 2700 { PCI_DEVICE(0x8086, 0x3a6e), .driver_data = AZX_DRIVER_ICH }, 2701 /* PCH */ 2702 { PCI_DEVICE(0x8086, 0x3b56), .driver_data = AZX_DRIVER_ICH }, 2703 /* SCH */ 2704 { PCI_DEVICE(0x8086, 0x811b), .driver_data = AZX_DRIVER_SCH }, 2705 /* ATI SB 450/600 */
··· 125 "{Intel, ICH9}," 126 "{Intel, ICH10}," 127 "{Intel, PCH}," 128 + "{Intel, CPT}," 129 "{Intel, SCH}," 130 "{ATI, SB450}," 131 "{ATI, SB600}," ··· 259 #define AZX_MAX_FRAG 32 260 /* max buffer size - no h/w limit, you can increase as you like */ 261 #define AZX_MAX_BUF_SIZE (1024*1024*1024) 262 263 /* RIRB int mask: overrun[2], response[0] */ 264 #define RIRB_INT_RESPONSE 0x01 ··· 408 struct azx_dev *azx_dev; 409 410 /* PCM */ 411 + struct snd_pcm *pcm[HDA_MAX_PCMS]; 412 413 /* HD codec */ 414 unsigned short codec_mask; ··· 449 /* driver types */ 450 enum { 451 AZX_DRIVER_ICH, 452 + AZX_DRIVER_PCH, 453 AZX_DRIVER_SCH, 454 AZX_DRIVER_ATI, 455 AZX_DRIVER_ATIHDMI, ··· 463 464 static char *driver_short_names[] __devinitdata = { 465 [AZX_DRIVER_ICH] = "HDA Intel", 466 + [AZX_DRIVER_PCH] = "HDA Intel PCH", 467 [AZX_DRIVER_SCH] = "HDA Intel MID", 468 [AZX_DRIVER_ATI] = "HDA ATI SB", 469 [AZX_DRIVER_ATIHDMI] = "HDA ATI HDMI", ··· 968 azx_dev->insufficient = 1; 969 970 /* enable SIE */ 971 + azx_writel(chip, INTCTL, 972 + azx_readl(chip, INTCTL) | (1 << azx_dev->index)); 973 /* set DMA start and interrupt mask */ 974 azx_sd_writeb(azx_dev, SD_CTL, azx_sd_readb(azx_dev, SD_CTL) | 975 SD_CTL_DMA_START | SD_INT_MASK); ··· 988 { 989 azx_stream_clear(chip, azx_dev); 990 /* disable SIE */ 991 + azx_writel(chip, INTCTL, 992 + azx_readl(chip, INTCTL) & ~(1 << azx_dev->index)); 993 } 994 995 ··· 1065 0x01, NVIDIA_HDA_ENABLE_COHBIT); 1066 break; 1067 case AZX_DRIVER_SCH: 1068 + case AZX_DRIVER_PCH: 1069 pci_read_config_word(chip->pci, INTEL_SCH_HDA_DEVC, &snoop); 1070 if (snoop & INTEL_SCH_HDA_DEVC_NOSNOOP) { 1071 pci_write_config_word(chip->pci, INTEL_SCH_HDA_DEVC, ··· 1350 if (chip->initialized) { 1351 int i; 1352 1353 + for (i = 0; i < HDA_MAX_PCMS; i++) 1354 snd_pcm_suspend_all(chip->pcm[i]); 1355 snd_hda_suspend(chip->bus); 1356 snd_hda_resume(chip->bus); ··· 1412 chip->codec_mask &= ~(1 << c); 1413 /* More badly, accessing to a non-existing 1414 * codec often screws up the controller chip, 1415 + * and disturbs the further communications. 1416 * Thus if an error occurs during probing, 1417 * better to reset the controller chip to 1418 * get back to the sanity state. ··· 1983 int pcm_dev = cpcm->device; 1984 int s, err; 1985 1986 + if (pcm_dev >= HDA_MAX_PCMS) { 1987 snd_printk(KERN_ERR SFX "Invalid PCM device number %d\n", 1988 pcm_dev); 1989 return -EINVAL; ··· 2139 2140 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 2141 azx_clear_irq_pending(chip); 2142 + for (i = 0; i < HDA_MAX_PCMS; i++) 2143 snd_pcm_suspend_all(chip->pcm[i]); 2144 if (chip->initialized) 2145 snd_hda_suspend(chip->bus); ··· 2262 SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB), 2263 SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB), 2264 SND_PCI_QUIRK(0x103c, 0x306d, "HP dv3", POS_FIX_LPIB), 2265 + SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB), 2266 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB), 2267 SND_PCI_QUIRK(0x1462, 0x1002, "MSI Wind U115", POS_FIX_LPIB), 2268 {} ··· 2418 if (bdl_pos_adj[dev] < 0) { 2419 switch (chip->driver_type) { 2420 case AZX_DRIVER_ICH: 2421 + case AZX_DRIVER_PCH: 2422 bdl_pos_adj[dev] = 1; 2423 break; 2424 default: ··· 2696 { PCI_DEVICE(0x8086, 0x3a6e), .driver_data = AZX_DRIVER_ICH }, 2697 /* PCH */ 2698 { PCI_DEVICE(0x8086, 0x3b56), .driver_data = AZX_DRIVER_ICH }, 2699 + /* CPT */ 2700 + { PCI_DEVICE(0x8086, 0x1c20), .driver_data = AZX_DRIVER_PCH }, 2701 /* SCH */ 2702 { PCI_DEVICE(0x8086, 0x811b), .driver_data = AZX_DRIVER_SCH }, 2703 /* ATI SB 450/600 */
+1 -1
sound/pci/hda/patch_analog.c
··· 1098 SND_PCI_QUIRK(0x1043, 0x81cb, "ASUS M2N", AD1986A_3STACK), 1099 SND_PCI_QUIRK(0x1043, 0x8234, "ASUS M2N", AD1986A_3STACK), 1100 SND_PCI_QUIRK(0x10de, 0xcb84, "ASUS A8N-VM", AD1986A_3STACK), 1101 - SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba", AD1986A_LAPTOP_EAPD), 1102 SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK), 1103 SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP), 1104 SND_PCI_QUIRK(0x144d, 0xc024, "Samsung P50", AD1986A_SAMSUNG_P50),
··· 1098 SND_PCI_QUIRK(0x1043, 0x81cb, "ASUS M2N", AD1986A_3STACK), 1099 SND_PCI_QUIRK(0x1043, 0x8234, "ASUS M2N", AD1986A_3STACK), 1100 SND_PCI_QUIRK(0x10de, 0xcb84, "ASUS A8N-VM", AD1986A_3STACK), 1101 + SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba Satellite L40-10Q", AD1986A_3STACK), 1102 SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK), 1103 SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP), 1104 SND_PCI_QUIRK(0x144d, 0xc024, "Samsung P50", AD1986A_SAMSUNG_P50),
+194 -61
sound/pci/hda/patch_conexant.c
··· 42 43 /* Conexant 5051 specific */ 44 45 - #define CXT5051_SPDIF_OUT 0x1C 46 #define CXT5051_PORTB_EVENT 0x38 47 #define CXT5051_PORTC_EVENT 0x39 48 49 50 struct conexant_jack { 51 ··· 76 */ 77 unsigned int cur_eapd; 78 unsigned int hp_present; 79 - unsigned int no_auto_mic; 80 unsigned int need_dac_fix; 81 82 /* capture */ ··· 113 114 unsigned int dell_automute; 115 unsigned int port_d_mode; 116 - unsigned int dell_vostro; 117 118 unsigned int ext_mic_present; 119 unsigned int recording; ··· 1606 { 1607 struct conexant_spec *spec = codec->spec; 1608 unsigned int pinctl; 1609 pinctl = (!spec->hp_present && spec->cur_eapd) ? PIN_OUT : 0; 1610 snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 1611 pinctl); ··· 1634 struct conexant_spec *spec = codec->spec; 1635 unsigned int present; 1636 1637 - if (spec->no_auto_mic) 1638 return; 1639 present = snd_hda_jack_detect(codec, 0x17); 1640 snd_hda_codec_write(codec, 0x14, 0, ··· 1649 unsigned int present; 1650 hda_nid_t new_adc; 1651 1652 - if (spec->no_auto_mic) 1653 return; 1654 present = snd_hda_jack_detect(codec, 0x18); 1655 if (present) ··· 1695 conexant_report_jack(codec, nid); 1696 } 1697 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), 1705 HDA_CODEC_VOLUME("Master Playback Volume", 0x10, 0x00, HDA_OUTPUT), 1706 { 1707 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, ··· 1705 .put = cxt5051_hp_master_sw_put, 1706 .private_value = 0x1a, 1707 }, 1708 1709 {} 1710 }; 1711 ··· 1723 HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT), 1724 HDA_CODEC_VOLUME("External Mic Volume", 0x15, 0x00, HDA_INPUT), 1725 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 {} 1737 }; 1738 1739 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 - 1752 {} 1753 }; 1754 1755 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 - }, 1767 1768 {} 1769 }; 1770 ··· 1771 /* EAPD */ 1772 {0x1a, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ 1773 {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 { } /* end */ 1777 }; 1778 ··· 1796 /* EAPD */ 1797 {0x1a, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ 1798 {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 { } /* end */ 1801 }; 1802 ··· 1827 /* EAPD */ 1828 {0x1a, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ 1829 {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 {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CONEXANT_HP_EVENT}, 1833 { } /* end */ 1834 }; 1835 1836 static struct hda_verb cxt5051_f700_init_verbs[] = { 1837 /* Line in, Mic */ 1838 - {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x03}, 1839 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, 1840 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0}, 1841 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0}, ··· 1853 /* EAPD */ 1854 {0x1a, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ 1855 {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 { } /* end */ 1858 }; 1859 1860 /* initialize jack-sensing, too */ 1861 static int cxt5051_init(struct hda_codec *codec) 1862 { 1863 conexant_init(codec); 1864 conexant_init_jacks(codec); 1865 if (codec->patch_ops.unsol_event) { 1866 cxt5051_hp_automute(codec); 1867 cxt5051_portb_automic(codec); ··· 1896 CXT5051_HP_DV6736, /* HP without mic switch */ 1897 CXT5051_LENOVO_X200, /* Lenovo X200 laptop */ 1898 CXT5051_F700, /* HP Compaq Presario F700 */ 1899 CXT5051_MODELS 1900 }; 1901 ··· 1905 [CXT5051_HP] = "hp", 1906 [CXT5051_HP_DV6736] = "hp-dv6736", 1907 [CXT5051_LENOVO_X200] = "lenovo-x200", 1908 - [CXT5051_F700] = "hp 700" 1909 }; 1910 1911 static struct snd_pci_quirk cxt5051_cfg_tbl[] = { 1912 SND_PCI_QUIRK(0x103c, 0x30cf, "HP DV6736", CXT5051_HP_DV6736), 1913 SND_PCI_QUIRK(0x103c, 0x360b, "Compaq Presario CQ60", CXT5051_HP), 1914 SND_PCI_QUIRK(0x14f1, 0x0101, "Conexant Reference board", 1915 CXT5051_LAPTOP), 1916 SND_PCI_QUIRK(0x14f1, 0x5051, "HP Spartan 1.1", CXT5051_HP), 1917 SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo X200", CXT5051_LENOVO_X200), 1918 - SND_PCI_QUIRK(0x103c, 0x30ea, "Compaq Presario F700", CXT5051_F700), 1919 {} 1920 }; 1921 ··· 1941 spec->multiout.dig_out_nid = CXT5051_SPDIF_OUT; 1942 spec->num_adc_nids = 1; /* not 2; via auto-mic switch */ 1943 spec->adc_nids = cxt5051_adc_nids; 1944 - spec->num_mixers = 1; 1945 - spec->mixers[0] = cxt5051_mixers; 1946 spec->num_init_verbs = 1; 1947 spec->init_verbs[0] = cxt5051_init_verbs; 1948 spec->spdif_route = 0; ··· 1957 board_config = snd_hda_check_board_config(codec, CXT5051_MODELS, 1958 cxt5051_models, 1959 cxt5051_cfg_tbl); 1960 switch (board_config) { 1961 case CXT5051_HP: 1962 spec->mixers[0] = cxt5051_hp_mixers; ··· 1965 case CXT5051_HP_DV6736: 1966 spec->init_verbs[0] = cxt5051_hp_dv6736_init_verbs; 1967 spec->mixers[0] = cxt5051_hp_dv6736_mixers; 1968 - spec->no_auto_mic = 1; 1969 break; 1970 case CXT5051_LENOVO_X200: 1971 spec->init_verbs[0] = cxt5051_lenovo_x200_init_verbs; ··· 1973 case CXT5051_F700: 1974 spec->init_verbs[0] = cxt5051_f700_init_verbs; 1975 spec->mixers[0] = cxt5051_f700_mixers; 1976 - spec->no_auto_mic = 1; 1977 break; 1978 } 1979 ··· 2168 } 2169 } 2170 2171 /* mute internal speaker if HP is plugged */ 2172 static void cxt5066_hp_automute(struct hda_codec *codec) 2173 { ··· 2245 } 2246 } 2247 2248 static const struct hda_input_mux cxt5066_analog_mic_boost = { 2249 .num_items = 5, 2250 .items = { ··· 2270 }, 2271 }; 2272 2273 - static int cxt5066_set_mic_boost(struct hda_codec *codec) 2274 { 2275 struct conexant_spec *spec = codec->spec; 2276 - return snd_hda_codec_write_cache(codec, 0x17, 0, 2277 AC_VERB_SET_AMP_GAIN_MUTE, 2278 AC_AMP_SET_RIGHT | AC_AMP_SET_LEFT | AC_AMP_SET_OUTPUT | 2279 cxt5066_analog_mic_boost.items[spec->mic_boost].index); 2280 } 2281 2282 static int cxt5066_mic_boost_mux_enum_info(struct snd_kcontrol *kcontrol, ··· 2715 { } /* end */ 2716 }; 2717 2718 static struct hda_verb cxt5066_init_verbs_portd_lo[] = { 2719 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 2720 { } /* end */ ··· 2781 cxt5066_hp_automute(codec); 2782 if (spec->dell_vostro) 2783 cxt5066_vostro_automic(codec); 2784 } 2785 cxt5066_set_mic_boost(codec); 2786 return 0; ··· 2808 CXT5066_DELL_LAPTOP, /* Dell Laptop */ 2809 CXT5066_OLPC_XO_1_5, /* OLPC XO 1.5 */ 2810 CXT5066_DELL_VOSTO, /* Dell Vostro 1015i */ 2811 CXT5066_MODELS 2812 }; 2813 ··· 2816 [CXT5066_LAPTOP] = "laptop", 2817 [CXT5066_DELL_LAPTOP] = "dell-laptop", 2818 [CXT5066_OLPC_XO_1_5] = "olpc-xo-1_5", 2819 - [CXT5066_DELL_VOSTO] = "dell-vostro" 2820 }; 2821 2822 static struct snd_pci_quirk cxt5066_cfg_tbl[] = { ··· 2827 CXT5066_DELL_LAPTOP), 2828 SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5), 2829 SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTO), 2830 {} 2831 }; 2832 ··· 2912 spec->dell_vostro = 1; 2913 spec->mic_boost = 3; /* default 30dB gain */ 2914 snd_hda_attach_beep_device(codec, 0x13); 2915 2916 /* no S/PDIF out */ 2917 spec->multiout.dig_out_nid = 0;
··· 42 43 /* Conexant 5051 specific */ 44 45 + #define CXT5051_SPDIF_OUT 0x12 46 #define CXT5051_PORTB_EVENT 0x38 47 #define CXT5051_PORTC_EVENT 0x39 48 49 + #define AUTO_MIC_PORTB (1 << 1) 50 + #define AUTO_MIC_PORTC (1 << 2) 51 52 struct conexant_jack { 53 ··· 74 */ 75 unsigned int cur_eapd; 76 unsigned int hp_present; 77 + unsigned int auto_mic; 78 unsigned int need_dac_fix; 79 80 /* capture */ ··· 111 112 unsigned int dell_automute; 113 unsigned int port_d_mode; 114 + unsigned int dell_vostro:1; 115 + unsigned int ideapad:1; 116 117 unsigned int ext_mic_present; 118 unsigned int recording; ··· 1603 { 1604 struct conexant_spec *spec = codec->spec; 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 */ 1611 pinctl = (!spec->hp_present && spec->cur_eapd) ? PIN_OUT : 0; 1612 snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, 1613 pinctl); ··· 1626 struct conexant_spec *spec = codec->spec; 1627 unsigned int present; 1628 1629 + if (!(spec->auto_mic & AUTO_MIC_PORTB)) 1630 return; 1631 present = snd_hda_jack_detect(codec, 0x17); 1632 snd_hda_codec_write(codec, 0x14, 0, ··· 1641 unsigned int present; 1642 hda_nid_t new_adc; 1643 1644 + if (!(spec->auto_mic & AUTO_MIC_PORTC)) 1645 return; 1646 present = snd_hda_jack_detect(codec, 0x18); 1647 if (present) ··· 1687 conexant_report_jack(codec, nid); 1688 } 1689 1690 + static struct snd_kcontrol_new cxt5051_playback_mixers[] = { 1691 HDA_CODEC_VOLUME("Master Playback Volume", 0x10, 0x00, HDA_OUTPUT), 1692 { 1693 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, ··· 1703 .put = cxt5051_hp_master_sw_put, 1704 .private_value = 0x1a, 1705 }, 1706 + {} 1707 + }; 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), 1716 {} 1717 }; 1718 ··· 1712 HDA_CODEC_MUTE("Internal Mic Switch", 0x14, 0x00, HDA_INPUT), 1713 HDA_CODEC_VOLUME("External Mic Volume", 0x15, 0x00, HDA_INPUT), 1714 HDA_CODEC_MUTE("External Mic Switch", 0x15, 0x00, HDA_INPUT), 1715 {} 1716 }; 1717 1718 static struct snd_kcontrol_new cxt5051_hp_dv6736_mixers[] = { 1719 + HDA_CODEC_VOLUME("Capture Volume", 0x14, 0x00, HDA_INPUT), 1720 + HDA_CODEC_MUTE("Capture Switch", 0x14, 0x00, HDA_INPUT), 1721 {} 1722 }; 1723 1724 static struct snd_kcontrol_new cxt5051_f700_mixers[] = { 1725 + HDA_CODEC_VOLUME("Capture Volume", 0x14, 0x01, HDA_INPUT), 1726 + HDA_CODEC_MUTE("Capture Switch", 0x14, 0x01, HDA_INPUT), 1727 + {} 1728 + }; 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), 1735 {} 1736 }; 1737 ··· 1782 /* EAPD */ 1783 {0x1a, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ 1784 {0x16, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CONEXANT_HP_EVENT}, 1785 { } /* end */ 1786 }; 1787 ··· 1809 /* EAPD */ 1810 {0x1a, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ 1811 {0x16, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CONEXANT_HP_EVENT}, 1812 { } /* end */ 1813 }; 1814 ··· 1841 /* EAPD */ 1842 {0x1a, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ 1843 {0x16, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CONEXANT_HP_EVENT}, 1844 {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CONEXANT_HP_EVENT}, 1845 { } /* end */ 1846 }; 1847 1848 static struct hda_verb cxt5051_f700_init_verbs[] = { 1849 /* Line in, Mic */ 1850 + {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x03}, 1851 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, 1852 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0}, 1853 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0}, ··· 1869 /* EAPD */ 1870 {0x1a, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */ 1871 {0x16, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CONEXANT_HP_EVENT}, 1872 { } /* end */ 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 + } 1886 1887 /* initialize jack-sensing, too */ 1888 static int cxt5051_init(struct hda_codec *codec) 1889 { 1890 + struct conexant_spec *spec = codec->spec; 1891 + 1892 conexant_init(codec); 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 + 1900 if (codec->patch_ops.unsol_event) { 1901 cxt5051_hp_automute(codec); 1902 cxt5051_portb_automic(codec); ··· 1893 CXT5051_HP_DV6736, /* HP without mic switch */ 1894 CXT5051_LENOVO_X200, /* Lenovo X200 laptop */ 1895 CXT5051_F700, /* HP Compaq Presario F700 */ 1896 + CXT5051_TOSHIBA, /* Toshiba M300 & co */ 1897 CXT5051_MODELS 1898 }; 1899 ··· 1901 [CXT5051_HP] = "hp", 1902 [CXT5051_HP_DV6736] = "hp-dv6736", 1903 [CXT5051_LENOVO_X200] = "lenovo-x200", 1904 + [CXT5051_F700] = "hp-700", 1905 + [CXT5051_TOSHIBA] = "toshiba", 1906 }; 1907 1908 static struct snd_pci_quirk cxt5051_cfg_tbl[] = { 1909 SND_PCI_QUIRK(0x103c, 0x30cf, "HP DV6736", CXT5051_HP_DV6736), 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), 1913 SND_PCI_QUIRK(0x14f1, 0x0101, "Conexant Reference board", 1914 CXT5051_LAPTOP), 1915 SND_PCI_QUIRK(0x14f1, 0x5051, "HP Spartan 1.1", CXT5051_HP), 1916 SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo X200", CXT5051_LENOVO_X200), 1917 {} 1918 }; 1919 ··· 1935 spec->multiout.dig_out_nid = CXT5051_SPDIF_OUT; 1936 spec->num_adc_nids = 1; /* not 2; via auto-mic switch */ 1937 spec->adc_nids = cxt5051_adc_nids; 1938 + spec->num_mixers = 2; 1939 + spec->mixers[0] = cxt5051_capture_mixers; 1940 + spec->mixers[1] = cxt5051_playback_mixers; 1941 spec->num_init_verbs = 1; 1942 spec->init_verbs[0] = cxt5051_init_verbs; 1943 spec->spdif_route = 0; ··· 1950 board_config = snd_hda_check_board_config(codec, CXT5051_MODELS, 1951 cxt5051_models, 1952 cxt5051_cfg_tbl); 1953 + spec->auto_mic = AUTO_MIC_PORTB | AUTO_MIC_PORTC; 1954 switch (board_config) { 1955 case CXT5051_HP: 1956 spec->mixers[0] = cxt5051_hp_mixers; ··· 1957 case CXT5051_HP_DV6736: 1958 spec->init_verbs[0] = cxt5051_hp_dv6736_init_verbs; 1959 spec->mixers[0] = cxt5051_hp_dv6736_mixers; 1960 + spec->auto_mic = 0; 1961 break; 1962 case CXT5051_LENOVO_X200: 1963 spec->init_verbs[0] = cxt5051_lenovo_x200_init_verbs; ··· 1965 case CXT5051_F700: 1966 spec->init_verbs[0] = cxt5051_f700_init_verbs; 1967 spec->mixers[0] = cxt5051_f700_mixers; 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; 1973 break; 1974 } 1975 ··· 2156 } 2157 } 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 + 2187 /* mute internal speaker if HP is plugged */ 2188 static void cxt5066_hp_automute(struct hda_codec *codec) 2189 { ··· 2205 } 2206 } 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 + 2222 static const struct hda_input_mux cxt5066_analog_mic_boost = { 2223 .num_items = 5, 2224 .items = { ··· 2216 }, 2217 }; 2218 2219 + static void cxt5066_set_mic_boost(struct hda_codec *codec) 2220 { 2221 struct conexant_spec *spec = codec->spec; 2222 + snd_hda_codec_write_cache(codec, 0x17, 0, 2223 AC_VERB_SET_AMP_GAIN_MUTE, 2224 AC_AMP_SET_RIGHT | AC_AMP_SET_LEFT | AC_AMP_SET_OUTPUT | 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 + } 2234 } 2235 2236 static int cxt5066_mic_boost_mux_enum_info(struct snd_kcontrol *kcontrol, ··· 2653 { } /* end */ 2654 }; 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 + 2706 static struct hda_verb cxt5066_init_verbs_portd_lo[] = { 2707 {0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 2708 { } /* end */ ··· 2669 cxt5066_hp_automute(codec); 2670 if (spec->dell_vostro) 2671 cxt5066_vostro_automic(codec); 2672 + else if (spec->ideapad) 2673 + cxt5066_ideapad_automic(codec); 2674 } 2675 cxt5066_set_mic_boost(codec); 2676 return 0; ··· 2694 CXT5066_DELL_LAPTOP, /* Dell Laptop */ 2695 CXT5066_OLPC_XO_1_5, /* OLPC XO 1.5 */ 2696 CXT5066_DELL_VOSTO, /* Dell Vostro 1015i */ 2697 + CXT5066_IDEAPAD, /* Lenovo IdeaPad U150 */ 2698 CXT5066_MODELS 2699 }; 2700 ··· 2701 [CXT5066_LAPTOP] = "laptop", 2702 [CXT5066_DELL_LAPTOP] = "dell-laptop", 2703 [CXT5066_OLPC_XO_1_5] = "olpc-xo-1_5", 2704 + [CXT5066_DELL_VOSTO] = "dell-vostro", 2705 + [CXT5066_IDEAPAD] = "ideapad", 2706 }; 2707 2708 static struct snd_pci_quirk cxt5066_cfg_tbl[] = { ··· 2711 CXT5066_DELL_LAPTOP), 2712 SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5), 2713 SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTO), 2714 + SND_PCI_QUIRK(0x17aa, 0x3a0d, "ideapad", CXT5066_IDEAPAD), 2715 {} 2716 }; 2717 ··· 2795 spec->dell_vostro = 1; 2796 spec->mic_boost = 3; /* default 30dB gain */ 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 */ 2814 2815 /* no S/PDIF out */ 2816 spec->multiout.dig_out_nid = 0;
+507 -329
sound/pci/hda/patch_realtek.c
··· 131 enum { 132 ALC269_BASIC, 133 ALC269_QUANTA_FL1, 134 - ALC269_ASUS_AMIC, 135 - ALC269_ASUS_DMIC, 136 ALC269_FUJITSU, 137 ALC269_LIFEBOOK, 138 ALC269_AUTO, ··· 209 ALC882_ASUS_A7J, 210 ALC882_ASUS_A7M, 211 ALC885_MACPRO, 212 ALC885_MBP3, 213 ALC885_MB5, 214 ALC885_IMAC24, 215 ALC885_IMAC91, 216 ALC883_3ST_2ch_DIG, ··· 845 spec->init_verbs[spec->num_init_verbs++] = verb; 846 } 847 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 /* 870 * set up from the preset table 871 */ ··· 1149 case 0x10ec0888: 1150 alc888_coef_init(codec); 1151 break; 1152 case 0x10ec0267: 1153 case 0x10ec0268: 1154 snd_hda_codec_write(codec, 0x20, 0, ··· 1162 AC_VERB_SET_PROC_COEF, 1163 tmp | 0x3000); 1164 break; 1165 } 1166 break; 1167 } ··· 1254 */ 1255 static int alc_subsystem_id(struct hda_codec *codec, 1256 hda_nid_t porta, hda_nid_t porte, 1257 - hda_nid_t portd) 1258 { 1259 unsigned int ass, tmp, i; 1260 unsigned nid; ··· 1280 snd_printd("realtek: No valid SSID, " 1281 "checking pincfg 0x%08x for NID 0x%x\n", 1282 ass, nid); 1283 - if (!(ass & 1) && !(ass & 0x100000)) 1284 return 0; 1285 if ((ass >> 30) != 1) /* no physical connection */ 1286 return 0; ··· 1340 nid = porte; 1341 else if (tmp == 2) 1342 nid = portd; 1343 else 1344 return 1; 1345 for (i = 0; i < spec->autocfg.line_outs; i++) ··· 1356 } 1357 1358 static void alc_ssid_check(struct hda_codec *codec, 1359 - hda_nid_t porta, hda_nid_t porte, hda_nid_t portd) 1360 { 1361 - if (!alc_subsystem_id(codec, porta, porte, portd)) { 1362 struct alc_spec *spec = codec->spec; 1363 snd_printd("realtek: " 1364 "Enable default setup for auto mode as fallback\n"); ··· 3717 /* We currently only handle front, HP */ 3718 switch (codec->vendor_id) { 3719 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); 3724 break; 3725 case 0x10ec0262: 3726 case 0x10ec0267: 3727 case 0x10ec0268: 3728 case 0x10ec0269: 3729 case 0x10ec0272: 3730 case 0x10ec0660: 3731 case 0x10ec0662: 3732 case 0x10ec0663: 3733 case 0x10ec0862: 3734 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); 3739 break; 3740 } 3741 } ··· 4862 spec->num_mux_defs = 1; 4863 spec->input_mux = &spec->private_imux[0]; 4864 4865 - alc_ssid_check(codec, 0x15, 0x1b, 0x14); 4866 4867 return 1; 4868 } ··· 5066 if (!spec->loopback.amplist) 5067 spec->loopback.amplist = alc880_loopbacks; 5068 #endif 5069 - codec->proc_widget_hook = print_realtek_coef; 5070 5071 return 0; 5072 } ··· 6396 spec->num_mux_defs = 1; 6397 spec->input_mux = &spec->private_imux[0]; 6398 6399 - alc_ssid_check(codec, 0x10, 0x15, 0x0f); 6400 6401 return 1; 6402 } ··· 6675 if (!spec->loopback.amplist) 6676 spec->loopback.amplist = alc260_loopbacks; 6677 #endif 6678 - codec->proc_widget_hook = print_realtek_coef; 6679 6680 return 0; 6681 } ··· 6751 .num_items = 3, 6752 .items = { 6753 { "Mic", 0x1 }, 6754 { "Line", 0x2 }, 6755 { "CD", 0x4 }, 6756 }, ··· 6952 { 8, alc882_sixstack_ch8_init }, 6953 }; 6954 6955 /* 6956 * macbook pro ALC885 can switch LineIn to LineOut without losing Mic 6957 */ ··· 7019 { 6, alc885_mb5_ch6_init }, 7020 }; 7021 7022 7023 /* 7024 * 2ch mode ··· 7231 { } /* end */ 7232 }; 7233 7234 static struct snd_kcontrol_new alc885_mbp3_mixer[] = { 7235 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT), 7236 HDA_BIND_MUTE ("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT), ··· 7270 HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x01, HDA_INPUT), 7271 HDA_CODEC_VOLUME("Line Boost", 0x15, 0x00, HDA_INPUT), 7272 HDA_CODEC_VOLUME("Mic Boost", 0x19, 0x00, HDA_INPUT), 7273 { } /* end */ 7274 }; 7275 ··· 7379 7380 static struct hda_verb alc882_base_init_verbs[] = { 7381 /* Front mixer: unmute input/output amp left and right (volume = 0) */ 7382 - {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 7383 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7384 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7385 /* Rear mixer */ 7386 - {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 7387 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7388 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7389 /* CLFE mixer */ 7390 - {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 7391 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7392 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7393 /* Side mixer */ 7394 - {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 7395 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7396 {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 7405 /* Front Pin: output 0 (0x0c) */ 7406 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, ··· 7427 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */ 7428 /* Input mixer2 */ 7429 {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 /* Input mixer3 */ 7434 {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 /* ADC2: mute amp left and right */ 7439 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7440 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00}, ··· 7472 7473 static struct hda_verb alc885_init_verbs[] = { 7474 /* 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)}, 7478 /* 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)}, 7482 /* 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)}, 7486 /* 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)}, 7495 7496 /* Front HP Pin: output 0 (0x0c) */ 7497 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, ··· 7516 7517 /* Mixer elements: 0x18, , 0x1a, 0x1b */ 7518 /* 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 /* Input mixer2 */ 7523 {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 /* 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)}, 7530 /* ADC2: mute amp left and right */ 7531 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7532 /* ADC3: mute amp left and right */ ··· 7661 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, 7662 { } 7663 }; 7664 7665 /* Macbook Pro rev3 */ 7666 static struct hda_verb alc885_mbp3_init_verbs[] = { ··· 7894 spec->autocfg.speaker_pins[1] = 0x1a; 7895 } 7896 7897 static void alc885_mbp3_setup(struct hda_codec *codec) 7898 { 7899 struct alc_spec *spec = codec->spec; ··· 7916 spec->autocfg.speaker_pins[0] = 0x14; 7917 } 7918 7919 - static void alc885_mb5_automute(struct hda_codec *codec) 7920 { 7921 - unsigned int present; 7922 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); 7959 } 7960 7961 static struct hda_verb alc882_targa_verbs[] = { ··· 8057 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 8058 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 8059 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 /* 8073 * Set up output mixers (0x0c - 0x0f) 8074 */ ··· 8081 /* FIXME: use matrix-type input source selection */ 8082 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */ 8083 /* 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))}, 8088 /* 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 - 8094 { } 8095 }; 8096 ··· 9070 [ALC882_ASUS_A7M] = "asus-a7m", 9071 [ALC885_MACPRO] = "macpro", 9072 [ALC885_MB5] = "mb5", 9073 [ALC885_MBP3] = "mbp3", 9074 [ALC885_IMAC24] = "imac24", 9075 [ALC885_IMAC91] = "imac91", ··· 9255 */ 9256 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC885_MB5), 9257 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC885_MB5), 9258 {} /* terminator */ 9259 }; 9260 ··· 9307 .input_mux = &alc882_capture_source, 9308 .dig_out_nid = ALC882_DIGOUT_NID, 9309 }, 9310 [ALC885_MBP3] = { 9311 .mixers = { alc885_mbp3_mixer, alc882_chmode_mixer }, 9312 .init_verbs = { alc885_mbp3_init_verbs, ··· 9346 .input_mux = &mb5_capture_source, 9347 .dig_out_nid = ALC882_DIGOUT_NID, 9348 .dig_in_nid = ALC882_DIGIN_NID, 9349 - .unsol_event = alc885_mb5_unsol_event, 9350 - .init_hook = alc885_mb5_automute, 9351 }, 9352 [ALC885_MACPRO] = { 9353 .mixers = { alc882_macpro_mixer }, ··· 9402 .input_mux = &alc882_capture_source, 9403 .dig_out_nid = ALC882_DIGOUT_NID, 9404 .dig_in_nid = ALC882_DIGIN_NID, 9405 - .unsol_event = alc885_imac91_unsol_event, 9406 - .init_hook = alc885_imac91_automute, 9407 }, 9408 [ALC882_TARGA] = { 9409 .mixers = { alc882_targa_mixer, alc882_chmode_mixer }, ··· 10227 spec->num_mux_defs = 1; 10228 spec->input_mux = &spec->private_imux[0]; 10229 10230 - alc_ssid_check(codec, 0x15, 0x1b, 0x14); 10231 10232 err = alc_auto_add_mic_boost(codec); 10233 if (err < 0) ··· 10365 if (!spec->loopback.amplist) 10366 spec->loopback.amplist = alc882_loopbacks; 10367 #endif 10368 - codec->proc_widget_hook = print_realtek_coef; 10369 10370 return 0; 10371 } ··· 11785 if (err < 0) 11786 return err; 11787 11788 - alc_ssid_check(codec, 0x15, 0x14, 0x1b); 11789 11790 return 1; 11791 } ··· 12228 if (!spec->loopback.amplist) 12229 spec->loopback.amplist = alc262_loopbacks; 12230 #endif 12231 - codec->proc_widget_hook = print_realtek_coef; 12232 12233 return 0; 12234 } ··· 12736 dac = 0x02; 12737 break; 12738 case 0x15: 12739 - case 0x21: 12740 dac = 0x03; 12741 break; 12742 default: ··· 12956 if (err < 0) 12957 return err; 12958 12959 - alc_ssid_check(codec, 0x15, 0x1b, 0x14); 12960 12961 return 1; 12962 } ··· 13293 if (board_config == ALC268_AUTO) 13294 spec->init_hook = alc268_auto_init; 13295 13296 - codec->proc_widget_hook = print_realtek_coef; 13297 - 13298 return 0; 13299 } 13300 ··· 13310 13311 static hda_nid_t alc269_capsrc_nids[1] = { 13312 0x23, 13313 }; 13314 13315 /* NOTE: ADC2 (0x07) is connected from a recording *MIXER* (0x24), ··· 13389 { } 13390 }; 13391 13392 - static struct snd_kcontrol_new alc269_eeepc_mixer[] = { 13393 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT), 13394 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT), 13395 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT), ··· 13397 { } /* end */ 13398 }; 13399 13400 /* capture mixer elements */ 13401 - static struct snd_kcontrol_new alc269_epc_capture_mixer[] = { 13402 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), 13403 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), 13404 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 13405 { } /* end */ 13406 }; 13407 13408 /* FSC amilo */ 13409 - #define alc269_fujitsu_mixer alc269_eeepc_mixer 13410 13411 static struct hda_verb alc269_quanta_fl1_verbs[] = { 13412 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, ··· 13580 alc269_lifebook_mic_autoswitch(codec); 13581 } 13582 13583 - static struct hda_verb alc269_eeepc_dmic_init_verbs[] = { 13584 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, 13585 {0x23, AC_VERB_SET_CONNECT_SEL, 0x05}, 13586 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 }, ··· 13591 {} 13592 }; 13593 13594 - static struct hda_verb alc269_eeepc_amic_init_verbs[] = { 13595 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, 13596 {0x23, AC_VERB_SET_CONNECT_SEL, 0x01}, 13597 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 }, 13598 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, (0x701b | (0x00 << 8))}, 13599 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT}, 13600 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, 13601 {} 13602 }; 13603 ··· 13640 } 13641 13642 /* unsolicited event for HP jack sensing */ 13643 - static void alc269_eeepc_unsol_event(struct hda_codec *codec, 13644 unsigned int res) 13645 { 13646 switch (res >> 26) { ··· 13653 } 13654 } 13655 13656 - static void alc269_eeepc_dmic_setup(struct hda_codec *codec) 13657 { 13658 struct alc_spec *spec = codec->spec; 13659 spec->ext_mic.pin = 0x18; ··· 13663 spec->auto_mic = 1; 13664 } 13665 13666 - static void alc269_eeepc_amic_setup(struct hda_codec *codec) 13667 { 13668 struct alc_spec *spec = codec->spec; 13669 spec->ext_mic.pin = 0x18; ··· 13683 spec->auto_mic = 1; 13684 } 13685 13686 - static void alc269_eeepc_inithook(struct hda_codec *codec) 13687 { 13688 alc269_speaker_automute(codec); 13689 alc_mic_automute(codec); ··· 13696 /* 13697 * Unmute ADC0 and set the default input to mic-in 13698 */ 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)}, 13712 13713 /* 13714 - * Set up output mixers (0x0c - 0x0e) 13715 */ 13716 /* set vol=0 to output mixers */ 13717 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, ··· 13724 13725 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 13726 {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 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 */ 13737 /* Mixer elements: 0x18, 19, 1a, 1b, 1d, 0b */ 13738 /* 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)}, 13743 13744 /* set EAPD */ 13745 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2}, 13746 - {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2}, 13747 { } 13748 }; 13749 ··· 13822 struct alc_spec *spec = codec->spec; 13823 int err; 13824 static hda_nid_t alc269_ignore[] = { 0x1d, 0 }; 13825 13826 err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, 13827 alc269_ignore); ··· 13844 if (spec->kctls.list) 13845 add_mixer(spec, spec->kctls.list); 13846 13847 - add_verb(spec, alc269_init_verbs); 13848 spec->num_mux_defs = 1; 13849 spec->input_mux = &spec->private_imux[0]; 13850 /* set default input source */ 13851 - snd_hda_codec_write_cache(codec, alc269_capsrc_nids[0], 13852 0, AC_VERB_SET_CONNECT_SEL, 13853 spec->input_mux->items[0].index); 13854 ··· 13867 13868 if (!spec->cap_mixer && !spec->no_analog) 13869 set_capture_mixer(codec); 13870 - 13871 - alc_ssid_check(codec, 0x15, 0x1b, 0x14); 13872 13873 return 1; 13874 } ··· 13893 static const char *alc269_models[ALC269_MODEL_LAST] = { 13894 [ALC269_BASIC] = "basic", 13895 [ALC269_QUANTA_FL1] = "quanta", 13896 - [ALC269_ASUS_AMIC] = "asus-amic", 13897 - [ALC269_ASUS_DMIC] = "asus-dmic", 13898 [ALC269_FUJITSU] = "fujitsu", 13899 [ALC269_LIFEBOOK] = "lifebook", 13900 [ALC269_AUTO] = "auto", ··· 13903 static struct snd_pci_quirk alc269_cfg_tbl[] = { 13904 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_QUANTA_FL1), 13905 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), 13935 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS Eeepc P901", 13936 - ALC269_ASUS_DMIC), 13937 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), 13942 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK), 13943 {} 13944 }; 13945 ··· 13981 .setup = alc269_quanta_fl1_setup, 13982 .init_hook = alc269_quanta_fl1_init_hook, 13983 }, 13984 - [ALC269_ASUS_AMIC] = { 13985 - .mixers = { alc269_eeepc_mixer }, 13986 - .cap_mixer = alc269_epc_capture_mixer, 13987 .init_verbs = { alc269_init_verbs, 13988 - alc269_eeepc_amic_init_verbs }, 13989 .num_dacs = ARRAY_SIZE(alc269_dac_nids), 13990 .dac_nids = alc269_dac_nids, 13991 .hp_nid = 0x03, 13992 .num_channel_mode = ARRAY_SIZE(alc269_modes), 13993 .channel_mode = alc269_modes, 13994 - .unsol_event = alc269_eeepc_unsol_event, 13995 - .setup = alc269_eeepc_amic_setup, 13996 - .init_hook = alc269_eeepc_inithook, 13997 }, 13998 - [ALC269_ASUS_DMIC] = { 13999 - .mixers = { alc269_eeepc_mixer }, 14000 - .cap_mixer = alc269_epc_capture_mixer, 14001 .init_verbs = { alc269_init_verbs, 14002 - alc269_eeepc_dmic_init_verbs }, 14003 .num_dacs = ARRAY_SIZE(alc269_dac_nids), 14004 .dac_nids = alc269_dac_nids, 14005 .hp_nid = 0x03, 14006 .num_channel_mode = ARRAY_SIZE(alc269_modes), 14007 .channel_mode = alc269_modes, 14008 - .unsol_event = alc269_eeepc_unsol_event, 14009 - .setup = alc269_eeepc_dmic_setup, 14010 - .init_hook = alc269_eeepc_inithook, 14011 }, 14012 [ALC269_FUJITSU] = { 14013 .mixers = { alc269_fujitsu_mixer }, 14014 - .cap_mixer = alc269_epc_capture_mixer, 14015 .init_verbs = { alc269_init_verbs, 14016 - alc269_eeepc_dmic_init_verbs }, 14017 .num_dacs = ARRAY_SIZE(alc269_dac_nids), 14018 .dac_nids = alc269_dac_nids, 14019 .hp_nid = 0x03, 14020 .num_channel_mode = ARRAY_SIZE(alc269_modes), 14021 .channel_mode = alc269_modes, 14022 - .unsol_event = alc269_eeepc_unsol_event, 14023 - .setup = alc269_eeepc_dmic_setup, 14024 - .init_hook = alc269_eeepc_inithook, 14025 }, 14026 [ALC269_LIFEBOOK] = { 14027 .mixers = { alc269_lifebook_mixer }, ··· 14070 struct alc_spec *spec; 14071 int board_config; 14072 int err; 14073 14074 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 14075 if (spec == NULL) ··· 14087 alc_free(codec); 14088 return -ENOMEM; 14089 } 14090 } 14091 14092 board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST, ··· 14123 if (board_config != ALC269_AUTO) 14124 setup_preset(codec, &alc269_presets[board_config]); 14125 14126 - if (codec->subsystem_id == 0x17aa3bf8) { 14127 /* Due to a hardware problem on Lenovo Ideadpad, we need to 14128 * fix the sample rate of analog I/O to 44.1kHz 14129 */ ··· 14136 spec->stream_digital_playback = &alc269_pcm_digital_playback; 14137 spec->stream_digital_capture = &alc269_pcm_digital_capture; 14138 14139 - spec->adc_nids = alc269_adc_nids; 14140 - spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids); 14141 - spec->capsrc_nids = alc269_capsrc_nids; 14142 if (!spec->cap_mixer) 14143 set_capture_mixer(codec); 14144 set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); ··· 14159 if (!spec->loopback.amplist) 14160 spec->loopback.amplist = alc269_loopbacks; 14161 #endif 14162 - codec->proc_widget_hook = print_realtek_coef; 14163 14164 return 0; 14165 } ··· 15021 spec->num_adc_nids = ARRAY_SIZE(alc861_adc_nids); 15022 set_capture_mixer(codec); 15023 15024 - alc_ssid_check(codec, 0x0e, 0x0f, 0x0b); 15025 15026 return 1; 15027 } ··· 15286 if (!spec->loopback.amplist) 15287 spec->loopback.amplist = alc861_loopbacks; 15288 #endif 15289 - codec->proc_widget_hook = print_realtek_coef; 15290 15291 return 0; 15292 } ··· 15912 static int alc861vd_auto_create_input_ctls(struct hda_codec *codec, 15913 const struct auto_pin_cfg *cfg) 15914 { 15915 - return alc_auto_create_input_ctls(codec, cfg, 0x15, 0x22, 0); 15916 } 15917 15918 ··· 16148 if (err < 0) 16149 return err; 16150 16151 - alc_ssid_check(codec, 0x15, 0x1b, 0x14); 16152 16153 return 1; 16154 } ··· 16265 if (!spec->loopback.amplist) 16266 spec->loopback.amplist = alc861vd_loopbacks; 16267 #endif 16268 - codec->proc_widget_hook = print_realtek_coef; 16269 16270 return 0; 16271 } ··· 16731 /* ADC: mute amp left and right */ 16732 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 16733 {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 16742 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 16743 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, ··· 16780 { } 16781 }; 16782 16783 static struct hda_verb alc662_sue_init_verbs[] = { 16784 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC880_FRONT_EVENT}, 16785 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC880_HP_EVENT}, ··· 16819 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 16820 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, 16821 {} 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 }; 16878 16879 static struct hda_verb alc663_m51va_init_verbs[] = { ··· 17571 SND_PCI_QUIRK(0x1028, 0x02f4, "DELL ZM1", ALC272_DELL_ZM1), 17572 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC663_ASUS_MODE1), 17573 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC663_ASUS_MODE3), 17574 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC663_ASUS_MODE3), 17575 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC663_ASUS_MODE1), 17576 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_ASUS_MODE2), ··· 17607 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC663_ASUS_MODE3), 17608 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC663_ASUS_MODE3), 17609 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC663_ASUS_MODE1), 17610 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC663_ASUS_MODE1), 17611 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC663_ASUS_MODE1), 17612 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC663_ASUS_MODE1), ··· 17635 SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10), 17636 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L", 17637 ALC662_3ST_6ch_DIG), 17638 SND_PCI_QUIRK(0x1565, 0x820f, "Biostar TA780G M2+", ALC662_3ST_6ch_DIG), 17639 SND_PCI_QUIRK(0x1631, 0xc10c, "PB RS65", ALC663_ASUS_M51VA), 17640 SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo", ALC662_LENOVO_101E), ··· 18254 spec->num_mux_defs = 1; 18255 spec->input_mux = &spec->private_imux[0]; 18256 18257 - add_verb(spec, alc662_auto_init_verbs); 18258 - if (codec->vendor_id == 0x10ec0663) 18259 - add_verb(spec, alc663_auto_init_verbs); 18260 18261 err = alc_auto_add_mic_boost(codec); 18262 if (err < 0) 18263 return err; 18264 18265 - alc_ssid_check(codec, 0x15, 0x1b, 0x14); 18266 18267 return 1; 18268 } ··· 18356 18357 if (!spec->cap_mixer) 18358 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 18364 spec->vmaster_nid = 0x02; 18365 18366 codec->patch_ops = alc_patch_ops; ··· 18379 if (!spec->loopback.amplist) 18380 spec->loopback.amplist = alc662_loopbacks; 18381 #endif 18382 - codec->proc_widget_hook = print_realtek_coef; 18383 18384 return 0; 18385 } ··· 18419 { .id = 0x10ec0662, .rev = 0x100101, .name = "ALC662 rev1", 18420 .patch = patch_alc662 }, 18421 { .id = 0x10ec0663, .name = "ALC663", .patch = patch_alc662 }, 18422 { .id = 0x10ec0880, .name = "ALC880", .patch = patch_alc880 }, 18423 { .id = 0x10ec0882, .name = "ALC882", .patch = patch_alc882 }, 18424 { .id = 0x10ec0883, .name = "ALC883", .patch = patch_alc882 },
··· 131 enum { 132 ALC269_BASIC, 133 ALC269_QUANTA_FL1, 134 + ALC269_AMIC, 135 + ALC269_DMIC, 136 + ALC269VB_AMIC, 137 + ALC269VB_DMIC, 138 ALC269_FUJITSU, 139 ALC269_LIFEBOOK, 140 ALC269_AUTO, ··· 207 ALC882_ASUS_A7J, 208 ALC882_ASUS_A7M, 209 ALC885_MACPRO, 210 + ALC885_MBA21, 211 ALC885_MBP3, 212 ALC885_MB5, 213 + ALC885_MACMINI3, 214 ALC885_IMAC24, 215 ALC885_IMAC91, 216 ALC883_3ST_2ch_DIG, ··· 841 spec->init_verbs[spec->num_init_verbs++] = verb; 842 } 843 844 /* 845 * set up from the preset table 846 */ ··· 1166 case 0x10ec0888: 1167 alc888_coef_init(codec); 1168 break; 1169 + #if 0 /* XXX: This may cause the silent output on speaker on some machines */ 1170 case 0x10ec0267: 1171 case 0x10ec0268: 1172 snd_hda_codec_write(codec, 0x20, 0, ··· 1178 AC_VERB_SET_PROC_COEF, 1179 tmp | 0x3000); 1180 break; 1181 + #endif /* XXX */ 1182 } 1183 break; 1184 } ··· 1269 */ 1270 static int alc_subsystem_id(struct hda_codec *codec, 1271 hda_nid_t porta, hda_nid_t porte, 1272 + hda_nid_t portd, hda_nid_t porti) 1273 { 1274 unsigned int ass, tmp, i; 1275 unsigned nid; ··· 1295 snd_printd("realtek: No valid SSID, " 1296 "checking pincfg 0x%08x for NID 0x%x\n", 1297 ass, nid); 1298 + if (!(ass & 1)) 1299 return 0; 1300 if ((ass >> 30) != 1) /* no physical connection */ 1301 return 0; ··· 1355 nid = porte; 1356 else if (tmp == 2) 1357 nid = portd; 1358 + else if (tmp == 3) 1359 + nid = porti; 1360 else 1361 return 1; 1362 for (i = 0; i < spec->autocfg.line_outs; i++) ··· 1369 } 1370 1371 static void alc_ssid_check(struct hda_codec *codec, 1372 + hda_nid_t porta, hda_nid_t porte, 1373 + hda_nid_t portd, hda_nid_t porti) 1374 { 1375 + if (!alc_subsystem_id(codec, porta, porte, portd, porti)) { 1376 struct alc_spec *spec = codec->spec; 1377 snd_printd("realtek: " 1378 "Enable default setup for auto mode as fallback\n"); ··· 3729 /* We currently only handle front, HP */ 3730 switch (codec->vendor_id) { 3731 case 0x10ec0260: 3732 + set_eapd(codec, 0x0f, 0); 3733 + set_eapd(codec, 0x10, 0); 3734 break; 3735 case 0x10ec0262: 3736 case 0x10ec0267: 3737 case 0x10ec0268: 3738 case 0x10ec0269: 3739 + case 0x10ec0270: 3740 case 0x10ec0272: 3741 case 0x10ec0660: 3742 case 0x10ec0662: 3743 case 0x10ec0663: 3744 case 0x10ec0862: 3745 case 0x10ec0889: 3746 + set_eapd(codec, 0x14, 0); 3747 + set_eapd(codec, 0x15, 0); 3748 break; 3749 } 3750 } ··· 4877 spec->num_mux_defs = 1; 4878 spec->input_mux = &spec->private_imux[0]; 4879 4880 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 4881 4882 return 1; 4883 } ··· 5081 if (!spec->loopback.amplist) 5082 spec->loopback.amplist = alc880_loopbacks; 5083 #endif 5084 5085 return 0; 5086 } ··· 6412 spec->num_mux_defs = 1; 6413 spec->input_mux = &spec->private_imux[0]; 6414 6415 + alc_ssid_check(codec, 0x10, 0x15, 0x0f, 0); 6416 6417 return 1; 6418 } ··· 6691 if (!spec->loopback.amplist) 6692 spec->loopback.amplist = alc260_loopbacks; 6693 #endif 6694 6695 return 0; 6696 } ··· 6768 .num_items = 3, 6769 .items = { 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 = { 6779 { "Line", 0x2 }, 6780 { "CD", 0x4 }, 6781 }, ··· 6961 { 8, alc882_sixstack_ch8_init }, 6962 }; 6963 6964 + 6965 + /* Macbook Air 2,1 */ 6966 + 6967 + static struct hda_channel_mode alc885_mba21_ch_modes[1] = { 6968 + { 2, NULL }, 6969 + }; 6970 + 6971 /* 6972 * macbook pro ALC885 can switch LineIn to LineOut without losing Mic 6973 */ ··· 7021 { 6, alc885_mb5_ch6_init }, 7022 }; 7023 7024 + #define alc885_macmini3_6ch_modes alc885_mb5_6ch_modes 7025 7026 /* 7027 * 2ch mode ··· 7232 { } /* end */ 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 + 7244 static struct snd_kcontrol_new alc885_mbp3_mixer[] = { 7245 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT), 7246 HDA_BIND_MUTE ("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT), ··· 7262 HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x01, HDA_INPUT), 7263 HDA_CODEC_VOLUME("Line Boost", 0x15, 0x00, HDA_INPUT), 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), 7280 { } /* end */ 7281 }; 7282 ··· 7356 7357 static struct hda_verb alc882_base_init_verbs[] = { 7358 /* Front mixer: unmute input/output amp left and right (volume = 0) */ 7359 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7360 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7361 /* Rear mixer */ 7362 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7363 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7364 /* CLFE mixer */ 7365 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7366 {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7367 /* Side mixer */ 7368 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7369 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 7370 7371 /* Front Pin: output 0 (0x0c) */ 7372 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, ··· 7415 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */ 7416 /* Input mixer2 */ 7417 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7418 /* Input mixer3 */ 7419 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7420 /* ADC2: mute amp left and right */ 7421 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7422 {0x08, AC_VERB_SET_CONNECT_SEL, 0x00}, ··· 7466 7467 static struct hda_verb alc885_init_verbs[] = { 7468 /* Front mixer: unmute input/output amp left and right (volume = 0) */ 7469 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7470 + {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 7471 /* Rear mixer */ 7472 + {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7473 + {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 7474 /* CLFE mixer */ 7475 + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7476 + {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 7477 /* Side mixer */ 7478 + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7479 + {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 7480 7481 /* Front HP Pin: output 0 (0x0c) */ 7482 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, ··· 7519 7520 /* Mixer elements: 0x18, , 0x1a, 0x1b */ 7521 /* Input mixer1 */ 7522 + {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7523 /* Input mixer2 */ 7524 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7525 /* Input mixer3 */ 7526 + {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7527 /* ADC2: mute amp left and right */ 7528 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 7529 /* ADC3: mute amp left and right */ ··· 7670 {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, 7671 { } 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 + 7743 7744 /* Macbook Pro rev3 */ 7745 static struct hda_verb alc885_mbp3_init_verbs[] = { ··· 7833 spec->autocfg.speaker_pins[1] = 0x1a; 7834 } 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 + 7850 static void alc885_mbp3_setup(struct hda_codec *codec) 7851 { 7852 struct alc_spec *spec = codec->spec; ··· 7841 spec->autocfg.speaker_pins[0] = 0x14; 7842 } 7843 7844 + static void alc885_imac91_setup(struct hda_codec *codec) 7845 { 7846 + struct alc_spec *spec = codec->spec; 7847 7848 + spec->autocfg.hp_pins[0] = 0x14; 7849 + spec->autocfg.speaker_pins[0] = 0x15; 7850 + spec->autocfg.speaker_pins[1] = 0x1a; 7851 } 7852 7853 static struct hda_verb alc882_targa_verbs[] = { ··· 8015 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 8016 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 8017 8018 /* 8019 * Set up output mixers (0x0c - 0x0f) 8020 */ ··· 8051 /* FIXME: use matrix-type input source selection */ 8052 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */ 8053 /* Input mixer2 */ 8054 + {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 8055 /* Input mixer3 */ 8056 + {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 8057 { } 8058 }; 8059 ··· 9047 [ALC882_ASUS_A7M] = "asus-a7m", 9048 [ALC885_MACPRO] = "macpro", 9049 [ALC885_MB5] = "mb5", 9050 + [ALC885_MACMINI3] = "macmini3", 9051 + [ALC885_MBA21] = "mba21", 9052 [ALC885_MBP3] = "mbp3", 9053 [ALC885_IMAC24] = "imac24", 9054 [ALC885_IMAC91] = "imac91", ··· 9230 */ 9231 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC885_MB5), 9232 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC885_MB5), 9233 + SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC885_MACMINI3), 9234 {} /* terminator */ 9235 }; 9236 ··· 9281 .input_mux = &alc882_capture_source, 9282 .dig_out_nid = ALC882_DIGOUT_NID, 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 + }, 9296 [ALC885_MBP3] = { 9297 .mixers = { alc885_mbp3_mixer, alc882_chmode_mixer }, 9298 .init_verbs = { alc885_mbp3_init_verbs, ··· 9308 .input_mux = &mb5_capture_source, 9309 .dig_out_nid = ALC882_DIGOUT_NID, 9310 .dig_in_nid = ALC882_DIGIN_NID, 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, 9329 }, 9330 [ALC885_MACPRO] = { 9331 .mixers = { alc882_macpro_mixer }, ··· 9348 .input_mux = &alc882_capture_source, 9349 .dig_out_nid = ALC882_DIGOUT_NID, 9350 .dig_in_nid = ALC882_DIGIN_NID, 9351 + .unsol_event = alc_automute_amp_unsol_event, 9352 + .setup = alc885_imac91_setup, 9353 + .init_hook = alc_automute_amp, 9354 }, 9355 [ALC882_TARGA] = { 9356 .mixers = { alc882_targa_mixer, alc882_chmode_mixer }, ··· 10172 spec->num_mux_defs = 1; 10173 spec->input_mux = &spec->private_imux[0]; 10174 10175 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 10176 10177 err = alc_auto_add_mic_boost(codec); 10178 if (err < 0) ··· 10310 if (!spec->loopback.amplist) 10311 spec->loopback.amplist = alc882_loopbacks; 10312 #endif 10313 10314 return 0; 10315 } ··· 11731 if (err < 0) 11732 return err; 11733 11734 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 11735 11736 return 1; 11737 } ··· 12174 if (!spec->loopback.amplist) 12175 spec->loopback.amplist = alc262_loopbacks; 12176 #endif 12177 12178 return 0; 12179 } ··· 12683 dac = 0x02; 12684 break; 12685 case 0x15: 12686 dac = 0x03; 12687 break; 12688 default: ··· 12904 if (err < 0) 12905 return err; 12906 12907 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 12908 12909 return 1; 12910 } ··· 13241 if (board_config == ALC268_AUTO) 13242 spec->init_hook = alc268_auto_init; 13243 13244 return 0; 13245 } 13246 ··· 13260 13261 static hda_nid_t alc269_capsrc_nids[1] = { 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, 13272 }; 13273 13274 /* NOTE: ADC2 (0x07) is connected from a recording *MIXER* (0x24), ··· 13330 { } 13331 }; 13332 13333 + static struct snd_kcontrol_new alc269_laptop_mixer[] = { 13334 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT), 13335 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT), 13336 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT), ··· 13338 { } /* end */ 13339 }; 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 + 13349 /* capture mixer elements */ 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[] = { 13359 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), 13360 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), 13361 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 13362 { } /* end */ 13363 }; 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 + 13380 /* FSC amilo */ 13381 + #define alc269_fujitsu_mixer alc269_laptop_mixer 13382 13383 static struct hda_verb alc269_quanta_fl1_verbs[] = { 13384 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, ··· 13490 alc269_lifebook_mic_autoswitch(codec); 13491 } 13492 13493 + static struct hda_verb alc269_laptop_dmic_init_verbs[] = { 13494 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, 13495 {0x23, AC_VERB_SET_CONNECT_SEL, 0x05}, 13496 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 }, ··· 13501 {} 13502 }; 13503 13504 + static struct hda_verb alc269_laptop_amic_init_verbs[] = { 13505 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, 13506 {0x23, AC_VERB_SET_CONNECT_SEL, 0x01}, 13507 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, 0xb026 }, 13508 {0x08, AC_VERB_SET_AMP_GAIN_MUTE, (0x701b | (0x00 << 8))}, 13509 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT}, 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}, 13533 {} 13534 }; 13535 ··· 13528 } 13529 13530 /* unsolicited event for HP jack sensing */ 13531 + static void alc269_laptop_unsol_event(struct hda_codec *codec, 13532 unsigned int res) 13533 { 13534 switch (res >> 26) { ··· 13541 } 13542 } 13543 13544 + static void alc269_laptop_dmic_setup(struct hda_codec *codec) 13545 { 13546 struct alc_spec *spec = codec->spec; 13547 spec->ext_mic.pin = 0x18; ··· 13551 spec->auto_mic = 1; 13552 } 13553 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) 13565 { 13566 struct alc_spec *spec = codec->spec; 13567 spec->ext_mic.pin = 0x18; ··· 13561 spec->auto_mic = 1; 13562 } 13563 13564 + static void alc269_laptop_inithook(struct hda_codec *codec) 13565 { 13566 alc269_speaker_automute(codec); 13567 alc_mic_automute(codec); ··· 13574 /* 13575 * Unmute ADC0 and set the default input to mic-in 13576 */ 13577 + {0x08, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 13578 13579 /* 13580 + * Set up output mixers (0x02 - 0x03) 13581 */ 13582 /* set vol=0 to output mixers */ 13583 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, ··· 13614 13615 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 13616 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 13617 13618 + /* FIXME: use Mux-type input source selection */ 13619 /* Mixer elements: 0x18, 19, 1a, 1b, 1d, 0b */ 13620 /* Input mixer1: unmute Mic, F-Mic, Line, CD inputs */ 13621 + {0x23, AC_VERB_SET_CONNECT_SEL, 0x00}, 13622 13623 /* set EAPD */ 13624 {0x14, 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}, 13668 { } 13669 }; 13670 ··· 13681 struct alc_spec *spec = codec->spec; 13682 int err; 13683 static hda_nid_t alc269_ignore[] = { 0x1d, 0 }; 13684 + hda_nid_t real_capsrc_nids; 13685 13686 err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, 13687 alc269_ignore); ··· 13702 if (spec->kctls.list) 13703 add_mixer(spec, spec->kctls.list); 13704 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 + 13715 spec->num_mux_defs = 1; 13716 spec->input_mux = &spec->private_imux[0]; 13717 /* set default input source */ 13718 + snd_hda_codec_write_cache(codec, real_capsrc_nids, 13719 0, AC_VERB_SET_CONNECT_SEL, 13720 spec->input_mux->items[0].index); 13721 ··· 13716 13717 if (!spec->cap_mixer && !spec->no_analog) 13718 set_capture_mixer(codec); 13719 13720 return 1; 13721 } ··· 13744 static const char *alc269_models[ALC269_MODEL_LAST] = { 13745 [ALC269_BASIC] = "basic", 13746 [ALC269_QUANTA_FL1] = "quanta", 13747 + [ALC269_AMIC] = "laptop-amic", 13748 + [ALC269_DMIC] = "laptop-dmic", 13749 [ALC269_FUJITSU] = "fujitsu", 13750 [ALC269_LIFEBOOK] = "lifebook", 13751 [ALC269_AUTO] = "auto", ··· 13754 static struct snd_pci_quirk alc269_cfg_tbl[] = { 13755 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_QUANTA_FL1), 13756 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A", 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), 13794 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS Eeepc P901", 13795 + ALC269_DMIC), 13796 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS Eeepc S101", 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), 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), 13808 {} 13809 }; 13810 ··· 13818 .setup = alc269_quanta_fl1_setup, 13819 .init_hook = alc269_quanta_fl1_init_hook, 13820 }, 13821 + [ALC269_AMIC] = { 13822 + .mixers = { alc269_laptop_mixer }, 13823 + .cap_mixer = alc269_laptop_analog_capture_mixer, 13824 .init_verbs = { alc269_init_verbs, 13825 + alc269_laptop_amic_init_verbs }, 13826 .num_dacs = ARRAY_SIZE(alc269_dac_nids), 13827 .dac_nids = alc269_dac_nids, 13828 .hp_nid = 0x03, 13829 .num_channel_mode = ARRAY_SIZE(alc269_modes), 13830 .channel_mode = alc269_modes, 13831 + .unsol_event = alc269_laptop_unsol_event, 13832 + .setup = alc269_laptop_amic_setup, 13833 + .init_hook = alc269_laptop_inithook, 13834 }, 13835 + [ALC269_DMIC] = { 13836 + .mixers = { alc269_laptop_mixer }, 13837 + .cap_mixer = alc269_laptop_digital_capture_mixer, 13838 .init_verbs = { alc269_init_verbs, 13839 + alc269_laptop_dmic_init_verbs }, 13840 .num_dacs = ARRAY_SIZE(alc269_dac_nids), 13841 .dac_nids = alc269_dac_nids, 13842 .hp_nid = 0x03, 13843 .num_channel_mode = ARRAY_SIZE(alc269_modes), 13844 .channel_mode = alc269_modes, 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, 13876 }, 13877 [ALC269_FUJITSU] = { 13878 .mixers = { alc269_fujitsu_mixer }, 13879 + .cap_mixer = alc269_laptop_digital_capture_mixer, 13880 .init_verbs = { alc269_init_verbs, 13881 + alc269_laptop_dmic_init_verbs }, 13882 .num_dacs = ARRAY_SIZE(alc269_dac_nids), 13883 .dac_nids = alc269_dac_nids, 13884 .hp_nid = 0x03, 13885 .num_channel_mode = ARRAY_SIZE(alc269_modes), 13886 .channel_mode = alc269_modes, 13887 + .unsol_event = alc269_laptop_unsol_event, 13888 + .setup = alc269_laptop_dmic_setup, 13889 + .init_hook = alc269_laptop_inithook, 13890 }, 13891 [ALC269_LIFEBOOK] = { 13892 .mixers = { alc269_lifebook_mixer }, ··· 13879 struct alc_spec *spec; 13880 int board_config; 13881 int err; 13882 + int is_alc269vb = 0; 13883 13884 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 13885 if (spec == NULL) ··· 13895 alc_free(codec); 13896 return -ENOMEM; 13897 } 13898 + is_alc269vb = 1; 13899 } 13900 13901 board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST, ··· 13930 if (board_config != ALC269_AUTO) 13931 setup_preset(codec, &alc269_presets[board_config]); 13932 13933 + if (board_config == ALC269_QUANTA_FL1) { 13934 /* Due to a hardware problem on Lenovo Ideadpad, we need to 13935 * fix the sample rate of analog I/O to 44.1kHz 13936 */ ··· 13943 spec->stream_digital_playback = &alc269_pcm_digital_playback; 13944 spec->stream_digital_capture = &alc269_pcm_digital_capture; 13945 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 + 13956 if (!spec->cap_mixer) 13957 set_capture_mixer(codec); 13958 set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); ··· 13959 if (!spec->loopback.amplist) 13960 spec->loopback.amplist = alc269_loopbacks; 13961 #endif 13962 13963 return 0; 13964 } ··· 14822 spec->num_adc_nids = ARRAY_SIZE(alc861_adc_nids); 14823 set_capture_mixer(codec); 14824 14825 + alc_ssid_check(codec, 0x0e, 0x0f, 0x0b, 0); 14826 14827 return 1; 14828 } ··· 15087 if (!spec->loopback.amplist) 15088 spec->loopback.amplist = alc861_loopbacks; 15089 #endif 15090 15091 return 0; 15092 } ··· 15714 static int alc861vd_auto_create_input_ctls(struct hda_codec *codec, 15715 const struct auto_pin_cfg *cfg) 15716 { 15717 + return alc_auto_create_input_ctls(codec, cfg, 0x15, 0x09, 0); 15718 } 15719 15720 ··· 15950 if (err < 0) 15951 return err; 15952 15953 + alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 15954 15955 return 1; 15956 } ··· 16067 if (!spec->loopback.amplist) 16068 spec->loopback.amplist = alc861vd_loopbacks; 16069 #endif 16070 16071 return 0; 16072 } ··· 16534 /* ADC: mute amp left and right */ 16535 {0x09, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, 16536 {0x09, AC_VERB_SET_CONNECT_SEL, 0x00}, 16537 16538 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 16539 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, ··· 16590 { } 16591 }; 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 + 16615 static struct hda_verb alc662_sue_init_verbs[] = { 16616 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC880_FRONT_EVENT}, 16617 {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|ALC880_HP_EVENT}, ··· 16607 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 16608 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, 16609 {} 16610 }; 16611 16612 static struct hda_verb alc663_m51va_init_verbs[] = { ··· 17414 SND_PCI_QUIRK(0x1028, 0x02f4, "DELL ZM1", ALC272_DELL_ZM1), 17415 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC663_ASUS_MODE1), 17416 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC663_ASUS_MODE3), 17417 + SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC663_ASUS_MODE1), 17418 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC663_ASUS_MODE3), 17419 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC663_ASUS_MODE1), 17420 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_ASUS_MODE2), ··· 17449 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC663_ASUS_MODE3), 17450 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC663_ASUS_MODE3), 17451 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC663_ASUS_MODE1), 17452 + SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC663_ASUS_MODE1), 17453 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC663_ASUS_MODE1), 17454 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC663_ASUS_MODE1), 17455 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC663_ASUS_MODE1), ··· 17476 SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10), 17477 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L", 17478 ALC662_3ST_6ch_DIG), 17479 + SND_PCI_QUIRK(0x152d, 0x2304, "Quanta WH1", ALC663_ASUS_H13), 17480 SND_PCI_QUIRK(0x1565, 0x820f, "Biostar TA780G M2+", ALC662_3ST_6ch_DIG), 17481 SND_PCI_QUIRK(0x1631, 0xc10c, "PB RS65", ALC663_ASUS_M51VA), 17482 SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo", ALC662_LENOVO_101E), ··· 18094 spec->num_mux_defs = 1; 18095 spec->input_mux = &spec->private_imux[0]; 18096 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); 18104 18105 err = alc_auto_add_mic_boost(codec); 18106 if (err < 0) 18107 return err; 18108 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); 18114 18115 return 1; 18116 } ··· 18188 18189 if (!spec->cap_mixer) 18190 set_capture_mixer(codec); 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 + } 18205 spec->vmaster_nid = 0x02; 18206 18207 codec->patch_ops = alc_patch_ops; ··· 18202 if (!spec->loopback.amplist) 18203 spec->loopback.amplist = alc662_loopbacks; 18204 #endif 18205 18206 return 0; 18207 } ··· 18243 { .id = 0x10ec0662, .rev = 0x100101, .name = "ALC662 rev1", 18244 .patch = patch_alc662 }, 18245 { .id = 0x10ec0663, .name = "ALC663", .patch = patch_alc662 }, 18246 + { .id = 0x10ec0665, .name = "ALC665", .patch = patch_alc662 }, 18247 + { .id = 0x10ec0670, .name = "ALC670", .patch = patch_alc662 }, 18248 { .id = 0x10ec0880, .name = "ALC880", .patch = patch_alc880 }, 18249 { .id = 0x10ec0882, .name = "ALC882", .patch = patch_alc882 }, 18250 { .id = 0x10ec0883, .name = "ALC883", .patch = patch_alc882 },
+83 -68
sound/pci/hda/patch_sigmatel.c
··· 568 0x0f, 0x10, 0x11, 0x1f, 0x20, 569 }; 570 571 #define STAC92HD71BXX_NUM_PINS 13 572 static hda_nid_t stac92hd71bxx_pin_nids_4port[STAC92HD71BXX_NUM_PINS] = { 573 0x0a, 0x0b, 0x0c, 0x0d, 0x00, ··· 2878 2879 conn_len = snd_hda_get_connections(codec, nid, conn, 2880 HDA_MAX_CONNECTIONS); 2881 for (j = 0; j < conn_len; j++) { 2882 wcaps = get_wcaps(codec, conn[j]); 2883 wtype = get_wcaps_type(wcaps); ··· 4363 if (enable_pin_detect(codec, nid, STAC_PWR_EVENT)) 4364 stac_issue_unsol_event(codec, nid); 4365 } 4366 if (spec->dac_list) 4367 stac92xx_power_down(codec); 4368 return 0; ··· 4760 static void set_hp_led_gpio(struct hda_codec *codec) 4761 { 4762 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 - } 4776 } 4777 4778 /* ··· 4790 * Need more information on whether it is true across the entire series. 4791 * -- kunal 4792 */ 4793 - static int find_mute_led_gpio(struct hda_codec *codec) 4794 { 4795 struct sigmatel_spec *spec = codec->spec; 4796 const struct dmi_device *dev = NULL; ··· 4817 */ 4818 if (!hp_blike_system(codec->subsystem_id)) { 4819 set_hp_led_gpio(codec); 4820 - spec->gpio_led_polarity = 1; 4821 return 1; 4822 } 4823 } ··· 4915 stac_issue_unsol_event(codec, 4916 spec->autocfg.line_out_pins[0]); 4917 } 4918 return 0; 4919 } 4920 ··· 4939 hda_nid_t nid) 4940 { 4941 struct sigmatel_spec *spec = codec->spec; 4942 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; 4953 } 4954 4955 - stac_gpio_set(codec, spec->gpio_mask, 4956 - spec->gpio_dir, 4957 - spec->gpio_data); 4958 } 4959 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 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data); 4975 - 4976 return 0; 4977 } 4978 - 4979 #endif 4980 4981 static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state) ··· 5283 hda_nid_t conn[STAC92HD83_DAC_COUNT + 1]; 5284 int err; 5285 int num_dacs; 5286 - hda_nid_t nid; 5287 5288 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 5289 if (spec == NULL) ··· 5321 stac92hd83xxx_brd_tbl[spec->board_config]); 5322 5323 switch (codec->vendor_id) { 5324 case 0x111d7604: 5325 case 0x111d7605: 5326 case 0x111d76d5: 5327 if (spec->board_config == STAC_92HD83XXX_PWR_REF) ··· 5343 5344 codec->patch_ops = stac92xx_patch_ops; 5345 5346 - if (spec->board_config == STAC_92HD83XXX_HP) 5347 - spec->gpio_led = 0x01; 5348 5349 #ifdef CONFIG_SND_HDA_POWER_SAVE 5350 if (spec->gpio_led) { ··· 5355 spec->gpio_data |= spec->gpio_led; 5356 /* register check_power_status callback. */ 5357 codec->patch_ops.check_power_status = 5358 - idt92hd83xxx_hp_check_power_status; 5359 } 5360 #endif 5361 ··· 5375 return err; 5376 } 5377 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, 5388 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, 5395 AC_VERB_SET_CONNECT_SEL, num_dacs); 5396 5397 codec->proc_widget_hook = stac92hd_proc_hook; 5398 ··· 5670 */ 5671 spec->num_smuxes = 1; 5672 spec->num_dmuxes = 1; 5673 - spec->gpio_led = 0x01; 5674 /* fallthrough */ 5675 case STAC_HP_DV5: 5676 snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010); ··· 5684 spec->num_dmics = 1; 5685 spec->num_dmuxes = 1; 5686 spec->num_smuxes = 1; 5687 - /* orange/white mute led on GPIO3, orange=0, white=1 */ 5688 - spec->gpio_led = 0x08; 5689 break; 5690 } 5691 ··· 5705 } 5706 } 5707 5708 - if (find_mute_led_gpio(codec)) 5709 snd_printd("mute LED gpio %d polarity %d\n", 5710 spec->gpio_led, 5711 spec->gpio_led_polarity); ··· 6246 { .id = 0x838476a7, .name = "STAC9254D", .patch = patch_stac9205 }, 6247 { .id = 0x111d7603, .name = "92HD75B3X5", .patch = patch_stac92hd71bxx}, 6248 { .id = 0x111d7604, .name = "92HD83C1X5", .patch = patch_stac92hd83xxx}, 6249 { .id = 0x111d7605, .name = "92HD81B1X5", .patch = patch_stac92hd83xxx}, 6250 { .id = 0x111d76d5, .name = "92HD81B1C5", .patch = patch_stac92hd83xxx}, 6251 { .id = 0x111d7608, .name = "92HD75B2X5", .patch = patch_stac92hd71bxx}, 6252 { .id = 0x111d7674, .name = "92HD73D1X5", .patch = patch_stac92hd73xx }, 6253 { .id = 0x111d7675, .name = "92HD73C1X5", .patch = patch_stac92hd73xx },
··· 568 0x0f, 0x10, 0x11, 0x1f, 0x20, 569 }; 570 571 + static hda_nid_t stac92hd88xxx_pin_nids[10] = { 572 + 0x0a, 0x0b, 0x0c, 0x0d, 573 + 0x0f, 0x11, 0x1f, 0x20, 574 + }; 575 + 576 #define STAC92HD71BXX_NUM_PINS 13 577 static hda_nid_t stac92hd71bxx_pin_nids_4port[STAC92HD71BXX_NUM_PINS] = { 578 0x0a, 0x0b, 0x0c, 0x0d, 0x00, ··· 2873 2874 conn_len = snd_hda_get_connections(codec, nid, conn, 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 + } 2883 for (j = 0; j < conn_len; j++) { 2884 wcaps = get_wcaps(codec, conn[j]); 2885 wtype = get_wcaps_type(wcaps); ··· 4351 if (enable_pin_detect(codec, nid, STAC_PWR_EVENT)) 4352 stac_issue_unsol_event(codec, nid); 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 4360 if (spec->dac_list) 4361 stac92xx_power_down(codec); 4362 return 0; ··· 4742 static void set_hp_led_gpio(struct hda_codec *codec) 4743 { 4744 struct sigmatel_spec *spec = codec->spec; 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 */ 4753 } 4754 4755 /* ··· 4777 * Need more information on whether it is true across the entire series. 4778 * -- kunal 4779 */ 4780 + static int find_mute_led_gpio(struct hda_codec *codec, int default_polarity) 4781 { 4782 struct sigmatel_spec *spec = codec->spec; 4783 const struct dmi_device *dev = NULL; ··· 4804 */ 4805 if (!hp_blike_system(codec->subsystem_id)) { 4806 set_hp_led_gpio(codec); 4807 + spec->gpio_led_polarity = default_polarity; 4808 return 1; 4809 } 4810 } ··· 4902 stac_issue_unsol_event(codec, 4903 spec->autocfg.line_out_pins[0]); 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 4910 return 0; 4911 } 4912 ··· 4921 hda_nid_t nid) 4922 { 4923 struct sigmatel_spec *spec = codec->spec; 4924 + int i, muted = 1; 4925 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; 4932 } 4933 + } 4934 + if (muted) 4935 + spec->gpio_data &= ~spec->gpio_led; /* orange */ 4936 + else 4937 + spec->gpio_data |= spec->gpio_led; /* white */ 4938 4939 + if (!spec->gpio_led_polarity) { 4940 + /* LED state is inverted on these systems */ 4941 + spec->gpio_data ^= spec->gpio_led; 4942 } 4943 4944 stac_gpio_set(codec, spec->gpio_mask, spec->gpio_dir, spec->gpio_data); 4945 return 0; 4946 } 4947 #endif 4948 4949 static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state) ··· 5279 hda_nid_t conn[STAC92HD83_DAC_COUNT + 1]; 5280 int err; 5281 int num_dacs; 5282 5283 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 5284 if (spec == NULL) ··· 5318 stac92hd83xxx_brd_tbl[spec->board_config]); 5319 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; 5331 case 0x111d7604: 5332 + case 0x111d76d4: 5333 case 0x111d7605: 5334 case 0x111d76d5: 5335 if (spec->board_config == STAC_92HD83XXX_PWR_REF) ··· 5329 5330 codec->patch_ops = stac92xx_patch_ops; 5331 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); 5336 5337 #ifdef CONFIG_SND_HDA_POWER_SAVE 5338 if (spec->gpio_led) { ··· 5339 spec->gpio_data |= spec->gpio_led; 5340 /* register check_power_status callback. */ 5341 codec->patch_ops.check_power_status = 5342 + stac92xx_hp_check_power_status; 5343 } 5344 #endif 5345 ··· 5359 return err; 5360 } 5361 5362 + /* docking output support */ 5363 + num_dacs = snd_hda_get_connections(codec, 0xF, 5364 conn, STAC92HD83_DAC_COUNT + 1) - 1; 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, 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 + } 5377 5378 codec->proc_widget_hook = stac92hd_proc_hook; 5379 ··· 5657 */ 5658 spec->num_smuxes = 1; 5659 spec->num_dmuxes = 1; 5660 /* fallthrough */ 5661 case STAC_HP_DV5: 5662 snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010); ··· 5672 spec->num_dmics = 1; 5673 spec->num_dmuxes = 1; 5674 spec->num_smuxes = 1; 5675 break; 5676 } 5677 ··· 5695 } 5696 } 5697 5698 + if (find_mute_led_gpio(codec, 1)) 5699 snd_printd("mute LED gpio %d polarity %d\n", 5700 spec->gpio_led, 5701 spec->gpio_led_polarity); ··· 6236 { .id = 0x838476a7, .name = "STAC9254D", .patch = patch_stac9205 }, 6237 { .id = 0x111d7603, .name = "92HD75B3X5", .patch = patch_stac92hd71bxx}, 6238 { .id = 0x111d7604, .name = "92HD83C1X5", .patch = patch_stac92hd83xxx}, 6239 + { .id = 0x111d76d4, .name = "92HD83C1C5", .patch = patch_stac92hd83xxx}, 6240 { .id = 0x111d7605, .name = "92HD81B1X5", .patch = patch_stac92hd83xxx}, 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}, 6246 { .id = 0x111d7608, .name = "92HD75B2X5", .patch = patch_stac92hd71bxx}, 6247 { .id = 0x111d7674, .name = "92HD73D1X5", .patch = patch_stac92hd73xx }, 6248 { .id = 0x111d7675, .name = "92HD73C1X5", .patch = patch_stac92hd73xx },