Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2531ff66 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "asoc: bolero: Add core_vote before gfmux access"

parents 0a0c718a cc71e490
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -350,6 +350,7 @@ struct rx_macro_bcl_pmic_params {
	u8 ppid;
};

static int rx_macro_core_vote(void *handle, bool enable);
static int rx_macro_hw_params(struct snd_pcm_substream *substream,
			       struct snd_pcm_hw_params *params,
			       struct snd_soc_dai *dai);
@@ -1230,6 +1231,7 @@ static int rx_macro_mclk_enable(struct rx_macro_priv *rx_priv,
		if (rx_priv->rx_mclk_users == 0) {
			if (rx_priv->is_native_on)
				rx_priv->clk_id = RX_CORE_CLK;
			rx_macro_core_vote(rx_priv, true);
			ret = bolero_clk_rsc_request_clock(rx_priv->dev,
							   rx_priv->default_clk_id,
							   rx_priv->clk_id,
@@ -1283,6 +1285,7 @@ static int rx_macro_mclk_enable(struct rx_macro_priv *rx_priv,
				0x01, 0x00);
			bolero_clk_rsc_fs_gen_request(rx_priv->dev,
			   false);
			rx_macro_core_vote(rx_priv, true);
			bolero_clk_rsc_request_clock(rx_priv->dev,
						 rx_priv->default_clk_id,
						 rx_priv->clk_id,
@@ -1396,18 +1399,21 @@ static int rx_macro_event_handler(struct snd_soc_component *component,
		}
		break;
	case BOLERO_MACRO_EVT_PRE_SSR_UP:
		rx_macro_core_vote(rx_priv, true);
		/* enable&disable RX_CORE_CLK to reset GFMUX reg */
		ret = bolero_clk_rsc_request_clock(rx_priv->dev,
						rx_priv->default_clk_id,
						RX_CORE_CLK, true);
		if (ret < 0)
		if (ret < 0) {
			dev_err_ratelimited(rx_priv->dev,
				"%s, failed to enable clk, ret:%d\n",
				__func__, ret);
		else
		} else {
			rx_macro_core_vote(rx_priv, true);
			bolero_clk_rsc_request_clock(rx_priv->dev,
						rx_priv->default_clk_id,
						RX_CORE_CLK, false);
		}
		break;
	case BOLERO_MACRO_EVT_SSR_UP:
		trace_printk("%s, enter SSR up\n", __func__);