Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: rt5677: Add the slot_width "25" support in the TDM mode
@ 2015-01-12  5:34 Oder Chiou
  2015-01-12 19:13 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Oder Chiou @ 2015-01-12  5:34 UTC (permalink / raw)
  To: broonie, lgirdwood
  Cc: Oder Chiou, alsa-devel, yang.a.fang, john.lin, bardliao, flove

Add the slot_width "25" support in the TDM mode for the Intel platform.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
---
 sound/soc/codecs/rt5677.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index 32c368c..af34ffc 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -4123,6 +4123,7 @@ static int rt5677_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
 		val |= (1 << 8);
 		break;
 	case 24:
+	case 25:
 		val |= (2 << 8);
 		break;
 	case 32:
@@ -4136,9 +4137,14 @@ static int rt5677_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
 	switch (dai->id) {
 	case RT5677_AIF1:
 		snd_soc_update_bits(codec, RT5677_TDM1_CTRL1, 0x1f00, val);
+		if (slot_width == 25)
+			snd_soc_update_bits(codec, RT5677_DIG_MISC, 0x8000,
+				0x8000);
 		break;
 	case RT5677_AIF2:
 		snd_soc_update_bits(codec, RT5677_TDM2_CTRL1, 0x1f00, val);
+		if (slot_width == 25)
+			snd_soc_update_bits(codec, RT5677_DIG_MISC, 0x80, 0x80);
 		break;
 	default:
 		break;
-- 
1.8.1.1.439.g50a6b54

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: rt5677: Add the slot_width "25" support in the TDM mode
  2015-01-12  5:34 [PATCH] ASoC: rt5677: Add the slot_width "25" support in the TDM mode Oder Chiou
@ 2015-01-12 19:13 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2015-01-12 19:13 UTC (permalink / raw)
  To: Oder Chiou; +Cc: alsa-devel, yang.a.fang, lgirdwood, john.lin, bardliao, flove


[-- Attachment #1.1: Type: text/plain, Size: 557 bytes --]

On Mon, Jan 12, 2015 at 01:34:55PM +0800, Oder Chiou wrote:
> Add the slot_width "25" support in the TDM mode for the Intel platform.

>  	case RT5677_AIF2:
>  		snd_soc_update_bits(codec, RT5677_TDM2_CTRL1, 0x1f00, val);
> +		if (slot_width == 25)
> +			snd_soc_update_bits(codec, RT5677_DIG_MISC, 0x80, 0x80);
>  		break;

This looks good but I'd expect to see something which clears this bit if
we're not using a slot width of 25 in case someone comes up with a use
case that changes formats at runtime (relatively unlikely, but better
safe than sorry).

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-12 19:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-12  5:34 [PATCH] ASoC: rt5677: Add the slot_width "25" support in the TDM mode Oder Chiou
2015-01-12 19:13 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox