Commit a7a0a64d authored by David Henningsson's avatar David Henningsson Committed by Takashi Iwai

ALSA: hda - Always call standard unsolicited event for Realtek codecs

With the model parsers out of the way, we have no custom unsol
events to worry about, we can therefore simplify the code.

In addition, this fixes a bug on the ASUS TC710, which has only
a headphone jack and a mic jack, but no internal mic or speakers.
Therefore the unsol_event pointer was not set, and as a result,
the jack kcontrols were not correctly updated.

BugLink: https://bugs.launchpad.net/bugs/1021192Signed-off-by: default avatarDavid Henningsson <david.henningsson@canonical.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent f68d891d
...@@ -174,7 +174,6 @@ struct alc_spec { ...@@ -174,7 +174,6 @@ struct alc_spec {
/* hooks */ /* hooks */
void (*init_hook)(struct hda_codec *codec); void (*init_hook)(struct hda_codec *codec);
void (*unsol_event)(struct hda_codec *codec, unsigned int res);
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_SND_HDA_POWER_SAVE
void (*power_hook)(struct hda_codec *codec); void (*power_hook)(struct hda_codec *codec);
#endif #endif
...@@ -688,7 +687,7 @@ static void alc_update_knob_master(struct hda_codec *codec, hda_nid_t nid) ...@@ -688,7 +687,7 @@ static void alc_update_knob_master(struct hda_codec *codec, hda_nid_t nid)
} }
/* unsolicited event for HP jack sensing */ /* unsolicited event for HP jack sensing */
static void alc_sku_unsol_event(struct hda_codec *codec, unsigned int res) static void alc_unsol_event(struct hda_codec *codec, unsigned int res)
{ {
int action; int action;
...@@ -1024,11 +1023,9 @@ static void alc_init_automute(struct hda_codec *codec) ...@@ -1024,11 +1023,9 @@ static void alc_init_automute(struct hda_codec *codec)
spec->automute_lo = spec->automute_lo_possible; spec->automute_lo = spec->automute_lo_possible;
spec->automute_speaker = spec->automute_speaker_possible; spec->automute_speaker = spec->automute_speaker_possible;
if (spec->automute_speaker_possible || spec->automute_lo_possible) { if (spec->automute_speaker_possible || spec->automute_lo_possible)
/* create a control for automute mode */ /* create a control for automute mode */
alc_add_automute_mode_enum(codec); alc_add_automute_mode_enum(codec);
spec->unsol_event = alc_sku_unsol_event;
}
} }
/* return the position of NID in the list, or -1 if not found */ /* return the position of NID in the list, or -1 if not found */
...@@ -1191,7 +1188,6 @@ static void alc_init_auto_mic(struct hda_codec *codec) ...@@ -1191,7 +1188,6 @@ static void alc_init_auto_mic(struct hda_codec *codec)
snd_printdd("realtek: Enable auto-mic switch on NID 0x%x/0x%x/0x%x\n", snd_printdd("realtek: Enable auto-mic switch on NID 0x%x/0x%x/0x%x\n",
ext, fixed, dock); ext, fixed, dock);
spec->unsol_event = alc_sku_unsol_event;
} }
/* check the availabilities of auto-mute and auto-mic switches */ /* check the availabilities of auto-mute and auto-mic switches */
...@@ -2062,14 +2058,6 @@ static int alc_init(struct hda_codec *codec) ...@@ -2062,14 +2058,6 @@ static int alc_init(struct hda_codec *codec)
return 0; return 0;
} }
static void alc_unsol_event(struct hda_codec *codec, unsigned int res)
{
struct alc_spec *spec = codec->spec;
if (spec->unsol_event)
spec->unsol_event(codec, res);
}
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_SND_HDA_POWER_SAVE
static int alc_check_power_status(struct hda_codec *codec, hda_nid_t nid) static int alc_check_power_status(struct hda_codec *codec, hda_nid_t nid)
{ {
...@@ -4271,14 +4259,12 @@ static void set_capture_mixer(struct hda_codec *codec) ...@@ -4271,14 +4259,12 @@ static void set_capture_mixer(struct hda_codec *codec)
*/ */
static void alc_auto_init_std(struct hda_codec *codec) static void alc_auto_init_std(struct hda_codec *codec)
{ {
struct alc_spec *spec = codec->spec;
alc_auto_init_multi_out(codec); alc_auto_init_multi_out(codec);
alc_auto_init_extra_out(codec); alc_auto_init_extra_out(codec);
alc_auto_init_analog_input(codec); alc_auto_init_analog_input(codec);
alc_auto_init_input_src(codec); alc_auto_init_input_src(codec);
alc_auto_init_digital(codec); alc_auto_init_digital(codec);
if (spec->unsol_event) alc_inithook(codec);
alc_inithook(codec);
} }
/* /*
...@@ -4879,7 +4865,6 @@ static void alc260_fixup_gpio1_toggle(struct hda_codec *codec, ...@@ -4879,7 +4865,6 @@ static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
spec->automute_speaker = 1; spec->automute_speaker = 1;
spec->autocfg.hp_pins[0] = 0x0f; /* copy it for automute */ spec->autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
snd_hda_jack_detect_enable(codec, 0x0f, ALC_HP_EVENT); snd_hda_jack_detect_enable(codec, 0x0f, ALC_HP_EVENT);
spec->unsol_event = alc_sku_unsol_event;
snd_hda_gen_add_verbs(&spec->gen, alc_gpio1_init_verbs); snd_hda_gen_add_verbs(&spec->gen, alc_gpio1_init_verbs);
} }
} }
......
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