diff options
author | Mark Brown <broonie@kernel.org> | 2022-01-05 18:59:21 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-01-05 18:59:21 +0300 |
commit | 570010b82e8a04206eb228da23e4ef0264df7d25 (patch) | |
tree | 2e876bb726658248323fb2dca0795e8c10ba835f /sound/soc/codecs/wm_adsp.c | |
parent | a319cb32e7cfd2703db3a883ce260a7b06729895 (diff) | |
parent | ba235634b138cd9d012dbe983e7920481211e132 (diff) | |
download | linux-570010b82e8a04206eb228da23e4ef0264df7d25.tar.xz |
Add low power hibernation support to cs35l41
Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:
This patch series adds support for the low power hibernation feature
on cs35l41. This allows the DSP memory to be retained whilst the
device enters a very low power state.
Diffstat (limited to 'sound/soc/codecs/wm_adsp.c')
-rw-r--r-- | sound/soc/codecs/wm_adsp.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index c3112bf23866..f3672e3d1703 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c @@ -896,11 +896,12 @@ int wm_adsp2_preloader_put(struct snd_kcontrol *kcontrol, struct wm_adsp *dsp = &dsps[mc->shift - 1]; char preload[32]; - snprintf(preload, ARRAY_SIZE(preload), "%s Preload", dsp->cs_dsp.name); + if (dsp->preloaded == ucontrol->value.integer.value[0]) + return 0; - dsp->preloaded = ucontrol->value.integer.value[0]; + snprintf(preload, ARRAY_SIZE(preload), "%s Preload", dsp->cs_dsp.name); - if (ucontrol->value.integer.value[0]) + if (ucontrol->value.integer.value[0] || dsp->toggle_preload) snd_soc_component_force_enable_pin(component, preload); else snd_soc_component_disable_pin(component, preload); @@ -909,6 +910,13 @@ int wm_adsp2_preloader_put(struct snd_kcontrol *kcontrol, flush_work(&dsp->boot_work); + dsp->preloaded = ucontrol->value.integer.value[0]; + + if (dsp->toggle_preload) { + snd_soc_component_disable_pin(component, preload); + snd_soc_dapm_sync(dapm); + } + return 0; } EXPORT_SYMBOL_GPL(wm_adsp2_preloader_put); |