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

Commit 28657f29 authored by Ramprasad Katkam's avatar Ramprasad Katkam Committed by Gerrit - the friendly Code Review server
Browse files

asoc: bolero: move bolero devup flag after macro Up event



Move bolero dev up flag after macro up events, to avoid
bolero reg access before all client clk requests are
unvoted.

Change-Id: I93426442bb753911808995c7dea84d25886f9f9b
Signed-off-by: default avatarRamprasad Katkam <katkam@codeaurora.org>
parent 7e5676e5
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -452,12 +452,6 @@ int bolero_request_clock(struct device *dev, u16 macro_id,
	}

	mutex_lock(&priv->clk_lock);
	if (!priv->dev_up && enable) {
		dev_dbg_ratelimited(dev, "%s:SSR in progress, exit\n",
				    __func__);
		ret = -ENODEV;
		goto err;
	}

	mclk_mux0_macro =  bolero_mclk_mux_tbl[macro_id][MCLK_MUX0];
	switch (mclk_mux_id) {
@@ -465,7 +459,7 @@ int bolero_request_clock(struct device *dev, u16 macro_id,
		ret = priv->macro_params[mclk_mux0_macro].mclk_fn(
			priv->macro_params[mclk_mux0_macro].dev, enable);
		if (ret < 0) {
			dev_err(dev,
			dev_err_ratelimited(dev,
				"%s: MCLK_MUX0 %s failed for macro:%d, mclk_mux0_macro:%d\n",
				__func__,
				enable ? "enable" : "disable",
@@ -479,7 +473,7 @@ int bolero_request_clock(struct device *dev, u16 macro_id,
			priv->macro_params[mclk_mux0_macro].dev,
			true);
		if (ret < 0) {
			dev_err(dev,
			dev_err_ratelimited(dev,
				"%s: MCLK_MUX0 en failed for macro:%d mclk_mux0_macro:%d\n",
				__func__, macro_id, mclk_mux0_macro);
			/*
@@ -496,7 +490,7 @@ int bolero_request_clock(struct device *dev, u16 macro_id,
		ret1 = priv->macro_params[mclk_mux1_macro].mclk_fn(
			priv->macro_params[mclk_mux1_macro].dev, enable);
		if (ret1 < 0)
			dev_err(dev,
			dev_err_ratelimited(dev,
				"%s: MCLK_MUX1 %s failed for macro:%d, mclk_mux1_macro:%d\n",
				__func__,
				enable ? "enable" : "disable",
@@ -576,9 +570,6 @@ static int bolero_ssr_enable(struct device *dev, void *data)
			BOLERO_MACRO_EVT_WAIT_VA_CLK_RESET, 0x0);

	regcache_cache_only(priv->regmap, false);
	mutex_lock(&priv->clk_lock);
	priv->dev_up = true;
	mutex_unlock(&priv->clk_lock);
	/* call ssr event for supported macros */
	for (macro_idx = START_MACRO; macro_idx < MAX_MACRO; macro_idx++) {
		if (!priv->macro_params[macro_idx].event_handler)
@@ -586,6 +577,9 @@ static int bolero_ssr_enable(struct device *dev, void *data)
		priv->macro_params[macro_idx].event_handler(priv->codec,
			BOLERO_MACRO_EVT_SSR_UP, 0x0);
	}
	mutex_lock(&priv->clk_lock);
	priv->dev_up = true;
	mutex_unlock(&priv->clk_lock);
	bolero_cdc_notifier_call(priv, BOLERO_WCD_EVT_SSR_UP);
	return 0;
}
+2 −2
Original line number Diff line number Diff line
@@ -1055,7 +1055,7 @@ static int rx_macro_mclk_enable(struct rx_macro_priv *rx_priv,
			ret = bolero_request_clock(rx_priv->dev,
					RX_MACRO, mclk_mux, true);
			if (ret < 0) {
				dev_err(rx_priv->dev,
				dev_err_ratelimited(rx_priv->dev,
					"%s: rx request clock enable failed\n",
					__func__);
				goto exit;
@@ -3159,7 +3159,7 @@ static int rx_swrm_clock(void *handle, bool enable)
		if (rx_priv->swr_clk_users == 0) {
			ret = rx_macro_mclk_enable(rx_priv, 1, true);
			if (ret < 0) {
				dev_err(rx_priv->dev,
				dev_err_ratelimited(rx_priv->dev,
					"%s: rx request clock enable failed\n",
					__func__);
				goto exit;