Commit 0202e99c authored by Kailang Yang's avatar Kailang Yang Committed by Takashi Iwai

ALSA: hda/realtek - Independent of model for HP

Create single model for HP.
The headset jack module was difference between other chrome book.
It need to manual control Mic jack detect.

Chrome OS loaded driver by models. Remove old assigned fixup table from
ALC269 fixup list entry.
Signed-off-by: default avatarKailang Yang <kailang@realtek.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent d59915d0
...@@ -3602,11 +3602,6 @@ static void alc283_hp_automute_hook(struct hda_codec *codec, ...@@ -3602,11 +3602,6 @@ static void alc283_hp_automute_hook(struct hda_codec *codec,
vref); vref);
} }
static void alc283_chromebook_caps(struct hda_codec *codec)
{
snd_hda_override_wcaps(codec, 0x03, 0);
}
static void alc283_fixup_chromebook(struct hda_codec *codec, static void alc283_fixup_chromebook(struct hda_codec *codec,
const struct hda_fixup *fix, int action) const struct hda_fixup *fix, int action)
{ {
...@@ -3615,19 +3610,34 @@ static void alc283_fixup_chromebook(struct hda_codec *codec, ...@@ -3615,19 +3610,34 @@ static void alc283_fixup_chromebook(struct hda_codec *codec,
switch (action) { switch (action) {
case HDA_FIXUP_ACT_PRE_PROBE: case HDA_FIXUP_ACT_PRE_PROBE:
alc283_chromebook_caps(codec); snd_hda_override_wcaps(codec, 0x03, 0);
/* Disable AA-loopback as it causes white noise */ /* Disable AA-loopback as it causes white noise */
spec->gen.mixer_nid = 0; spec->gen.mixer_nid = 0;
spec->gen.hp_automute_hook = alc283_hp_automute_hook; spec->gen.hp_automute_hook = alc283_hp_automute_hook;
break; break;
case HDA_FIXUP_ACT_INIT:
/* Enable Line1 input control by verb */
val = alc_read_coef_idx(codec, 0x1a);
alc_write_coef_idx(codec, 0x1a, val | (1 << 4));
break;
}
}
static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
struct alc_spec *spec = codec->spec;
int val;
switch (action) {
case HDA_FIXUP_ACT_PRE_PROBE:
spec->gen.hp_automute_hook = alc283_hp_automute_hook;
break;
case HDA_FIXUP_ACT_INIT: case HDA_FIXUP_ACT_INIT:
/* MIC2-VREF control */ /* MIC2-VREF control */
/* Set to manual mode */ /* Set to manual mode */
val = alc_read_coef_idx(codec, 0x06); val = alc_read_coef_idx(codec, 0x06);
alc_write_coef_idx(codec, 0x06, val & ~0x000c); alc_write_coef_idx(codec, 0x06, val & ~0x000c);
/* Enable Line1 input control by verb */
val = alc_read_coef_idx(codec, 0x1a);
alc_write_coef_idx(codec, 0x1a, val | (1 << 4));
break; break;
} }
} }
...@@ -3823,6 +3833,7 @@ enum { ...@@ -3823,6 +3833,7 @@ enum {
ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
ALC269VB_FIXUP_ORDISSIMO_EVE2, ALC269VB_FIXUP_ORDISSIMO_EVE2,
ALC283_FIXUP_CHROME_BOOK, ALC283_FIXUP_CHROME_BOOK,
ALC283_FIXUP_SENSE_COMBO_JACK,
ALC282_FIXUP_ASUS_TX300, ALC282_FIXUP_ASUS_TX300,
ALC283_FIXUP_INT_MIC, ALC283_FIXUP_INT_MIC,
ALC290_FIXUP_MONO_SPEAKERS, ALC290_FIXUP_MONO_SPEAKERS,
...@@ -4122,6 +4133,12 @@ static const struct hda_fixup alc269_fixups[] = { ...@@ -4122,6 +4133,12 @@ static const struct hda_fixup alc269_fixups[] = {
.type = HDA_FIXUP_FUNC, .type = HDA_FIXUP_FUNC,
.v.func = alc283_fixup_chromebook, .v.func = alc283_fixup_chromebook,
}, },
[ALC283_FIXUP_SENSE_COMBO_JACK] = {
.type = HDA_FIXUP_FUNC,
.v.func = alc283_fixup_sense_combo_jack,
.chained = true,
.chain_id = ALC283_FIXUP_CHROME_BOOK,
},
[ALC282_FIXUP_ASUS_TX300] = { [ALC282_FIXUP_ASUS_TX300] = {
.type = HDA_FIXUP_FUNC, .type = HDA_FIXUP_FUNC,
.v.func = alc282_fixup_asus_tx300, .v.func = alc282_fixup_asus_tx300,
...@@ -4213,7 +4230,6 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { ...@@ -4213,7 +4230,6 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1),
SND_PCI_QUIRK(0x103c, 0x1983, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), SND_PCI_QUIRK(0x103c, 0x1983, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1),
SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
SND_PCI_QUIRK(0x103c, 0x21ed, "HP Falco Chromebook", ALC283_FIXUP_CHROME_BOOK),
SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
...@@ -4321,6 +4337,8 @@ static const struct hda_model_fixup alc269_fixup_models[] = { ...@@ -4321,6 +4337,8 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
{.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
{.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
{.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"}, {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
{.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-chrome"},
{.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
{} {}
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment