From patchwork Wed Feb 13 17:47:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Thomson X-Patchwork-Id: 10812093 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 253D11399 for ; Thu, 14 Feb 2019 09:01:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1126529CA7 for ; Thu, 14 Feb 2019 09:01:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 050522D5BD; Thu, 14 Feb 2019 09:01:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,FROM_WORDY, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A8C32D58F for ; Thu, 14 Feb 2019 09:01:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5C9FC26799C; Thu, 14 Feb 2019 09:45:22 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1EB9B267418; Thu, 14 Feb 2019 09:45:17 +0100 (CET) Received: from mail1.bemta25.messagelabs.com (mail1.bemta25.messagelabs.com [195.245.230.66]) by alsa0.perex.cz (Postfix) with ESMTP id EE913267917 for ; Thu, 14 Feb 2019 09:45:14 +0100 (CET) Received: from [46.226.52.200] (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)) by server-2.bemta.az-b.eu-west-1.aws.symcld.net id CB/30-04268-89A256C5; Thu, 14 Feb 2019 08:45:12 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKKsWRWlGSWpSXmKPExsUS3ulwWHeGVmq MwbqtkhanWvawW1y5eIjJYurDJ2wW3650MFlc3jWHzaJzVz+rxYbvaxkd2D02fG5i82i99JfN Y+esu+wem1Z1snnse7uMzWP9lqssHp83yQWwR7Fm5iXlVySwZuxu7mYs+CJTsfzjDuYGxi6JL kYuDiGBbYwSp391MEM46xkl/lw6wNrFyAnkVEhc2bYIKMHBwSuQKXGiTQwkzCngLvHp7E52iB I3iZ8HfjCB2GwCFhKTTzxgA7FZBFQlZv5rYgSxhQVCJE7tWwlWIyLQxShx/qg3yC5mgfmMEts WXgXbxSsgKHFy5hMWEJtZQELi4IsXzBALDCROL2gEi0sI2EtMf38V7B4JAX2JxmOxEGFDie+z vkGVmEvs3LGcDVU5ppo/p34yY6pBZltLXP8wi20Co8QsJNfNQnLdAkamVYwWSUWZ6RkluYmZO bqGBga6hoZGuoaWZrqGJsZ6iVW6SXqppbrlqcUluoZ6ieXFesWVuck5KXp5qSWbGIHRnVJwpH 8H47Pl6YcYJTmYlER5jS+mxAjxJeWnVGYkFmfEF5XmpBYfYpTh4FCS4NXVTI0REixKTU+tSMv MAaYZmLQEB4+SCK8gSJq3uCAxtzgzHSJ1ilFRSpxXWQMoIQCSyCjNg2uDpbZLjLJSwryMDAwM QjwFqUW5mSWo8q8YxTkYlYR5E0HG82TmlcBNfwW0mAlo8VORFJDFJYkIKakGxor75/5flt7W+ +Lf+9PmB5ZceaJqde/Ri/uFp7/smx/5YfZen72uB1P+PFh/iEtePjvxiF3+15jeqxLVl7ezTP ZY0PSLa/r6xjPpvxX+dD//YsPT89frYejiyonps3KMbjF+lA+t2Z+53t38pPKDXUvUp99isr/ uuCVq46cXbxod3acW639bbP5CiaU4I9FQi7moOBEAoS23PmgDAAA= X-Env-Sender: Adam.Thomson.Opensource@diasemi.com X-Msg-Ref: server-15.tower-288.messagelabs.com!1550133911!2392454!4 X-Originating-IP: [87.137.64.195] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.31.5; banners=-,-,- X-VirusChecked: Checked Received: (qmail 12092 invoked from network); 14 Feb 2019 08:45:12 -0000 Received: from unknown (HELO NB-EX-CASHUB01.diasemi.com) (87.137.64.195) by server-15.tower-288.messagelabs.com with AES128-SHA256 encrypted SMTP; 14 Feb 2019 08:45:12 -0000 Received: from SW-EX-CASHUB01.diasemi.com (10.20.16.141) by NB-EX-CASHUB01.diasemi.com (10.1.16.141) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 14 Feb 2019 09:45:11 +0100 Received: from swsrvapps-01.diasemi.com (10.20.28.141) by SW-EX-CASHUB01.diasemi.com (10.20.16.140) with Microsoft SMTP Server id 14.3.408.0; Wed, 13 Feb 2019 17:47:32 +0000 Received: by swsrvapps-01.diasemi.com (Postfix, from userid 22379) id A38233FBB6; Wed, 13 Feb 2019 17:47:32 +0000 (GMT) Message-ID: In-Reply-To: References: From: Adam Thomson Date: Wed, 13 Feb 2019 17:47:32 +0000 To: Mark Brown , Liam Girdwood , Takashi Iwai , Jaroslav Kysela MIME-Version: 1.0 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-ServerInfo: sw-ex-cashub01.diasemi.com, 9 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 13/02/2019 16:08:00 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 14/02/2019 04:08:00 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-EXCLAIMER-MD-CONFIG: 8d172408-bd6a-42b1-8e53-daaedf35a5af Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Support Opensource , Akshu Agrawal Subject: [alsa-devel] [PATCH 1/2] ASoC: da7219: Add support for master mode BCLK rate adjustment X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Previously the driver would default the BCLK periods per WCLK to 64, to cover all possible non-TDM scenarios when the codec was DAI clock master. However some devices require a lower BCLK rate to operate correctly so with this in mind, this commit updates the code to be more dynamic, with BCLK rate now based on SR and word length provided to hw_params(). Signed-off-by: Adam Thomson --- sound/soc/codecs/da7219.c | 36 ++++++++++++++++++++++++++---------- sound/soc/codecs/da7219.h | 1 + 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c index b1df4bb..7dbecf3 100644 --- a/sound/soc/codecs/da7219.c +++ b/sound/soc/codecs/da7219.c @@ -1376,11 +1376,7 @@ static int da7219_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) return -EINVAL; } - /* By default 64 BCLKs per WCLK is supported */ - dai_clk_mode |= DA7219_DAI_BCLKS_PER_WCLK_64; - snd_soc_component_update_bits(component, DA7219_DAI_CLK_MODE, - DA7219_DAI_BCLKS_PER_WCLK_MASK | DA7219_DAI_CLK_POL_MASK | DA7219_DAI_WCLK_POL_MASK, dai_clk_mode); snd_soc_component_update_bits(component, DA7219_DAI_CTRL, DA7219_DAI_FORMAT_MASK, @@ -1399,14 +1395,12 @@ static int da7219_set_dai_tdm_slot(struct snd_soc_dai *dai, __le16 offset; u32 frame_size; - /* No channels enabled so disable TDM, revert to 64-bit frames */ + /* No channels enabled so disable TDM */ if (!tx_mask) { snd_soc_component_update_bits(component, DA7219_DAI_TDM_CTRL, DA7219_DAI_TDM_CH_EN_MASK | DA7219_DAI_TDM_MODE_EN_MASK, 0); - snd_soc_component_update_bits(component, DA7219_DAI_CLK_MODE, - DA7219_DAI_BCLKS_PER_WCLK_MASK, - DA7219_DAI_BCLKS_PER_WCLK_64); + da7219->tdm_en = false; return 0; } @@ -1458,6 +1452,8 @@ static int da7219_set_dai_tdm_slot(struct snd_soc_dai *dai, (tx_mask << DA7219_DAI_TDM_CH_EN_SHIFT) | DA7219_DAI_TDM_MODE_EN_MASK); + da7219->tdm_en = true; + return 0; } @@ -1466,10 +1462,13 @@ static int da7219_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_component *component = dai->component; - u8 dai_ctrl = 0, fs; + struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); + u8 dai_ctrl = 0, dai_bclks_per_wclk = 0, fs; unsigned int channels; + int word_len = params_width(params); + int frame_size; - switch (params_width(params)) { + switch (word_len) { case 16: dai_ctrl |= DA7219_DAI_WORD_LENGTH_S16_LE; break; @@ -1533,6 +1532,23 @@ static int da7219_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } + /* + * If we're master, then we have a limited set of BCLK rates we + * support. For slave mode this isn't the case and the codec can detect + * the BCLK rate automatically. + */ + if (da7219->master & !da7219->tdm_en) { + frame_size = word_len * 2; + if (frame_size <= 32) + dai_bclks_per_wclk = DA7219_DAI_BCLKS_PER_WCLK_32; + else + dai_bclks_per_wclk = DA7219_DAI_BCLKS_PER_WCLK_64; + + snd_soc_component_update_bits(component, DA7219_DAI_CLK_MODE, + DA7219_DAI_BCLKS_PER_WCLK_MASK, + dai_bclks_per_wclk); + } + snd_soc_component_update_bits(component, DA7219_DAI_CTRL, DA7219_DAI_WORD_LENGTH_MASK | DA7219_DAI_CH_NUM_MASK, diff --git a/sound/soc/codecs/da7219.h b/sound/soc/codecs/da7219.h index 366cf46..018819c 100644 --- a/sound/soc/codecs/da7219.h +++ b/sound/soc/codecs/da7219.h @@ -830,6 +830,7 @@ struct da7219_priv { int clk_src; bool master; + bool tdm_en; bool alc_en; bool micbias_on_event; unsigned int mic_pga_delay; From patchwork Wed Feb 13 17:47:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Thomson X-Patchwork-Id: 10812095 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 81715922 for ; Thu, 14 Feb 2019 09:01:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EFAA2D58F for ; Thu, 14 Feb 2019 09:01:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 632FF2D5B9; Thu, 14 Feb 2019 09:01:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,FROM_WORDY, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B0722D5AA for ; Thu, 14 Feb 2019 09:01:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id F16EE267917; Thu, 14 Feb 2019 09:45:19 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 19B6F267917; Thu, 14 Feb 2019 09:45:17 +0100 (CET) Received: from mail1.bemta25.messagelabs.com (mail1.bemta25.messagelabs.com [195.245.230.66]) by alsa0.perex.cz (Postfix) with ESMTP id B8BF5267418 for ; Thu, 14 Feb 2019 09:45:13 +0100 (CET) Received: from [46.226.52.200] (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)) by server-2.bemta.az-b.eu-west-1.aws.symcld.net id C8/30-04268-89A256C5; Thu, 14 Feb 2019 08:45:12 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKKsWRWlGSWpSXmKPExsUS3ulwWHeGVmq MQetTHotTLXvYLa5cPMRkMfXhEzaLb1c6mCwu75rDZtG5q5/VYsP3tYwO7B4bPjexebRe+svm sXPWXXaPTas62Tz2vV3G5rF+y1UWj8+b5ALYo1gz85LyKxJYM37tMC2Yq1zxceFK9gbG7bJdj FwcQgLbGCVO/+pghnDWM0rc23WUtYuRE8ipkLh/5hKYzSuQKTHzVR87iM0p4C7x6exOdogaN4 mfB34wgdhsAhYSk088YAOxWQRUJS5/vAhmCwPVn9w2DWyOiEAXo8T5o94gy5gF5jNKbFt4FWq BoMTJmU9YQGxmAQmJgy9eMEMsMJA4vaARLC4hYC8x/f1VoDgHkK0v0XgsFiJsKPF91jeoEnOJ nTuWs6Eqx1Tz59RPZkw1yGxriesfZrFNYJSYheS6WUiuW8DItIrRIqkoMz2jJDcxM0fX0MBA1 9DQSNfQ0gKIzfQSq3ST9FJLdctTi0t0DfUSy4v1iitzk3NS9PJSSzYxAqM7peDYkR2Mp7vSDz FKcjApifIaX0yJEeJLyk+pzEgszogvKs1JLT7EKMPBoSTBq6uZGiMkWJSanlqRlpkDTDMwaQk OHiURXkGQNG9xQWJucWY6ROoUo6KUOO9lkIQASCKjNA+uDZbaLjHKSgnzMjIwMAjxFKQW5WaW oMq/YhTnYFQS5r2gDjSFJzOvBG76K6DFTECLn4qkgCwuSURISTUwMsww4Eh8FhP4Sb42YFHOt anNxlelSh403Ndc1BghsSyursDjStWkU3WbnzErhh94Pas/LyCY2Zjn8uMrO7t6bHnupi4raH SYuv/H3x0r2SSec09+epQzyvPA7r/G6tq8geGXKrZfEvTbU6RVNPn+y0UCzMc3i0xQ+n+v1/m 3W39/1ZyeSfUtSizFGYmGWsxFxYkAdOQ1n2gDAAA= X-Env-Sender: Adam.Thomson.Opensource@diasemi.com X-Msg-Ref: server-15.tower-288.messagelabs.com!1550133911!2392454!3 X-Originating-IP: [87.137.64.195] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.31.5; banners=-,-,- X-VirusChecked: Checked Received: (qmail 11715 invoked from network); 14 Feb 2019 08:45:12 -0000 Received: from unknown (HELO NB-EX-CASHUB01.diasemi.com) (87.137.64.195) by server-15.tower-288.messagelabs.com with AES128-SHA256 encrypted SMTP; 14 Feb 2019 08:45:12 -0000 Received: from SW-EX-CASHUB01.diasemi.com (10.20.16.141) by NB-EX-CASHUB01.diasemi.com (10.1.16.141) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 14 Feb 2019 09:45:11 +0100 Received: from swsrvapps-01.diasemi.com (10.20.28.141) by SW-EX-CASHUB01.diasemi.com (10.20.16.140) with Microsoft SMTP Server id 14.3.408.0; Wed, 13 Feb 2019 17:47:33 +0000 Received: by swsrvapps-01.diasemi.com (Postfix, from userid 22379) id A6E643FBBB; Wed, 13 Feb 2019 17:47:33 +0000 (GMT) Message-ID: In-Reply-To: References: From: Adam Thomson Date: Wed, 13 Feb 2019 17:47:33 +0000 To: Mark Brown , Liam Girdwood , Takashi Iwai , Jaroslav Kysela MIME-Version: 1.0 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-ServerInfo: sw-ex-cashub01.diasemi.com, 9 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 13/02/2019 16:08:00 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 14/02/2019 04:08:00 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-EXCLAIMER-MD-CONFIG: 8d172408-bd6a-42b1-8e53-daaedf35a5af Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Support Opensource , Akshu Agrawal Subject: [alsa-devel] [PATCH 2/2] ASoC: da7219: Update TDM usage to be more flexible X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The previous implementatation was restrictive with regards to BCLK rates for slave mode where the driver would not allow rates the codec couldn't provide itself as clock master. The codec is able to automatically determine and handle whatever rate is provided so this restriction isn't necessary for slave mode. The code was also flawed with regards to setting of the frame offset as using rx_mask to explicitly set the offset has the knock on effect of impacting the min and max channels for the codec, in soc_pcm_hw_params() through the call to soc_pcm_codec_params_fixup(). With this update, the driver now only limits frame size if codec is clock master, and dynamically determines the BCLK offset relating to WCLK using the tx_mask for slot offset along with the slot width provided. Signed-off-by: Adam Thomson --- sound/soc/codecs/da7219.c | 80 ++++++++++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 33 deletions(-) diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c index 7dbecf3..be606e3 100644 --- a/sound/soc/codecs/da7219.c +++ b/sound/soc/codecs/da7219.c @@ -1391,8 +1391,10 @@ static int da7219_set_dai_tdm_slot(struct snd_soc_dai *dai, { struct snd_soc_component *component = dai->component; struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); - u8 dai_bclks_per_wclk; - __le16 offset; + unsigned int ch_mask; + u8 dai_bclks_per_wclk, slot_offset; + u16 offset; + __le16 dai_offset; u32 frame_size; /* No channels enabled so disable TDM */ @@ -1405,51 +1407,63 @@ static int da7219_set_dai_tdm_slot(struct snd_soc_dai *dai, } /* Check we have valid slots */ - if (fls(tx_mask) > DA7219_DAI_TDM_MAX_SLOTS) { - dev_err(component->dev, "Invalid number of slots, max = %d\n", + slot_offset = ffs(tx_mask) - 1; + ch_mask = (tx_mask >> slot_offset); + if (fls(ch_mask) > DA7219_DAI_TDM_MAX_SLOTS) { + dev_err(component->dev, + "Invalid number of slots, max = %d\n", DA7219_DAI_TDM_MAX_SLOTS); return -EINVAL; } - /* Check we have a valid offset given */ - if (rx_mask > DA7219_DAI_OFFSET_MAX) { - dev_err(component->dev, "Invalid slot offset, max = %d\n", - DA7219_DAI_OFFSET_MAX); + /* + * Ensure we have a valid offset into the frame, based on slot width + * and slot offset of first slot we're interested in. + */ + offset = slot_offset * slot_width; + if (offset > DA7219_DAI_OFFSET_MAX) { + dev_err(component->dev, "Invalid frame offset %d\n", offset); return -EINVAL; } - /* Calculate & validate frame size based on slot info provided. */ - frame_size = slots * slot_width; - switch (frame_size) { - case 32: - dai_bclks_per_wclk = DA7219_DAI_BCLKS_PER_WCLK_32; - break; - case 64: - dai_bclks_per_wclk = DA7219_DAI_BCLKS_PER_WCLK_64; - break; - case 128: - dai_bclks_per_wclk = DA7219_DAI_BCLKS_PER_WCLK_128; - break; - case 256: - dai_bclks_per_wclk = DA7219_DAI_BCLKS_PER_WCLK_256; - break; - default: - dev_err(component->dev, "Invalid frame size %d\n", frame_size); - return -EINVAL; - } + /* + * If we're master, calculate & validate frame size based on slot info + * provided as we have a limited set of rates available. + */ + if (da7219->master) { + frame_size = slots * slot_width; + switch (frame_size) { + case 32: + dai_bclks_per_wclk = DA7219_DAI_BCLKS_PER_WCLK_32; + break; + case 64: + dai_bclks_per_wclk = DA7219_DAI_BCLKS_PER_WCLK_64; + break; + case 128: + dai_bclks_per_wclk = DA7219_DAI_BCLKS_PER_WCLK_128; + break; + case 256: + dai_bclks_per_wclk = DA7219_DAI_BCLKS_PER_WCLK_256; + break; + default: + dev_err(component->dev, "Invalid frame size %d\n", + frame_size); + return -EINVAL; + } - snd_soc_component_update_bits(component, DA7219_DAI_CLK_MODE, - DA7219_DAI_BCLKS_PER_WCLK_MASK, - dai_bclks_per_wclk); + snd_soc_component_update_bits(component, DA7219_DAI_CLK_MODE, + DA7219_DAI_BCLKS_PER_WCLK_MASK, + dai_bclks_per_wclk); + } - offset = cpu_to_le16(rx_mask); + dai_offset = cpu_to_le16(offset); regmap_bulk_write(da7219->regmap, DA7219_DAI_OFFSET_LOWER, - &offset, sizeof(offset)); + &dai_offset, sizeof(dai_offset)); snd_soc_component_update_bits(component, DA7219_DAI_TDM_CTRL, DA7219_DAI_TDM_CH_EN_MASK | DA7219_DAI_TDM_MODE_EN_MASK, - (tx_mask << DA7219_DAI_TDM_CH_EN_SHIFT) | + (ch_mask << DA7219_DAI_TDM_CH_EN_SHIFT) | DA7219_DAI_TDM_MODE_EN_MASK); da7219->tdm_en = true;