summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_hwdep.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-03-13 09:02:42 +0100
committerTakashi Iwai <tiwai@suse.de>2009-03-13 09:06:31 +0100
commitbb6ac72fb19c6676eb8bafa8e3b8bf970a2294a2 (patch)
tree6cf263c2c3172bd1371ffbb0fcd0da14345aa5d4 /sound/pci/hda/hda_hwdep.c
parentALSA: hda - Add model=vaio for STAC9872 (diff)
downloadlinux-bb6ac72fb19c6676eb8bafa8e3b8bf970a2294a2.tar.xz
linux-bb6ac72fb19c6676eb8bafa8e3b8bf970a2294a2.zip
ALSA: hda - power up before codec initialization
Change the power state of each widget before starting the initialization work so that all verbs are executed properly. Also, keep power-up during hwdep reconfiguration. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_hwdep.c')
-rw-r--r--sound/pci/hda/hda_hwdep.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c
index 1e3ccc740afc..1c57505c2874 100644
--- a/sound/pci/hda/hda_hwdep.c
+++ b/sound/pci/hda/hda_hwdep.c
@@ -176,25 +176,29 @@ static int reconfig_codec(struct hda_codec *codec)
{
int err;
+ snd_hda_power_up(codec);
snd_printk(KERN_INFO "hda-codec: reconfiguring\n");
err = snd_hda_codec_reset(codec);
if (err < 0) {
snd_printk(KERN_ERR
"The codec is being used, can't reconfigure.\n");
- return err;
+ goto error;
}
err = snd_hda_codec_configure(codec);
if (err < 0)
- return err;
+ goto error;
/* rebuild PCMs */
err = snd_hda_codec_build_pcms(codec);
if (err < 0)
- return err;
+ goto error;
/* rebuild mixers */
err = snd_hda_codec_build_controls(codec);
if (err < 0)
- return err;
- return snd_card_register(codec->bus->card);
+ goto error;
+ err = snd_card_register(codec->bus->card);
+ error:
+ snd_hda_power_down(codec);
+ return err;
}
/*