From patchwork Mon Aug 5 00:34:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816806 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 161E6C3DA64 for ; Mon, 5 Aug 2024 00:41:47 +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 8AED349BC; Mon, 5 Aug 2024 02:41:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8AED349BC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818478; bh=WeFjavISzMSFH/srSndOZpGAOt4ap9JGSkD0M1q5alA=; 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=AExyt2PapCXpBNtmzU7ngi2bk40nB+6byp87Jb3paFjU5K1lyjtGSDc7wIqfrFn24 YsC56VtV3KRt+aW/kyrT/L9M5szKtxcmA2TS+xCpiPA1Qqy3fDye068Kr8FGbm+zeb D7gVoEr9djIwHDhTbz7mjmwy/Ya0CyWNmSVMGfwE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4991EF806D1; Mon, 5 Aug 2024 02:38:52 +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 E4320F806A9; Mon, 5 Aug 2024 02:38:51 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C441DF802DB; Mon, 5 Aug 2024 02:34:46 +0200 (CEST) Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazlp170100001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c406::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 E0E3CF800BF for ; Mon, 5 Aug 2024 02:34:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E0E3CF800BF 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=K3tzODYG ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cP/8041kwRR0t5zWnHrlcTgyvXKV8JqBYMPeG/2+J9lwUCC+vl3Kar0p8cOg3YXQ+SQsmSqPV8JHbhn8B+8DULOXYv1L54JVQr788JF6XNfEuIFUPEjlhsUy4wwieB5nlCkrMTlq+TR7V1PiYzYMYjNV/Llf0BSLNHH4vk+y3n92vEzjGBXSCjof0of+ExGHpjS1cPSbuTeJgkNsOwFjIS23WCGK7jTg+3/9zvlPPGq+kp1jAaorV0mkWloV8PAE7h6tMXOUeR1Xa3eeFPltCFrP5z8xT/R/vmPloGJ86C/evDwfLhhk6ApE3VCe8jNoGerVTzMKifoBlGrTvRYhJg== 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=jA9TzAfqUrRxp8P6/tcc0m8ON2s+ManXGlpk2hx2ncs=; b=qyWFX6XTvlRFBmxY/Es85HO/km913Dr0eMKW1SU8qWOVIR0JFbggpbbRE+IpFp4OMxIAFDywsWpiK6cT4fT4uQRcQJBAkxa2Smipw//95h+cAvn/LuzpYJjR9bhbDhHzQbjqQe3AVlANwvLP+pistfCBmPzsaDVIMfuwcBUHlCE/ufe5BL/WAdy1u2eypdNBDJuW+zNpoTnlPk9MzOFowtQSi2iF2HPD+p1DDtPwy0m+MwzpcHiblNxKiepGkSQBDMCIXNoYZkFdftdgqelyhCt9xYWKmGXujn0fj4fMDCkYzxZYYIDr1mtCVP+HP00tAdi7TVU8MFxhezb0BDJfeA== 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=jA9TzAfqUrRxp8P6/tcc0m8ON2s+ManXGlpk2hx2ncs=; b=K3tzODYGL3l3TKPH3A1qyZxepiu9IxcTUBt2ORuCg9Fw9HZhe19fZMBHIxhgYrBYyW/ozzHoelX+z/BdzbA9Ka6Q0TgFcSaqRFonqkK5NU9xAvA98SJb9rx/0MvwcNbKoEnO/hyui0vOew8kpjYZLyLr7jSRrEVOmdIebxJ+CFs= 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 OS3PR01MB7994.jpnprd01.prod.outlook.com (2603:1096:604:163::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:34:41 +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:34:41 +0000 Message-ID: <87v80f24f3.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 006/113] soundwire: intel: 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:34:40 +0000 X-ClientProxiedBy: TYCP286CA0078.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b3::15) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB7994:EE_ X-MS-Office365-Filtering-Correlation-Id: 18bb4f58-52d1-4826-f27e-08dcb4e6651b 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: g2LLp72OHdvK+YWLb5CFCzJ8WEkjX6yhfGeT3VLyro/pT0QRCHAWOjUcOb1ttp/I9tGNxtV2XxfeMhrmPCloE4PlJShJpiiF9T8Xaon8XJTJr4SRo4Xpa3sAc7Dwbgy8nl8iDorarbGjN/jOB2o47jmvbYy3TXWJAMBuLoqf3H6LkZk8rB3wajRPYGxB2cyKdmTUiabtp8jJkb4hvaAfIi+GZeW5UAGjIbFU/yfZ24mkqYINtOjMPkJmxWTwsvmT/I03EqAF9oc9F8/ghkyiwr2DuA5zMo8vNYM/M+IaRN4kpwTzTxCVKMUQh5sGOaJ5WZB+qt0/rd1Gs9RXReprkjK9nrLQTR9B4v7L25ayKdGkThxqDO+Ol1qj6ueaM6PPjadaTjgQ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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: fvMWKfIPCtx1yJ+McZY2gSNVE2IUXnuwcRnKJ5RxvRgUoFERzb3GwfDyaUx3x5UTZ1BbE698T1B2+O1hOjO1ua++LMsNSxUM0RcgNBdE/WNlSKS7uLIDvZYvxKBmUhK0gDibZGlAYnfzbJVqCyXaPiItXfB10yDAfUDigM8hfst254tDfg7zoJCpCBuxv0qZ1yDQdyog4jV3qbYpbgac9VpCY/wTGjf/BeLVyKqjDbxEZ486eVnitOJesmOUoln/voC3/4CuqmODCfFp11zl17u2xAUaRokEpgU+1SgA/2mMdItkClgb3W9zh3uLysQH9wA+r8fKuctePSEM5e+8vqMqLAUB0FvBMuHKweUG+6RUrmxD0kdhaUFVs5aWdy8kWHJt8Dul1VVDJ4zqZbGBs+fug7UkZ+y3upeeRdD1AREBoeX71EpGHRBb+fe6VHgu/Iq/1e2vn1TR66RqfYQR1W3NxwN0kcuQ90KIiPvDkSvMks4bO9562Xv2V7tWSZyQfXSazuYTu0LGT3Po9tO3SabPVzWO91Plpl+8Vq4JlNUnKPtZke2OifRaIvJ0TLaq/lUEQkntpDDI4zX2lZAwdg7/MeYRY5wFRr42ge0+oKDH7wiPCr1G9Dlho28B/YlrM8HCTvi7FMhp+67yZuRJd5Pcy9v1A9TxGLGYP+6koZLdB11XIzbo9OCtqUP7nzq/G8IQkr4w2osbtvvVOukXKvlZXOhdqDORUQd9t+jW3KQBCR/ckv84yGLjPUt4FBdlruiHQozPrrehLSLWQ7tQd/4cHIBr7p9devPPghfcx4cTUs8ztsLDIonV+iLvPwbH9kzytGVSQwGmjxSc9tNREezhWZfuXdV1CEW8Bf/oA0WRXaNmEQB+8Vy1LrGyTpowaCwI1/SYSt6J1LXML3TFEioIqggyk3qbaEiEUV5r449lyCNNOPcLWwzxlFBjUrFk06g4MZq6BN0BGoXA+ArpLIgYWNFO0e4SmH6wh6MwPbWQstuoLosW02DRtRUsUuj7I7n97OuMjROdtlOBcaSqBJyBIhYPwGjJK2JQQjVJaWJmXE39PFMMKwPFTWcFgQtnRgNkeFTvxYDcdLGWdRZTp1H6e3QUcw2I/xaX5bQLSOeR7Y1DWuAXF4vDH4ygRkF8Vx0hnJRHqh+eHEDfrzm2+C8G3ZOeEE4+6ZEsMwI+Vr4R0XV2S7Db3/mA3NOVp6XPF39UonDzeS5s7AzMnjbWWbUi53Zo6ayuioi0GpP2Z9pGf+ya1Nvunkx4yKIBNHT7a1JtgDX0VOVxBNXokZ4iVqhD/FHol3ivNIy3UL0h1zofZR9icGCdSzHWbjNwgyccjXMNGeqht2WxKPzMxStt1e5J5yjRXVAP2dwngy51Ve8quF/TYmlRg0UNxf8WFhtnoxrJx++aNIRfJTI3RorGje6a2xBEyskFpPSL4Bz3ZIgeH+274fuNQtj5oDBoqwUERsSCR+7fJ0vTqd0SMCa5fUX1TSntAXr6uVjSR48KL4kGoC3plExleUmZgk6PHdTSdDUtUCtUebRDC8SdxWeNPZCyzlpjCDxKC9ZrnH9r/Rc8dd+DFBoGIYS1V1IiaoTkxUGleYuQc2NjrOZRFU8WR1fOsQj1wsuSRncWGrkjOg4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 18bb4f58-52d1-4826-f27e-08dcb4e6651b 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:34:41.2478 (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: mtUgCcyc/kSIZRhpz9h1Y41Z3o8/nH5Ant3AhlqKCtIonbRRrcRHXRbIhyH44ZSItum/qN3YNY4mllreKlzBfWnSqLo0uiBEHNYlGgft8/EMGGvfzAcuh9mLw8fW6uPP X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 Message-ID-Hash: LVGNL3T6MHZU5SAO2LAT5QN3YV5EQ6VJ X-Message-ID-Hash: LVGNL3T6MHZU5SAO2LAT5QN3YV5EQ6VJ 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 --- drivers/soundwire/intel.c | 4 ++-- drivers/soundwire/intel_ace2x.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 421da0f86fad6..17bad341f2336 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -734,7 +734,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream, return -EIO; ch = params_channels(params); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) dir = SDW_DATA_DIR_RX; else dir = SDW_DATA_DIR_TX; @@ -819,7 +819,7 @@ static int intel_prepare(struct snd_pcm_substream *substream, /* configure stream */ ch = params_channels(hw_params); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) dir = SDW_DATA_DIR_RX; else dir = SDW_DATA_DIR_TX; diff --git a/drivers/soundwire/intel_ace2x.c b/drivers/soundwire/intel_ace2x.c index 781fe0aefa68f..b1cc9041ff917 100644 --- a/drivers/soundwire/intel_ace2x.c +++ b/drivers/soundwire/intel_ace2x.c @@ -319,7 +319,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream, return -EIO; ch = params_channels(params); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) dir = SDW_DATA_DIR_RX; else dir = SDW_DATA_DIR_TX; @@ -407,7 +407,7 @@ static int intel_prepare(struct snd_pcm_substream *substream, /* configure stream */ ch = params_channels(hw_params); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) dir = SDW_DATA_DIR_RX; else dir = SDW_DATA_DIR_TX;