From patchwork Mon May 29 01:03:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13257969 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 1AC25C7EE23 for ; Mon, 29 May 2023 01:05:28 +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 9F6F484B; Mon, 29 May 2023 03:04:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9F6F484B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1685322325; bh=eXkDvqezi7ERAGj77f83+BFDRaBmKx1vpn1imIQSQqc=; h=From:To:Cc:In-Reply-To:References:Subject:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=rw7Nnf0XqHx0p00YTJm2Bh8ZoJcrV7gmwN4qRw/kPh6Wf9AB0MwlcRq01lMEU0fjO +84moq0FIp4PsJDsuIUvOxiC29Sa5O981m96wfaumWjHOr5kZiGfnhs+GiKDnk7tUQ HRY40FYpX+2Kjw5vWeQJevYGshG8hMqpH87FGOKg= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 11CE7F805AF; Mon, 29 May 2023 03:03:30 +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 84C7EF805BB; Mon, 29 May 2023 03:03:29 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4DACEF805AF; Mon, 29 May 2023 03:03:25 +0200 (CEST) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20703.outbound.protection.outlook.com [IPv6:2a01:111:f403:7010::703]) (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 9A85FF805AC for ; Mon, 29 May 2023 03:03:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9A85FF805AC 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=P/KZqW+N ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kZVYB+LD8FogeG051oPyGJoTwRoiQwED2YDOIiAiAVgIKolZK3FpYN4SQsvVGTqEa0/k0uQCHi1m8D29bbuvOkj66DkqFi8/WSGLfOKR/Mb/XYdp9cJFvYc2P8LQ7eP7hzA/hC9TDKbBMYaxDcz1H7rYlwNk1IML8C7X2BPcdEE4LB83wWX/qth/8pnFCK019t3c22Z8P81+1FVm5arjSMgWZr3Zmb3XNrTzB9PSPlxW6+bvM/mAiGa8CvzhIQI6EhDnuZJ1Wwc9RwPDaLbonOrfwmm2wtc8BvnQiri3/QogDq/eayDa3Lksvu6OikC6wC1sE2YjulSXDZVvoMT5/w== 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=URYLGPDTAxi+1oEIac+j4tw5WMwXWhid+7elBPBpCKA=; b=W/S6GX7RLBgT/Uea01q0xxXOb/IEGA3/1i6Yk5+1qP6s972aWoyMRkgEQJA6In90UwWv0/n6ONPxdR7zxTJ0hgBVlMPUpGC0y5nsZvCSOLGTK6j2uADPFWRuYjP36y7Xs7yzBFk9F8my5IG+N/Ul/zpX41nlkoj5eSlTGl3sZ+OLEThWDDVXT3olBxT5mr4FZ/4RuaRjc+zntqbHRdzO422WKGyzUWqu1abIJV29O4RKjfIPV+fS7k2kylM9uQLER3NqJR4V/D9BwvMgV1imTYuxoL2wrbgtPjFgjJ73o+hFDJ2sEBHefmmMmQMW0drm/TchJOp+KN7ONHV8HWAUZw== 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=URYLGPDTAxi+1oEIac+j4tw5WMwXWhid+7elBPBpCKA=; b=P/KZqW+NoYzsbzGh+XeteRZkqhtRr2RIWRNRHc4y/6pKHSQhghLpsfO6W2g8erPgYBtgUb3FoA22wofDd1CyOZcpYBy2gaLX8HyYYlWqXTnSgsdw2ZoZGi/woVYLJHWrzDubx8qyLumrm5k6hFCUWmhYH0f3XohsINOqXLY3JPY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYCPR01MB8658.jpnprd01.prod.outlook.com (2603:1096:400:15e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.22; Mon, 29 May 2023 01:03:20 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::91e7:a94f:9f75:d840]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::91e7:a94f:9f75:d840%7]) with mapi id 15.20.6433.022; Mon, 29 May 2023 01:03:20 +0000 Message-ID: <87h6rwlzjc.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Jaroslav Kysela , Liam Girdwood , Mark Brown , Takashi Iwai Cc: alsa-devel@alsa-project.org In-Reply-To: <87o7m4lzl3.wl-kuninori.morimoto.gx@renesas.com> References: <87o7m4lzl3.wl-kuninori.morimoto.gx@renesas.com> Subject: [PATCH v3 05/21] ASoC: soc-pcm.c: tidyup playback/capture_only at soc_get_playback_capture() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 Date: Mon, 29 May 2023 01:03:20 +0000 X-ClientProxiedBy: TY2PR0101CA0033.apcprd01.prod.exchangelabs.com (2603:1096:404:8000::19) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYCPR01MB8658:EE_ X-MS-Office365-Filtering-Correlation-Id: d5b0aec7-13d7-4cb9-974f-08db5fe07e8e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rlHbQuhHKyda6O2YG5Cs+GKdmNRtSfKmJOroFjs76Ajm3JXCofqfKCtJ33BQPpZ2ArWnAzAiFF8Ls6MWSTjw+7BZLmmrj+SeBrIbKeHvdQX3eSgndOecLwloVfHKk+yNjCk68EuWXuhvYNU1DAKUNqD+lr7PEybYn1qIqJVHIc0VccBgixlGoIrhJsIl3meNnSmLqf2HMYm+bLFzfCQnnfxRINMYoQ89GzPtzM2YEcHAYutjc3gziQ6No9drJ89z1/aJdMqLd+1mYgwgoOcVSlgOjXzNDluCPzbkV36rwyjwa7pnynVwvsIR5hNF0BSELXIVm2DxNO33sQs4E2CA7NbZC11GCNHUHx6ZWxKyQ/NwQ+1EQRk+0gohEt1WhH/Rq77eB/GdEyf3WAr9p0qlyryuXCvNI52eG8ez+ueT18AdEovRFzA0IW65LjW8UIEoAUIAnzzLEzsNx98mXA4AztTLDhOxhPkp/tDCP33uSunNEVnF2FM2Nb7B8yFnsbasyjK6scFUNrcRNC75YmdMjb1AVEPAOTuP3l2jUbd/yiGPb3wkiYl+Ap3J/j8lqV67ltmOdqMX6aLvCQ03EjZObAgFr3e27AwsWPYX8tvZbxgTqTAEwF14pdJjvNQHaew9 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB8426.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(136003)(39860400002)(346002)(376002)(396003)(451199021)(26005)(38350700002)(38100700002)(41300700001)(52116002)(6486002)(83380400001)(186003)(6512007)(6506007)(2616005)(478600001)(110136005)(66946007)(66556008)(66476007)(4326008)(316002)(2906002)(5660300002)(8676002)(8936002)(86362001)(36756003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-2?q?2mbrNZw/Te31FBZkisVmHnx?= =?iso-8859-2?q?PD3zIBKNGp+RNRx4CudipefSDYwfajl2PagQjhctGrkIDMKPOhHeU3cA11nt?= =?iso-8859-2?q?Whr4GcvE3Rk86Kz1J0kU7BR52cVlYJjsdpG7GLjp73coQIRLnsq1O+s+1WCH?= =?iso-8859-2?q?liqtYylfrFjG9YlN5RhQlHvErD7Wq9VSiXEXQZz1dwEhg72c3S3rAlnQvya8?= =?iso-8859-2?q?38CzGA+AEKiasq+Xwjzz3/Vo44i4VVkAV6ZAlCmXTL1JUa2ZQN8RVazCz1bg?= =?iso-8859-2?q?IRojnt46hcOtArHFWxTNL/e0djtKWYw2A4EdcA8jTYzyYSJrj8pQOBSQGT5R?= =?iso-8859-2?q?X5XmdbmXFai2/qzk1J8XRfGbt/Ynq2q+PQuuswmquqTDzxhGm8EtPNW/MlIn?= =?iso-8859-2?q?R/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h78/0KKHHkhl3Z2QtuFmnN02mKjR0V71Q2M?= =?iso-8859-2?q?p9v/HTzHFA33w7ec0A5bCwnDWmvXDW5TGGwQh8XPxWFQxMS6Zzr1by531tE9?= =?iso-8859-2?q?4rvuZaRA8x9UQjNcizRa2SyOTESNlo2DQ0DwNEVFcqBUTzYcCXnXuXgxcKwn?= =?iso-8859-2?q?36o/EhfSTbcPnKKE0sJLp7zW4VRu1esNd31ANsYRmBuntdB+fWxl387tX2jp?= =?iso-8859-2?q?ik/NQWX0n5ryrBcRunAP+RJYSXPGRahdNugho9nl6THCGjXtxAQUBwrrn0WU?= =?iso-8859-2?q?5e8xwCFRNvXFGl9iOwCnlFVC9rdYuAbBzgD+pUIMFA+D8VVqvLSsygbj78dR?= =?iso-8859-2?q?r3LDwH2jFWYWrllt3tv1hzwZe5PfTWTW2KiW0zEJlVh5aocsYJ1vScrX7E2k?= =?iso-8859-2?q?=3D?= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5b0aec7-13d7-4cb9-974f-08db5fe07e8e X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2023 01:03:20.4573 (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: ryCOhfug59GI5B3rwKssUCvPNn1aQBj9KdO0Lmc7J3jofE6Er3bip8l9cYxf2pZeOpyrdyJaLDuYTxdV6Tgj2UETebPdBvFYumw/Btuik8mh1uCsjbvTZAHMEpeJESwq X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB8658 Message-ID-Hash: ZQYJBJANFHDNRRMH3BTCMYRT2N7NEVQ4 X-Message-ID-Hash: ZQYJBJANFHDNRRMH3BTCMYRT2N7NEVQ4 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.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: soc_get_playback_capture() (A) returns number of substreams for playback/capture, and then, we can use playback/capture_only flag (X)(Y). (A) static int soc_get_playback_capture(...) { ... (X) if (dai_link->playback_only) { (*) *playback = 1; *capture = 0; } (Y) if (dai_link->capture_only) { *playback = 0; (*) *capture = 1; } ... } But this flag should not have effect to opposite side stream (*). This patch tidyup it. Signed-off-by: Kuninori Morimoto Reviewed-by: Amadeusz Sławiński --- sound/soc/soc-pcm.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index b3d569e7ba61..159670612de3 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2807,15 +2807,11 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, } } - if (dai_link->playback_only) { - has_playback = 1; + if (dai_link->playback_only) has_capture = 0; - } - if (dai_link->capture_only) { + if (dai_link->capture_only) has_playback = 0; - has_capture = 1; - } if (!has_playback && !has_capture) { dev_err(rtd->dev, "substream %s has no playback, no capture\n",