From patchwork Thu Mar 30 08:30:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Abildgaard Svendsen X-Patchwork-Id: 13194513 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E34CAC761A6 for ; Thu, 30 Mar 2023 16:07:45 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E19DB741; Thu, 30 Mar 2023 18:06:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E19DB741 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1680192464; bh=mOGiNDWe3jmTokxzQ/ChGf3fEw1r3TCQLdUkdHgqAU4=; h=To:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From:Reply-To:Cc:From; b=Ypkf2x6j2AQ3Y0EDdyLMu1sUrxlmD4G0ZSWp0TJvgc9SAcVcx9eR07U0VXUwQVSFq 0xLX65JSs2/fkJIR9FuAIaf2qd4N8N3RpJYUBv1HsJrE/wxQAfV7W962X8MheTrnSC 9/tmEpNw1p04SSjBblBSsL9nAG7CWO3XD5EIterQ= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id D8C44F8052E; Thu, 30 Mar 2023 18:06:35 +0200 (CEST) To: Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Subject: [PATCH] ASoC: fsl_sai: Use physical format width Date: Thu, 30 Mar 2023 08:30:55 +0000 X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 X-Mailman-Approved-At: Thu, 30 Mar 2023 16:06:32 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <168019239506.26.13518757920586712702@mailman-core.alsa-project.org> X-Patchwork-Original-From: Emil Abildgaard Svendsen via Alsa-devel From: Emil Abildgaard Svendsen Reply-To: Emil Abildgaard Svendsen Cc: Emil Abildgaard Svendsen , "alsa-devel@alsa-project.org" , "linuxppc-dev@lists.ozlabs.org" Content-Disposition: inline Slot width should follow the physical width of the format instead of the data width. This is needed for formats like SNDRV_PCM_FMTBIT_S24_LE where physical width is 32 and data width is 24. By using the physical width, data won't get misaligned. Signed-off-by: Emil Svendsen --- sound/soc/fsl/fsl_sai.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 939c6bdd22c4..213e2d462076 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -519,13 +519,13 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream, unsigned int channels = params_channels(params); struct snd_dmaengine_dai_dma_data *dma_params; struct fsl_sai_dl_cfg *dl_cfg = sai->dl_cfg; + u32 slot_width = params_physical_width(params); u32 word_width = params_width(params); int trce_mask = 0, dl_cfg_idx = 0; int dl_cfg_cnt = sai->dl_cfg_cnt; u32 dl_type = FSL_SAI_DL_I2S; u32 val_cr4 = 0, val_cr5 = 0; u32 slots = (channels == 1) ? 2 : channels; - u32 slot_width = word_width; int adir = tx ? RX : TX; u32 pins, bclk; u32 watermark;