From patchwork Mon Aug 5 00:42:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13753022 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 9855BC3DA64 for ; Mon, 5 Aug 2024 01:07: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 27E554E23; Mon, 5 Aug 2024 03:02:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 27E554E23 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819780; bh=6rdcYnuY0bGVLBKs+kUhLnWK/315W4nTizK0dpx1Sic=; 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=O7FiRb8rE+A+Vl0qyl16v/HwgnFT1D/EZZ0Y7kUAoeOTqbMzEUnD5mJdhqLeCQmeu thvT5aK1wKUo0dw5vUt1m6orlufRNgu1b5UJw4AhRmJowV7bgvl/AsLXWtbGvFNRW3 ba2uoEpVqqiGfDKECA/2QyG/R8aE1bazNlILzNHA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 00F94F89DC7; Mon, 5 Aug 2024 02:43:09 +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 90D16F89DD3; Mon, 5 Aug 2024 02:43:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5ADEEF89D88; Mon, 5 Aug 2024 02:43:01 +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 CB886F80C87 for ; Mon, 5 Aug 2024 02:42:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CB886F80C87 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=bW+iltDs ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=X0Xsa/NqZnbCXj47F480udIpS39wD81GYuV4cPNACfbkR2egjfivVTKalepW3tUcmVxwPjy1wPfy0wMLK94o90zexFx/vqM65Yf99uo+PfSRFqQv3LfKmHSal5TQ730TX9cAMfU6hLJx8M5fuAXG4Nx/67hLaWbcAlHzg96t+SFe8AkaTYT+PJyytQZRvpW4KbG8/2anRUwuIydcOkeuJYkwm9u3cTdI1fMN2x2jPgaAo4FVkkqwzS1so1x4bW02KjLKVkF2pkge0bYhY5AsSd1Zp1eUZW8gR7E0fsdjIZAfMCaRhBsCOmOLdHJ+ik2RsN0wdOxs9DLxVYhqrZfl7Q== 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=hDJXe/9zg8fO4KEhqRvLKCtYhFFcnAsHTPvjuYoZwIg=; b=YT0fZwpA0gvZ48l9ibpAF/iu1JICNllwO3ZMUK6F0Bq/B+lAN/WkRDIoNEiDsrg8hPQMb+lUCSOpVc16I1h6WUmvCqGrnpe2S+L5UzL4IogZVYYJMnkL09nzs5TQlhhO9TzOJe6B5yizhc7UYYi6uaE7M4K98yVzK/AvtGpDJawvGdwSuEygIQREZBLWGCRrVyLI0HaYduUcVJxmKUX6Lui4PSEvKidBJrYsdUvLfyMJaBkA4mqks33R6hqtF3vKmVvvwPSDfRa7QTt5uedbswgSCd3UBzhDOoesbpuZaIBPw2sAI5cD9mK0/+p6qIicwyzPYIVX8l08Qs6W2U1aGQ== 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=hDJXe/9zg8fO4KEhqRvLKCtYhFFcnAsHTPvjuYoZwIg=; b=bW+iltDsYPMSQ64dRFC8wKVr6HJ7QX5+/DHUmAe9NqUWMHxGU1j7viNtB0pzEdamErCKY6c3ELCoCw5ydXkj8uR/xZuFBJkrcoSvnevLgQDuwPmdLyHFN33fTXh9PAdrD0rzi485QfJFh8+7tPdA3E5iMro9NHNvOG0yUEfY1f4= 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 OS3PR01MB9302.jpnprd01.prod.outlook.com (2603:1096:604:1cf::11) 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:42:46 +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:42:46 +0000 Message-ID: <87le1bx0jd.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 088/113] ASoC: codecs: sma1303: 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:42:46 +0000 X-ClientProxiedBy: TY2PR0101CA0024.apcprd01.prod.exchangelabs.com (2603:1096:404:92::36) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB9302:EE_ X-MS-Office365-Filtering-Correlation-Id: d5e4c84b-efe9-40a0-6c23-08dcb4e7868e 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: KM/cAQF9ECnOwr9LmvmqKZxzu4UHCnXZwrzi3+XQ8RGZJjYiLXTjjTDDEYpNMrQMc1zrl45+STeT0E8ubl+vR3JTWyxU0ZMFm8AZgqxrJga72zT7r5mlPrKuplO76+HtmCax49qhfhi57B1EmRFJc62/5RQKykCukkiGHvEBkVOK4k6+NGjy1LRJFai93hZLWgCdIjv88Fm/uP32NNrhjLtI9Q6pEkeWVywG5OXJuEZyG2bhhSRHswWgSCpNd9xFLvt0zXPxPXI34pqoN5awlFyOG9l5op9FmIOXau0d/w5LqoLJAeqk7URTHIPC2z+yZdd9Ab+dxJJvEtJZSiUlQY+W3MjYSS90sFVcfxTdbUy4jxn0O4uCpzorp4DzdXzsA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255.255;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: A851NFGDAfnBApOtv5npuKOxEG3yvf9HyNyGX/nllglS78OXaDIpwfq72iwElDMLuIqfyADshy8mzncd2Gj7JYErCMDodNx+Eib4lrSOlxLJnRnveU+LgWvMkrEYaX67uBjGZIeFpQdW2dVivj3cHFvaEBWLZ9Bf5fQdt2Yx1vW9LSK1mvlVB7FUcYH37SG3iTLDX3a7Kcvf22wulk2I/3behEG8KXEae3nr/jlw7zuY0dV8z7z/MmXQvGB9CmuHv+5PS5JGHolo43OPqMPt6CwnGwmtvc2bi49FqZcS6EV1ORHkw3JdHLMwKpzWJ2eKYPS6kBHm/urcdC3e7ZAGWSaf4gTQ24/XkE54ifgEB9gnU9LeTdc/iD7KEFI0GONvj77EzONKCRipP3wiEZn2nhnUhEI9EMcXngwjBxrOvYBsYJwdFoL+EmWzTEncb6XyVTAIuU6+545lTUFYDme+wUNHBZxaPPiL7uigyIBswnT13R01Pnb9XWC2OERGqbgE0XaXMJUeGZGjh0HQ9umFvZdUqow99VnldAiSNCQ3ZtsQeHdJn41yAHeYlfmZhttCJOdoHegTcvIuEfrdKJrAp+jIVavLnLiEsN47/txiYL528bUNMwfrzbmepfk0Uni0K1dMldyJ0k9V4e6qyt0AsTbjUCfdvxuv/Gx/R593+DKlqIXILpRGTNuy1KVFBDVGRKVSuvnlbqu9N1OmVnWsK12/7bOQ/Etf9qJZWhvU2MIo0lBjNgeY03AxL18VueYeZw9X1WGta397Jzb/d+ScAhAlC8JoEbQQa73Ui+gZ8OiIE0QyP1DOu2gQhKwTapwR6MOYswc7C6iLGARDF3+jvtIWxSwn88dnKsPPtTSJROQ0XWbUCNHoDonj5kstRQcN+fe/PTk+rqN3SayGT/7lJVtHIIT9WFaqwitDgn+Pqqn9jdpEPRgni0uX6p+Cg3IiEcFyGY1+3eaY0sSm1MmscM6s1rwPJNeh7UH6W3n0eRruC8EB7VJCRoZxCpm8USPE9hXFz4mhTEz40fcrYVUc+GjjuitPG772nCzOrLOkeBt+jcYdlx+RkurwufgB0vFCogNp0128N5NA3U2SwKxvTIGl3DskptcKTHsh64U9lqpCw+EooxmL/TE6EsvHnycRfxTPiIiP1OcggsUkfS2UUMHnGUWeuB7lHrGHJB8BPBF1omAR/vBxaDfZ4Hcp4CfL1Es2Wdht1Y+ldva9BoYw1OiJqpZBOXqV/+/4T1bstJTyM/35b66b4O2K9bl3mOojldzAW7mXkD5hP3MXC1kAZSceDXNkNz2+YKgc2Unpzu7E6Jxb1DRZyrHhLTXDkYoCAiO3QpH+/ARAIrpxowtv3v7DUWulRlw1YIuQz2VTySABd1psyPE+23GddFr/QFSWGhkjYrLMFlyM9Uf6AiehbWeAn2emKFWqZ8921bCQOsBvfgJDyw0/L8q4XyCbNNpU8IWVj60ElJ8oARCdamJXXrJLGpeKDcRNxkrT6xFbCbd6tsikN7W6DSpey999xL/g4p44hprqJPufTft+OjgNVVVz1tQS9omRr6ValRXoLrNxPL4x68STXx7A4hcrUe/P3+2sUiMmykHjZ3yJyoNXK7ix98AxpUQ6mTWZR4rFaeM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5e4c84b-efe9-40a0-6c23-08dcb4e7868e 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:42:46.8787 (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: BFcv+yfizsqPvtE87+6oGSIQcsIB/W/pkgl9FmHu+efAvb1RcgzY2rMZW5aiEhuHnChJPongAuHizjMe4uvGJcUhPL3/nyi1jNIIZffc25x36B1x5Zl+nv2UAwcBunSm X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9302 Message-ID-Hash: JEH6QEVSZJ3PMOKBBYUX3ATBFATRMXAX X-Message-ID-Hash: JEH6QEVSZJ3PMOKBBYUX3ATBFATRMXAX 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/sma1303.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/sma1303.c b/sound/soc/codecs/sma1303.c index 980c48cbc3482..4da80cbab7946 100644 --- a/sound/soc/codecs/sma1303.c +++ b/sound/soc/codecs/sma1303.c @@ -997,7 +997,7 @@ static int sma1303_dai_hw_params_amp(struct snd_pcm_substream *substream, __func__, params_rate(params), params_width(params), params_channels(params)); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (sma1303->sys_clk_id == SMA1303_PLL_CLKIN_BCLK) { if (sma1303->last_bclk != bclk) { sma1303_setup_pll(component, bclk); @@ -1195,7 +1195,7 @@ static int sma1303_dai_mute(struct snd_soc_dai *dai, int mute, int stream) struct sma1303_priv *sma1303 = snd_soc_component_get_drvdata(component); int ret = 0; - if (stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(stream)) return ret; if (mute) {