Commit b63eae0a authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Add missing initial vmaster hook at build_controls callback

The generic parser has a support of vmaster hook, but this is
initialized only in the init callback with the check of the presence
of the corresponding kctl.  However, since kctl is NULL at the very
first init callback that is called before build_controls callback, the
vmaster hook sync is skipped there.  Eventually this leads to the
uninitialized state depending on the hook implementation.

This patch adds a simple workaround, just calling the sync function
explicitly at build_controls callback.

Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent e6bbe666
...@@ -4475,9 +4475,11 @@ int snd_hda_gen_build_controls(struct hda_codec *codec) ...@@ -4475,9 +4475,11 @@ int snd_hda_gen_build_controls(struct hda_codec *codec)
true, &spec->vmaster_mute.sw_kctl); true, &spec->vmaster_mute.sw_kctl);
if (err < 0) if (err < 0)
return err; return err;
if (spec->vmaster_mute.hook) if (spec->vmaster_mute.hook) {
snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute, snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute,
spec->vmaster_mute_enum); spec->vmaster_mute_enum);
snd_hda_sync_vmaster_hook(&spec->vmaster_mute);
}
} }
free_kctls(spec); /* no longer needed */ free_kctls(spec); /* no longer needed */
......
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