devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Andrew F. Davis" <afd-l0cyMroinI0@public.gmane.org>
To: Liam Girdwood <lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"Andrew F . Davis" <afd-l0cyMroinI0@public.gmane.org>
Subject: [PATCH 4/4] ASoC: codecs: tas5720: add TAS5722 TDM slot width setting support
Date: Mon, 11 Dec 2017 13:01:57 -0600	[thread overview]
Message-ID: <20171211190157.12371-4-afd@ti.com> (raw)
In-Reply-To: <20171211190157.12371-1-afd-l0cyMroinI0@public.gmane.org>

From: Andreas Dannenberg <dannenberg-l0cyMroinI0@public.gmane.org>

Unlike the TAS5720, the TAS5722 can be configured to utilize 16-bit wide
slots in TDM mode. This can help easing audio clocking/frequency
requirements.

Signed-off-by: Andreas Dannenberg <dannenberg-l0cyMroinI0@public.gmane.org>
Signed-off-by: Andrew F. Davis <afd-l0cyMroinI0@public.gmane.org>
---
 sound/soc/codecs/tas5720.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sound/soc/codecs/tas5720.c b/sound/soc/codecs/tas5720.c
index 042068964afb..08e0bfc9390c 100644
--- a/sound/soc/codecs/tas5720.c
+++ b/sound/soc/codecs/tas5720.c
@@ -152,6 +152,7 @@ static int tas5720_set_dai_tdm_slot(struct snd_soc_dai *dai,
 				    int slots, int slot_width)
 {
 	struct snd_soc_codec *codec = dai->codec;
+	struct tas5720_data *tas5720 = snd_soc_codec_get_drvdata(codec);
 	unsigned int first_slot;
 	int ret;
 
@@ -185,6 +186,16 @@ static int tas5720_set_dai_tdm_slot(struct snd_soc_dai *dai,
 	if (ret < 0)
 		goto error_snd_soc_update_bits;
 
+	/* Configure TDM slot width. This is only applicable to TAS5722. */
+	if (tas5720->devtype == TAS5722) {
+		ret = snd_soc_update_bits(codec, TAS5722_DIGITAL_CTRL2_REG,
+					  TAS5722_TDM_SLOT_16B,
+					  slot_width == 16 ?
+					  TAS5722_TDM_SLOT_16B : 0);
+		if (ret < 0)
+			goto error_snd_soc_update_bits;
+	}
+
 	return 0;
 
 error_snd_soc_update_bits:
-- 
2.15.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-12-11 19:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 19:01 [PATCH 1/4] ASoC: codecs: tas5720: add basic support for TAS5722 devices Andrew F. Davis
2017-12-11 19:01 ` [PATCH 3/4] ASoC: codecs: tas5720: add TAS5722 specific volume control Andrew F. Davis
     [not found]   ` <20171211190157.12371-3-afd-l0cyMroinI0@public.gmane.org>
2017-12-12 12:01     ` Mark Brown
2018-01-15 14:50       ` Andrew F. Davis
     [not found]         ` <ada57df8-66c0-0692-9250-422ef37cce95-l0cyMroinI0@public.gmane.org>
2018-01-15 16:41           ` Mark Brown
     [not found] ` <20171211190157.12371-1-afd-l0cyMroinI0@public.gmane.org>
2017-12-11 19:01   ` [PATCH 2/4] ASoC: codecs: tas5720: add TAS5722 register support Andrew F. Davis
2017-12-12 12:05     ` Applied "ASoC: tas5720: add TAS5722 register support" to the asoc tree Mark Brown
2017-12-11 19:01   ` Andrew F. Davis [this message]
2017-12-12 12:02     ` [PATCH 4/4] ASoC: codecs: tas5720: add TAS5722 TDM slot width setting support Mark Brown
2018-01-15 14:50       ` Andrew F. Davis
2017-12-12 12:05 ` Applied "ASoC: tas5720: add basic support for TAS5722 devices" to the asoc tree 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=20171211190157.12371-4-afd@ti.com \
    --to=afd-l0cymroini0@public.gmane.org \
    --cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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;
as well as URLs for NNTP newsgroup(s).