audio-kernel: Synchronize hw vote and unvote requests

HW vote and unvote is currently called from multiple
clients leading to synchronization issues
during SSR/PDR scenarios. Synchronize all the vote requests
by using digital codec resource manager.

Change-Id: I7e63f69ab5d761a3bb4c7ce70bbef2e8bfd76cfb
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
(cherry picked from commit 31aa875405)
This commit is contained in:
Aditya Bavanari
2020-03-19 18:30:10 +05:30
committed by Phani Kumar Uppalapati
parent 1859d2a24b
commit 42a8ba550a
11 changed files with 193 additions and 16 deletions

View File

@@ -16,6 +16,7 @@
#include <asoc/msm-cdc-pinctrl.h>
#include <soc/swr-common.h>
#include <soc/swr-wcd.h>
#include <dsp/digital-cdc-rsc-mgr.h>
#include "bolero-cdc.h"
#include "bolero-cdc-registers.h"
#include "bolero-clk-rsc.h"
@@ -444,7 +445,8 @@ static int va_macro_swr_pwr_event(struct snd_soc_dapm_widget *w,
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
if (va_priv->lpass_audio_hw_vote) {
ret = clk_prepare_enable(va_priv->lpass_audio_hw_vote);
ret = digital_cdc_rsc_mgr_hw_vote_enable(
va_priv->lpass_audio_hw_vote);
if (ret)
dev_err(va_dev,
"%s: lpass audio hw enable failed\n",
@@ -467,7 +469,8 @@ static int va_macro_swr_pwr_event(struct snd_soc_dapm_widget *w,
if (bolero_tx_clk_switch(component, CLK_SRC_TX_RCG))
dev_dbg(va_dev, "%s: clock switch failed\n",__func__);
if (va_priv->lpass_audio_hw_vote)
clk_disable_unprepare(va_priv->lpass_audio_hw_vote);
digital_cdc_rsc_mgr_hw_vote_disable(
va_priv->lpass_audio_hw_vote);
break;
default:
dev_err(va_priv->dev,