Commit faba002e authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda/ca0132: Move unsol callback setups to parser

The setup of unsolicited event callbacks should be done only once at
the parser phase, not in the init phase that is called multiple times
at each resume.

This patch moves the unsol setup code in ca0132 codec driver to the
more appropriate place.
Reported-by: default avatarHui Wang <hui.wang@canonical.com>
Link: https://lore.kernel.org/r/20200930113008.9307-1-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 9be9f2d3
......@@ -8544,7 +8544,7 @@ static void amic_callback(struct hda_codec *codec, struct hda_jack_callback *cb)
ca0132_select_mic(codec);
}
static void ca0132_init_unsol(struct hda_codec *codec)
static void ca0132_setup_unsol(struct hda_codec *codec)
{
struct ca0132_spec *spec = codec->spec;
snd_hda_jack_detect_enable_callback(codec, spec->unsol_tag_hp, hp_callback);
......@@ -9376,7 +9376,6 @@ static int ca0132_init(struct hda_codec *codec)
if (ca0132_quirk(spec) == QUIRK_AE5 || ca0132_quirk(spec) == QUIRK_AE7)
ae5_register_set(codec);
ca0132_init_unsol(codec);
ca0132_init_params(codec);
ca0132_init_flags(codec);
......@@ -9941,6 +9940,8 @@ static int patch_ca0132(struct hda_codec *codec)
if (err < 0)
goto error;
ca0132_setup_unsol(codec);
return 0;
error:
......
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