Skip to content

Commit 0ceb8a3

Browse files
jwrdegoedebroonie
authored andcommitted
ASoC: Intel: cht_bsw_rt5672: Change bus format to I2S 2 channel
The default mode for SSP configuration is TDM 4 slot and so far we were using this for the bus format on cht-bsw-rt56732 boards. One board, the Lenovo Miix 2 10 uses not 1 but 2 codecs connected to SSP2. The second piggy-backed, output-only codec is inside the keyboard-dock (which has extra speakers). Unlike the main rt5672 codec, we cannot configure this codec, it is hard coded to use 2 channel 24 bit I2S. Using 4 channel TDM leads to the dock speakers codec (which listens in on the data send from the SSP to the rt5672 codec) emiting horribly distorted sound. Since we only support 2 channels anyways, there is no need for TDM on any cht-bsw-rt5672 designs. So we can simply use I2S 2ch everywhere. This commit fixes the Lenovo Miix 2 10 dock speakers issue by changing the bus format set in cht_codec_fixup() to I2S 2 channel. This change has been tested on the following devices with a rt5672 codec: Lenovo Miix 2 10 Lenovo Thinkpad 8 Lenovo Thinkpad 10 (gen 1) Signed-off-by: Hans de Goede <[email protected]> Cc: [email protected] BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1786723 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent b6aa06d commit 0ceb8a3

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

sound/soc/intel/boards/cht_bsw_rt5672.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -253,21 +253,20 @@ static int cht_codec_fixup(struct snd_soc_pcm_runtime *rtd,
253253
params_set_format(params, SNDRV_PCM_FORMAT_S24_LE);
254254

255255
/*
256-
* Default mode for SSP configuration is TDM 4 slot
256+
* Default mode for SSP configuration is TDM 4 slot. One board/design,
257+
* the Lenovo Miix 2 10 uses not 1 but 2 codecs connected to SSP2. The
258+
* second piggy-backed, output-only codec is inside the keyboard-dock
259+
* (which has extra speakers). Unlike the main rt5672 codec, we cannot
260+
* configure this codec, it is hard coded to use 2 channel 24 bit I2S.
261+
* Since we only support 2 channels anyways, there is no need for TDM
262+
* on any cht-bsw-rt5672 designs. So we simply use I2S 2ch everywhere.
257263
*/
258-
ret = snd_soc_dai_set_fmt(asoc_rtd_to_codec(rtd, 0),
259-
SND_SOC_DAIFMT_DSP_B |
260-
SND_SOC_DAIFMT_IB_NF |
264+
ret = snd_soc_dai_set_fmt(asoc_rtd_to_cpu(rtd, 0),
265+
SND_SOC_DAIFMT_I2S |
266+
SND_SOC_DAIFMT_NB_NF |
261267
SND_SOC_DAIFMT_CBS_CFS);
262268
if (ret < 0) {
263-
dev_err(rtd->dev, "can't set format to TDM %d\n", ret);
264-
return ret;
265-
}
266-
267-
/* TDM 4 slots 24 bit, set Rx & Tx bitmask to 4 active slots */
268-
ret = snd_soc_dai_set_tdm_slot(asoc_rtd_to_codec(rtd, 0), 0xF, 0xF, 4, 24);
269-
if (ret < 0) {
270-
dev_err(rtd->dev, "can't set codec TDM slot %d\n", ret);
269+
dev_err(rtd->dev, "can't set format to I2S, err %d\n", ret);
271270
return ret;
272271
}
273272

0 commit comments

Comments
 (0)