Skip to content

Commit

Permalink
ASoC: fsl_esai: Only bypass sck_div for EXTAL source
Browse files Browse the repository at this point in the history
ESAI can only output EXTAL clock source directly. But for FSYS clock source,
ESAI can not output it without getting through PSR PM dividers.

So this patch adds an extra check in the code.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Nicolin Chen authored and Mark Brown committed May 12, 2014
1 parent 89e47f6 commit 57ebbca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sound/soc/fsl/fsl_esai.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,16 @@ static int fsl_esai_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
return -EINVAL;
}

if (ratio == 1) {
/* Only EXTAL source can be output directly without using PSR and PM */
if (ratio == 1 && clksrc == esai_priv->extalclk) {
/* Bypass all the dividers if not being needed */
ecr |= tx ? ESAI_ECR_ETO : ESAI_ECR_ERO;
goto out;
} else if (ratio < 2) {
/* The ratio should be no less than 2 if using other sources */
dev_err(dai->dev, "failed to derive required HCK%c rate\n",
tx ? 'T' : 'R');
return -EINVAL;
}

ret = fsl_esai_divisor_cal(dai, tx, ratio, false, 0);
Expand Down

0 comments on commit 57ebbca

Please sign in to comment.