alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Naveen M <naveen.m@intel.com>
To: alsa-devel@alsa-project.org
Cc: Shruthi Sudhakar <shruthi.sudhakar@intel.com>,
	vinod.koul@intel.com, liam.r.girdwood@linux.intel.com,
	tiwai@suse.de, broonie@kernel.org, naveen.m@intel.com,
	Harsha Priya N <harshapriya.n@intel.com>,
	pierre-louis.bossart@intel.com
Subject: [PATCH] ASoC: Intel: kbl: Enabling ASRC for RT5663 codec on kabylake platform
Date: Wed, 16 Aug 2017 15:55:59 +0530	[thread overview]
Message-ID: <1502879159-23771-1-git-send-email-naveen.m@intel.com> (raw)

From: Harsha Priya N <harshapriya.n@intel.com>

Patch fixes cracking noise in rt5663 headphones for kbl platform by
calling rt5663_sel_asrc_clk_src() for RT5663_AD_STEREO_FILTER to set
ASRC.

The ASRC function is for asynchronous MCLK and LRCLK. For RT5663 ASRC
should be enabled to support pcm format with 100fs.
ASRC function will track i2s clock and generate corresponding
system clock for codec. Calling this func helps select clock source
for both RT5663_AD_STEREO_FILTER and RT5663_DA_STEREO_FILTER filters
which fixes the crackling sound.

Signed-off-by: Harsha Priya <harshapriya.n@intel.com>
Signed-off-by: Shruthi Sudhakar <shruthi.sudhakar@intel.com>
Signed-off-by: Naveen M <naveen.m@intel.com>

diff --git a/sound/soc/intel/boards/kbl_rt5663_max98927.c b/sound/soc/intel/boards/kbl_rt5663_max98927.c
index f9ba977..29b50e4 100644
--- a/sound/soc/intel/boards/kbl_rt5663_max98927.c
+++ b/sound/soc/intel/boards/kbl_rt5663_max98927.c
@@ -312,11 +312,13 @@ static int kabylake_rt5663_hw_params(struct snd_pcm_substream *substream,
 	struct snd_soc_dai *codec_dai = rtd->codec_dai;
 	int ret;
 
-	ret = snd_soc_dai_set_sysclk(codec_dai,
-			RT5663_SCLK_S_MCLK, 24576000, SND_SOC_CLOCK_IN);
 	/* use ASRC for internal clocks, as PLL rate isn't multiple of BCLK */
-	rt5663_sel_asrc_clk_src(codec_dai->codec, RT5663_DA_STEREO_FILTER, 1);
+	rt5663_sel_asrc_clk_src(codec_dai->codec,
+			RT5663_DA_STEREO_FILTER | RT5663_AD_STEREO_FILTER,
+			RT5663_CLK_SEL_I2S1_ASRC);
 
+	ret = snd_soc_dai_set_sysclk(codec_dai,
+			RT5663_SCLK_S_MCLK, 24576000, SND_SOC_CLOCK_IN);
 	if (ret < 0)
 		dev_err(rtd->dev, "snd_soc_dai_set_sysclk err = %d\n", ret);
 
-- 
1.9.1

             reply	other threads:[~2017-08-16 10:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-16 10:25 Naveen M [this message]
2017-08-16 10:47 ` [alsa-devel] [PATCH] ASoC: Intel: kbl: Enabling ASRC for RT5663 codec on kabylake platform Naveen M
2017-08-16 10:47 ` Naveen M
  -- strict thread matches above, loose matches on Subject: below --
2017-08-11  5:00 Naveen M
2017-08-16  4:58 ` Vinod Koul

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=1502879159-23771-1-git-send-email-naveen.m@intel.com \
    --to=naveen.m@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=harshapriya.n@intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=pierre-louis.bossart@intel.com \
    --cc=shruthi.sudhakar@intel.com \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).