From patchwork Mon Mar 25 04:37:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13601186 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 95708C54E64 for ; Mon, 25 Mar 2024 04:46:06 +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 9CE5614E8; Mon, 25 Mar 2024 05:45:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9CE5614E8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1711341964; bh=YgTWv1vhfUdk2t+lbs/HS8Ry7stgMNoX6aOctFEpjRk=; h=To:In-Reply-To:References:From:Subject:Date:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From; b=EqMn9y4y2bb/wyvd2RLHqQHOFImbr1QSiYqyDgiqQsLYycYkF55byCo5d4mjx5cC9 t5dwMvnV2n0W2FBUrhovc/Vg4Fw/naWyax0TzxoMQ9sIgAmPZJU/iWefr9KtDLHjg6 m5mlpEe02fQQZZF4H3y3kFQcCAQZr3FrVbDQKVsU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 268A5F80736; Mon, 25 Mar 2024 05:43:24 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id C0DC5F806F8; Mon, 25 Mar 2024 05:43:23 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id ECB7CF8025F; Mon, 25 Mar 2024 05:37:37 +0100 (CET) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20600.outbound.protection.outlook.com [IPv6:2a01:111:f403:2019::600]) (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 5FC45F801EB for ; Mon, 25 Mar 2024 05:37:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5FC45F801EB 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=ijjNNvgJ ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N0X7PUZxYZWiHEh0nTrusStXCMX2Vt8Jv4pDPq/8EXLyWwIRZTn9Y2gt9bPxTOZI0uqqPd6P7rhauIHu0UcIV8rT2TMjWCTYAgPcTnEGl0av9DlkKyZfR+g5yAorTql970xo7FY7G1/WRMIi2jd23fsLZFsDCa1fKp5NrQqJhanydig3rMUITczaav4tpCYo8CUCtl3gjwy6zTiOe58M80G9cTuCGd3nJT2+XirB4omfOt5cv2uPkJwmug0qm0xO3eVuOMwZnzLIbRJhFVt4xX5oL2jRoSDXUoN98Of6TABLowgjutc3i9T7QboQYAQOwPIT7ZwmTiH4F8lpVBxChQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=JqhqoTJF+tm8QauwvluMseFaT1V2WJovxDaDwefjuKM=; b=D8InueaadLc2YSQ5UWW9o/84bE+sLDoAfO558htsjwvItvjVMp+xTmIeAQSMMogu6/1NDl2w/3w3xZA17mwUQxW6A1VKnpPw0dKCPFA+rD0rZ9hgNTC5Q8EH7n0ah1pU9vYzoQx/HAW322u6b6f3KA3ZG1sT/Q3QA+K5Cq16jAxOig3ynnXzgEespCNeL3XQVFmOdPeqF1a/kk5P0w+AC2KWR0KskXZx0rzahYivP2DzsEDi0F0+l8orfum1yGgJqd/XBYHzviXD48FDpb2YmFkTKZIomEIMxeyvGNvqRhd0y5pGU1KH3lHF8dHk1RlR9jRY267kx2XGPO8CVIhhXw== 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=JqhqoTJF+tm8QauwvluMseFaT1V2WJovxDaDwefjuKM=; b=ijjNNvgJ9g+x9o/E8mqCTG58MU5ZdyK/heqr/c8xgIBX11odYZd95oa0LSWddCfl65tyVtqWn4c+qxbevFWHXTl/xdicAdpgQDnC2Qb4jOe5eHGLFvV80n2ScGXOmUkk+EvWGYQa/Xn0Pib7KPr73S4hpwSZ2mNks5pnmoG9SAk= 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 OS3PR01MB9512.jpnprd01.prod.outlook.com (2603:1096:604:1cb::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.31; Mon, 25 Mar 2024 04:37:25 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b%7]) with mapi id 15.20.7386.025; Mon, 25 Mar 2024 04:37:25 +0000 Message-ID: <877chr53lp.wl-kuninori.morimoto.gx@renesas.com> To: =?iso-8859-2?q?=22Amadeusz_S=B3awi=F1ski=22?= , Alper Nebi Yasak , AngeloGioacchino Del Regno , Banajit Goswami , Bard Liao , Brent Lu , Cezary Rojewski , Cristian Ciocaltea , Daniel Baluta , Hans de Goede , Jaroslav Kysela , Jerome Brunet , Kai Vehmanen , Kevin Hilman , Liam Girdwood , Linus Walleij , Mark Brown , Maso Huang , Matthias Brugger , Neil Armstrong , Peter Ujfalusi , Pierre-Louis Bossart , Ranjani Sridharan , Sascha Hauer , Shawn Guo , Shengjiu Wang , Srinivas Kandagatla , Sylwester Nawrocki , Takashi Iwai , Trevor Wu , Vinod Koul , Xiubo Li , alsa-devel@alsa-project.org, imx@lists.linux.dev, linux-sound@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com In-Reply-To: <87o7b353of.wl-kuninori.morimoto.gx@renesas.com> References: <87o7b353of.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 12/15] ASoC: soc-compress.c: replace dpcm_playback/capture to playback/capture_only Date: Mon, 25 Mar 2024 04:37:22 +0000 X-ClientProxiedBy: TYCP286CA0250.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:456::14) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB9512:EE_ X-MS-Office365-Filtering-Correlation-Id: 300176f3-b0db-4779-3972-08dc4c8543f9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OPTnwteUuR96Ga5YtVAYPInSH7Z0IJz/2MOAOpVXbmNEp19e+QVwfjgTmMG49fZWiont/GomAZ5EO7tIRxySv022OtO3XqE7+MlooxGvelzAMXGqqYJ8RYaFGgo0FcN+U585oVwzHfuLUsYwT0dfu5xMGWEESUJlsF2AXgZue3zZ0/j2+nQLc36uijNrfWt2g3aHHYKjqjSj3oKFSppqlk+u1mMEzG9duvH/ZgNF0xsKM/EHYAE9XvFZfvYbnzykVoonTHK//bjVChy6I5jrYgV/YQx2s0UcUV8aHw4iwY4/Z2ZfQ9C7jIY0ck1FICPjKLD8In0pflzrr4caCjgvur1xtRzGJrZ6pyd/A9EioYKahh2vHK+gtDtRF1iUe+zeQvrfLMAVk1//xLKRaXodprOkCJ2IUdN/3o40IJdxoa5p9Vic4OrFpU4wv9qzz7ZKQc7DO1a1JRg125Oirhl/Nk8QAVTqBgNKOiW1Flf8ewGxSVgMcII6PWATdryVyutq1WNlzloJDgrHDiBd3pNo+nMK2874ltFxRoCa5Ur5n54Oo8MMZAUinDkCl6HU4nhev88vhOfQd9kdrcSTU1VZ/sJPpj3LvavpvJ1iZaEmsGzPg+3Zl5TDzwWnvaMBOyPMW8vpzD0TzAN8waaSRJfeAp/+Mq/jvjivREcn+/E6sDnBn5RSGh/csFNnYsJiikzHx6Vtr9+IkBZlw2nSfn3v9LHueTa4gmL9SCy2Kpng91E= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(52116005)(1800799015)(376005)(366007)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-2?q?MaXZyzbNPaU9U0qXeC9f9bK?= =?iso-8859-2?q?QkdEvRltWMDiztwZXr8u5DgdKC3W6TBMA1H/P8Mokwy6Hy54EWXF5kHPAarM?= =?iso-8859-2?q?CEj2Qx+UPoYrxi4r6uIvJ4DjReh0KGbNX3kEZ4w81PAB7IA1RhSBgTL4R8xL?= =?iso-8859-2?q?L06XT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343EjP5gdQ7vhQZMhw6lV+?= =?iso-8859-2?q?H+GxHx4jza5ODoWtB96xLMgpfIOX44hv2vkQlv4ZFaslymGmE99gto1DxGK7?= =?iso-8859-2?q?rafrR02Cpbv/akeJpcoKibWTQPAVlhJWQbOap8InX6187MncCvjb45lQxKXK?= =?iso-8859-2?q?jD69V+MFuN3vWKKgmgsS9fIAllvwdTLv9NVDEgCDv3JWs2bkvqW7H97xHiFu?= =?iso-8859-2?q?x1ltSD8lbR9hSB7chPL7daR0w6kpuTi3BfYi9yb95WHfuPPmR/KBYZ40HiZB?= =?iso-8859-2?q?Zr0Rqz0YoKWBRP342fdPoZenYGTe3v++Ihcy077uOcw8C46EVd8hdrSv+QXp?= =?iso-8859-2?q?1FdaFCM8v3E0O7+vnsIjX9Gd8lYit0iTXAq4psHbEUkEwargRrR4Q0s0dlmS?= =?iso-8859-2?q?8EfPzz1UXgtJ6vmPb7RxTbxKjxseF06hQhsysjNtF96RiqaXwJ4f+qkEASsJ?= =?iso-8859-2?q?wst8RGDEinGY9zuO3uP69IfWj/UGsoaXWqLdBs1Xm0x/sIXOIPOHYqG/AHPr?= =?iso-8859-2?q?mKJt+/T+bhSVw+HIDMG0+FZUHDzaIYLJGulBVlaPREn06lZCp7gfWqkqPUxV?= =?iso-8859-2?q?9hFkVb+QEZTlG5Ycqhoqf5Wn5pezvHKoF+MRFshJzy0qFcVx49558RwbWfx4?= =?iso-8859-2?q?=3D?= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 300176f3-b0db-4779-3972-08dc4c8543f9 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2024 04:37:23.5398 (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: ruCK4JHHMX82dRTo47l4ddcj0W6liJs0XTvPxEC6AjYsFs6KgFUAMzqeFOUY4/3dfi0bWQwXT9DITTFpfAVt5PzEKtRRZn4DGeBftNWUzh9/Rt+R0x1mfHeTEXV/9XSf X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9512 Message-ID-Hash: NSVV2OYS5CVVNI2NTDEB7UCUKACGWIUT X-Message-ID-Hash: NSVV2OYS5CVVNI2NTDEB7UCUKACGWIUT 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: soc_get_playback_capture() is now handling DPCM and normal comprehensively for playback/capture stream. We can use playback/capture_only flag instead of using dpcm_playback/capture. This patch replace these. Signed-off-by: Kuninori Morimoto Reviewed-by: Amadeusz Sławiński --- sound/soc/soc-compress.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index e692aa3b8b22..b861c2bc62e4 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c @@ -606,12 +606,14 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num) return -ENOMEM; if (rtd->dai_link->dynamic) { + int playback = !rtd->dai_link->capture_only; + int capture = !rtd->dai_link->playback_only; + 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 +626,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 {