From patchwork Mon Aug 5 00:40:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816781 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 258C4C3DA7F for ; Mon, 5 Aug 2024 00:57:23 +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 89BD7522D; Mon, 5 Aug 2024 02:54:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 89BD7522D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819279; bh=8kSWrJH9g+DEF4SgSHltqiTQ27G3P+Pe/lIHu44ik14=; 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=HpoU200m1QRfqDp7vCAp6Pk5GvijvTmbn/5rANO3icifYd0BktrL+hdDErsVo6eSq 9Ze6Po+fxVe/5gBZbMAuRf+PepEd/NhKUg0q01sRBwpNK9zZJ7tQ49d0W7ZGtcOujO q0aMCWdUTni3UY4f+ay0D/phtqRo8jR6CquC1+ic= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B5AA9F89B07; Mon, 5 Aug 2024 02:40:37 +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 3F4C0F89ADF; Mon, 5 Aug 2024 02:40:37 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 30A92F89A86; Mon, 5 Aug 2024 02:40:23 +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 F37BBF89A45 for ; Mon, 5 Aug 2024 02:40:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F37BBF89A45 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=caKFOYEj ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XzihHn9CoA8nBYK7J6K1ExRJ+49PXpNvUl7Ews2T5Y0XyJbsVVkbg68QEGcBSIvvqyFdMR5WfQEZ+sATTNHR1eTYlhyFZYopq/nIv5INBV58w5PHcMOlgkim1oLHla04LNFg+JHrcYkiXaS3/ycy1NPAzOQQd9OZiX5njFi4eWgOKGWV8DQntnKuoSvIEEcCwK9oSJngpWuzO5UC1u/OB3z+ERpY7Vvj62OGFJzkuD204tLxwpnsxWqJt6kI32oHKwhfyCPBTH2qNcqLjYCNGocODo6GdPbBdWlx8y5xnHHj7zLDWWVUnLUENYAwwqVfZDMK8A5mEK4+hmSBLtp4lw== 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=SiyklXxnwCuOFLk8+hLoD2v6lvVgqnyvDraGVcT1JCs=; b=U6yaAp7UABlXXk4W+KKfxvSGUU+UR7xeJhEDXg7oTSM1u0TlKDpJ8F/WJpVOUJINF3yzp6AU0qqjdFFGlntTO0V6uzHBojdqFtcPB2TpO8ECuALtyJo1TjaTBvelBmjfzrII/Hbe30cDiiQMrjr5bY+KhszaDpQvbf/MlLIKE3EBjIH5sGRNRh5amV5aADREhdhy9xzt1u567YWlhZcP5KzCv4VfTw7VeD5i+5mmS6kAa+EuVU9MJ75OTJ0wWlPuHqP+gjr/O6U4HeO2eOtK/VFb6CJgE+ACwJhFnrfXRU87xIrjAwN+qBKWHg8Ep4t53ynQN4rsC3goiX8e3gSBAQ== 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=SiyklXxnwCuOFLk8+hLoD2v6lvVgqnyvDraGVcT1JCs=; b=caKFOYEjfKjksY+itmlXZq73JhMaTfzYNhenx2uQTffDkb3JsYPPeuIrS4sAN2k3CG5n9Nv76SiSrYN5fL/WdSky0RaLz2eAmqrbYkDTTwhJakbc1/haN6ibQVUG8BDSFAdNup4U6WxMmLs26NUcY2Y81Tcf9chpa+jvKmtvMos= 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 OSZPR01MB9459.jpnprd01.prod.outlook.com (2603:1096:604:1d0::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.25; Mon, 5 Aug 2024 00:40:08 +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:40:08 +0000 Message-ID: <87o767yf87.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 061/113] ASoC: intel: avs: 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:40:08 +0000 X-ClientProxiedBy: TYAPR01CA0053.jpnprd01.prod.outlook.com (2603:1096:404:2b::17) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OSZPR01MB9459:EE_ X-MS-Office365-Filtering-Correlation-Id: 78bcacd8-a320-432e-c5f4-08dcb4e72820 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: 4AWmwySw9KvSjuYHRzWb790mi/PwbSEokXXePSw4eAFoVP6eRMu9BGAsHMBN/qxt2hbSnToX6yAAtGlDIN65S1Wu/46oOOM9mzZijXMgL9MSggNHrtoblPZ4mTPhfHcxzRC1K90G0SF2aQ9XFj2aj5C1dg0ZaKoxMfSi2AvbvsFucUy9pB+L4OydEHI5lFuscpXZyqBbsMxrYjlIBL/fNQ1pm3aWepeWXtvYn2to4tMuqRcvGtqaOyGs0NcL66hkmRyXZjFVlGCCrg27HyMfgVLLbT6iiRzWM2bmJ5jF231hw3w4nV8oJf6QIfvkT4+BMwYPdJhx0WA8f8q50up+YCob9VdNRVgGpGMLIY70/Lor7OFuPIRZtNVtIK+GD15DbEF8yoQ8ki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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: Fw14Sqy8LPHJM62fYepnx7qF7QbVUtB7GloxC076fMCY6AdPp9avDdu48ejW4ivv0fN3vzweyxtiTbV6blbr11/EL+qa59vvhfCenbUoIlNSAP/17TZJTqflfxMbU6Ve01q/DWPNd0jqNne6h2o1bT5xz2H7RfjqpIVQK+Z6YG7veGLjILYovS4T16MZQndZTmpdUDaBDqj5hQPab0kulQ6f/mN5qK/noP3vF6UFuBjPBzkS/4vDFrse7B0dKnWp2a50OlDVuh8fciJ9AMybCLjbC1zKWe++kMoZYnjrkNFWCGwhd98w2CXcXzP/rH6Fh/RFYMm296IS1y/ty0KVUOcCMEIIfRrAdkKUG+L3kEDT2RhF0XB4fwJVKCPAjEAhlz7kd8FUfFYakihXn66F90taPwNPMtdwbU6moDjIUs1YhLOGx7D/mnpoPTF/VliV5CbHjLkJ9IPLl58fqJuBfyiGf+HTbCQInQDs4ylXIC3X+fE5ownyJIPlRYky8Ljqq60ELQs31bWJkE4RILQnb3RqTK1A11qb4Gy3cn2dZiF7u4kKLx3sIgfh3WFZ8wuxaqr4QNl+EPoi0BOlS2hbIg7bNcehoTjgHfiMzxuy02rBzcNeddodGmGZPf4oMq077+wGEki3Ml1DkmcA5vRYGLrhw1BDkEvYNliEvvubogOJ7O9hEC1kkeUg/mTsfbsJMkuIuhVrfR67mhGPhxdXbWU2Zm8Noq2Hra8AzYXl/I5X5j0Bt8b+sFliGBZ389PBCeFhgT3NDdUCrIoN2PIpzLN16ApC6ZSIjjwjpFQgxyiXRUIvGZoLi4I6HHr5cZFxP9FCaWoCq6bCKLgPtG+Le3vQ5RstcclEuUzl4OGsEeXM/dMMpUyVsJBI/dQXml0vqCK7h6wNvISDG5cgrrEp1HziKtRefDRZ9SQWqAjG9fcXHTkQpj502kngFz8MDpIIoxdf+PqsdoFbofPd/srfiMtFeud2GjvtUBpYk3eFH6d6FDDjUMQ2dSNCCGVDSYMrwFQfbxpvrOHzp17F3042agI5FiE8362MwHSeX1svU2EFJa/MJmwzA0lau3PTjIORCzB9+hB18P5Wqnm0eNRESnAxpHeRFApM2MaIamCF5SVc3hcXE+HsObfOqT7hUkE7C1l1+wA1qKdnLluxq3XwcqFjVyfHIzZh1QiKT4Is6CHfYYZq/klhd1UJ98m3byZN8knNsIoWTjGDAW3/8OOe9F3zEoCJz8XW+iyDJFcp8PCHzaAxqykVl23Ofs5b9xsKRgOaRXUo7OcN7CEufOMB1eqVN7pPGfwa9sTy12RWwP1/o6D2woKjQ/eFNmq74/adPif9/m9vdXWpdpEiYvjwleY9XBf1XRzvhbrTWM7elVaWxfYX83X2PM2dhmURO1B5IPQbA9E4x545o+kAeECozbsX/lUJM9YvDWL8c4oNoYgNlnbBpxNSxiGMohxZfyIzZHu2NAERDPd5XRYbkxWxzIjjjnQ0Rnkh7R4WgNgDkssR8pK/5tpXz/zHfcar9NhN0SMVfPRtnkK28UOtuR1Fc9Rx/iu/QZ0AnyMcPeESZu2BFNWfm08vY5aB2tOd4I3Khup178a5axQ1B+r1qKzME2F4N+DGvLqLLsd3Gb5dkbY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78bcacd8-a320-432e-c5f4-08dcb4e72820 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:40:08.4313 (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: U0JrH+eeGxriQQQkPeBoc+Z2vMrlvqUuFTMsk4WKCm4n99RtAC7ogOHQnvQqiI/cOvPMoiUUkJ5Jd6x8ugUC9+nyBeDMXTMF6FIO3HoZ0BkR1cXi/NxMvXMYu1zhCen7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 Message-ID-Hash: 35SAE4YYEJUUEFA5BCPC37NLR3BGBB67 X-Message-ID-Hash: 35SAE4YYEJUUEFA5BCPC37NLR3BGBB67 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/intel/avs/path.c | 2 +- sound/soc/intel/avs/pcm.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sound/soc/intel/avs/path.c b/sound/soc/intel/avs/path.c index f31d5e2caa7b0..dab52a90f4c31 100644 --- a/sound/soc/intel/avs/path.c +++ b/sound/soc/intel/avs/path.c @@ -171,7 +171,7 @@ static int avs_copier_create(struct avs_dev *adev, struct avs_path_module *mod) if (t->cfg_ext->copier.blob_fmt) fmt = t->cfg_ext->copier.blob_fmt; - else if (direction == SNDRV_PCM_STREAM_CAPTURE) + else if (snd_pcm_is_capture(direction)) fmt = t->in_fmt; else fmt = t->cfg_ext->copier.out_fmt; diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c index c76b86254a8b4..df71a0292d4a6 100644 --- a/sound/soc/intel/avs/pcm.c +++ b/sound/soc/intel/avs/pcm.c @@ -40,7 +40,7 @@ avs_dai_find_path_template(struct snd_soc_dai *dai, bool is_fe, int direction) struct snd_soc_dapm_path *dp; enum snd_soc_dapm_direction dir; - if (direction == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(direction)) { dir = is_fe ? SND_SOC_DAPM_DIR_OUT : SND_SOC_DAPM_DIR_IN; } else { dir = is_fe ? SND_SOC_DAPM_DIR_IN : SND_SOC_DAPM_DIR_OUT; @@ -331,7 +331,7 @@ static int avs_dai_hda_be_hw_free(struct snd_pcm_substream *substream, struct sn if (!link) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) snd_hdac_ext_bus_link_clear_stream_id(link, hdac_stream(link_stream)->stream_tag); return 0; @@ -372,7 +372,7 @@ static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct sn if (!link) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) snd_hdac_ext_bus_link_set_stream_id(link, hdac_stream(link_stream)->stream_tag); ret = avs_dai_prepare(substream, dai); @@ -695,7 +695,7 @@ static void avs_hda_stream_start(struct hdac_bus *bus, struct hdac_ext_stream *h * disable L1SEN to avoid sound clipping. */ if (!first_running) { - if (hdac_stream(host_stream)->direction == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(hdac_stream(host_stream)->direction)) avs_hda_l1sen_enable(adev, false); snd_hdac_stream_start(hdac_stream(host_stream)); return; @@ -707,7 +707,7 @@ static void avs_hda_stream_start(struct hdac_bus *bus, struct hdac_ext_stream *h * re-enable L1SEN. */ if (list_entry_is_head(pos, &bus->stream_list, list) && - first_running->direction == SNDRV_PCM_STREAM_CAPTURE) + snd_pcm_is_capture(first_running->direction)) avs_hda_l1sen_enable(adev, true); } @@ -733,7 +733,7 @@ static void avs_hda_stream_stop(struct hdac_bus *bus, struct hdac_ext_stream *ho */ if (!first_running) { snd_hdac_stream_stop(hdac_stream(host_stream)); - if (hdac_stream(host_stream)->direction == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(hdac_stream(host_stream)->direction)) avs_hda_l1sen_enable(adev, true); return; } @@ -743,7 +743,7 @@ static void avs_hda_stream_stop(struct hdac_bus *bus, struct hdac_ext_stream *ho * left, disable L1SEN to avoid sound clipping. */ if (list_entry_is_head(pos, &bus->stream_list, list) && - first_running->direction == SNDRV_PCM_STREAM_CAPTURE) + snd_pcm_is_capture(first_running->direction)) avs_hda_l1sen_enable(adev, false); snd_hdac_stream_stop(hdac_stream(host_stream)); @@ -1602,7 +1602,7 @@ static int avs_component_hda_open(struct snd_soc_component *component, } /* RESUME unsupported for de-coupled HD-Audio capture. */ - if (dir == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(dir)) hwparams.info &= ~SNDRV_PCM_INFO_RESUME; return snd_soc_set_runtime_hwparams(substream, &hwparams);