From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752656AbdLKTCP (ORCPT ); Mon, 11 Dec 2017 14:02:15 -0500 Received: from fllnx210.ext.ti.com ([198.47.19.17]:21509 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751356AbdLKTCG (ORCPT ); Mon, 11 Dec 2017 14:02:06 -0500 From: "Andrew F. Davis" To: Liam Girdwood , Mark Brown , Rob Herring , Mark Rutland CC: , , , "Andrew F . Davis" Subject: [PATCH 4/4] ASoC: codecs: tas5720: add TAS5722 TDM slot width setting support Date: Mon, 11 Dec 2017 13:01:57 -0600 Message-ID: <20171211190157.12371-4-afd@ti.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171211190157.12371-1-afd@ti.com> References: <20171211190157.12371-1-afd@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andreas Dannenberg 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 Signed-off-by: Andrew F. Davis --- 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