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: 816940 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011041.outbound.protection.outlook.com [52.101.125.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B683828366 for ; Mon, 5 Aug 2024 00:44:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818646; cv=fail; b=jT7czd7QsN+Tc7Q6av3wGmzM4iLosJt+fyxy6c7giDZR4dCqnnawWHT0gMy+lOcsi/OD/Rs3AXi8k8YZUrwf3iTg0xhcetOW+N5hXLXPIF0gtnapkI7QvmD8wHP2etmNVk+GHxsUm3QtaRvsK5F4Q7Zic8iVjctplX7d4AmKhLY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818646; c=relaxed/simple; bh=TzHmMZ3IA1n1Ch0cAApz+Sl/07KzkSD4n6VDabTGiV8=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=IiV+Rk4+ywbCCvq7iddblEEFBVTbOBKkn635C8zV6/buApA1qBHqTW69MP4Ppu3XXi2mt8SaLEsa2wPZTtUlqiL+eRdE8Der5hHhaUZShrP9vlJR4vp2pqMhBpn3A8aUmGVzGDUV1HWNGf+IRdbrciX2NZJlw7GvT+o4+kX80c8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=OhdZaoqK; arc=fail smtp.client-ip=52.101.125.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com 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) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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/39KLfM9weI/Wr7gyp4LjuCTfdzJssIuFEpJLAs24rXLu0U1rZL3hb5karULlwyvDhDW6FbdhYuv8UnWSX8cUu2Pcx8NS2NwyFCTz3++5WYHNgfWjof/TzXEQOIQy1kdBv7aBdXHnYLMwgLmbRoApz4E9uyXO4F6gTpku0Rd91L/YGFn8ga1U5BfelajOR8p8JVys3TR1/OE7j0v6himiKnIQLylskqjLCbBylhUwNwSfgOIJouLKJYYJlvsrYuO8EOeaWLiuk3aiE50HjP1ofOlSOIqtl4H+qLBG00yHqYPAbANHl8t0U/6amXA4VwP9nT+m5y7CF1GEgtigIMCEhd0lma8evO4JW2WkKkLklhbGTWQ+rtuBGm6nPMUi5JhrYgNG5ounjvgR9JyL6Or8ALVG+c24Y6BRllO8Qydlhob1jxeme3Enmmh0SWPFtnJO3sCNuwYwWBtdaiJ1jdNDhop7Nnx3DKh3v1IJeVvYOkcWnvT1uoFQFOhPPl2tZU5bYoTabUvRqF9HKxvXtd8oyru2WZC4iMDYi8M/dpUyUdyRJxar2JYSacw7lhUSR/o7gna2CVacJnz/TC9+gAPmWhA/4vQgAJn5uybtAkysZw7pE3VV4EdTTo4H7dHuUtylzwSeZQa0g8Go7lSs7c3Pyv4FdpffxsQxRZ1LnFqxFtzQWj/FNq7uXu0d+1RTzXOAe3ccO70QpMEsJg59CloHbkylV8VvhH5MWOPip+La3qLaMn5BJJFbci+aIBjiFDLKWaX+RdbjlbkZzhY+M77dULPWvlJhv7fqqRk6naybvsMBuLLGE7hajbU+shr4kkToTqiCLe4xwlUAOr6aEywbtT5dHTHD2ZoV4HEbkeDKJhrETDdeDMSNmohY83YzqYMA9xGhqTKvI+gzq4d7LMMyn7vXksjBdBRM95NvSYdTM0+F2DadK4LEfI9nDytIrlsYOVHQBcXg+V6B0LxIa4ZI/Yxu62Qw13sTO2DKo9RC7E2ohwyZCt58egg1Casg/x6KFyMlhqG3UsP1Wo7LNXQX3wdN4dAJIRg== 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)(366016)(1800799024)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aITRVHU7McpBIATjuNQ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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 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");