diff options
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 55 |
1 files changed, 41 insertions, 14 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 01a6643fc7d4..d64dcb9a4c99 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -2830,6 +2830,7 @@ static int find_ext_mic_pin(struct hda_codec *codec); | |||
2830 | 2830 | ||
2831 | static void alc286_shutup(struct hda_codec *codec) | 2831 | static void alc286_shutup(struct hda_codec *codec) |
2832 | { | 2832 | { |
2833 | const struct hda_pincfg *pin; | ||
2833 | int i; | 2834 | int i; |
2834 | int mic_pin = find_ext_mic_pin(codec); | 2835 | int mic_pin = find_ext_mic_pin(codec); |
2835 | /* don't shut up pins when unloading the driver; otherwise it breaks | 2836 | /* don't shut up pins when unloading the driver; otherwise it breaks |
@@ -2837,8 +2838,7 @@ static void alc286_shutup(struct hda_codec *codec) | |||
2837 | */ | 2838 | */ |
2838 | if (codec->bus->shutdown) | 2839 | if (codec->bus->shutdown) |
2839 | return; | 2840 | return; |
2840 | for (i = 0; i < codec->init_pins.used; i++) { | 2841 | snd_array_for_each(&codec->init_pins, i, pin) { |
2841 | struct hda_pincfg *pin = snd_array_elem(&codec->init_pins, i); | ||
2842 | /* use read here for syncing after issuing each verb */ | 2842 | /* use read here for syncing after issuing each verb */ |
2843 | if (pin->nid != mic_pin) | 2843 | if (pin->nid != mic_pin) |
2844 | snd_hda_codec_read(codec, pin->nid, 0, | 2844 | snd_hda_codec_read(codec, pin->nid, 0, |
@@ -3653,30 +3653,37 @@ static void alc269_fixup_hp_mute_led(struct hda_codec *codec, | |||
3653 | } | 3653 | } |
3654 | } | 3654 | } |
3655 | 3655 | ||
3656 | static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, | 3656 | static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec, |
3657 | const struct hda_fixup *fix, int action) | 3657 | const struct hda_fixup *fix, |
3658 | int action, hda_nid_t pin) | ||
3658 | { | 3659 | { |
3659 | struct alc_spec *spec = codec->spec; | 3660 | struct alc_spec *spec = codec->spec; |
3661 | |||
3660 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | 3662 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
3661 | spec->mute_led_polarity = 0; | 3663 | spec->mute_led_polarity = 0; |
3662 | spec->mute_led_nid = 0x18; | 3664 | spec->mute_led_nid = pin; |
3663 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; | 3665 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; |
3664 | spec->gen.vmaster_mute_enum = 1; | 3666 | spec->gen.vmaster_mute_enum = 1; |
3665 | codec->power_filter = led_power_filter; | 3667 | codec->power_filter = led_power_filter; |
3666 | } | 3668 | } |
3667 | } | 3669 | } |
3668 | 3670 | ||
3671 | static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec, | ||
3672 | const struct hda_fixup *fix, int action) | ||
3673 | { | ||
3674 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18); | ||
3675 | } | ||
3676 | |||
3669 | static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, | 3677 | static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, |
3670 | const struct hda_fixup *fix, int action) | 3678 | const struct hda_fixup *fix, int action) |
3671 | { | 3679 | { |
3672 | struct alc_spec *spec = codec->spec; | 3680 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19); |
3673 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | 3681 | } |
3674 | spec->mute_led_polarity = 0; | 3682 | |
3675 | spec->mute_led_nid = 0x19; | 3683 | static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec, |
3676 | spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; | 3684 | const struct hda_fixup *fix, int action) |
3677 | spec->gen.vmaster_mute_enum = 1; | 3685 | { |
3678 | codec->power_filter = led_power_filter; | 3686 | alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b); |
3679 | } | ||
3680 | } | 3687 | } |
3681 | 3688 | ||
3682 | /* update LED status via GPIO */ | 3689 | /* update LED status via GPIO */ |
@@ -5387,6 +5394,9 @@ static void alc274_fixup_bind_dacs(struct hda_codec *codec, | |||
5387 | /* for dell wmi mic mute led */ | 5394 | /* for dell wmi mic mute led */ |
5388 | #include "dell_wmi_helper.c" | 5395 | #include "dell_wmi_helper.c" |
5389 | 5396 | ||
5397 | /* for alc295_fixup_hp_top_speakers */ | ||
5398 | #include "hp_x360_helper.c" | ||
5399 | |||
5390 | enum { | 5400 | enum { |
5391 | ALC269_FIXUP_SONY_VAIO, | 5401 | ALC269_FIXUP_SONY_VAIO, |
5392 | ALC275_FIXUP_SONY_VAIO_GPIO2, | 5402 | ALC275_FIXUP_SONY_VAIO_GPIO2, |
@@ -5413,6 +5423,7 @@ enum { | |||
5413 | ALC269_FIXUP_HP_MUTE_LED, | 5423 | ALC269_FIXUP_HP_MUTE_LED, |
5414 | ALC269_FIXUP_HP_MUTE_LED_MIC1, | 5424 | ALC269_FIXUP_HP_MUTE_LED_MIC1, |
5415 | ALC269_FIXUP_HP_MUTE_LED_MIC2, | 5425 | ALC269_FIXUP_HP_MUTE_LED_MIC2, |
5426 | ALC269_FIXUP_HP_MUTE_LED_MIC3, | ||
5416 | ALC269_FIXUP_HP_GPIO_LED, | 5427 | ALC269_FIXUP_HP_GPIO_LED, |
5417 | ALC269_FIXUP_HP_GPIO_MIC1_LED, | 5428 | ALC269_FIXUP_HP_GPIO_MIC1_LED, |
5418 | ALC269_FIXUP_HP_LINE1_MIC1_LED, | 5429 | ALC269_FIXUP_HP_LINE1_MIC1_LED, |
@@ -5506,6 +5517,7 @@ enum { | |||
5506 | ALC298_FIXUP_TPT470_DOCK, | 5517 | ALC298_FIXUP_TPT470_DOCK, |
5507 | ALC255_FIXUP_DUMMY_LINEOUT_VERB, | 5518 | ALC255_FIXUP_DUMMY_LINEOUT_VERB, |
5508 | ALC255_FIXUP_DELL_HEADSET_MIC, | 5519 | ALC255_FIXUP_DELL_HEADSET_MIC, |
5520 | ALC295_FIXUP_HP_X360, | ||
5509 | }; | 5521 | }; |
5510 | 5522 | ||
5511 | static const struct hda_fixup alc269_fixups[] = { | 5523 | static const struct hda_fixup alc269_fixups[] = { |
@@ -5672,6 +5684,10 @@ static const struct hda_fixup alc269_fixups[] = { | |||
5672 | .type = HDA_FIXUP_FUNC, | 5684 | .type = HDA_FIXUP_FUNC, |
5673 | .v.func = alc269_fixup_hp_mute_led_mic2, | 5685 | .v.func = alc269_fixup_hp_mute_led_mic2, |
5674 | }, | 5686 | }, |
5687 | [ALC269_FIXUP_HP_MUTE_LED_MIC3] = { | ||
5688 | .type = HDA_FIXUP_FUNC, | ||
5689 | .v.func = alc269_fixup_hp_mute_led_mic3, | ||
5690 | }, | ||
5675 | [ALC269_FIXUP_HP_GPIO_LED] = { | 5691 | [ALC269_FIXUP_HP_GPIO_LED] = { |
5676 | .type = HDA_FIXUP_FUNC, | 5692 | .type = HDA_FIXUP_FUNC, |
5677 | .v.func = alc269_fixup_hp_gpio_led, | 5693 | .v.func = alc269_fixup_hp_gpio_led, |
@@ -6375,6 +6391,12 @@ static const struct hda_fixup alc269_fixups[] = { | |||
6375 | .chained = true, | 6391 | .chained = true, |
6376 | .chain_id = ALC269_FIXUP_HEADSET_MIC | 6392 | .chain_id = ALC269_FIXUP_HEADSET_MIC |
6377 | }, | 6393 | }, |
6394 | [ALC295_FIXUP_HP_X360] = { | ||
6395 | .type = HDA_FIXUP_FUNC, | ||
6396 | .v.func = alc295_fixup_hp_top_speakers, | ||
6397 | .chained = true, | ||
6398 | .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3 | ||
6399 | } | ||
6378 | }; | 6400 | }; |
6379 | 6401 | ||
6380 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { | 6402 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
@@ -6494,6 +6516,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
6494 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | 6516 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
6495 | SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), | 6517 | SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), |
6496 | SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), | 6518 | SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), |
6519 | SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), | ||
6497 | SND_PCI_QUIRK(0x103c, 0x82bf, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE), | 6520 | SND_PCI_QUIRK(0x103c, 0x82bf, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
6498 | SND_PCI_QUIRK(0x103c, 0x82c0, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE), | 6521 | SND_PCI_QUIRK(0x103c, 0x82c0, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
6499 | SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), | 6522 | SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
@@ -6580,7 +6603,6 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
6580 | SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), | 6603 | SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
6581 | SND_PCI_QUIRK(0x17aa, 0x3138, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), | 6604 | SND_PCI_QUIRK(0x17aa, 0x3138, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
6582 | SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), | 6605 | SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION), |
6583 | SND_PCI_QUIRK(0x17aa, 0x3112, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), | ||
6584 | SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), | 6606 | SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
6585 | SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), | 6607 | SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), |
6586 | SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP), | 6608 | SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP), |
@@ -6752,6 +6774,11 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { | |||
6752 | {0x1b, 0x01111010}, | 6774 | {0x1b, 0x01111010}, |
6753 | {0x1e, 0x01451130}, | 6775 | {0x1e, 0x01451130}, |
6754 | {0x21, 0x02211020}), | 6776 | {0x21, 0x02211020}), |
6777 | SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, | ||
6778 | {0x12, 0x90a60140}, | ||
6779 | {0x14, 0x90170110}, | ||
6780 | {0x19, 0x02a11030}, | ||
6781 | {0x21, 0x02211020}), | ||
6755 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, | 6782 | SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
6756 | {0x12, 0x90a60140}, | 6783 | {0x12, 0x90a60140}, |
6757 | {0x14, 0x90170110}, | 6784 | {0x14, 0x90170110}, |