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

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda - Fix silent outputs from docking-station jacks of Dell laptops
ALSA: HDA: Use model=auto for Thinkpad T510
ALSA: hda - Fix buffer-alignment regression with Nvidia HDMI
ALSA: hda - Fix a unused variable warning
snd-hda-intel: better Alienware M17x R3 quirk
ALSA: hda/realtek - Remove use_jack_tbl field
ALSA: hda/realtek - Avoid conflict of unsol-events with static quirks
ALSA: hda/realtek - Avoid multi-ios conflicting with multi-speakers

+63 -34
+12 -5
sound/pci/hda/alc880_quirks.c
··· 762 762 /* Looks like the unsol event is incompatible with the standard 763 763 * definition. 4bit tag is placed at 28 bit! 764 764 */ 765 - switch (res >> 28) { 765 + res >>= 28; 766 + switch (res) { 766 767 case ALC_MIC_EVENT: 767 768 alc88x_simple_mic_automute(codec); 768 769 break; 769 770 default: 770 - alc_sku_unsol_event(codec, res); 771 + alc_exec_unsol_event(codec, res); 771 772 break; 772 773 } 774 + } 775 + 776 + static void alc880_unsol_event(struct hda_codec *codec, unsigned int res) 777 + { 778 + alc_exec_unsol_event(codec, res >> 28); 773 779 } 774 780 775 781 static void alc880_uniwill_p53_setup(struct hda_codec *codec) ··· 806 800 /* Looks like the unsol event is incompatible with the standard 807 801 * definition. 4bit tag is placed at 28 bit! 808 802 */ 809 - if ((res >> 28) == ALC_DCVOL_EVENT) 803 + res >>= 28; 804 + if (res == ALC_DCVOL_EVENT) 810 805 alc880_uniwill_p53_dcvol_automute(codec); 811 806 else 812 - alc_sku_unsol_event(codec, res); 807 + alc_exec_unsol_event(codec, res); 813 808 } 814 809 815 810 /* ··· 1684 1677 .channel_mode = alc880_lg_ch_modes, 1685 1678 .need_dac_fix = 1, 1686 1679 .input_mux = &alc880_lg_capture_source, 1687 - .unsol_event = alc_sku_unsol_event, 1680 + .unsol_event = alc880_unsol_event, 1688 1681 .setup = alc880_lg_setup, 1689 1682 .init_hook = alc_hp_automute, 1690 1683 #ifdef CONFIG_SND_HDA_POWER_SAVE
+10 -5
sound/pci/hda/alc882_quirks.c
··· 730 730 alc889A_mb31_automute(codec); 731 731 } 732 732 733 + static void alc882_unsol_event(struct hda_codec *codec, unsigned int res) 734 + { 735 + alc_exec_unsol_event(codec, res >> 26); 736 + } 737 + 733 738 /* 734 739 * configuration and preset 735 740 */ ··· 780 775 .channel_mode = alc885_mba21_ch_modes, 781 776 .num_channel_mode = ARRAY_SIZE(alc885_mba21_ch_modes), 782 777 .input_mux = &alc882_capture_source, 783 - .unsol_event = alc_sku_unsol_event, 778 + .unsol_event = alc882_unsol_event, 784 779 .setup = alc885_mba21_setup, 785 780 .init_hook = alc_hp_automute, 786 781 }, ··· 796 791 .input_mux = &alc882_capture_source, 797 792 .dig_out_nid = ALC882_DIGOUT_NID, 798 793 .dig_in_nid = ALC882_DIGIN_NID, 799 - .unsol_event = alc_sku_unsol_event, 794 + .unsol_event = alc882_unsol_event, 800 795 .setup = alc885_mbp3_setup, 801 796 .init_hook = alc_hp_automute, 802 797 }, ··· 811 806 .input_mux = &mb5_capture_source, 812 807 .dig_out_nid = ALC882_DIGOUT_NID, 813 808 .dig_in_nid = ALC882_DIGIN_NID, 814 - .unsol_event = alc_sku_unsol_event, 809 + .unsol_event = alc882_unsol_event, 815 810 .setup = alc885_mb5_setup, 816 811 .init_hook = alc_hp_automute, 817 812 }, ··· 826 821 .input_mux = &macmini3_capture_source, 827 822 .dig_out_nid = ALC882_DIGOUT_NID, 828 823 .dig_in_nid = ALC882_DIGIN_NID, 829 - .unsol_event = alc_sku_unsol_event, 824 + .unsol_event = alc882_unsol_event, 830 825 .setup = alc885_macmini3_setup, 831 826 .init_hook = alc_hp_automute, 832 827 }, ··· 841 836 .input_mux = &alc889A_imac91_capture_source, 842 837 .dig_out_nid = ALC882_DIGOUT_NID, 843 838 .dig_in_nid = ALC882_DIGIN_NID, 844 - .unsol_event = alc_sku_unsol_event, 839 + .unsol_event = alc882_unsol_event, 845 840 .setup = alc885_imac91_setup, 846 841 .init_hook = alc_hp_automute, 847 842 },
+4 -2
sound/pci/hda/hda_intel.c
··· 469 469 unsigned int irq_pending_warned :1; 470 470 unsigned int probing :1; /* codec probing phase */ 471 471 unsigned int snoop:1; 472 + unsigned int align_buffer_size:1; 472 473 473 474 /* for debugging */ 474 475 unsigned int last_cmd[AZX_MAX_CODECS]; ··· 1691 1690 runtime->hw.rates = hinfo->rates; 1692 1691 snd_pcm_limit_hw_rates(runtime); 1693 1692 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); 1694 - if (align_buffer_size) 1693 + if (chip->align_buffer_size) 1695 1694 /* constrain buffer sizes to be multiple of 128 1696 1695 bytes. This is more efficient in terms of memory 1697 1696 access but isn't required by the HDA spec and ··· 2774 2773 } 2775 2774 2776 2775 /* disable buffer size rounding to 128-byte multiples if supported */ 2776 + chip->align_buffer_size = align_buffer_size; 2777 2777 if (chip->driver_caps & AZX_DCAPS_BUFSIZE) 2778 - align_buffer_size = 0; 2778 + chip->align_buffer_size = 0; 2779 2779 2780 2780 /* allow 64bit DMA address if supported by H/W */ 2781 2781 if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64)))
+1 -1
sound/pci/hda/patch_conexant.c
··· 3027 3027 SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD), 3028 3028 SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD), 3029 3029 SND_PCI_QUIRK(0x17aa, 0x21c6, "Thinkpad Edge 13", CXT5066_ASUS), 3030 - SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD), 3030 + SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo T510", CXT5066_AUTO), 3031 3031 SND_PCI_QUIRK(0x17aa, 0x21cf, "Lenovo T520 & W520", CXT5066_AUTO), 3032 3032 SND_PCI_QUIRK(0x17aa, 0x21da, "Lenovo X220", CXT5066_THINKPAD), 3033 3033 SND_PCI_QUIRK(0x17aa, 0x21db, "Lenovo X220-tablet", CXT5066_THINKPAD),
+30 -17
sound/pci/hda/patch_realtek.c
··· 185 185 unsigned int vol_in_capsrc:1; /* use capsrc volume (ADC has no vol) */ 186 186 unsigned int parse_flags; /* passed to snd_hda_parse_pin_defcfg() */ 187 187 unsigned int shared_mic_hp:1; /* HP/Mic-in sharing */ 188 - unsigned int use_jack_tbl:1; /* 1 for model=auto */ 189 188 190 189 /* auto-mute control */ 191 190 int automute_mode; ··· 620 621 alc_mux_select(codec, 0, spec->int_mic_idx, false); 621 622 } 622 623 623 - /* unsolicited event for HP jack sensing */ 624 - static void alc_sku_unsol_event(struct hda_codec *codec, unsigned int res) 624 + /* handle the specified unsol action (ALC_XXX_EVENT) */ 625 + static void alc_exec_unsol_event(struct hda_codec *codec, int action) 625 626 { 626 - struct alc_spec *spec = codec->spec; 627 - if (codec->vendor_id == 0x10ec0880) 628 - res >>= 28; 629 - else 630 - res >>= 26; 631 - if (spec->use_jack_tbl) 632 - res = snd_hda_jack_get_action(codec, res); 633 - switch (res) { 627 + switch (action) { 634 628 case ALC_HP_EVENT: 635 629 alc_hp_automute(codec); 636 630 break; ··· 635 643 break; 636 644 } 637 645 snd_hda_jack_report_sync(codec); 646 + } 647 + 648 + /* unsolicited event for HP jack sensing */ 649 + static void alc_sku_unsol_event(struct hda_codec *codec, unsigned int res) 650 + { 651 + if (codec->vendor_id == 0x10ec0880) 652 + res >>= 28; 653 + else 654 + res >>= 26; 655 + res = snd_hda_jack_get_action(codec, res); 656 + alc_exec_unsol_event(codec, res); 638 657 } 639 658 640 659 /* call init functions of standard auto-mute helpers */ ··· 1886 1883 }; 1887 1884 #endif 1888 1885 1889 - static int alc_build_controls(struct hda_codec *codec) 1886 + static int __alc_build_controls(struct hda_codec *codec) 1890 1887 { 1891 1888 struct alc_spec *spec = codec->spec; 1892 1889 struct snd_kcontrol *kctl = NULL; ··· 2032 2029 2033 2030 alc_free_kctls(codec); /* no longer needed */ 2034 2031 2035 - err = snd_hda_jack_add_kctls(codec, &spec->autocfg); 2032 + return 0; 2033 + } 2034 + 2035 + static int alc_build_controls(struct hda_codec *codec) 2036 + { 2037 + struct alc_spec *spec = codec->spec; 2038 + int err = __alc_build_controls(codec); 2036 2039 if (err < 0) 2037 2040 return err; 2038 - 2039 - return 0; 2041 + return snd_hda_jack_add_kctls(codec, &spec->autocfg); 2040 2042 } 2041 2043 2042 2044 ··· 3241 3233 int i, err, noutputs; 3242 3234 3243 3235 noutputs = cfg->line_outs; 3244 - if (spec->multi_ios > 0) 3236 + if (spec->multi_ios > 0 && cfg->line_outs < 3) 3245 3237 noutputs += spec->multi_ios; 3246 3238 3247 3239 for (i = 0; i < noutputs; i++) { ··· 3912 3904 static void alc_auto_init_std(struct hda_codec *codec) 3913 3905 { 3914 3906 struct alc_spec *spec = codec->spec; 3915 - spec->use_jack_tbl = 1; 3916 3907 alc_auto_init_multi_out(codec); 3917 3908 alc_auto_init_extra_out(codec); 3918 3909 alc_auto_init_analog_input(codec); ··· 4175 4168 codec->patch_ops = alc_patch_ops; 4176 4169 if (board_config == ALC_MODEL_AUTO) 4177 4170 spec->init_hook = alc_auto_init_std; 4171 + else 4172 + codec->patch_ops.build_controls = __alc_build_controls; 4178 4173 #ifdef CONFIG_SND_HDA_POWER_SAVE 4179 4174 if (!spec->loopback.amplist) 4180 4175 spec->loopback.amplist = alc880_loopbacks; ··· 4306 4297 codec->patch_ops = alc_patch_ops; 4307 4298 if (board_config == ALC_MODEL_AUTO) 4308 4299 spec->init_hook = alc_auto_init_std; 4300 + else 4301 + codec->patch_ops.build_controls = __alc_build_controls; 4309 4302 spec->shutup = alc_eapd_shutup; 4310 4303 #ifdef CONFIG_SND_HDA_POWER_SAVE 4311 4304 if (!spec->loopback.amplist) ··· 4702 4691 codec->patch_ops = alc_patch_ops; 4703 4692 if (board_config == ALC_MODEL_AUTO) 4704 4693 spec->init_hook = alc_auto_init_std; 4694 + else 4695 + codec->patch_ops.build_controls = __alc_build_controls; 4705 4696 4706 4697 #ifdef CONFIG_SND_HDA_POWER_SAVE 4707 4698 if (!spec->loopback.amplist)
+6 -4
sound/pci/hda/patch_sigmatel.c
··· 1608 1608 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x043a, 1609 1609 "Alienware M17x", STAC_ALIENWARE_M17X), 1610 1610 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0490, 1611 - "Alienware M17x", STAC_ALIENWARE_M17X), 1611 + "Alienware M17x R3", STAC_DELL_EQ), 1612 1612 {} /* terminator */ 1613 1613 }; 1614 1614 ··· 4163 4163 return 1; 4164 4164 } 4165 4165 4166 - static int is_nid_hp_pin(struct auto_pin_cfg *cfg, hda_nid_t nid) 4166 + static int is_nid_out_jack_pin(struct auto_pin_cfg *cfg, hda_nid_t nid) 4167 4167 { 4168 4168 int i; 4169 4169 for (i = 0; i < cfg->hp_outs; i++) 4170 4170 if (cfg->hp_pins[i] == nid) 4171 4171 return 1; /* nid is a HP-Out */ 4172 - 4172 + for (i = 0; i < cfg->line_outs; i++) 4173 + if (cfg->line_out_pins[i] == nid) 4174 + return 1; /* nid is a line-Out */ 4173 4175 return 0; /* nid is not a HP-Out */ 4174 4176 }; 4175 4177 ··· 4377 4375 continue; 4378 4376 } 4379 4377 4380 - if (is_nid_hp_pin(cfg, nid)) 4378 + if (is_nid_out_jack_pin(cfg, nid)) 4381 4379 continue; /* already has an unsol event */ 4382 4380 4383 4381 pinctl = snd_hda_codec_read(codec, nid, 0,