From patchwork Mon Aug 5 00:39:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816785 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 (unknown [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 DCD35C3DA7F for ; Mon, 5 Aug 2024 00:55:18 +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 DD79849F7; Mon, 5 Aug 2024 02:52:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DD79849F7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819165; bh=MrHl/wFqz544WiV37Y+wTgj5w019RkGulZzw7fG22+0=; 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=hFTWT/pn0KG6Xb2lAPXupzsyUxzA15eIY2GlmHbnaR7xRRe90gGG7GQ35eYs66ujO +mZbmVIvTfbCYgtNORkYZvEcFaOsn6jaoJHm6ICwi8rmk0RtlfEite1lndfvGRG64b 5otToiEjBN12wAer5IB7iyvm0CPuP1V0llX8GRGU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6B52EF89A1B; Mon, 5 Aug 2024 02:40:15 +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 2F0F2F89755; Mon, 5 Aug 2024 02:40:15 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 963E0F805D9; Mon, 5 Aug 2024 02:39:50 +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 CA3DEF8962F for ; Mon, 5 Aug 2024 02:39:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CA3DEF8962F 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=aaJOL9OU ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YLBswOE90iVRHAlWDmB9BFKK33L0ktmCRWVMt7u/u8P41lZD2Uy/uNH8EZ36iHJi0ZTsTuqaK0McR4Oi7mY4SvPSGDL9B3crzt9+qp7P3yA8v9sJ/amGRliYhDEbB3t6hB8aWVSOTsEcSsH13wxUfeIvMpg85BK1EvNN4AWkKmaUKNoJ7Cs5+yF8nssbQJXCXBVNw6MYR4IQNyvJYgxC8N15+5ueWFhnF9/OBUgaPFRJsmIByOqnDbJfbt2ATmJIm3GXq4mzLk13P+0fxEIg5iDzBSZ3CflD9gx6EZrCeh2tC4Rm9QiJZKFE8gMiyxs/AaIcqdtpdjs8w6J/SGsEyg== 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=Wzvkin/sh7n7ol9McnO397vFmn+9c0d3PNkl1UBzJNk=; b=Xy69s3/SWY+etRzcM2GwWGv7D1yKyEEzmAtcd1miJ1kJcW3L+LbMb4aHo1Thn9wwhPLV37QVtXIQF6gk9rwUXNDB735m9oS6VvaGKwSoFPAbI/cM3IDgGEvEKm0/e7C3+EGzUSm6r4TMw7+51B5dlOXRvlU6MK5ovimDoUFjsMio0u0fTW4ASje6CxrZWHCWbONN0l0cPr/tsmpBjTU8nbueW2/KTA6+XOekd7Bz1gc7rIIh6DM3AnbBphNwGZPwY4MiDnRkPMlRG0qnm5ITzMTmAKc1ugf0Irm0RH+iBeFKceOwgngVnYU636hdDWJlZSFSWaQVH7pc0GbgQeJ7Ig== 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=Wzvkin/sh7n7ol9McnO397vFmn+9c0d3PNkl1UBzJNk=; b=aaJOL9OUaL44qTpoBcfrfuLYbE67lKmQs7djpJCkw36fErAYHPSnlD3s5ZPDyD4mP5hFrCX078O/T1XnJwxWoE2Da/c+EEercws1F4H79sqLcpCwYkuXLpOSn0Mbl8ahxtws5gmcshGDjoFSH28CR4MnNWo6/K7Y+1bv3zxUYo4= 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 OSZPR01MB9459.jpnprd01.prod.outlook.com (2603:1096:604:1d0::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.25; Mon, 5 Aug 2024 00:39:32 +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.7828.023; Mon, 5 Aug 2024 00:39:32 +0000 Message-ID: <87zfpryf97.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 053/113] ASoC: stm: use snd_pcm_is_playback/capture() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-staging@lists.linux.dev, Linux-ALSA In-Reply-To: <874j7z3j1a.wl-kuninori.morimoto.gx@renesas.com> References: <874j7z3j1a.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 5 Aug 2024 00:39:32 +0000 X-ClientProxiedBy: TYCP301CA0002.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:386::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_|OSZPR01MB9459:EE_ X-MS-Office365-Filtering-Correlation-Id: 7053ef70-af0f-4dd2-7315-08dcb4e712d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: luXP+S75Ltxqs85jYbuywxzRaQVTAR3e/z10gf5bgxwolhfvrl+h/tLw1FG2y2sDeRQJOPEr/NyZ/D5KO/+jwESF5D3TOUtnaHBDpRC1vk1gmlBSN4BJNdqOhZKxURB9JNsGGWGp8K5ZrttCc09YJINhBUPcRH0QsyfQC1Pkrb76OpJi+RwVXqJemep6jc07zeGbXx1fWtr2w147vVwX/w1Rl3Y2NrY/wdUEP8yL7dNf7CDq898A3bDdz4pdySU7yTTIIQsHaZu0/FKPLJlBKoMYfgsUgTE2jIe1DTGpoG2DIE/oPSb+Njjn/ccGVtllKT3QWxQbc07D1Mces91vtw6lAysN2Nm8KKfSn32xAg6oFqmVFibftCKZXaxHgK7bDbGGlJergtvfrq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L:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: D/TofCWSOdLuqp4BkB2mKhx1PZWXquU64v7bf5s/CTjBwfjYf7JUXL1TlonjyFTDSibBCbp84z4oUk8OC4uv5W8IZqVmx2onredWr4g94EUedtl9xROPzd7FZq2WRNA+mUzUSSxTSeZXw388nQpFD1EZ9sKcbXjx0l/AcT8/r6vxSv2Tp4Beiap5cekOJ08Ke4PSitWTnOqikEVTJSqxd0EeenByqfZqUxVFAA2fcL8CYm4WYIztAR5TXAe65CLihC8jGDqsl65MpybWflVhbGIFM72EXB50y2jawQr4yMPjynBM0BMaoLpqggnUpsbLbFh/Oriu8DUrVIcTZ3Z/34r4dYN/waYrGGbtUYkG7MMl7oA5g+LqPRnnlQOFjMs6cfbkL3I36xW2vOQCH+0SH8aGdut2kkVaYkNRaCNSRnmFL4fZa100mmTYInWxLs3Ghr8p14zTN0JaNtftYNWnNhDXzcTsSrHA7+c2UJU+jRYDPyjx4/6acbVU15G2jjgRvUegPPu1T5ULKOcWNMZwYIfAaIjxDuQNIS7IQJk/GomTyNFtzkrrW3QRgFnFD9hQqDbyzRCfpVJot47UWgrcsVTXPsgJVc+mXZj8odh+b5A2FObHKkdi6cwtVI17lwZ45uQ5ywFz3qlpPPhqxqCWc+GRGBMw5KmhmptxapGc0FEu/qB2zZfEdOUr1cM90u4dDmJBbvyLNFaxaPQbXk27WyRguSDUQ5+9hQurF/ic0FY7dxJ2OjtAEri6emNfAXI+YvQ5+3N33FXwk3JgeEELMsp2PYG9FmxXmWmomYHACxTzWgZQm0ggIMmLfTzdsHiSQDVXKB7n9bwdXAqojb8sGATmfSCkGOSe0hXJawhtbe+NmHWRyNXHgmrsAyR7Cu5GvDDzkHg5EzSjWkQsy5GsoQApPMcKTUS9MFRpw1C1W0ApEMFCE88vz/UTploljG4WcJ0KqEjz112jEUSriPVfTqFhPhGXxYepiCENEiIg052JR279PMVq8rdGCabD/4IlRqLnrgPE8Hk5kw+dzghTKpREVrpGrsmOs2q+qF5kr3LWTMfzlCzqu+V0+IUwIZAfVabJ16eKyDTvY2XSgYonMKgxM7+kl12RGsGMX4e83BYzpSa0SLp/00oX3I4LiC7A2U+RsefMEr9kPklGJm3Y9C/mFofwJ772Efva0SlxIxMJ4ZFrBU4LRVNfV8QEAo8CRz73ciLsGmgPcxQO2S1D5YXSyqQPR7p3LMRnEg+5lZwDHZlxvm8ESQut72/6QGc8X5hrA8wFcx0VY3P+bgF19oYQmSXk5zeq0TjsDApTj3UiL4VxeMybEQNvyYc7LoZypBOTJzo4EDEXaTA8lNEGWdbgDOWN1G4O5zt29ED+EGBA/0kHY0b5f2p3HdnqnckY81AekVcE+QqNe0bghlQ4cGABZj2ORCiSbDnGE+lLmyE8XUKJpTcbkpeUwpC70CkMTRQsF4Y7Yog5bhciE4026/Ec2fOSArLgZXeu60+PC7zlpmSfYCHXJdJyYnq4ZdVvtQ83FUdKroPr7PfIBZq7wf5ytI+b9TwK8B8T4tk7Vj+Mjcv5vgWpoZBO6TAc/FDYeaiYNkZ86N28f1TeU3tdZGjnOEFNttSc9y0xyuAeclE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7053ef70-af0f-4dd2-7315-08dcb4e712d7 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 00:39:32.7240 (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: ApiAjgKGyvHGMt3T9HQ9egOuhupBy405GO/FUdK4Y1pV9MH2YQWeIW5Szjo3Nw/4J9wxRINz1/8GvXZimuzdtjc203qDdrZgdTxQbREJiLAFtDCLKoMOUI2Izw+M8Pmp X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 Message-ID-Hash: GPX2YZU5HGEGLGHCTHVMR4OA3QRUQPH7 X-Message-ID-Hash: GPX2YZU5HGEGLGHCTHVMR4OA3QRUQPH7 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/stm/stm32_i2s.c | 2 +- sound/soc/stm/stm32_sai_sub.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c index a96aa308681a2..d6654fc9f1a7c 100644 --- a/sound/soc/stm/stm32_i2s.c +++ b/sound/soc/stm/stm32_i2s.c @@ -813,7 +813,7 @@ static int stm32_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *cpu_dai) { struct stm32_i2s_data *i2s = snd_soc_dai_get_drvdata(cpu_dai); - bool playback_flg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool playback_flg = snd_pcm_is_playback(substream); u32 cfg1_mask, ier; int ret; diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c index ad2492efb1cdc..ff8d98e574f2b 100644 --- a/sound/soc/stm/stm32_sai_sub.c +++ b/sound/soc/stm/stm32_sai_sub.c @@ -38,8 +38,8 @@ #define STM_SAI_DAI_NAME_SIZE 15 -#define STM_SAI_IS_PLAYBACK(ip) ((ip)->dir == SNDRV_PCM_STREAM_PLAYBACK) -#define STM_SAI_IS_CAPTURE(ip) ((ip)->dir == SNDRV_PCM_STREAM_CAPTURE) +#define STM_SAI_IS_PLAYBACK(ip) snd_pcm_is_playback((ip)->dir) +#define STM_SAI_IS_CAPTURE(ip) snd_pcm_is_capture((ip)->dir) #define STM_SAI_A_ID 0x0 #define STM_SAI_B_ID 0x1 @@ -1406,7 +1406,7 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev, sai->spdif = false; if (of_property_present(np, "st,iec60958")) { if (!STM_SAI_HAS_SPDIF(sai) || - sai->dir == SNDRV_PCM_STREAM_CAPTURE) { + STM_SAI_IS_CAPTURE(sai)) { dev_err(&pdev->dev, "S/PDIF IEC60958 not supported\n"); return -EINVAL; }