aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_generic.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-10-25 17:43:10 -0400
committerTakashi Iwai <tiwai@suse.de>2013-10-25 17:43:10 -0400
commitb63eae0a6c84839275a4638a7baa391be965cd0e (patch)
tree7695c0b5de82589ce46a43a309b0f07957c2959b /sound/pci/hda/hda_generic.c
parente6bbe666673ab044a3d39ddb74e4d9a401cf1d6f (diff)
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: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_generic.c')
-rw-r--r--sound/pci/hda/hda_generic.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 26ad4f0aade3..b7c89dff7066 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -4475,9 +4475,11 @@ int snd_hda_gen_build_controls(struct hda_codec *codec)
4475 true, &spec->vmaster_mute.sw_kctl); 4475 true, &spec->vmaster_mute.sw_kctl);
4476 if (err < 0) 4476 if (err < 0)
4477 return err; 4477 return err;
4478 if (spec->vmaster_mute.hook) 4478 if (spec->vmaster_mute.hook) {
4479 snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute, 4479 snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute,
4480 spec->vmaster_mute_enum); 4480 spec->vmaster_mute_enum);
4481 snd_hda_sync_vmaster_hook(&spec->vmaster_mute);
4482 }
4481 } 4483 }
4482 4484
4483 free_kctls(spec); /* no longer needed */ 4485 free_kctls(spec); /* no longer needed */