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

Commit 515fc228 authored by Prasad Kumpatla's avatar Prasad Kumpatla
Browse files

asoc: codec: Add pre ssr up event for all macros



Add a pre ssr up event in all macros ,where GFMUX reset
to done before set the dev_up flag to true.

Change-Id: I77229ccd0ed68aac841146a89fe7f76961260aea
Signed-off-by: default avatarPrasad Kumpatla <nkumpat@codeaurora.org>
parent bbf44eeb
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -834,11 +834,19 @@ static int bolero_ssr_enable(struct device *dev, void *data)
				priv->component,
				BOLERO_MACRO_EVT_CLK_RESET, 0x0);
	}
	trace_printk("%s: clk count reset\n", __func__);

	if (priv->rsc_clk_cb)
		priv->rsc_clk_cb(priv->clk_dev, BOLERO_MACRO_EVT_SSR_GFMUX_UP);

	trace_printk("%s: clk count reset\n", __func__);
	for (macro_idx = START_MACRO; macro_idx < MAX_MACRO; macro_idx++) {
		if (!priv->macro_params[macro_idx].event_handler)
			continue;
		priv->macro_params[macro_idx].event_handler(
			priv->component,
			BOLERO_MACRO_EVT_PRE_SSR_UP, 0x0);
	}

	regcache_cache_only(priv->regmap, false);
	mutex_lock(&priv->clk_lock);
	priv->dev_up = true;
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ enum {
	BOLERO_MACRO_EVT_RX_COMPANDER_SOFT_RST,
	BOLERO_MACRO_EVT_BCS_CLK_OFF,
	BOLERO_MACRO_EVT_SSR_GFMUX_UP,
	BOLERO_MACRO_EVT_PRE_SSR_UP,
};

enum {
+7 −5
Original line number Diff line number Diff line
@@ -1410,11 +1410,7 @@ static int rx_macro_event_handler(struct snd_soc_component *component,
			}
		}
		break;
	case BOLERO_MACRO_EVT_SSR_UP:
		trace_printk("%s, enter SSR up\n", __func__);
		rx_priv->dev_up = true;
		/* reset swr after ssr/pdr */
		rx_priv->reset_swr = true;
	case BOLERO_MACRO_EVT_PRE_SSR_UP:
		/* enable&disable RX_CORE_CLK to reset GFMUX reg */
		ret = bolero_clk_rsc_request_clock(rx_priv->dev,
						rx_priv->default_clk_id,
@@ -1427,6 +1423,12 @@ static int rx_macro_event_handler(struct snd_soc_component *component,
			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__);
		rx_priv->dev_up = true;
		/* reset swr after ssr/pdr */
		rx_priv->reset_swr = true;

		if (rx_priv->swr_ctrl_data)
			swrm_wcd_notify(
+3 −0
Original line number Diff line number Diff line
@@ -411,6 +411,9 @@ static int tx_macro_event_handler(struct snd_soc_component *component,
		else
			tx_priv->hs_slow_insert_complete = false;
		break;
	default:
		pr_debug("%s Invalid Event\n", __func__);
		break;
	}
	return 0;
}
+4 −2
Original line number Diff line number Diff line
@@ -297,8 +297,7 @@ static int va_macro_event_handler(struct snd_soc_component *component,
				"%s: va_mclk_users is non-zero still, audio SSR fail!!\n",
				__func__);
		break;
	case BOLERO_MACRO_EVT_SSR_UP:
		trace_printk("%s, enter SSR up\n", __func__);
	case BOLERO_MACRO_EVT_PRE_SSR_UP:
		/* enable&disable VA_CORE_CLK to reset GFMUX reg */
		ret = bolero_clk_rsc_request_clock(va_priv->dev,
						va_priv->default_clk_id,
@@ -311,6 +310,9 @@ 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);
		break;
	case BOLERO_MACRO_EVT_SSR_UP:
		trace_printk("%s, enter SSR up\n", __func__);
		/* reset swr after ssr/pdr */
		va_priv->reset_swr = true;
		if (va_priv->swr_ctrl_data)
Loading