Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ladislav Michl <ladis@linux-mips.org>
To: alsa-devel@alsa-project.org
Cc: Mark Brown <broonie@kernel.org>,
	Alexandre Belloni <alexandre.belloni@free-electrons.com>
Subject: [PATCH 5/6] ASoC: max9867: DSP mode
Date: Thu, 1 Mar 2018 15:21:30 +0100	[thread overview]
Message-ID: <20180301142130.GG30722@lenoch> (raw)
In-Reply-To: <20180301141843.GB30722@lenoch>

Add configuration for DSP mode.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 sound/soc/codecs/max9867.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/max9867.c b/sound/soc/codecs/max9867.c
index 4160523ea720..4ea3287162ad 100644
--- a/sound/soc/codecs/max9867.c
+++ b/sound/soc/codecs/max9867.c
@@ -325,10 +325,16 @@ static int max9867_dai_set_fmt(struct snd_soc_dai *codec_dai,
 		return -EINVAL;
 	}
 
-	/* for i2s compatible mode */
-	iface1A |= MAX9867_I2S_DLY;
-	/* SDOUT goes to hiz state after all data is transferred */
-	iface1A |= MAX9867_SDOUT_HIZ;
+	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+	case SND_SOC_DAIFMT_I2S:
+		iface1A |= MAX9867_I2S_DLY;
+		break;
+	case SND_SOC_DAIFMT_DSP_A:
+		iface1A |= MAX9867_TDM_MODE | MAX9867_SDOUT_HIZ;
+		break;
+	default:
+		return -EINVAL;
+	}
 
 	/* Clock inversion bits, BCI and WCI */
 	switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
-- 
2.16.2

  parent reply	other threads:[~2018-03-01 14:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01 14:18 [PATCH 0/6] ASoC: max9867: Driver update Ladislav Michl
2018-03-01 14:19 ` [PATCH 1/6] ASoC: max9867: Show Kconfig entry Ladislav Michl
2018-03-01 14:19 ` [PATCH 2/6] ASoC: max9867: Improve error logging Ladislav Michl
2018-03-01 18:06   ` Applied "ASoC: max9867: Improve error logging" to the asoc tree Mark Brown
2018-03-01 14:20 ` [PATCH 3/6] ASoC: max9867: Drop probe function Ladislav Michl
2018-03-01 17:56   ` Mark Brown
2018-03-01 20:06     ` Ladislav Michl
2018-03-01 20:39       ` Mark Brown
2018-03-01 21:32         ` Ladislav Michl
2018-03-01 21:37           ` Mark Brown
2018-03-02 13:17   ` Applied "ASoC: max9867: Drop probe function" to the asoc tree Mark Brown
2018-03-01 14:20 ` [PATCH 4/6] ASoC: max9867: Fix codec capabilities Ladislav Michl
2018-03-01 18:06   ` Applied "ASoC: max9867: Fix codec capabilities" to the asoc tree Mark Brown
2018-03-01 14:21 ` Ladislav Michl [this message]
2018-03-01 18:06   ` Applied "ASoC: max9867: DSP mode" " Mark Brown
2018-03-01 14:22 ` [PATCH 6/6] ASoC: max9867: Use continuous sample rate Ladislav Michl
2018-03-01 18:22   ` Mark Brown
2018-03-01 21:47     ` Ladislav Michl
2018-03-02 10:50       ` 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=20180301142130.GG30722@lenoch \
    --to=ladis@linux-mips.org \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    /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