From patchwork Wed Jul 24 01:59:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 814181 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 D0FB1C3DA63 for ; Wed, 24 Jul 2024 02:17:01 +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 15E5ADFA; Wed, 24 Jul 2024 04:16:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 15E5ADFA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1721787420; bh=zn771/moilrXhpUqmxmwLeqqx4kEy6PBopJtNZ9ph3w=; 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=mMaVHIPv83wtcMZ//14yYsmmqG/KlQ95ySaElf5H4OC/gKpgXVbgd0hHeRi3eIuzH coMCUjqq98t1eyyCbX5n50wyV9kkVxXavvahWLC3Hwfy5/1FPOQtRi4d5inlGNuChO ye4K8CywexeGrY+k3vdMDecNxvBl61SsDKlFFzJo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 78260F805BD; Wed, 24 Jul 2024 04:16:11 +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 6A0F5F805E1; Wed, 24 Jul 2024 04:16:06 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C99B1F8013D; Wed, 24 Jul 2024 04:05:07 +0200 (CEST) Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazlp170110002.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::2]) (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 4D228F8013D for ; Wed, 24 Jul 2024 03:59:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4D228F8013D 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=RikwPchl ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DG2ZCT3VIzR1h6DIPQD1QKxJ4PPNuJ0bZAScsqZxs+6DwAFsyhD2PBKoj+GZrgXFJWC2Slf+JkK+Bqz/thxuq29nsis5kPbCPduUSBexDE7PVlQK8zHnT+oILJQ7HWeHVai7cDr0AwYYrfGofMUOg0TFUTMj6gJQRJY6fD8PJ4bGx/8Ej2Ax0jxGLx/ju0KuTKEOpvqMne0IjjHZ/jre+rUvMoYhVAC0ebfUcCjWI+MNxxMIAovuwOIJo6Lj7rxPiWheM/F94u4XOgkQ3mqKEtH+NOl268JkautUAjntwnxPJsC8SbQwxS8Fbn7Aej/mwvLy7w5k5VkH6GeL0nPr6w== 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=UgFsZPUoIFmxXlfE+0AaO+UY4LdkhOK8tTUMKORG1Fs=; b=Oeo6r8nlxVxYOrNadjZszW2E3d4UjNQ5a3nIhRv4cIX0+Xw4EPSPNZIJmwEC3ML8BrjgC1sgzpdoxGvu5ewFQf66FuPrUvxHc6rlHYHYpuT6Dv1e3+cWgWsTN+5ioTZNo2XeRSGHphglvr2pjPs936GzzsABM0OrbIWDefu6uTwGLGnAEISQ2qfFr6lfuHNjcgAQsPml1nzU39FP4oSfa0hogd7xga0VSfNycc6Fkp2y8tb7y7PzX3zvyUOqcokuvHvzU/0OpztsfZ14yaNVmQ3jst3j7rC+XVSjtDTGFzIIHorZphJrRvQmPjQGP+jlSKjRjv10MZNCSArGu4cF0w== 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=UgFsZPUoIFmxXlfE+0AaO+UY4LdkhOK8tTUMKORG1Fs=; b=RikwPchlaf4ytk9xloWDHuTkHgLRFIFPTSaYwWT80QzvjneH/VVCbehkqwq0DeewOKaEYEn80WtaxJ2B9KOecOdr8emgkgguo1JAzx/MzX32ptNoxBkvChkMQv/AUfCiUkMfj9OaEzEAFwDeXxbXwXc6xFp53ixNZhOZSPeaIZY= 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 OS3PR01MB10388.jpnprd01.prod.outlook.com (2603:1096:604:1f8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Wed, 24 Jul 2024 01:59:50 +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.7784.017; Wed, 24 Jul 2024 01:59:50 +0000 Message-ID: <87o76nft2o.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 001/112] ALSA: add snd_pcm_is_playback/capture() macro User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Takashi Iwai , Mark Brown Cc: Linux-ALSA , Takashi Sakamoto , Amadeusz =?iso-8859-2?q?S=B3awi?= =?iso-8859-2?q?=F1ski?= , Pierre-Louis Bossart In-Reply-To: <87plr3ft3q.wl-kuninori.morimoto.gx@renesas.com> References: <87plr3ft3q.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 24 Jul 2024 01:59:48 +0000 X-ClientProxiedBy: MEAPR01CA0098.ausprd01.prod.outlook.com (2603:10c6:220:60::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_|OS3PR01MB10388:EE_ X-MS-Office365-Filtering-Correlation-Id: 8a553f1b-8cea-4611-56ec-08dcab844d7a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|366016|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: votIYD24UUEB156l0VWQl9txUu+dUhwYvTuxUJxCrpdl0BXgaZu7JCDVaXI3xLd7HHKMLFzhoy3sIkOBUqFtyo0KKOT6O9mzL2V7mvE3W1I/ZpDND8UHVdf5IoEKvm+fad8ggXarrdU0WVD2toejBZOvPgDZpmoZaS535AbirLEIaCVqX07wPX/SytA1nBZd1GSjQnEUuBCAs3EXOxSiyAY/EvacgLElpbxDHwnK2Ymst+7vEjhm4mCk/qYN51m7h1gP0GhnhxIwu86VLMIAoBckkex0m6EoLceAMVtw6VwaDdPJviaknNLv2VCoG1GPF+rpH1iyW7vZWtcGWTJTEujdNw+eLPNdmj0rBXrnrWEjUT1Y/tGl/KOKog46anIj/GQThdUtctSa0i8UOJntg/UlNSxzMsg/d2stzKCtJSqfWVwuUQqnGk5CTQEVYIl9BdAMfftoSuxTS2hPsMlzqJUcxnxiDd7h7P/cC6VobXowBouy8RXp5wb10V3yqCAOy31xSZNAXbtjbMj0ub0f4GTHS2kgfiU/8aNtPcBsuEc1/VjG00kNK++5bTqU2fMcIn7af1XzqZpNgrdGqwaSUed5ouguTlEZaikFcd/ulUV7N+ryPJR9rhwhmWCr2eWZbwf3rqFOhrAEiKGMKcGrEi7wbmwGvikMoppDJff6R2qFtRSc9KXGUci0AufGcGhuWV4PSQ6ZrR5irAJ4UXdUUlxdpkdQ61rTTmCunb34i791tLQKlJ1ian58FyLBvsiNbXS+uHbU9DYJrvyb12K71lCcGc7/NGR4efLVAArKhRcLuvKAzsjpg6ZSw5XnyAbAhVz4rvhZa+pkLJhtHS3naEbNSBggWDiA2EMarIaDad6Po4tEQqHKTr180j7Ccp1WkoKgJaMONCUGuCsl1oIpulvlIp9WtiaxGBBWkSxgRRWfOs63CXErNCkviQvg1zbTdJBQT5D89nijkjInvwtuyuOzITnVmvcLiFRwADfkv3naJlutDtCwAWA1DjWALwFKCmbZ/K+tF6ank9qJSEeN9MSkpbE9k93+3/DMc8k0E8a349hjaa8LuP3brg3xxzOKvJwX4NbYv2R/IZU+ZA7zY5nYQaPHvYzOgKt3T08m4C8aiVZIrvY5qJAXRy0sKnxvJtCAubWFuyLcotweinNmQby6PKM8ZbjmFbYp8QoY24bxoZTAwMMDIdIxuyGqVBjvGx/FSrrfgcIem3ayk5mMUUHFI5N32JvQXsz6RS7WWm9z5Ut82rNDspUxFwgb9I0j4PPnhfaqnJW3iDZy/u/bLDnvho9UGeP8uzKMf7Fv5Sq0qZMcASWMgyL+DZGVda38POVHolF2n0SK0DN6L0tDWuhXjEkk3Dzr8vRCykBZutgUer/kR0wQYyZoaL50yP4wloAbG4w8j5PiPEA9+r7R+g== 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:(13230040)(52116014)(366016)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vfx4+6aM6fRYPH6bniYJ9xZrKCJagjCf6XLUJjUBSdP7ZMV43WTt5nFjiZRGqVLWfk/bPiR9Jq31sUo9Li9l8JT1F0VMyBTq3/i9aBrQGWE3ukhopSUOFQEywWa0trByXe2Day52kkGgEPv1usin6MxmRABHjcaO8DzES01a91JiEkvx5FX7++P8qxNTMNfUcY5irkjL6/9C7so6j5I5qTjCZGk43bgvcuPSxugpp0fD7To0A+hXnZCFrpZO7VWisF3hR4Cx/X0u9ecOC05HOxdq9C6K+f2fzLCY3k7dyxEbeuvsMkjF8sO6yPOqzu8mIk5vMKyybf7Zqen32R4qbYYu/KakxGBC/QIMFX58GECPQeF8w7xWrfTgLyAPo34JZ2ehlqy13qafqwYvecJy2oQH0PnzWxxRZPTrr75TFjJQy4UhcYoGahcApozrwl1pu4PXiL133jImo5gIaqnMM+CFA6ilPSyEkMWncfQ5DQsBwRh2CjucsV6sCFgFTWKYlYiBBAg8II89OSWIZrCRjvYoLhOqY9LWXD27G8hY9Nvu8rrILBIwqZhxoTET2PjkqJCM32ZpwlWfdI+U8gaBOeyE98keyBVTFeX7Iw49R72uDSE3o5z5oIlDBSbyF4ycd+8o0xc5xTsojoS0DbL+52Urg7e/olYB4Vg2WrTPDSyyI81JxaPbcLcCnif/cG3EL4AFDJwf8hwTu6y/yekP0fAsos7I1b+J5vFq5XEQ8/AvW7TTYXC/oabG4x+t3jy1/LL67V3ymrrBQqAdCycmbg3maP2VfkC1PJsVYHdcoJVbFsx1c+B6RiPW0tYNEeuCziiKxSFNKGKlpDvleFCIvsppwMmJHNghd1DyJB7NXVLXjx2/J7fIFOYEQk4MDLlfF8y4+y8uWgxgpsttFqqIqkH/B7Prbq38ju+LfWYAMhJH1QtGsyWCsNB5hgtGBKlbEFeCz2jqUMTzBKbp67rfSI+v/OxPYFW8V0Qb2u5DuS67WQzo1tw0BX+msMiPCgwBaEMkMWWkm1QgdJZnvhRrQ7UkJpO6HQ+7PKDUkWa6GNG+xd+uJ81d4CCkslJ2n5AtkUk3r76dMVXmruN9Q+nIuoTjBLCKCH8GvUJJ4o1sMS8/c4IemUc+ENh1depeJrmsRyuOReP8SjbDMwNiWNUDlHrNaz7eQrOx2zzo6Tum1cGPxtW/a13iNqmJXFqwenMsD8blvNgWvzG6DiF52+K16kL42hfuNwiPE4yC6P0jGS9h1sVIVHtxE1lM/98wRQJ7/mRKX/p40H35SDK+quNvm6IHri2TvUT1Uxl5sGDxOfcBYmEuINC1cVEoUDvYuNVCMwe3/go71N9qRf6yC20yha9d4KZAQ629Cnf3g/zZqBV/iRnmATcPo1G+LJ+yWWtzHGEuA8B0siedfMXxO+dPB27Lr0FLXRF5ZkbCgJqk6ifZHGX69WbF+/09SvDMkTzx9C8Oal2cuW4iV6V0VQqHdBWVQH/6ftp+WeOURHB9kx3TPh+qXueujFP5tIzTj8OD8qXFgvOOaMaJUjIFKeGw8F860vlcZ860OvU3YGmqKbUYDVAYXx4DluOFssSjZW8Spj+cMW/rq15Kw450xyt1BK3tAqvyMWPbbpfwLZhYEck= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a553f1b-8cea-4611-56ec-08dcab844d7a X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2024 01:59:50.4831 (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: Ap1zOWIJgZLcZsQ2uEWKflOgkI4OQP2CFj7ojVwr/9is6ffjcFBrLwVc1SYPnI+SQ4+36p4NZI0jpLyw4pFaD5VYHK5o5DzBVS03GUEQpDnRlq8qF6+/3QxApUgB+1Y6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB10388 Message-ID-Hash: BFQRZO5K6V7BTI6PE2GXB4NISMSJA6H2 X-Message-ID-Hash: BFQRZO5K6V7BTI6PE2GXB4NISMSJA6H2 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: Many drivers are using below code to know the direction. if (direction == SNDRV_PCM_STREAM_PLAYBACK) Add snd_pcm_is_playback/capture() macro to handle it. Signed-off-by: Kuninori Morimoto --- include/sound/pcm.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 3edd7a7346daa..b3d4a928e41a4 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -501,6 +501,41 @@ struct snd_pcm_substream { #define SUBSTREAM_BUSY(substream) ((substream)->ref_count > 0) +static inline int snd_pcm_direction_is_playback(const int stream) +{ + return stream == SNDRV_PCM_STREAM_PLAYBACK; +} + +static inline int snd_pcm_direction_is_capture(const int stream) +{ + return stream == SNDRV_PCM_STREAM_CAPTURE; +} + +static inline int snd_pcm_substream_is_playback(const struct snd_pcm_substream *substream) +{ + return snd_pcm_direction_is_playback(substream->stream); +} + +static inline int snd_pcm_substream_is_capture(const struct snd_pcm_substream *substream) +{ + return snd_pcm_direction_is_capture(substream->stream); +} + +#define snd_pcm_is_playback(x) _Generic((x), \ + int : snd_pcm_direction_is_playback, \ + unsigned int : snd_pcm_direction_is_playback, \ + unsigned char : snd_pcm_direction_is_playback, \ + unsigned short : snd_pcm_direction_is_playback, \ + struct snd_pcm_substream *: snd_pcm_substream_is_playback, \ + const struct snd_pcm_substream *: snd_pcm_substream_is_playback)(x) + +#define snd_pcm_is_capture(x) _Generic((x), \ + int : snd_pcm_direction_is_capture, \ + unsigned int : snd_pcm_direction_is_capture, \ + unsigned char : snd_pcm_direction_is_capture, \ + unsigned short : snd_pcm_direction_is_capture, \ + struct snd_pcm_substream *: snd_pcm_substream_is_capture, \ + const struct snd_pcm_substream *: snd_pcm_substream_is_capture)(x) struct snd_pcm_str { int stream; /* stream (direction) */ From patchwork Wed Jul 24 02:00:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 814180 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 9CC50C3DA63 for ; Wed, 24 Jul 2024 02:42:51 +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 BAEC3F51; Wed, 24 Jul 2024 04:42:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BAEC3F51 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1721788969; bh=6lY3QVjna1Z1nGwAEftbLSdrhp/gCPw0b5Kv6pmxbVM=; 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=tLTac93P/SY8GWo8c/a79pLodPuE6tl5sbrjZynvkUWyqHeRrSymaG3t0sps3VT+r j0z7RpR66VjxowegJVQJKctXyHgFFp3bmKRl4y+noUM27I3vRMVLEM7s68SQdOTUPf EHsUOjxNfUjA/qRgucYCgWwMnjsOmbiiZCuu6HyE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2B811F805AB; Wed, 24 Jul 2024 04:42:19 +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 7FB9AF805AD; Wed, 24 Jul 2024 04:42:18 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 318FAF8057A; Wed, 24 Jul 2024 04:07:42 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170100001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::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 63CA0F801F5 for ; Wed, 24 Jul 2024 04:00:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 63CA0F801F5 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=Rr4juaAF ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=S6+4hE+uo04JxrKqlw8mn6CUqt/yrmy1NLncZt3fV/eND4Edm3RLpli/XWovRB7AEjuQAAlw417NZPq1gWMrO7dz4oRngAOsJ+IPxWL7nD73A5/FnP7/bOes9R7JvcyNz+FOxI0lBzFRcJPzXxkryJ926qYIpfTte49nCsNQIp/gPKVJ34QX0MDrc9G0afl62VTYMedWFWPzAxYBiXYGNnN2ILjInL5bd6nKw12wq/YgplZx9wMQO0Tf756uKDDuw7/e2ZGluvyqbkM6gJvcxIsH7FWCKXzCET3qRuDuP1r7fGyWwpPGaHK5UH/HpNqrqd4/yE7BA5kbx4y3/y9ZSw== 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=PH+IIYhAWXhIqx3v8oBZrz7nXjciHR50q+VObJXTIDo=; b=FHBv+74P7Ec93AZfAJL7hSd0Uyo+Dvy4I+7VrZ7yAxYU8ASi1ABnklODeRtmb2EfEm9bad1OibMTo+rNsr8bb1XAmCMfWt9Ex3TASeXF1wyi2B2FEGn8xGvKy7xb+kWwNfKTc5+U2FTIuhAKSsijkzaaHLD7RY8ptHN8iFUuXS0Fzi0PSj/dnzuwKBCHjE+KYU3u/nANJOHFfJVmYR+FXsAJhq/vAyQVBCCEobjOEH3fva8a5BWrM4uZ1pmePrh9oj5EsTtCBDMoZJKxFyLaCrybsBuRn5Nzv85kVw8v4zOYzUTxWEGzDUcPiJ508sW1W25AgHs0cIE23vYxr/wqHg== 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=PH+IIYhAWXhIqx3v8oBZrz7nXjciHR50q+VObJXTIDo=; b=Rr4juaAFdQJ9CmsHuZMc6uBPjzsliQkS29WX6vIFyVk5LdzRTqy8GVtSR/rWC86qi9OhzXjLPJQ+Mx4iVBoVxx5/bjf4mePNOG9OvdfR+Da2AQsylguxNJCrwEQ7f+YWHTrSYFtSuBEzku5/+zOlZMbCptTRWeEvbbtGRo1VYY8= 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 OS3PR01MB10388.jpnprd01.prod.outlook.com (2603:1096:604:1f8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Wed, 24 Jul 2024 02:00:04 +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.7784.017; Wed, 24 Jul 2024 02:00:04 +0000 Message-ID: <87msm7ft23.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 015/112] ALSA: pci: ac97: use snd_pcm_is_playback/capture() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Takashi Iwai , Mark Brown Cc: Linux-ALSA , Takashi Sakamoto , Amadeusz =?iso-8859-2?q?S=B3awi?= =?iso-8859-2?q?=F1ski?= , Pierre-Louis Bossart In-Reply-To: <87plr3ft3q.wl-kuninori.morimoto.gx@renesas.com> References: <87plr3ft3q.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 24 Jul 2024 02:00:04 +0000 X-ClientProxiedBy: TYCP286CA0044.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:29d::17) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB10388:EE_ X-MS-Office365-Filtering-Correlation-Id: 3555070c-b921-4f74-c8c7-08dcab845600 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|366016|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: YjAERmaBCQ/93E7yvTA9XNJ9emZngvy8YpLk2CskP5b4LJxqZnltkEAkP8agDerRLeBy0KROVkB3eg8T8kMuAZU8ReFxeg+Q3cteIfyXl8/vr9VpnWbLMfa7qVS3o+tSwdarASz/kA92fS6FaVlSndUp3UegFjo7SAwyQrGM7zCbcAh4R/ZZRv0akqPVqTyfwjFldWCWCZTmy+ph8dPMH89OrX8oBYvEC7NSTM0brjMVzxLVSa3TPszLQrH8TJVdCUG7fQ9Z2SbcLcKUVWnnv1O3mBmq2vWgshlta81s0QlTf4ULQAvts4dqjVmnBNVQuPVR7oS7tfcoOo70j905Ew8snv7XrxJ7XnQxf08sk2AvNx8FWPXfHQVys4bG1SN8KuUCY/lvOAKGOMseZ7bwTkb2vOzKVGkrfHDfRZQEkBtNg1EIjfz/ih3W5GWdPaHuvJjvC9AnGy8Jpvt8gvJWtQhmOn52sOhJr0PxrqWhq/oG89G4K77bf87FVigdX8GeAGExxpveJHPR/ZTXxDd2kjYmvezjCm0MjO7lHQI+meiLCp2SsABkCEcmjfxIlkCVN0ptB4n1lTJAHT+2a5aOPRz/4bH4dm3Tbu6HQbRVbQZqScBS9weZQa1trFV9iUTfLwnsdWC16unqPrXLa9Opi9DRfFvpeV9TosFjvq2G0yZ3a65aBzdhQPPn0X6pU5DLyoAKlLoGXkBb6RgOJ73uJIh+pek0qgu4LtNfgokC6hY0mJvmUejHJrCpeyKLX+hYk+2j6RQwziDRNYD8aOTgsK3Ay3iAsynJc0lyV2f9V/JuZatcyhSD2yzUIPrfstoIupyFU+kE5O1noTH+eeGeDbAsQFxtyMet4Hsl1vcAkyuQOq+V3tA3gLZuC4QaJrmwXoHEtDaq5zTce1yzxO3t0IM9Jg6+GuYL57Dk0BFWwBSfL85sgcfeF0C1QN2jTbd7KeileF9TaQF7aCy7K3bqIXJFMCYNR2lY3jrOcpExjxBOzHsU9Q1qN1osDBDvQWl5Lrwz6/3oz1Gm/uusA/b2793dX5RiPUkIC4vOYjbbK0q2TzqEkdzzv5tX70gBFmpn6NN8gSbnQiGL2D3qKnGvFG8Zbgjz4RHJ+42sRHeY8rJb93544cE2aUY86vLRUKWMYnDCkdVUhRP2dRqibrL5HnPTxYfLRDvqoGcJWFA8s6uA7aoDitTN9oJEe998Cd15y5cZiX1/GUqMIjuv5p0R/a0m2Qob3v6CeC6H3wZs0P63ZJmyiq+OrFnQWATowcAP3iQPoT5hQWY8JhS/ge/t8s9doMA73RWR8qH1JHrRNlfouQjf8pHTjcXkIgXqGMy5YtIefTRUZl7V+3RdJdBveJAAL1Sms1gzSLMILtazaQf2PclKDSTRF6zCptk+lK8x6p8RtV/X0SQ0jNAS/y2wkA== 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:(13230040)(52116014)(366016)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zWZxNJnvQ3Jrkx+IFnX16LfdWT4sNjAMFpck94J9gqG9zLCH6PO+2kh3EVCNXR3MMy/QkgKD7G4dC6QqDDuYnjtndQAXHKkcAXvYboszLJ02M9c7e1mqU5pYXuLAPK8dU8noqbFTfG8+nrkFlnNzop20h7MkEzgfY/BGBwb5YI59SKa2KT9a/yfIQDPc9l3uriYHFElaZLEsaM6dpsJnrImfbGd4oTQqIwVewqK9COGRILiHDoKurT2IIS7KK9wfZ5peffYbTW0frQ99F9BJT8z1aU1Q+tNsPpWDeOQo8phA+UpoBsWp3KrpUat4oDG91A3V3CynTpKfcaneZLKA9JAazo3CCv5c47ifJeoxHHKmnjOQGEnavEj6nhxEeY8nKCvUT7BmYqt0/twQA5eKqqy4bwoZ0ozkFWvrrtW82FVYZVyllzKKHrSibIzaFXsG7HX5tMoA+jnKWhvv1T4vVn8SOJbTgVNClPoRBx02kgUIuKQ74AS+MV29irsUojM/nePtLLSD6/Qgf7eqqIzwghIh85o0o8f5dMhp3m4UhEbH4Q8Pyd9AAy1mpWNSHQjwnQZtnDClaLrrL4Jaen9HpDuC0qI/mjXCJ0t54DovY5PP1uuAZ7kWsx9zG/fncVL6ryxvt+4BwM7PpYP/WLKC2xFONBGWqNMf1Njjd/chq6yjOLJob9d55iW0D3HxInIpRIsSvraJTPvLgKSL/Z/CzyuSl7FU4d1KCmfTIr/kcKMKQPcBoQpD1zbtvY5StLUqjDtNtIvzb8Wvdv06iFapce7ocYnh0YUvfJoyVtk/Kqg6Hn7JAabEc4WVD+2IZVIlOcQpSzx9xwZwJsto15BSQI/etVr4s7TemsXX8ggD0z4WOHpS8svBMbOitodCmK14lb8z66MSy6j9G/ID23VMLmKR5EagTf59pCMvbm3mw2N1Ulo5hJycQtFm4a7mh75foV06fIPQMPEKIYQSioyDEOj0Pi0UkKd355bYH0gjabVHNeUfVUMuF2xR9P3HuAt/upakKYgs3Ysuqd0O/glXWGJio2x51WJDypSvMHGzXJFrgOajSydx1nEqjDoX7EfDlLo7FNE+4RBjyduVphdEJx+VTbkAqrvtslRoB1MavVBP8+Jdy7gKo2TFZSAjdvjJEsAO/vdn7M4mNArj3ybyMVbhMCZ8fRwIPmAnWhq6XwlWvrZUkQRVVOuZ8eKV8ckP4/+9E9IW3qRUnNw2AD+zei0YMz3DQLWkH7W7z3vz7It/6yfwOCYiggqWwbM0UPgiLrsHyaYyQ98p1PiTVj1docEcuuVKOmWht0aOF7AFhkzSbyhURmObv3DFZKuOC875RR02lIopwqtXVGCN6Kjgb6M1leL2Wm+Qeo0vOE0QYiq68oWH+AtxCn2rswjd/wgdT5laLKGIJCIHngC1HRtfqu7nGBYOJouERrhaln5SzckSN3Wt9NBZVtrhhw1He7s4QEjYHt2E0f6b/FUe63LcRHFKpnzwdXqCW4GEYI4iDmvEHrmjmnonKzviecZS0bFPCO+45xppMrBmn8Lo64Xi461VjFXOEBelDqqNGVLDQGrEEZEbamwr8GQjDIq+zDMBB5AT7HL/DxDYwYkAEiYFgNSAkm7UxsuRJeT4ukvBMck= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3555070c-b921-4f74-c8c7-08dcab845600 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2024 02:00:04.7719 (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: r6+0kpEMtVyJgDDueN49cZkBeDSIsL8XgGwOEwxBLbAhr4apAPuKjPsQ53LLH+ztR+M/PcFm2evrcA3Uyz5gbv/RKQ4EBFOEOa5ubEclFu9ZOXP1KBdRe7o2DejpulkX X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB10388 Message-ID-Hash: QC64I45MBMRVOJCYVBPCBD6NMXUXJX3F X-Message-ID-Hash: QC64I45MBMRVOJCYVBPCBD6NMXUXJX3F 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: We can use snd_pcm_is_playback/capture(). Let's use it. Because it is using bit-field, can't use snd_pcm_is_playback(), uses snd_pcm_direction_is_playback() directly. Signed-off-by: Kuninori Morimoto --- sound/pci/ac97/ac97_pcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/ac97/ac97_pcm.c b/sound/pci/ac97/ac97_pcm.c index 5fee8e89790fb..2d8276d2d32f4 100644 --- a/sound/pci/ac97/ac97_pcm.c +++ b/sound/pci/ac97/ac97_pcm.c @@ -150,7 +150,7 @@ static unsigned char get_slot_reg(struct ac97_pcm *pcm, unsigned short cidx, return 0xff; if (pcm->spdif) return AC97_SPDIF; /* pseudo register */ - if (pcm->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_direction_is_playback(pcm->stream)) return rate_reg_tables[dbl][pcm->r[dbl].rate_table[cidx]][slot - 3]; else return rate_cregs[slot - 3]; @@ -512,7 +512,7 @@ int snd_ac97_pcm_assign(struct snd_ac97_bus *bus, rpcm->rates &= rates; } /* for double rate, we check the first codec only */ - if (pcm->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_direction_is_playback(pcm->stream) && bus->codec[0] && (bus->codec[0]->flags & AC97_DOUBLE_RATE) && rate_table[pcm->stream][0] == 0) { tmp = (1< X-Patchwork-Id: 814424 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 258F6C3DA63 for ; Wed, 24 Jul 2024 02:42:14 +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 8437CE97; Wed, 24 Jul 2024 04:42:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8437CE97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1721788932; bh=CaYz35U0BrwmCo0iOY5skcYXkbmMfwDHib/aBG/5a3E=; 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=uqTAucyEKE3w6GcZi80sW8Gx8fPtNaWz2cLcHJnDD723xe+dm6f5G02GpLNsf5pmw c+xv3LUtXlCmBuOQlP/KSMnntPlqFOjlO7pzqOp78PyicPd70QXOcrMkXtbpV1GPSI seaH++Pi6j1FSwJfBsBSttfdbv1ltrMhsIuW9IPI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id E3A83F805A9; Wed, 24 Jul 2024 04:41:41 +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 424E1F805B4; Wed, 24 Jul 2024 04:41:39 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6DEBFF8007E; Wed, 24 Jul 2024 04:07:42 +0200 (CEST) Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazlp170100001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c406::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 D8C0BF8007E for ; Wed, 24 Jul 2024 04:00:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D8C0BF8007E 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=hpQTYKiy ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pOdwdBkYhI6ye0lGSOyrqeI5xA/HDy0jgzKElXkboCNfRsDnEx2bHb9y6cKdpqlVb/ENfSAnZU/Wlps4VEXn6Q8A05kOol72LBO4+7mXs6fdL0xecMgwfjRM4hv+x1leJ/eB7d8Or0BCXqtOoG9abdZPUlNwQR/o1dETObI8Y0wqYA5fnmjPexMM9kDfvjCQl7ePVXsxaunIfkKEYKkqScIYYBtD9uZa+HOwspAsZb8x7XLro+Wfhe4abUwEaTMqx1VGo70lnf1BJIyJpGpGOEL29WGh2Ex7XrnI+Iu4JdJ8NN2xbHPv69bqLNL/Lp4OOTD//biDcnU5b76YQi8T6A== 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=j5aejhi9EUF5c3ufjhP9ssq/Ihfsj+f/SlWVNf6wNVA=; b=l+pLWLMQtwKVtcmDgj+QpF1+A7KlZm1mpVgmcaOEnVDRnq/jUa585cVuFubu9d8uoltRSL7gyVYrGZUb4xR76e3RMrBO0rzAA1zuM575mwANFanok9wC5r515cvnDKx7u2Jney6il/SdB15IwGlq+fRgtWQUMHgEPah17iT/KJHMGsef0xka0eqxl20xMp+eFh1kuFcq6ejt0CtWdEEsYr7/o9gU8KrflvUHhihqFhXngXfoGatMqWgtifEel92ONf+6XJ6oT3NBdsesmLYlClBMmSZGVK7LILuWpQ4alcGM56To7Y/db7V6KgpQXT9jckB0gccFkjMkPd4HsftHSQ== 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=j5aejhi9EUF5c3ufjhP9ssq/Ihfsj+f/SlWVNf6wNVA=; b=hpQTYKiyyuDnNJ7ocJRyKDUmhAz6lsEAB7shSkjbpg4piZwfdspPzVmd4rN3VLiBucnxSF2DnOaJ6cMSKpy55NcTN6CxJlDWBYBxcAYNjGRvZU7NHucCHSunwBHAqH1NFCtLnDM/kGIk0iKoOpZZz6HKys+PcppmzrLVLv7YhVc= 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 OS3PR01MB10388.jpnprd01.prod.outlook.com (2603:1096:604:1f8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Wed, 24 Jul 2024 02:00:11 +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.7784.017; Wed, 24 Jul 2024 02:00:11 +0000 Message-ID: <87le1rft1x.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 027/112] ALSA: pci: use snd_pcm_is_playback/capture() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Takashi Iwai , Mark Brown Cc: Linux-ALSA , Takashi Sakamoto , Amadeusz =?iso-8859-2?q?S=B3awi?= =?iso-8859-2?q?=F1ski?= , Pierre-Louis Bossart In-Reply-To: <87plr3ft3q.wl-kuninori.morimoto.gx@renesas.com> References: <87plr3ft3q.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 24 Jul 2024 02:00:10 +0000 X-ClientProxiedBy: TYCP286CA0183.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:382::12) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB10388:EE_ X-MS-Office365-Filtering-Correlation-Id: 42939cdb-d55c-4085-0551-08dcab8459ba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|366016|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: mzFtLxnA4TgJfItbMeQ1Mz6O5UgrE1xE5R4HAmyfL14OQVW7nE3GnOtM1POtldRfHh3SKqe+M1XvHdQZC8rwiqioRqNCtdERE1aMsbYqR3CN073OwcNGCeGCrYq1P8Ck6LJKJRsJTuMJGiPbrBFaDAPPsuPnp467GSEU3HE0gtg+WlPFaUMUw2ndN68jQRdI8XZ9jF/k99HUmRrlXpAAA1UWpMS/AuUwwmC1e3DgQlZJHF0WO8g/PYCeerdHA+szQ6Y1BnopD0Fzgd3WKnO+7h5qLzwyNX1IvMANj4TAA1wSQCSewp7im1WO4v9Nbx1onRGPaU2O2OoxefDsGJir6fYShS0GQuBKWXBsKjVVhtC31i9cOKothpa/G/zxcr3qw8AClHt5Aa/WnFrivJ+xaGexfsDJoET1DEF8RZClTFC9snFEr26dfGro6IPxr3lYETU/kCCpFf3VUzOgrIquqgX/HXTbs0gvWNIzFZE0T0hATr7KQFjAKt0wwYz49ZaYXF2tn061k1pu8XQ2XqPq+RHXr2ERDFizuvCYH2FKaDg1em/jRlDhgJX2VLJhCPE30KsjNIeUz7ClTvDwBgQD1wiD/oQuoDdkXte1rKqXL5iAtvm+u/vT85CHcwpLNkF3iZKJGAdAD63k9D8kXGJSuh0vSIVpJG6eXNJw5kNZCOmxwf6ROw7tR3NtMf3A988zqc/gs4SPRuk09D11lOqpAUlkn/lb30EdESkS9cn8v3l3h8G4ZhWUBIdaU/zQ/0YCd9tvDJ968pNFYWGahKTetSRtFjwVBs9k8PJr2u12wGEeU1SuCEUhevG7La91kt30fdJ82qc+urrxFHuD5z2bf/2bN0LYetms8YPyduIv1hcT4hQzj6OwAprRxQI4T3k1aJLH1WhZDXvsa8l2VaCUPthTbDrGDAY401aYAcnq+hlgMt1sDGXTFOuQVS5sLptNyVkYmwrACV4O70Lkcmw4RwC3q5J4IBsWja0aVGGnqGwoi5fTup6Ga00XwwSpjfOwkIY9bCg2PMLl6H11ftIATYyxubO2RZqBXvsqFEaPJR1PquRBj0QySRRdRG8sGzAU4hraOmwRUXXxgtXznPFQAsDzgQQiwQ3OgKw14jd5wM8o3jgktZE1jPIhpCjGCaypsJPRkAzCATewDe6rflAxAKjtVZEHWvnFqC+RY0IVRlW4pXvLRWxzItvvGfCQEfBsaqGAxK9eePAdRh7kXAw8KX+U3GHRNVIWxKczwFJKkr6BgqN05g6fb9M2Nw9R8L0NH3W+z9gr+tvCZdMCeXy0GQHOlYPyDNV6DAclGiX76aZbm+IM55EkMW9CstpW7se901jnDBU7tQXXIm9AVp+ofmJSL0/if4zxhUuqQHGM3P4niW4QFg/iC1Kj+eUj1qOmmbwEbN1XFOcb85E1N+Sd5Q== 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:(13230040)(52116014)(366016)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yBSXQ9YHaOcKinHaBTf6lnZriRN0SlV0IMOj6g/w0O0JTrGbWCniekzybNF/ug9AygzZTg76r4VuFONUpOff5axSDFAIDwpWL8v6bFrf01Xysw/JlwOhCDljmBkhb8DCd4p1AGg5XmYS0uoyO/gJ29GdOFx1HiXIPSTZxio/Pbqe2yatdIcy6WOsREQC6NGPe/PNmDkWpW6hel2Cb+iPLYBITfMNzdvcgo3RUmaTeLz0fHzwjFvWHIZT3mVqdf9RcTWCS+ZEog4ZpGFdktk2e7Wqf4sC8IWleIzDZu/KA27CpYZFhz3Of1czOD6e8s09oMHgJJyVWhNKZBNDIu88o2liZYYZRw1jF2iMTBZqPhCYeetwBlvZtcqFRJMVsRZ7DS5V8ldfjg+zU+xkG9mdPwFnFLxgDKL4IkkqgR/Xi+dCI49eeSxNs/I+yN7+izIl67Y999kWT3AYjK/GehxXgPtdramhpJk/Ez7tu2yiPDItNLI3PpptDBbBTmyc9gN/DZTP+JCqykcbYzH+rW2zdHtCXKbfP9gSGVdvpvaifGPHiHYWKl55DLGOrSeAekMN3KmQOooRdvNmMezlDyLsP0wtibJirOtpcgi0LpjL2KHWuEShRaxjWTMRlyRCMCeO6PX88hEgDRyEWtgL/C1vdd4p1YasgRuRq2VjvV1JvMX2IoBoFzRAhEwalmZ41W14G2BZDwPY6MlMMfr8zDS53oD3W8clC/PyofxBR2fZgNzVVz+BhuRYsjOZz9GY81U0OtKhgbInF5upaUOYl4RiMolQTstxNgBb9ssYfl584Mb0MgrZAIJe7pW4aDpMODrVjiQbDR2aV4qZnIHXpabjAtQc77iSdIQntJ3SgnaiF2uWgGO0F0Uj+4j+AMkyf0NNLUnHulk63LAOZqz3y0Y/Ik2GbCNfriXzwOd18KHNyZo5RMDL4g3abkvkDWk/zBlvB14FR6TRohY+KQ6zbfsZ/HEEOYQQmP4SmcqK/dCGLkJIWL2Mn/ig/gAYG3lsV4tzPolTjAWWmkMd67P97eq5Ka6YIRWF084QdrDMmB9JRc/LXCQxmareqfqgNuG9Vy8lOh4o6CWW5dxUrzmj9PC9uZjNAskDjYJJ06Et0gzDurT1auXok+owDImv57IXQh2s2IyrjnWZYSM1ehe9J9+/4Ofz8uBn63lJG/s3QOBb2clltFi5IMz7vJYuuQ2OlPqKMZskck5KGOCX4jC1W0TfqBPVr/gu+FWzsmqw++XRXeZWnzaZqxnD2YDfaREMbCWGtPmPdk92iuPb0jX4cOuUFerbdk8LDJpMaWbafQELAY2NA+00LM8MoAm5bCEx220hsML0tRMtJpq3VouTIycDtvdRd8rdUO+rgMja3MLywjYypfFycBYyf8Wd43uTFYlBLTeVTqxCfse+uQAoBfjHvtRbqZvBK+Re/jVJER7+GbAkGsQRqA+bTLdk1ETSyy4pE3yV2FvXFcmt4n9dBa5LAptTbOaoDCFhw68kfUrTdQR2f/q65b2Vo6sWY34lJg9KTCNsijQUImeViyvXTV3ZABcCe45xS39mmgnL5ILCBUBPmwxhfeBmXgtCs/5lG38WVdxZj1dMJnd+kBVAFoZJIkAjzFzgMwWxu8pZoD/Bcf4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 42939cdb-d55c-4085-0551-08dcab8459ba X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2024 02:00:11.0275 (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: BmTncYD/fF6lv1ZrGY9BKu0GWE8GTavfb7AnH+LNxh5UPbzTuIcLnrCHXu0vnopOdSNvCkoSxjCXwl+vC15s4fCCKAZxH7KDWGVVeO1MJFW3T6YRrgHhrkuE4SBetXTr X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB10388 Message-ID-Hash: LHJLZFXVTZX4ANGCCIT5Y64EB4FI4HIU X-Message-ID-Hash: LHJLZFXVTZX4ANGCCIT5Y64EB4FI4HIU 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: We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/pci/intel8x0.c | 2 +- sound/pci/maestro3.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index dae3e15ba534d..d9a6a9477bccc 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -838,7 +838,7 @@ static int snd_intel8x0_ali_trigger(struct snd_pcm_substream *substream, int cmd fallthrough; case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* clear FIFO for synchronization of channels */ fifo = igetdword(chip, fiforeg[ichdev->ali_slot / 4]); fifo &= ~(0xff << (ichdev->ali_slot % 4)); diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c index f4d211970d7ec..28634b2d8e5bd 100644 --- a/sound/pci/maestro3.c +++ b/sound/pci/maestro3.c @@ -1130,7 +1130,7 @@ snd_m3_pcm_setup1(struct snd_m3 *chip, struct m3_dma *s, struct snd_pcm_substrea int dsp_in_size, dsp_out_size, dsp_in_buffer, dsp_out_buffer; struct snd_pcm_runtime *runtime = subs->runtime; - if (subs->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(subs)) { dsp_in_size = MINISRC_IN_BUFFER_SIZE - (0x20 * 2); dsp_out_size = MINISRC_OUT_BUFFER_SIZE - (0x20 * 2); } else { @@ -1416,7 +1416,7 @@ snd_m3_pcm_prepare(struct snd_pcm_substream *subs) snd_m3_pcm_setup1(chip, s, subs); - if (subs->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(subs)) snd_m3_playback_setup(chip, s, subs); else snd_m3_capture_setup(chip, s, subs); @@ -1724,7 +1724,7 @@ snd_m3_substream_open(struct snd_m3 *chip, struct snd_pcm_substream *subs) s->substream = subs; /* set list owners */ - if (subs->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(subs)) { s->index_list[0] = &chip->mixer_list; } else s->index_list[0] = &chip->adc1_list; From patchwork Wed Jul 24 02:00:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 814423 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 B9DACC3DA49 for ; Wed, 24 Jul 2024 02:43:13 +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 9CBD7EC0; Wed, 24 Jul 2024 04:43:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9CBD7EC0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1721788991; bh=LkTnb72aTb7kcS1zdgH5m10CNc7UH88hv4pJtxFaDp4=; 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=qhofKWTzGBuTCqvz7biuy+wuNrRqarpAe7/+Ab+EnEdxXsiPm7/mWvcPvdY3Ggie/ h04jqFOZQIqiIJhFeSFYRek7aEf0xM0ifv69pH70o28pMipYjoArY9cSkF4ZAwHiRT zQ9E2WaQPrGs7fbkqMDYz/IcNhuVb+/e2EsK0oMI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2D206F80579; Wed, 24 Jul 2024 04:42:49 +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 DC15AF805DA; Wed, 24 Jul 2024 04:42:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 81CB2F8013D; Wed, 24 Jul 2024 04:07:56 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170100001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::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 85994F8026D for ; Wed, 24 Jul 2024 04:00:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 85994F8026D 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=KM3NWmXC ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vVjpDzXfWV2Q6EachQhHWbK67+glAaDtURyekgcvz9x2Uc4SwCp+fpjouo9uoFox6CnAmyq1f6NgrFaBsumNh9Hn6m9lQbFg1v5IohqetX1hB874lCaH0zhOM/kC4mTkDn7eqSqY2nHKp341bjksWefsdMH1BxjVdizjmRn3jQ6k7EC1GBu2/+cccThcF9QWMNxqEAr5gSv3eDcqwOWwjHBAOS1k6/8ytPxiindjA00RFXvXzLm+e946Oq313kdBbFSMumb6JOTc2xpGwDMexedxgHwipep2HSdt4ZMQFp8hRUUIgouECoUcOK1N3bdbk+iJYhA1DKERKXgLo7q+fQ== 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=1SRic96GdGwzG0AvMX8UxTlI8UVl6TeKw699m4CLoPc=; b=Ajy6Ri4DY5hEuoEgq+0/B5Pz1B0M/ER0MxOBDRGudTld3y6Q7gZa/J7v6QcSQpnNNJ4x40PZ0VUxaKgjByRE+jtEs4YSfHJuxslzrUtV2JGfDBAdvDFrsqXT4SV0Nf7xWB89lqZYDUXHM1ViGxU32vMBork7s2MXQfo7HK6phOvx+fqKxcpaktUlM+USEX2PF+tFxDDB5ezvEz1Zx+3Tlg1wK/5hKZbHw7VJAdqjiPAFsILYlLnmpfVju7JOu68mLA/R4hCI3SXOO5GC6vNGRW/8eT7t/GHEZAx2uMmZsnbpj3+Y07+ZureKR5Fkqw9Ud+IgKFQb616L7jSm6At5Vw== 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=1SRic96GdGwzG0AvMX8UxTlI8UVl6TeKw699m4CLoPc=; b=KM3NWmXCGIZSZS7iitvGMwiMk8uM/19AbV66Sk1M0o9m/Xs7RWxOvOgYELlj2f8H0awAQqS3vwZfX3vzd/NrpWjawa+5WQBTcXqooZrXUGWjJtafyVKHZp6ZMp1WYPumg4atiqWvjYnESFDTPl7TBwVwMOycmY0YSGi5tIibpVY= 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 TYCPR01MB8899.jpnprd01.prod.outlook.com (2603:1096:400:18d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.17; Wed, 24 Jul 2024 02:00:16 +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.7784.017; Wed, 24 Jul 2024 02:00:15 +0000 Message-ID: <87jzhbft1s.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 062/112] ASoC: intel: use snd_pcm_is_playback/capture() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Takashi Iwai , Mark Brown Cc: Linux-ALSA , Takashi Sakamoto , Amadeusz =?iso-8859-2?q?S=B3awi?= =?iso-8859-2?q?=F1ski?= , Pierre-Louis Bossart In-Reply-To: <87plr3ft3q.wl-kuninori.morimoto.gx@renesas.com> References: <87plr3ft3q.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 24 Jul 2024 02:00:15 +0000 X-ClientProxiedBy: TYCPR01CA0188.jpnprd01.prod.outlook.com (2603:1096:400:2b0::20) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB8899:EE_ X-MS-Office365-Filtering-Correlation-Id: 214b1775-d35b-45e5-9124-08dcab845c93 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|1800799024|366016|376014|38350700014; X-Microsoft-Antispam-Message-Info: hEjh/O5beMQSEG9SIk6u8o1Np7l1I3GAKysytqFBVohcEtmj/DZHyihSRsMO8Nj9Vz++aFthpsWWifN870bpIYmQICA6LaleYK4qHmt4mLdtualfdt/v+Huelsr0HlVF7ZIVpi2SoILKoYDhHOmco83plFkr2N+ecjHVqTz4oHVMLqJOCMQ1b6uopjCNK4e7H6/wh8UQt6tLP6lqZGpewYOBkqmc9ttKqT6vmRHqCf1BkRfJgW/7W9gVpwVp/tWYfchEtVzMI4vtoK2gwUkjrAs//rLLWa3/KUqz3JJGvXONhZjzmgSanaxkROXBCwoh+S+DTUw5XqA8fMiVIuIRP8BVNRsrlpMGUY5PxUEuQcxh+hHabbDL40wbU5OkYHcZtA1xdNdWuY83FP87d1FiQTECXCiYA2IXnV5hWx0zduHkA4wy48ohF8NgPf9fOSU8qe/eDH1tndZwNpDNeTPmIhzUqO8bdFwSAJHJv/bOUKAXudZmu0mAvtxVlXNaG3qP0pFw1I6LhS+apTV1L69yNrC8tUxRRcN34xeCeoMom8nB5l55X5Q+vM8d1GOviQssfGNlygw4d/uULAV1VSLuAfHi671xNc4KoxuRUX9gWSxJuI0OWFEup2oHNf+DexsUGEInm99yvBYGmPLUxmZBXcVoWjceOKom/pJKvnf3LLO3EGpUnbOsQO9F/K7U/Lr51asKRPvlrgpp7wtsYQYBk9IsPoEqn64AVnxSbV0wnXmXjWSjcQGC7TsrWp12bbTdzgTwoQbP9LleNjdepG7b8ulMaLW9Cobg6AZJaPTWV/c0Gwo3EjYlhHFa0BjBesr8mYTUUvxJwPZKhw1jAHUAzHLJCyNb5GZ7qjYfDZxY4vB1jAPv3DippX7ZmSVDL03ZGW92B5BMYrgPfFtJi2Nu6AjB12E6qqFltxiYO6N5wmqUshx0bLNI6v6euSJDuspmV26ZbDO+GKo2laYDz89GpcUZpy05ymQcSdTiFcb+FONPWf+PsyBtMsetAteT0JjbO96w7OEpslj3UlHQP/PDojh7cm65OaW5wqxoV1D4zTiEUPOgPVo3P0JKWRjLPyT8CJZE+or52nCvn81S1xgXvE6PzwxJoRCSssiuZkA6kIhIPTai+Ah51wIkHHtO4q2rDVliyk8aXYjnYE1ktF4WG/ofxC2Qj7f1tF0OX27ycL0lPk16vsmNIlPz55uW4gisVMVLSutgWY9h2PdCKB0g4SQbXB2DWooNl0QOD959go7pCLmrlKWvIyLY+PdkJNJPpPyXJfoTWvWtOM4w36cRVD6P7jX2N6CMppyVQi84F+F5u7dXmy8d3Dll3uUEBPk6cTuDW8KUeWJIs+GXTrhOdZKGhdZEN+iK0J2zkb7L8c4l231bksqsrbTVwWQ+95OlxYLIVpxOYk7PcpPFFNhmEA== 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:(13230040)(52116014)(1800799024)(366016)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zMv/JhCD5G6Pxi/P7/NxhEqvYpGSPq9LylGorfusn/WcoDCctpTgLWmBajCuebf9PWVyJinMu4ITDRgEcuVfUR/YfnMXmAlEvakaBFUf0SpMVDlFTLNpnsYTYu54I86tqRHDIU194ycIFm7L3esOoptEWD2t/CA3zrTJQmEsDuitgs6aWHQP25ks/760+oOXEtgf+lw4xEtRFmjQBQ60+s0dgXWb5za5+3pRl+/bv4MRi6iu6SgJSnQa2IjTfQui3IQDreya2Xl2smDdrzgM+9aROMDxkNVRHOG1AlWpaqKbBpfrp1C+FUF89fgvnkWmUGC42CY5nMWWcryn8ZM9Zqxf6px5akGbAkqY86QlKEjPOQRaf49YoQJajlSmG+VRI89R6VFFFfBoBqfk9/Lh0rrZd2CvuinPUBjRUmGwzbt5HkvrH4BGHDKViQrrThCWh+QIZy5/6a3uOH/dyyJRvsRFIm3SdbXSnnv2LnZsoEbFO3r6PYavSVVuxZXo+daJ372SRGgeJv2HZ7EH2BuIHNH4uHvoavx8L9wYcnb1UB5N+pKpCQ/0AX3Njo+ZARs90ytZxGP6t5pOaO0Uw+muin7lqMr0+MOrBbZa3v8H4QK9bO8NThHvDqh0OAeQG3E5cicKXobRl1d8OYDSrnTxuubp+sv22xQFlrMS6FcDmVVF5axDcMqSgk6XSBr6J2Cud/BoulrwkH8gir7JUbd50tXfrtAhb1XUKLsPE1T33H4HD6m3B/CCKauVb5XNUBBDboES4vd/ioP2mc/bNnA4Izt6SZMin4ULbn5pgIteaoe9fSxJgPsQFIif3zKSIe3Mt9bZ9rDefVGK1jpz3CLEhsNrrXnJg5cshI0EwBfJUiD23G1079ISCvbmCPTqh187KjM9NzTn0OljZhjKMgHLO81d4pyhKjVnYC1gLGXesGtBuXSnP+KjNhGAhNO3wnbV4R0wO0QFEcZdMdqtUZCSzPJmRJPnakyj2wXIsg7JaBENL7udShs0oZS5DndDKbMhde+go7IdWL9GV/rKFGNw4/SNxQUDJ7j9GWTUgslM3wGjVSZM/eYO4a9Xl64kAzp5xRio2ZAHaAcng9545KTRSOBii2c1tqfHZYl+/c3BHtBGRbwZme2eJiEk7kInguq2N2uNZuNTdDMV68TbRVUyhUH2I37qpQnjsuUV+DcwKJomzsV5Lc44I/8xIFlGlPjxDWmRwQVKaeuov7gW6WMXBwfoyQabWUrSbpm00+Aqw+ZQwFaYihYAWQertB0zE9XbZKNtTREK/bjGB/D+HCKn+WtrTUcs8sZSo0aqadvxSaBUrSBNRlTnS+mSdGc5Z2r89a+40/2zFmB50ozY420kK0RFf4Dxo+Cwd5lPeOwdK4L4ZPKtcittJif3w5nF3xH0c9K60oAx+5DJ/109DiVT0u7wdVk6RjvHj/30BFslFr4RGEDMkK68yCNwUrfpd2XV6Fr9pj2uAin6JgsZlV0A5es77JIVVC2oN6zrYyQrMcs1JazMmWtUHljrda3fpY6DCKOnqbTzXkSEbrkS7O0uBSyj+WONvNbRmmx0KaV3G3Jx4yoPzHyquh8G0r4HYPpmPeJ5WrgJo8Fwkwc4Aj/CWd9SblmydqhZEv2UKh3NQ/s= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 214b1775-d35b-45e5-9124-08dcab845c93 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2024 02:00:15.7998 (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: 58/F2Ky6RBSLT93hnk4TbYHeG9gvO2eQwMIOj9Rf8uN72I6IqggXQ16Q7UuMgXjPDletkso4Lt7MG/tyIfPlHF5h8LbH1KB3isgbq7p0BeOVdfjHxxmIK39UEtpiPs1E X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB8899 Message-ID-Hash: E22356Z4552PPJT4FKYKYEODSHEFYJFY X-Message-ID-Hash: E22356Z4552PPJT4FKYKYEODSHEFYJFY 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: We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/intel/atom/sst-atom-controls.c | 2 +- sound/soc/intel/atom/sst/sst_drv_interface.c | 2 +- sound/soc/intel/boards/bdw-rt5650.c | 2 +- sound/soc/intel/boards/sof_maxim_common.c | 2 +- sound/soc/intel/boards/sof_sdw.c | 6 ++--- sound/soc/intel/boards/sof_sdw_maxim.c | 2 +- sound/soc/intel/catpt/pcm.c | 4 +-- sound/soc/intel/keembay/kmb_platform.c | 28 ++++++++++---------- sound/soc/intel/skylake/skl-pcm.c | 14 +++++----- sound/soc/intel/skylake/skl-topology.c | 18 ++++++------- 10 files changed, 40 insertions(+), 40 deletions(-) diff --git a/sound/soc/intel/atom/sst-atom-controls.c b/sound/soc/intel/atom/sst-atom-controls.c index 38116c7587174..0c6ce403148f8 100644 --- a/sound/soc/intel/atom/sst-atom-controls.c +++ b/sound/soc/intel/atom/sst-atom-controls.c @@ -1333,7 +1333,7 @@ int sst_send_pipe_gains(struct snd_soc_dai *dai, int stream, int mute) dev_dbg(dai->dev, "enter, dai-name=%s dir=%d\n", dai->name, stream); dev_dbg(dai->dev, "Stream name=%s\n", w->name); - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { snd_soc_dapm_widget_for_each_sink_path(w, p) { if (p->connected && !p->connected(w, p->sink)) continue; diff --git a/sound/soc/intel/atom/sst/sst_drv_interface.c b/sound/soc/intel/atom/sst/sst_drv_interface.c index dc31c2c8f54c8..f02ee7f48a2a4 100644 --- a/sound/soc/intel/atom/sst/sst_drv_interface.c +++ b/sound/soc/intel/atom/sst/sst_drv_interface.c @@ -487,7 +487,7 @@ static inline int sst_calc_tstamp(struct intel_sst_drv *ctx, fw_tstamp->ring_buffer_counter); dev_dbg(ctx->dev, "mrfld hardware_counter %llu in bytes\n", fw_tstamp->hardware_counter); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) delay_bytes = (size_t) (fw_tstamp->ring_buffer_counter - fw_tstamp->hardware_counter); else diff --git a/sound/soc/intel/boards/bdw-rt5650.c b/sound/soc/intel/boards/bdw-rt5650.c index 3c7cee03a02e6..a5df4d3067d71 100644 --- a/sound/soc/intel/boards/bdw-rt5650.c +++ b/sound/soc/intel/boards/bdw-rt5650.c @@ -150,7 +150,7 @@ static int bdw_rt5650_fe_startup(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; /* Board supports stereo and quad configurations for capture */ - if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(substream)) return 0; runtime->hw.channels_max = 4; diff --git a/sound/soc/intel/boards/sof_maxim_common.c b/sound/soc/intel/boards/sof_maxim_common.c index fcc3b95e57a4f..f520442bbb096 100644 --- a/sound/soc/intel/boards/sof_maxim_common.c +++ b/sound/soc/intel/boards/sof_maxim_common.c @@ -196,7 +196,7 @@ static int max_98373_trigger(struct snd_pcm_substream *substream, int cmd) int ret = 0; /* set spk pin by playback only */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) return 0; cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index e5feaef669d14..778190cbe3dbc 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -671,7 +671,7 @@ int sdw_hw_params(struct snd_pcm_substream *substream, return 0; /* Identical data will be sent to all codecs in playback */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ch_mask = GENMASK(ch - 1, 0); step = 0; } else { @@ -1731,8 +1731,8 @@ static int create_sdw_dailink(struct snd_soc_card *card, WARN_ON(i != num_cpus || j != num_codecs); - playback = (stream == SNDRV_PCM_STREAM_PLAYBACK); - capture = (stream == SNDRV_PCM_STREAM_CAPTURE); + playback = snd_pcm_is_playback(stream); + capture = snd_pcm_is_capture(stream); init_dai_link(dev, *dai_links, be_id, name, playback, capture, cpus, num_cpus, codecs, num_codecs, diff --git a/sound/soc/intel/boards/sof_sdw_maxim.c b/sound/soc/intel/boards/sof_sdw_maxim.c index b7f73177867f4..b3d51d345964f 100644 --- a/sound/soc/intel/boards/sof_sdw_maxim.c +++ b/sound/soc/intel/boards/sof_sdw_maxim.c @@ -51,7 +51,7 @@ static int mx8373_enable_spk_pin(struct snd_pcm_substream *substream, bool enabl int j; /* set spk pin by playback only */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) return 0; cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); diff --git a/sound/soc/intel/catpt/pcm.c b/sound/soc/intel/catpt/pcm.c index 81a2f0339e055..c32c101e65b9c 100644 --- a/sound/soc/intel/catpt/pcm.c +++ b/sound/soc/intel/catpt/pcm.c @@ -83,11 +83,11 @@ catpt_get_stream_template(struct snd_pcm_substream *substream) /* account for capture in bidirectional dais */ switch (type) { case CATPT_STRM_TYPE_SYSTEM: - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) type = CATPT_STRM_TYPE_CAPTURE; break; case CATPT_STRM_TYPE_BLUETOOTH_RENDER: - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) type = CATPT_STRM_TYPE_BLUETOOTH_CAPTURE; break; default: diff --git a/sound/soc/intel/keembay/kmb_platform.c b/sound/soc/intel/keembay/kmb_platform.c index 37ea2e1d2e922..eab7b8223b51b 100644 --- a/sound/soc/intel/keembay/kmb_platform.c +++ b/sound/soc/intel/keembay/kmb_platform.c @@ -170,7 +170,7 @@ static inline void kmb_i2s_disable_channels(struct kmb_i2s_info *kmb_i2s, u32 i; /* Disable all channels regardless of configuration*/ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { for (i = 0; i < MAX_ISR; i++) writel(0, kmb_i2s->i2s_base + TER(i)); } else { @@ -184,7 +184,7 @@ static inline void kmb_i2s_clear_irqs(struct kmb_i2s_info *kmb_i2s, u32 stream) struct i2s_clk_config_data *config = &kmb_i2s->config; u32 i; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { for (i = 0; i < config->chan_nr / 2; i++) readl(kmb_i2s->i2s_base + TOR(i)); } else { @@ -199,7 +199,7 @@ static inline void kmb_i2s_irq_trigger(struct kmb_i2s_info *kmb_i2s, u32 i, irq; u32 flag; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) flag = TX_INT_FLAG; else flag = RX_INT_FLAG; @@ -270,7 +270,7 @@ static int kmb_pcm_trigger(struct snd_soc_component *component, switch (cmd) { case SNDRV_PCM_TRIGGER_START: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { kmb_i2s->tx_ptr = 0; kmb_i2s->tx_substream = substream; } else { @@ -279,7 +279,7 @@ static int kmb_pcm_trigger(struct snd_soc_component *component, } break; case SNDRV_PCM_TRIGGER_STOP: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) kmb_i2s->tx_substream = NULL; else kmb_i2s->rx_substream = NULL; @@ -378,7 +378,7 @@ static snd_pcm_uframes_t kmb_pcm_pointer(struct snd_soc_component *component, struct kmb_i2s_info *kmb_i2s = runtime->private_data; snd_pcm_uframes_t pos; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) pos = kmb_i2s->tx_ptr; else pos = kmb_i2s->rx_ptr; @@ -419,7 +419,7 @@ static inline void kmb_i2s_enable_dma(struct kmb_i2s_info *kmb_i2s, u32 stream) dma_reg = readl(kmb_i2s->i2s_base + I2S_DMACR); /* Enable DMA handshake for stream */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) dma_reg |= I2S_DMAEN_TXBLOCK; else dma_reg |= I2S_DMAEN_RXBLOCK; @@ -433,7 +433,7 @@ static inline void kmb_i2s_disable_dma(struct kmb_i2s_info *kmb_i2s, u32 stream) dma_reg = readl(kmb_i2s->i2s_base + I2S_DMACR); /* Disable DMA handshake for stream */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { dma_reg &= ~I2S_DMAEN_TXBLOCK; writel(1, kmb_i2s->i2s_base + I2S_RTXDMA); } else { @@ -451,7 +451,7 @@ static void kmb_i2s_start(struct kmb_i2s_info *kmb_i2s, /* I2S Programming sequence in Keem_Bay_VPU_DB_v1.1 */ writel(1, kmb_i2s->i2s_base + IER); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) writel(1, kmb_i2s->i2s_base + ITER); else writel(1, kmb_i2s->i2s_base + IRER); @@ -474,7 +474,7 @@ static void kmb_i2s_stop(struct kmb_i2s_info *kmb_i2s, /* I2S Programming sequence in Keem_Bay_VPU_DB_v1.1 */ kmb_i2s_clear_irqs(kmb_i2s, substream->stream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) writel(0, kmb_i2s->i2s_base + ITER); else writel(0, kmb_i2s->i2s_base + IRER); @@ -556,7 +556,7 @@ static void kmb_i2s_config(struct kmb_i2s_info *kmb_i2s, int stream) kmb_i2s_disable_channels(kmb_i2s, stream); for (ch_reg = 0; ch_reg < config->chan_nr / 2; ch_reg++) { - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { writel(kmb_i2s->xfer_resolution, kmb_i2s->i2s_base + TCR(ch_reg)); @@ -678,7 +678,7 @@ static int kmb_dai_prepare(struct snd_pcm_substream *substream, { struct kmb_i2s_info *kmb_i2s = snd_soc_dai_get_drvdata(cpu_dai); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) writel(1, kmb_i2s->i2s_base + TXFFR); else writel(1, kmb_i2s->i2s_base + RXFFR); @@ -695,7 +695,7 @@ static int kmb_dai_startup(struct snd_pcm_substream *substream, if (kmb_i2s->use_pio) return 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dma_data = &kmb_i2s->play_dma_data; else dma_data = &kmb_i2s->capture_dma_data; @@ -713,7 +713,7 @@ static int kmb_dai_hw_free(struct snd_pcm_substream *substream, if (kmb_i2s->use_pio) kmb_i2s_clear_irqs(kmb_i2s, substream->stream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) writel(0, kmb_i2s->i2s_base + ITER); else writel(0, kmb_i2s->i2s_base + IRER); diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c index 613b27b8da134..2ffd511eedfe4 100644 --- a/sound/soc/intel/skylake/skl-pcm.c +++ b/sound/soc/intel/skylake/skl-pcm.c @@ -189,7 +189,7 @@ int skl_pcm_link_dma_prepare(struct device *dev, struct skl_pipe_params *params) snd_hdac_ext_stream_setup(stream, format_val); stream_tag = hstream->stream_tag; - if (stream->hstream.direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream->hstream.direction)) { list_for_each_entry(link, &bus->hlink_list, list) { if (link->index == params->link_index) snd_hdac_ext_bus_link_set_stream_id(link, @@ -225,7 +225,7 @@ static int skl_pcm_open(struct snd_pcm_substream *substream, * disable WALLCLOCK timestamps for capture streams * until we figure out how to handle digital inputs */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { runtime->hw.info &= ~SNDRV_PCM_INFO_HAS_WALL_CLOCK; /* legacy */ runtime->hw.info &= ~SNDRV_PCM_INFO_HAS_LINK_ATIME; } @@ -319,7 +319,7 @@ static int skl_pcm_hw_params(struct snd_pcm_substream *substream, p_params.host_dma_id = dma_id; p_params.stream = substream->stream; p_params.format = params_format(params); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) p_params.host_bps = dai->driver->playback.sig_bits; else p_params.host_bps = dai->driver->capture.sig_bits; @@ -574,7 +574,7 @@ static int skl_link_hw_params(struct snd_pcm_substream *substream, p_params.link_index = link->index; p_params.format = params_format(params); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) p_params.link_bps = codec_dai->driver->playback.sig_bits; else p_params.link_bps = codec_dai->driver->capture.sig_bits; @@ -645,7 +645,7 @@ static int skl_link_hw_free(struct snd_pcm_substream *substream, if (!link) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { stream_tag = hdac_stream(link_dev)->stream_tag; snd_hdac_ext_bus_link_clear_stream_id(link, stream_tag); } @@ -1193,7 +1193,7 @@ static snd_pcm_uframes_t skl_platform_soc_pointer( * or greater than period boundary. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { pos = readl(bus->remap_addr + AZX_REG_VS_SDXDPIB_XBASE + (AZX_REG_VS_SDXDPIB_XINTERVAL * hdac_stream(hstream)->index)); @@ -1226,7 +1226,7 @@ static u64 skl_adjust_codec_delay(struct snd_pcm_substream *substream, codec_nsecs = div_u64(codec_frames * 1000000000LL, substream->runtime->rate); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) return nsec + codec_nsecs; return (nsec > codec_nsecs) ? nsec - codec_nsecs : 0; diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index 602ef43211221..cb51b98b92c9a 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c @@ -198,7 +198,7 @@ static void skl_tplg_update_params_fixup(struct skl_module_cfg *m_cfg, in_fmt = &m_cfg->module->formats[m_cfg->fmt_idx].inputs[0].fmt; out_fmt = &m_cfg->module->formats[m_cfg->fmt_idx].outputs[0].fmt; - if (params->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(params->stream)) { if (is_fe) { in_fixup = m_cfg->params_fixup; out_fixup = (~m_cfg->converter) & @@ -618,9 +618,9 @@ skl_tplg_get_pipe_config(struct skl_dev *skl, struct skl_module_cfg *mconfig) } if ((pipe->conn_type == SKL_PIPE_CONN_TYPE_FE && - pipe->direction == SNDRV_PCM_STREAM_PLAYBACK) || + snd_pcm_is_playback(pipe->direction)) || (pipe->conn_type == SKL_PIPE_CONN_TYPE_BE && - pipe->direction == SNDRV_PCM_STREAM_CAPTURE)) + snd_pcm_is_capture(pipe->direction))) in_fmt = true; for (i = 0; i < pipe->nr_cfgs; i++) { @@ -1612,7 +1612,7 @@ int skl_tplg_update_pipe_params(struct device *dev, if (skl->nr_modules) return 0; - if (params->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(params->stream)) format = &mconfig->module->formats[mconfig->fmt_idx].inputs[0].fmt; else format = &mconfig->module->formats[mconfig->fmt_idx].outputs[0].fmt; @@ -1642,7 +1642,7 @@ int skl_tplg_update_pipe_params(struct device *dev, return -EINVAL; } - if (params->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(params->stream)) { res->ibs = (format->s_freq / 1000) * (format->channels) * (format->bit_depth >> 3); @@ -1666,7 +1666,7 @@ skl_tplg_fe_get_cpr_module(struct snd_soc_dai *dai, int stream) struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(dai, stream); struct snd_soc_dapm_path *p = NULL; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { snd_soc_dapm_widget_for_each_sink_path(w, p) { if (p->connect && p->sink->power && !is_skl_dsp_widget_type(p->sink, dai->dev)) @@ -1745,7 +1745,7 @@ skl_tplg_be_get_cpr_module(struct snd_soc_dai *dai, int stream) struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(dai, stream); struct skl_module_cfg *mconfig; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { mconfig = skl_get_mconfig_pb_cpr(dai, w); } else { mconfig = skl_get_mconfig_cap_cpr(dai, w); @@ -1813,7 +1813,7 @@ static int skl_tplg_be_fill_pipe_params(struct snd_soc_dai *dai, goto err; dev_dbg(skl->dev, "%s using pipe config: %d\n", __func__, pipe->cur_config_idx); - if (pipe->direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(pipe->direction)) pipe_fmt = &pipe->configs[pipe->cur_config_idx].out_fmt; else pipe_fmt = &pipe->configs[pipe->cur_config_idx].in_fmt; @@ -1903,7 +1903,7 @@ int skl_tplg_be_update_params(struct snd_soc_dai *dai, { struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(dai, params->stream); - if (params->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(params->stream)) { return skl_tplg_be_set_src_pipe_params(dai, w, params); } else { return skl_tplg_be_set_sink_pipe_params(dai, w, params);