From 70dbfce31b290691dfee0290da0c37946c61a0b9 Mon Sep 17 00:00:00 2001 From: Vatsal Bucha Date: Tue, 10 Nov 2020 14:27:00 +0530 Subject: [PATCH] asoc: bolero: Add core_vote before gfmux access GFMUX access happen during WSA macro usecase. Update wsa macro to do core_vote before clock request. Change-Id: I0b96e725e5150fff4d8bef0d6a50837fc9a3f873 Signed-off-by: Vatsal Bucha --- asoc/codecs/bolero/va-macro.c | 4 ++++ asoc/codecs/bolero/wsa-macro.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/asoc/codecs/bolero/va-macro.c b/asoc/codecs/bolero/va-macro.c index 34564add16bb..79b5ad4d725d 100644 --- a/asoc/codecs/bolero/va-macro.c +++ b/asoc/codecs/bolero/va-macro.c @@ -61,6 +61,8 @@ static int va_tx_unmute_delay = BOLERO_CDC_VA_TX_DMIC_UNMUTE_DELAY_MS; module_param(va_tx_unmute_delay, int, 0664); MODULE_PARM_DESC(va_tx_unmute_delay, "delay to unmute the tx path"); +static int va_macro_core_vote(void *handle, bool enable); + enum { VA_MACRO_AIF_INVALID = 0, VA_MACRO_AIF1_CAP, @@ -303,6 +305,7 @@ static int va_macro_event_handler(struct snd_soc_component *component, break; case BOLERO_MACRO_EVT_PRE_SSR_UP: /* enable&disable VA_CORE_CLK to reset GFMUX reg */ + va_macro_core_vote(va_priv, true); ret = bolero_clk_rsc_request_clock(va_priv->dev, va_priv->default_clk_id, VA_CORE_CLK, true); @@ -314,6 +317,7 @@ static int va_macro_event_handler(struct snd_soc_component *component, bolero_clk_rsc_request_clock(va_priv->dev, va_priv->default_clk_id, VA_CORE_CLK, false); + va_macro_core_vote(va_priv, false); break; case BOLERO_MACRO_EVT_SSR_UP: trace_printk("%s, enter SSR up\n", __func__); diff --git a/asoc/codecs/bolero/wsa-macro.c b/asoc/codecs/bolero/wsa-macro.c index 489f8ad11836..68b71ecdeedd 100644 --- a/asoc/codecs/bolero/wsa-macro.c +++ b/asoc/codecs/bolero/wsa-macro.c @@ -142,6 +142,7 @@ static struct interp_sample_rate int_mix_sample_rate_val[] = { #define WSA_MACRO_SWR_STRING_LEN 80 +static int wsa_macro_core_vote(void *handle, bool enable); static int wsa_macro_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai); @@ -1025,6 +1026,7 @@ static int wsa_macro_event_handler(struct snd_soc_component *component, break; case BOLERO_MACRO_EVT_PRE_SSR_UP: /* enable&disable WSA_CORE_CLK to reset GFMUX reg */ + wsa_macro_core_vote(wsa_priv, true); ret = bolero_clk_rsc_request_clock(wsa_priv->dev, wsa_priv->default_clk_id, WSA_CORE_CLK, true); @@ -1036,6 +1038,7 @@ static int wsa_macro_event_handler(struct snd_soc_component *component, bolero_clk_rsc_request_clock(wsa_priv->dev, wsa_priv->default_clk_id, WSA_CORE_CLK, false); + wsa_macro_core_vote(wsa_priv, false); break; case BOLERO_MACRO_EVT_SSR_UP: trace_printk("%s, enter SSR up\n", __func__);