asoc: codecs: Add system sleep ops for macro drivers

Add system sleep ops and invoke force runtime suspend for all
the macro drivers in bolero in order to synchronize
system suspend and runtime suspend callbacks.
Use freezable delayed work queues instead of normal
delayed workqueues in order to avoid contention with
pm suspend callflow.

Change-Id: Ibb0d35ad80c09e7f2a7032b4daef53c359056dfd
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
This commit is contained in:
Aditya Bavanari
2020-02-20 12:46:51 +05:30
committed by Gerrit - the friendly Code Review server
parent 68f58b0d09
commit e2f52ea5c0
5 changed files with 26 additions and 6 deletions

View File

@@ -1142,11 +1142,12 @@ static int va_macro_enable_dec(struct snd_soc_dapm_widget *w,
*/
usleep_range(6000, 6010);
/* schedule work queue to Remove Mute */
schedule_delayed_work(&va_priv->va_mute_dwork[decimator].dwork,
msecs_to_jiffies(va_tx_unmute_delay));
queue_delayed_work(system_freezable_wq,
&va_priv->va_mute_dwork[decimator].dwork,
msecs_to_jiffies(va_tx_unmute_delay));
if (va_priv->va_hpf_work[decimator].hpf_cut_off_freq !=
CF_MIN_3DB_150HZ)
schedule_delayed_work(
queue_delayed_work(system_freezable_wq,
&va_priv->va_hpf_work[decimator].dwork,
msecs_to_jiffies(hpf_delay));
/* apply gain after decimator is enabled */
@@ -3039,6 +3040,10 @@ static const struct of_device_id va_macro_dt_match[] = {
};
static const struct dev_pm_ops bolero_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(
pm_runtime_force_suspend,
pm_runtime_force_resume
)
SET_RUNTIME_PM_OPS(
bolero_runtime_suspend,
bolero_runtime_resume,