summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_sigmatel.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-03-16 21:32:11 +0100
committerTakashi Iwai <tiwai@suse.de>2015-03-18 09:22:28 +0100
commite6feb5d08509be1af2ebc894dae35f32f7b92ab6 (patch)
treed5f993a6e71646577c2ec824a89500a386a39e07 /sound/pci/hda/patch_sigmatel.c
parentALSA: hda - Simplify PCM setup overrides (diff)
downloadlinux-e6feb5d08509be1af2ebc894dae35f32f7b92ab6.tar.xz
linux-e6feb5d08509be1af2ebc894dae35f32f7b92ab6.zip
ALSA: hda - Support advanced power state controls
This patch enables the finer power state control of each widget depending on the jack plug state and streaming state in addition to the existing power_down_unused power optimization. The new feature is enabled only when codec->power_mgmt flag is set. Two new flags, pin_enabled and stream_enabled, are introduced in nid_path struct for marking the two individual power states: the pin plug/unplug and DAC/ADC stream, respectively. They can be set statically in case they are static routes (e.g. some mixer paths), too. The power up and down events for each pin are triggered via the standard hda_jack table. The call order is hard-coded, relying on the current implementation of jack event chain (a la FILO/stack order). One point to be dealt carefully is that DAC/ADC cannot be powered on/off while streaming. They are pinned as long as the stream is running. For controlling the power of DAC/ADC, a new patch_ops is added. The generic parser provides the default callback for that. As of this patch, only IDT/Sigmatel codec driver enables the flag. The support on other codecs will follow. An assumption we made in this code is that the widget state (e.g. amp, pinctl, connections) remains after the widget power transition (not about FG power transition). This is true for IDT codecs, at least. But if the widget state is lost at widget power transition, we'd need to implement additional code to sync the cached amp/verbs for the specific NID. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r--sound/pci/hda/patch_sigmatel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 2956a6ba6bf0..86b944a6b0ed 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -4394,6 +4394,7 @@ static const struct hda_codec_ops stac_patch_ops = {
#ifdef CONFIG_PM
.suspend = stac_suspend,
#endif
+ .stream_pm = snd_hda_gen_stream_pm,
.reboot_notify = stac_shutup,
};
@@ -4487,6 +4488,7 @@ static int patch_stac92hd73xx(struct hda_codec *codec)
return err;
spec = codec->spec;
+ codec->power_mgmt = 1;
spec->linear_tone_beep = 0;
spec->gen.mixer_nid = 0x1d;
spec->have_spdif_mux = 1;
@@ -4592,6 +4594,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
codec->epss = 0; /* longer delay needed for D3 */
spec = codec->spec;
+ codec->power_mgmt = 1;
spec->linear_tone_beep = 0;
spec->gen.own_eapd_ctl = 1;
spec->gen.power_down_unused = 1;
@@ -4641,6 +4644,7 @@ static int patch_stac92hd95(struct hda_codec *codec)
codec->epss = 0; /* longer delay needed for D3 */
spec = codec->spec;
+ codec->power_mgmt = 1;
spec->linear_tone_beep = 0;
spec->gen.own_eapd_ctl = 1;
spec->gen.power_down_unused = 1;
@@ -4682,6 +4686,7 @@ static int patch_stac92hd71bxx(struct hda_codec *codec)
return err;
spec = codec->spec;
+ codec->power_mgmt = 1;
spec->linear_tone_beep = 0;
spec->gen.own_eapd_ctl = 1;
spec->gen.power_down_unused = 1;