alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, broonie@kernel.org,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: [PATCH 17/17] ASoC: Intel: cht-bsw-rt5645: fix DAI formats
Date: Thu, 26 Jan 2017 14:09:45 -0600	[thread overview]
Message-ID: <1485461385-14544-18-git-send-email-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <1485461385-14544-1-git-send-email-pierre-louis.bossart@linux.intel.com>

Remove default and set I2S mode correctly both on codec and
cpu sides

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/cht_bsw_rt5645.c | 39 ++++++++++++++++++++++++---------
 1 file changed, 29 insertions(+), 10 deletions(-)

diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c
index a97eef6..b972b65 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5645.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5645.c
@@ -304,13 +304,6 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
 	if (ret)
 		return ret;
 
-	/* TDM 4 slots 24 bit, set Rx & Tx bitmask to 4 active slots */
-	ret = snd_soc_dai_set_tdm_slot(codec_dai, 0xF, 0xF, 4, 24);
-	if (ret < 0) {
-		dev_err(runtime->dev, "can't set codec TDM slot %d\n", ret);
-		return ret;
-	}
-
 	if (ctx->acpi_card->codec_type == CODEC_TYPE_RT5650)
 		jack_type = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE |
 					SND_JACK_BTN_0 | SND_JACK_BTN_1 |
@@ -377,7 +370,17 @@ static int cht_codec_fixup(struct snd_soc_pcm_runtime *rtd,
 		 */
 		ret = snd_soc_dai_set_fmt(rtd->cpu_dai,
 					SND_SOC_DAIFMT_I2S     |
-					SND_SOC_DAIFMT_NB_IF   |
+					SND_SOC_DAIFMT_NB_NF   |
+					SND_SOC_DAIFMT_CBS_CFS
+			);
+		if (ret < 0) {
+			dev_err(rtd->dev, "can't set format to I2S, err %d\n", ret);
+			return ret;
+		}
+
+		ret = snd_soc_dai_set_fmt(rtd->codec_dai,
+					SND_SOC_DAIFMT_I2S     |
+					SND_SOC_DAIFMT_NB_NF   |
 					SND_SOC_DAIFMT_CBS_CFS
 			);
 		if (ret < 0) {
@@ -396,6 +399,24 @@ static int cht_codec_fixup(struct snd_soc_pcm_runtime *rtd,
 		/* set SSP2 to 24-bit */
 		params_set_format(params, SNDRV_PCM_FORMAT_S24_LE);
 
+		/*
+		 * Default mode for SSP configuration is TDM 4 slot
+		 */
+		ret = snd_soc_dai_set_fmt(rtd->codec_dai,
+					SND_SOC_DAIFMT_DSP_B |
+					SND_SOC_DAIFMT_IB_NF |
+					SND_SOC_DAIFMT_CBS_CFS);
+		if (ret < 0) {
+			dev_err(rtd->dev, "can't set format to TDM %d\n", ret);
+			return ret;
+		}
+
+		/* TDM 4 slots 24 bit, set Rx & Tx bitmask to 4 active slots */
+		ret = snd_soc_dai_set_tdm_slot(rtd->codec_dai, 0xF, 0xF, 4, 24);
+		if (ret < 0) {
+			dev_err(rtd->dev, "can't set codec TDM slot %d\n", ret);
+			return ret;
+		}
 	}
 	return 0;
 }
@@ -458,8 +479,6 @@ static struct snd_soc_dai_link cht_dailink[] = {
 		.no_pcm = 1,
 		.codec_dai_name = "rt5645-aif1",
 		.codec_name = "i2c-10EC5645:00",
-		.dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_IB_NF
-					| SND_SOC_DAIFMT_CBS_CFS,
 		.init = cht_codec_init,
 		.be_hw_params_fixup = cht_codec_fixup,
 		.nonatomic = true,
-- 
2.7.4

  parent reply	other threads:[~2017-01-26 20:10 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26 20:09 [PATCH 00/17] Baytrail/Cherrytrail audio fixes Pierre-Louis Bossart
2017-01-26 20:09 ` [PATCH 01/17] ASoC: Intel: atom: fix frame polarity Pierre-Louis Bossart
2017-01-31 20:02   ` Applied "ASoC: Intel: atom: fix frame polarity" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 02/17] ASoC: Intel: boards: remove .pm_ops in all Atom/DPCM machine drivers Pierre-Louis Bossart
2017-01-31 20:02   ` Applied "ASoC: Intel: boards: remove .pm_ops in all Atom/DPCM machine drivers" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 03/17] ASoC: rt5640: Add "10EC3276" ACPI ID Pierre-Louis Bossart
2017-01-26 20:09 ` [PATCH 04/17] ASoC: Intel: Atom: Add HP Pavilion x2 10-p000 machine entry Pierre-Louis Bossart
2017-01-26 20:09 ` [PATCH 05/17] ASoC: Intel: add support for Realtek 5651 on Cherrytrail Pierre-Louis Bossart
2017-01-31 21:18   ` Applied "ASoC: Intel: add support for Realtek 5651 on Cherrytrail" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 06/17] ASoC: codecs: rt5670: add quirk for Lenovo Thinkpad 10 Pierre-Louis Bossart
2017-01-31 21:17   ` Applied "ASoC: codecs: rt5670: add quirk for Lenovo Thinkpad 10" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 07/17] ASoC: Intel: Baytrail: add quirk for Lenovo Thinkpad 10 Pierre-Louis Bossart
2017-01-31 21:17   ` Applied "ASoC: Intel: Baytrail: add quirk for Lenovo Thinkpad 10" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 08/17] ASoC: rt5645: add support for RT5648 Pierre-Louis Bossart
2017-01-31 21:17   ` Applied "ASoC: rt5645: add support for RT5648" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 09/17] ASoc: rt5645: add ACPI ID 10EC3270 Pierre-Louis Bossart
2017-01-31 21:17   ` Applied "ASoc: rt5645: add ACPI ID 10EC3270" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 10/17] ASoC: Intel: cht_bsw_rt5645: add Baytrail MCLK support Pierre-Louis Bossart
2017-01-31 21:18   ` Applied "ASoC: Intel: cht_bsw_rt5645: add Baytrail MCLK support" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 11/17] ASoC: Intel: Atom: add machine driver for baytrail-rt5645 hardware Pierre-Louis Bossart
2017-01-31 21:17   ` Applied "ASoC: Intel: Atom: add machine driver for baytrail-rt5645 hardware" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 12/17] ASoC: Intel: add support for ALC3270 codec Pierre-Louis Bossart
2017-01-31 21:17   ` Applied "ASoC: Intel: add support for ALC3270 codec" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 13/17] ASoC: Intel: cht_bsw_rt5645: harden ACPI device detection Pierre-Louis Bossart
2017-01-31 21:17   ` Applied "ASoC: Intel: cht_bsw_rt5645: harden ACPI device detection" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 14/17] ASoC: rt5645: fix error handling for gpio detection Pierre-Louis Bossart
2017-01-31 20:00   ` Mark Brown
2017-01-31 20:29     ` Pierre-Louis Bossart
2017-01-26 20:09 ` [PATCH 15/17] ASoC: Intel: cht-bsw-rt5645: add quirks for SSP0/AIF1/AIF2 routing Pierre-Louis Bossart
2017-01-31 21:17   ` Applied "ASoC: Intel: cht-bsw-rt5645: add quirks for SSP0/AIF1/AIF2 routing" to the asoc tree Mark Brown
2017-01-26 20:09 ` [PATCH 16/17] ASoC: Intel: cht-bsw-rt5645: select ASRC source based on routing quirk Pierre-Louis Bossart
2017-01-31 21:17   ` Applied "ASoC: Intel: cht-bsw-rt5645: select ASRC source based on routing quirk" to the asoc tree Mark Brown
2017-01-26 20:09 ` Pierre-Louis Bossart [this message]
2017-01-31 21:17   ` Applied "ASoC: Intel: cht-bsw-rt5645: fix DAI formats" " 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=1485461385-14544-18-git-send-email-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --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 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).