ALSA: hda/realtek: merge alc295_fixup_chromebook to alc_fixup_headset_jack
Jaroslav Kysela
maintainerPATCH 1/1 ALSA: hda/realtek: merge alc295_fixup_chromebook to alc_fixup_headset_jack
The ALC295_FIXUP_CHROME_BOOK fixup can be merged to alc_fixup_headset_jack unless some other model will reference ALC225_FIXUP_HEADSET_JACK in an incompatible way.
Cc Kailang Yang <[email protected]>
Signed-off-by Jaroslav Kysela <[email protected]>
--- sound/pci/hda/patch_realtek.c | 39 ++++++++++------------------------- 1 file changed, 11 insertions(+), 28 deletions(-)
sound/pci/hda/patch_realtek.c +11 -28
@@ -5501,6 +5501,16 @@ static void alc_fixup_headset_jack(struct hda_codec *codec, alc_headset_btn_callback);snd_hda_jack_add_kctl (codec,0x55 ,"Headset Jack" , false,SND_JACK_HEADSET , alc_headset_btn_keymap); +switch (codec->core.vendor_id) { +case 0x10ec0295 : +alc_update_coef_idx (codec,0x4a ,0x8000 ,1 <<15 );/* Reset HP JD */ +alc_update_coef_idx (codec,0x4a ,0x8000 ,0 <<15 ); +break ; +case 0x10ec0236 : +alc_update_coef_idx (codec,0x1b ,0x8000 ,1 <<15 );/* Reset HP JD */ +alc_update_coef_idx (codec,0x1b ,0x8000 ,0 <<15 ); +break ; + }break ;case HDA_FIXUP_ACT_INIT :switch (codec->core.vendor_id) {
@@ -5521,26 +5531,6 @@ static void alc_fixup_headset_jack(struct hda_codec *codec, } } -static void alc295_fixup_chromebook (struct hda_codec *codec, -const struct hda_fixup *fix,int action) -{ - -switch (action) { -case HDA_FIXUP_ACT_PRE_PROBE : -switch (codec->core.vendor_id) { -case 0x10ec0295 : -alc_update_coef_idx (codec,0x4a ,0x8000 ,1 <<15 );/* Reset HP JD */ -alc_update_coef_idx (codec,0x4a ,0x8000 ,0 <<15 ); -break ; -case 0x10ec0236 : -alc_update_coef_idx (codec,0x1b ,0x8000 ,1 <<15 );/* Reset HP JD */ -alc_update_coef_idx (codec,0x1b ,0x8000 ,0 <<15 ); -break ; - } -break ; - } -} -static void alc_fixup_disable_mic_vref (struct hda_codec *codec,const struct hda_fixup *fix,int action) {
@@ -5694,7 +5684,6 @@ enum {ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE ,ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE , ALC255_FIXUP_ACER_HEADSET_MIC, - ALC295_FIXUP_CHROME_BOOK, }; static const struct hda_fixup alc269_fixups[] = {
@@ -6671,12 +6660,6 @@ static const struct hda_fixup alc269_fixups[] = { .chained = true, .chain_id =ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC }, - [ALC295_FIXUP_CHROME_BOOK] = { - .type = HDA_FIXUP_FUNC, - .v.func = alc295_fixup_chromebook, - .chained = true, - .chain_id =ALC225_FIXUP_HEADSET_JACK - }, };static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -7089,7 +7072,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = { {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, - {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-sense-combo"}, + {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-sense-combo"}, {} };#define ALC225_STANDARD_PINS \
Signature · 1 line
2.20.1
Quoted 4 lines · Jaroslav Kysela
The
ALC295_FIXUP_CHROME_BOOKfixup can be merged toalc_fixup_headset_jackunless some other model will referenceALC225_FIXUP_HEADSET_JACKin an incompatible way.
I'd rather keep ALC295_FIXUP_CHROME_BOOK since it's more obvious.
thanks,
Takashi
Quoted 88 lines
Cc Kailang Yang <[email protected]>Signed-off-by Jaroslav Kysela <[email protected]>--- sound/pci/hda/patch_realtek.c | 39 ++++++++++------------------------- 1 file changed, 11 insertions(+), 28 deletions(-)sound/pci/hda/patch_realtek.c +11
-28@@ -5501,6 +5501,16 @@ static void alc_fixup_headset_jack(struct hda_codec *codec, alc_headset_btn_callback);snd_hda_jack_add_kctl (codec,0x55 ,"Headset Jack" , false,SND_JACK_HEADSET , alc_headset_btn_keymap); +switch (codec->core.vendor_id) { +case 0x10ec0295 : +alc_update_coef_idx (codec,0x4a ,0x8000 ,1 <<15 );/* Reset HP JD */ +alc_update_coef_idx (codec,0x4a ,0x8000 ,0 <<15 ); +break ; +case 0x10ec0236 : +alc_update_coef_idx (codec,0x1b ,0x8000 ,1 <<15 );/* Reset HP JD */ +alc_update_coef_idx (codec,0x1b ,0x8000 ,0 <<15 ); +break ; + }break ;case HDA_FIXUP_ACT_INIT :switch (codec->core.vendor_id) {@@ -5521,26 +5531,6 @@ static void alc_fixup_headset_jack(struct hda_codec *codec, } } -static void alc295_fixup_chromebook (struct hda_codec *codec, -const struct hda_fixup *fix,int action) -{ - -switch (action) { -case HDA_FIXUP_ACT_PRE_PROBE : -switch (codec->core.vendor_id) { -case 0x10ec0295 : -alc_update_coef_idx (codec,0x4a ,0x8000 ,1 <<15 );/* Reset HP JD */ -alc_update_coef_idx (codec,0x4a ,0x8000 ,0 <<15 ); -break ; -case 0x10ec0236 : -alc_update_coef_idx (codec,0x1b ,0x8000 ,1 <<15 );/* Reset HP JD */ -alc_update_coef_idx (codec,0x1b ,0x8000 ,0 <<15 ); -break ; - } -break ; - } -} -static void alc_fixup_disable_mic_vref (struct hda_codec *codec,const struct hda_fixup *fix,int action) {@@ -5694,7 +5684,6 @@ enum {ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE ,ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE , ALC255_FIXUP_ACER_HEADSET_MIC, - ALC295_FIXUP_CHROME_BOOK, }; static const struct hda_fixup alc269_fixups[] = {@@ -6671,12 +6660,6 @@ static const struct hda_fixup alc269_fixups[] = { .chained = true, .chain_id =ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC }, - [ALC295_FIXUP_CHROME_BOOK] = { - .type = HDA_FIXUP_FUNC, - .v.func = alc295_fixup_chromebook, - .chained = true, - .chain_id =ALC225_FIXUP_HEADSET_JACK - }, };static const struct snd_pci_quirk alc269_fixup_tbl[] = {@@ -7089,7 +7072,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = { {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, - {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-sense-combo"}, + {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-sense-combo"}, {} };#define ALC225_STANDARD_PINS \Signature · 1 line
2.20.1