From patchwork Mon Sep 30 02:14:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 831956 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 66307CF6498 for ; Mon, 30 Sep 2024 02:16:53 +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 2D07C14FD; Mon, 30 Sep 2024 04:16:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2D07C14FD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1727662611; bh=dWJ9aiL0KPdEdwUWlUtMQzWpBBRw5tjhFlKXxKwqj90=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=UbKPC0F8Ubm4g8O05pAYAyAd4vg7IDwpE5C9psXQ0y4UkcGQRl/w75S4LXazAsCg1 PTXeXqd+1sOqhuueT5Ns7Zo7DWVMWqkTf7lOiE25+1/bMIpFtR9NVNMT51GdeTBMTE 7C13p4KbF0ujLSAg1/aLkKpy5wDcoR3eiqKKU6vo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 40A43F806E9; Mon, 30 Sep 2024 04:14:36 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id BEFB7F806ED; Mon, 30 Sep 2024 04:14:35 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BD97DF805AF; Mon, 30 Sep 2024 04:14:30 +0200 (CEST) Received: from OS0P286CU010.outbound.protection.outlook.com (mail-japanwestazlp170110001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c407::1]) (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 410BDF806A2 for ; Mon, 30 Sep 2024 04:14:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 410BDF806A2 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=EVqcHncG ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oxAMmiCY0gXeqcOMvnNwB7QmlekqKFmg8wKOckyp7qcCaUnMeEK70LiD50d69IbsIE9l3M3r5XxqVlM7n3EkiJ+DdgPmq3e6ywMqrNJzP/3Srqhf6hWO9Y0anoJiswUaTqFqcjxpLJ6W0l8xxKOnTEJ2KbNjbW+6TBnY8Fdju8eKvyOy0zrAUaGsph9kzsZfRoYAF0NOy70pxmBs3a3pYAqGtwuzzbqi41OEA88CAUitMZZAF7I+HKBLLcFdnz7/ij+y8+e98wx7K8DUUTwzp1yfdzu3yIEwuLJ0Pr9nlmzwpCv9WbdQSaFZIjAwxWst1aGcWgbZOhxEPHG+BT+YUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ipWWxJjMu/EVkBUzGA8d5t1ousLvweYqHA9t/geTqS8=; b=e1quLcm7Bx6H7lY0w8BgV/xBIQe5cvAFontL+FnaLZ1QbvZjAdcRTUSCxbr1WiQl4eX9V8Ies9bUoKHWwXK+nQkKkDOEYbd3vKSAOyuFIDxv4w1CD+7pwcv56edSEdPEJKlw3HAcKeR3T37In1I3umB8oPfSiOVgnu70wB6IuGUTi7N0EVCgqNaFgHOWORJibUquTs4fA6FiTxcpYeik4TfpXwQS8hH31TR0AwEAyaQGmyuIDZhBVbrjSPI1JCUuMxK2P4zKzGuR0RQKuG6nGxVvtYaGmWbOfYsRZWHellPnqiWuuuZ3rPPXEdTR5hs5VTnTgU4AD6V6YEx1WnSAMA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ipWWxJjMu/EVkBUzGA8d5t1ousLvweYqHA9t/geTqS8=; b=EVqcHncGO1bQd8JGDGS0r4KU1H0SzV7H5iyJd+Qp5qbvS7w9gamCAIXNiOyX5Kxv1nBTAYu6jVvikDeGaEwtIsJVEs+7dWS+NdoT/vURI3V5MSwjvB3ZzyMJxkw66JBiD6CSPpkThvp7xfEuytWlKqA2zV71MW7KC4yF8M+Fc6k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by OS3PR01MB5798.jpnprd01.prod.outlook.com (2603:1096:604:c3::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.26; Mon, 30 Sep 2024 02:14:23 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.8005.024; Mon, 30 Sep 2024 02:14:23 +0000 Message-ID: <87frphlwg0.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 08/13] ASoC: soc-compress: remove dpcm_xxx flags User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org In-Reply-To: <87r091lwhg.wl-kuninori.morimoto.gx@renesas.com> References: <87r091lwhg.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 30 Sep 2024 02:14:23 +0000 X-ClientProxiedBy: TYAPR01CA0183.jpnprd01.prod.outlook.com (2603:1096:404:ba::27) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB5798:EE_ X-MS-Office365-Filtering-Correlation-Id: c941dc0c-bd24-487f-4983-08dce0f599ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: 2rTs2LJOglhJRWbbOa87zeJWXCXv5ogbqRM/V9RgvQphI0PiQne5MGvAEaQu51+7myemEx4FDr1inVLnbPJ1VEao5MwIE0xPYrHxCk4Jkv9fS/3ZFyOhmcC4GAn8t0v9/BpqNgcMED7Ovcwqv1UMEnt9+bshrRy+OaB4BuELo0L258+rePa7N02ppb65vHg0fTeIQ65BcI2x33CXO4oHqhnhOWBuwreJKoCh8K2JWz0qhw/9nCkG7Vfo8mLrVSqM7WvVNUttXZ7unmBAEk60slcOK2m8DQAA9vR8N1iTKr3Zb7B9UCW2m5PIQ4W2mDmFhxf1mvrpTP8IT4siY65gU6zne1o1ClEJBgm29wajnmSwXN8WLa12ycChXttf90QCJitvu8+iTStFXG6ox8rt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LI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SKLYjVkAlj73BLEcvWm/G9R98cj/Rt5O0pbBge4x2ec5FzkVnPmthFHmIk5vcGQyrnslMT88gJ3IbliogaQYFF6apIh2G3BGxhyvB2R5BTYSZkKS8BmF64Ncr+SKCWoTsLYYEQJRLEp2ot3OxCnQXop6uHp57eCSjN0DUdcIK6pAIzQcX1B1WKGCZ02ndkjTOrScFzNqB+0MY7n1P7ppxEksmEJbMMAWdiorKx2TUieaCbxUDK768HJkkjKjdp4V9d26xxLmQ287NcHesViRGVLs1q+9mx1HBIuz7d5Y2QQzyVZpfgHvUtyi4l5Jw5JRZl0VetZPNevzrlosqToEl6bNR+MdT6o/cn6+wdKQbNc72xOzodxR48RTHGorAGcxQBKMMXyY+r912/cxCnArgJXHl5MgxsPvZJUfhHyS7IsHneyWXPiFcuRzb8GAaN3vyDxSngp3EFVtBwPvRHVrcq9SF97G9Ef0Hwx3XPFZhXUxHPa0mV3WLaZfX2tPMgUOamZAPPgE+03W6jbY2rTv8NQRDUNyOnC04FVerf6s18UXCsqqBqZGiFl3rou7w0oZYBUrLfH2eP95QM/XGB4UIbVDk+8dnY5SQ8pwHRSorQesCx2d+TLSBwlU5Q/7OWmpHVLjGmFkPSI4TM3PertXCLimVxj0DslAaPA/cdCIfJMQCLgq+isDDX0Vpj0A0Wl/grrH97hvVA2T051OOCNeZuIZlX3vff2d8UIezQTdxDPwpDi6VPfALjn7gtjAnxoxRaTjExweda0m87hdkXKEHeBCOFhyrBATy1Ou61HAoDZ3ZpVIX1VLfirQtB6QZaLGRY1LGL9PxyAGglDSWnWkUSqFlf1+URAcut+Gsmi72WvvbRHh50WbcO8FoXTQMFQuodhYQhCSSz2vXJdSBhACkbt7ajQjTRXlxVDnrIN5XhfGo3HzEy1MjEx7Z9ShbAdXxjc/xqgQQRkdt6y/OAm9zk9Fk4RFJKdlmPB7yDKqma8FOO50rXIcYv0Oo4swdGZATpJtq9zR+Ajc0b/ItJ2+y0/41AuYwCgD50EVMmSdPN1+5FqpXSNGCskNp7LeKqUsbXPin+fJT1NFMBLp1FUjnBgWUN4uODu8Ov/Zsqkb6OnMRyT9/1yGTncaMQPPjvEnSDak50zjgli5E6kLVukZAMi8Jx3b/9ibotHOvvcjNZzuulFl9nUwrzsCTT1V2Fjr7aGswWTRFvlX0xQwaLDyFc1CMXBUjjdFZYpRNRDsDPRfMkhGWSKMKWBpAuLxlWkPYYV9tV8Net1/zwFawSBqiec89B6ZXZ5KFPqh92y93iyAb+WnkNyW2TKZVfO1vmq6BZHBC6eXJ8Z9qSggq9nQuobTbkR/w5MJbbJdeeB0O1W74Xpkp5gq2sdlq8jNLNj+EhionFwtTZWfyfAfIdZWQ1TlFdmI1ruqDnIiauoUSzlxhxDBco71iU08Os0FxGoG1QPmDYBL8U9oSgSRjxTlzeKFdPBbg360ruwjzy11/wyBF3iDKyiS7t1fl1woZS3pMa2Tu8AMmRwdNfJpmsUKQ2FuKXnc9s1dwwSX3OuLpev0gKNa0U+XzhdReRCLlnEWsWZcka/QSmTjT+Wko/SHJAmir2j8/TZ4ozt/xX/touo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: c941dc0c-bd24-487f-4983-08dce0f599ee X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 02:14:23.4739 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fQouuIo0/RBZZstcJ3SrTxjU9usiQS/FKjoag7DccP+BiukAIL/PmWoH9Oxofg75wcDXYSdwvFBUZGZRbBc2kkEUtur1yvjabLy4UiClURRTJLel5hHBshF/oHPhmZwG X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB5798 Message-ID-Hash: KZQ52IO4G7F2YIJD7KS3NNMUAMMBJABI X-Message-ID-Hash: KZQ52IO4G7F2YIJD7KS3NNMUAMMBJABI X-MailFrom: kuninori.morimoto.gx@renesas.com 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; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 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: dpcm_xxx flags are no longer needed. It converts dpcm_xxx flag to xxx_only if needed. Signed-off-by: Kuninori Morimoto --- sound/soc/soc-compress.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index e692aa3b8b22f..a0c55246f424b 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c @@ -606,12 +606,19 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num) return -ENOMEM; if (rtd->dai_link->dynamic) { + int playback = 1; + int capture = 1; + + if (rtd->dai_link->capture_only) + playback = 0; + if (rtd->dai_link->playback_only) + capture = 0; + snprintf(new_name, sizeof(new_name), "(%s)", rtd->dai_link->stream_name); ret = snd_pcm_new_internal(rtd->card->snd_card, new_name, num, - rtd->dai_link->dpcm_playback, - rtd->dai_link->dpcm_capture, &be_pcm); + playback, capture, &be_pcm); if (ret < 0) { dev_err(rtd->card->dev, "Compress ASoC: can't create compressed for %s: %d\n", @@ -624,9 +631,9 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num) rtd->pcm = be_pcm; rtd->fe_compr = 1; - if (rtd->dai_link->dpcm_playback) + if (playback) be_pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->private_data = rtd; - if (rtd->dai_link->dpcm_capture) + if (capture) be_pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->private_data = rtd; memcpy(compr->ops, &soc_compr_dyn_ops, sizeof(soc_compr_dyn_ops)); } else {