Skip to content

Commit 947c401

Browse files
bo liutiwai
authored andcommitted
ALSA: hda/conexant: fix Z60MR100 startup pop issue
When Z60MR100 startup, speaker will output a pop. To fix this issue, we mute codec by init verbs in bios when system startup, and set GPIO to low to unmute codec in codec driver when it loaded . [ white space fixes and compile warning fix by tiwai ] Signed-off-by: bo liu <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent edad3f9 commit 947c401

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

sound/pci/hda/patch_conexant.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ enum {
307307
CXT_FIXUP_HP_MIC_NO_PRESENCE,
308308
CXT_PINCFG_SWS_JS201D,
309309
CXT_PINCFG_TOP_SPEAKER,
310+
CXT_FIXUP_HP_A_U,
310311
};
311312

312313
/* for hda_fixup_thinkpad_acpi() */
@@ -774,6 +775,18 @@ static void cxt_setup_mute_led(struct hda_codec *codec,
774775
}
775776
}
776777

778+
static void cxt_setup_gpio_unmute(struct hda_codec *codec,
779+
unsigned int gpio_mute_mask)
780+
{
781+
if (gpio_mute_mask) {
782+
// set gpio data to 0.
783+
snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 0);
784+
snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_MASK, gpio_mute_mask);
785+
snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DIRECTION, gpio_mute_mask);
786+
snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_STICKY_MASK, 0);
787+
}
788+
}
789+
777790
static void cxt_fixup_mute_led_gpio(struct hda_codec *codec,
778791
const struct hda_fixup *fix, int action)
779792
{
@@ -788,6 +801,15 @@ static void cxt_fixup_hp_zbook_mute_led(struct hda_codec *codec,
788801
cxt_setup_mute_led(codec, 0x10, 0x20);
789802
}
790803

804+
static void cxt_fixup_hp_a_u(struct hda_codec *codec,
805+
const struct hda_fixup *fix, int action)
806+
{
807+
// Init vers in BIOS mute the spk/hp by set gpio high to avoid pop noise,
808+
// so need to unmute once by clearing the gpio data when runs into the system.
809+
if (action == HDA_FIXUP_ACT_INIT)
810+
cxt_setup_gpio_unmute(codec, 0x2);
811+
}
812+
791813
/* ThinkPad X200 & co with cxt5051 */
792814
static const struct hda_pintbl cxt_pincfg_lenovo_x200[] = {
793815
{ 0x16, 0x042140ff }, /* HP (seq# overridden) */
@@ -998,6 +1020,10 @@ static const struct hda_fixup cxt_fixups[] = {
9981020
{ }
9991021
},
10001022
},
1023+
[CXT_FIXUP_HP_A_U] = {
1024+
.type = HDA_FIXUP_FUNC,
1025+
.v.func = cxt_fixup_hp_a_u,
1026+
},
10011027
};
10021028

10031029
static const struct hda_quirk cxt5045_fixups[] = {
@@ -1072,6 +1098,7 @@ static const struct hda_quirk cxt5066_fixups[] = {
10721098
SND_PCI_QUIRK(0x103c, 0x8457, "HP Z2 G4 mini", CXT_FIXUP_HP_MIC_NO_PRESENCE),
10731099
SND_PCI_QUIRK(0x103c, 0x8458, "HP Z2 G4 mini premium", CXT_FIXUP_HP_MIC_NO_PRESENCE),
10741100
SND_PCI_QUIRK(0x1043, 0x138d, "Asus", CXT_FIXUP_HEADPHONE_MIC_PIN),
1101+
SND_PCI_QUIRK(0x14f1, 0x0252, "MBX-Z60MR100", CXT_FIXUP_HP_A_U),
10751102
SND_PCI_QUIRK(0x14f1, 0x0265, "SWS JS201D", CXT_PINCFG_SWS_JS201D),
10761103
SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT_FIXUP_OLPC_XO),
10771104
SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410),
@@ -1117,6 +1144,7 @@ static const struct hda_model_fixup cxt5066_fixup_models[] = {
11171144
{ .id = CXT_PINCFG_LENOVO_NOTEBOOK, .name = "lenovo-20149" },
11181145
{ .id = CXT_PINCFG_SWS_JS201D, .name = "sws-js201d" },
11191146
{ .id = CXT_PINCFG_TOP_SPEAKER, .name = "sirius-top-speaker" },
1147+
{ .id = CXT_FIXUP_HP_A_U, .name = "HP-U-support" },
11201148
{}
11211149
};
11221150

0 commit comments

Comments
 (0)