aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_hwdep.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-03-13 04:02:42 -0400
committerTakashi Iwai <tiwai@suse.de>2009-03-13 04:06:31 -0400
commitbb6ac72fb19c6676eb8bafa8e3b8bf970a2294a2 (patch)
tree6cf263c2c3172bd1371ffbb0fcd0da14345aa5d4 /sound/pci/hda/hda_hwdep.c
parent307282c8990c5658604b9fda8a64a9a07079b850 (diff)
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 1e3ccc740af..1c57505c287 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)
176{ 176{
177 int err; 177 int err;
178 178
179 snd_hda_power_up(codec);
179 snd_printk(KERN_INFO "hda-codec: reconfiguring\n"); 180 snd_printk(KERN_INFO "hda-codec: reconfiguring\n");
180 err = snd_hda_codec_reset(codec); 181 err = snd_hda_codec_reset(codec);
181 if (err < 0) { 182 if (err < 0) {
182 snd_printk(KERN_ERR 183 snd_printk(KERN_ERR
183 "The codec is being used, can't reconfigure.\n"); 184 "The codec is being used, can't reconfigure.\n");
184 return err; 185 goto error;
185 } 186 }
186 err = snd_hda_codec_configure(codec); 187 err = snd_hda_codec_configure(codec);
187 if (err < 0) 188 if (err < 0)
188 return err; 189 goto error;
189 /* rebuild PCMs */ 190 /* rebuild PCMs */
190 err = snd_hda_codec_build_pcms(codec); 191 err = snd_hda_codec_build_pcms(codec);
191 if (err < 0) 192 if (err < 0)
192 return err; 193 goto error;
193 /* rebuild mixers */ 194 /* rebuild mixers */
194 err = snd_hda_codec_build_controls(codec); 195 err = snd_hda_codec_build_controls(codec);
195 if (err < 0) 196 if (err < 0)
196 return err; 197 goto error;
197 return snd_card_register(codec->bus->card); 198 err = snd_card_register(codec->bus->card);
199 error:
200 snd_hda_power_down(codec);
201 return err;
198} 202}
199 203
200/* 204/*