All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolin Chen <Guangyu.Chen@freescale.com>
To: broonie@kernel.org
Cc: tiwai@suse.de, alsa-devel@alsa-project.org, lgirdwood@gmail.com
Subject: [PATCH RESEND 2/4] ASoC: fsl_esai: Only bypass sck_div for EXTAL source
Date: Tue, 6 May 2014 16:56:00 +0800	[thread overview]
Message-ID: <6c6ffc8939e15e4942f8b45a8a779d6cc16b72d4.1399366227.git.Guangyu.Chen@freescale.com> (raw)
In-Reply-To: <cover.1399366227.git.Guangyu.Chen@freescale.com>

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>
---
 sound/soc/fsl/fsl_esai.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index d098a48..7e1916e 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -259,10 +259,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);
-- 
1.8.4

  parent reply	other threads:[~2014-05-06  8:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-06  8:55 [PATCH RESEND 0/4] ASoC: fsl_esai: Fix some issues Nicolin Chen
2014-05-06  8:55 ` [PATCH RESEND 1/4] ASoC: fsl_esai: Fix incorrect condition within ratio range check for FP Nicolin Chen
2014-05-06  8:56 ` Nicolin Chen [this message]
2014-05-06  8:56 ` [PATCH RESEND 3/4] ASoC: fsl_esai: Bypass divider settings if clock requirement is not changed Nicolin Chen
2014-05-06  8:56 ` [PATCH RESEND 4/4] ASoC: fsl_esai: Set PCRC and PRRC registers at the end of hw_params() Nicolin Chen
2014-05-12 22:15 ` [PATCH RESEND 0/4] ASoC: fsl_esai: Fix some issues Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6c6ffc8939e15e4942f8b45a8a779d6cc16b72d4.1399366227.git.Guangyu.Chen@freescale.com \
    --to=guangyu.chen@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.