From patchwork Mon Aug 5 00:44:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13753042 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 4596FC3DA7F for ; Mon, 5 Aug 2024 01:13:29 +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 57BDF4EE6; Mon, 5 Aug 2024 03:08:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 57BDF4EE6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722820113; bh=jDmfkdTmVa2mfEAclGFkpGjLr7nnpEUowyIYFxatrIw=; 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=pJgChwmhKIUy+Vk+Kh8gDN9+Em2mOMQdoB7wMwIuzj909qrs2cKTbT/IOkoaYTFe9 AxolxlSeb2ueQB5V5mrjkKJKfuaCYMoBjFyaUNOtKARRLBYyVmBpj3iXCx6xMjETOR sEXSjPOuwyfVJAyrddZ1eYsHbLmlnnwPko9natmE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 93EB3F89F8F; Mon, 5 Aug 2024 02:44:35 +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 85602F89F8C; Mon, 5 Aug 2024 02:44:35 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 35DCAF808C2; Mon, 5 Aug 2024 02:44:31 +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 329F2F896D6 for ; Mon, 5 Aug 2024 02:44:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 329F2F896D6 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=k27PkGT4 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=k0vCCO6DpLaue5n45K2F/Wt96iSRWQ3J2kNW4UZGLsaWe77n9wz6cnVXznwnODFLePVr7JJzCQtGFQ11oxs/AXeOFwucVjohjhlG39Xwjy1vGuGJgp9fA86RzLaM9iBlCa/MtYWuZrOD8sUoiWkx99+qc2sYanMrU5ZLEhAMcMHkhUwLMq6+xSxAgcUCd42YTLiCxGWjxubf3l+I+woHgosN7CHFOqcQWerYvn58Wwk7leiV6kR7MvPMvPjqTBPNVmiJCOzt39zBcSUCEesKNOQpC0J+I/sYoqTf/8xPv+D/32CHqThQjbIuTSUaenGPGA5wIeZubmAa1TCo4zrN/w== 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=PnaN7Y45blHwpUNFxGbqERz7xmucY20FdxE3eLug914=; b=zI6XbXqidkJMbBaxJQkb7G8D/zoT62D6WI11kvHsGSX3qF9b9FSkK1XTLDkzjmxvQdS5uYahYsDa/XQkb4K/U3O33I9tg8r4V6hao67Ip4X+PPky19/hA+0pfiL2xX0k9aqUM3vPvj8ZmDz5SXYBv3M7F9QKavigqcwZNCNT7Ty9yZSvOSYX+KaiAbKfw3PqyJgMnIaEpSH94i4wo/+VDb9kYaLa5rMMKWnX43wEXkZfA6oMbmcGRsPgfRWgXg3sGx5/kkbSSEcn2MWmECnJHH39+gSQMiMfXo5/IvlrYLDnBX9U2lfk44AjRcdrwVjLLIPuIhO5Tl1fQziTl8Y/qQ== 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=PnaN7Y45blHwpUNFxGbqERz7xmucY20FdxE3eLug914=; b=k27PkGT4hCM4BxPdMWYA4dtS7EZXvbsuPUmB+Ub46Onamc3gp2aSkSvdayGa3spw9WI39pPUwesO9NVmbLHp8CUkPmKTiUysHzVDEiu3k4uroGBD4QgiTgCvT0D+p2lvjnjtA2jmIyjqYoSpbRFV1LJTQ1Gak9UhiFVnTwRbuC0= 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:23 +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:23 +0000 Message-ID: <87plqnvlw9.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 110/113] ASoC: starfive: 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:22 +0000 X-ClientProxiedBy: TYAPR01CA0151.jpnprd01.prod.outlook.com (2603:1096:404:7e::19) 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: 121f423f-26bb-4e5b-5b44-08dcb4e7bfd0 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: 9oDE+a0AIYLEMOKglhYyLpWrbr1HTCYgBXLghCCIn8IC2WbNRFIM5TQ0EdExEVIsR0NVxjhq0raK2UI8oBePexJiB2pPM5gIzN1ZsdDNvW479uOlyIYhDjLyvoSBXdbFE+panb1R6tw+8n1ToArI5eVKmOXu4H5simnssYksqeP473IThYrAWjf7oUIPcoYAAQ2s5QfcUT7txAMLUUal39kxRKaBXQOim0xrgXae1+0q4R5RorkysDoCxtWSmjZ2NfHRpc9X2BqfIeR/hxgzsC4Y2LlbIr70cQf9p2BdS/QEyHWQIiF8jubeyalMxVt9MqMjTjZR8ROSa/2HpU6QoefbnP7R3+oRpRpV7YmDtN7uvV/NQ4IfNzWYt+QLm+RQ3pf7PZsOgQ3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RV:;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: KY9aUeCzju2IqNfYrGge2zU1AUkjWGuSX8nE6EU44IsQy1hzKb+rs2pGJ0r6mmhXCqSO3iuKXVIjJGDfIn+uXYkJcF0c6wPQDz9eaDPoYA/PqeHzqqUWMKfzm75YbvdYqw7+SXgu6KxOjwSxytpRJasLvgg84cz2kHZ4yXnvVSdKUbBqwvPUFv8a5LPhDJbYSjfA7MOCKn6lVB2MVxtpflCJkqaBi7I7+8Pkn2qx3+h+T51OVk4ox1Vtpz8JPi+ZAqYGb1DFDYZYPS2wsNRioT0GGDNTa54mY4gj2JNmkUDwypmZILq67fEChC/8M1hyzw+tHiT75D8Q9NcbtE2l8dcdC3hQRMyk2+arFkxYvnzaZECpFSeanu7//IpV8tlZ4uc6RkMl2OIuv6aOSJqD819BQM9L9Iatas7cvEq0U/buGTIiFPkGu8UvdLEA1yOK8Zf75Bf84YtuKP+Fhx4tUDAwesOr4zcDGAhb/uo5V0Js0w2iTyaW83+j6xpMBxMNxAgiyoPDtn1AWpPToyteWz6T2rfPlKStj4QcfdKzvmRTqvQpU0JuWYa7TJFYY9cxMCiRNHHWcjWpo1oTe843gBdUdc99vPvFBgtQLK8Q9tPKVkq8+wpo6vWLXb0/AR3J/u6pdr+S5hG5DM00EF7ZhHYiF12IODd+Ey+l8/7QpLs9wDusU/jWtTHD+NqA/xEW0gsJm/gGvqW/Eb1xZgQimsCs4eX02Jwgp/jxa1gRsLL+5+WZglVqy6e9Zdd3jSpdSQhFlmJuXxCk7QcG+iqSODIGjWEforG/hOnb2hAp12+Z+q2JUelxuIIm0Rs5NIACjZ15yFhEJA5M9T73B1t4T7SpzGVDdT0TBiv8V4S1XyTo8sfe9fj+nto7f/TTpn6AL0Cl9K8jy094kwEDR7kdv5JMCY0tc9h04TsIVFmrAbKlhc+AvZtGaDwaspnQj9ORRniLIKgWzM9C3zxABm5z33I7SHXPotwOjoP8dGQK8/OYiuoHnd5SgumaLoeXuq2BHUnmp+qGqX5h7fF0beScaAUWLViuFnKZH0qf50sGa63U/u51IsHytzRESQLO08K0zsl1sHx3v7aaX3dGp9EOMRjVCzuWBsYEyPgNv9Q71QwjN1b4pllsliKhslFNEKuae1A5/ULl6nVLYkrBTubeKGOSDtLJfoWr73ek3gCKWUMowoOvPWJR20KI7yHx61ZC6YZigvhK6bZmLPAwHnCYltqzpz77hwRzVEUmnTIxE3LGOq0IBCzAtwLHT3VNKkX9aQRMTYtwZyvSfx/MNmR7ryIUl2vCgEH7Hp7GPRqIjVsL7nb0dXZtph44EahfSPPSHBLUAqnqvYwi/Y9FTumKc/r170LmxaG/1+SYQ5f4UbV5jQxKCva3EVgzz+TKkiz2BYzltSUa9QIkOt6i69Xm0K4d5nzVnzyMKIULQA024/McHBr619XN8r1FqyHj1OrILfzKmcq4TvK5gHf5qs8sRzSCrvADr/votwai9Qt1TQ7SjhCj2LbvdDa66QOgaDlKDu/JmR9djO5F42yVp8Ofl5MveIXktmL0Z7zPk44vhDyRhr7N/DzkD2SXLcRROO+vkQc547I5kAG4ocH8GdnEilbgYkXsBw3JI3wP/1/jaOY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 121f423f-26bb-4e5b-5b44-08dcb4e7bfd0 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:22.9210 (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: Kjo0K9jELy7TsUtNhadeO7DjXpaljkXM5sm5f7hGENJgy1fJn7p/RyxrEUrgjlW+H5dAx22+SAYbx0uJprQfIMGCxRWenNNWohyrTS6dX2jY7cKsJAcMyD77ywMKH/i/ X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB11466 Message-ID-Hash: 33MWGVTMVR6NZGFV622CRAUAPIWJNZV4 X-Message-ID-Hash: 33MWGVTMVR6NZGFV622CRAUAPIWJNZV4 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/starfive/jh7110_tdm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/starfive/jh7110_tdm.c b/sound/soc/starfive/jh7110_tdm.c index 1e0ff67207471..c2b307558bfb5 100644 --- a/sound/soc/starfive/jh7110_tdm.c +++ b/sound/soc/starfive/jh7110_tdm.c @@ -146,7 +146,7 @@ static inline void jh7110_tdm_writel(struct jh7110_tdm_dev *tdm, u16 reg, u32 va static void jh7110_tdm_save_context(struct jh7110_tdm_dev *tdm, struct snd_pcm_substream *substream) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) tdm->saved_pcmtxcr = jh7110_tdm_readl(tdm, TDM_PCMTXCR); else tdm->saved_pcmrxcr = jh7110_tdm_readl(tdm, TDM_PCMRXCR); @@ -161,7 +161,7 @@ static void jh7110_tdm_start(struct jh7110_tdm_dev *tdm, jh7110_tdm_writel(tdm, TDM_PCMGBCR, data | PCMGBCR_ENABLE); /* restore context */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) jh7110_tdm_writel(tdm, TDM_PCMTXCR, tdm->saved_pcmtxcr | PCMTXCR_TXEN); else jh7110_tdm_writel(tdm, TDM_PCMRXCR, tdm->saved_pcmrxcr | PCMRXCR_RXEN); @@ -172,7 +172,7 @@ static void jh7110_tdm_stop(struct jh7110_tdm_dev *tdm, { unsigned int val; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { val = jh7110_tdm_readl(tdm, TDM_PCMTXCR); val &= ~PCMTXCR_TXEN; jh7110_tdm_writel(tdm, TDM_PCMTXCR, val); @@ -237,7 +237,7 @@ static int jh7110_tdm_config(struct jh7110_tdm_dev *tdm, (tdm->tx.sl << SL_BIT) | (tdm->tx.lrj << LRJ_BIT); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) jh7110_tdm_writel(tdm, TDM_PCMTXCR, datatx); else jh7110_tdm_writel(tdm, TDM_PCMRXCR, datarx); @@ -380,7 +380,7 @@ static int jh7110_tdm_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { tdm->tx.wl = chan_wl; tdm->tx.sl = chan_sl; tdm->tx.sscale = chan_nr;