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

This commit is contained in:
qctecmdr 2019-05-07 22:35:09 -07:00 • committed by Gerrit - the friendly Code Review server
commit e7072b0ae4
3 changed files with 11 additions and 6 deletions

View file

@ -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)

View file

@ -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;

View file

@ -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 @@ handle_irq:
mutex_lock(&swrm->reslock);
swrm_clk_request(swrm, false);
mutex_unlock(&swrm->reslock);
exit:
swrm_unlock_sleep(swrm);
return ret;
}