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

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

Merge "asoc: codecs: Bail out from clock enable routine during SSR"

parents 67c97933 f4a471de
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -638,15 +638,14 @@ static void bolero_ssr_disable(struct device *dev, void *data)
	struct bolero_priv *priv = data;
	int macro_idx;

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

	bolero_cdc_notifier_call(priv, BOLERO_WCD_EVT_PA_OFF_PRE_SSR);
	regcache_cache_only(priv->regmap, true);

	mutex_lock(&priv->clk_lock);
	priv->dev_up = false;
	mutex_unlock(&priv->clk_lock);
	if (priv->rsc_clk_cb)
		priv->rsc_clk_cb(priv->clk_dev, BOLERO_MACRO_EVT_SSR_DOWN);
	/* 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)
+1 −1
Original line number Diff line number Diff line
@@ -405,7 +405,7 @@ int bolero_clk_rsc_request_clock(struct device *dev,
	}

	mutex_lock(&priv->rsc_clk_lock);
	if (!priv->dev_up) {
	if (!priv->dev_up && enable) {
		dev_err_ratelimited(priv->dev, "%s: SSR is in progress..\n",
				__func__);
		ret = -EINVAL;
+8 −2
Original line number Diff line number Diff line
@@ -241,8 +241,10 @@ static int swrm_clk_request(struct swr_mstr_ctrl *swrm, bool enable)

	mutex_lock(&swrm->clklock);
	if (enable) {
		if (!swrm->dev_up)
		if (!swrm->dev_up) {
			ret = -ENODEV;
			goto exit;
		}
		swrm->clk_ref_count++;
		if (swrm->clk_ref_count == 1) {
			ret = swrm->clk(swrm->handle, true);
@@ -1274,7 +1276,10 @@ static irqreturn_t swr_mstr_interrupt(int irq, void *dev)
	}

	mutex_lock(&swrm->reslock);
	swrm_clk_request(swrm, true);
	if (swrm_clk_request(swrm, true)) {
		mutex_unlock(&swrm->reslock);
		goto exit;
	}
	mutex_unlock(&swrm->reslock);

	intr_sts = swr_master_read(swrm, SWRM_INTERRUPT_STATUS);
@@ -1420,6 +1425,7 @@ static irqreturn_t swr_mstr_interrupt(int irq, void *dev)
	mutex_lock(&swrm->reslock);
	swrm_clk_request(swrm, false);
	mutex_unlock(&swrm->reslock);
exit:
	swrm_unlock_sleep(swrm);
	return ret;
}