ALSA: hda/realtek - Allow skipping spec->init_amp detection
Some devices have the overrides of spec->init_amp at HDA_FIXUP_ACT_PROBE just because alc_ssid_check() gives the false-positive values from the SSID. For more consistent behavior, define the logic in the following way: - Define ALC_INIT_UNDEFINED as the default value before calling alc_ssid_check() - Each fixup may set up spec->init_amp with another value at HDA_FIXUP_ACT_PRE_PROBE - At detection, check whether spec->init_amp is ALC_INIT_UNDEFINED or not; if it's different, we skip the detection Also, it turned out that ASUS TX300 requires the spec->init_amp override, too; currently it ignores the GPIO bits implicitly by its static init verb, but this will be changed in the later patchset. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
ab1bcc93b7
commit
1c76aa5fb4
1 changed files with 21 additions and 23 deletions
|
@ -43,6 +43,7 @@
|
||||||
|
|
||||||
/* extra amp-initialization sequence types */
|
/* extra amp-initialization sequence types */
|
||||||
enum {
|
enum {
|
||||||
|
ALC_INIT_UNDEFINED,
|
||||||
ALC_INIT_NONE,
|
ALC_INIT_NONE,
|
||||||
ALC_INIT_DEFAULT,
|
ALC_INIT_DEFAULT,
|
||||||
ALC_INIT_GPIO1,
|
ALC_INIT_GPIO1,
|
||||||
|
@ -656,20 +657,22 @@ do_sku:
|
||||||
* 7~6 : Reserved
|
* 7~6 : Reserved
|
||||||
*/
|
*/
|
||||||
tmp = (ass & 0x38) >> 3; /* external Amp control */
|
tmp = (ass & 0x38) >> 3; /* external Amp control */
|
||||||
switch (tmp) {
|
if (spec->init_amp == ALC_INIT_UNDEFINED) {
|
||||||
case 1:
|
switch (tmp) {
|
||||||
spec->init_amp = ALC_INIT_GPIO1;
|
case 1:
|
||||||
break;
|
spec->init_amp = ALC_INIT_GPIO1;
|
||||||
case 3:
|
break;
|
||||||
spec->init_amp = ALC_INIT_GPIO2;
|
case 3:
|
||||||
break;
|
spec->init_amp = ALC_INIT_GPIO2;
|
||||||
case 7:
|
break;
|
||||||
spec->init_amp = ALC_INIT_GPIO3;
|
case 7:
|
||||||
break;
|
spec->init_amp = ALC_INIT_GPIO3;
|
||||||
case 5:
|
break;
|
||||||
default:
|
case 5:
|
||||||
spec->init_amp = ALC_INIT_DEFAULT;
|
default:
|
||||||
break;
|
spec->init_amp = ALC_INIT_DEFAULT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* is laptop or Desktop and enable the function "Mute internal speaker
|
/* is laptop or Desktop and enable the function "Mute internal speaker
|
||||||
|
@ -1589,8 +1592,6 @@ static void alc260_fixup_kn1(struct hda_codec *codec,
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case HDA_FIXUP_ACT_PRE_PROBE:
|
case HDA_FIXUP_ACT_PRE_PROBE:
|
||||||
snd_hda_apply_pincfgs(codec, pincfgs);
|
snd_hda_apply_pincfgs(codec, pincfgs);
|
||||||
break;
|
|
||||||
case HDA_FIXUP_ACT_PROBE:
|
|
||||||
spec->init_amp = ALC_INIT_NONE;
|
spec->init_amp = ALC_INIT_NONE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1600,7 +1601,7 @@ static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
|
||||||
const struct hda_fixup *fix, int action)
|
const struct hda_fixup *fix, int action)
|
||||||
{
|
{
|
||||||
struct alc_spec *spec = codec->spec;
|
struct alc_spec *spec = codec->spec;
|
||||||
if (action == HDA_FIXUP_ACT_PROBE)
|
if (action == HDA_FIXUP_ACT_PRE_PROBE)
|
||||||
spec->init_amp = ALC_INIT_NONE;
|
spec->init_amp = ALC_INIT_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3892,6 +3893,7 @@ static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
|
||||||
struct alc_spec *spec = codec->spec;
|
struct alc_spec *spec = codec->spec;
|
||||||
|
|
||||||
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
|
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
|
||||||
|
spec->init_amp = ALC_INIT_DEFAULT;
|
||||||
if (alc_register_micmute_input_device(codec) != 0)
|
if (alc_register_micmute_input_device(codec) != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -3914,9 +3916,6 @@ static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case HDA_FIXUP_ACT_PROBE:
|
|
||||||
spec->init_amp = ALC_INIT_DEFAULT;
|
|
||||||
break;
|
|
||||||
case HDA_FIXUP_ACT_FREE:
|
case HDA_FIXUP_ACT_FREE:
|
||||||
input_unregister_device(spec->kb_dev);
|
input_unregister_device(spec->kb_dev);
|
||||||
spec->kb_dev = NULL;
|
spec->kb_dev = NULL;
|
||||||
|
@ -3937,6 +3936,7 @@ static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
|
||||||
struct alc_spec *spec = codec->spec;
|
struct alc_spec *spec = codec->spec;
|
||||||
|
|
||||||
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
|
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
|
||||||
|
spec->init_amp = ALC_INIT_DEFAULT;
|
||||||
if (alc_register_micmute_input_device(codec) != 0)
|
if (alc_register_micmute_input_device(codec) != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -3955,9 +3955,6 @@ static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case HDA_FIXUP_ACT_PROBE:
|
|
||||||
spec->init_amp = ALC_INIT_DEFAULT;
|
|
||||||
break;
|
|
||||||
case HDA_FIXUP_ACT_FREE:
|
case HDA_FIXUP_ACT_FREE:
|
||||||
input_unregister_device(spec->kb_dev);
|
input_unregister_device(spec->kb_dev);
|
||||||
spec->kb_dev = NULL;
|
spec->kb_dev = NULL;
|
||||||
|
@ -5227,6 +5224,7 @@ static void alc282_fixup_asus_tx300(struct hda_codec *codec,
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case HDA_FIXUP_ACT_PRE_PROBE:
|
case HDA_FIXUP_ACT_PRE_PROBE:
|
||||||
|
spec->init_amp = ALC_INIT_DEFAULT;
|
||||||
snd_hda_add_verbs(codec, gpio2_verbs);
|
snd_hda_add_verbs(codec, gpio2_verbs);
|
||||||
snd_hda_apply_pincfgs(codec, dock_pins);
|
snd_hda_apply_pincfgs(codec, dock_pins);
|
||||||
spec->gen.auto_mute_via_amp = 1;
|
spec->gen.auto_mute_via_amp = 1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue