From patchwork Mon Aug 5 00:44:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752935 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010002.outbound.protection.outlook.com [52.101.229.2]) (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 995902B9DA for ; Mon, 5 Aug 2024 00:44:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.2 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818650; cv=fail; b=KowPMsdZ1C4lpzecDmn9dVq5U9JBWBT0pNnzQgpy3wh87Xf3uDImWZogsIkTgyFs+YxRSVV2UdfQ103dq09igpFXOk0OH80G54Y+dUynNVjz4Cf4yiHYRGymVDadvPTl6IsmQV9xoyKOJOjgHT3vRg+x4aOlVmqNZwui0xd0Fqk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818650; c=relaxed/simple; bh=D8BpZn3x8VRsEcVVXQrMjzMFl2E1oOXNqsu0aFfDGXA=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=a0sIomTd4q9aTAe0bsA1jfCLcF9vv3NxFSiJwgfFIXhZ2wZdy5bKWB+pjjQGUFJKQOwcWU1QyeHRDTNGqFdnSmWANM8iJKIrri/yD/fasBZmteaIU+lggOpikUYKwBhUFQumneMptukrOUgZKL7d56HPh7ZpFyWtRt/x3WUtAF8= 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=B3jJqSBV; arc=fail smtp.client-ip=52.101.229.2 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="B3jJqSBV" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xibJcTNciPaN9ULQx0x22gY1iC3PWud5zKHkviQ4hCQYuKVIihlmvZm9VNlBLqZQz0LekR2g56Q0y3sHV81XXcjSie/fNHvvWnUCl2AT11dHpwHCODtngx1g5nCKXKyq6DmOfI5YFvZLC04sz8byW8fv5dMuU8v24sgAObqtZQCa55NHmRiItqfFB5uFcVHZAHrzTMe8fCRBLlw5Aw/F7AJKMyJdsOZ8A9m1NsnDyiZnCACuq0ZrXiztsn2zcl38W6gaVuTufTQ1QzT676Pu4eNGVVGg9vhGEeui7Hj1pGGWlNuNCUJE13NCW5A7cJtl2Za9oDC6qnUz5Q1l1JCfeg== 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=eHw1WLibZN/L50QnInpxqE7BExor7mE9XBYyT4WZzPI=; b=qSBqHmcB+9OidArbQFObKnkzqoCvi0E70MzEgVxQOvVn8a2rivCormBX3Xv+svOaRTujqNC0wirS8ATFGgh8XAXVQbu82iFsTu9kRivOLYL5oHEFfL+A5NKltq+Q54WKw57h8zGiWauDrHq5Jk4qA3mgYRjH0mHiUmSEJITNM1xbCW6FjhUz3ESaYoZE49+clhdMo4YXDHyeknZRiY3CeLR6+pbJvpDrUOfDQcRUuAbV1Mfoa4Cz/Q3ytOktpVPotPAsS25Qi4A3gjC9aIgyPb74K/xVoMrS22cr4zHjyQBUTZvmk3Vo9cfr6UimEuTey1NIHhxujxlV4cTOm8Qbnw== 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=eHw1WLibZN/L50QnInpxqE7BExor7mE9XBYyT4WZzPI=; b=B3jJqSBVIK6z3hHcsXGf5KbYCNVu4RFnXWz5E920kCLPz2LyESO8yzFglieds9AkX3W3uMvOE0T7sWt6VDhpbc6LLCvDWUfJeV4vzI92bm45lVWIVaSL7E4KWl3qWAElmApUjkcgZtqVYY8Y8mesXqeKBH2uK1nq0B7Q5Bqt8nI= 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:06 +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:06 +0000 Message-ID: <87v80fvlwq.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 106/113] ASoC: kirkwood: 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:06 +0000 X-ClientProxiedBy: TYCPR01CA0097.jpnprd01.prod.outlook.com (2603:1096:405:4::13) 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: 27809676-bba0-47da-8ae5-08dcb4e7b5ea 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: Mfzt7vEu3n+aMRvJ5BQu3avaNeZUzaBJhu9iJ8hCd7XPlN+FBFS67KS3xJ5LI50GqZo6nL68038ikfFcvcNH1kybWMARFOjw/hlYc4Rv77ijnU5OCwI5hla30Gv0RV8zgQmDCDyDc2H2aecW5R2580wOYOdypX01l3cf+69pfGYT6h9ssCaPpQ6WDSUbbjWa7z9NaFstxiLSx9WZVZfxMbVYsUpTmqkIuX9KwJXtFdM0H0Q2FZK4twtsL2Ohn5qmBH4KZaUTgJbTpXb6u4ChT2QYeNc1GkjojDCbCVMN2ncc1jU8qDjeyWBj6SYQ8VfT8US2Y542dS2azo/tiGLxyHRp7eZpqVSm7lLgbhHOTjGguKqo2iiQ/ldp9ktw32lRI0jmxiB5xhpwxhq0LamFLOIQMGqNHC2A6fcWX6Ifeh15jX/2XeAacF4aji+hv1ljtVNfMHJZAAa7H4dtahGhtjX1OQIRAa5UjpxwzDxPXs/VXL3JbM/R3DM8v0s07HccgtDAFPp6ijic270Dvdf0RoYGUf9r7x5M6p8rktyMhC16+RDVozZpU4jPRc/tkeMJiHVP+S47tGcmjG7Qo/VLAW6soBlakY6e9rUmwGXJP6hqMsxAkRZX9yAmfMCZUpbjc0Ht51b1TlmVXqBhX8PpjDIX8/lxTTgGiqU8ozkTKXEwgJ8A4ss/BpLYjTmJ4mK9w9wxU/EuAQFXtWgLs7uUTAn/2yf8adv9jspSqQASgEtdO9sA2nDU7mZy2S+u9bCuozBf+mDFuNT7BOgX9thffmQBBE9vqXtySONfXrNL8APotIBhLh/JNOzgaQ0y2fkWkGhnG/crNPWWUzlE7XKPgp6DTMCqNIfX3hKd/AMcVTAfOBWWbdIvszEO9EuVtN9DDW3nD8jBmc/awzVVce9tJiZOjoWhq7qBr5lMZ7MJcdTCrI2KWO0FlwsppSctMH9uadMiwkHwRAVp4MmzZ6D4gbysXp7w7PkG7Jfu8LCFfGmVEGi9jZmtg9YqOS6jRSEbv0IF2YjPZbedlHey6gT/+qU8phPlSkvWTjFzXbovKrtDUcko1i0rYHjIpsuZ1YNOMVGRGAYknttNYHrBX7q6CETN5zrRc88km6rsouFmqQ7JAa0aQmEvV6OEjOSuSrL/9ZBj2xy099wcJmoUJjsZmHL/wz8Jhght32VUw5BX8hZytVpneZMJz6V3wzo9p3GU3sBVu8zyrI43S1va7yIh71zNPEIipCRoo/93hjBQA0y3IobAQ+laiBYPHONjCf0y74g+jBMwprwYqgv4GuVT+1IAqGs08mgqcqr5Gkaaio/6lXlV6rd8/nfOgPLnsa8lrjjAktYtQU2CuEX/FKozdEvFJkNNEC1hRdD9YtGZGOfasYV5RIrndX1gZgfbB/+6NjMWEsLQN7XivApzCORxmw== 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: 2y4nwKv+QoPT5OY1pcJdrNLrM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EoYkQzF3RV1rtINHmZW7wXsMEI91TzHwYTaP/JsakDR9AsQpEWBQU9goU06CDaXlKwrtWPyBPIlo5BbiUtha9R0zUpKv+OdYI95UqOl5YSp6APZO+fH4awp+xz08Ry0yRGEo2d0fWQHXTBTK7/DcaK6xsXKyS9LcvvIN7pQAcxLnfBtZ9uqhRoIiK+jBte3NhZv4sZ7XLQdTHgqSzPP1fC2PoogS9c2NRK3BF6m3eu7KFNDk1+ib63u1OeubD/JYnq933aaFfbZVb8E0N+qkeRyyXeDH26NvJffciEggIybumDndoc4DdgaKHk3nVRXCz1+k5Lg5OKbBSdi3oYoTW3qBYTTw3qQLzPnhMThLKJ9Ih8ejGAU6T8HxywikrWwmK8LW5Fhb6jOjPHOca1IVcmcPyc1FTXUt/PxrHiNCt/j2zJhiuPPprUGjxPVrJf0U2lyOw2euw5Ualax7sFjQDU072yiNxGvkJvCsAPXGvX8W+dmmlhVMWn8CJ4LX7NewPc6762zkVmDyzinExt4ag= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27809676-bba0-47da-8ae5-08dcb4e7b5ea 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:06.3034 (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: Ov4GVVYB+9mK5edwXt0hr3DVHJyILjOcMuI4854pQD/sFPYSPYtSMjXsCHvmk00Pslt/GLvITfZq1VKO/Lr6sxO8jEARQgm7j7Cbc2c1YlOuCvIKasobOZabHXZwK+sP 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/kirkwood/kirkwood-dma.c | 10 +++++----- sound/soc/kirkwood/kirkwood-i2s.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/kirkwood/kirkwood-dma.c b/sound/soc/kirkwood/kirkwood-dma.c index 036b42058272f..1a3749b50d0be 100644 --- a/sound/soc/kirkwood/kirkwood-dma.c +++ b/sound/soc/kirkwood/kirkwood-dma.c @@ -140,7 +140,7 @@ static int kirkwood_dma_open(struct snd_soc_component *component, writel((unsigned int)-1, priv->io + KIRKWOOD_ERR_MASK); } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (priv->substream_play) return -EBUSY; priv->substream_play = substream; @@ -161,7 +161,7 @@ static int kirkwood_dma_close(struct snd_soc_component *component, if (!priv) return 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) priv->substream_play = NULL; else priv->substream_rec = NULL; @@ -185,7 +185,7 @@ static int kirkwood_dma_hw_params(struct snd_soc_component *component, if (!dram) return 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) kirkwood_dma_conf_mbus_windows(priv->io, KIRKWOOD_PLAYBACK_WIN, addr, dram); else @@ -206,7 +206,7 @@ static int kirkwood_dma_prepare(struct snd_soc_component *component, size = (size>>2)-1; count = snd_pcm_lib_period_bytes(substream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { writel(count, priv->io + KIRKWOOD_PLAY_BYTE_INT_COUNT); writel(runtime->dma_addr, priv->io + KIRKWOOD_PLAY_BUF_ADDR); writel(size, priv->io + KIRKWOOD_PLAY_BUF_SIZE); @@ -227,7 +227,7 @@ static snd_pcm_uframes_t kirkwood_dma_pointer( struct kirkwood_dma_data *priv = kirkwood_priv(substream); snd_pcm_uframes_t count; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) count = bytes_to_frames(substream->runtime, readl(priv->io + KIRKWOOD_PLAY_BYTE_COUNT)); else diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c index d1eb90310afa2..5d43924bc1caf 100644 --- a/sound/soc/kirkwood/kirkwood-i2s.c +++ b/sound/soc/kirkwood/kirkwood-i2s.c @@ -258,7 +258,7 @@ static int kirkwood_i2s_hw_params(struct snd_pcm_substream *substream, unsigned int i2s_reg; unsigned long i2s_value; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { i2s_reg = KIRKWOOD_I2S_PLAYCTL; } else { i2s_reg = KIRKWOOD_I2S_RECCTL; @@ -314,7 +314,7 @@ static int kirkwood_i2s_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (params_channels(params) == 1) ctl_play |= KIRKWOOD_PLAYCTL_MONO_BOTH; else @@ -501,7 +501,7 @@ static int kirkwood_i2s_rec_trigger(struct snd_pcm_substream *substream, static int kirkwood_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return kirkwood_i2s_play_trigger(substream, cmd, dai); else return kirkwood_i2s_rec_trigger(substream, cmd, dai);