From patchwork Mon Aug 5 00:41:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13753012 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 2969FC3DA64 for ; Mon, 5 Aug 2024 01:04:09 +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 0E9AE57B1; Mon, 5 Aug 2024 03:00:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0E9AE57B1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819631; bh=dtDxKYXzaihL07zyBf0CI5eVsPGd9MgBvDVOdQKRi/g=; 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=N2uiYjjGFIAE+wJe37FXk21vAcVgQwuWmZ7nf52AU6pg38kAO190jaTEybzl7AA7q JkzyJlg5hEo/X3iD6URBzd/SABE+Y61pHzAHtaJkw8swarc3OOBfJ8zPrQFDXqg54B RIr7j/QQT+yTymHE0b28zx8OCwZidNUR8IsiZmb4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8C0C1F807B5; Mon, 5 Aug 2024 02:42:13 +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 D9BFBF80764; Mon, 5 Aug 2024 02:42:12 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 160CCF806ED; Mon, 5 Aug 2024 02:42:07 +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 CEE3BF80580 for ; Mon, 5 Aug 2024 02:42:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CEE3BF80580 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=VhrSM1sC ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GtC07e+6QloRzbc+PxGIwigQirH7AdOg8D3Ht6bTnLltMuhtDPlSe+p21CJnHA0FXXVihbcB25sxR1c1yFQMQo/mSbgcXJVJMsk2fQp4G93zhOI8XzyFr5ThcVE/wlU+Q2G3UNgCujHuHDunJAyJxQp7Qy/zvWrIIH7Vs4C9qpIKIeyFmbcFKFeRpCtD1+a61iupQiyJBWmAzcnTmhY+hXxyWTzPLM8WvStwPMazvhXS5cSzR80UULxLafos4+Ag0x4u7hdvbKMmgoHAMN4af2R9dHEUKXaYXtWIHO5sVaq3VPv742yt1EVSZWZG9aleewfMMwjecnY6pXiVPG95DA== 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=aF+P81Oto2g4Ejdeqj2vWGlqxdj4i0+OPE7KNSz9NwE=; b=KOZ1dz1/C9B/7yEVGKiHJ2AxFhwXZ9lT8KxklaSisqvW/c2BeFJfHGHgCYvy1IOiEcMRQoyhrtAGEacthKGTgMCxUh8Zo52E33kwHRAvljLaCFouqJqF/QTsCQbsMPx3rh6PQdniKeD3valYNiQmYQCQCARy+TD4V4Qv6wUns9OP+TkquH+FhCKzUnAV64IkwVyxyStzflbBFeFTiybnM3bl/baMmWac0fVl3lqBPg/KAFmcy//dmdzfHTMHoVrxm5LxjCrblA/9KffdTMJUZ5xMiq8ghzbNUEF/CmxRTs4BHGcXc1GkK1hoip4EbyKkd2jVo491moOGJXN861Rm6A== 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=aF+P81Oto2g4Ejdeqj2vWGlqxdj4i0+OPE7KNSz9NwE=; b=VhrSM1sC1KZ6K+ACrOBQc1iBMCq7BeDon2jMDBsTEF1wMOREaK51IKcbbAIrCkd26eWZy6FISId1txOHCtcOiWLVUhKpW/q3Mxo6dXnNU+czPsuWF8VrS7TA7Ya1x1RWKP2HZ68pH0uZwyXfMH0t5FucyHyDYeCd84Kn2k6QMwY= 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 TYCPR01MB8678.jpnprd01.prod.outlook.com (2603:1096:400:15a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Mon, 5 Aug 2024 00:42:00 +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:41:59 +0000 Message-ID: <87y15bx0kp.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 079/113] ASoC: codecs: ak46xx: 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:41:58 +0000 X-ClientProxiedBy: TYCP286CA0340.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:38e::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_|TYCPR01MB8678:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a6d85b1-7728-4b09-cd8a-08dcb4e76a24 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: 7U3QtWjGcbKvs86ZzMh7LLOIxrQanDFpbv4AQER9smEHoW7R1lcf/zL2kXvAuAqgZHf+zF9GnwMv8EbXdhlkLGeYJModKlfJ7DiNKDEtzrt+8q+qzJZw6rWxRKr3tDi7HmmKuW+1oAAAkl8z6L1/Sr7MZCBXvju01cyyVuzvuxHwdtqgtVY12+qDz/PPpnlJaXRx1XzTgwP71gaqZZCSIJ2Fk6hzF0ve2tjJ4DtrMV/8RVK7yDFb60qpj/PtoagYsJmxX6lfTi+Ve0ffKLhPY+eIKNAfdE8mmQ2NJvrHeTfzE9B/1jHmsfCaa8a1jJCqBH0+1B/C3PQKjU9d5YIlMEdopiP5P/C4uekIlJpEHcWuw4s7jfslYg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;CTRY:;LANG:en;SCL: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: jLc7e0z1bLMhvWj1WkmDd1Z3VPCsoLXMsAXes0pMekLJasxVJwOpeaGdXmg4TUFsu1Z7g7QNJ2liifG06cxDDOAaZw0m/4yZki97Ib/ywFx+EHFZE4a2KviW0JF7oAFuYt39MIqDycn8hgiyEF4JcZcXFQk/JHGZE4I/dDf+ylecI4Pz/Taz1ffoc2hUEHrxC/nKLFSPUgRYXXLCo/GDU1AFWBRRZDpMGJCpeQt0M/rkilqiH7ZwfP9loukjV1x9cUwfIHIlOTIJ1jfK/BxhdNZZ1oDwpxZRFeovOIEIaWCUAb9sqQ2n74yFSUj47Se8RAKkbgKkolSntZD7ouWC+PgZ3lWV8T1ywXQmwtTMVlNlHQDP0GYALrHgm8kgfTokL1Wl/oqBn701Bm5ehid4GjY84lxPTftEVbX3JogGTHiwktPbaS3YKKtA43XH6JkTmEQXOPZlY+/O/f2XxVWNN9sbjMY5OrcvaIOgWyadCIxO1P/EiWH6fqSLMnJQ06CDzh0WH8l6y58YKvncBe7oc0Fp+NfLomA2bmI9uE+eOMEURs8+UeAae4Dgn6LPQVM9lTnJyQrF+0Ni3uMcapFVF7Yqqt4qKfLj761Gb5AcAF83HpE0kgr6BcFQUfyvmfPllcXes4PISCGl00l178Xjs6K7GbhLH0B+tgVUuM92crtdEu5SkSu/kryZLNjcdje1LiXQHOiuDMrYkFMfrF9lPA9waKZIk2STYBdIVWs0RbEHO7m3ti/4XZAdbGX6itUts/53qEgWfjv8wwVapbbst8OfJTWhiPtTtHF7Ia2yAJAGB8MLBqUNDCZvCVHut94jIETtkDnsGMwcTeoblNqLwmYB3vYG4/02kCbHxY0ZeF9g3igRv7k2OWL992AEvD33P8vzuI87bpRze0fcVjA3Olb7wsZY8A2AWpCZ2b1o0iR+9TSK3nnzIIxOteWCNoWilF6ywBzK/I2g9H119tCFVJgzWg3sIv6xemb60k4tzzuktS9QDbvwV8u67beWjkDEBfiTh5co10k2lmUjlqap1avwN9E9XVeGGeuwDsu6dh27nDN6k5ni47BcE2YrEc7rA7lJ2IYaj/hFxtPoCXs+4bTIxxPEC9ljWWCP08sgENn3mmiXD6JEDHZJ9epbpfv9fBoRqplAB4qZvmwM/cAGSddp3qu3ZpUhIoNYkKwju4KGo669eDx3JlyqgZoi9rEFdf64ZXP+n3yuGS2WAMqAUzAzviz3pzjbOY+fUTT5vPWrZG/GQBwo+LpZHWPkoytDEwFlxExOhc1LloQF0IETRIzJCYWm+Q2n3a83munnpC3lF+5oGAXBFZYDXM/ouGxd+volzfcBHUigZNfS3lsbkOaFwje4aJfxyFXeUEf/Yn4Ndki/0TNVfSRLd26qHIVR7Y1MsnRpU15No046sm0QLBze9Y5ZT9SvOgQ/UH7Pr5GYGqjAKJrJ6QHEZ2go4CQQTM8no8jjdlHB/LWOenBSuwMZPXCpsvqidbEAbWqYKv5YtiOKi1C9O4bDasFWRo+U2yiQhuq8vhHT8Lx/xuWDn7g4Ez4VJT3c+kGM29Zp3S0OOEWK647yrFhIOgR02Rw6YtFtCOJyGfy5NfbE3MCHmTKiuVY5ewJY3SyLx0/tj3k= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a6d85b1-7728-4b09-cd8a-08dcb4e76a24 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:41:59.8434 (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: uE4UZv8x0LlS1hAWpUwx95LEirohPD9OGfZyktUuX62Q7M08Z2vgyDFRpJJ2AVwHhIUushJ0E8DWziPobedJU/XG1f/IRov6BTEuHPeqNJnIDl+OliI2aM3heBtYnG5H X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB8678 Message-ID-Hash: 5PI2JFRVED6R7WLFFLQTU3MXOU75HK7L X-Message-ID-Hash: 5PI2JFRVED6R7WLFFLQTU3MXOU75HK7L 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/codecs/ak4613.c | 4 ++-- sound/soc/codecs/ak4619.c | 2 +- sound/soc/codecs/ak4641.c | 2 +- sound/soc/codecs/ak4642.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/ak4613.c b/sound/soc/codecs/ak4613.c index de9e431855559..3d73c659545d1 100644 --- a/sound/soc/codecs/ak4613.c +++ b/sound/soc/codecs/ak4613.c @@ -434,7 +434,7 @@ static void ak4613_hw_constraints(struct ak4613_priv *priv, unsigned int mask; unsigned int mode; unsigned int fs; - int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + int is_play = snd_pcm_is_playback(substream); int sdti_num; int i; @@ -739,7 +739,7 @@ static int ak4613_dai_trigger(struct snd_pcm_substream *substream, int cmd, (cmd != SNDRV_PCM_TRIGGER_RESUME)) return 0; - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return 0; priv->component = component; diff --git a/sound/soc/codecs/ak4619.c b/sound/soc/codecs/ak4619.c index 8f2442482f725..1d63e5c447e1b 100644 --- a/sound/soc/codecs/ak4619.c +++ b/sound/soc/codecs/ak4619.c @@ -538,7 +538,7 @@ static int ak4619_dai_hw_params(struct snd_pcm_substream *substream, unsigned int width; unsigned int rate; unsigned int fs; - bool is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool is_play = snd_pcm_is_playback(substream); u8 dai_ctrl = 0; u8 clk_mode = 0; diff --git a/sound/soc/codecs/ak4641.c b/sound/soc/codecs/ak4641.c index ec33e7d73c6c2..179d391083c57 100644 --- a/sound/soc/codecs/ak4641.c +++ b/sound/soc/codecs/ak4641.c @@ -344,7 +344,7 @@ static int ak4641_i2s_hw_params(struct snd_pcm_substream *substream, snd_soc_component_update_bits(component, AK4641_MODE2, (0x3 << 5), mode2); /* Update de-emphasis filter for the new rate */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ak4641->playback_fs = rate; ak4641_set_deemph(component); } diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c index fe035d2fc9131..9cf3bc9387b13 100644 --- a/sound/soc/codecs/ak4642.c +++ b/sound/soc/codecs/ak4642.c @@ -277,7 +277,7 @@ static const struct reg_default ak4648_reg[] = { static int ak4642_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + int is_play = snd_pcm_is_playback(substream); struct snd_soc_component *component = dai->component; if (is_play) { @@ -320,7 +320,7 @@ static int ak4642_dai_startup(struct snd_pcm_substream *substream, static void ak4642_dai_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + int is_play = snd_pcm_is_playback(substream); struct snd_soc_component *component = dai->component; if (is_play) {