From patchwork Mon Aug 5 00:42:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817088 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 74F06C3DA64 for ; Mon, 5 Aug 2024 01:04:24 +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 8A0243669; Mon, 5 Aug 2024 03:00:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8A0243669 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819646; bh=eHc0IA89H5dGyNCld9zIKcIGc5kTMyrh/c8uZmblVL8=; 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=oL/ZLhJKtypTa1A7Ab+XarFZjpZsL9/vvq6F7nPjqTR7jRstWwSgUgrxQNXWCwvBQ 8CBGFBUb37rP2xrzvcxrAk5+KVbop7T2nW4MXfevx6IwCA4E3Db1dpiTq1zKCTAKgZ EzCb6le0UEGHuoO8HcdZ16G6B8qJbUOEH7NkNf8Q= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 32014F80844; Mon, 5 Aug 2024 02:42:28 +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 E750DF8080E; Mon, 5 Aug 2024 02:42:27 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9AEE0F80841; Mon, 5 Aug 2024 02:42:15 +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 0B26EF80580 for ; Mon, 5 Aug 2024 02:42:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0B26EF80580 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=VfHqBBxE ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BPNR6ENAUiAJDXzwZR4rrHVPTptDD6L/CxJLqi/2ROYQ2n16Uabt5VtK3AoXrSMnRq0RIp4oAt0iICQd365baZgam6BwmB1a0pH4x4qmvtTcme4Ye5EbEC73wr9LMphyYhR/JiKif+vZdWvxkpuNUlMSQBIxdGyxSsqcR0sFfq90yeh6iWDS/SH+j7P8UCO/WpXOF/LUqoYMbpKaul7IDdVdbWuCHe7g5YroJNbctlptDUDwTlNRsBFMgDeNrTjXGsrJpzL1ZAFGUflNBZi98h6JzDKrdn2rHq5qyZ+1jvta/VB5wX9QR2iShcEg7V2PqcPkKneW1wvcqldno1GDOg== 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=tRUozKlejGwEKAtGbBxAHzFkFIpBOaNQqY5DlT+OePs=; b=Dcl4WuNLX/YScZOg4IJRIDmruBu4qfL9chDZNEzpVHaRmePxettQxkU8BuIDwVbbGtezOJjYxRWUpWY6NfRZnagsAfgrRung38WbfhQrlFWwVA9dLq1xdMbW0W4aejGMQBjOQiV9UYS659mEakobfaE0d7PIontQVG7C85qfV5KXCwUcY7KoKIS7je/XpYdtaTC/2cDTstQiaT7DUQUUCdhPTb620Ozv4E6jp9iD6RaNnkPICogtvt5sVNF7EOfad46Ps6NbluutFIEvdN90ESzC1nLt54sZ15gAeI/XdpZ6JmzaHFFnhOWKlvtB3bohDFp4ZLtQIw23GX5SGXfJNg== 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=tRUozKlejGwEKAtGbBxAHzFkFIpBOaNQqY5DlT+OePs=; b=VfHqBBxEMpcM2e7u4PCZPI53WetEyffS5NJTrvNMtl83RksHom9O3WGSC/LceDn0y82oVQRLAVdGVyRDNt4Zf/J+rtTu4oIZPLLWq4mXObOnNPlygpaDLA4zPaswE06CC5oTjDZRzR3fZcRxvyrZd78bgyz3Wmhq+TlnOQ6dtWo= 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 TYCPR01MB8678.jpnprd01.prod.outlook.com (2603:1096:400:15a::12) 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:42:07 +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:07 +0000 Message-ID: <87wmkvx0kj.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 080/113] ASoC: codecs: jz47xx: 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:05 +0000 X-ClientProxiedBy: TY2PR06CA0028.apcprd06.prod.outlook.com (2603:1096:404:2e::16) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB8678:EE_ X-MS-Office365-Filtering-Correlation-Id: 99b6ec1a-9c38-4959-3d62-08dcb4e76dc1 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: ygmmRPUVIv/nMf40UaGIYEGTMDqx/6anaDuVvMeE0qmtpky6XnFAMKBe4ZAlLyOa9A5yWpVzt/ec+kSKkq7OhMQzv3FFitofmoOwLEyOqub9Cp9Avgwb+ysP25Kds/VoPQDSUrMhvB5PbOT9VlXgaKXndMk6i8Zh9lz0SG31iacYV3gr1pnmq29SPKGUYMTdXYyTvKnQPiKCHKJWiQzW6GG/Xp4Yf3Y2ALfT9qB6VnaQ9e1Pcwmw4uBtlHy1O0kyxHte73I3T3dDa/7fBuvONkGckmIWFgmZ67rjvbRux96XNrOSvcT9Rm7zyR2XcVg8lMADfqxwZU0mY3s+sK3xYKStkZTQFiXX90OKBZq2iXDrCPW2f4CWGXjIWmlO6kM19z8qfch5KtNwWQZ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PV: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: KQmBvdZGI0RuxF8p552d3QfvRZgnq183lNrGJFj1KJUnpLngn9gjkbSbHoapxmbvGAnzzGqxwIFmMgRenjzCa7HjAlfTpHIP/XAT9Ln88P0Wci2JfvikUNvOB2K9aCFUQrGUChlACGWOkHsjtqXxd/55Ehw11aHSmgQdL0wC10U0J7KI0GaIFe/sd0DRbLJLMjXKXaoXH4klufwl5OI3UjoHtkWK1gTQJFFSoalvP0/5TgbKVO2tu/viZok3+0rc5E8/qj47756O2A4bCogHZC5Fb3XgPW+zlVW/0C8+wCruwbmwkgGtZ6NG72H3HnXDrnzSLm2Ehs0iBIYJ3JB1XgVTXnIE3EoLdnnrO0O9nCb+ywi0eVmz6yc4WsGQHkU681qUYMFy/xW8YJCXHoapashfZ9R2VdfC9hDFuzK9WkA8LiwSICCZxHAXiX3Tos2IqOirvWuhIQKPVQiHD0+ouCSEqJ5zdQmGXtfH+EOmf6/P/f0rCLLrf8Xu8a48BRbsCwN98qbaAIWGj7Pyw0mB+eFpPlQpQSW2FrApC6uWxPRlqXeW75fh5ejSKU+1N7ojKfQugw3qJpWHjYMzDstoNaM6jr4x4tjOu7QuphbnQqDe8OE7D9ypFPwDSRBNxW2OP6PwMVP28W0n/zfSVlJWYRBk+ZfTkwdl3wbzQmHzsFfvQZ+IQxeC6qSFFhZmC+B+RcYDM+JN1PDqJ1hv+gNpbHJuPldOR+9qNGWyYv8FNHkIk+zUB06ITTZ41I6jN1bR9IESawOd2ESSwn37MQJeUm3IyHMMw5ZRMhY9VBjbX+l8f1IscXUad0JTEs7SrohzwN9naERE1/afcXEIEz5PmgGql4pSwzraNuu4G6JutnPzRTftiOoIhOLRdXBtwA+yBOArtC3wIPVgM9WsHPiNtoOQiJgOZa285PJ2UyiWWaQniNXC8VIAJLbkSzb/n8qkdTuR0n9Vyrg1/5oQICacZO0TxiIpNlVyoSwpk2v1rfUsw6P0RIgwBTmKFLqamFjGPhpYf1ZxjOgiTdOjNXPeSkZ+0Ce4N5wZq2iXbP90NubramPTdVtpmJ4/Ncy5zQM3xle1rZh0OXjET+VhbMWnISh9hSIg7IjD31h4fBO6SNEPsHX9Euw1iDQHw9ljPkAy1mTlp5tJ9I+3tvUSLjFY06EGkKzl/mmh4AFwlkfB5MwbHe6MmfA+H6Pl+Q5d3kCubgambv58NxD5pdBACks91hkjGufuutGYuv7uSOo23SCjmsa5g7dv3H0EfdItApebTLGPWjdVytkfRTLDxrcItQjB3Zn5OYs+lOw3xJ4k8B+gBsgJPLvwnDIOpRyovzqNGA256ju4KZqyr1cc8phGBcuANZZYgXWXnMqgZUF3AabuHbLu75ty2mEOIWE7t7B3BtrEJCykrnufkt5Y6oxqBb7W7cC14IKu/VCKeJuwaEJJdUSSZX3+CZvs4UMQnNjidwS0P0sXCf4ytYXjTlaN1tqTw66aWMahzYqtPtS9uLuIO98e077hwKm4erkneHYCKvi70BlHt+h4xMEqj7dSzxjcYM+4KwNzu9dEF5GfO/SkeBMBPqxapwp7lFVKhbyf8jHq5UsQ9ctb3hASNhDdRbHKw7D8GHncC3pBAhbMQ8o= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99b6ec1a-9c38-4959-3d62-08dcb4e76dc1 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:06.4884 (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: M9YpIXzEX/410y3gNnXlI9xJy76qU2WxDvepLbKEuT9FAmr0p8M5ivAasL5Q+CgSbHCFuOC681AKFzMFDUYrTxtgCuIblryd5tVJHd6WcgD6MBgGEYmgIkhr1XnMLNRs X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB8678 Message-ID-Hash: VDPCNGYX2UN3E6ALE44UFGIP42A7PKJC X-Message-ID-Hash: VDPCNGYX2UN3E6ALE44UFGIP42A7PKJC 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/jz4725b.c | 2 +- sound/soc/codecs/jz4760.c | 8 ++++---- sound/soc/codecs/jz4770.c | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c index 39cebaa167beb..7add57e5c4bac 100644 --- a/sound/soc/codecs/jz4725b.c +++ b/sound/soc/codecs/jz4725b.c @@ -476,7 +476,7 @@ static int jz4725b_codec_hw_params(struct snd_pcm_substream *substream, if (rate == ARRAY_SIZE(jz4725b_codec_sample_rates)) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regmap_update_bits(icdc->regmap, JZ4725B_CODEC_REG_CR2, REG_CR2_DAC_ADWL_MASK, diff --git a/sound/soc/codecs/jz4760.c b/sound/soc/codecs/jz4760.c index 6217e611259fe..f39bb0dc93e02 100644 --- a/sound/soc/codecs/jz4760.c +++ b/sound/soc/codecs/jz4760.c @@ -205,7 +205,7 @@ static int jz4760_codec_startup(struct snd_pcm_substream *substream, * DMA transfer going during playback when all audible outputs have * been disabled. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) ret = snd_soc_dapm_force_enable_pin(dapm, "SYSCLK"); return ret; } @@ -216,7 +216,7 @@ static void jz4760_codec_shutdown(struct snd_pcm_substream *substream, struct snd_soc_component *codec = dai->component; struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(codec); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) snd_soc_dapm_disable_pin(dapm, "SYSCLK"); } @@ -231,7 +231,7 @@ static int jz4760_codec_pcm_trigger(struct snd_pcm_substream *substream, case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) snd_soc_component_force_bias_level(codec, SND_SOC_BIAS_ON); break; case SNDRV_PCM_TRIGGER_STOP: @@ -693,7 +693,7 @@ static int jz4760_codec_hw_params(struct snd_pcm_substream *substream, if (rate == ARRAY_SIZE(jz4760_codec_sample_rates)) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regmap_update_bits(codec->regmap, JZ4760_CODEC_REG_AICR, REG_AICR_DAC_ADWL_MASK, FIELD_PREP(REG_AICR_DAC_ADWL_MASK, bit_width)); diff --git a/sound/soc/codecs/jz4770.c b/sound/soc/codecs/jz4770.c index acb9eaa7ea1c5..740b4e926c76c 100644 --- a/sound/soc/codecs/jz4770.c +++ b/sound/soc/codecs/jz4770.c @@ -224,7 +224,7 @@ static int jz4770_codec_startup(struct snd_pcm_substream *substream, * DMA transfer going during playback when all audible outputs have * been disabled. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) snd_soc_dapm_force_enable_pin(dapm, "SYSCLK"); return 0; @@ -236,7 +236,7 @@ static void jz4770_codec_shutdown(struct snd_pcm_substream *substream, struct snd_soc_component *codec = dai->component; struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(codec); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) snd_soc_dapm_disable_pin(dapm, "SYSCLK"); } @@ -251,7 +251,7 @@ static int jz4770_codec_pcm_trigger(struct snd_pcm_substream *substream, case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) snd_soc_component_force_bias_level(codec, SND_SOC_BIAS_ON); break; @@ -730,7 +730,7 @@ static int jz4770_codec_hw_params(struct snd_pcm_substream *substream, if (rate == ARRAY_SIZE(jz4770_codec_sample_rates)) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regmap_update_bits(codec->regmap, JZ4770_CODEC_REG_AICR_DAC, REG_AICR_DAC_ADWL_MASK, bit_width << REG_AICR_DAC_ADWL_OFFSET);