From fb39a8c3d7e5c4cb7d16c5cd54d3a4c41b89dfa8 Mon Sep 17 00:00:00 2001 From: Banajit Goswami Date: Sun, 14 Aug 2016 11:46:19 -0700 Subject: [PATCH] ASoC: msmcobalt: remove custom PM QoS for Low-latency playback For msmcobalt, it was found that, for low-latency audio playback, audio driver requests for a PM QoS with 10% of the period size. This value is too small for CPU to come back up from L2 PC, and hence CPU never enters into L2 PC, which increased power consumption. ALSA core framework already has a way to vote on behalf of client driver, with a latency value of 75% of period size. To enable CPU to enter L2 PC, fall back to use ALSA core provided PM QoS of 75% for low-latency audio playback instead of the custom PM QoS request. CRs-Fixed: 1048743 Change-Id: Icff3c15a4f1d26f43274465063259f06737fe495 Signed-off-by: Banajit Goswami --- sound/soc/msm/msmcobalt.c | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/sound/soc/msm/msmcobalt.c b/sound/soc/msm/msmcobalt.c index 763854061966..fc4103173c33 100644 --- a/sound/soc/msm/msmcobalt.c +++ b/sound/soc/msm/msmcobalt.c @@ -2042,32 +2042,6 @@ static struct snd_soc_ops msm_wcn_ops = { .hw_params = msm_wcn_hw_params, }; -static int msm_get_ll_qos_val(struct snd_pcm_runtime *runtime) -{ - int usecs; - - /* take 10% of period time as the deadline */ - usecs = (100000 / runtime->rate) * runtime->period_size; - usecs += ((100000 % runtime->rate) * runtime->period_size) / - runtime->rate; - - return usecs; -} - -static int msm_mm5_prepare(struct snd_pcm_substream *substream) -{ - if (pm_qos_request_active(&substream->latency_pm_qos_req)) - pm_qos_remove_request(&substream->latency_pm_qos_req); - pm_qos_add_request(&substream->latency_pm_qos_req, - PM_QOS_CPU_DMA_LATENCY, - msm_get_ll_qos_val(substream->runtime)); - return 0; -} - -static struct snd_soc_ops msm_mm5_ops = { - .prepare = msm_mm5_prepare, -}; - /* Digital audio interface glue - connects codec <---> CPU */ static struct snd_soc_dai_link msm_common_dai_links[] = { /* FrontEnd DAI Links */ @@ -2300,7 +2274,6 @@ static struct snd_soc_dai_link msm_common_dai_links[] = { /* this dainlink has playback support */ .ignore_pmdown_time = 1, .be_id = MSM_FRONTEND_DAI_MULTIMEDIA5, - .ops = &msm_mm5_ops, }, { .name = "Listen 1 Audio Service",