From patchwork Mon Aug 5 00:44:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13753038 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 9A396C3DA64 for ; Mon, 5 Aug 2024 01:12:26 +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 6DE8E3C04; Mon, 5 Aug 2024 03:07:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6DE8E3C04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722820042; bh=TzHmMZ3IA1n1Ch0cAApz+Sl/07KzkSD4n6VDabTGiV8=; 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=E/qVNdV6XONKoayzZQR2ecUaOBTd5WJzeV5+v1S0mzxCiYU9EbPqFIEf0xIAhNYbY fT6Fdjul+lGsCWlgv9phttw8UKmvXBY1KVcpIJjxlWI9n5gcFkqgoAPapXAKkshNiS hmSA6Ic2YCId91hE0WHw/FLA7EOKKyTf0Mi4HU/g= Received: by alsa1.perex.cz (Postfix, from userid 50401) id D59FBF89F30; Mon, 5 Aug 2024 02:44: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 632A4F89F3B; Mon, 5 Aug 2024 02:44:15 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D76C8F80716; Mon, 5 Aug 2024 02:44:11 +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 3D62CF89F00 for ; Mon, 5 Aug 2024 02:44:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3D62CF89F00 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=OhdZaoqK ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OeXY18M0QKkuINOjqSkjcm7pWJTDtU7kcTDVURMkQ0iRddB9I5zhCHYEYDKpHGU9lGa57g2riQtsbwlAiJQzx/qtZraA+WQP36uHjbSmGXMcY66MLMbSseaKsCJA0Ftkev5tKFdLXDS/lDfLiD6AZQz8fD9vYnyiKlWw02K06zpCivpGruaR+q2Kdt4QR7HUKqmuscX9yyjSegd3JGcyeb4lC47O7bKfAPTZzvYSkKKtFLreK7Ro3hwCZ2/ZiFxemV6LXpwg/PoUYNc65R0ScBOCRJDc6XKQeA1zm/I/1udEcbvEaziX7671YKwDH1hf5K21MFcd/+cctyfA78kLaQ== 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=8iN3ylHoFXnBLmyC3YRrE+pMKjnmUEzsk6JQYYFL50Q=; b=lVdZNQA70nE0SXACpOkIP3X1/Wa+9aWMFtHs3KORRkQhBUcl6Wi+E6NTCSOVN4LDpxYp7zhda1Ky0Y06XdoTNrI6om2RcAHSjoQMuBlBbgSuIGnX8rbG7+FwR/cbTt17lB4upxLwxYfPg9VNZ32KtE/scbWO3cVmgzGSH3vaTwDDyUngI4VhampFFN6XF4AlFcwHpGayjK2ZCrwknH+BggltBAO29vx0nZ8vKOMDkAtisa/HWaoKyDc5nydtVgt10mAktOWTcNi4A4zzL0m9hfb7PeJ9x1iP7UMX6mj9QvZMbxNm1hetZHqfgCD+4bZb2Hhhq18tTRR1GscqYBq6lw== 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=8iN3ylHoFXnBLmyC3YRrE+pMKjnmUEzsk6JQYYFL50Q=; b=OhdZaoqK8MRV5NmGuu5FVBQLajW+P3TtQwQ3EGSbdbtk1ZyBDLpAHSemYSuoRGxOdwiYuIdksPzgPUJMsOr4LrwJeIS8vC+afyGFpZF1CBArHCRO+Rd8LEwbErzHfNBU1Q7+0LnU4sACOtEaqkPkUBnb/jZEaAZewECSlLgr5aM= 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 TYWPR01MB11466.jpnprd01.prod.outlook.com (2603:1096:400:400::11) 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:44:02 +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:44:02 +0000 Message-ID: <87wmkvvlwu.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 105/113] ASoC: samsung: 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:44:02 +0000 X-ClientProxiedBy: TYCPR01CA0119.jpnprd01.prod.outlook.com (2603:1096:405:4::35) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB11466:EE_ X-MS-Office365-Filtering-Correlation-Id: 690add45-484f-4193-bed4-08dcb4e7b37c 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: LMkL1R0VyDyZKRZSMLA+MLPOsxbQa1ah1KmxVTf78SgyWPrJBVyqxCypxa5SlifxSZ0Q5uOYQ52czvDlZgHbtLGlYJFQE54DP6rBgmOWvLh2Li/rx8ilYc1x3opmvUDqUqAmmsODDVwM9TT40ET26g8QMsTEC8SmWoUeiSbYf9MZmZxgG6tjs7xv4ogI58G9AVX5hZuBiiMZzjrihyfMwripMYLTtKoHgaHmU6Oav7+tYiBKDK2BmmS7BSBjBrehMOX2cn0UFiD3dvZsvkF44W5Zg+hGyGn2BEd5Z3Wb5IMaV6TY3gEBBe92WvZe3H1nHvdE73PxVlBhMzD3F9dtpa59UHf7Iuf8bmgOYDIdrAYNEZDw+NDBRe/39KLfM9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;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: aITRVHU7McpBIATjuNQFTbupEF2/BbOgRYOl60JqYLhCVYqLwCjQTrzOoMk5WNE+Eg5Iol+mC9tciZFUQcJCGp1dfSVqH+Kkp0MAHCNtmbdbNoYH147iydYveLe7rJe24KPOzN2bg3bV53+6NR+v873o+2Ym/iM7Zb2sH9qGmg3jL4XWQbuKwYVbkArJfM+n+64sAVeQp0VzQgRhlln5qG6niRxuWgVn15iGNdtJ1OlDKMDm9Jz0RF8cDw0Ooe+2ZvrVA5+cEzAiwmsVjjkifsBsD+CFdjoUoB7cy6BF1vdzueiJOlcjm0OwVfneZZrmh3J9CfoExY/Q1GqoGGB2US5XwfJGa6dNuohSuh4gzqdbY6Jc3cJRf8M0R6OhWQJ3+nf/IUudlauTUHNeqNt8/GnlxyD3Rv/BppyFUmJ1db+BtXYm7S2WdyUToZMzz3xFXkHmpcRbxRgelJjZJY8ry12IPr6ZcrJ9anlu9kkyOmq57qpsA1Uwv/7/Q0VVCV0PlEBSrqi1taZijOwqFMKiEL5SisAlcYfrTibDMMFB6cTnoPI+d4Bf5NYK7p1+Ut/vr0hGMT+cw9QMmNqowJtFdqKSHWtUbFMkpcJ3HZP2r7TazEBZcGCl6UIfFsQ0U1gkNZIvO0k+GQcX4+798o2CelgRA7U4ApnnvMviPRpNN8tRC0cr9RLF7P2M377n45PLWDjsGbJSQZFJUUZWRtTCbMIZMrRAWMlPW4A7nIVc2Ibvkp1Eit0OVmZmDjHS2M7bSI4BOEc42BxjDkbiUnQZ05sD2aOyxZrEkWW9UcHHkXRevmGCL2qGIJMX/gP0Lv0rdHtvHfnl5UoKlOSdJpDSIN/69Xcj+WBv1sCon7pcOmTJHLcxZWv90+wCxzVRlD8XJ+u4fLfFk2lh1rKOXrai3lBjfo6ChZQeTDG69NTHViq+e4Ha896VYiSeDaCaMhDCeJ5ayOkTqgZGnF+yU7YXv/NHTKpAfXkgCEJ97m88Cygpo6VoAK2YK3k3OuNLBESewT+6oizSwXhSr03uckVt3NpPvzQ2UbjoKXG/BZmLKjijmT5pMo+ZnuwKbqnovu7vhmKbBla8Eq85LUrG7DPoefJc1uZOGPg/InKuIBOKmFi3ZSbJHsbCqNzBEzmS+fYMztSd9JMNdydKJMzhKVyc8u9CCthcespuM/Ollm/QfHLMoVb3iGfJkTj3COg1qnuW+ngHfVzsE4A/6YCAW8eVi/5clt5R+p17qejEfuiiIx1dTACYsBdQK4N75r3yWFtGrFKX9gk7KHT6ieKTLXp8K3JP1nq2XSJlJJglZCUV89V+R0dLwOgAOeVwavh9o6q2bIm75Yuj9IDnx4nz7YDdaq+Vo437ngE1Haw9dGpo/iLryG/Ucegu+eNk/M3SrUtVlA9Ws4eVj8+BQLtPw+HtIpy6AQMlCTdBDLzZplnn8/YiypwVYnXwIS6WrYaZRuTIDZo75zM9IEYliQ5BVqjcQNwKhAqDjHd/DAbcpgBOWScxuFOjwP+lg+8HZ4DdjSs2yZps9TAASN2SMZsE1sRZKbXcFFrmSuRU4YGQUez3SjaBX5GvYde88D54RLc2XoDDGyU3V9/QSzYqONHjC9XvyPhoQAkVne3wvRGa1zWX7B8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 690add45-484f-4193-bed4-08dcb4e7b37c 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:44:02.2292 (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: H429NEUNM6phEZOKrZtS0zNHhkxNur4Oiz9JnKyoTDMXkSZSRvaUoFIcWBVCyr8VzGnXQhcEODMHgt9UP2tGQSNz7xHir9t6CFQR57++Hj+TSG3eG5FwEE1hYEZlpktM X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB11466 Message-ID-Hash: LNIOS3OX4JTPRTQSCXYH2TF2UJICFQKQ X-Message-ID-Hash: LNIOS3OX4JTPRTQSCXYH2TF2UJICFQKQ 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/samsung/i2s.c | 8 ++++---- sound/soc/samsung/pcm.c | 4 ++-- sound/soc/samsung/spdif.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 1bcabb114e29f..fdf494a49dd92 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -744,13 +744,13 @@ static int i2s_hw_params(struct snd_pcm_substream *substream, val |= MOD_DC1_EN; break; case 2: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) i2s->dma_playback.addr_width = 4; else i2s->dma_capture.addr_width = 4; break; case 1: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) i2s->dma_playback.addr_width = 2; else i2s->dma_capture.addr_width = 2; @@ -936,7 +936,7 @@ static int i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai); - int capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int capture = snd_pcm_is_capture(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct i2s_dai *i2s = to_info(snd_soc_rtd_to_cpu(rtd, 0)); unsigned long flags; @@ -1026,7 +1026,7 @@ i2s_delay(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) WARN_ON(!pm_runtime_active(dai->dev)); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) delay = FIC_RXCOUNT(reg); else if (is_secondary(i2s)) delay = FICS_TXCOUNT(readl(priv->addr + I2SFICS)); diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c index 573b2dee7f07c..a9bcc2adb4403 100644 --- a/sound/soc/samsung/pcm.c +++ b/sound/soc/samsung/pcm.c @@ -228,7 +228,7 @@ static int s3c_pcm_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: spin_lock_irqsave(&pcm->lock, flags); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) s3c_pcm_snd_rxctrl(pcm, 1); else s3c_pcm_snd_txctrl(pcm, 1); @@ -241,7 +241,7 @@ static int s3c_pcm_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_PAUSE_PUSH: spin_lock_irqsave(&pcm->lock, flags); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) s3c_pcm_snd_rxctrl(pcm, 0); else s3c_pcm_snd_txctrl(pcm, 0); diff --git a/sound/soc/samsung/spdif.c b/sound/soc/samsung/spdif.c index f44e3180e8d3d..d5eaeacefd230 100644 --- a/sound/soc/samsung/spdif.c +++ b/sound/soc/samsung/spdif.c @@ -187,7 +187,7 @@ static int spdif_hw_params(struct snd_pcm_substream *substream, dev_dbg(spdif->dev, "Entered %s\n", __func__); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dma_data = spdif->dma_playback; else { dev_err(spdif->dev, "Capture is not supported\n");