From patchwork Thu Jul 25 10:22:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 11058493 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 4627913A0 for ; Thu, 25 Jul 2019 10:23:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30FC928971 for ; Thu, 25 Jul 2019 10:23:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 240F128978; Thu, 25 Jul 2019 10:23:32 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0413828971 for ; Thu, 25 Jul 2019 10:23:30 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DAC071AC7; Thu, 25 Jul 2019 12:22:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DAC071AC7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1564050208; bh=bSPinfBvu4BbZ7UNiMrlOHL73dDFRSKEFi+DQ5jbrmY=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=rUfa3qkgPZ/NsTAomqSwqmixCs/VkN6/T6twL/KsOg/3PNjOAcRZm44DChJ8dQveE mdtqkYVw3TLwe3GcuSdUAUmd/WqWI9nnRi5wvPXfnLXq/TlK/cHkfk0EOunBq6hFR+ GlBlzzWaAtF7nnZ6iaAD0VIZVsgcEGUmvR6b61R4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 61017F80392; Thu, 25 Jul 2019 12:22:38 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id A5C1EF803D0; Thu, 25 Jul 2019 12:22:36 +0200 (CEST) Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C4F89F8015A for ; Thu, 25 Jul 2019 12:22:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C4F89F8015A Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="ghq/2OBS" Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x6PAMTcC029804; Thu, 25 Jul 2019 05:22:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1564050149; bh=vsxGJSq6Q1NuCBoWhzjiA+1ThQ4/lUXE9hS+/sJtOM8=; h=From:To:CC:Subject:Date; b=ghq/2OBSSvdCKurgXkazr1GGkrmNRJLyEvJCgxynQ5WkaspSxN9UbLjnjxw7wDrxV R2mL0qFpxNsaccynHu7jE2t66oZubaGWQuy+lh655M9LKS63I/p7WhE+xveju1lwmq dv0SwKRx/NMkGnXyZ50b1EVwXDOgL7JgHP/gsd4U= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x6PAMTXR077471 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 25 Jul 2019 05:22:29 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Thu, 25 Jul 2019 05:22:29 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Thu, 25 Jul 2019 05:22:29 -0500 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x6PAMQPG110383; Thu, 25 Jul 2019 05:22:27 -0500 From: Peter Ujfalusi To: , Date: Thu, 25 Jul 2019 13:22:26 +0300 Message-ID: <20190725102226.781-1-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: alsa-devel@alsa-project.org, tiwai@suse.com Subject: [alsa-devel] [PATCH] ASoC: soc-pcm: Use format size instead physical for sample_bits symmetry X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP For DAIs the format size in bits matters when it comes to symmetry. The physical width is the in-memory format size which matters mostly for the platform drivers. If for example a DAI requests symmetric_samplebits and the first stream is using S24_LE then the second stream would not be allowed to use S24_3LE despite both S24_LE and S24_3LE would need the same clocking on the bus. But S32_LE would be allowed (S24_LE and S32_LE is both physically 32 bits in memory) which would not be compatible with S24_LE on the bus. Signed-off-by: Peter Ujfalusi --- sound/soc/soc-pcm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 1406f935af22..c70722dc1f4f 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -243,7 +243,7 @@ static int soc_pcm_params_symmetry(struct snd_pcm_substream *substream, rate = params_rate(params); channels = params_channels(params); - sample_bits = snd_pcm_format_physical_width(params_format(params)); + sample_bits = snd_pcm_format_width(params_format(params)); /* reject unmatched parameters when applying symmetry */ symmetry = cpu_dai->driver->symmetric_rates || @@ -932,7 +932,7 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, codec_dai->rate = params_rate(&codec_params); codec_dai->channels = params_channels(&codec_params); - codec_dai->sample_bits = snd_pcm_format_physical_width( + codec_dai->sample_bits = snd_pcm_format_width( params_format(&codec_params)); snd_soc_dapm_update_dai(substream, &codec_params, codec_dai); @@ -945,8 +945,7 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, /* store the parameters for each DAIs */ cpu_dai->rate = params_rate(params); cpu_dai->channels = params_channels(params); - cpu_dai->sample_bits = - snd_pcm_format_physical_width(params_format(params)); + cpu_dai->sample_bits = snd_pcm_format_width(params_format(params)); snd_soc_dapm_update_dai(substream, params, cpu_dai);