aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_proc.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-08-10 11:21:45 -0400
committerJaroslav Kysela <perex@perex.cz>2007-10-16 09:58:46 -0400
commitcb53c626e1145edf1d619bc4953f6293d3a77ace (patch)
tree715c2ef3d56a5ac7c79498800e888f562c1aa961 /sound/pci/hda/hda_proc.c
parentcca3b3718ca96dca51daf1129ac03003bcede751 (diff)
[ALSA] hda-intel - Add POWER_SAVE option
Added CONFIG_SND_HDA_POWER_SAVE kconfig. It's an experimental option to achieve an aggressive power-saving. With this option, the driver will turn on/off the power of each codec and controller chip dynamically on demand. The patch introduces a new module option 'power_save'. It specifies the second of time-out for automatic power-down. As default, it's 10 seconds. Setting 0 means to suppress the power-saving feature. The codec may have analog-input loopbacks, which are usually represented by mixer elements such as 'Mic Playback Switch' or 'CD Playback Switch'. When these are on, we cannot turn off the mixer and the codec chip has to be kept on. For bookkeeping these states, a new codec-callback is introduced. For the bus-controller side, a new callback pm_notify is introduced, which can be used to turn on/off the contoller appropriately. Note that this power-saving might cause slight click-noise at power-on/off. Also, it might take some time to wake up the codec, and might even drop some tones at the very beginning. This seems to be the side-effect of turning off the controller chip. This turn-off of the controller can be disabled by undefining HDA_POWER_SAVE_RESET_CONTOLLER in hda_intel.c. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/hda/hda_proc.c')
-rw-r--r--sound/pci/hda/hda_proc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
index ccd19180e541..e94944f34ffd 100644
--- a/sound/pci/hda/hda_proc.c
+++ b/sound/pci/hda/hda_proc.c
@@ -262,6 +262,7 @@ static void print_codec_info(struct snd_info_entry *entry,
262 262
263 if (! codec->afg) 263 if (! codec->afg)
264 return; 264 return;
265 snd_hda_power_up(codec);
265 snd_iprintf(buffer, "Default PCM:\n"); 266 snd_iprintf(buffer, "Default PCM:\n");
266 print_pcm_caps(buffer, codec, codec->afg); 267 print_pcm_caps(buffer, codec, codec->afg);
267 snd_iprintf(buffer, "Default Amp-In caps: "); 268 snd_iprintf(buffer, "Default Amp-In caps: ");
@@ -272,6 +273,7 @@ static void print_codec_info(struct snd_info_entry *entry,
272 nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid); 273 nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid);
273 if (! nid || nodes < 0) { 274 if (! nid || nodes < 0) {
274 snd_iprintf(buffer, "Invalid AFG subtree\n"); 275 snd_iprintf(buffer, "Invalid AFG subtree\n");
276 snd_hda_power_down(codec);
275 return; 277 return;
276 } 278 }
277 for (i = 0; i < nodes; i++, nid++) { 279 for (i = 0; i < nodes; i++, nid++) {
@@ -359,6 +361,7 @@ static void print_codec_info(struct snd_info_entry *entry,
359 snd_iprintf(buffer, "\n"); 361 snd_iprintf(buffer, "\n");
360 } 362 }
361 } 363 }
364 snd_hda_power_down(codec);
362} 365}
363 366
364/* 367/*