From patchwork Mon Aug 5 00:33:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816809 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 18141C3DA64 for ; Mon, 5 Aug 2024 00:39:52 +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 BFC7C48B6; Mon, 5 Aug 2024 02:39:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BFC7C48B6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818378; bh=9BMN4WoKMTQrUp40AzXKgLjbg3IXg44C9YOag9OiH2U=; 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=iBSwS1475Ee98Eon8uZEwhKQilFKkuKryVslrEUXWg5vQAUpeUeBs63Idh3P/EJts T0H0K/Dbx+1CzSPZLM09z85WB3K9xi9SkyyUJwMLF2TGGK8iQKMuNH/214J9TTcqBd uwnFPS+HXEVoCd+rhWgrzTgfTT5UkZI9k5ghfp1Q= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A443DF805F0; Mon, 5 Aug 2024 02:38:45 +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 17D1CF805DF; Mon, 5 Aug 2024 02:38:45 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E73FFF802DB; Mon, 5 Aug 2024 02:34:12 +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 151F1F800B0 for ; Mon, 5 Aug 2024 02:34:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 151F1F800B0 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=aJVgRWb7 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RgmHITRTRSYGCTUa1bWm0qNu99sIu1gw3G9rkE2qIU1uZwBDGCsX0J6RgpTiHoi+Aya39vsoDr2QOQ0/YqQ028ZdvzujsJm99PDkeTDHQQm3vxU8kxFXXpuKKfu0JoliXmykrL2Yt0ftvQmZ9SoacVbu0Qq0RyBLFi3tzd5MKzatWi914ubjqoNwTS25gfM0r4JPBUmn0lUrw/zhQX/wKWEde+wJwzB7dCB6hrcZjRy17KXfroWBLknZ1/SfIo82dHx8wQYIZHHsYexBZHAcyTbvX0GdSPz9sVVFqKPf3Hs+NqMJvMHuvahqj4GQwCX3n6LX+c2VRiPZq84avfCxdA== 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=STRgMxUU3+hM8Juwob+XlXbZHALOi6eCpfXS1P5jhEw=; b=MC+97zJO3HXuiH57lZRsxjFzA61TwOxAb5iqymPU7wj9UPcJ2PzBIsDzjPMtrb/CxDyU0/FVft7wkNazZncSVF0+QgqtJjcXVcvduAd7Y6+MOx1vOtNrv6auwghY/KczJcS5bjqIweWw5HWcc8UOqIaJ2znhgykRLYmsMwyLSS4pVAzWv3+bIt2vDn1OwHwdv9KXYmDZT6GLpwyDXljmUF28n65L0EhY6DwtXNUqKRMhF8NyoBHurf/FWvk0h3DZLe4TTJSv8cbQWndyVfy7D/4X9zzI4AnRkjdvhohC38mvsPfbuiGeoTjwLN9G0RUapZwGWuoFiLPTpuy6Y5PCVA== 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=STRgMxUU3+hM8Juwob+XlXbZHALOi6eCpfXS1P5jhEw=; b=aJVgRWb73+Sn9eceDO0GNND+x8RGSR5/77VSbVC3/Net0B9aqmAfJwadhkVC2+DKC7cTlSz5JVKboFQ0LOUM2L9HuhUlsvH2LWgcrgqowWjc51yoUy+n4dDGSXSbW9JpKiCDqYiMvB7nIoVepy7MrqwhbBU1W4regGcLLqLTo2o= 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 TYRPR01MB12335.jpnprd01.prod.outlook.com (2603:1096:405:105::12) 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:00 +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:00 +0000 Message-ID: <8734nj3j0o.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 001/113] ALSA: add snd_pcm_is_playback/capture() macro 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:33:59 +0000 X-ClientProxiedBy: TYCP286CA0357.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:7c::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_|TYRPR01MB12335:EE_ X-MS-Office365-Filtering-Correlation-Id: 4bc15a6b-aa0d-460f-7b1c-08dcb4e64c8a 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: 5OoOhkkvteeSJ+9MfZQqZb/VgM7s9SF1Whiyo52ldEFv+sJpXjyLAU2chGg7sYD1XomEf7KbclK75sDi82G7xze95cBYvn68wuSnrJbzx4qShFfaIqvpw08GNtFBsCkXOZBx+/+goZJ5SnuaR+Paq+qOiYXCnxyJAM3z2/YsKS6AEAkjzTBujYAk73YNdP1aSTuWbmNRqduqU6ejTygvT/Xk1/0sD/3gzUPcpSxmsc41zhlqATxPFoH0teQzsZBoVYWzga9ZlJiITRli04VLLzm0yV6CJmnsl+qySLzDTN58Hg4XOD/wWKvZxVviGfkEQgyIazNSUMF+i/UrBSwtFbuT5GTw+alxLCeAd4awzqQRj1VZz1uUHWvUt7pZ3L7AvjWQolPsSuI4Tz2BE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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: agZcM2BOvG/4GIOOScfT2tiq956c3hOQIy9Kq8qn8Ug2u1kEPYgoV1GNQMqoVfaEl5OJbaFA3Kpo9sDRnMCEUHDQc+81CpDvkjAUdF0PGOscfIf+rddosRbW3fHLM1BYnkA1VydseeSujNK60P60022B0JYVRyxNiV4ycD3mSlYOfOP2/fdXaRXvfBZHr/9CZspSTNpLeHpsDCbxU7DYNosDO7xvF0t6PtNJFgOCwTpsam5pT9Ac0uGcMhX1uRdwzTCNuYsrny/ced5S5rpad9QfsGLW3J3p4gWPDy0u7WUVkVIurDNlejlVB5VnZQ7An70XKHmkEvQWltt4aCYhlQHTvq7coMwLsLeULkgKKJd+zdILQLtXicbDEfc4pa6eUcdEt+JI6/9bX4KGgwzF5TyRzgckRM0DmsODbmQn/DTPJuP3qcLzIaGZqTwFP5zeYbSnz3EzJhyBXYFwlIgtgJ+nub1pDsABE3hbKRwbZrRjFLjND2CIjkyHWzR1y/njoEqG/Yh/HQnYCDnVD6Q+MV2dIZqbnwApx9trXWtsmiNTYDvaNAC2HqWRwyIrmgKjcfjgo3dzplvUdae0GCiP7MYBu6dRWzLZ0uHZyzP8/vZB0IcjmDeUWVDZ3NgdOTlZhFC6NbNQ5cDs5zsXPm8nNWwg6VGz8EeiR9WGh2CTG9/DDD372Q0ME+HxFSlIrYy8xan0aw4OKmSiiWFLY6imj77qxsXphbrh9/xdHvZrfBYdF+QSBcjCDrgqVgH7WveRihbS33zSNNMXW679u+r25EdTdZB406wQlPTdZrsemifvo20/EJiS5jy5TTgkVzaqHBKCkDW4eE5LF7cDuQKK8SqPc9F11vk1O9+na2uPJm5Vq1PdmE4E1ppxDHODHiInGsYjOaKXzi2HlhuYoLPpfAm3btTCoycPIEUCUKOrCIR0f4h0doitAZECSFvvdu1aKomRtmC321D0DjWTgTLgvuggsGziq0YWb0kjkvQqBjLhEC8CC0zmjUaQQeCWcz6GTqsJj+h7/w3BVx6s+TeHE8sZF2RzxMOllRsUm7roIOkRCkmbsO1lXTK7DOp/Kpwd+fkmXr9wKKm5cGe/Vy0M8W0lcv65tEATeoFkPwCFu6Z6PCKuWgi+ipxGNsfDiBc2NAqy6zpGwOuqULmapMEreVbpfHPNWURzvSFnWZfVpzCYIT7mEv6pbia++OKVbQtq7mk63auPNNq2ePkZqZmwtilRzROun6C9y2S/hW3Zuf3H/18TVvZatMzZ6QB3fSxZZtyPNQtvQrRKmH1neXlODpjUtklfL9HcFT5RnfCvHpR2DejG+Md2ZUqgR/D0uksBxMqZTtdiMJA9RKaoNM1xrB2sNx5/4LpIB26uxuRbuTXRiPoohi+hvCuiom7xl9TC6uIBUHSnxicHEI/kQDUllpaYi2Mmhrub8vuJmj262yDT4MG/dzN+qz5VjLSeRgX1oeaIU0kKsQxqt8Lht5wmvz2NkcF+9TkkPkkbDky8o3Dmgcy9KFVapqOQuFWG7gjpQX5iUBoNjWP0UF5K4BLUrPdHt7zuA9WmTuF4QxzFtDKh4tzS5sjPnhgaYH9SaeiTJlGgVSlclnrDbfiHym1wcwpmOuft5vdv8lF5D97QcwU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4bc15a6b-aa0d-460f-7b1c-08dcb4e64c8a 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:00.0487 (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: /p0tLEq8J7tm9fjYeWedS10idxNNQODGaDds7l/YtDBz+My5E9HDeGGpDLQve1SpsQc0ElowULULkW3V2uBf7VZb+UDTH6O78aWhIeBifiQHTDXc4m8IxX6KluO9iRLH X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYRPR01MB12335 Message-ID-Hash: ZTXLYATKRVA6ACY4GFT6V4XBCIR4ZTU6 X-Message-ID-Hash: ZTXLYATKRVA6ACY4GFT6V4XBCIR4ZTU6 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: Many drivers are using below code to know the direction. if (direction == SNDRV_PCM_STREAM_PLAYBACK) Add snd_pcm_is_playback/capture() macro to handle it. Signed-off-by: Kuninori Morimoto --- include/sound/pcm.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/include/sound/pcm.h b/include/sound/pcm.h index ac8f3aef92052..69e535aeb8e82 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -502,6 +502,35 @@ struct snd_pcm_substream { #define SUBSTREAM_BUSY(substream) ((substream)->ref_count > 0) +static inline int snd_pcm_direction_is_playback(const int stream) +{ + return stream == SNDRV_PCM_STREAM_PLAYBACK; +} + +static inline int snd_pcm_direction_is_capture(const int stream) +{ + return stream == SNDRV_PCM_STREAM_CAPTURE; +} + +static inline int snd_pcm_substream_is_playback(const struct snd_pcm_substream *substream) +{ + return snd_pcm_direction_is_playback(substream->stream); +} + +static inline int snd_pcm_substream_is_capture(const struct snd_pcm_substream *substream) +{ + return snd_pcm_direction_is_capture(substream->stream); +} + +#define snd_pcm_is_playback(x) _Generic((x), \ + struct snd_pcm_substream *: snd_pcm_substream_is_playback, \ + const struct snd_pcm_substream *: snd_pcm_substream_is_playback, \ + default : snd_pcm_direction_is_playback)(x) + +#define snd_pcm_is_capture(x) _Generic((x), \ + struct snd_pcm_substream *: snd_pcm_substream_is_capture, \ + const struct snd_pcm_substream *: snd_pcm_substream_is_capture, \ + default : snd_pcm_direction_is_capture)(x) struct snd_pcm_str { int stream; /* stream (direction) */ From patchwork Mon Aug 5 00:34:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817127 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 1BE2DC3DA7F for ; Mon, 5 Aug 2024 00:40:04 +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 D347D48D5; Mon, 5 Aug 2024 02:39:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D347D48D5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818388; bh=Wu2Hgbm+NG5sa19ycahQbJwlVy9dLO3eNLS0+2qPqpc=; 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=llOuTZ4vQmdwHOAKHDUE7uoeJDiqfaBFGBlGulpkDOvEmIiaQ0NcZNA3DaYsihueR 6eht6eoKTvVT8FDFqZzdh2zo7A6QUkQ/eQsJZGEizaOyIwQrZ11WVqGXRKbhge9gdd n5zu5ntpizKzQe1zHvwIuCjF3cYSl9fuhDVa/b5k= Received: by alsa1.perex.cz (Postfix, from userid 50401) id DA936F805EE; Mon, 5 Aug 2024 02:38:46 +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 644FCF805F7; Mon, 5 Aug 2024 02:38:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 259C8F80448; Mon, 5 Aug 2024 02:34:20 +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 9B59FF800B0 for ; Mon, 5 Aug 2024 02:34:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9B59FF800B0 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=i9FRwNEP ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qqaAbDJf7acbhuSY1+9Dml4Mo0xoQvof6x7X9Tl8wkzKT03j4antPFORXFHEivJEX36/HBDruJes5qO6SWW+fk++1CPx+ZfxvU1rR+y2UaT6y6n/JUw3X65LjgyGM0Uh8vha6N/ny2evNVOp5Fc/RTx923V0bo/B2fS1NnCdfdevDF3LcDLuFtaI9Yxu5TK8pUKGdCouF3bHaWNMxiS04BlANQ0qxm2fHdTW8JV1Ks+gGLEewbJtCu8nfLHTDCQgpbh+JhFxjx9t2R2a/yCOk5L6+W/RXJD8rZN0ULtMZ2N3E3ZEbY+WtHFSO/0FmAQCerSCp/GL49tuAMhiN7kCQg== 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=2BlIdZU9HhCJ42PTLUQESOSSES0dzK4sxPfy7FuBfwE=; b=QqB49tZ8PB8GbMCH4bF7yQQW74hA/XdVzpRee4TAnxyV8/hxyo9gdgrzT11fbouKfLXvCyiBB3MSCUknTRhH3CGzHPx6Co1vpUdI+OXMhQpT9ZBwT6WNQ/9K9aKOeAlbMLym0lOajKEQvenMtLJh1eyn1amJfpRExICuh3qOUD0/8UXrbu8vprvihETgJl97OVcNlRa1Lj4N/IN+N/2T+FKL7dJDLkx8Vcl586YJxxtjPPHiJTFPcAnnXt2comHv+OkX8RAKx3Pn1Fcxr9vMTurpd7m+onCyZfXm4Wp7k2Fht/PDmwtCJ2kydzjQzHXlKWg0Byl8OPj2+xIb6SCKPg== 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=2BlIdZU9HhCJ42PTLUQESOSSES0dzK4sxPfy7FuBfwE=; b=i9FRwNEPBlGKFI4LBrAPPQpbnt8Y16lL4gFsgA/duPY0ToaaRg+V2EFHAFX0a83QnptObhcscY14ilxPpXaCp85fjNPJj2d9pRQyJlpXY6e0q+4nEcsvHf9fhitlw+qEinJa3JyrKqs70sfWqVQK5Q48Ky4PVBFNZCtKYrT5sX4= 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 TYRPR01MB12335.jpnprd01.prod.outlook.com (2603:1096:405:105::12) 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:09 +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:09 +0000 Message-ID: <871q333j0f.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 002/113] slimbus: stream: 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:09 +0000 X-ClientProxiedBy: TYCP286CA0316.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3b7::9) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYRPR01MB12335:EE_ X-MS-Office365-Filtering-Correlation-Id: 70572247-d2fc-43ec-717d-08dcb4e65216 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: Upb9dvTSqwP1t5ytEcEom8x8LOE1x2A7LvaZ5Htq08HkG46IK05tVecs3+sr5px2jowxkNxAgEYUYu0Jgb+vrydL968Mfut0HoS5TQH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uNgrSnXdkQ5dJUwYISqgI/VK6GTstjBNvQUomeJOXa4k1Kwq01cBv3TclZ9zuH5kTjfdBDx26g+mX9S4ykSeXd+WPcEsy3SZrcie2zcy9hKdd1x2IT+xVb90s3GmK2jFIl+WGyT29rB5LP0ZCqso/CRKYjObu+JGSi+fJYZF0LRKI9s5U2J9O9DEWPhAXkiVxkUN8akVDseq0p5l4ID2mPUgsW1/qPn80Uoh8p3hViZ9NPiLbLPf877hlFog== 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: 04A445JSX8/8svF9Mnu4WfW4djrcWmTHQJCE++CKuLb/jh2zI8k0Zufis4xjyC8+JfbkMSVDZPrnRQSsaPW2BWSne+aSuqAVg/Ijlz23cr1O4NN+b1Mukkyuvj6kLtwrXA+K8/iye/jO3+5lSOEx5jLFKCIsZOUZoY3/nicrnDhG+5OPtH5S9lt1dldRzJg5xjFIUxwh2WLrEVApa+N0yCOc4ljx0lVI8bcx5B706oxNLMOIpJsEiyqAFUwOq+8b6O98eMYcvDxEnF9FtDbx0SsrrqQUqh6euecawqFu2GcZaNqwz6tCZyv6SxTT17hUpZLLFvqFrcLFMNA9ghfvvus2f00g/LFojCg+EH7sJbxA5GRhNdaw+jxx/bBE0fwYQzedNhvB+1UDtPGwQhIJptNvXAQKUOAkPVpvTYXbilStbhtXJPjfa3LFVTh6FiVWZTQWk8UV+mFroV6dNZe6Z/b1KHySg/CP4U9jRvdnOlqUqZnuAs01Ap6mMm3MvaaymQ+Czn7OTToADBFhhx8FHhtKKRMJdUuFy1fBDBnkMbnVvjaMxsU30jfhF23liGXz9A6b8AqwxF6ExDdo9+TnoH1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Tenant-Network-Message-Id: 70572247-d2fc-43ec-717d-08dcb4e65216 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:09.3813 (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: UjHHLWpfp2ZOg+0lp3hbU/2Ru/CQw9Rt4BrquEs0LdqC1bQm2QAUH+8LN3x7FxlrnhYPQzFDQ89MW6OZ+ElvFMHRVR6wA1qg/9zlmEKxdnDRIsTGD7outVRGNYIm+kMR X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYRPR01MB12335 Message-ID-Hash: M7PDB73PIEYQMO6AEZG4DK5LK7F3EUAZ X-Message-ID-Hash: M7PDB73PIEYQMO6AEZG4DK5LK7F3EUAZ 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/slimbus/stream.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/slimbus/stream.c b/drivers/slimbus/stream.c index 863ab3075d7eb..e65a6bda2f5ba 100644 --- a/drivers/slimbus/stream.c +++ b/drivers/slimbus/stream.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "slimbus.h" @@ -235,7 +236,7 @@ int slim_stream_prepare(struct slim_stream_runtime *rt, * data rate not exactly multiple of super frame, * use PUSH/PULL protocol */ - if (cfg->direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(cfg->direction)) rt->prot = SLIM_PROTO_PUSH; else rt->prot = SLIM_PROTO_PULL; @@ -256,7 +257,7 @@ int slim_stream_prepare(struct slim_stream_runtime *rt, port->ch.aux_fmt = SLIM_CH_AUX_FMT_NOT_APPLICABLE; port->ch.state = SLIM_CH_STATE_ALLOCATED; - if (cfg->direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(cfg->direction)) port->direction = SLIM_PORT_SINK; else port->direction = SLIM_PORT_SOURCE; From patchwork Mon Aug 5 00:34:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816808 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 9D9B3C3DA7F for ; Mon, 5 Aug 2024 00:40: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 4A134491F; Mon, 5 Aug 2024 02:40:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4A134491F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818411; bh=7eSIdsafACvoGl0jkQT3jSTsRL5qsJFqFq15w2TTKH0=; 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=Ce23kbzVwJbiSWdN6mXTj0DYKKOuu+umvLNCqyOYQZ+8oHPrZ+aXICqisIwpryzKh 51siWHIR0fwqH3rQGI7ITe7rCLE5kIJ/lkG3AZG0Eck/0mh1gGcCZ2RwysloTdC3Gz Xzt5yUs9AnFcxyHh1KnO8dwZ5DR9DE+tZDpFWdFM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 239A1F80619; Mon, 5 Aug 2024 02:38:47 +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 9E8ECF8060A; Mon, 5 Aug 2024 02:38:47 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C0678F802DB; Mon, 5 Aug 2024 02:34:22 +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 C50ACF800BF for ; Mon, 5 Aug 2024 02:34:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C50ACF800BF 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=MsIMRfhy ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WvwYN89519nPB6hMkEq1SUdD9yfieFzS0by7d3g8gnnLLvnexSaOdOcIxSJpZGtow+72teRZ7H9e1wllCYMH8Zhz2VwT/DEN81WJ41k6fBrGc6/FIRjqHJcf8GGECyUvtPcLTVuyOTBIkx6xmryQYducacWjNCc9+lmInwWrlnqI0lwALsaWaHRH0vDPPGI5B3CAvHRwys3ZgWUtyUR/uzy4PkQ9akCqFeeeox2PcV30zNLAVtp9W0hA2MJYl+gJmI+Sfzs8WfPCMRWEUzB3wL+IrC05eawAypKSbyAWrZKVIgRDOe3tNqBiMsSXO8um9w/xrkLzh+/l0d2t+FEmpw== 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=VjmQFyL2yLF1SSPQGT2bLiUTDL7Z7nshJwz90vu+LhQ=; b=c7+YIMBJsqywoKCmUiOAGPn5eCK/37sZ9qIitwHLxStBn7td3m+UuZK5MvQWSA5PJzd/cWNIpe1ikDn4Y/HXQuYyv5b3lBhm0mIM6QOi0zoJ+GgF7CP9FE4ezAfULVCVq6pKXKA77e67kukRMIvc8QPbS+rCpp0wfvM6gyhztYyhDcNdEwYTFY8ej1YRhg4mdFBOtxv/g76sKjml8Ll3DYpWJpx/QAKSgal0LEmIej4OpUN169zpuwmMCi1+3b/227pp12jXYLjAtkJkcDYOl7TwriC3OoS250AEbApOoe/YeijQOD75bwf/F5vsHwZ3tpRJcKNh5Th4d4vX58vw/Q== 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=VjmQFyL2yLF1SSPQGT2bLiUTDL7Z7nshJwz90vu+LhQ=; b=MsIMRfhyPs+Z4GyTYib6qrGUcyhZrfOvDbuPAGqcaDj6YQ6q47ElF9ig9OGOdDwebgxWwnDKlrUhuEmtSdEKGuCoQDeXVmUxrEEgWQKWo9PAbJZ5cxoMrHJGVKCD596T1H9z4u2n80D5cfQmSVSi4s0yztUW6mL4zkw/OjFfXJY= 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 TYRPR01MB12335.jpnprd01.prod.outlook.com (2603:1096:405:105::12) 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:15 +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:15 +0000 Message-ID: <87zfpr24ft.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 003/113] staging: greybus: 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:15 +0000 X-ClientProxiedBy: TYCP301CA0065.JPNP301.PROD.OUTLOOK.COM (2603:1096:405:7d::10) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYRPR01MB12335:EE_ X-MS-Office365-Filtering-Correlation-Id: f922e9bb-e439-4ff7-ca02-08dcb4e655d5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|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P5yxFDGZ34ujBFurOwkY4WEQc45HjrYT+CpB/TMhKemAf7oF3e6CTHSZ/WVcq4kgTz9Igs3i1qkq2wKaz7tiU5aZnKyQ17AF5LdjYbO0DK74uGAttVAU84ud1jIOA33g2Hh6n9fQqFkTrsizzUpp00lTyubFKsdT/CkqoFpQiD7ddFGVzgLt3RztjsXDyZ8g5UhBaceZN9hKFErxaa5vtZf/W3tuOs7bFWBd8E7bv9E2cAhELKMB95ONrCFlNKaXPSdKQuHSvotCwHg1m/EVK/TMIGlm5CCgQ9GRMQq3Hw67bHfhlgAzbMNW5uEPGkUUeEwfFYHestL+Qgu4qt36oeYNH2C0um48WpEvxMXrL5cH4yY7nrAmASuywwy/4JYBQRF7FkxpCT0A== 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: 9DK2SD/DhZGtiM04aEUXJNVlQKBwaIVP4KQs6/sTCzqAzEbGl2daE9Farq7yOI93CEZy0f7oBrmImFUtMDnY0gS3/VRJ8CDixiCfpJThHKSLqZOudFF2OI+D8MUZUKIe1JlNPqJnwjBuJ25AxvvE0xLk3haSGyeiFYTd5XHXV0AKxEgw/4jRaACHKNcFDdsERX9Fm1M0cY4RNHpQn/olrw7h3EFJ0tO/kzCfDdg0uQORA2AEDIielw/UhznNZvmplF3JWnBf99tqxRKg3hjD2SH6YnibybDqu07H+awR4/Or5VAQY7siFMG2bsKAxvDo5JW1xELK9IIztmauL/fBgRBOQtlhc6B6QIjEii2hm49Cy6FAcoI1heBikxhCI+biwRFd8p6WYwW+Ii1mIYaGm9PoBUr6edcYHVHnIQViev3ZW7EfbDeOR+tB10NBpymP+7KRrXO+ngb7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7n/gkspdLtQl7W6AMYzk+78wKMCcdjZnF+5xTEFsTNMy1MPgy9IsutS8gt+QCorUuD24i8LIV7Hb11U3BuSo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: f922e9bb-e439-4ff7-ca02-08dcb4e655d5 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:15.6363 (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: hd4bWABnUNiTOkZlNsBf48s24Hy1mRaSRyRZHrdRdTCrVZtD0qw7pZH1T0byY3R7/VGFouhO2GEBu8xaDOHmWIao89d5JD3CAJ2DHqGs9lRhNcBQReilYcInLTDwCID9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYRPR01MB12335 Message-ID-Hash: VX52IPOTGCNP7ZMWFWCQCB2YNGI666GF X-Message-ID-Hash: VX52IPOTGCNP7ZMWFWCQCB2YNGI666GF 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/staging/greybus/audio_codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c index 2f05e761fb9ad..3042a486c0c51 100644 --- a/drivers/staging/greybus/audio_codec.c +++ b/drivers/staging/greybus/audio_codec.c @@ -478,7 +478,7 @@ static int gbcodec_hw_params(struct snd_pcm_substream *substream, gb_pm_runtime_put_noidle(bundle); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) sig_bits = dai->driver->playback.sig_bits; else sig_bits = dai->driver->capture.sig_bits; From patchwork Mon Aug 5 00:34:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816807 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 4E61CC3DA7F for ; Mon, 5 Aug 2024 00:40:54 +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 B5FAD494A; Mon, 5 Aug 2024 02:40:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B5FAD494A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818432; bh=wZUcCKfRypx2pFpsANvr7jOGkCTb6aV7BTj81uwNjbw=; 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=haDzoqsyWNR+QW6meD10UNjCd1o3e+VV3pUu43DpanV5ULiHrUm05qJdgeT2JuRDi kGO4WriGJLV/qvJqd2LqBhZaUOd4x38k+WpTLoPu3xvsvTu5cZd8/aPVQV5tKzeNRb l9lOyYFvGfy4sLwPPAA/Taa9YXvRGSwRwWadMnWo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 605BAF8063D; Mon, 5 Aug 2024 02:38:49 +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 063D1F80634; Mon, 5 Aug 2024 02:38:49 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0E624F802DB; Mon, 5 Aug 2024 02:34:30 +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 56965F800BF for ; Mon, 5 Aug 2024 02:34:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 56965F800BF 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=EcA48BcI ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MOTRdvzhPiTwrJlSgfkZ5JCoWDVX0wZVQ564iaga1qUEGiKAfjrAcnOUr065SCo1ai476S8Cg9zRhAMLhDyJPTZHKj3noGqc7L4WzRv+zpnV+7MHxk8AEYBPSIE/BnL7oWlnDlzdNAdYcaoSRuAOVOsYSr4xgcDNwRgmkLRI3511GCuacHjt1wnufwjug7gScaTQZ9UZj3lUzh9DkI15g3aN47uiyxyTC/3vG3YYMdf8t2Ul1kOT9+jQwWzwGGEqqPc+91EpU1P4gPJSLL/oN9IC3RVLO1+km+P1EB4jlT1gveYbGA218ePjHxi+dsi0UHWaf+uoEkf0kM8CuqbASw== 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=XjR2gsSnHpxklssZ9xh1RDlJx2HWTqEa2D3t3xpLY/k=; b=Rc8r8j66cgx+CIqm/ZZfG+fX9fBYlmaOPJodUuEL0aNYLNWc4Rhr9Wb47HGTpW+4E0DIHbMkz54fOUDlx+owAsRIrMf0NLVKTBj+Nnksva9725Uwwp7xRtq+nZWNUSv1hX9OmYqLwx4NV+64tmJ4g+0YD6Xmk8CLdFoShEwfFZ/rmOB7sXasjfyvWp6I/lhsOC5hfr8H7TLqPgb319kw0ppBoGlPZH5uNfM5h8hGQYUf+JGah+fzTrhcovJt+UexqkNy1L1w7xt6mRBgQSLftPqswFYuTsJhddetffdrF44PPc6OI2lFwmnv4BdeP9VW384M2DvNN9iYWb+E2Y1rmw== 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=XjR2gsSnHpxklssZ9xh1RDlJx2HWTqEa2D3t3xpLY/k=; b=EcA48BcIGa5emS1rMLNMVmTWQZKeUJSHBdokew9A0ejtUI4JpeH1DcWVuzYtmA8hbY68/u+YsHxIIdvkQr6IjAE1kV5Uv3Kag1ED6oIj/OZHpRwqpkEVFl3rCbDtaMOE7fbn9/urot76JukbI9dCYfVU3WBn/pWQD2IjwF752/k= 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 TYRPR01MB12335.jpnprd01.prod.outlook.com (2603:1096:405:105::12) 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:24 +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:24 +0000 Message-ID: <87y15b24fk.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 004/113] soundwire: amd: 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:24 +0000 X-ClientProxiedBy: TYAPR01CA0043.jpnprd01.prod.outlook.com (2603:1096:404:28::31) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYRPR01MB12335:EE_ X-MS-Office365-Filtering-Correlation-Id: 49cb9d27-cd2d-4fae-1218-08dcb4e65b06 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: JNjxnDD8Ctx32wOVru5nYtpmV/o3YTG2MQ7ttOdU8lH1szeemyGiFltrXa+QfE+qdRu3E/A15bytDXJFBxNB0QD0iGTu8ca24r+F3wv83Oaia1vz4s98u1k2RHB+OBJODb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idjXglMhA5qRe3+avALxMJl/GfNsoY6ttybzRgkz9vaESrzY0Rla0jqmJU3FqzB0cOkcfpYt/VYsuWeeyFXCfwHf+EeJWWayvgkWRqih8J7vL1H0C3RJ3Wg8Pj1KdRuN0ChMQ1OKlzFDzD4nBpYF7Z9Ek/o02AT8surKnsUMTmBYzIXKJm1OcKmxWUmrT57mS5x6riCFLj0l0tJW5wgw/M+aCu73A== 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: OvrR3/BQNX/ar8WDroXKzxEABcDNrOaHiglcimY+EhTJawMR0gnOEvlc/m1LKOguI5xXQJORHEGy9oeMvhEwXa7buXU3mpiZyhuJvPKVkxRRUZ9xrq8QEHnujkqnRuE9/P8RqzkC1vxikOO1ibb6dg3Ena/VHtIVEdyjDztVPVNTeOn0R0aZISe+LFwrkcXq1CBAY2u5qdsPo0pdKLGnS4CDcTKRvtjBf6CG437sBPrsxSEXKv+VXk8O82DpvVn63xgo29kVFy4Dc3dJTkMXWmP5nWQcnzS3ol6fy7bTXtKxtyBW74p4Tl/BBdwcKKCLdzhZtHrMdT0YUS9cl+ZFnBAa6tV3xvqIaW3LbdWhmeP3syBmhn2Q452feXomSj3dAqP2daT4eBELcB9CG1NfmWnxoZ4bF+iifIqq0JN3YPdJ+xbNghwlOy21fWQoA9doYCeb/28LKfx3iO9lzbXCVbh0+/LJgHKns3DXvY9CLAsvX7xe/sPJt2b/dH3WZmzyfooFZD9pn+ZMOMc7Oaq8RuW3vkxtDJ3FxuAeW/5UVSD3wvHOS5qBAVF+3GMC36xnXxdxpndIfFMHCPRs9ZbqLurvDqvFK7brRs7R6q6AIvb0w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fae-1218-08dcb4e65b06 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:24.3353 (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: X4ZeXkfULjs2ZQQPs5RPafG9u42rDQEAwE2Z6s8wY7v5raHBceFr9//7Ea65DdGjdrNe1cuES1/lePH+mRinEvG9PdAK5TIJbj5iTwFrC2t8mBCAHMyM43LBrDQKVarU X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYRPR01MB12335 Message-ID-Hash: DGFON2FNHSWPMMSGSEAJQOSBGXTHWX3J X-Message-ID-Hash: DGFON2FNHSWPMMSGSEAJQOSBGXTHWX3J 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/amd_manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c index 0d01849c35861..6f9e075b49979 100644 --- a/drivers/soundwire/amd_manager.c +++ b/drivers/soundwire/amd_manager.c @@ -612,7 +612,7 @@ static int amd_sdw_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; From patchwork Mon Aug 5 00:34:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817126 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 A8980C3DA64 for ; Mon, 5 Aug 2024 00:40:37 +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 304294905; Mon, 5 Aug 2024 02:40:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 304294905 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818420; bh=qNJCRsLqfzjpUHxq2E54CJB2RRc/uc5QQ4fxmJJByCQ=; 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=VGacjmE1yyspd79KbM3VNeGpecWLbXJRNHLmlCK4TUMs1r08g+Q2Heuiaok6XKmwA MUQ3sBMdI7zFbYBEq2iD/YtMeqYXRxNN7yHfw+3P+tVR9p051iQGv44tE7Lvhv/O/j syJYwgJCQQnRmGIk4OK6xxAfRCHr1je9YfO2XUqE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id AFD7FF8068E; Mon, 5 Aug 2024 02:38:50 +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 7C41CF8061F; Mon, 5 Aug 2024 02:38:50 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5A234F802DB; Mon, 5 Aug 2024 02:34:44 +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 6CD00F800BF for ; Mon, 5 Aug 2024 02:34:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6CD00F800BF 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=ELljCNhv ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xI/X9pJZfnYMmjmE5nGvQ3sNDJ+k4lAMerTbwY4sfb8AKMUWGiKwGc9zfd1iOsr71kiNoKlEWU7xbiLD3xd9pIx9aBOhLlp9NgvmbXoObm10DLDEeSy5SpSknLufFsRKObFCBLyEuhxxuwjayhixqBji52AMtxg20cNzkxDKhXnEMT0w4pd/ZDOsnM/4eb4XvDvvSbKhscUlHnSiK62SERg9NvTnhjLa8KZI7CaWq/DCo/KXZVgrpMuYBkBomlPN35zrCvOk49hZozF4Q5LuIjHVJcJpsPIuYOEK9XUZSap4eVw7ww0bvqbhSZeojbiAModr1hjyOSVsSA96Ia0TPw== 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=mn+aFG8W7K/ky9R9XxqYenET+qsj6NVDkrVCrdtoqVk=; b=hIBEO1n0Yb3Izt/L+8U579wncwzvE5Rh27A+YCVOl+IPwAN1hEmmMfk2RRf3vEMXwKprN4YKtm5wVhrvjjcXZh6druNwZxhf2JP68ri+UyiQ7weqvI//XbVg/QmpY1k+5DmzJdUL94uXPfMmTe6hpkX5ska2zyl9/UJKLYkI1Og/Ckc9Ci1NiGORgLlN6Yad5td2UclViz/268AzUQpoJTvZgOMfQgiPYc9U0ay037R/xATlkNmb1eDz1op7NJbUkLVGjBk3GhDK3CXG3r4VEj41vwADsvU+fUsW2NbjlpgQtc0NmGkhL2oAtjuqsuExixP7YbgfDpUEIhA5MSzUHw== 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=mn+aFG8W7K/ky9R9XxqYenET+qsj6NVDkrVCrdtoqVk=; b=ELljCNhvpUbyiR2Oktaj9JTB7ih442gLXbMNHwL4nkRVzc09AMTo8fMJL5nhebX7wINyNLhVrcd1eFns/c6JH0OdS54vyd5h6rjhHO2tg7osf4dYgM8JIDQlR18t79W/QrgmMNpGxH4c/vMj7EtgdDGOsNkHMWFy1BHxROPuLaU= 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:35 +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:35 +0000 Message-ID: <87wmkv24f9.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 005/113] soundwire: qcom: 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:34 +0000 X-ClientProxiedBy: TY2PR06CA0018.apcprd06.prod.outlook.com (2603:1096:404:42::30) 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: c18e3242-7169-4290-e87e-08dcb4e66165 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: JKpcdzJtpMRjhofGXfpL4cOtu4+EY7Ti0PPQxUUyHL7C+DIXb5V02Ngq4UzK4+os48uZ9Di1xE4oQgQKZ4CbM153qfZKCtXsK66GrFCk67s4vSEBgd2WLJanFjGJ7a5g8GINsLHthN4zpe5/EV8wl8f68qUdSQXjSTHoMaklsoao49g9ueZJzsdjsdo1AK/HRbPKxJq4uGHrhtKxZL8tU30B0ESFoQMiYDZtufUzNGKpT6kVJV/t4K36XVywnTP/QGjeciIDzZ60UJ2/IhPF3iokeosHomJoBwbwhW1ONh5Z0O8Y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4crjRSS1SPkpWaAjZlwUjnho/4Sx8Vj7g== 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: YMDlsI/58iY1v7XtCQq7QhqTlL/2uI/7lTO0uoqQh0uKYTs/BUamJL3HBiF7eHw6tgfESf0wYTDETVhUc2iZisgMFwNnomX9lu0Czb/qtcG3PoyGk605MKGFsPyaGwkfHvvpyt5R8kQdHK9yUM/LYxW+O8l8FSaHX3thnmBh9EnTBGrKnrsx1PFk9n3KoReMYWXdWBHZ0G2HvFYtnDK7biRkNY0JYbaMKsgBl3XKtA8WFv5ru94dQxIACUglsxFwzAx1Ie2B9L47rTqYZarSndj3L/LTPvSP+MwrwS8GB8kTgcH44ajLJHX4mrpg3s/oWd/ju/Y2BZT/DccUeF7JQWNU+KKwgYAWs11a4GgzEh3NkHq1ez9T8Zbe1GE5uW8Q4V9+hGhZDYpgBY1gRkaWa/cIKEksGrLqsIk94C80j4kHWuaVs4oTdQYHK5y1K7t+5V645LGF2eC6fz/sLIeY5CAKhMCTCU3PFmXAr/ZLnvxSchUCaNHYIp4cx8M8927NJngthDcDi9VLSNVw6wtDkKkv0QKHGsBx3I14TNEEa53Svf5cZVaE+bslbguAMbPEImTNoBlM5u+KXUda66yxMGfgymbt5Nv40AX6dT8CYEAru8coziGYMAXRlQeY2e4H/qpOJThRlS1IE5mochXzESRg2P1eldPbJzShb+lqun0Rx+BcrT0pqipIE6UEpC84K4YZ/YU5keYDOs0zqpnGpUvWSn6DfcG0dIN0lT/WTygP1kLhsD1MbfWF8EGd5dud4kZDHvlTc3CLdvOanXHsXO9PmMfcrc0hLMTlPtxvUmrfGW5j6GCBYRXgPy5vJ1gZyvJvZTTdIozcg1amAq4EcfmtAmrEq3rp/mORZ05c8HXtfjeozGPxtIzyKoXyS0CO8umLcwq+UQrOrmzdrS9Ln+S2NCMb2qimc7q+LeTzCstGn/fcJwNx4G3thFzVRh0FSgp57B6+UwtF+M+ugY0XHc6uS4D+HRVAhFWXAHWBlK/DQse3NaIJkCZFqbdr2em9VDXA8lAXRXqlH2Wiu+J5Jn5n/TAPBUWHKK5U4xosUl9Rz3ZTs575aOmdZyfRH/tgEKUHMtRPo0c/caiwh3LlzobV0nDW0Wv6t0mubbXMgMe1W5OTNWZKpYJ481Y0gXOqjWSYxhI2OILHhF+PPqrTFpPiTY64vG8IiXW/aZ6W4cqIpV0fE8mWYV30uw55o1o0gCWVG/WiGHg0L7Ny2FKicpxfEBaBTN2z9Ouw5aRxJr/0Ijvi3sFw4lBJIsE4DsdZRDGSrVSJvESZP/4sC51YDS9lPGES/ptGyN4hsqgnBzWPbDQiemyfM2JBHnJTkRZemToeU46YnZ/fxUVsm03x5rYyEjpiZyTXT97lMHtzXu61usE1lClFJ49Z8sOmy6zGvYmCc0vXLPnDaJY5GnTqsIyNh45wmAZe8j1Oy5I+VvQrXoTLjvsiSrHFxelr9Hv6ZTUh5kqfMe68OEcqnCzk101KGGnqSXPkVtAFyUtLIv5SeVCb2ebUq+EMZKB7SrMiKjDDOt5NSUlWu9gSqtGArXLspOHrrH2G9pRrwI0p6/A1tOc9AmbnQuWk1M+8wTRyWfpC79ueaEXjIRixJR6/LwyE4YLljpkIcRS+bEXSbvA= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: c18e3242-7169-4290-e87e-08dcb4e66165 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:35.0125 (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: rzomtmDD0IWFJxNKThCMgBCewSLGr2C7BscYayyrWO9vG7iouIsn909Lx+TBdyAqIBnc2KFDj66I4K5ziAkNuqa7c7E+Qid2AOBMIqcX6h7nIGKu0RuxEYfVoDIFaC0T X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 Message-ID-Hash: DGNHYMH3QYXSY4ENESOS47QCCXJP7W2X X-Message-ID-Hash: DGNHYMH3QYXSY4ENESOS47QCCXJP7W2X 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/qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index aed57002fd0e6..0b86ee6a4d77c 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -1168,7 +1168,7 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl, int maxport, pn, nports = 0, ret = 0; unsigned int m_port; - if (direction == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(direction)) sconfig.direction = SDW_DATA_DIR_TX; else sconfig.direction = SDW_DATA_DIR_RX; 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+Ol1qj6ueaM6PPjadaTjgQu9Bw346FPCMWWsiarQsWPphxYV9SVOrOj9FoZJXxEw2cMJ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: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; From patchwork Mon Aug 5 00:34:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817125 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 81B38C3DA64 for ; Mon, 5 Aug 2024 00:41:26 +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 444CA4928; Mon, 5 Aug 2024 02:40:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 444CA4928 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818462; bh=HTOIKyRnbGjMMvkGw/4lco2EC26MWWYNJgK6EGT4vYs=; 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=tupJ76vn3lUbi7S9+TGnToY/xNnskGjfxlGlVZvYJTm3HQitVN8TaMU+OvdLweMKy IUHzrWwGzmI9UFUDHUQBd6P0j9nexK9rLMhZPbFZaStPgVAe4VX1up6gsrkanr0ViJ GwzvAdiKQRaFHRhFwJ0+v1CTvllWQgmz4wPtyhsw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2F8B2F806AF; Mon, 5 Aug 2024 02:38:53 +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 7D555F806AE; Mon, 5 Aug 2024 02:38:53 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1ECACF802DB; Mon, 5 Aug 2024 02:34:59 +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 98497F800B0 for ; Mon, 5 Aug 2024 02:34:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 98497F800B0 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=YGvOuFNV ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aR7612StW2rRWB4EruJaLNnFpjKBzTLFb+s3zHx+jfReRHGj9L++YmzTHUHe+zXQ+cLfhS+E+OoYP/xGvm9LHR8Olgkf+D1ZWBLjFfm0jU1kprXLNyyic6Ez3gzZkESeyHTPGcE64569Eivdw5DBpdGJmkWq3TSP+m1fic8VbVqUU6s6bQoWr6feKpXunxfu6sw5AXs2bGikdm2WlPUhpzlBIo4Qi6XN8jY598TakXIIFsSJgzHCZlKJvHg2BfdC5jj4hLcuizB2+DGUyl+iviyuCy+GYJu4edgwLeEe4b17A8+ZVHdfb7yOSBwpeW2EuFfN/WgtxzCSQCKLNNdgiw== 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=0+2Pv4qJ9iu6M9SujEAQRp7TY80S6LTXNnPMHD4yBvE=; b=tyPnys+TnJ41sHIYVIWPQXPH2BGr/bovvKX8DMA4WcLoJqGVQgP9zY43NnY1J0nZ1jSQ2tmByBbLWoqscH9MPOzO4mLQvVjL9vLPs3nnfDx6jKBKBijUilApC+uJ6/UZMBbplvPuWJZIye0zAQSWFDVgoEwGWPkqWdF5DaQSBHc9IfPXxIwCnmpqRmR3+VI/9nZxe3alJBGMmZIcjauX+atipl5HQvMSMThyCwDLNoqkhRDPkLa+dsFFk165xhtcAKhIjhC97uB0RQ4eh7Kme9RILWvKh1gM3d6Re9rXh7pfRB1QqjaewYIG3xnFUAVRrgd4xT/DQVOXpOCaYYNJ5w== 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=0+2Pv4qJ9iu6M9SujEAQRp7TY80S6LTXNnPMHD4yBvE=; b=YGvOuFNVIxGJQAuv3tEjwjhuOaNFKdrNXm2rOGAoJL3+4qYJu96ctKDMTUFDkeavAJvynho4+dUDflHVP3yj2Y17bE76/vUOFH/ITXEfoSgXTXuPopggXR4uJYkSdHetfGdAHRhhFwNuXJS+4M2W7UVYBlMeWNhkX6/dUZ5Y21k= 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:51 +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:51 +0000 Message-ID: <87ttfz24et.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 007/113] soundwire: stream: 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:51 +0000 X-ClientProxiedBy: TYAPR01CA0237.jpnprd01.prod.outlook.com (2603:1096:404:11e::33) 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: 77db58ed-f799-43d4-6768-08dcb4e66b5e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|38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JdRp3+HrEu1YYdLlqFfjjaAQLo7qQX/wmwNawQiOjMh/9iTNf0ikPTW0CPF+1Yr9x1gSQ980XFxWIqeemmUUt+Iq+siPIzkJJHSwIHPqymPUgfNpkwUJbZwzbem9kPNAjWTyzOaILx5RIiBJCZ7r9UZ/6gzGCM04x9J6B3clGWHJfRCB3TPJbx8aORiFMXwrEFgS66vHuA5njSqeuVf9P9Jbouo2Ey0o7tDTm9tHiJxmBHtLWWITExpo1QDlFpEeQM+z3QbOTmcrYYycxjotnte171y5zfAPY373rL4eHaW4Sxm01oMiyHlbUfTqzGYUl8TpKGYoP+yp8YAtVZuDZUPMekpOwtkX5ct8hmzUTXoJpUtgA== 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: bV4Zujx7ALCtwBZ0Mgez+W8zn/AOET2udXpv4V1NkTB72Ehl3OdiXaHresoO8fJ7OBZtkct3/Um/O/RoGW+qFqibJrEbrSOU6iyWF02cZZw1ra+l4imTg/kBvKlVOObr9tmypjfa+lggt/t08i+u5DeDKGWZoezR0Jq5Denc8RrNV/cXeuBBwF9YRV9hwjlNZnYJRXeyTWZBQkZK6Oepbh9scaN3kk3hmtYKpdR/V4KQkALKs1hsFINfiNm6Xm0X8/u/sEmpYNfD3pHbNrFt3UYhTBHFf/ga0U2dBT4M5O4SjwMCtoDqhMOxuzNezbIn04m4Rhb+ypA3fiWKRxZVTd96YzNsAXr+Ia3ne34rJq5SCwhNDkU16euQ9afw+KLsAbtPesOuSIMG6v5qiHp7ySmc3PT2ESmEMC32rwQetjy5KQhIxSrZ5Q7TP++Efxzmm1AUso5EFvBCNvh/QeW791mNATfrCC2r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OSdjF20cvZqQpYMbtP9itT4wXwhufTX7eKz7t29JEp8jErDr75mlnjFfc+yodDboO7QgpBpOLMar34y6KbWw4c/wXxGZhJ28PInZshDPV2c= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77db58ed-f799-43d4-6768-08dcb4e66b5e 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:51.7320 (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: LUkDo73Lay8TbSxlZlizE5J1nI1dCO6lK9wqlOhERANwbFEKQjqOGSgJv+zpeuDbigTBrU4uNZYxgwxDp/d521ZqYeHLSveqq+nmixLxSudajQi15xNrsjWTBjeMFCzm X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 Message-ID-Hash: BHTNP2LRD3ERRF3CBUM2AHOGNGC5VA4F X-Message-ID-Hash: BHTNP2LRD3ERRF3CBUM2AHOGNGC5VA4F 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/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index 7aa4900dcf317..d471506327579 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -1781,7 +1781,7 @@ int sdw_startup_stream(void *sdw_substream) char *name; int ret; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) name = kasprintf(GFP_KERNEL, "%s-Playback", substream->name); else name = kasprintf(GFP_KERNEL, "%s-Capture", substream->name); From patchwork Mon Aug 5 00:35:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817124 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 3F38CC3DA7F for ; Mon, 5 Aug 2024 00:41:51 +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 1350849BF; Mon, 5 Aug 2024 02:41:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1350849BF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818485; bh=0cRBQYa7X70wjyvei3chAN4k7fTkbsPa8BYLzdNmFzk=; 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=LnPOqCQMkzlzjiVXDsw3jOPo5M2bBwTSqdStVdrt1vN+Dg8T6UfwMK0MAx9Wputuh O3ukQvsNcsW6bUlEzBPnDlcI+Pn866raeIwPoshaaKf0e8wgfESwjr21hsO2ElGz33 zffZx2HjYFWFIdNBVJmIJs8vMd5nk0B3SXK83luU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8B8A1F806D9; Mon, 5 Aug 2024 02:38:55 +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 54328F806DF; Mon, 5 Aug 2024 02:38:55 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CCA40F802DB; Mon, 5 Aug 2024 02:35:08 +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 9BF0BF800BF for ; Mon, 5 Aug 2024 02:35:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9BF0BF800BF 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=cFJVjafl ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=USQcUpxb56KN1x5mzSFogulePun0zPrfg/XaV00e8ivhrHCg5RaYHF6Q7OQu1wrJu/S59qj2y2mCIRcRTSiGfJSNE+WgI4Xme5nXR2bljYzkoXbpAMUDmceKbNioum4wPYkts9tv47tIBxDihYjlr1vsi5NeDDBEZqk/C1K06lOc8CIjiqzrFKmvVxJcQu0bquKzEa0HqP4fPTgbZ/jxrYzNu1ggCzrekqb5A/JUZNCA4a8a2kVAa30P1VU7nzOQFs7k2/2MEJv2SdAQnONFgN+v2DoYpL/p2SYZNXFOhwxJnbtfRi9r2593XSOB8MhxicpTUYTan/7v529q9yDAsw== 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=1ces1U53ktVFxLwc0yyu5L4AAL0qNgQj/TlhKtcqksE=; b=BW19Q5y2cC4zFSjJA6P1hf4U9pqKvT++WZe+NxcEu/FXFB54K57VOLVzsTLhq88SLhKcbRzrLBymhNyDNbi9J2h1FGB0J+HMB8YqK2Jwkx7RGmsTlM4pQaZV8vfjmyrOOj0N88XemXefSnA8U+kDH6dpw4MnWkYsHSJDCAND8AK1sDswN9ol4qc704ENSypvgmfjqkJ/PdxGL+xhBXUUTRq23ZxF4juYjEQn+VnnFwd7tNYZXnfgZgfpB/LllCkIjsqWxYINJdHIpkEu+eecKMcjGaLh1SuxPnx+xDjVWFjEIKJuer0TzfxYQnrmMP9bJ849K28BGWj07pVUM52tPQ== 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=1ces1U53ktVFxLwc0yyu5L4AAL0qNgQj/TlhKtcqksE=; b=cFJVjaflIyv3nJfpRiPJ3mBXbysPd+kmEBO8sKuEzqwPsB+5GnAqkZkikdTUN9mxJwp4pUxRRDE735+ygoHtIe9PP1avDWDK+Xfjc1csdZi2sOwBoiYeKK0XpGyBtWGgVG+TiEn7WdMsDmXYwzmIt1Nf2t99iMymCs7MSEg1/4I= 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:35:01 +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:35:00 +0000 Message-ID: <87sevj24en.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 008/113] usb: gadget: use for_each_pcm_streams() 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:35:00 +0000 X-ClientProxiedBy: TYAPR01CA0222.jpnprd01.prod.outlook.com (2603:1096:404:11e::18) 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: 91f5396c-188b-431e-b376-08dcb4e6706a 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: scsHlm2gPFeLcTsY6KhChba8aw0qg9y+j+afEktsyJq1lM7IZ4Ef9jTDfX/KZ7e5OvE8XQwJP3xk+09GcNBIYDBiYqtfyl7XJQ10U09L6hclwCrba+glDYMvWBKMBQWlkULC+D6dL/+NRVq8SNnYmlNbhQpz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DK/GY01vndC3tlsNT8ZS2PD8oRRXK07tMyCziKcnI/eq4HWUDMPkFzuRVSBVom1FfNX6wbHNMOVGnHb2/b7YCxcmNBOHIDjrv+UBynfXGq9ktAanNXmI4b1iSgGIncGwfpBG7dPfr1zLYwhn6b0FjAeBNd5pYjnVMVpBtRpM2LgX1VzpDnrALzw== 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: cDhDGU+mcuqbgW+XUkTysuV8pkOfRi/tcisuEjd2PuO8HtiHOWAc8q7ahuA2ocbATrE32JtW2rxuEgzjALE64ssctPfGnTtsbwfscnywvcySPyVITHTHst9R1PNbNbsII+nvAbgbSS3kkL0i7rnPow4EImbzVsRngEv6c6K4RNNAkw6ZCI5R2UDTU5cIA1WvcYuFEMLZCEgiyuDWPikhkT7dWiUmWMj6gbPgEjWOm6X/VOdnIu0D+FsII0wu75zzvGZH0AlxAzb5W6Js1MnJc3pP7Se8v/7MAOgqKpFmsrTYgylGT3v47MaE+OW2pb8dB2jw7vXTkc1z+nagiqYWGRT+xJ/Wcf3fFqrqnlZgqJhB8BnM2pHEcLe1js0SdlqluljYbaZ1A9vSdirfR4HT49NKXxR3lG6CpWeQ81WUJFApC/CbbY0pHgtIoGXhpdjKX2u68L+hb2/c2P+tRJJeKNTXTse84+8yBA6vKJlqiI3Ao3GLTzWf0URkNaDP2QiS+D4eK1YzimOxNDF65CucL09mN6F5xP9udAZW0mQpDiURV1g7piGi13V5jO6OlSBPbctX+dCua8WQGI+Dimmaj4frwJwTjkf5vaJBOk525Hp9qRzzF0ulKxiltwq6s5wPaRSI4aOSTHBozIzv1QfCJonKJ/HAwY2uKk3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01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 00:35:00.2135 (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: JXICSwgs38YGQP4AevBDgBz5GTykvSpU4LDYfOFacVkAGevAwn/LX86kj0W6Cjo/LaIMX29fwd6Hnxi7IUBY8/lzZO5ToqNHeEnTTDP3zO3qFxdp9peRbZobMTgRo0TS X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 Message-ID-Hash: ZGZBBIQTRLH6T2IK5H75WFYHXBD5FMZK X-Message-ID-Hash: ZGZBBIQTRLH6T2IK5H75WFYHXBD5FMZK 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 have for_each_pcm_streams() macro, let's use it. Signed-off-by: Kuninori Morimoto --- drivers/usb/gadget/function/u_audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/u_audio.c b/drivers/usb/gadget/function/u_audio.c index 89af0feb75120..40093fa1093d3 100644 --- a/drivers/usb/gadget/function/u_audio.c +++ b/drivers/usb/gadget/function/u_audio.c @@ -1290,7 +1290,7 @@ int g_audio_setup(struct g_audio *g_audio, const char *pcm_name, goto snd_fail; } - for (i = 0; i <= SNDRV_PCM_STREAM_LAST; i++) { + for_each_pcm_streams(i) { struct uac_rtd_params *prm; struct uac_fu_params *fu; char ctrl_name[24]; From patchwork Mon Aug 5 00:35: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: 816805 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 8F933C3DA7F for ; Mon, 5 Aug 2024 00:42:22 +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 0C7B749DE; Mon, 5 Aug 2024 02:41:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0C7B749DE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818496; bh=IOPZXeXsgRX0h0cqxnL7z7k/O8y0MVDDzhFsYovbWaI=; 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=FV93E3qpNpp31eaIyTUGtlq5rdhv4rO6RMLOoKv9Evmpf4XmPn8pY2r90cWHbqIJc zjqyXIuos66aO/9ycKSuh7uovYeBTuYJv3NUjXhwa0xJ9EY9nE5DNhcSG25mPCmUYC kFvaOVxJPVbRCEWQsKod33FlHv4SrgVBZ7Z0mEBk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id DFA06F806A8; Mon, 5 Aug 2024 02:38:57 +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 A6A45F80720; Mon, 5 Aug 2024 02:38:56 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 508E3F802DB; Mon, 5 Aug 2024 02:35:14 +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 457CDF800BF for ; Mon, 5 Aug 2024 02:35:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 457CDF800BF 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=e23+TJCc ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hD2Bl8wJySkfsn/QE/1cenPyy009TL4jGLuke7ojO6HMRHgkFCJJ/tGeKYhipLv0NEoLno6s10SMVg4WBCI3f9pTtQ3J1IFpntjvBelQWmWfo4kJpkoWgjUmfYNHhL3MbSXRM/E3lVu8NdQFtnHlZKKdURGNrInu689YkadpAtLye9kmtD5JKPEiRYifCcRn04O93jFFZU3GUU1fkq+X0TO9P73tCaxZYF+9L0UV4J8Ym5eQ7vd8N4f8AxOEvB7Y+JpF7l8jprD3QcdfpP8FpLTYRFNp4UmRBH8cBMUoRvEePg5nar/kQNYx6ZycXvJcnU3j43jx0KWO8HVm9bOitw== 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=m0gbCarOVeR5u5TuhQk5OH0N9gggorU44pKSD2LyuT4=; b=TxF9Di4Rl8thXF4BCIKNXRYCYHg/56VmfAA7+oKsXGKggCuFZcfEvvKwC9Pnka0fqGz8E4d137uzgVvyBacoUwtGausLJwX/cKsGozVLx9eOx2TAfNVHZHzpWghVHeA1QeZMgw5R6wh3uCwzdU6Fe2p69MkJa2SPAt23Xue+4C/sGi3bOX7W96z0jRFNIRKUuc3rnrYCRRxteNiyHASHhfbCknhKGYY/ydkwuRKMftMDQRpke/yIKyhA0IwBlFs3PlXPwB/0gIolHh5ABOGtg58cnukr/xVm5FXNgd7Iaq6lAflXPLHOByMYflfI4a8IbKvS2jMfYH6IInHcHyKAjw== 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=m0gbCarOVeR5u5TuhQk5OH0N9gggorU44pKSD2LyuT4=; b=e23+TJCcEU1nNfqUEKpjhfJPsHbCBT1TYKnn34HoH3OZoTH9goJcKrSOBpDa0ylWRbkgbmOsaPoU5j+PPEudc+W8llwsmEEs0XqLyuU9sOu1sn4Eh9enuMpGZxPl2QhVMApq7kTXsLUfK+BeUNIhuaQjZXLsKH96ha2Iy+IJslI= 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:35: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:35:06 +0000 Message-ID: <87r0b324ee.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 009/113] usb: gadget: 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:35:06 +0000 X-ClientProxiedBy: TYAPR04CA0016.apcprd04.prod.outlook.com (2603:1096:404:15::28) 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: 20d65098-8b78-482c-0c77-08dcb4e67432 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: t3NQ4zrAMWlSW47m9y+rDUM8OE6Lgb/a0iL80wYmnPO3yWeULGofCczHSRrqqKYrVdoDub2MNKq+zrAQqnAZpn2uH7maCu+0IjaSwpd28RT2o2e5u2YNb7wa9oHY8+GtMOCtktBjo2kdWLp/kWxIRVjRs39kpT1i2gOlzozGoxjbtm8EAodMKAnggZxecOKy8ldUbycWI8qvRffegBm9WzyaEj/e+EDZ/8+c34FGuMy3wnVc7Y17lTQhNal2Psfg6tS+aBA7j741i4sY+fsr/St5cZl37TzHr3Ot8OiPyYVyBqZKnu/yWXm9YaG+X3MLni8v8nOburRrG/uZnsSbKeImA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T2fA== 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: fpTkmae9ilUm80L1DFB88uWutoeOHV/EThl0gGB0TzydxiHLIfLsnoOyxg1dOoX6TPNJDlfeTN/p6wtbMVkDhLwtrLDOKDwb4uIBCo5NNpDwW710RJu6jcNDisJmNPlFj+UkNbNQPQxYYHoR7K4RD7fx57M8EH0cN5SQIfvsXpZa3fEmpzK5C4zIGFkGHdsXSKGQVevuUW/D5S8CPrHCP11JzlMeVoE0Ff2E0oBBwrS+k/JEMs1vxCDaqSqaqp3s73Jx/aUqPHXcgbfoOucT0uV+TYy5ysso6tp0O5XdvDcDR20KGE+ZAcrA6fWaEANxHR9TgN0v2HNzybWFr46mh+suqMh3P4lsibRShugEkZKncP+7C+C6h4NliLIVrLEezVcBGIOrSDEj86iPh9EuhJE2IS8Fy5paFbtVcHPtw9H9+e+Eu478cu5uOLNbzb9HgM4TFHOApCKZY8gQNfbxwJbKv6zJEeYUPdAeg2DEh6B1fHB70qnue7kNVYsrmFdQajpIPa5Rqy+UHMUQ4WWI9+qk0iWX8KrqXedsIsC3Yv8UcLEXNqHjmowcr6qXEHnK3QCLN9gPzSZhdvaRYBc4zNbvTWbS19kZW+cm0f1egm37NZusjtv/BvyNZu6NiZXFjHFeDz1sgKC86fuRp9DapJ4Q1T/nj85u4OsEXE5LaCVieB2IyuhMykI6ZXP02Ok1xxY9D53rhrHw2+h8JYYzXZ6+ird4myyrotzFEgXkJpbXx8VGn1FO4v+9jFDNirxYaIgqLL9UX8OlxzmqdFuPi1rwn1dXKyAnUDTc2TU7RqoZeE3UwEdeEv27+GgbAdIrn0QMo7ymj0PJbkJh9N1WbUN/F/hUgcJZaFrfwnior/enqcJKkqBCKJmsgtykpqRzxpvzwKCo6cfosoLpKYupr5fjYCMOILxx0nSCerOcrnDbYQolWNcqb3GjNKH/ys8l3WkWRHrEHFkUAC5sFHZSEfQMwAyStG9KZt1JYBmJaMIfAz7QyQg3laMlZusEFKRm/eNzUcljvxexc/wZPcN87CogTqisUH/j8K7g0w625GlLKzIFRfrLhHutYppV3y+5eiVHlEBXQjUjOKOs3YzRX0zj7A+mtAgPezUeNWabujgHGreS6EwFlzINhm54+dKu8ikp/e4sF94aeHfHRkUdPRS6sl4sQU+EiGMVVvqaHv5bw9xcsSf2YkZniR4OTDuepkssjVpwDx4i2mIuxCuaa4l4aS32ZxTQZydjLnBGu9Hh6GgzDmkewl1V76SCaiKzU7ElkCumkKf0TYPwLsqUvMipqszbgiicZGqq21pMJyjdzTuHjDCiRyJIhJ8eq22PFqjDrO4vbtSMSl1b64W2d9sixNT1ppc7nVxVnzm2zXg8bmQ3biYknsV5j4dnb7yVpvKCRrzoxVgQpkpLUI8kECUo5jm5njUuCVDrANBBthZKcaMKCyHdvMPt2h2F4hq0wGr57WNpGFRF9SSvo934LzCVzAFGtnM3W6DeZwGlJ9uDNcnljnABojdZo0UsP6Qfs6CsbSXi/OAFltYdQmRJmyVamEnmPcuZWSUs4wNXc6qQJ8790zmeTA6sEcpFR3r+BKL/L4COL0YKRYxc77EUCi0GtJeRdWjroXbe1H3fGFY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 20d65098-8b78-482c-0c77-08dcb4e67432 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:35:06.5435 (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: zK75Gnthdj02EOMWpEFzkaYDM7sqS2k4evPg9GSxdka/j0IEdjuAcCmRE2PTKUHLw3xBUk7L0r66XDxvwHRvSv/Oepd0DQp+TuLaHGeceMPkOBARFg4InxRX7O7T2s/L X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 Message-ID-Hash: WBUSMPLZ74HLKNVUGR46S6EMLCMUJHXM X-Message-ID-Hash: WBUSMPLZ74HLKNVUGR46S6EMLCMUJHXM 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/usb/gadget/function/u_audio.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/usb/gadget/function/u_audio.c b/drivers/usb/gadget/function/u_audio.c index 40093fa1093d3..09fbae35aea25 100644 --- a/drivers/usb/gadget/function/u_audio.c +++ b/drivers/usb/gadget/function/u_audio.c @@ -190,7 +190,7 @@ static void u_audio_iso_complete(struct usb_ep *ep, struct usb_request *req) goto exit; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* * For each IN packet, take the quotient of the current data * rate and the endpoint's interval as the base packet size. @@ -244,7 +244,7 @@ static void u_audio_iso_complete(struct usb_ep *ep, struct usb_request *req) /* Pack USB load in ALSA ring buffer */ pending = runtime->dma_bytes - hw_ptr; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (unlikely(pending < req->actual)) { memcpy(req->buf, runtime->dma_area + hw_ptr, pending); memcpy(req->buf + pending, runtime->dma_area, @@ -322,7 +322,7 @@ static int uac_pcm_trigger(struct snd_pcm_substream *substream, int cmd) audio_dev = uac->audio_dev; params = &audio_dev->params; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) prm = &uac->p_prm; else prm = &uac->c_prm; @@ -344,7 +344,7 @@ static int uac_pcm_trigger(struct snd_pcm_substream *substream, int cmd) } /* Clear buffer after Play stops */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && !prm->ss) + if (snd_pcm_is_playback(substream) && !prm->ss) memset(prm->rbuf, 0, prm->max_psize * params->req_number); return err; @@ -355,7 +355,7 @@ static snd_pcm_uframes_t uac_pcm_pointer(struct snd_pcm_substream *substream) struct snd_uac_chip *uac = snd_pcm_substream_chip(substream); struct uac_rtd_params *prm; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) prm = &uac->p_prm; else prm = &uac->c_prm; @@ -402,7 +402,7 @@ static int uac_pcm_open(struct snd_pcm_substream *substream) runtime->hw = uac_pcm_hardware; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { runtime->hw.formats = uac_ssize_to_fmt(p_ssize); runtime->hw.channels_min = num_channels(p_chmask); prm = &uac->p_prm; @@ -1299,7 +1299,7 @@ int g_audio_setup(struct g_audio *g_audio, const char *pcm_name, if (!pcm->streams[i].substream_count) continue; - if (i == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(i)) { prm = &uac->p_prm; fu = ¶ms->p_fu; direction = "Playback"; From patchwork Mon Aug 5 00:35:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816804 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 5BA3BC52D70 for ; Mon, 5 Aug 2024 00:43:32 +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 071753C1D; Mon, 5 Aug 2024 02:42:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 071753C1D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818541; bh=N7WYGc4xp4YzmzjWHqh7NC9smpp+INH73rQ4aqDnD68=; 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=TuMKagdEYTSeC9qeQp9b/rKeAOg9DadrpSN03uXXK3UQZ9vxK1iy61HrjODzyH28k ashKK6LYneIxsjvevcpApTsaPOMbYu8WiP3TyfjNA4fu4g9/dvKu/DYW70xEXg46ph dthltchDJLz9/zHNOnN+VqRpIOowmhbwQM3NhVMY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7FD32F806D0; Mon, 5 Aug 2024 02:38:58 +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 DD68BF8075E; Mon, 5 Aug 2024 02:38:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1D703F802DB; Mon, 5 Aug 2024 02:35:21 +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 A061FF800B0 for ; Mon, 5 Aug 2024 02:35:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A061FF800B0 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=ZHos9fAi ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GS8M1gzOaiL8Jd0ySeHuL9dB6DzCizqtCPn6viPppBQU9t2uXIZWTZfrJgJSw1E6wgZsXixsS1V32uzA2qhUO2PMCh8si00Vm99Fo2+M0ygGLd2FMhNo/4oMvkzXlDRbpuIP++cYXZI2IkmqZr4MxLRdfPVZnsCvzvLgyTpobS+Gr19LPxXXPYid61RGOu0+6ctWS6cxzzDUoTghWNvnj32b9soGd/YsI4c8vWgWFVsGyyi/HGkXCRfXKpOvIss00a+785z1M+67+SfBr6LjWedBE+W1L+wWI8Y7b3OxWdgvLm7jCqEFsQOCUuG2URt+RqF6cxMuFyl3sVy76mSNxg== 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=TIeh9UFk5aLeWLWckP6h+PobhxPgKOygL3SUWnoHDcE=; b=u5Zskscy8pGwk7w+Oe21rHz7TQz1Hj2BGVbUHQ+/bsSAiKy3okVZdwcvWOXC5TjV/c2riRbp1RWRPuPWNV/7OF8JHE037HMhfttGRNjotsyPceQdloBePwHKbTPPH63+z8SAbW2SEfBZHqlJ8tThlChyR/mJ0VE/8zcFVs6g/q56tN9RpCnECnHEHuMIwhqYSijpcaMaI9Ie3n+bciyoFEsNpHl4R6cSwJ3RYMmhYbS9wInVPUsE67IVVEAztM/UfSeqEmzeIZkchhmUgp6Tz9aRfnXggArXgQBaTCLs7o8Dr/snhOoxWLcomH/y+XuXrf8ae55Zx5UPSHYFob7Kqw== 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=TIeh9UFk5aLeWLWckP6h+PobhxPgKOygL3SUWnoHDcE=; b=ZHos9fAi5UEVfVKLvkRcHghaSctP/IJ2TdpR9SArGhCYzhw3ZVpHMG4vHdAEGQU2AGq4KZhFahGU7ZwsVjCj587jWxng0APd2mLyKwokrqkluK70IpXu4TsjOmxQNgysE7kAgewjWHh+AdjzY8cZ14e/7zqfwJQ97aG0Evz/hM0= 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:35:13 +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:35:13 +0000 Message-ID: <87plqn24e7.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 010/113] ALSA: isa: 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:35:12 +0000 X-ClientProxiedBy: TYCP286CA0271.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c9::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_|OS3PR01MB7994:EE_ X-MS-Office365-Filtering-Correlation-Id: d8a39f26-c2dc-47b0-d536-08dcb4e67830 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: N23fPjWVHSLQ5iShx9qT6HO2wmZ193LYBu/ZmBm+SAMkvkw8AnqKLgxBtwCyxaPlMP/hqnOIzZMs9wF5WOY/NPs26aEMIQ8Xxbw61DmyNdNFf8J4v9B0YuH6iJvonjWu2znfWlzmSvUbscgXf6oJ1YEGzUJAAovSsQefsKQHrscjnGlBDL42//aBQKXMJ8fGce9nAn0V4Z43CNTgIPVZpDq12bE4LLLIsd5IXPeMED/00+Mqq90a2vRmg3co+0dxBiXRACQFz36kV+vEAwQQ/7wA4G5tONy2w6AK8p1HO5dKmqe76tWymPpA4Wg4786+7ahUCdY9/FACklkKoKFruSyMkv4jm7ol5Ba5mp1vDQKryE2+er3FGLwIWnEpKL8hZA1CZ1LWctwOd957EdA92OFHXGshX0AGKZMNRg28sieMd5Lb6qxEsu4PoMWcI/aJklFv+APQ0t8tSGFS8ChqX7gf9HPOWi5pc8Xw7FKMxBOAQ6HgYEoaDiRkCeYhxnjj/9RuCvofogkUUwfzSWvVvGWMYoa9d5+FThy6mdXxnRMEK9I9/GkYi7YZ7wNChseh8Ib7f1ezM2KW5n47LkT7bl8PAWUruT+crWbdnhfaa3Pcta+nRvKpPA6nnJvshNsnfXFOfBY3n0LZkiivjCLT22nHr3dsldsMd+7645miU/dq05zuWdF9JGL5B62XJuw6hT2Qilm6+yKK83E5eAGpXRILJ6hu3p5iIPXowt+QBI928k8fw1K9fkQKy0aXFhOUhzWDRxgnZ+3mG5k6dVW38W1hW5IH8Hc/qmthHCjxsaaLQdozZHRfEGQYOi5L1h3xPtXl0+FOm1g7BVdgXlvs7bGe9ECtnr+tdXQ9w3lSZV39Zs55Vtqjvq4W4ICUPF0XKfY9Fduwlf/7rY8bkcuSoLirtjlkiBXdC7X6sXGNyEUaNV4SXesTgpfsvkK1MzsrjHf71AkFYNQk+jn1HXFiZJxm1N4Pz268UiBlzWVZijLCpgbTUl4XaOhYYU4Ep6B05BSpBxi2+ahrIaIOKydgg22UHdcaFzb2jgpA8iFYPSFITyQAEL1Usp76g+Bg8uZtQhMit4DUB5C5HQ3HiddyRydSXbMJLpiIbT4ZbSTkBs73LmQAEU7agACc9lLRDlLztZA8SXIdDzgxp/mnCeIxafMyBrbd3URSUMyjXIvu/T2NptUHyhh04Y1uXTNZLtw1Z4RLVc0Nh187Iy3iKhcb/3IBA07JERoBFzi1Cv4hdzIRYJnLTNIIpw7f9K8Si3RLynRrfMveUO2n7uTaFRrxYk1gMaTrAj07e9jyT+nwFius4NkygG30Ym2FBKa2yLYUnfYayKbn6gORw78QSjHlZXAl+E01XqCyEFLXhO3cEOHNLKcl3js4HWZsHNqNkT8ecrjWY1phi7+2jqLyIpoRBg== 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:1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ZcHBfG2dxrIDbl46ekLyCXLkZRKHFq/Frdr3RQgIvgrilIz7/chP6fTMgWUreWt74dTrSfJUmY10IVZuYW9nvWZMyWAH2J3kPFgUZdFjZ+DYFwjjlIHLqKEX6CO7n4rhYUGoP31Tc49zzeQ2u1ZOmxHiqEVnYkdtonGDBpDBB8yREdZnNE54KogesadQhJ08Q+V1zDWHt6WSMZ1C4DCO2lYJYwbyHuh3YOUtOiDbrNL37Z5lPRANPZPn7CQU4I5WJ8FjAt2/lMoxR9GJW9QQv5JUM5qYLe9q81uYIA/lDHODtmfaHFXKHYVjRu38ncWo5kwlwH85+ut/XtYAUONCjAoeHQKaaSTc/RLZnFox0rBJ6WL7m9wiy54LuWIPs5+IEw+LC6f70alqkbFsbuTdVBV+7v/FMOyeS2OZuSJgvJ0hZyOYyu/iwfvw4g5F+znqLytqZCJC5kNmpFXsrOUZOSvGsWB1BbUiXMFu9K1AFL1Z+tQKwz3Q9RDHoNE70anYy4wMcazg9Pf/J224X4BSoGHVS/kGmok3ZtbtIt5wUi0x1ypYG4+qWWMPBJr61DNbE3RbWr76udQEB3AMQJKjZ1Wq1GYm4JoiNayYUK1LWsCoKMSXKfDg3wr+L1wXY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d8a39f26-c2dc-47b0-d536-08dcb4e67830 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:35:13.2577 (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: mlzbs2BYRChT15zTLZ+ivaPfDNn4bLnZtTEpyiUwHNKNw+XM0ttvzyG9HpjLZgM28Wlna/ooaMGfewSRX11vyzZ7hRcQUERJv7A/G76VPTYCay5Z3GYb3rUmYLIo0PTk X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 Message-ID-Hash: UENMHEH47D7QZLMTQGXVCUCNUUKAWB7F X-Message-ID-Hash: UENMHEH47D7QZLMTQGXVCUCNUUKAWB7F 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/isa/sb/sb16_main.c | 4 ++-- sound/isa/sb/sb8_main.c | 6 +++--- sound/isa/wss/wss_lib.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c index a9b87e159b2d1..7145dcb4417a5 100644 --- a/sound/isa/sb/sb16_main.c +++ b/sound/isa/sb/sb16_main.c @@ -216,7 +216,7 @@ static void snd_sb16_setup_rate(struct snd_sb *chip, unsigned long flags; spin_lock_irqsave(&chip->reg_lock, flags); - if (chip->mode & (channel == SNDRV_PCM_STREAM_PLAYBACK ? SB_MODE_PLAYBACK_16 : SB_MODE_CAPTURE_16)) + if (chip->mode & (snd_pcm_is_playback(channel) ? SB_MODE_PLAYBACK_16 : SB_MODE_CAPTURE_16)) snd_sb_ack_16bit(chip); else snd_sb_ack_8bit(chip); @@ -860,7 +860,7 @@ int snd_sb16dsp_pcm(struct snd_sb *chip, int device) const struct snd_pcm_ops *snd_sb16dsp_get_pcm_ops(int direction) { - return direction == SNDRV_PCM_STREAM_PLAYBACK ? + return snd_pcm_is_playback(direction) ? &snd_sb16_playback_ops : &snd_sb16_capture_ops; } diff --git a/sound/isa/sb/sb8_main.c b/sound/isa/sb/sb8_main.c index 2ed176a5a5743..dbb08e9e0f367 100644 --- a/sound/isa/sb/sb8_main.c +++ b/sound/isa/sb/sb8_main.c @@ -473,7 +473,7 @@ static int snd_sb8_open(struct snd_pcm_substream *substream) } chip->open |= SB_OPEN_PCM; spin_unlock_irqrestore(&chip->open_lock, flags); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { chip->playback_substream = substream; runtime->hw = snd_sb8_playback; } else { @@ -501,7 +501,7 @@ static int snd_sb8_open(struct snd_pcm_substream *substream) SNDRV_PCM_HW_PARAM_RATE, -1); break; case SB_HW_201: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { runtime->hw.rate_max = 44100; } else { runtime->hw.rate_max = 15000; @@ -532,7 +532,7 @@ static int snd_sb8_close(struct snd_pcm_substream *substream) chip->capture_substream = NULL; spin_lock_irqsave(&chip->open_lock, flags); chip->open &= ~SB_OPEN_PCM; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) chip->mode &= ~SB_MODE_PLAYBACK; else chip->mode &= ~SB_MODE_CAPTURE; diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c index 026061b55ee94..d3f1a80c3a574 100644 --- a/sound/isa/wss/wss_lib.c +++ b/sound/isa/wss/wss_lib.c @@ -2196,7 +2196,7 @@ EXPORT_SYMBOL(snd_wss_mixer); const struct snd_pcm_ops *snd_wss_get_pcm_ops(int direction) { - return direction == SNDRV_PCM_STREAM_PLAYBACK ? + return snd_pcm_is_playback(direction) ? &snd_wss_playback_ops : &snd_wss_capture_ops; } EXPORT_SYMBOL(snd_wss_get_pcm_ops); From patchwork Mon Aug 5 00:35:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817122 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 525B7C3DA7F for ; Mon, 5 Aug 2024 00:43:32 +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 B0D183DCB; Mon, 5 Aug 2024 02:42:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B0D183DCB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818543; bh=JwQeLh87k0ZNtRknOiUIThCvZPhfU3EM06MuKtk58XE=; 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=YdMAOynnhw4GBrLNpzhTdjx+YmXQSc0y5/LTTAl5etBG+hKqk0nnH7ZnVq7t+cEDa wH3niez/EmN47VWVzbZT3iyqG0UnH+PY6uzqe+DOcr0hj1InROo//w4C2/BUgkZ5RY qqVqtRSyjmJPM3heJjKCPSfHOcltHac/05Z7SFO0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7D94AF80736; Mon, 5 Aug 2024 02:38:59 +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 8C450F80764; Mon, 5 Aug 2024 02:38:59 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 163A7F802DB; Mon, 5 Aug 2024 02:35:28 +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 87B4EF800B0 for ; Mon, 5 Aug 2024 02:35:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 87B4EF800B0 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=Gtnln2sF ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ehg1XoSvYHTHK/F4R1PDG8elfgnHn56wkio4g1RGNjiwOr1oVOxThIiwhjAOsXd3ToApku29PB5KLB1nUucEwRwetyECVrlMdUDLxWCqc8x21ACUBCwFzpjuxud3B5+uuGIIIEIVVlu124JccIHUYDOmw6ZJOIP4zPNr/MnUMXp+oHYdOfwgqLK48Fi1ts4XP8mgvGNlK1dNZryq/xoxfHUR+pQadKQubCiZG9TrJM0J2oTYjmHwja0tYJkkNfiQQtYh1UuqlP8BAaNmfuN97e8SaXy423R/M+rTd1tZSgauw6LG4KVW2H7xL333os75K0nBvbmOa2PNI6elItXSUA== 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=Ea3L6+QvxQ1xHG0ZXSmOuAoPAivQwWvTxu8sAonKpFY=; b=Be6rq9Fd2NwphZ65a0wyGma0mqFRvw1PtY6uyRhcv595XrAjBnINqoVa3MpjxfGQZKlemY5y+gIyhAYJGKoDF02Md4r9mKPVeThjIhjqi/Eev0sVItFHjQTgeqLMNJm/0jfQvPwhzpz0dV7s+24YoiIhnaxTRq/ggAKiusDPr/ByfXNOisQS4yHagszbIPC4xUNSf+7deQmqYLBQN5Zl5BTzjUtbEfo53IbhM61bDI+CD0xWuoX1OqsiXL7xptJHjkFKtN/eT91mtAG9s6FeCRSy8OMlOwrtu16SwIePVNHGC+S2q1JEKsKXK1jpxwxL4FCIyJ1T7rXHP7PRzhW4+A== 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=Ea3L6+QvxQ1xHG0ZXSmOuAoPAivQwWvTxu8sAonKpFY=; b=Gtnln2sFxCVkWpJPU/fh67kFYKKJnwzPAfEtvRjvx3MZQz8IPoiRvyNVOBAPNVWWXP5W5C+/7iC1iZtn9o8JLeGIbfs7g6jA2H2FxUzHmCzSBkmvCdPizw5bI6PFG2PBvw2kc/gzQIy3/CtRdkd7u72ENTEHwiqnZpgcYnb2g+I= 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:35:19 +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:35:19 +0000 Message-ID: <87o76724e2.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 011/113] ALSA: arm: 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:35:18 +0000 X-ClientProxiedBy: TYAPR01CA0141.jpnprd01.prod.outlook.com (2603:1096:404:2d::33) 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: 1f04f71c-9cfc-463d-0573-08dcb4e67b94 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: eaBvDsn2rWNShIww+ZmeAKZ+qc24PzHLkD0HCI8BnxPoIh/9pR4+B2bFHZpTpRY4HxBTFJzsDIrTkAhurhkyy2CFHsfMda46PoL0kaJuQ7LrsmZx+eOkX2kIht5qcNDNW+VU7npRQpLPbFYlk7MiA3Nnakg8lYiAsqeJzJEWmdIilBqSU7KdKv0OEbwWvOLE0h0DleamEKNR+uy5xG48yQJMXLgetXQ8xUP+CV+1QKnEhG5PURzTsqDq7EWyni2JHs6211JiwQmvUz9ZXtYJQzFZLLJ8kk9qP3CJGozA3RCdI4zqDosevEkI1xGg9uM/9SZ4iuZbmTM0O8mKh6PMQGV3a/bWvxk3ecqxbQFWZBUstLuddC6/IBVMbX4VBODFs5g324QVV7m2M58SWwDbFHLHybD6PWU2N2qLiorN6ilF5A0YrNeBnzoROV3JCLCG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od.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: 5LFQl6s4Gh99UsR8ZfikY5tfztW6g4gN5TtP3tkX/ZAJliFMTjRa1P90TdcDZH7RGHfI0OK36jki+SbANvbX841kOn6xdXOErsGbUJfakTn7SqyFAMhNJNBV4jOI3Sbe3UJiiLorEPI/Rwkg3UfHvPRatg4HY1ABgRV3lILbsXDBDutXNxKz2k3hAnJwzWEfZCqShfs/HQR7XYuOSjULNC0d9G1QOxXSXzsU6iElQH1ohKmdkrBJq7p576TC+s3XAyY3zNJuSDfOcejgFNzKEr9E/HQhkylaTr58nymi4A0x4P6FwhOGkmmS2oaZPpldhvVKo06/4D+4R876+HuqU5BgPBB8XrztE2yStIeWvLE9t38l5LUNk+OVujSVjLef0/GxDjPeJRQqTeTQQIVn+wDp0V9Ifac+rfHmQxvcb9gsUEa0/d2ny5TiiD7QvEYPVeQBmUTMNu9yGfxJP2wkmv9dwNsx04e/vX3SCSHhpeihbv5+s+2JJO3qVt1v1B49MU4NBF5LSei0Ymcm/kO47ARc9K+6xqlYkrrZh/33476aXdGDZQDkccOs+dBQJLBYVEMxS86Dd7dQJzvwMHN8ZDOhxihNscvSnDFD9iaz6fZ9itPQsuaN0f2dU8conaASc/9FmcrgAOg6aGVqrelbKxzgcBcq0v7+lsCyQ3GLhlgTjcihmgiPBWSzJDyki7xuNnfkA5ELeJ3VT7XBtjM7Pgn8klDyT5DwiQ+h5XqHuqMw8OHyzl10XI42kZNd2lblgqp2nrthNsgo1gbgeJv4hd32rmomgIZn65+CflbMnav/N003JsbpOB+pHt1P5k9WnOLb2gS2/la+jhG5IL5aJ0IKfqoPYZOgq/BKfxjdvQ1yET+PlWpgftvvU1U11lOmY0rdWmL5jcbJFiRsY8Y+iUBQxwaeSOlgj9cyFtrvZZ4ZXRLSCej1/b4shKVVvEAJsr5sLYOSZahLEUWrEhnQS+ajQgmhMQGkG1zqEvOQDBkLG9y7XZKinVH5E5yKSrdDzrrMpe2jQ0XcJaZR46RoMfdHTT3jXvCqFyHYC9HTp9v8wAdcl6DrPFUx5QDEWI8oBxN/VsOaTZdyPiIwsMTytf/1dC4a6g4eBftV08NsTYTFoCW/Z6PmWv2osc20X2oZpA0BGzViFnfRzM6D0KHP52gqWNS0gfpbnLCWX0hgPdevbUtrsTcKqMvFdCxnF58hDbAN4NSUfUYJ6+YCeAcGX8Yv2Ii5sUWrM8enN7c5Emjm08Gk9el4PVHS1OFWbAwfUmjlJZZ3KOh/o0ttlxxq7JZBeZKpjcPPzN5tR+tAKk6suB4+7Azi9qRTxoNsiQ3Nc5I8a7gIx2RX0WkXdXRHM8o9iKizV4qYUTTgi1BniS4ui8DtD7hOYKntO10wvp0oLtwBG9S555ETU+SHxxVLCBkId+/ZTIGtqE+fRw2NlcSZ+Ym08WNm2UL6KF0riKLnjVCNjFVEK/IDa3RSQ6wznN2HT4bTjOrdFnMq4o7Cbmzeq034t1aMMOx0oKI+BhEVQwU/O9F4apCDGIRI4Cm30os+QCefbgjb6eqfVCj913/YdCFLo16FJD9AWWGaUb0AKx2+Lg+q9Li8MoxD5AZd1ANW9HlMebMR+0WyYCn/Mw0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f04f71c-9cfc-463d-0573-08dcb4e67b94 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:35:18.9645 (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: /F++eu/7fZcjwMvqFHqoQR0KX3M2CRkkkTXfph3PlzppuHNgxPkDPOWRlvQ8gyX0V/Fb8GkdtSG2rxDEBOm03HUkudxuBlITtBpmNv2uUtuWxDgFbulrhR8TFXR0DYQ0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 Message-ID-Hash: 2AXZSRKODUK24KC5UVMAAQDM2FV7ZLTH X-Message-ID-Hash: 2AXZSRKODUK24KC5UVMAAQDM2FV7ZLTH 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/arm/aaci.c | 4 ++-- sound/arm/pxa2xx-ac97.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index c3340b8ff3daf..5542c18cf2191 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c @@ -403,7 +403,7 @@ static int aaci_pcm_open(struct snd_pcm_substream *substream) struct aaci_runtime *aacirun; int ret = 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { aacirun = &aaci->playback; } else { aacirun = &aaci->capture; @@ -415,7 +415,7 @@ static int aaci_pcm_open(struct snd_pcm_substream *substream) runtime->hw.rates = aacirun->pcm->rates; snd_pcm_limit_hw_rates(runtime); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { runtime->hw.channels_max = 6; /* Add rule describing channel dependency. */ diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c index 4c367e73b2c9b..bce0c7ca4b707 100644 --- a/sound/arm/pxa2xx-ac97.c +++ b/sound/arm/pxa2xx-ac97.c @@ -71,7 +71,7 @@ static int pxa2xx_ac97_pcm_open(struct snd_pcm_substream *substream) runtime->hw.channels_min = 2; runtime->hw.channels_max = 2; - i = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? + i = (snd_pcm_is_playback(substream)) ? AC97_RATES_FRONT_DAC : AC97_RATES_ADC; runtime->hw.rates = pxa2xx_ac97_ac97->rates[i]; snd_pcm_limit_hw_rates(runtime); @@ -100,7 +100,7 @@ static int pxa2xx_ac97_pcm_close(struct snd_pcm_substream *substream) static int pxa2xx_ac97_pcm_prepare(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; - int reg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? + int reg = snd_pcm_is_playback(substream) ? AC97_PCM_FRONT_DAC_RATE : AC97_PCM_LR_ADC_RATE; int ret; From patchwork Mon Aug 5 00:35:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817123 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 D2AC5C3DA64 for ; Mon, 5 Aug 2024 00:43: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 488533B52; Mon, 5 Aug 2024 02:42:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 488533B52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818531; bh=wAfWU8RkK6TrMQ7T6BAsuBLFYiMxEi1X8L0d9gUJ9AU=; 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=FioI1jbijTagVom0daCLFQJ837nQ0JHzfsoIbj7EItccbv0g5GfqSV3D4ynvsRGQ9 PAPwbAy5k1KNMP72n9r46dEXiDGhiLB/oZnNOgPu7/7ytIrAtVsCRi7mxFwfb1wghC jdI6J/i0rEoy/bZshNasUE7WcB6RIGKZKCQi9/s8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 59C56F80845; Mon, 5 Aug 2024 02:39:01 +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 AC046F80803; Mon, 5 Aug 2024 02:39:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 60B52F802DB; Mon, 5 Aug 2024 02:35:33 +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 45EB0F800BF for ; Mon, 5 Aug 2024 02:35:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 45EB0F800BF 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=ePxbwkDu ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yc7w+ix64ogXoQosvpBpcA3b6e1jvXtv7bEjWLU/sKVMCnxujaT9hFKlDs+WhBSp54mNc3oZfT470ZUa99bmYHburQ6jJNxfrCzoz4aP7gEfvoieR1PPUd+ikdHMtwQkqPfcy5xP0RaqJcwAaQA8CNUWeD5ZQlOHPzv7yaqsFTkzgcdyT0rSjCHWwT5oKBki4gjtmQ2TdKy002qtdBK/XaD0R+vpFjnWSSLtOV+7F3ve9DaouVqdJ+q+XeEsP75z+x/opblMTJ89NyghYQJMHv0k2SR+1lUGG2P+eJrnV91vmTWWml5GAtPC6JuCk35hysBlQqtvl50mbqFVhzWHvQ== 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=aHtKcixYAPzw/V1vmXMcbeb42Ti40TDFqqHPKnKUnXQ=; b=vgpCk4kYtG1x4Ws4OZBoMEV3rTGFYGhnbpn26qv/uV5s3H0yvbmBuxbBXyw01wtG68GkAJxkFIGKuJ0eM37+JxW8jdVXVa4PSJ5EN4f3rAAg/sbGpyDqPJphFHKNmX3XeJvh+4p7FHBOZBw2Pc8EUMSU5rm6we3NsvQXNP2h6NkPP1tnT6qGFcwAFVkQMRZBWQ27OMdh8IKR3iVakxj8NydygwPsLyHGx0qc8nvoXaZ5N5CyzALNbnrVqBcKReK6VN22jdalX32jhPXkN3dCgHrr+dGsXLq4IXr8v/PsNYqA13eC2x0+rKX2Yka2+mGGFr/kOfXZz/OvAr1jbDnCbQ== 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=aHtKcixYAPzw/V1vmXMcbeb42Ti40TDFqqHPKnKUnXQ=; b=ePxbwkDuYKFisR9VcDfodHMUtHiAw8DSDbhqQX4zPtFVlYAgCjnsTNLeSY0+O0uMBxajPhlifoscZpaihQH5kccgopnCRU/PyQnCRXrPT8FErQfifUGhnEj1YPI774lutvwm7VF4MEULuzwx17r9d3VPHA2cKzZarnCTLzfajFs= 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:35:27 +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:35:27 +0000 Message-ID: <87mslr24dt.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 012/113] ALSA: xen: 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:35:27 +0000 X-ClientProxiedBy: TYAPR01CA0214.jpnprd01.prod.outlook.com (2603:1096:404:29::34) 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: ca25e829-ef2c-4c42-cb58-08dcb4e680c7 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: dUH3Agndhk4BqxYICWtT4bSNbGXKoREWJHQCgx+KvPk/WDV+ZoxcMZTekFPaWwuN+P282CfsTyMfuaLdeeZMwbuWw83+tSyC69dX+rdBe5xNkGqDX2hA2LpBL9lktz/jftXDaTyXQaTiWXM9/qKO1di0bSs1lEYHPlMLBiW0708F0xcB52hPUn5ic3V6ZiUB8KTrFUHAgLEx3m47ocqI+1aWIM6tsoh71VLvv70ZxAIsTlDEYDgEuBFP9xgrCuUUjJ4cLrT3TCQOFK3bPBTEqH8JTrk1Osodt5WV5EpC6IuPlZazNJRzgr5SikbkybHJ+PJ9TH/nZOySbeXcQxJNHj/m0edFB7IswQdMjr3nbPzyrYHSHBw+s9yDD1rhPoyYKk1+paLD9osKFm/Rq+CY/C4v+vpi5CWbG2/0tAoAx2RfsZ0mg7EI7JjsJwe7us26gQOnZ+PqrHbEHe/HMhbM1HOyabH9FQG3uffeeQ2mssIqKXkc5Fu0AfXQRVEmnNgAHZvEpjaIMuJPLqMdgzno2xBDk/xlUr4iBmdQJtpx/+N6fHdirAOGl9W6s0qcfrCEiUP1xwV6nXHF1/5VELzzBz+6+Lpm3u8hOgUMWd6UgUFIgY6lgWuq207ce57uuUA+DIZD78qsDvSO7luQpn1DMEZbg8BIAa0Xr7k5D0f7v5SGE1JTCAMt6zZEIiy/LL7fdGCfn9goR6854p3l7TrDb/ML47W9xzENI7MBWg/gLK1GYY9lJh/Tql0vcn0NW/c2R8E8zJV+6Z6rBZrksgNbYpk91jIKfsXhMmsTPIz0JSeNeT0NeEHOhjy6kv8zoXTLNNaZc8C/XT42+8Ik5q89mkOrBNIjsDJ5uc/X3UBnakPCp5MQJ907tPivFLCBNJHykszTi6YaS/eM+ZL8jE9N9gWnvbhZbOdd3Q/JaNcd7yA6a8mZRnvkjbRdlqgH+5q0Tag5VtHsU7gOiKHgqG1/SW9FVAKBNnMpOqbA57n1S6Z7LjlpZVeKBx6FlCgSwefwykzqRqES/6P+QFX4mYxj/IR0jPdwUFLFY78h9vtewiuMgXqOOn78goigxOiZ726KGUbBH7RgV8Cw86SJPYbnWqbASQ5UVYl4naI4CDLcuGZQ0E71JEfrBXQ1qCPJ18pAHjYAsR4/Xl8OaF0Izi4rEPs3cXTNFHZCgGcBQ/C/29G/Lj5c/kLp60E1Bu1WJq9mhZ++lqUVOiVLjoVPhOqm+LJh4uPgYpqOU5TGmqmzCPptyKRw3DJR++lo7mtMpSsr+6sbbKMhGtrXDDiLkWy19dLo89qtjfj4KCsVUOBdc+0293Wb9N8HlMYqFlkmIvCv8Op8DME/+7z2qRspZwYAJ26gR/6VTn7XaaxgBY6f1fk9/sp7vNiwOJEuRcAVFlko96jw29EWWCuoqBhhS7KD4g== 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: Wx7hg79TRQzycSDUkjO6VwYPsZQEAHc6819eOezJNObh6bs1gbD5qiuL69fz2+lUCTKeIocRWGPFf90I9WSlCXpGuB21F/0hAnWCn4juyBTRs+tU3Rpwmr1rF4vzZrLYbBfrOagTO0Lgc2bzbFewLrOBm4kt7Mvzwj0zLz9jE4tCovNuRA5XJBdcg7Jh9Yyo5BnAgD8E1TlWjJQJC748QxVFqXDQRjvP+QCGsauTK0R9+h8eek/ibx46zHFDr7jelOwnBPrVSbnHukQJm3owOYQJakvk7CtmdR9oxZmoQ3JXf11g1ZybZP78OlP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SEruUfmVeHB0I4DJ2ieV97o5CCZIP6h9gY3aPiG2LsIkmSCbaK6/yl7IzDze+Gqci2PEzKr3HewDigleF9dnJSqkSriAa2274X/6iVBi0knSvo2ixdYvGeIIexlzHIJWssxfuKP6pIB2EyR6ychzHzCEg4/PNoqHN1d1iDkNvrJKS2NRkPueHMAWGUB75uI0UUWKsjvSlwO8Cd7m5WUxSt2P6ZSB+Y5sORBWoPIe1sV5Fdbt2+ns/tF0oqa1mg= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: ca25e829-ef2c-4c42-cb58-08dcb4e680c7 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:35:27.6473 (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: 2cqhvLeBNiDwIVQkfjdN6sQ4BfXmUUra2G0pWhBO7vXxnlfc+zW/w91YHKL/STLUKxO0hImkRDh9Nz4wP1fZmOKPDkSs17kx8YOhcALeYtdZ2p27DH2MlGDBhtco/Gf+ X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 Message-ID-Hash: R4AYBVYWP2TAXD3X3G3K6DWWZCPEF7L4 X-Message-ID-Hash: R4AYBVYWP2TAXD3X3G3K6DWWZCPEF7L4 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/xen/xen_snd_front_alsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/xen/xen_snd_front_alsa.c b/sound/xen/xen_snd_front_alsa.c index b229eb6f70571..0f4f849bd20b3 100644 --- a/sound/xen/xen_snd_front_alsa.c +++ b/sound/xen/xen_snd_front_alsa.c @@ -240,7 +240,7 @@ stream_get(struct snd_pcm_substream *substream) snd_pcm_substream_chip(substream); struct xen_snd_front_pcm_stream_info *stream; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) stream = &pcm_instance->streams_pb[substream->number]; else stream = &pcm_instance->streams_cap[substream->number]; From patchwork Mon Aug 5 00:35:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816802 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 642BFC3DA7F for ; Mon, 5 Aug 2024 00:44:19 +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 853A04B21; Mon, 5 Aug 2024 02:43:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 853A04B21 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818597; bh=yfgVQiUCgnxLQQ6XJIHNQksmrazJG+hcsEw3Itd45Is=; 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=XSI8OTl/TJJyB8yINfngmjUMPD7s67H5FGIGmpURX57KOmrOBSlwy7Hz0rK5q9vhH hW6p6M3XbOnE6Po516xPU8Q3zxsAfidWc0BBFdGxQU8kLDjffftiVAfqnUkICNj+hI b+a4JWj9rCQNIwFwiUkTfUyI97eRdsaYHr2BGJ5Q= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 14069F80CB9; Mon, 5 Aug 2024 02:39:02 +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 5DAACF808C2; Mon, 5 Aug 2024 02:39:02 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 06304F80448; Mon, 5 Aug 2024 02:35:47 +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 C6ED8F800B0 for ; Mon, 5 Aug 2024 02:35:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C6ED8F800B0 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=LG1Lc4/3 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=K/wLX4RtSrzhkqh8O66BE5PW6o2Z15zjwLSA4Sqv+937/J1Qh2gnam3doc41BczBCtc+EPYyrX8cjS39gKZC1vGgP5GzrX4ZC1jgsiuwe9tCRO/E3x4wQWN1bjM5o1d8QhuxFRwgsxKgv53lb8dU6FOvPjdVylgk9iSR70f3nIcRuY6GlG7Uh+ZGpbqAwJ8V3tYFEmwMJeimfgMHPtyi9uE8iFqCe5eaReHqrqeVvuWKLC4tAISI04junZIiQwTas28tT5Ece7EnIPni1X5CxW/7zvKxRMCKQnA3jDiDGxTaK8LowNfidfuNjXawSDySWj7MpZtN+KK5T02xbVYkGA== 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=10QEcSqGNEU3Jmr8Q3ORPlOaXXB7ow3Xweb/2Cn1SGw=; b=t8OkbGxUte/+9ec6OblKJTyZQ69ZAOdkPPHPiJCCDkKwScARcoIK7mZf9fNn2V0GY3EN9IpII5T7KCOlBVyrEykhu2VG5qd+DsqVVGC6xwvh9V5RKiUK1mPqfM/k0sC7YiQhcPGCAIktH+ikrhsOcyOtvjYlR2lBTamuWaPdX4zW6gpE06JqszjKTAT32/k9Bk6K0HuV6GLUHmS8iNO6wcZDNufXeLhBW5HZX/TQfTFTLK7MkBb/hv5PkPC908IkeetMRgP2/fJFYG/ZYX1v06GZbNHZS7rgzYs2i2iw+vfWuv4HyaWF0BMggM7scqrRzLl2wmFOatZoqKbGRKc+zw== 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=10QEcSqGNEU3Jmr8Q3ORPlOaXXB7ow3Xweb/2Cn1SGw=; b=LG1Lc4/3hB6QqtCwyyJJwELeDuTzkQd/8c9ZyAmmw5Si5QV59y+6i00SHnfgiSb87yVZith8YJqhUZSyC5NVzzJ6R6PICgFT8JzLgLIHl0FwYycSDnH6UkVVkkka+lNxGzfxk2tc/8JO5Xo4SBM+BU6iUNo1sdejc+5yUeElGiU= 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:35:33 +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:35:32 +0000 Message-ID: <87le1b24dn.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 013/113] ALSA: usb: 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:35:32 +0000 X-ClientProxiedBy: TY2PR04CA0008.apcprd04.prod.outlook.com (2603:1096:404:f6::20) 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: 4319d61b-987f-48ab-83e3-08dcb4e683e5 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: B5itVf613Ge4NrMGyHmfZZqu/oJN8Sftw3qgIO0fJIevuDnsugkou0BbRoO5NcpKPerE5QmxweWNvQcf4vh1ZAL++mUrFbguLMBWMGqBameT5PSs8EEENY7Ao0XyhgO/ZXCO64tEoqzRr9yZKwxyBM2atnb6wg64h++RCZgR5uDUu6GLqLfFuW2zbAw+JaL/ek4YldJ2+rAJ5hfOp+bX0w+Dnn7SegCU0f9R+1HZs1LwWUePu+9nJ4b8D2a/fJdbkU4ZOAUZ8ohpNBdrrYibkwi3HWtllQUUw8DGgx9FAm7i1ykXz8SX+vGlitROJvwHSJBEXjEE5bmkTtPUsF5eplT7BMCKoyV2MP07hOoYEqrMR6cVPCQHnKwX27Plk9OemdEe7gbClku9m1P8U3SF43qHGvP0gNAg4LCY6JVBIo9lk/vyuYrZXcB1wdjVTz3JQ8hHqKl0YiALog5mTkE6ZdU58Mby3hi93KM0M/OmU6e5vIUR8VV4rgKjPVeXaoMn9/k79ddnMVxxXsUDZ1Kfr+Gfm18ZuL7auz+mikx09SjaPbuxIVokSYyG8YCqOLqDS3ZdIG2x6QMidWqZ9bSlZD2UYYTFJhdS5nIGP29Cg2Cjj9FX+knB2pQdNbHWEswT1SW8fzq1Sy31sIVKn4HGTuGRrhHW/6v/QIabVmoL293riGV8XJ1k8mgWmhndGgY5ohmohLYLIFiUjzHJPwsjoPNqECAGMkNWjhMczc1fBlJL6xhy8HcYWw6OF/JDrMFE90buzQy1d4XYAFUXSZ8FfRIpLH3yQHh5+YH+l6Vljqxwaty6lMalyrlky7iZTu0gjzhHN0cTgrM3O17pL1iqaW60+D8Ds2vujlkIrc70LnU1B5J02XVI5llHDf/HsoWkQAWB6MM+ql6mytaDar59zEkMaTgTdEAxplVxEjqQbERI9hAJECKbqpwnuc3LiEVyUqRqXoCMe2eYrKShRG8dJmva5vmGivOmrbWJWCj+hHMLiteeW9SgjyPYKUSEPeI9ghZVpVhhTeH/HBcuqOdL2JV5O2gGGLyEzmIm7UdUtO9ksmeKHu3mpr2FAE6C3blh2Rq6OgIWW3iU5v/p5h96jGZnzzJ2U2lXcOYmNmIO+uGcv2+qiB8Bp8JXbZ/u+S4xpe61A6qL0qyz9PPd49t/lhgfeDz0dD0ZtSUmNjiI8AG/AuoyGf9hpfj3tjhm41OFuJfzovWg8hNCW9ezhXci67T2IdXqtTBs9IDdyUSYOlUxARdGMlAzODkP1lhAYIlB20WZhVTEHcINMp40D52jguKeC5a+mslFesAf3soK8K/1bIyRCa/0nwVgFAEwLmifCYVjFQRQY7XadvRZozWWG6323KbegnIGhKuk4M+DTXg9cOTiOoQ3fBoXcURqt5PYh62r6KNFcW853SUt0UYEPA== 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: +J8kaELoRUqT290M8qIkRKZ3OWKvcD1WL+KavY0CjBr+MiS/V6SR7PSCl/gGPPhw5nsQYAp2ujkyg6nOxxT+SkHCF3gH6X17nYrtpf6xWnPGKJhLMUPw+i8i0e1VaAJlTThvo76w9chqkhYlRKwoalrZxRc/UsXewS/GfMBaYmOCc80UHpI2hkbRGcl9Dzz0ST606Q5MVW8E/eOtG5BQX+eI5ntoSRI0IUCgQWseWlrqElvQ3nX8iOElSz4AAtFT9jWV9mc5SGlH98ra+6ktOaLo0x2l/sETR0VsJm+OQqAD+eu4OVdIlV7V0cG8dHUS/n9kbDMs5fV3i892qFYcC2iC3agT6XBeBtYP4zUgwmWv7cEbWOOy/gJhonbzWLMlxbpG/DQYnTYb4rsWR8wCoUFS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LT/kXHmRYQRd1dBXLzQcRqOEjdPTAm30Ee5JK6yq9vAfzh7qRU6OlYMhi2AYNZohkR5b0XbPsGd5QKNo4MijzsTm66kAwg67HdpUw2rATGGVaPA93KeXzpKFcg/8itW+ALXMWrmrZrZmTrbzHYT+/SfN2g9eHWCZib+74= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4319d61b-987f-48ab-83e3-08dcb4e683e5 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:35:32.9265 (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: WguzEHuXgE8ellqC6CniPcIAKXWer4w8TyL7LKJePY1uV2NMkEH0HJ+9jxEp+nWFOow5ZAj5hoHLIonV725718RYe/mz5wLZYaeOH1HuCF7e9J5qJ196zdy0FFQ8nCV0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 Message-ID-Hash: V5VK6QUTXWZXQT6W2CFR4AWMBD4IFPUZ X-Message-ID-Hash: V5VK6QUTXWZXQT6W2CFR4AWMBD4IFPUZ 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/usb/6fire/pcm.c | 8 ++++---- sound/usb/caiaq/audio.c | 14 +++++++------- sound/usb/hiface/pcm.c | 4 ++-- sound/usb/line6/pcm.c | 16 ++++++++-------- sound/usb/media.c | 2 +- sound/usb/pcm.c | 20 ++++++++++---------- sound/usb/quirks.c | 6 +++--- sound/usb/stream.c | 6 +++--- sound/usb/usx2y/usbusx2yaudio.c | 2 +- sound/usb/usx2y/usx2yhwdeppcm.c | 6 +++--- 10 files changed, 42 insertions(+), 42 deletions(-) diff --git a/sound/usb/6fire/pcm.c b/sound/usb/6fire/pcm.c index 32c39d8bd2e55..fa3dfceab11cc 100644 --- a/sound/usb/6fire/pcm.c +++ b/sound/usb/6fire/pcm.c @@ -119,9 +119,9 @@ static struct pcm_substream *usb6fire_pcm_get_substream( { struct pcm_runtime *rt = snd_pcm_substream_chip(alsa_sub); - if (alsa_sub->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(alsa_sub)) return &rt->playback; - else if (alsa_sub->stream == SNDRV_PCM_STREAM_CAPTURE) + else if (snd_pcm_is_capture(alsa_sub)) return &rt->capture; dev_err(&rt->chip->dev->dev, "error getting pcm substream slot.\n"); return NULL; @@ -395,12 +395,12 @@ static int usb6fire_pcm_open(struct snd_pcm_substream *alsa_sub) mutex_lock(&rt->stream_mutex); alsa_rt->hw = pcm_hw; - if (alsa_sub->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(alsa_sub)) { if (rt->rate < ARRAY_SIZE(rates)) alsa_rt->hw.rates = rates_alsaid[rt->rate]; alsa_rt->hw.channels_max = OUT_N_CHANNELS; sub = &rt->playback; - } else if (alsa_sub->stream == SNDRV_PCM_STREAM_CAPTURE) { + } else if (snd_pcm_is_capture(alsa_sub)) { if (rt->rate < ARRAY_SIZE(rates)) alsa_rt->hw.rates = rates_alsaid[rt->rate]; alsa_rt->hw.channels_max = IN_N_CHANNELS; diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c index 4981753652a7f..6996c5e07095f 100644 --- a/sound/usb/caiaq/audio.c +++ b/sound/usb/caiaq/audio.c @@ -53,7 +53,7 @@ activate_substream(struct snd_usb_caiaqdev *cdev, { spin_lock(&cdev->spinlock); - if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(sub)) cdev->sub_playback[sub->number] = sub; else cdev->sub_capture[sub->number] = sub; @@ -68,7 +68,7 @@ deactivate_substream(struct snd_usb_caiaqdev *cdev, unsigned long flags; spin_lock_irqsave(&cdev->spinlock, flags); - if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(sub)) cdev->sub_playback[sub->number] = NULL; else cdev->sub_capture[sub->number] = NULL; @@ -192,7 +192,7 @@ static int snd_usb_caiaq_pcm_prepare(struct snd_pcm_substream *substream) dev_dbg(dev, "%s(%p)\n", __func__, substream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { int out_pos; switch (cdev->spec.data_alignment) { @@ -305,7 +305,7 @@ snd_usb_caiaq_pcm_pointer(struct snd_pcm_substream *sub) goto unlock; } - if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(sub)) ptr = bytes_to_frames(sub->runtime, cdev->audio_out_buf_pos[index]); else @@ -339,7 +339,7 @@ static void check_for_elapsed_periods(struct snd_usb_caiaqdev *cdev, continue; pb = snd_pcm_lib_period_bytes(sub); - cnt = (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) ? + cnt = snd_pcm_is_playback(sub) ? &cdev->period_out_count[stream] : &cdev->period_in_count[stream]; @@ -701,7 +701,7 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *cdev, int dir, int *ret) struct usb_device *usb_dev = cdev->chip.dev; unsigned int pipe; - pipe = (dir == SNDRV_PCM_STREAM_PLAYBACK) ? + pipe = snd_pcm_is_playback(dir) ? usb_sndisocpipe(usb_dev, ENDPOINT_PLAYBACK) : usb_rcvisocpipe(usb_dev, ENDPOINT_CAPTURE); @@ -741,7 +741,7 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *cdev, int dir, int *ret) urbs[i]->context = &cdev->data_cb_info[i]; urbs[i]->interval = 1; urbs[i]->number_of_packets = FRAMES_PER_URB; - urbs[i]->complete = (dir == SNDRV_PCM_STREAM_CAPTURE) ? + urbs[i]->complete = snd_pcm_is_capture(dir) ? read_completed : write_completed; } diff --git a/sound/usb/hiface/pcm.c b/sound/usb/hiface/pcm.c index cf650fab54d7e..178f70fd64d51 100644 --- a/sound/usb/hiface/pcm.c +++ b/sound/usb/hiface/pcm.c @@ -172,7 +172,7 @@ static struct pcm_substream *hiface_pcm_get_substream(struct snd_pcm_substream struct pcm_runtime *rt = snd_pcm_substream_chip(alsa_sub); struct device *device = &rt->chip->dev->dev; - if (alsa_sub->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(alsa_sub)) return &rt->playback; dev_err(device, "Error getting pcm substream slot.\n"); @@ -359,7 +359,7 @@ static int hiface_pcm_open(struct snd_pcm_substream *alsa_sub) mutex_lock(&rt->stream_mutex); alsa_rt->hw = pcm_hw; - if (alsa_sub->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(alsa_sub)) sub = &rt->playback; if (!sub) { diff --git a/sound/usb/line6/pcm.c b/sound/usb/line6/pcm.c index 6a4af725aedd2..db1d93de327fd 100644 --- a/sound/usb/line6/pcm.c +++ b/sound/usb/line6/pcm.c @@ -137,7 +137,7 @@ static void line6_wait_clear_audio_urbs(struct snd_line6_pcm *line6pcm, static inline struct line6_pcm_stream * get_stream(struct snd_line6_pcm *line6pcm, int direction) { - return (direction == SNDRV_PCM_STREAM_PLAYBACK) ? + return (snd_pcm_is_playback(direction)) ? &line6pcm->out : &line6pcm->in; } @@ -148,7 +148,7 @@ static int line6_buffer_acquire(struct snd_line6_pcm *line6pcm, struct line6_pcm_stream *pstr, int direction, int type) { const int pkt_size = - (direction == SNDRV_PCM_STREAM_PLAYBACK) ? + snd_pcm_is_playback(direction) ? line6pcm->max_packet_size_out : line6pcm->max_packet_size_in; @@ -191,7 +191,7 @@ static int line6_stream_start(struct snd_line6_pcm *line6pcm, int direction, !(pstr->active_urbs || pstr->unlink_urbs)) { pstr->count = 0; /* Submit all currently available URBs */ - if (direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(direction)) ret = line6_submit_audio_out_all_urbs(line6pcm); else ret = line6_submit_audio_in_all_urbs(line6pcm); @@ -216,7 +216,7 @@ static void line6_stream_stop(struct snd_line6_pcm *line6pcm, int direction, spin_unlock_irqrestore(&pstr->lock, flags); line6_unlink_audio_urbs(line6pcm, pstr); spin_lock_irqsave(&pstr->lock, flags); - if (direction == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(direction)) { line6pcm->prev_fbuf = NULL; line6pcm->prev_fsize = 0; } @@ -240,7 +240,7 @@ int snd_line6_trigger(struct snd_pcm_substream *substream, int cmd) switch (cmd) { case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: - if (s->stream == SNDRV_PCM_STREAM_CAPTURE && + if (snd_pcm_is_capture(s) && (line6pcm->line6->properties->capabilities & LINE6_CAP_IN_NEEDS_OUT)) { err = line6_stream_start(line6pcm, SNDRV_PCM_STREAM_PLAYBACK, @@ -256,7 +256,7 @@ int snd_line6_trigger(struct snd_pcm_substream *substream, int cmd) case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: - if (s->stream == SNDRV_PCM_STREAM_CAPTURE && + if (snd_pcm_is_capture(s) && (line6pcm->line6->properties->capabilities & LINE6_CAP_IN_NEEDS_OUT)) { line6_stream_stop(line6pcm, SNDRV_PCM_STREAM_PLAYBACK, @@ -267,13 +267,13 @@ int snd_line6_trigger(struct snd_pcm_substream *substream, int cmd) break; case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - if (s->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(s)) return -EINVAL; set_bit(LINE6_FLAG_PAUSE_PLAYBACK, &line6pcm->flags); break; case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - if (s->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(s)) return -EINVAL; clear_bit(LINE6_FLAG_PAUSE_PLAYBACK, &line6pcm->flags); break; diff --git a/sound/usb/media.c b/sound/usb/media.c index d48db6f3ae659..3870df7214e53 100644 --- a/sound/usb/media.c +++ b/sound/usb/media.c @@ -54,7 +54,7 @@ int snd_media_stream_init(struct snd_usb_substream *subs, struct snd_pcm *pcm, return -ENOMEM; mctl->media_dev = mdev; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { intf_type = MEDIA_INTF_T_ALSA_PCM_PLAYBACK; mctl->media_entity.function = MEDIA_ENT_F_AUDIO_PLAYBACK; mctl->media_pad.flags = MEDIA_PAD_FL_SOURCE; diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index 08bf535ed1632..18a0b55e4159f 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -37,7 +37,7 @@ static snd_pcm_uframes_t snd_usb_pcm_delay(struct snd_usb_substream *subs, int est_delay; int queued; - if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(subs->direction)) { queued = bytes_to_frames(runtime, subs->inflight_bytes); if (!queued) return 0; @@ -57,7 +57,7 @@ static snd_pcm_uframes_t snd_usb_pcm_delay(struct snd_usb_substream *subs, some truncation for 44.1 but the estimate is good enough */ est_delay = frame_diff * runtime->rate / 1000; - if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(subs->direction)) { est_delay = queued - est_delay; if (est_delay < 0) est_delay = 0; @@ -126,14 +126,14 @@ find_format(struct list_head *fmt_list_head, snd_pcm_format_t format, */ if (subs && attr != cur_attr) { if ((attr == USB_ENDPOINT_SYNC_ASYNC && - subs->direction == SNDRV_PCM_STREAM_PLAYBACK) || + snd_pcm_is_playback(subs->direction)) || (attr == USB_ENDPOINT_SYNC_ADAPTIVE && - subs->direction == SNDRV_PCM_STREAM_CAPTURE)) + snd_pcm_is_capture(subs->direction))) continue; if ((cur_attr == USB_ENDPOINT_SYNC_ASYNC && - subs->direction == SNDRV_PCM_STREAM_PLAYBACK) || + snd_pcm_is_playback(subs->direction)) || (cur_attr == USB_ENDPOINT_SYNC_ADAPTIVE && - subs->direction == SNDRV_PCM_STREAM_CAPTURE)) { + snd_pcm_is_capture(subs->direction))) { found = fp; cur_attr = attr; continue; @@ -616,7 +616,7 @@ static int lowlatency_playback_available(struct snd_pcm_runtime *runtime, { struct snd_usb_audio *chip = subs->stream->chip; - if (subs->direction == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(subs->direction)) return false; /* disabled via module option? */ if (!chip->lowlatency) @@ -678,7 +678,7 @@ static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream) runtime->delay = 0; subs->lowlatency_playback = lowlatency_playback_available(runtime, subs); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && !subs->lowlatency_playback) { ret = start_endpoints(subs); /* if XRUN happens at starting streams (possibly with implicit @@ -1212,7 +1212,7 @@ static int snd_usb_pcm_open(struct snd_pcm_substream *substream) runtime->hw = snd_usb_hardware; /* need an explicit sync to catch applptr update in low-latency mode */ - if (direction == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(direction) && as->chip->lowlatency) runtime->hw.info |= SNDRV_PCM_INFO_SYNC_APPLPTR; runtime->private_data = subs; @@ -1770,7 +1770,7 @@ void snd_usb_set_pcm_ops(struct snd_pcm *pcm, int stream) { const struct snd_pcm_ops *ops; - ops = stream == SNDRV_PCM_STREAM_PLAYBACK ? + ops = snd_pcm_is_playback(stream) ? &snd_usb_playback_ops : &snd_usb_capture_ops; snd_pcm_set_ops(pcm, stream, ops); } diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index ea063a14cdd8f..b26d1aa12a698 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1685,7 +1685,7 @@ static void set_format_emu_quirk(struct snd_usb_substream *subs, * sample rate shouldn't be changed * by playback substream */ - if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(subs->direction)) { if (subs->stream->substream[SNDRV_PCM_STREAM_CAPTURE].cur_audiofmt) return; } @@ -2017,7 +2017,7 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip, * although it's really not... */ fp->ep_attr &= ~USB_ENDPOINT_SYNCTYPE; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) fp->ep_attr |= USB_ENDPOINT_SYNC_ADAPTIVE; else fp->ep_attr |= USB_ENDPOINT_SYNC_SYNC; @@ -2036,7 +2036,7 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip, break; case USB_ID(0x3511, 0x2b1e): /* Opencomm2 UC USB Bluetooth dongle */ /* mic works only when ep pitch control is not set */ - if (stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(stream)) fp->attributes &= ~UAC_EP_CS_ATTR_PITCH_CONTROL; break; } diff --git a/sound/usb/stream.c b/sound/usb/stream.c index e14c725acebf2..b4096a2b53210 100644 --- a/sound/usb/stream.c +++ b/sound/usb/stream.c @@ -524,8 +524,8 @@ static int __snd_usb_add_audio_stream(struct snd_usb_audio *chip, as->chip = chip; as->fmt_type = fp->fmt_type; err = snd_pcm_new(chip->card, "USB Audio", chip->pcm_devs, - stream == SNDRV_PCM_STREAM_PLAYBACK ? 1 : 0, - stream == SNDRV_PCM_STREAM_PLAYBACK ? 0 : 1, + snd_pcm_is_playback(stream), + !snd_pcm_is_playback(stream), &pcm); if (err < 0) { kfree(as); @@ -1058,7 +1058,7 @@ snd_usb_get_audioformat_uac3(struct snd_usb_audio *chip, audioformat_free(fp); return NULL; } - pd->pd_id = (stream == SNDRV_PCM_STREAM_PLAYBACK) ? + pd->pd_id = snd_pcm_is_playback(stream) ? UAC3_BADD_PD_ID10 : UAC3_BADD_PD_ID11; pd->pd_d1d0_rec = UAC3_BADD_PD_RECOVER_D1D0; pd->pd_d2d0_rec = UAC3_BADD_PD_RECOVER_D2D0; diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c index ca7888495a9f4..7026e6a8f023b 100644 --- a/sound/usb/usx2y/usbusx2yaudio.c +++ b/sound/usb/usx2y/usbusx2yaudio.c @@ -816,7 +816,7 @@ static int snd_usx2y_pcm_hw_free(struct snd_pcm_substream *substream) mutex_lock(&subs->usx2y->pcm_mutex); snd_printdd("snd_usx2y_hw_free(%p)\n", substream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { cap_subs = subs->usx2y->subs[SNDRV_PCM_STREAM_CAPTURE]; atomic_set(&subs->state, STATE_STOPPED); usx2y_urbs_release(subs); diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c index 36f2e31168fb0..56111336d71f7 100644 --- a/sound/usb/usx2y/usx2yhwdeppcm.c +++ b/sound/usb/usx2y/usx2yhwdeppcm.c @@ -368,7 +368,7 @@ static int snd_usx2y_usbpcm_hw_free(struct snd_pcm_substream *substream) snd_printdd("%s(%p)\n", __func__, substream); cap_subs2 = subs->usx2y->subs[SNDRV_PCM_STREAM_CAPTURE + 2]; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { cap_subs = subs->usx2y->subs[SNDRV_PCM_STREAM_CAPTURE]; atomic_set(&subs->state, STATE_STOPPED); usx2y_usbpcm_urbs_release(subs); @@ -414,7 +414,7 @@ static int usx2y_usbpcm_urbs_start(struct snd_usx2y_substream *subs) struct urb *urb; unsigned long pack; - if (stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(stream)) { usx2y->hwdep_pcm_shm->captured_iso_head = -1; usx2y->hwdep_pcm_shm->captured_iso_frames = 0; } @@ -592,7 +592,7 @@ static int snd_usx2y_usbpcm_open(struct snd_pcm_substream *substream) if (!(subs->usx2y->chip_status & USX2Y_STAT_CHIP_MMAP_PCM_URBS)) return -EBUSY; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) runtime->hw = snd_usx2y_2c; else runtime->hw = (subs->usx2y->subs[3] ? snd_usx2y_4c : snd_usx2y_2c); From patchwork Mon Aug 5 00:35:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817118 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 D1459C3DA64 for ; Mon, 5 Aug 2024 00:45:54 +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 16FD04C58; Mon, 5 Aug 2024 02:44:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 16FD04C58 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818691; bh=E62+TX6G4XfDRmg37BFmjd1R2msZXwoXLs7ZjLQXKEs=; 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=iV1SIRXsGwhEIuDCCmo+t6C15jFbiNP1moiyiN8F28z8qbHXTXQNslBQguGAX4KIU EMqsA2bM4cw3udXvxuLGd3/UDka8e+C/4o2zSCBCUsu7Xmt/teSbE/iecCnR/rByac 5nADH0LbTsMExoqrt7mU3jgH40JQuzGcoEiSihkk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id CF5F3F898DC; Mon, 5 Aug 2024 02:39:04 +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 CE312F8087B; Mon, 5 Aug 2024 02:39:03 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4BA55F802DB; Mon, 5 Aug 2024 02:35:49 +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 A996DF800BF for ; Mon, 5 Aug 2024 02:35:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A996DF800BF 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=FzOjOaEI ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=w8UUIV2DETiUQqytPYVB8h1+t7fNQCo9ai51eZjfIl1ggmrkv9ilIwqBifcAi2aunnFA11ZyfG5TNrFF73UaJLK/HpYjpaKuJtDAcadYZ/MjCSFiIiCujrJR4XQ1ca4/WUqT1vP5PFGFGpbyTXFsxLGeithaIrwyamxzzOyEkh66kKKlBhn5aH+ErniyxgkZtYvz/OuZqVOgeQja6qnYNnNQKcJT9gD8eV8YQxzUQ7BQLLnGt8Z9YrIoQLq4wvZliNnkot7NB3EMPX0dMGZt/G47LlAHggvKFaIfgCI9hiRlJCr59eB27yP02nTMC/apIPeHw6wRixSLdwfRUR1L4g== 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=X6E7hugC9TJp4HKlVqIg//X4XKAVcOkqxHfcKFYvU4I=; b=IyuQNujUcAJZGjzS8KZzdHiv8NSOAkNixgCxUhf2iee5pOSdVPK/rx+vs7ea9XDZXJQxK47tqisDqp4+NY3yaejv0o4OMDhhnId8UEry1KCuyBfUrzn5B8q9cAwKkZGcIZ1dA6zDj8tSi707u86ncSnHV33pC5H7PsokJ69ZpsUXRAYxttBK51AKaqkmX6og5LzxAVoDlANkgyXxpXPEn9IlM9TDNclju1mfTbfcxqYElthHOb5QyxfRx3IxIKnDYV6gevcjrM+DD6C0E32urT+hb18D2iUtIg1S/1A2vdBKXL64o3rx06lcQb1O4ZFCy8T60jz5j2GjIhUxn//a6A== 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=X6E7hugC9TJp4HKlVqIg//X4XKAVcOkqxHfcKFYvU4I=; b=FzOjOaEIq2b0Ec7HcB/UoixT8IB7izO5CD4BppuE3IbRdhNT6ELGV5AQg2yWYot3/wCaHusCou3LLWjpCTqFq6S4MA2pJWMogBVYaIg72dihABpH8Q4HCOdnVraAleFFIojwOVECkSCjjNdKpUqtIzm+0VzFLKXihRDAW0fgvKg= 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:35:39 +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:35:39 +0000 Message-ID: <87jzgv24dh.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 014/113] ALSA: pci: hda: 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:35:38 +0000 X-ClientProxiedBy: TYCP286CA0013.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:26c::20) 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: bdc2056f-5988-4ff5-0c41-08dcb4e68798 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: 9KrPppJpNjuJ/dXzrNTLygcewmfoIvcl2n8M9tqhAULi6iy/gzd6lFxs7PEWsCUbOjR5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arzjmbqNVAM14w1B2YQItVTpY4cwizv8NlqG6gkIxXLae0qk1iHbqnbXMa/Z2ljt5OGKQTZAFsV7pfzFDX3dtuhMpLfniZT75cd3kaMtAxtKx6A1QVtIx/szJbZGm1F1xPhKMtuc3vkyFbpbrtAcdum5kitWors0T6v82YbwoYsSfDAV4jyOp44NHoF7T8IJzaaNuWo4D9q58mDVoZWPubc+8ZiqarWoxhoDwAQSldcnrsvZQI3MRsBwlVGOxkwxUsKHjomciim7PN5A2VX0LOhbSA== 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: vzZYyO9E/7F4tt3jBSt+0EHgdvlTDJp10wqveSAcKYG8x2FZGssVdk0emIttW1S5sg5clIQu+2Io/Dfsf+pa3Meec9iZkuWZkoBSTVUWmkI18A7kapoBPkqkVbdKAlElbOumSSFc7yNEdyeMhZCl7v/TBPUNp+Mp+14oEmw1Yo/1w6Sy7E7P++sBeAXmQRnEH6LTleXrpFF4FQMoyXnZB/jpMqIxQhl3AE182h5KLdo0dyunR93bnzsEZ6moBwvhv7j2pexx+paqOon370XgUvYr+PCjuITDR2JyLTbJbziBJCX0R+1MIsBfsBPrjSj56GJrEHoiJ7aouZOMhj97P8Sc6RwFSoSGKmcZv2m9vug+YsV3Pzu3ysuqBvKn/Tv+1KpCk4E0rI4pCI99HHL8wCA+yndJ0qAeVWaV84G8SPyhkuJzOgtdaKb31K06EbuC5094Y2Zk53CWa6aandKh4wJ1IhdFoulrA2VJKWyydF8m8A4DMQqN22a6AW6cBHULTlPsqWt834+9mVRbk7dkwEWFsc7Ew0+Qh7xfwDCnGU8g6KO5W3JqYi8rYZOBBDPHl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atorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: bdc2056f-5988-4ff5-0c41-08dcb4e68798 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:35:39.0810 (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: /grWJbpRfTIk0CF0pdgtcwXSFFvbC5wJZT/jrmmuh6mx4zSIc7CjpOpbKNe6/uvS8Qx8TUDz6PIqDfvYCOsZks/0tn4opIs0aa8fMphJWT3Arz5MDXSNzrCYOpJl6Vj2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 Message-ID-Hash: NALTJZIUV5H2ZLN3CKKYPIULSQ4UQIQF X-Message-ID-Hash: NALTJZIUV5H2ZLN3CKKYPIULSQ4UQIQF 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/pci/hda/hda_controller.c | 6 +++--- sound/pci/hda/hda_intel.c | 6 +++--- sound/pci/hda/patch_si3054.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c index 5d86e5a9c814a..9efa43afd0c16 100644 --- a/sound/pci/hda/hda_controller.c +++ b/sound/pci/hda/hda_controller.c @@ -75,7 +75,7 @@ static u64 azx_adjust_codec_delay(struct snd_pcm_substream *substream, codec_nsecs = div_u64(codec_frames * 1000000000LL, substream->runtime->rate); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) return nsec + codec_nsecs; return (nsec > codec_nsecs) ? nsec - codec_nsecs : 0; @@ -385,7 +385,7 @@ static int azx_get_sync_time(ktime_t *device, runtime = substream->runtime; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) direction = 1; else direction = 0; @@ -659,7 +659,7 @@ static int azx_pcm_open(struct snd_pcm_substream *substream) /* disable LINK_ATIME timestamps for capture streams until we figure out how to handle digital inputs */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { runtime->hw.info &= ~SNDRV_PCM_INFO_HAS_WALL_CLOCK; /* legacy */ runtime->hw.info &= ~SNDRV_PCM_INFO_HAS_LINK_ATIME; } diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index b79020adce63b..c9552b71c0e9d 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -583,7 +583,7 @@ static int azx_get_delay_from_lpib(struct azx *chip, struct azx_dev *azx_dev, unsigned int lpib_pos = azx_get_pos_lpib(chip, azx_dev); int delay; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) delay = pos - lpib_pos; else delay = lpib_pos - pos; @@ -800,7 +800,7 @@ static unsigned int azx_via_get_position(struct azx *chip, unsigned int fifo_size; link_pos = snd_hdac_stream_get_pos_lpib(azx_stream(azx_dev)); - if (azx_dev->core.substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(azx_dev->core.substream)) { /* Playback, no problem using link position */ return link_pos; } @@ -869,7 +869,7 @@ static unsigned int azx_get_pos_fifo(struct azx *chip, struct azx_dev *azx_dev) } /* correct the DMA position for capture stream */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { if (pos < delay) pos += azx_dev->core.bufsize; pos -= delay; diff --git a/sound/pci/hda/patch_si3054.c b/sound/pci/hda/patch_si3054.c index 763eae80a148e..9f13732a89064 100644 --- a/sound/pci/hda/patch_si3054.c +++ b/sound/pci/hda/patch_si3054.c @@ -142,8 +142,8 @@ static int si3054_pcm_prepare(struct hda_pcm_stream *hinfo, SET_REG(codec, SI3054_LINE_RATE, substream->runtime->rate); val = GET_REG(codec, SI3054_LINE_LEVEL); - val &= 0xff << (8 * (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)); - val |= ((stream_tag & 0xf) << 4) << (8 * (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)); + val &= 0xff << (8 * (!snd_pcm_is_playback(substream))); + val |= ((stream_tag & 0xf) << 4) << (8 * (snd_pcm_is_playback(substream))); SET_REG(codec, SI3054_LINE_LEVEL, val); snd_hda_codec_setup_stream(codec, hinfo->nid, From patchwork Mon Aug 5 00:35:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816800 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 8F13BC3DA7F for ; Mon, 5 Aug 2024 00:45:36 +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 DE7144BFA; Mon, 5 Aug 2024 02:44:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DE7144BFA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818673; bh=AsAITu36a9j4qRtm2uIF9gaX/wMbq5Jd/KowHXXbM50=; 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=K1yzaf+qjx5oYZro8qcj4w/w6E6bIqfQ2K0nfc7wzh7n2fdF8Mvgj1QqKUiopyfyg Il5AAAn/hw36o3/pgy21czIPYC0XkeP1DCaECW2eoKl6xgKdsgmyVhHP3zHvk+4MHd vVMLXK7tC5dgHr1yGABsgx4O7G8B34sjZ3ILH3Fo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 63803F80C0F; Mon, 5 Aug 2024 02:39:05 +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 4C6FDF80C16; Mon, 5 Aug 2024 02:39:05 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5D0E6F802DB; Mon, 5 Aug 2024 02:35:53 +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 01F47F800BF for ; Mon, 5 Aug 2024 02:35:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 01F47F800BF 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=OA1R26YR ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yvse9mceJq2aJaoM2nAByBBOsXnyF3tJC5LMtZwAvW2J82iVGMVOewV/zXTLHhNlUhc8W5vq81qLZCb1RSxpA0tbvVHhgUGhCn9droWcQz3o9118U5EiRFHDrY38PrlVVIe80NXrOPIi4auo55UrRz9nNNpGYeYnxP+jsR6KXgRO42hr2wReiDo3ztNcg+Yo/vUV0T5xIbBL7+wRnHKJdDcS3JIUOSVkfpSr5ZGsvwFGDiwTwunfAXOJfkQyXHnpfgbA7ZbT/QYmh3IrDQRM7CvxpyBUVFs/dzwxHr7i6j6I4nVEyntheTKuStDZUUwPY8FrpiHPyugqdHiGrc5DHw== 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=6jx7po4Al7XoKH8XSQtSVL52Z577aksXu8OfoXidgsc=; b=cpluQDyGQssZFE6lwLUNEvXGbS82s79URFzGDCHfQHcsSEFibDl6uEI8PaHtoPZ27RW/bRSLn0TTZAQBWvVvrDL1sP/avAXBw4xjXGdgXaHxLZEQy+j8SVuXDZRKCiYziAd6uZ4EWLoUKpcMELr6BT3nXEOHURNjyi8EgGyLEQMGhgl2qUI6cnxavAG3iQcT6Fw54TLFSJY3FhzM2wylfhRxNp97iPdrtIQbn7IxpQsFFj7snpB7/XXva0+XxHA1lJRIZjtUJKq2Roj+pEZhItA0FVv9rhwwjZgySSAlBzFNUZYVTI84VfOH/LdspH3ZQYiMaVhuj74Gq8ENzsaQdA== 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=6jx7po4Al7XoKH8XSQtSVL52Z577aksXu8OfoXidgsc=; b=OA1R26YR1yZvlchhTaHjUICzswzpO2OzfvcV/d1CCemiMgE1fPPmC4JSOlrSGuMVm5YYClhxwxoeo5+n0kYrsddxgk3WQCvNgLn9qHzlusHVwCFgF3aryr7ELJZsskK9CAAzDkNNkT5RNIAGHs0UaGMFzhgl6/Ee5vV8O2modI4= 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:35:46 +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:35:46 +0000 Message-ID: <87ikwf24d9.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 015/113] ALSA: pci: ac97: 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:35:46 +0000 X-ClientProxiedBy: TYCP301CA0016.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:381::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_|OS3PR01MB7994:EE_ X-MS-Office365-Filtering-Correlation-Id: 79bf6de3-f7ae-4601-407f-08dcb4e68c16 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: fsTR7riolp4ubIu7+JheVHTTe3e3evjDOvl1ShyUh0hOBvRuz2AMKUkgmXSpACCHMnMyTwT1YGh6TMx/Lw+pZ4Pv77yrTXUMcuOux4ojq+mlvabtfQuoqZTLwoNniHuxpXTrD4fdR6WvwbMfr/W4/NZrdYOIUvl0Rgu73KvZwIHBK+jE6SjCdII89cFEqVwU6r5iE+FtP0U5ZXACBfZpWo5fmw5jOMf3Wla/7XfHDSlBCH4qI2sJrKnJ6IT0NSetB4QmlgrJG3jfr1/q9HfHy4bbx4aw+MUuknf1jsgNwobraQKtCzxz/ulM5Y9Q5gRGKutxPzwsVJKb38hcVuVvapb0jBIQWO5I6TUEJDdvqZ3gl/iMtjbNftTQx/Iz6m2Y9Ykfrik3cXRoJV3656WftBdN9eP4R9plpD/gFn8i0JhNdNKo2oOqe22sjW5nB4OGeYO7/XBFkM5sUUTOZzZMB8BLaDKekv8Tm+ct8foMe2SNOKp4rZpYPeFA1H5Dor/3LWsgmlOlIGsh6b9XEf47Hzv9d0OVgxw9gxpb8I92b8mH3mNFqH1VrM+kVyqpxSPkOW3RVq6gLEs2IljGyhqm79O0WApQ0ypy6HupMEEIr+HS9wo5999uv/AoCEBY0q093E8V7eN6ZZBcWQqOuXn+8w7wyCU/Nls0xpxDwpBueD3dqXbz9HUnbpQn7i3tT8jwdfrrFmhCmJMKhbLfrGCJiZf1Jt5oTrzUJMLiTz+RqGARuZJ5LAQy5XdTTyB7wxRpu8gEfpolr6MSWitHTODuZ0OxqBTyODnjFz8pTrKXWFICaroHzVt7nmaus3ouKh1Ds90SxAkFiJkw9yd0ayc+sLr/HGwOHZreVPwOu99M1BKdfx3wfhMW2jVch5+n8fQ5s/Yi7iDQMDadWOPK4oKauf/pNClyjJs3F9Zy76tkJSIcjijPEK0nAALRfKDL6HS+TbvkF+uHQbH7fPwqzzI9lm0d/HOfwCb2lyllqUCvTQjESkniCJ7fISZqdap2vZKQlB/5qohHV2X0fKk+yDn1VkkhIVAixCz4TpQ0ioX0ndMTxMLxYBQAa5dJK9LVU90utwQ48HLfHvmcbuFHyy1yJgXEOnfr8U8CErZ7UnhAtSx5R5IY8H1+zUWMeY638T0YNKreKqvKSADWgO4ziVvf+8ufnCF9kadFksh09WdVIRlF+khNy3hwUJ46OC6TmewyVBLvSukxzKBeSLdSgEB/rjFnNYYtpXzB7Jp10AozbfditkoX8g1wywPhsoe1tgJz5pvbTcrThCS0FrNGFEJeYqOyeO3tNZ7h0a1RyJiyA23UJ6wNDFit887ZtMxKMJlu/F9xgfBdQfALzLc1ZY+YsLSMHQRpujuj0Bec/A7n5WrlqATOB6WD++Ol+z89/xkIy+P/IKjSFOenZzAaKW8Aiw== 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: h2xv8pWEGpLySnCKkuCCVM1eg+Tvk9d1Fa4l/sooT0RcvqFknz9f8DpoIM4u0sumG35r4Z04Ur8sQRstj21/eaMfFo8K+CknXv6zaGmopmEe2icbJdUTBbsXH60IUoErO0msNVlYUv+ANVg6yNHcbnYXHOH267OrPp8p5jd1O3e4B/KOfJ6HcWERVwbXnG9n6uyA//dJpUQ2TCfo0cssvZItJOltjgF9bEbR4qr0qulw9U3tBzSOfv4qYXijgmSdp1RK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bRQ1AKVcztjx2c+T8IWHc44CG2pyiQlE67GBSoM98Fy+AHtSo8dT4wt95sEphGrm/26BuMKlG6f7a/y1AUv6ciqhQYDH8AkYVTwtSiq2Hu0LIJOdduUoz8UEjpqbsrD/ErPdYLmkyHC2WEAZEYywBgFFcyqzyOMRjbnbG56250H+Nub3LVwfSyz6tJxmrvUUFfDAcaJc1KyPYb5bw3vTtXmVVmnY0bBlfo2cZ7HlsWeszgMmatDk7KCn9OMBE+hEe+07EEY/hY/FaDfs/LlBsFOc0pizPpPCOk4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79bf6de3-f7ae-4601-407f-08dcb4e68c16 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:35:46.6667 (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: kldClfVf6+jdW9T3xrB4sQtaMKJfcyrMc8fwqFhy/Q+CZ+V4w6RYDK+jG+yhoGRATOm/KiMRjjLSpEYtNN4tYfmSkC/WyJBX5NPAIzPIBm28LaPGTdVD2OOZOaAupmHa X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 Message-ID-Hash: JFFDJWJ445Q5GQARKDN46J6RE3OD76M4 X-Message-ID-Hash: JFFDJWJ445Q5GQARKDN46J6RE3OD76M4 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/pci/ac97/ac97_pcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/ac97/ac97_pcm.c b/sound/pci/ac97/ac97_pcm.c index 5fee8e89790fb..0d29676a8ecfa 100644 --- a/sound/pci/ac97/ac97_pcm.c +++ b/sound/pci/ac97/ac97_pcm.c @@ -150,7 +150,7 @@ static unsigned char get_slot_reg(struct ac97_pcm *pcm, unsigned short cidx, return 0xff; if (pcm->spdif) return AC97_SPDIF; /* pseudo register */ - if (pcm->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(pcm->stream)) return rate_reg_tables[dbl][pcm->r[dbl].rate_table[cidx]][slot - 3]; else return rate_cregs[slot - 3]; @@ -512,7 +512,7 @@ int snd_ac97_pcm_assign(struct snd_ac97_bus *bus, rpcm->rates &= rates; } /* for double rate, we check the first codec only */ - if (pcm->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(pcm->stream) && bus->codec[0] && (bus->codec[0]->flags & AC97_DOUBLE_RATE) && rate_table[pcm->stream][0] == 0) { tmp = (1< X-Patchwork-Id: 817120 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 2AF10C3DA64 for ; Mon, 5 Aug 2024 00:44:21 +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 D058A4B1C; Mon, 5 Aug 2024 02:43:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D058A4B1C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818596; bh=efROVIxXFFDrkgrp4i7G7cCHG1tkzYRmOhl8NYg1BuM=; 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=KrMW4s6kR7FYeI33Q+p8vuJ+z9ceUWaWcONSJn1hbIW3N1kCj/oRsGMBIcg6UWiCA 6eDSXTtVP4T5JQlrbvD/x6PP79T+26t2jWs89puP4X6kTmlfVR/T+zUVpDb+d1VCL0 uMlEmSnzRNsTn9vCGmpXjzLO4n2YthhjtVvI0nIk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id F26FAF808AF; Mon, 5 Aug 2024 02:39:07 +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 BA2BDF80C93; Mon, 5 Aug 2024 02:39:06 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C475AF800BF; Mon, 5 Aug 2024 02:35:59 +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 63D94F800BF for ; Mon, 5 Aug 2024 02:35:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 63D94F800BF 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=pp5HFWXs ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=i8CxDSFxHiAJuetvtGJgYh1Ds6XhHGUE849zVjcKiPs+AC+mwM3j58greumKiSJ7BaFbuRJuJIl5ELfAtRpD1QQKJIQEI5KUYsuRPZ1CDHb681EifX4u43N2Cp0pmMFeIlZ8JAwbBDffxPhSysaOUZfqCeX3lnL38PqCoIn6c/pPAHPhvzFv8BNIBYY2JCGe45l43eYJNL23ZmeXxRPV4AJtsTRnoXfzKT0EyEsKJAtkEfHRaZqMrYVE551fk+l2VnHfi7uUcmL9L8iyPxS94gWBzHUx3GeVNP/WcBWYwV8YCYj3A+Sia4yR60juxGySJgmA3oWEw1WxNvQ8fxPwVQ== 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=GFL9gpwDt2LsE0MEC39up1Sdk6A+Ag6xb1TieCWb9KE=; b=BSxTHbYHWnzDCKZNXg6c36T+Iby+Va2NJfacGfSf0t1lDkBw+LZMnL0rARmR4G9V94R1Vwd6bYwUGKG4/vWSwJyKJz+Z5zjaJXo+rxqaFcQ1lVH9PyZIQs6gugDWuYvR6nmUAIyDEtFx5A+PcmoKIl0HcikXnB1gSjNf23hCMBsq/y1MbUFxpBnrjuQ4/6bH54dGHSfKLexl8ohNTt8NyWswZpYu72ms3bg0rgURAmBgWjD66aiAbFj3ffcfRw3vCBd9oH60pbQQYdIMRvH2Fb2IRrt99ViFw3sDX2bCJb3gIjcN4CyOD2Q21Oi84fESF0CRkq/W9wpuYY4qM4lUlw== 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=GFL9gpwDt2LsE0MEC39up1Sdk6A+Ag6xb1TieCWb9KE=; b=pp5HFWXsVzfGbZ+HtQOT2ZyR+CvqMsGoqINU41jTjTA1zZtF3g/LtLxy0+ONsusyA14COEVLHMSYkCuvAKjA1t9+qzzX4nUcglxNHwjM0zNNN5rwzJwHqwaeRnOoSI8CsbHC/rgThoHt3Wl2nQTxbilEUByATtDwQWwSAsbmIVU= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:35:51 +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:35:51 +0000 Message-ID: <87h6bz24d4.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 016/113] ALSA: pci: nm256: 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:35:51 +0000 X-ClientProxiedBy: TYCP301CA0028.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:381::11) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: ca727641-1632-45d2-e596-08dcb4e68f1b 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: uGt/LUn7LXlCiMvgnPKfNoKUm5mTbeUFaJ9N38Y9AMUknZ0XkRCXnybIBooxglHrwuOE1KKNDliOIls/UY2atwtRdOWEzLYfmP/jByVFxpHekVzhCSuwsXIQqcQH9CCj2HmC2AvQj6l46TowRmoL6x5c2MwaFNFnXguaUlQmGOxEFcEs6JJ6WXB7PeUEpctVqyAT7baeUDIUpwlGbK6feCZKobmoXfXvrGVp/eV1BKnE5Kc99URRuLu9nk+L1evYjOBXRn9BMXwiMFpLYdMdXvceHI9RrgpOPwS9XiVZ+695zDbpgmuvweOvq6Xm2RWIC3s1Xtx/oPrmRJoQqVterzotg4WpGuq1wbzBH3N7LbRzgpRKsu5LypYEPUxaZG4aXCEc7qKgr3NRabY6GF4O5HFZz+QZaSNW9xqq/4eT2TBOpgAmjJlNbcz9yPFS4II9y68ZyaVE0keJGrlPN8WoUu0F1NLJYXS0eRsl/GEK3HPWo3jaoaNTHrG0WDCgZ2D2ee6efDlMCT3Nwofc0KkNih3aKjvsnnXd+0mrJgCqtoFS9scyKFsRXkGKlz5njGBK0oNp3wbVHmh8LNy1glc8ioTOXpevcc4Y8JCIm1VPd1vyMZHGc9ZdvYH3yreslC7s/WpL3m3jhcpBC/qwRDjgKyfD6rXgf26J8Yffkm975R7xR2Oz4V7E5U309sDt1glKWcKMpX/yUiPpFbcT3bjFsd6J0/03nXx6OnUKE37QAdAQtIY7jM4UaKebfzgkaCPkMW6dVZKjZUa0gDHJi7xwioInmsEQnxH1fyaVoT6/OxMzhIJjQMg+EFjVKVjdFMqd9M/ELoL785YedNNGvtB770fNGfuSMg2VisvnvugWZ+LOTLPKyBrx/vYncEiOvrz9p3rTpOkoo4DiYahTBxGHy4wTrKsuVJFSUME5vTHkto7A0Ulr57TVOCtObHAK/0fn3atpGe5wIYOvu8VKypsPTETYjt+rBlDeEKRV4998awZrCgF1hNigegKzUbE9Vmuo9MwW8EA5MHhkX15qe1WNkVmWrn5EvDfcGh2GQ0msG+9+E6U16cT3STekn6cWJ13alEABY/Ss4ZUtaW0OOaB3Gx4wqSpe+h8bbQg6fZIJw6Z7EwHyuWiUbUvIrEdrDOgWDCKbGh7SmP1ELZ+75/sEiftrtxaEeoHt/Dd8hrQIJYW6FZBfEfVGl8LBGKhuc1uNEsdZkay0P/bQirFj7W7NwOpORyv5SRgB5YvTR68UUJxCaZJm81tDLVy6+n53g85ULyrx6HUks+ThMmm62WuGx/qyHL92SmbDi3ZT3J0wMkxYOgQ3LCnG/Z2POETu2VUge82kTIokdA2FuiMmIahKsMz8R9UgKuZ6pKCKpcIWXjKDEl4cm5Ck4p4z8PxfqrTioj17lF3zPGDKYmYPb3LQlg== 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: XLCf+g5+lAhFAlhACkqEtQgMFrqKT+cLv9OIIi+P7YtVah5Xs7VUOe7uVso0K4eD3K8w4vRnNQ3Gw4FwPySk4xmYHWXBx2+m1dmzash/3SeWNCCiAcraOvkNI128kiwa6OrnOh/JyoFAelnkuQlZGYJ2O8aBm01B9sfBX/o0BAQSwM6JsyOZciW4buG2dSmbFWat1bg8+thrgajbxJluj0YgDJhLBQpWZ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7lV6Nyf88s4zNrFANr2bY+bZc3ktdcbzWwZgglP0ZZ4uyi7JfqtEZi7/Sr6QHe2fe92aNShRNyM65x+AOw/adGrXT2RKmbMQr0e+ZaOc0geNPhhvxcKL79bZNuPIgrAxWhupKy1i3bq5eaSSGFevqiZYWexOzMqLYrnBjDjRzcrzkRAG6QliopX6+yTtNZTN8DhRjFk+miIQIgYrgfjyq84trTRnYraIf2urglEZw4Dezg4w2wSfR73XklOaVAvdtSnMAFUCpQpvPgDkaaOadd6a5+pREwqWI70JCWBwRP1X0gnNfHdBLxZ6OpAK/GTwrHGWPkgL9qNaz1XBq4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: ca727641-1632-45d2-e596-08dcb4e68f1b 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:35:51.7232 (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: 8kID6u46NKW1TqnQS7qPU+CI9FNjmVTdSmVvnau5w36PW6IKN64MeDMKp/Oxz6V0i0oHahwoHJrG/jwL98K7nKUsBIdwNK0pbv4hLYnUxGMlOwangNCd1ac5nPZRP9UD X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 Message-ID-Hash: QRSTNHXXVWNXB6JOJBHFY3PKXBQRGJJ7 X-Message-ID-Hash: QRSTNHXXVWNXB6JOJBHFY3PKXBQRGJJ7 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/pci/nm256/nm256.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c index 11ba7d4eac2a4..4ad3734796ed6 100644 --- a/sound/pci/nm256/nm256.c +++ b/sound/pci/nm256/nm256.c @@ -332,7 +332,7 @@ snd_nm256_load_one_coefficient(struct nm256 *chip, int stream, u32 port, int whi snd_nm256_write_buffer(chip, coefficients + offset, coeff_buf, size); snd_nm256_writel(chip, port, coeff_buf); /* ??? Record seems to behave differently than playback. */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) size--; snd_nm256_writel(chip, port + 4, coeff_buf + size); } @@ -341,11 +341,11 @@ static void snd_nm256_load_coefficient(struct nm256 *chip, int stream, int number) { /* The enable register for the specified engine. */ - u32 poffset = (stream == SNDRV_PCM_STREAM_CAPTURE ? + u32 poffset = (snd_pcm_is_capture(stream) ? NM_RECORD_ENABLE_REG : NM_PLAYBACK_ENABLE_REG); u32 addr = NM_COEFF_START_OFFSET; - addr += (stream == SNDRV_PCM_STREAM_CAPTURE ? + addr += (snd_pcm_is_capture(stream) ? NM_RECORD_REG_OFFSET : NM_PLAYBACK_REG_OFFSET); if (snd_nm256_readb(chip, poffset) & 1) { @@ -356,7 +356,7 @@ snd_nm256_load_coefficient(struct nm256 *chip, int stream, int number) /* The recording engine uses coefficient values 8-15. */ number &= 7; - if (stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(stream)) number += 8; if (! chip->use_cache) { @@ -372,7 +372,7 @@ snd_nm256_load_coefficient(struct nm256 *chip, int stream, int number) u32 offset = snd_nm256_get_start_offset(number); u32 end_offset = offset + coefficient_sizes[number]; snd_nm256_writel(chip, addr, base + offset); - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) end_offset--; snd_nm256_writel(chip, addr + 4, base + end_offset); } From patchwork Mon Aug 5 00:35:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817121 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 72794C3DA7F for ; Mon, 5 Aug 2024 00:44:16 +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 63CB24B05; Mon, 5 Aug 2024 02:43:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 63CB24B05 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818594; bh=kD5D+JYDLwjUBsmQyZ7K66wTaqtvl3YT1KHXkpIP6S4=; 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=Gf7IOgHkwLw6OEILu4NLblxtt+3vG5H1XdbsVadoT8fUVD3CH3+p/LnINQsbmTYRb rYr6E/28lLa8B1oOeVlhBwnrgpjZ2d/EA6T2VUsu0F+lNtUya/43ZG7Ob835ciJfE3 iPSbHrno5BNA01XGzAExZ1+wGk3cPZqREUlnmX2c= Received: by alsa1.perex.cz (Postfix, from userid 50401) id EEE84F89718; Mon, 5 Aug 2024 02:39:08 +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 5610CF89636; Mon, 5 Aug 2024 02:39:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D63AAF802DB; Mon, 5 Aug 2024 02:36:00 +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 82F5AF800B0 for ; Mon, 5 Aug 2024 02:35:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 82F5AF800B0 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=AMVYfrsU ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=K5E+5sFZdzhLVrPeGIoceXWmkWme2QUZoJJ5WpPRXZQ9TDwzMr+3rpVJULU96IlLFFA7Vgu8UUFSQ3dorqHukwKpfyKoca4TJz4d/ItCCLIxYXfzqqVn2kE/UxYL7vdu+sBZPPpfxG7Vsed61//ajCOJ7JLD2S9rBiiu7tHLV1vEYM0RDDF36xW//vSLlfyxyFTwV5JraQqG44lTvT+4TC9zL0PyjTu7PUsWorGJ5nlWlhDWMHv2pkWYvoCoU2CQOunS83mru4YbuLoBjCEeKKKFL0PgeJkRasHWt9VERzriO9vbCF15Xk8V6rKTLpn1R9ClIygkZomOBal4KvFCGw== 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=+2gg95VKISkFMzk2asYqs52WMb3/zFHpKRS+Gupqwnw=; b=Vw6Nf0hW1deFWj/Bc1A5naqzGAb8Kmw2XULUefQAkRzY2ueBl1hrK2j45nTPW4s2gviR/AExb6i3uxc5KMLy7WggSyay815xMNCFOIjpL8e3Ybp+7meSZ+t2pSyLgQvP9hY6aL8RTZ2JAIj+fZj+KMJun0C7BQs9p6bL8TzGMHzfxjzdEIAKG04t0vWs+rMwHh4XdkeCYauWXyH5pNwKKHenGdxI/kWzjQtQP0dRr7HXCQHU0dOG/BqxB47kGt/zbKHi+NOf0AlI9BTzMYId8aAOSp37albBdAtMFaMb+DTDgLoz0eJLw2qFDoSwEUYZhn/UM/hYw3B6guUj425KXQ== 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=+2gg95VKISkFMzk2asYqs52WMb3/zFHpKRS+Gupqwnw=; b=AMVYfrsU3Ng8/zFqz2a73tGYNxoRhAdpKEPJG3IeLQ+LRokbeJqCVkJymaWvGEJcE9HsE296tHXF+ZeqgZpTUNP6Us9BD9elyVaH3lr4wNc1B3cc/UCpjUKFjy6+xOnRcy9iw8m81uSJvQHlhJULbF+OexG7QNMAcGNmrdQmGBI= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:35:56 +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:35:56 +0000 Message-ID: <87frrj24d0.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 017/113] ALSA: pci: pcxhr: 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:35:56 +0000 X-ClientProxiedBy: TYBP286CA0005.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:ce::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_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d9f9e1f-0f5e-4961-98ee-08dcb4e691ce 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: 73QCax6oPPwzYNiaQX0uFUT+dRJUhetaDATPWv8Yjmvbt5u6aDj2zhJrlhPCrfLzuN86XB19AbUMXJRxkdMQXW9yF8d9WkjTyQ9rgI3ewNkFmoXJgFMo+eR5LNMlcE6SQSejxx0hCuQ6KaM+ChG8GAvyiCj/lln95wpFFNbPrjv2CL5LT3Swd5BDfnlA0KbxTC8DrnB3zYqR2GU/0R7ssF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epSrYEAlAkX5m9A98niyaGpXxcDqym3OZ2bu1cn3RjUJkN8HJSCfzidO6IC9gU0h6JLmnLd7+EXXq8uf1VCXw2ViuCGrnYwbi9UEDu5ZVoJjiJdvY7Umt4PNWAU2T1YSBHB9M0sBqdZLw== 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: lccAk/del/W2eaWasSTl69e3JdX7dwJmUWSIL7Lfrtr0zOXEuFJwO1Fjre8XtHjvqS/84smApIRY4by4icizw7qbF7IIY4hPWvTYPQMaHB7BOS1GnqFQ9D3T3be5O1nr2WQNbZVyz+EwpwTCCcVcE0UENOiJWI/0cpLU3AD296W7beWec32xRKiHHYRsm/U/7D/CX+jX/4j0t79uqp66f82glVu6OWzaeQP41IhADEyRhT5jgR6EKj1vwuM6KjnQ7AWRWs/xK+pEMsniDCN/Va3yzvZFRakkFUIOEnqyg0npvvIsJGE9xxfblFu1UkDzE6EJgA0BobpiuOLbhL7hMLyInDHLHLUDU6ec1wpJ+wa/nJaC5lazzPeqeCi9U/Z/5O8PyXI+vDg/wnKi2r/36pR9Tc/Gqge915ZTyWd9Ma6SfH1Ayss9BdhN8VpiuXrI8QtXLUy3nTeu+gthz26Wv/vM4Ps4kaw0YpiPUCMm+xo8aBI41DTMA5u6WmN6puUTzceDmcwVe/idjXUMjnc3aTE01g2DP4Kp26Vy9klYwnvn+DZI/a8JV8bKJ8k91Dp+aIV4q8sZ6D9yg1XZ848enjU4qGHGQl7PkkwSuJQTLe98pYvfSuLPaX5B9422KPraYpUsnCCuk8N3nISVwepDWKMhv+5aqhJ/ys/Wb8v+mFsIzEb8CKe6bdJ5vfkgLxhqks6ww2kIOA06U/QhOZJVoVII2rlLIVwptFYopkhzDD35/FD8k86hHuQplOkMEdJ/q0M9LeenCEnw7WgcsIsAuQw/yTV/X0IcPrLlWyMgFfuyPM3FWZk3MuEU4Bnkrgi+IdKqA7bqTxXH3m/Dw1ZirpcZdZJxAWNTeqf+Wta2crIgu8OtXfomUBJf76wUKDzJuD9WQj+zeh8tiGz3vszkpbhuSru9bEKfS3LmDsKeSKgOCiWmwOj0daobyV/Qui+92uOEgkC+Tr/p4jjKwOrXK+ZHDsq3Hn0BGBKkpuyAF1GDEiWozuIN2GB6gdtelGvrztutJsOc2lHK7g48tFMIwxa8sBFVcZbbCMxtr8387anUP0bpOQmEG9gjx2BmgUx6X5EeAgh0a1qeKbKyizJM0pI7IFRWrNdENLJuH+G1dqLCnyV0ToO1rj4omQiFTtx56wTk1Dlkq/m0Qrv1FykYcl6gg6Jm6u3G8RZIxCF7LLZpDyJVmq+3kUMNn10YahHKwSZw40lelekIWQ3xD+LsufsJmBZm+03+u7mMcab1bL+x1LsSM2WCjwHDJcsquNEQikKceLRk/feODDJVn9pyqSLALHo82FTwz58ZEjvR4V+eUbIQZGoMuheyUB9gXL+kWUzuQSuvkDhkVLU2VG+W1/z3kbUxp2yUV7ca8DH9vx4TMVTOvHHrVuknOsxur0WBXhR8R4KFtUHWsohYr51gQBE4sDbGczwUcIlsUr7QKsq/ijQHcFsU6s8QrTiECVjFlvXY+taQKe4nCSXN9gD19uBGzkngocqqZoRxOQ2m/Z91l8UIWqRZSJTtpby8Ac4fv84Zd3ps88SdZkGgHm3a9rltHvxGYt08Zbkz52CdtSZaxAZEeVyDNBDHGU6/hxDBQupyLlZ0cE8SeqqG9S+tI4kn1AMfhUrkCseGGOmccyI= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d9f9e1f-0f5e-4961-98ee-08dcb4e691ce 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:35:56.2336 (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: JIgjmFK7dOCoSN+AkvrgTkwuIEYz84zfgOYIhA3Ph1LtzHMWzR0OXe+r/qnWmYrRvv0GnVR45s9a7KGXwy70eHUWIG2z03Wcml9V951x64jWemFOJEaP5ayPW0UY3dIU X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 Message-ID-Hash: MJRGKYAJU6VNLOVHL5Z46EMRJQLNFK7O X-Message-ID-Hash: MJRGKYAJU6VNLOVHL5Z46EMRJQLNFK7O 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/pci/pcxhr/pcxhr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index 242bd7e04b3e1..2de8ccb33d17e 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c @@ -626,7 +626,7 @@ static int pcxhr_update_r_buffer(struct pcxhr_stream *stream) struct snd_pcm_substream *subs = stream->substream; struct snd_pcxhr *chip = snd_pcm_substream_chip(subs); - is_capture = (subs->stream == SNDRV_PCM_STREAM_CAPTURE); + is_capture = snd_pcm_is_capture(subs); stream_num = is_capture ? 0 : subs->number; dev_dbg(chip->card->dev, @@ -995,7 +995,7 @@ static int pcxhr_open(struct snd_pcm_substream *subs) /* copy the struct snd_pcm_hardware struct */ runtime->hw = pcxhr_caps; - if( subs->stream == SNDRV_PCM_STREAM_PLAYBACK ) { + if(snd_pcm_is_playback(subs)) { dev_dbg(chip->card->dev, "%s playback chip%d subs%d\n", __func__, chip->chip_idx, subs->number); stream = &chip->playback_stream[subs->number]; From patchwork Mon Aug 5 00:36:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816803 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 764EEC52D70 for ; Mon, 5 Aug 2024 00:44:16 +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 347534B0B; Mon, 5 Aug 2024 02:43:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 347534B0B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818595; bh=gsde/cJHAmwbbp22NkWXiU3qOdpEOOZulO9Kz5BIpxI=; 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=XKJM0rrp55MFxWGwMOrRlabkzLLhA9+WWpCJR+sfB+ODAxoRyG7pBALmD/hlIgibN a4bVj2l6dBl9DJK6cfg0PhCrJSKbZ76qbcTBBMYJeq8ufeTW0q07gVoUjDhFQy5gqJ GUoJ3FVgXvOBdDSuAgoFqcqV9ldb/zWOEU0gU68A= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 96428F896F0; Mon, 5 Aug 2024 02:39:10 +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 D4A0CF89673; Mon, 5 Aug 2024 02:39:09 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6A541F802DB; Mon, 5 Aug 2024 02:36:08 +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 8D461F800B0 for ; Mon, 5 Aug 2024 02:36:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8D461F800B0 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=GsoVauOt ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dZAIFsd2fqVfMp1dhruRW78cutgGPSAnkh8MhXGaIxc3XfbR6yNmbtKeBmCx3QkmsZFAxJPvBsq8hBAtWeUliqUXpomW96JvaZSco7zHtZ6XBHvpI6va7BHneJipDzFur3kh2nxcaKZuI3gcVhkwkuefAOxmqEQ6bx0xW2oH0uWCm0YY5GgPNeqSI/+gvfM7WjoXtpDRDXabRlHMyC8f0SJsIe5d6NVe530eBs5sU2eVX5F1VnUWQ4J+f/XAEcrPoGNEv+T/leigGS/8+HJNXf3awYyYkqnbyB/70c02J7hsgYHEgYyLNembR80ZKf/F+8X4PrZ8MiB0n8xobZumPw== 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=0GmQw3MIk+q98y/3wEF9FGiNcya3N5KLX9JV2Js2j0o=; b=tMnlJH57bLnWnzuwaDvhjoE3WNPnIK1cQK+g18T83EunNpzBWSOrjDwjlnCmcTIn16uQvkGoTmzuqfVjfYNbnUt5sWgibDFlhFe9dBFTJPbdMc467APrEhxOCpleOKYIWf1bb1O+J8qDWxIJAxQhyIVV4n/lqHccHCo7ogOCrhIVj2/ZoHlfZkQbpENkGiui5+FcpWQFjdTNky7iWaiRev0Xl+Xgr49QzEJehJEm4lunOqKEeMgPdzBQcTF/81ycyqOC1GdbY0GH3Qi1paFG9zsdPqiVjNJwUWe5zjzeBSRpX5M1zUf1jYLSW/BLeMIH7LPuQdNj2eRxDPgs1wontw== 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=0GmQw3MIk+q98y/3wEF9FGiNcya3N5KLX9JV2Js2j0o=; b=GsoVauOtpTMNpxtvNEhf2MNDti6LbC9WPFxY2HnYcsONrUrTyRVbwhOv/4nXhEQnEDxCTOxeUINhiUCej/htyTeTYkTSBudekEIGgrR04NIgKuqffMoxteQv2xwntDujWVvLagFI/TZ2s131r7iAxnSNhSjwUwc7pmSrHjfDts0= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:36:01 +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:36:01 +0000 Message-ID: <87ed7324cv.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 018/113] ALSA: pci: asihpi: 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:36:00 +0000 X-ClientProxiedBy: TYCP286CA0163.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:383::10) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: b92e6272-e5e5-4cea-c4a5-08dcb4e694b8 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: S+UStLMKpbz4S4yUmg0kB2BIl28ch6UHBTYEvIji0KR3ShjKus+JXIuzwbGO39Aiqmt0djBXUllqnH5duLNb0kJBTj9+r6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5xZZS/uRo2dT5DjpouLHGTfc40rIKw5cCGgqF3UpzH1JKHqfnTWs+WBZv+8CqD2NeFuQRjNr6eXG9XtK+DDh9Qwd3w2C9t5TArfvy88bT8hvKteR0ZHxjWF/aLhsy/f3AH3a6OoWMkhY/fWTSP3w0PxR/WoaIo54BBnHn8yFPo1YtLHPW1E0ez5nWW5kZ9KeHPA7Hf9hBkGJFsqTQuhV1tPOtI3oIaZSyWGoH89PUuR3lD7AJNhMz+JRXjyw0CWoyGuUJk6JZA== 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: +qHVx1K5SsWGLSKIul6u//CsLTtdaC+I4Kjv62Gn8lksGYy80nHZ1LxTLBQRnXBLl1A4kwxCf4dJLTEEhFW/le30Qo+hOJxlEKsLaPo69NYGH0wB1hyvBKn6+B0BwYt9lEd9O81pEZDApqFiap2+3XQor++FiTmJ0vGcfdFgFWS8+0G4x/G6cJ8/s36X8fYRutcKhFw1NxVcVBOPZ3+O0FU25CYgvTPahyvxfuPjgPnounhzKsENoZXU/KcPqaYtvpELbHa+ZbCjRAjL2MGty1SEu3CsFybV2Pw/e/PnROhp0zYx171P3njbMCOkyBmioUMLXUY4sD0H5TPZQAITv3r+hEuL7jwTO+5Us6VXBkIg0ks58d0qw3rybeGuSclEWkDVLtQkazs7Ei8KnsRLIfTZXhIwk0U1QDbU/NDAbnNIOLNFzPSTmM8TPFxWB+TN5cxLABzkYBA7zrscD/2lc3mFbBZYtDdauikoNZFsnNvL4bjnApACBCjkVsuCvmglrkYhCI21Vr0gPRBqgfw+AKwOBbmioOvXJOSEmxAI+4wWjD5jhvqDirEupFRR256ycK728EK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-CrossTenant-Network-Message-Id: b92e6272-e5e5-4cea-c4a5-08dcb4e694b8 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:36:01.1178 (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: nDAUeRtlev17UMgtxxfVHssCsgjpG9eYqf+NE1keHSPb2sJJKvC0LVTmI4dVdR85zFJUtMwtN0Mv+IapjwONYFfTTl5nVLrOvyPHb11EyNT7+1FortolwxzcfAzQoqy6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 Message-ID-Hash: 4VANEPFYBVHA4UOAX7S6X3EOYIG4T4TJ X-Message-ID-Hash: 4VANEPFYBVHA4UOAX7S6X3EOYIG4T4TJ 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/pci/asihpi/asihpi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index 001786e2aba13..69eb696012933 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c @@ -447,7 +447,7 @@ static int snd_card_asihpi_pcm_hw_params(struct snd_pcm_substream *substream, params_channels(params), format, params_rate(params), 0, 0)); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { if (hpi_instream_reset(dpcm->h_stream) != 0) return -EINVAL; @@ -582,7 +582,7 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, continue; ds->drained_count = 0; - if (s->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(s)) { /* How do I know how much valid data is present * in buffer? Must be at least one period! * Guessing 2 periods, but if @@ -615,7 +615,7 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, } /* start the master stream */ card->pcm_start(substream); - if ((substream->stream == SNDRV_PCM_STREAM_CAPTURE) || + if (snd_pcm_is_capture(substream) || !card->can_dma) hpi_handle_error(hpi_stream_start(dpcm->h_stream)); break; @@ -643,7 +643,7 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, /* _prepare and _hwparams reset the stream */ hpi_handle_error(hpi_stream_stop(dpcm->h_stream)); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) hpi_handle_error( hpi_outstream_reset(dpcm->h_stream)); @@ -755,7 +755,7 @@ static void snd_card_asihpi_timer_function(struct timer_list *t) if (!card->can_dma) on_card_bytes = bytes_avail; - if (s->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(s)) { pcm_buf_dma_ofs = ds->pcm_buf_host_rw_ofs - bytes_avail; if (state == HPI_STATE_STOPPED) { if (bytes_avail == 0) { @@ -837,7 +837,7 @@ static void snd_card_asihpi_timer_function(struct timer_list *t) if (xfercount && /* Limit use of on card fifo for playback */ ((on_card_bytes <= ds->period_bytes) || - (s->stream == SNDRV_PCM_STREAM_CAPTURE))) + (snd_pcm_is_capture(s)))) { @@ -853,7 +853,7 @@ static void snd_card_asihpi_timer_function(struct timer_list *t) xfer2 = xfercount - xfer1; } - if (s->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(s)) { snd_printddd("write1, P=%d, xfer=%d, buf_ofs=%d\n", s->number, xfer1, buf_ofs); hpi_handle_error( From patchwork Mon Aug 5 00:36: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: 817119 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 0557FC3DA7F for ; Mon, 5 Aug 2024 00:45:19 +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 7247C4A43; Mon, 5 Aug 2024 02:44:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7247C4A43 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818653; bh=HYuIrX8jSKxIxIyHH+Ku7hI056eIRBBYibhNfAmX5AM=; 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=awiPuUa+Hdjz9NlNjZXkriqs4TwzCd45+vyqWBvxnTtXp1vwqmM5lf42vpEk8494B 0cXLBbHie4yIIVigviLN2/ozPE6dH6fnbVZeItrQKKnPMc733Gl4F/tvaRyzwIIT/Y E7TEUpC+oHC7jhVgffP6LLvrFakxerhvxzVw1lu0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 793C6F80CAB; Mon, 5 Aug 2024 02:39:11 +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 75026F896F1; Mon, 5 Aug 2024 02:39:11 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5781CF802DB; Mon, 5 Aug 2024 02:36:12 +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 676D5F800BF for ; Mon, 5 Aug 2024 02:36:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 676D5F800BF 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=JCV4PnlC ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CnHpV4BNl/DsnmE0cQ7hcXrAFFLkEtyQ9FWZRP33Mj6bo3iBrkwuTI095Pf0rKkJkvC+DufVp6s/6D9Twh+nnlcyCfbtkQD5Ss+aNqPPxweddcEoI3fU5x0JAbqFiiZgQWDUkK2rsemhkFltqekwpa5SbcfrkIi7xdwQnht3oS1OjP+EknIPfggnKQOpVri6beFBOn6O5GKr8kSfZjpKniuANxSenGZbSkT8tay+oG0NcDiSc++TOBTtqR01dJzQ+3a0vlaJXKmCdR3d0YOVs2jwXZpE/QG0LjXNui+fvEtLc4UQb0vinigN8P//qSM4eVwK4OTOOZ6xWzXx4z4DLw== 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=7YxTb8PPGPqJP9yDIl7LQoTnWX/oEPaYUGMy6gdRE/Q=; b=qQF5sGnjUlOq86yZ5bf6c3c9d6tRNNk3uO7oSoDQV27ZTGhLqlCzmmJM1uJFq32TjVYYTzsdST0Qn/bOB87WsLgAA2myjefTxDKUxx7EJvn/XLYouoJuqTXX4bxIdq49EuoV8BCTAxveJ/PxQblGcuwudL1dsFm6pZMuXGxG6cor1+e8+iAHV14GIApExQEOmXkDS5qPO8FauAJNcq9+/9wWuuthFmWoGwZZMQDkSt6+X/oRTQueWRkB4ECz65IFR0c3UmsuWX6iALiqeiMPl6QkcgwXoqOiA9vGLxQuUy9IdMKSCTGyoHsNE9mxpIGJ+dvcRhEgfZOIDjzluktd8w== 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=7YxTb8PPGPqJP9yDIl7LQoTnWX/oEPaYUGMy6gdRE/Q=; b=JCV4PnlC0RaZcZpngVe+MDrMQRMEkWh2ptbB3R/WXRqfyi4xit2DHTXaKHV1yjLXLgtsRO9vbtosRm0KRiXdZyvIqVALA8R4/u65a4Ap1x7u2lm5QEhRm0GvnQ/0zJD9kTK1HktO5IhL9jnp5gdmHMFyTSyRauFcizRS9jJNzmo= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:36: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:36:06 +0000 Message-ID: <87cymn24cq.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 019/113] ALSA: pci: au88x0: 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:36:06 +0000 X-ClientProxiedBy: TYBP286CA0009.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:ce::21) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: f44ddef5-59e6-4bcd-c42b-08dcb4e697cf 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: hX7dL0x0NP6Uo9lB1WSiq8PLeseW+xYsFb7ZTsr7qdaKg2ZgPg5vMLQpU57r4MHQJmMeGwV3XZd/8fkEOC2mgpoBovhJc8TzcE0m+lW22SB0EwADe7y2OdZyrfpi0Go4liBYxtj/Gn0CPe/5cV7JSd8arsvKqG6dZAKpMEBTKvMaIP7pP+8t1eKD1hz0Eshpb5AfLloBDxv7tBB/rGBU9/9r/J5cP82Bbi6IDQa+Aoia+C3nk1e3YGQ2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ZA2XDkZ1FkJB087lcQWXtKkQyqj03YQeHTV+Kd6+Malb0ataTFHlbUIbtXcQ7QVgv3DTkCZiiTGCYrAe6YnRsQJ6hzh+WDBGRZAbyW69On86M8U1TdckN6hGjmiMkqGQ== 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: 8+jTANCuP054//tetvXpvVnJtA9Mg+tKqXkyzsM0GHUSgb8CCQ9iopgVCoiwjCaeohVzYqcR8Ic0CqEAd0iDe6UsOnvsJGU8Oqhvplicx6O/xT+7vP7X2vgTtJecqNmnO9s9wd34fA8mYTvHcj/BTInEx9EmbTIjySX9ju8ci4a6jxN0bXH54pYV0Vu6+3mIxvDeozdZwGmTHbMVkXvx9bdYFLPuhAadvB97tdwcRovXD2w0mOkLqPsalDx/a6l30rtdv+mY87+3T2LxW8jhWHUgjO26uzbSsz3fPKu8dNcnR48K8vYC92r6FFo+NSGsV2grR3Z+TiykwRQ/GA3FylFeGQNbYjUMNzrFeRCTBI1j/KG/Zqb8haOVsVo/Gg0UKxXgzo68S8L5nGy9vFVTSE79nalMkMLM5S3nZGUqhQS/qtAsBrnlUf3r0QtZnNI91e1Q0ymg+PFESTbbfvfF2pKbW1lk6Oy8Hu3wk5WLfR3Kqv1R2ATgMwoY4ACwd+m3sXBe7mOLG+ctr06rMLrHQpA0EnPbmrtfd93kVF/tnpdZx6Dmb7MMZPYa0VQUqdmbNj+bmXRMH+rSTq2p/5lRgtfaJ7lTTfe58qAjTFkfBCWLkvH3ZcSmvVHKPsaAXo2J9KT9Syui/UB1Uv0NZlXOG0UFcL5vmLYsUhe2Tfy4QAiy6n/T1KvbpLOErc+Yx7KTUFvKOmGF6Ah4/WUVrpvVBYTu4TN8/vXMeqjtdQQd3weICktD8DdRUFLZPX7Jbs3ra2E2AGNg2NGoZ9lBhU02XhOvvBNrPBChhDqagj/AHl40wUEU3qFbtF3NbY23S4xL0dZBSYVosg9R2uasJeix96Zqk0tXr3tRB8qwSLKv4xtleYdpad2oI8JxqxbdK6RKGslE6Wxe1bE1WBQBbgzJDC7N2IXTmKuZD+k2z5Php2gcQOEPs/OkkuK5csSnydlpGIq22BhHNGJg3PAXMiAVsoe1zYKwh/VyVW6KlIO/VkhKVVDyEzEH8ZXkvSfmvxQnj8UkZEP484h04iy73i6ecAiiKS6e5uZ5bAoffMIyvnz6fnXsJvtj+rm+nLG4Id1Xn8qVwYCpT0ptLAssIVXwnFdJcoDRGEkCFnzMtVeowVKDYfGm1qkkeighVZE0WPI/NjQj4xCYy+5WMFDDNRS0yN+bpFNdIoXHrYzfQT/qBAVVaFxev94D2LGwaotlM8xqt0FbkcnlXIC5LyNdf8Ugvm8Z0gbHTA2eEROz3gOy60wSh1s8V5tv4Rh6JRiZP3eG21CQFxyiYmvqZfsfeNRA2SAwEGAEE49NLbU/6QS3fuZ52BmiWDUn1Y74grdagdDZZgcqHNt0WFedPSS9FoEN4G2Hvj7PFn2V8yI7w0oznqC3e5q8e5y5Z2tE3aYcbtfNRoU2nGuhSj59QiYoKqLa79ZprUlHVAbwudc1AE7z0uHFbJ53tv1gwN/GpK9G8lhYMGZSW9nJJ3p2sjkVpqI4uYUa9qiJgu9LOiGVMWl8pmzYm2a4jTv8CjSNsJhHjSUiaJzc+QuT+0yG/ccjZmzXpNnOvIJRMWfyqQzt+8vsB/gAxqZPjA2hVmSynsHP6QXUkfDkMeXNexqnKp507epxEOUu99lYiyv2fO4O56lgwYw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: f44ddef5-59e6-4bcd-c42b-08dcb4e697cf 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:36:06.2948 (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: C5g8VY9qTtryO7t6cjJg4okExfJdZ1xINl5o3ufB62buNr8uKDzQYFv/Pw0uVQ3cpni5yvzvju6fpkcMYTFEgQKtCUr2g9k9dSKE67XEZTxGAjATW1r6zd629VoyFgsB X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 Message-ID-Hash: GDVNTMW725DQMEQTP4OGSC5PC4QB6KKO X-Message-ID-Hash: GDVNTMW725DQMEQTP4OGSC5PC4QB6KKO 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/pci/au88x0/au88x0_core.c | 2 +- sound/pci/au88x0/au88x0_pcm.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c index e5d8676373368..192b5fe0d54d7 100644 --- a/sound/pci/au88x0/au88x0_core.c +++ b/sound/pci/au88x0/au88x0_core.c @@ -2132,7 +2132,7 @@ vortex_adb_allocroute(vortex_t *vortex, int dma, int nr_ch, int dir, stream->type = type; /* PLAYBACK ROUTES. */ - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { int src[4], mix[4], ch_top; #ifndef CHIP_AU8820 int a3d = 0; diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c index 546f712206040..53000e486986c 100644 --- a/sound/pci/au88x0/au88x0_pcm.c +++ b/sound/pci/au88x0/au88x0_pcm.c @@ -167,7 +167,7 @@ static int snd_vortex_pcm_open(struct snd_pcm_substream *substream) || VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_I2S) runtime->hw = snd_vortex_playback_hw_adb; #ifdef CHIP_AU8830 - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && VORTEX_IS_QUAD(vortex) && VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB) { runtime->hw.channels_max = 4; @@ -308,7 +308,7 @@ static int snd_vortex_pcm_prepare(struct snd_pcm_substream *substream) int dma = stream->dma, fmt, dir; // set up the hardware with the current configuration. - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dir = 1; else dir = 0; From patchwork Mon Aug 5 00:36:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816801 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 52043C3DA7F for ; Mon, 5 Aug 2024 00:44:33 +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 291C24B52; Mon, 5 Aug 2024 02:43:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 291C24B52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818608; bh=xq3Mt1ql7U3H/lyejOGb1DigCzDhBnHeHhj85z4TaBU=; 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=JIL/SKROZfLxKFosoHG2uZvDJeFY+qVNP6HEcd1KcFB+VtSEpjEeUPDfVLhyg9hpG pfe/MpSvCdSjWiQbWbPQzvKZbSvtZNneNdD5mlmY3x85bDYhMQ1MBOuuIZIMDrPxvv rgnuI+k+LsjgPoukFjl6Ib5lGAuX5nLY8+42evHE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 82455F896F9; Mon, 5 Aug 2024 02:39:13 +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 2A235F896DD; Mon, 5 Aug 2024 02:39:13 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D7D77F802DB; Mon, 5 Aug 2024 02:36:16 +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 4781BF800B0 for ; Mon, 5 Aug 2024 02:36:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4781BF800B0 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=PqQ/0U3+ ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VYpprfN+rIKTjDlYXrSrDuywPiuWbSYXkQL54MMgUqFReSaFm1ZoheMxPW50EdZUBTv+jjfiFyawJekxU/jpJrBQwd1Eiv4Z7deZFQVFXz+KbBJdKdQjbc5PbL9f2AJf5wM7xBD80zhr2+H1uBAIOtpZWDfJBRw9NKxdnhwXVFXOeVYFoNNpdtcrQHKnQVBPxm3fEOcLBtk0eBOvIV2GS2BdV06feBuD/VjtihhoqYVaf4LykstWdDr90Y7mQzIyk4Xcx+qjkHcCRbRSottxAhlpl4BXFLCR4DVWQ8Fq6STt5Ij+a5P2pQBgRlhJPHSevqhN4JPzTANnm54xTcRTTA== 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=0AOimuGkJt0hPMSSBzijB5opL4Pqz0vwxV4X1XmvH1Q=; b=NIzoOlhZyv1IsNpVmSw41lop8189qssM0AQelcgbug6zqrQyjoJtrPtvWqpzbVr7B6Fty4Ck4S+xZ+JgepKrpoV2lfFTGl/ylUhYmLVo1ybrjkQ6LBqPcVjEI2jAeeEPY2BKfzC0FQ+ZH+2/FErNAu8wAophwhzITJlGvgZGj9VcOZYCwX/FYulVv/LiF1n/2glS7xFnDCbwY4N/ui0SLKhZmKBwKoN7wKQofBKOOMZGxzFfY8m/Dk3sgDTrg/gLbLO60CELHIVbTOFN6MLDlv2HSYeQvs/maPlFBzGb8q+NPOAZelPTncjS2Hwv1HshHIIltSffwnxhcv14PspaQQ== 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=0AOimuGkJt0hPMSSBzijB5opL4Pqz0vwxV4X1XmvH1Q=; b=PqQ/0U3+L60U72BqfrrNx4rt6Mv80IrfJp3Ie5Vp7hjheUPlW+lIX79VwuMZjlco5h9G1zFjOglXrfiILecP8QuG1O1GjoCCKx7FE7Efn4QVo5SO+tlKFfWFYHiRctJPam9p6I8EcAUKlH5IqW3u7jZhXn/Y9bUa7t2sCitYJHo= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:36:11 +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:36:11 +0000 Message-ID: <87bk2724cl.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 020/113] ALSA: pci: ca0106: 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:36:11 +0000 X-ClientProxiedBy: TYAPR03CA0015.apcprd03.prod.outlook.com (2603:1096:404:14::27) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: de770122-7b5b-4f0d-6382-08dcb4e69ab8 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: 4sW7sLs1dGzaRPXCfGmkZFB9JhWUzt6RSBhASTJ65Y2KPB8GHH7rHzvIiR+krSnquMuvkpBHv4gY6OtI0mJsSEKu1EZ5hKF2JYlo/VHwityyM98nzupCIxh0Jb8BO41TKRHkVz3WBVTjXqm0uyKzgWYLk7Hq6UU+tK3j+8mLEmND9qbGHRtoU1+VHtwPcqhY5qDus7Paa0RLOXni2sr/Dh4ehoiwR1LeoMv2EaNRkP9w03tndiy6cVhdVZV8V23nWszSL1VsajQOQ+RVXLerRwpmXlLiotgg9P/XXtO5KGeX5XyB8BQZGSmO6affjr0B/S9deidvdQ3DZLHjKM+STq7l/ZE/s6rtaAmQvE8Xf0b46xq/YxEvjCX06R2y9Zs9vw5V33EoQbGv+rf7M9r08tzl1ffx3V/9B9rYkGEOsBnT1VVmucq3IPg04Ed+njNqIc6JRg3hmWIAN0XYIjfxYKJPUNHzem86m0FH5LXJeX5CJMuLd/dkCQpeYBcS31nkT6WBMPxHa0jNnkj/A0xSeL0iArZ3IAGk8O8qmhPIW+RI8X/DX0+HAUvnWEM+7XmfFtzniQtzRLzZOcBdbh+FRSusDWwUOF+bwlsnaay9Uo3H938YNegKGMCbcp5ri2VmwaBxLMAdUmk1l3tjFdZ6fv+h1hIwqx4CwQyw1iQBUUbsMH4d35V0fAFhGiqIcAnDoBBdDPMbPsj3oCfhc2bFHinwIENxwh+2Js6qYYZthDe4hVdCuK5Klr8mSXaU9L1T8PZQl5CUXjE/98tTxuwaRgEYPyPXuJ4kRAX6UBgeUoXCx0KhhOg/MeewzKsDjhIRoLyUvuFWzR+guqxMaSm3RoP1c8BnJtfR2kflCdT8wKDYnq6pdKg7YiVgw2769hRvQewgdVf3CTJl2vEE7XzmBmzW95VNv+bKTRIG5vi+oDAfk508MkfXp2mxylxGcJBEmY8jxAzzWSVSyDsbKKf78d4HwUvwt3iOOUl0lOLVkaIP9hoCUoBx4Qj93XWusm7YodcGhRKt6+wPJ1chGn7Eu9mQAYqVGVVfydVOC288xwE3iDWxXAxWASmT9+rSpMSc6CZIHuvejS6oIsnlNA2gClFBkEGj1yGjfOQx+1PyimHo9o3VSxKAOzu1vbhUODRMQW/zJ489r36u1go1J4a9xt/vafDf3MT9s6/gkbaYSMHyhOLPRMj3jGLlOZ2nfGIQY056x6C6uz5zL/cmuPwEz3gMPuo/g6v9tNKsxEkibMwQg1M4EhVeNRIK2kivByXieKQiXEs3Pd5rkHEMIwEWfAo+sbhiOUQy1FXwUcHjAxDgC+G9k5IGIOfKH3r7u3pDxxxrQU2p56GlQ+lxAu7mMntDt1RB2y3c846f2EEmSgLdCRLrN274NtxHHlyXzwerT8U9tjB7vnRpVRkeLVczgQ== 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: ncMliJjqpGT8lo3A745W0lzn683ABIyzlWP1sxCSf5z5DJZUzgjNeeDostQ1RgHZnWh1qam/QTlgmXhyKU4ha71l6FUa0gFluxTecNitp6IhK5yjZIYYt9IgtkuadO3vKRRmuyOz29quCLdMUY17YuRmiBBdH8Q8G+RYQ1pekCICkpZ/2u1+9b5zAWO81Ett46YyqB53ltdmqhYbSD4gnQ3Da3c8PATY4xyC+EGcHnzHWU+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KaWLpvjruq8Aw16U3z2vX8mGGnTCN7ccutGmxHtqeUpUrwezHv62V6bCbIHNqoQ8fMRybCCdaYROq631PgNramS301E1yZGfNBZYepzShnQdbYlf8/DKbbshD0onx/TyubJARk8Cl2zniTAtTP2qiXzIhmmiGRg2nk/Vpc/wxnXbOiTueNZLrgQmtJL+G9afldNhlMSsUcVYPgr74a6iyPD/QiLb8uN7nJ6h+0/PD0U3vW/Jta3hrr8tO7X9z4poQ8rOFOOFzottRiadMKPs0dwAy8BwxkAwduB3dsmNl/aBpsahqWcgU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: de770122-7b5b-4f0d-6382-08dcb4e69ab8 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:36:11.1767 (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: 8b8ZlzmOupPdYYwkvGgyZdkD89kTZ0rBkUrz8qFzuD2Jl8vRyyX2SzTRSH7hxr64oFpaOFl8Tx8W5nBY54zgCPEDim/40rSAaSTalLP7INDDCtGHDlVC2P5JcbroQG9y X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 Message-ID-Hash: UOWD2AVFNRX3I2NOJ3PGDA47Z6552JQE X-Message-ID-Hash: UOWD2AVFNRX3I2NOJ3PGDA47Z6552JQE 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/pci/ca0106/ca0106_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index cf1bac7a435f1..abee20e6dab39 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c @@ -943,7 +943,7 @@ static int snd_ca0106_pcm_trigger_playback(struct snd_pcm_substream *substream, } snd_pcm_group_for_each_entry(s, substream) { if (snd_pcm_substream_chip(s) != emu || - s->stream != SNDRV_PCM_STREAM_PLAYBACK) + !snd_pcm_is_playback(s)) continue; runtime = s->runtime; epcm = runtime->private_data; From patchwork Mon Aug 5 00:36:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817113 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 559E9C52D70 for ; Mon, 5 Aug 2024 00:48:22 +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 B5BB03815; Mon, 5 Aug 2024 02:46:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B5BB03815 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818809; bh=RO9sGYPtH4FnSGA69e1GZXgXLCVyeAgQOYghxEQzqn0=; 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=jp0IjxzAtiQbUeX/KrzAPeq+IdFl/MCaF5eFW0AF1NrvpAssE2TLDCmxSrEN6h9Yv 7iztdK3t6rwegjYenP8CSDbago64YdzJcEsqINVOuVHxe6o5Nx2g5Ov7ZUWbDZmepX I5Lt6jKInFpGDWEoj76Di6x2CXbCCcvB/nTqzkI4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1F077F8979D; Mon, 5 Aug 2024 02:39:15 +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 D643CF89736; Mon, 5 Aug 2024 02:39:14 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6FA32F802DB; Mon, 5 Aug 2024 02:36: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 215C5F800B0 for ; Mon, 5 Aug 2024 02:36:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 215C5F800B0 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=K64AodmO ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=b+w1u599502mzEY03P7GNWm9eXJ2dZPSf2ZHwo06HkjDpwO9iX9sYpsOpXFQhqlRR3XsosimqtdLgDLJVjKwBVPTMdbwlEJi0df9frL8ZREnUYadLeHpyFYj0lH4wHRwDDBGy1Jopfoi/XgbLKzRuoUFhacrR6QeSOFwueTLLGa+YqdKiackaihcsDqT6wYU+RIHUKBFL6fpfl/VwXOOaoUfqu/iksQTTZeEAWOdo647OxY4HbGSjY1hhClyJhUe6Jsh7GCr18iCJwh5kjLu2kW70tRYXPWS2KcFjgKTyWNoa+I3a2vnW109ob5NZMc1xb/WV/DQewhlOL8quPQezw== 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=Fc0zE345D0DOcFhECJyWKv2hc7dMyEdP61dty9apzvQ=; b=AL/YHHT6M+nbJhEsLviLXZ5DzWhIkyLnoT2K1+NDACop6Noqp4u1iykvRx2DMtUV8iuzwfLI6dymSwbfnwQbNnAjhJus6Rk7kAGdsg5n/IMEedSG80VpThsRPuqIfnIZbzpbY/YMr5Qj4nebU8wloHU/xk7ZtW5o6dKG3QwkjVeLJcfNSdCB3LEM+v0C6xfp5zdfsk1+2SWpXQRwzTtLc5hXuZC9SB9qq8TMHJ4ggczzsjPRXr5ibGAxiOcbvjAD/pvthEnKxWBl1AaA9w2NJkjTFNGrnAffgCOwCUcFApdPwpWoBqj11DuMrGEhMyFL94fxn0NU30wsQce87Xvaqg== 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=Fc0zE345D0DOcFhECJyWKv2hc7dMyEdP61dty9apzvQ=; b=K64AodmOQODq/LIsN/pH/V1VOWvmf5U2X++XBI6eSmUW0Vov+V5STwJE707uACL8pFiJ29LNIvecX5AR/Fb1BatV8voGHc4TSnHDO5gODhF3bsDX/S+ZlizqLni/sZNm4p5eCtIpRo4G91Ij8cOH1HQ/wRAx48Abw3nEgH5bqhY= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:36:16 +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:36:16 +0000 Message-ID: <87a5hr24cg.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 021/113] ALSA: pci: mixart: 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:36:15 +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_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: 382d6311-730b-44bb-d095-08dcb4e69d9e 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: jrk33gdofdEQhNv6HRxC6aTNVyaNDPKyiW7YhJvxnF5Z17eVp6F2gafaUfrTBNimKzW8JctvQ+pQZz13BuZ9uzaCjsmEBvJZ8STWMegQpf8T/HOPoKxxL7luc0m0mQLGpcQoLMGIu77WdlszgAOkKYWUaTt353V2cpOBnL0sOpgYDrtFBAJjI1K7EHr4ahE+AU1goakZSWiqhM7okfnouc3d6vtKIK5lqBDuqUp9isW6NPYPRbBUfD9lebch7WoeBlJxbEm0FKyeqonQNuDYfkfDdvSZH2sfToPIkjzhMUXx2LDFxMJm/4XeV9Zx1ltvrRawTwLHHOquigQDcyQtV4wPS2+JteRVzQ88p1b0Kl3b0OBE3Cqoob8A8fnK8fKPmxm3ColDPpGuJ/mbNoaUWJHQRqm0jLK+oblvIjrGxWsoX6HeTrQ3AhV1oSb6ITjZxg4yDOzUk8smgQCpNWl8rj25WjRXDq/NwVTFcwUogunbHWyvGRYMoq78YwnUNcNRB/GEgeOm4HGk8SfbIP59h0CoNihQjH3oEpZRuMh0MvsC+Oy+F28HvGnv3NgsWv4nRI7N57fKRRAxstX9TqHH2pkidVk0eS8M+/N5nlJLeqorp67dX2pdVk0WchUFjiM9UhicbuWojVUoA4hYapdpiZ8WpCr3xFNosq0tUVE2WRr05CbqcZzj4EipG+DaDBSKJ19BHLbIH6FV7Ma+/Efj3Y2cTQMhQ51stQ3GShRsIyrRl771NICu3w+hR887LDn/ahJ1otTVoUHbiFzRECWJEPsf7S88W4ohtVzjRtICBsFU3+eKeslDuEw2vLa8hg8eUWjAxspIhhMs87EUUOL/riezuxFSwW9y+4EbxDHU9iHpKCMgcaRARTQPGvuSTaPZnLs++CUTsSFOecYl4GI+VoHuA7mnR905BoKqlYxI6/Az8Kb6zZOenwS/wT+/9X5UoXLWDUmRfKbhtgP+JIW66/jv2/ohAwqv3rgOhEqGsD1cqJJ9Sy+9f+edXoBHhFFN5yh8eVS0NAF4rL4Sb0BB2GecAMo0h/mvhpxlkaeP2gyJRKyldTkfOk07lDYdyCkYkQiVUwB7HxlUU5saEsOTOrq9NTppRcVCM+HSNf7YVlybdqCFNf6x/Tij+hn6KyWs6s+ib7bsxEwphylPh1fHDA1qXXEYSPwfVknR7Y/ion/whV9eQFNYipCZtbQ4QPb5rphFkdqK3A2d6p/HPN/PlsoVL2LZECgztFjSAi8d476Y/RxT6s/BP0ClQYm8wLxhxkZwF0Ej0SSCTjHcoMIubWnyW6bFcJbJjSwK8U4yXmabTeFu6/6AQsNPB3cpqLX/skH/nsgIa4YeQQT/1toxvBOzPsdsGZb8c1Jc5okDlYruPAcqvFPdQ8lLSczbnOGL9YJjEPi8aaA+uNGQb9DTKg== 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: ns21YsUeKA2lyyqnYfz3y2WJhDkkL64EB2kX1v8UlzalHGROOfMSSFavVM6ISBOKau/v/Np0va70AoDn0mpJVgRx9DNzcEqLD8e7DNWIGI55fcxldNjl8Fu6HbokOBFR0bs5z0ospfORCUQeSuNsgRctk9h6kDldu0dkIqkiFwH6TjpDn8HWlmCZGep3RB0+h22NiKIwV66alcB/hwtHF3Q0Te86x+IY7hBJr643wyt9HGMnD/976zbKlUmIEqtN3D6H1g+bv6TufOoiw4r0wF+gIC6yzD4Frl8NRpu6DZdw+RVaOb23HSxRwo926zDLtbltmo2gf/ycMPpLCUsZ200Le0MJ9XTTn9MQY9BjwFEfjnc2tDGjj4zK75B3kYgPwMeoOYYrPq322ZiqNhH9YE8eu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aclvTJ0AinyGPpC3fR19lzC+5prOkC2OelcBoutmf/3Cknjv4mT//A3cEqKIzZ4tajDoQ5xrP/bAukJyeviiLE3EOqrv6E35H5uY3xJmTdU2rQr/q+TJZJrRfzBmF76U8E= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 382d6311-730b-44bb-d095-08dcb4e69d9e 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:36:16.0658 (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: gy2SxBYi1WX6bd6b8dRw86+aOzGRXx5fnlNDKN1pSiMSn0ds/HQmHkedc+bFt827HwS0N2EPzifJ/99Mm3R2MyRxmd7EsHut0jPJ85/k353UKrB+gcFSdjHjo2nGpAys X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 Message-ID-Hash: ZCSFFPDMSMEUCUUEF3ZNECLHNNBS4ZB4 X-Message-ID-Hash: ZCSFFPDMSMEUCUUEF3ZNECLHNNBS4ZB4 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/pci/mixart/mixart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c index 7ceaf6a7a77ea..ed4959c517d2d 100644 --- a/sound/pci/mixart/mixart.c +++ b/sound/pci/mixart/mixart.c @@ -391,7 +391,7 @@ static int mixart_set_stream_state(struct mixart_stream *stream, int start) stream_state_req.stream_info.stream_desc.uid_pipe = stream->pipe->group_uid; stream_state_req.stream_info.stream_desc.stream_idx = stream->substream->number; - if (stream->substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream->substream)) request.message_id = start ? MSG_STREAM_START_INPUT_STAGE_PACKET : MSG_STREAM_STOP_INPUT_STAGE_PACKET; else request.message_id = start ? MSG_STREAM_START_OUTPUT_STAGE_PACKET : MSG_STREAM_STOP_OUTPUT_STAGE_PACKET; @@ -608,7 +608,7 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs, /* update the stream levels */ if( stream->pcm_number <= MIXART_PCM_DIGITAL ) { int is_aes = stream->pcm_number > MIXART_PCM_ANALOG; - if( subs->stream == SNDRV_PCM_STREAM_PLAYBACK ) + if(snd_pcm_is_playback(subs)) mixart_update_playback_stream_level(chip, is_aes, subs->number); else mixart_update_capture_stream_level( chip, is_aes); @@ -626,7 +626,7 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs, if (subs->runtime->buffer_changed) { struct mixart_bufferinfo *bufferinfo; int i = (chip->chip_idx * MIXART_MAX_STREAM_PER_CARD) + (stream->pcm_number * (MIXART_PLAYBACK_STREAMS+MIXART_CAPTURE_STREAMS)) + subs->number; - if( subs->stream == SNDRV_PCM_STREAM_CAPTURE ) { + if(snd_pcm_is_capture(subs)) { i += MIXART_PLAYBACK_STREAMS; /* in array capture is behind playback */ } From patchwork Mon Aug 5 00:36:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817114 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 12BECC3DA7F for ; Mon, 5 Aug 2024 00:47:39 +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 F38654D5B; Mon, 5 Aug 2024 02:46:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F38654D5B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818791; bh=Zf0N4JmGAnOLoh1BoriMrjrvUgifTzRyh2cB/qWe8uM=; 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=EdUaeNa17aIH6Q8pfn7nUjKEZ27IB0LyOOiv8W8dZhGMk4buoT4Kv5Acw8XEUd0S8 WM0qrukU6MCFGZUiQatM3JUqZDogug94IQaFs5PEkYQT0Yn5MNAbGorhAlYsJtyNzp vP0YAZX9qmHJGegnPs2m0+UntnLiv0xaOVMkcxyY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A4885F8987D; Mon, 5 Aug 2024 02:39:16 +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 6F707F896ED; Mon, 5 Aug 2024 02:39:16 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4158CF802DB; Mon, 5 Aug 2024 02:36:27 +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 EA1D0F800BF for ; Mon, 5 Aug 2024 02:36:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EA1D0F800BF 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=iB+GHvTk ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Lr+arYGdTWoxGijZ+xnPwu8yrarCka95CeXtqbCVdeoiyN+9Bm9+vPKTWPr+beCXTABW3h4k/K7gUTDIch01o0wjYnUBrNRyt7o7KDnAL+m6rAlHIPCtKqq/xjc/OGsGBYN8R+jJIG/7Pig6KStDWbB5t7OAxsrE5h0VbELzNO7conCEhbL7qYrFAQ85d9n+j74/SChmO3OJQSOjFo+AzdpMGEC2QBUHilKIbswaNA1ElRdqFXaZ5WJ45ZA4VPWvC3SkA1FpquBEWjRwb3yZR4ckbpzTUo//xLf6XPdne2qL8jUs55OiBCvq9gzfNpbAUAbY3EepEdX5+c3d3CsDvg== 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=o9sSF6Gr9RkUcV5wPZ5OOdlEGW1/a6F1orDus/TdiZI=; b=WKQEn6M+PQIQ7Eqlgg35YCgYKae25auw/sAlZzfvg2jajv0qJUBH8wphQnf7gga1YqGBUMr6aa/fbOTl50X9mbXtXWFUr1YwflVpVoaW2UQNkDtAJdWgrNa3FvR4XVjEJbBkFMdxkFgPIBRa1CGhm4aX6SaRMqdZusZaKlOdrjXt3AYHqJtoY2Z4pElqbZkl++twnFzDICS1En2E7md4/Ri9efYUvobu1R8JGf2LrLWgbSDgIHrRrBQCO/f7FYAE4gNW+vSYVIDOW2R5Cj+53NcsmNcp7VC4xyBVbTaiQUbWljYE0feXf86xYKmboM7T5VixxHMKXGvcRUywSCo8zw== 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=o9sSF6Gr9RkUcV5wPZ5OOdlEGW1/a6F1orDus/TdiZI=; b=iB+GHvTkYiwPpRxyfBluj7K7SaM1oZ3wyMXTJlUtmGJVsDVYArXwkC7/0tx+pcWT/cMJFYwHerEG7wZfGbZIFN9hlTPDSYn02/mtNfY0ds2BM/FYXxjZobXcKi7iLkEMMijhfLlmmlOPS1xP9jUJ6zKm/lTHF+WulpahDj40O40= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:36:21 +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:36:21 +0000 Message-ID: <878qxb24ca.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 022/113] ALSA: pci: emu10k1: 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:36:21 +0000 X-ClientProxiedBy: TYCP301CA0015.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:386::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_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d434ece-4546-4605-d4d3-08dcb4e6a0e7 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: Q1VHNuFOPkXWu0LVLwrdS/7E8fHnPmKte+ykPUsGzAOwqkQ0xLuOA0ndQNv3R2nRzn0NYzn7FGxarbtljLaXXtNBeN3pwmKj4FZIk0kNXvDZ1cpLIJDc//YSs1M5mcbOs9fQ/B6qefsegucHZOynUFaajUTbotrKArOhoduo4ib+ObxGDusatF1AdqtuJIbmoHnR87TyxvIWnyjg7NSJqm1fVcetEevZ/iMkadx35Vz+4sGsc2K4AjWi7vlakDU8wCGbSmCFmm3ad4qzcFezHsAny33Zp3X5aoiRDpQfUtiIcA1sq3oHmSNZdUO6P075UYeuD93bbyM4MnQqpuWC7behjJkCbBLX+SRbJkzyWsmmVSpLx8jhwUjYDzyeqOWY6BpXvl+L7d9h7QRuv7hASnWMWubwLJWWlEHlRPFRNNUxVbWl9x+MZ8tsvu/c5Z0Qd7dT/9HP8A21Gpl5zDljePUsi+62mltRQ3u+pZlAa/Sc25li798Yf9epJ4AlNYLbtXBuNhdCWWv6pLaMUO7kBOeWCLk+df4N9Y+bTo0joMGrRjytJbIpTs7CHZWApD8rDqBKTEpQJOtULlVgCg4n5FbdOV4wetHM4pC7qcFu8k4PfM5N92+XRxWq/6Bez69O7Zb9Q4JE5y50iY0lOVYowCoNNXhiRtqgcw5/CNWKS6pjlbnZW7bRiDuKnP5Xy6IInyQDHko1ZdoYgvqM/bAMEpPhwXgtHSyLw1sJ78ylI+5sJQxtK3KMcaCzEMFr0FFJ5WmDnfo7MVr9Z4dusca44cLqDH4/T/GsVbcvilfb7GaE3ofFA4XX6yypc/OCqD5Hvs8dLgTFGrGFQyhgaDS9DC2FRXntohTnxzgtQcKceasTFoVZs7kY8LODoaWV3Vosobn4I9EarCn6KcOLCtUd0Xed082F8R/qhf1kbhjrYb6nTC0haDrnHpx+8kyxLsIn3memRceBrxVpW6Tr9OtZbOZZwgWAZNdUQMRCXVMXsyVSlF6ll2cgwWrTovQ/z6qr5LAhMFil4RrPiXeYpqye5hY4s+BVRbEGTlKSov6b6wZgJI23LhNSyATlguhA7TY3l1JzwhhuOIxNmLrUktuE/qsmG1xgpacDaPydJqay3lgz/+x1K1SnOdkW9CtYZEJTiATAOOHvRxAesG2tGWzQLqfTuVDvPY8A+ymt0TDuqa4UoCxYV/AC3cLRqBppuzZQFEZPs7CERiNLRKgvK+vvvPb01mXB2uvNs6iopfQpCdM5Pd56tudwF5sP1F7ouoFRTXxOTBChmSEkbxjLOtlLt73opEUubv59wW9+vQ5n5KA7Q9y0HyEWTx/UJ7bvg3nZVdOPGDSjm0rLcUp3NGF6uIB+4NAr7xxDimJBTteLPAJMNDFt44I5BusIuu0pz016KhtFiMafltLzJK/JUhZcUw== 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)(52116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ViX5JfxnqWNrbua99UAArDaYTz9jpQQFXvqnxCSp9wud11Y7CK8M+UMsUTy7yo9evOCfIiKxrb9iXSyvHNqCPj62+I9CvGQ08MMPtW7xwB3HSCe41+EUQgM3JYwjSKiYgbSBtoxzZU+t/t2M6bOlSnmus3ERRoa8ibbfvkHOLodrHH3XI83u/gE+cBYCPGmPlFqaM050+eSKjPWLCDlVnbF2NLNW4U9eNNTB2hg2gyEfdQV/NMx2Q64SeJnXvDnQySA0XKmOYW7ebJ6tjTQGfIA6C1IROlzps2Vz0bFNodr1kPFPB4To8UwREHBrkzXrQhwv94yCvs4rx9PFBHKo0jvU9IYBjNoRMwOQBctIXWk3DSXaVRu5r0nXJPNGdjdwhfyC9IE6+6EtIm2Uzle2y26oRrwlGWOjDJ6YL9sXeR+PICDZYpyrV2aDhrKhGCCOtxpk2mSwJGJ06Tp0SwthpyOHHtv6/k2f5iontIIw5wjr3RrFDr4rHSERbNOeEjXBsoH5bsqw+v7K1eNZC1Xa5/cHSpiIWyNduL9k5jEt8fb++oG1+2hCDKriL4rAuI+Feg5/r211VT4ioOiO7/Ww6jZXe7nlpmiWqpb/2LkgG2gFzEtUMHmoLQrLhlYJ8qBQ7+vE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d434ece-4546-4605-d4d3-08dcb4e6a0e7 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:36:21.5866 (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: V3oO+4PQmBOBUcgCT+mUQIoy0hZQFfH9MP+qOveooHXR9WpKdSrzEFEpxfZyjmcEe8zEXoyZe54w3dkKxfMgAZH6zHhD0JtSK0h9tvrpogpapJtP5zfmgm0brlAD619O X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 Message-ID-Hash: 2FP7P2GK7X5HPABJXPEQNPN4UICNX66N X-Message-ID-Hash: 2FP7P2GK7X5HPABJXPEQNPN4UICNX66N 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/pci/emu10k1/p16v.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/emu10k1/p16v.c b/sound/pci/emu10k1/p16v.c index a9a75891f1da4..b174b392b6aee 100644 --- a/sound/pci/emu10k1/p16v.c +++ b/sound/pci/emu10k1/p16v.c @@ -422,7 +422,7 @@ static int snd_p16v_pcm_trigger_playback(struct snd_pcm_substream *substream, } snd_pcm_group_for_each_entry(s, substream) { if (snd_pcm_substream_chip(s) != emu || - s->stream != SNDRV_PCM_STREAM_PLAYBACK) + !snd_pcm_is_playback(s)) continue; runtime = s->runtime; channel = substream->pcm->device-emu->p16v_device_offset; From patchwork Mon Aug 5 00:36:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817117 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 50837C3DA64 for ; Mon, 5 Aug 2024 00:46:25 +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 B64004ABC; Mon, 5 Aug 2024 02:45:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B64004ABC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818719; bh=i+H+QQwiJLoD8qFPk+b4VJ2qHaZScLVWFztzbLv8GRA=; 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=rwO2rWl6Rj97lWVKOgt1PkZYVq5t6HZ81ADzOZU5y8MacnP+5KvZTSaXDc4sLaWSp N8OQcWvWHZ3z9ODXtYGe1DkhmAbEk3yg/lxZe0l4Gf/Xb8zDlA2yWree0RVsaJCJ5Y IRc/fTXLe0Kd4mEWhulGO3H04Ve6AZnB9uhZ98c4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id AEE87F8975A; Mon, 5 Aug 2024 02:39:18 +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 BFFC9F8976F; Mon, 5 Aug 2024 02:39:17 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0EA30F802DB; Mon, 5 Aug 2024 02:36:38 +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 73D51F800B0 for ; Mon, 5 Aug 2024 02:36:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 73D51F800B0 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=X+PH1z0z ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zMhq2l8l55HrNNsrRqmlNMd1agYBfMxhEn+uZ8+S+jKIp0Ernz1HoBFi+3LRSEjdm9jU9IQihN8PIqhbtND2ibiqJUfolATBv3cMMNzzSQcmNo2Kr105x/aWyMvI3fTSP/kzykvo9r7gALfP209/KYfgyE+2lWjkL0L/wGrD3U8lCgUto0fAUfOVBrmIQseJ3ZOyjqnISt8JhLQKtp1/7G8g02GZlu/dLmk1Jv9P401SPRUDOS4Bu9FPEIM69R/15CIkr6qkcI4NXPOHyVLXjlNUwBOwXjNbP+c0mgBBs2+jAUMb0GstDusEtvSDwFqIakyOxSejNW7bpFT7wJokyQ== 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=jQLJLkHykyf+9tjtwn6ySZkkW916yfItHvW05IKs/pg=; b=t9dNUrOzEu/oehNq0lQJP1vAqe1p/DA5oy4EGrX7YDmbKI4jXn5q9Z/LsP61NcSxwGStmKuxxR257i/YxaAUSRmTsreDrkxKX87XMT8x2FUtAYHmGBNxodeAVgjT3W0wTIaL8rOgAGPWGJwUOz37674D7vKnIgpC3kp+wb54pPP9cXECRWhzn/JQi6d9HwFBn2rMMrObA/j0NL4gHalLBUhz49rtBmL5keAA+UHbe0Ct1KbtjTuvZwREM+D4rHD57bZEfPntAFQtuAgewChO7snm1sq+dhmfTZY2QgMwRsPCLTOFv8BQelppiKKhBCqk97uybxjXRXOCu2AZ8E5vqA== 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=jQLJLkHykyf+9tjtwn6ySZkkW916yfItHvW05IKs/pg=; b=X+PH1z0zqRDsqJt34C4MZ8gIi10f1v1o9GjtGMzUY0pitO/XjC33rFb9UKZO3gcMzew/R/pZ4tGmr2KnJg+oPaQ90NQW/Xk3nC1vXJIqBO4wQX69wNU5c155/8Xv6TjUnkThDSCICntavC6QS8BN/fxvXZpdT6ugkp3y8g5zXRI= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:36:32 +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:36:32 +0000 Message-ID: <877ccv24c0.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 023/113] ALSA: pci: ice1712: 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:36:31 +0000 X-ClientProxiedBy: TYCPR01CA0202.jpnprd01.prod.outlook.com (2603:1096:405:7a::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_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: 78d6a4ff-92a3-4130-9b8c-08dcb4e6a728 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: fZHuL7fdJZHxKZV4nw2JPbrVYngMZNBCqO1Brz17cNsDp1xE1O6+WBbQPRbnGic612CzuIHCmoPDboZJrdeQUEbUnghqLPBPG/RONW2ijSv3GFLlstdE6O+qui3sumir6UGnJ+glw5W1WjSc4xZu/EjouQUk+c0bN9R9UPbJU58HP8MAL4EtAV0Ga2+s0YMn2u376pYUGwGPUt16X0vTh+7JvWhR5FqDYLzZ9haGMctPAIDAzeaaUD/69TYFRRVYwy7RYbHyvqng/3SqNVyFYeGgopba+gZqiH3E2XvMhYZiktQR/WfgaMX8M3BMueof3+ClJaY/0D4uAHN3jCErhdP1JRj1rxWKqEHrBPDfI8sYhsvXol5ZuXM1fDs0IvArWd8W0h08gJbGidoW9mBqz8HCoeSk6mxVDx+783PN54/4+hGey1zvRHGYYNQIrRN/YuoWYoM2IgDkbXTXPfhUHerC4hBcu/kzvO9u4hdU3dQnA3TfHr+W2DJZafWjAJ8F3gHgihZlV44ebI5nIvGPuxw2WqScEwG43Y1hr83M1bez9SkJRs4FE1Z92SxUz0PaijLZjYWnpi8r8fsOHTIlgNthmStxrnc3tegIMOBxyroLkYDohBD6XpoHCKdCZDUt/tfhwEzwalQqMvwtJe7BgTWV2IaAaciQRwGgZoH6i6M218cBXnmRKUBlFhgzqYQHsvmqqdcoNoh2RtYlhZpGlBD6huoPQrF/Zj9JLH3oO99IMQOIu9HCuvnsfmIjhdM+lsyafNwxnaNyWoTWOkiGfNSGGprhhkoztHbJIFLXiRpsS8LLv0rChi28bN8kYfu2pkJUtmkvD8KEg8M0l7vebMheDvMsgNl651gBQ+vyGu60BhpSW3c5FQwedORcTYy24j6avn09XsW5duKn0TpDIvbC8oBCyk7iWYij9mO+3SO+6/Tfj3WoQ8Va/PafQUR7aF0azXDnFlrDiYbzzPidxJCyfDougPI1XyuLLUTYmyHM/KH8ym3qrHMhzsWkq/vuuf3kUpVgE61JK1frf34mOlKhOiMDq4h/DjWtWUMQY6io26W3rvZuR79vUvlzQPRKFjeT/BOlVL3AJjXq0Lmu40PZ87tYe5wAkw1ZS81f7Kbg4LDnyj3hzGgD6CS703TB6P4k1DOPHe6bk4LAoEFmtGQ8+nZqm1gHEVQ+f6VcX+6irGBiimgBeF2Fm1XrZ6Kxza0BxWxHchN2O9bn5wr5MmNxINUFyD3DTDXtC8cZCPTOy/tAE4VtR/UV+m3PUN1wixyJ9F28rSNBm+GRRFHN5C5n+HMCIlMwJN3AGjLwv1SrQjRI52vCuBbUZjBhCReKOrX4+fzvKtkntQ0if3y0cPak2cOXDYwwkde3XGWmSxptOIRcdQVk0kxCF8SaKfO/P1Sbc3Yr1EHRxX4DUDt5wA== 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: 6lQpQiZNoT2+xBAY2TmeMHO6S36eN0vQLkCjKWjef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4aiLx0dFcI5Ue0r1KJ22CceeFw+FoW8C/55YmIDtBy6RhHlUe2siQUfww3OsQ5F67qCRxNcttUBj1MW9o88ZeZvZ8zxUUGxrRAYGR4QbKWPq8eVehRJjHt9IKK8U36ykot3LF2CuoDaIz0XcDBh2KcEZiwB4rF8pitnuTVk5O+ZVML1e4nkpIju5aDU+PPotjr4YtL+uyGpXtee1cHAFE0xZ9anbpTAeQB1w8wuxTKpwFnUpOlySRpXD1z6C7lHok2RUCd1ybgmQ9FKK2RkqtFav84LtUXsKCkOpF9sokmuTs2cmzUCUiiMWAgM3giJuMnxbk2tAzNAIxiw+cg3iCu5nkkP5axS1fGE5P+lry8xku6RVKjThgk0QFgHhDp24xDeTR/jRKOKBlNz6Rm8iI6GZH2ntVm2tDAR4NgSagFperRl9V+5nV+dekkWKfLNYyM0knCoILHaj2kNqrwA02mz3YKYjCKg1yWvV7U4yHtGbQx0P9Q1mUrCUzGOhxY0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78d6a4ff-92a3-4130-9b8c-08dcb4e6a728 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:36:32.1229 (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: pTjX+w+omXanEO5R8pcYgOk/YiVP4f+LiPDGHhqxEdXFYdgywD+U9cWKcFL+wxmwPvb6uSJDC8Eje6ePgmGyd1iF91bU1Ub+K6BXXLDhu+Wgmp16N3PBcI0YlwpyTVmY X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 Message-ID-Hash: HRKKOJLXTU4SLSALXEKIYHV6R2ORHQJR X-Message-ID-Hash: HRKKOJLXTU4SLSALXEKIYHV6R2ORHQJR 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/pci/ice1712/ice1712.c | 2 +- sound/pci/ice1712/juli.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index 3b0c3e70987b9..12f0cd9b8fbb1 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c @@ -907,7 +907,7 @@ static int snd_ice1712_pro_trigger(struct snd_pcm_substream *substream, { unsigned int what; unsigned int old; - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return -EINVAL; what = ICE1712_PLAYBACK_PAUSE; snd_pcm_trigger_done(substream, substream); diff --git a/sound/pci/ice1712/juli.c b/sound/pci/ice1712/juli.c index d679842ae1bd7..b52426540c529 100644 --- a/sound/pci/ice1712/juli.c +++ b/sound/pci/ice1712/juli.c @@ -170,7 +170,7 @@ static void juli_spdif_in_open(struct snd_ice1712 *ice, struct snd_pcm_runtime *runtime = substream->runtime; int rate; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK || + if (snd_pcm_is_playback(substream) || !ice->is_spdif_master(ice)) return; rate = snd_ak4114_external_rate(spec->ak4114); From patchwork Mon Aug 5 00:36:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816797 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 6D1FCC3DA7F for ; Mon, 5 Aug 2024 00:46:59 +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 8E57A4CE2; Mon, 5 Aug 2024 02:45:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8E57A4CE2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818753; bh=twAO4m0NbFNEN3VdvY7CaSFGxPH3+uRvtg4VOT3L6wA=; 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=BEb9yQhoLEQC+wjCcszt9SpYFXiBMQbpf66rBeGFLGBhPnu/teP/NpFaLMYrVbq5z 8x0BND+d2NrWvBVivrxBYp/Gsx6dYAC2PtwgljyKT1ipNoFwUYv5wD+idwJgmMpB3o CQ7+v56+QR7feTb7EtHAwf2mL7kc/wWs5f+0qUok= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9C201F80707; Mon, 5 Aug 2024 02:39:19 +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 57489F8977F; Mon, 5 Aug 2024 02:39:19 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1EAFBF80448; Mon, 5 Aug 2024 02:36:49 +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 BA852F800B0 for ; Mon, 5 Aug 2024 02:36:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BA852F800B0 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=gUysYGQb ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vGAhIIlsU9JHDKFNsey3DtnGKE1Ba/to4VW2BIn6bKUPOfBwKJCUXI6zzSoDZEvo4X6R81MZKHE1dTzmmf/DBVGCNLgbE9SFKOMYhJVKLs3e7GyjqhlZbRD/rTvNHcX/AmL/Fcy7gMp1qYOvtpvlzIQqrL9tq4VKxC3H0OddmaUFZI8GOApQT+Lg45ZttAuydiHDupRD9zdc5wmMUhX2Q1P2+VNhWQqSMxpBLxf1biCvxP7DJ/ufK0gq4D6ccsk1QNBVWp8shtHLRfL2HNvK92gn1WSOljvzMZhDB60dplI4hVTkCaY9ykZLJiZnTvRvZUIUIuLdbomn35/y4kfUQQ== 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=NM/kwySv9IWD+l5L1gOqEK4w0rf2dXzrAk6ErGxenss=; b=A27cGevcGNEQ47QPArGWkzeIrWyEYrl/ODv4cisUnT66whUNBmKNi4Lf1fMPDBOGWzmtl/TrqXx3ZefIHuJFBOg/ZKIymZKmanbXWOh4xAyBG/uJnmBAJ3s5/ASLP9lXdEqupgt49bnLE/KQvxpYkaKlPokUyESdQ+Sr5pvvBayj2SNBE5EToef9kQkVdA4zSDif2fkbO3dgRl7gZPO7gXONS1jxjwTgjcbHMy9V/7V+c4eTTqdhGw9XEiGIy6UpTOOoe57w/dU6IQEOjF8JoV4PMxuUpymd5XItcblvsgzbkq6wmXffg5JHLS45QCwf6l/eHo1JWgDre1tv4a1lWw== 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=NM/kwySv9IWD+l5L1gOqEK4w0rf2dXzrAk6ErGxenss=; b=gUysYGQb5TNiY3T1NwhouAS2E+YfX1PZSsnKrnF6HoVDbdPmnJgOsx5SqORY3YHW+cYGa8TW6iHSJnJxNUOiQFsXl8QoBury3XTLoPIlnkYf+GYmeupajjHwSO8uCKSjnM+6XYHajwVD1J/mE05tHpOb0c13kR3bWFwdVRsDd6Y= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:36:38 +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:36:38 +0000 Message-ID: <875xsf24bt.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 024/113] ALSA: pci: rme9652: 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:36:38 +0000 X-ClientProxiedBy: TYCP286CA0324.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3b7::12) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: d7de162f-5c52-4444-b957-08dcb4e6ab05 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: fB7v60MMDM9AY30QLR1dpOJZ4RzPMUFcVnIixQZS81WJFO2LBCmzv6IdbUeAlDMaSsTm5LRHI4zt2Lg8OqWGzzcwbM0xWWmBs+Vqe4oEha2CBf8AODT9w5JOQXiQnV+QJSuZnGxa3pgddyul70rWmYg//lbd4E4XB60krMyGInjuUxWl+kljpTnOyQbYR4bQ98mYaNEvUJNwPUofzX71bqiHvN6K/Mfd/EyHc2vH/WSmzmxFMqrTB4adtc+jRhl09LV4rLeWHO4hnPg3KNz9ofNacCzVITU/NCkd+hEhGqKxLnZKup1EOjYF2roMv0SRfLl5h9gxXve+PIQIdUjoXMwnB0UVRpJKK4htQHb/mX08tuSBPDbdIQSMXoOSOHCSTVPfidWj7kXqEs51S9siCMi9Na6Ky9CCAdhv4V2P2urs48JIZ3FHcSq+p5NN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nprd01.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: xr6+v7nrlStwAU0j6p/ty3RjVxpYa638o9/+ohOgG5Uus+cMP366wS9cT7xrI5hlrglXN5nvmY5TOh7OzcyJrLEo7J+mqqcHX7M+T/JpknnarIguf3RimkO3Nj+HNsBvO6yCyw0Ft03fV5Xp8w39V5K1upkFKpQkqOMjy4Bnwl1CA682Mml40vHif07b7W5EO0O7SLS60NwXz3ShzNqEmYBcHQSoJX4SETeHeITmla4rviYRQRzAu9o7VFl3wLy0IuGow1ig6hAWqHMgyFZRnhwGOWKQR14A7dqThmMC/PM2gy31N4FxA0T1wVHak9YiTmfEHI8+d2m5j3kwNLasQtegL7Dh642laiDx8vOCJlL9scxulAU1GVN1zWcxLhtzt1gcoz/fqmeX/K1JMjvtSwdagwmhL+j3Va2owzOw2ekxafZ1fBVCrFF+bTsBPRI3e1NWPopaI/zuLomO1BgnLTtlH6GEcX0UTqt1OSh6C1rWOicdyZTk/0H9uzbJLc38MhhHv1xqrEKc0nLoW+TXmy0YueSGfPUsO8/TYCSNxlgPhxqtXRF2KwTYGUIVwqG5KLJvL3QoUYlEjRYNdWSjWFI82kN459odx6GvhyVfaSrHI+AEXe7vHvw2semKGA0XhJ1gua8hW2a+WSJI8sYm0TaQ+FtfGuVQSPwdzNm8oG6QD4NPKCoSc38F8J7h8pVw+a0G2U6LxyDPv4z8/daNKi9CjgVFNAyTG8Q+q/8Ytih1td1KahYlynneAsUywvZr9DI4hoOpgAHSh3XIZIoL4vMwvmXgAUpjuFBvwoxcGAfww12HrxF0bVweVjjGlQJ2nsmHpLPtNsG4GcMtl47xijSAJb4ZXVfcsZrJ+I24sJeAeomV29Nl770vJWmELwPkgb21h90GLpFx5jQ1l4v7HUDZxVtplWZ14VZiztkSYWXu5ZiETJkFhir039Fl79sEGQfI9NicjvO/8TVwO3eR0nqoAHjmnC8mIm8lbtiQvuoWOKfCCY9ki4ioaBs27R+cl/xX7sKeUNgqIKxAZ1zH7PI3u1h9DUzdOiwIgVxnfKrbi7ismhkbLmLhhYaxPe2S2LOiw1SURnRiPRSybGGCXew3zwNCZB88/j19V8w83UBaCWcRBrLmEoGohB7fUawPMDbF4wzjtY1NpRzXt/zGKj9B4Sq5wNOUKsfyc22Bdu0pbbwqPy2iPuHrBktAmJmv/sunzHZLUaACIAhdqn2lboPvBROnJl05dCtl/LRTy4juf+vfjjlrQQSV6yhwMtrMovz+oVk7wW2z8MoccDvd0jHbL4wyRub/IsU1lJiBeqXrCoH56Mz8o9X362b+25uFZMfoFF2XEjE0E71ojA/5tRt98wWlzoJWiSgnCwmZqBx4z0dcdzWxKNPhqJYxRI30i8Ir14APwJFoxK8foKVCrRqB0WOFtEL9QYXEY3VZ9JyGxirpcuplgfdbfVyBmy5GoinkRTZKvfWmLFLLLhcgc+CttemNvxDMwRnf28LrymfXUx92xAAAumwDsnk6xAPeOm9VVV01uhSysXctthFiML4PGl10SL48uxtI3X60fhiJEI9cXxT/ZwIhbmqYySelgFttbRYHSPBlqnrnW9+w8W844oqgs0Z3zwJM9FZXwBY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d7de162f-5c52-4444-b957-08dcb4e6ab05 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:36:38.5611 (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: FmXsIkgBYqT28wLJMWlmrM1kjMSmLePKyPOhva9sYDb/DCyrhYqrsSYMbqiGO7VdCyvW6NN0atajRnE5MhAAZdJm47OPdbzUHM0AKCY8FNLUsEjg0j621Z7A0JrPheW6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 Message-ID-Hash: 7CKOT5J7EEH5YZ2FA6D4UFMOEI7EJFKY X-Message-ID-Hash: 7CKOT5J7EEH5YZ2FA6D4UFMOEI7EJFKY 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/pci/rme9652/hdsp.c | 14 +++++++------- sound/pci/rme9652/hdspm.c | 23 +++++++++++------------ sound/pci/rme9652/rme9652.c | 14 +++++++------- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index e7d1b43471a29..b99f32d24f7df 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c @@ -3953,7 +3953,7 @@ static signed char *hdsp_channel_buffer_location(struct hdsp *hdsp, if (mapped_channel < 0) return NULL; - if (stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(stream)) return hdsp->capture_buffer + (mapped_channel * HDSP_CHANNEL_BUFFER_BYTES); else return hdsp->playback_buffer + (mapped_channel * HDSP_CHANNEL_BUFFER_BYTES); @@ -4014,7 +4014,7 @@ static int snd_hdsp_reset(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct hdsp *hdsp = snd_pcm_substream_chip(substream); struct snd_pcm_substream *other; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) other = hdsp->capture_substream; else other = hdsp->playback_substream; @@ -4051,7 +4051,7 @@ static int snd_hdsp_hw_params(struct snd_pcm_substream *substream, spin_lock_irq(&hdsp->lock); - if (substream->pstr->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream->pstr->stream)) { hdsp->control_register &= ~(HDSP_SPDIFProfessional | HDSP_SPDIFNonAudio | HDSP_SPDIFEmphasis); hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register |= hdsp->creg_spdif_stream); this_pid = hdsp->playback_pid; @@ -4172,7 +4172,7 @@ static int snd_hdsp_trigger(struct snd_pcm_substream *substream, int cmd) spin_unlock(&hdsp->lock); return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) other = hdsp->capture_substream; else other = hdsp->playback_substream; @@ -4191,15 +4191,15 @@ static int snd_hdsp_trigger(struct snd_pcm_substream *substream, int cmd) } if (cmd == SNDRV_PCM_TRIGGER_START) { if (!(running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) && - substream->stream == SNDRV_PCM_STREAM_CAPTURE) + snd_pcm_is_capture(substream)) hdsp_silence_playback(hdsp); } else { if (running && - substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + snd_pcm_is_playback(substream)) hdsp_silence_playback(hdsp); } } else { - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) hdsp_silence_playback(hdsp); } _ok: diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 56d335f0e1960..a85e09535636a 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -5465,7 +5465,7 @@ static int snd_hdspm_reset(struct snd_pcm_substream *substream) struct hdspm *hdspm = snd_pcm_substream_chip(substream); struct snd_pcm_substream *other; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) other = hdspm->capture_substream; else other = hdspm->playback_substream; @@ -5499,7 +5499,7 @@ static int snd_hdspm_hw_params(struct snd_pcm_substream *substream, spin_lock_irq(&hdspm->lock); - if (substream->pstr->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream->pstr->stream)) { this_pid = hdspm->playback_pid; other_pid = hdspm->capture_pid; } else { @@ -5570,7 +5570,7 @@ static int snd_hdspm_hw_params(struct snd_pcm_substream *substream, return err; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { for (i = 0; i < params_channels(params); ++i) { int c = hdspm->channel_map_out[i]; @@ -5656,7 +5656,7 @@ static int snd_hdspm_hw_free(struct snd_pcm_substream *substream) int i; struct hdspm *hdspm = snd_pcm_substream_chip(substream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* Just disable all channels. The saving when disabling a */ /* smaller set is not worth the trouble. */ for (i = 0; i < HDSPM_MAX_CHANNELS; ++i) @@ -5682,7 +5682,7 @@ static int snd_hdspm_channel_info(struct snd_pcm_substream *substream, struct hdspm *hdspm = snd_pcm_substream_chip(substream); unsigned int channel = info->channel; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (snd_BUG_ON(channel >= hdspm->max_channels_out)) { dev_info(hdspm->card->dev, "snd_hdspm_channel_info: output channel out of range (%d)\n", @@ -5765,7 +5765,7 @@ static int snd_hdspm_trigger(struct snd_pcm_substream *substream, int cmd) spin_unlock(&hdspm->lock); return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) other = hdspm->capture_substream; else other = hdspm->playback_substream; @@ -5784,16 +5784,15 @@ static int snd_hdspm_trigger(struct snd_pcm_substream *substream, int cmd) } if (cmd == SNDRV_PCM_TRIGGER_START) { if (!(running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) - && substream->stream == - SNDRV_PCM_STREAM_CAPTURE) + && snd_pcm_is_capture(substream)) hdspm_silence_playback(hdspm); } else { if (running && - substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + snd_pcm_is_playback(substream)) hdspm_silence_playback(hdspm); } } else { - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) hdspm_silence_playback(hdspm); } _ok: @@ -6046,7 +6045,7 @@ static int snd_hdspm_open(struct snd_pcm_substream *substream) { struct hdspm *hdspm = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; - bool playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool playback = snd_pcm_is_playback(substream); spin_lock_irq(&hdspm->lock); snd_pcm_set_sync(substream); @@ -6121,7 +6120,7 @@ static int snd_hdspm_open(struct snd_pcm_substream *substream) static int snd_hdspm_release(struct snd_pcm_substream *substream) { struct hdspm *hdspm = snd_pcm_substream_chip(substream); - bool playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool playback = snd_pcm_is_playback(substream); spin_lock_irq(&hdspm->lock); diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c index d066c70ae1600..84e18197f26f7 100644 --- a/sound/pci/rme9652/rme9652.c +++ b/sound/pci/rme9652/rme9652.c @@ -1833,7 +1833,7 @@ static signed char *rme9652_channel_buffer_location(struct snd_rme9652 *rme9652, if (mapped_channel < 0) return NULL; - if (stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(stream)) { return rme9652->capture_buffer + (mapped_channel * RME9652_CHANNEL_BUFFER_BYTES); } else { @@ -1903,7 +1903,7 @@ static int snd_rme9652_reset(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); struct snd_pcm_substream *other; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) other = rme9652->capture_substream; else other = rme9652->playback_substream; @@ -1934,7 +1934,7 @@ static int snd_rme9652_hw_params(struct snd_pcm_substream *substream, spin_lock_irq(&rme9652->lock); - if (substream->pstr->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream->pstr->stream)) { rme9652->control_register &= ~(RME9652_PRO | RME9652_Dolby | RME9652_EMP); rme9652_write(rme9652, RME9652_control_register, rme9652->control_register |= rme9652->creg_spdif_stream); this_pid = rme9652->playback_pid; @@ -2056,7 +2056,7 @@ static int snd_rme9652_trigger(struct snd_pcm_substream *substream, spin_unlock(&rme9652->lock); return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) other = rme9652->capture_substream; else other = rme9652->playback_substream; @@ -2075,15 +2075,15 @@ static int snd_rme9652_trigger(struct snd_pcm_substream *substream, } if (cmd == SNDRV_PCM_TRIGGER_START) { if (!(running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) && - substream->stream == SNDRV_PCM_STREAM_CAPTURE) + snd_pcm_is_capture(substream)) rme9652_silence_playback(rme9652); } else { if (running && - substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + snd_pcm_is_playback(substream)) rme9652_silence_playback(rme9652); } } else { - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) rme9652_silence_playback(rme9652); } _ok: From patchwork Mon Aug 5 00:36:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816792 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 98174C3DA7F for ; Mon, 5 Aug 2024 00:50:07 +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 7AB4F4EBE; Mon, 5 Aug 2024 02:48:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7AB4F4EBE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818920; bh=Ovlt5L9oONm6lcpKVxuxML7k8JmtDy2KlGuO0/YvIic=; 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=Auiea25M/QTgIDWr2jTHPjSTrxzlaojXOZ7Xl+F0x31hb2acvYf8NiU67rK4UQI5f J7iQESPog8U5bI3VDSVfXLFgyzIQgCip2EeKFuF1SdT4RU7Srgz5y4xLfTNmEOfL1x gFxQ1r6QCwWjeCK/CBqmhsuFiyTJRdHpNhqBdD3A= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 99BA2F89891; Mon, 5 Aug 2024 02:39:21 +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 EEE61F897AA; Mon, 5 Aug 2024 02:39:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7AA7CF802DB; Mon, 5 Aug 2024 02:36:49 +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 358D0F800BF for ; Mon, 5 Aug 2024 02:36:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 358D0F800BF 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=myFiTyy/ ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=S51U7uwx3ZgicY3981iJS19AiYKmaMmnK8v1HF6w9WiDNq9cUIFLYiQxgNrX62g8iuVQWOKV5+5OVD5D27fFzgyQFQcxMkhanTFaua25I0PtyJ/k/XxhSxnjs83aMNJQA1nArUsbjDS/XxnoNxQTnaoGQVi/wavozbFqqZHh0hzFN9JP8ien6xy38rOuSF3jhKFGQci1wa9BRvVJyTLxSBIevQKntQSAbnW9K6QqbYuZ8VV/PwgHpvXYJ29q93DnbT2ou8/wYz/yyz1t7KbHN2EvJvFK3qFipaxtHek7kQrA98ZKp87iPobURPwmr3Petv2eGTrMN0t1OjhCZ89D0g== 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=3n6Oq+EET7nzKlc5BhH687yFBNZAc6VtaoLke/qPZxI=; b=b+UF5Qcn/yQjxKQCedNzLLp8sRa4QLvvj+A5hVQyBNV2MDdzmENhrXj0MZ2p1BU5BdwySgAHw8IBnUrIC8Eysm2uSIybNg1/IOIS4stpEdqESVUm6/Ba6wM9cQlR3g2HAfLzQCrkBsRebjKv3coJhPP8rOkx1KCXxHUYoRjd2hSWHgrTzKjDoXiU7Lpyx4DXp5lDbk+R96saiVeK3U3Uu+GA0aMf+CRaRYRkRvVR3eswfcyhnm7X11HmyoVBNv5UXuXn/p9iTzW9+/0JOtd9Ew8bJP+zlTRRflncMmuP/Fw0l/PdHlY6eO0Fpc1TX2ZYR5Z6Le3SwyNFpKp+oRN/Kw== 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=3n6Oq+EET7nzKlc5BhH687yFBNZAc6VtaoLke/qPZxI=; b=myFiTyy/ynvZ/mHud9feDaVNHBPfFB4mL0Sj48i9dC1vdbZtd0z5fiQ9ok9tq1329F2X+Lv3c5x3PJyVI+bYGUrM0z6aMsn1Bwqz1oisaeIdPgpV1r+eEuqZ/zo0FYRmjbCuiB/xAhB8dxYHL+vFjdBaHe/vntyl6nlRQST3TKg= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:36:43 +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:36:43 +0000 Message-ID: <874j7z24bp.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 025/113] ALSA: pci: korg1212: 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:36:43 +0000 X-ClientProxiedBy: TYCP286CA0074.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31a::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_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: ddaabb9d-5b48-45ca-72ee-08dcb4e6ade6 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: RK/DujiU8+W+Dfc72wfE7mDAW1zrADDuWHNk7nWoacYR0M2hAbN9X/w75j4mh4yDVHkP+7+h95zCaGdCx2BvD1OQcmTnMcippNzMAsAojE8XaLJMIJ9k2I4xTiIwfIMfOH1lLSwT1c3pNfGePWC/gU833tSiJWqJ9rMbO4/7Tuw5FwUINP6Fk5WivUJBR+wgtQ8S1ClRP5NpbkaTO96LWXUtdb+xV3XdFZ77X797pyjteZ37dh88xj/yC+6TndwdepSTRDMaa7CMA+IGxXi44vS3f5C9Rwc5BtTzTV4QtD1O5coMtbP9gOlWDtzad9JuURJJ4fV+KcXGuO7kOM6NuefinKfstlTbb20JPC6BTxCNWrSEMvy+MmRrcLCTsVlPG+Vo2pSQpSrkLdpPd/5u2LQYffvYYbz8qR7jLPMVC4p3ZkAMdymgB5uHSdgfVr4y25TTcgHtJQ+VK87CPjVSfHl9uf/bIJiWTR+JYCzoIr4f8rsAwjmSQV4Jl20XNSvSXyDaX8bUqmXINwBKqQ6CF+c0Q4WYgNyaz5t5eolDxlh8II0TF7MV3RBwY0gvxyi0WVOD/OBrHzJF3LVpsC0wGFmOO4Ls2Bci+5UVYc5nNF4k72T5XGujb+qvjAYpvPUvWPfe8oGc9uEPBbbQcNcHiHmtWeFVF7GruINhEj25vy5sO3wkxG2aKSdRHirTqS9ZeuiJTlPqsysUKGhqEO2GMwc5TJugqogBQuotviJirz3oXjnL1NOH/yG+VC9Fvk+zEXiM61EhQzzq65295rnDnVH5J2dDgUCMKpiNbUcFlAsF82ZgB+92JJz5oZ4zmlE3TJBYvVpKv89qc55Y4bOaz/zWtGimzc7IBcLVbjiKx7XIwIkMOKggq8CF2YDiur07U+f9VlUy83LoL0RUNHrEnBzv/2MMnkUV8qnnEWTRIMl9seoRxP/Sp6e9znz0rW3pMRwd/YC02f3mZA2XYhzRphxr1y9uAv1ZCZEZhSpE8yMQ+OPUs5GIdX2pTE5+HqoqEjigK9WFwCvYmAhfBGAGMG2iayIzW1YWWBj6AcALCnUvEdwEr56EUU6KpL+fwJCZJ7PZqWDGTOnpjRKkpVN33I6lXDQR5OAEa5cVrF/qMM8eTenOJ78/vlTFWjQ+Dt50wV9VLb/1GmuP73YmSNSeR54Cz2UNwjLaiJ9SG9ZQ1k5L+hyOOj4BU9oZE7g9H3qs2vWZ9XIN/0/ComVqPE7kZv1qF0W9qP+s0YiQrmG1bghuUAM68bUgIcLguZ6mR83C0KRr3w712h4na3bL3/XnGrKR+7lKnxwS7lhkPegH3FRimLSDb3kXB5TSvpyoz9c1AnIjwNZ4bO75S81KT2DtQp74T2Mumzpkc51GWBtJ0EfYsWsMZwcCnkW1hIuVeeJjgqAQA/Xs9dgvHx1IE6+XVQ== 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: FHdIhNZwNdh5YsKbKF3DXkmBH+NgYD02h4dHlUwWNMpim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GetMF0s+YhepnC5077ThK3T5j2UJ9SOs7Jvz8EM7r41F7AlDuZlvJvLAPNUFIeOi211jxluUQWV4SKbAaD0hqNciyRPfFFTDmyrdebdmEuzbJUJEIGuaXbfpxEZjxZOgAD95qH6nyVrIHg1hYOWIYcDpQFMkLSQdE+V/YUyyPh4nTYtPNRhyXGT2EEymAQtAwU1v632t1dgy66o9HJWAGxAcl7sF4QcEQXW0CFUZfwDsZrirbHPdrPcnxfOM/6M93v0KhumEKaw6QfH8r/2E2onPT3yCcNB5V1u7EzApGEfSw05rP5ltODG+UTJQcNC4KMBSa+NKZuLVdoUroDBfyeDv3yCw6kuXduwM2hlLcdMtwEciFHG/d9cSvmUDshZvEnp04LF6mpNhENG/z1WY2bg1MKhnBnLToEvtr/UU62KZkMJx6AST9nZAyCMjmY7GPFnB7Z9n5kOYDS7VH5UkbxmsyToIPE3JAZUMNJ8Tz+ZcUUzEME= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: ddaabb9d-5b48-45ca-72ee-08dcb4e6ade6 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:36:43.3754 (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: JOYJMeX6oldTLSbp25g0pkaB2UWt8Cx5oyZlfgUl/7JJADufI8F4O3NtAbO+hu3GpFxUi3cl/S1S6/zamhyV7FAuGpvmAozc4pkzWPU98TU7qt73iRuHalt19oVEY3zC X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 Message-ID-Hash: WFKTCBOLYGPXWCAF52WPZOHRVN4BOWLV X-Message-ID-Hash: WFKTCBOLYGPXWCAF52WPZOHRVN4BOWLV 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/pci/korg1212/korg1212.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c index 5c2cac201a281..f6c7edd1f045b 100644 --- a/sound/pci/korg1212/korg1212.c +++ b/sound/pci/korg1212/korg1212.c @@ -1494,7 +1494,7 @@ static int snd_korg1212_hw_params(struct snd_pcm_substream *substream, spin_lock_irqsave(&korg1212->lock, flags); - if (substream->pstr->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream->pstr->stream)) { this_pid = korg1212->playback_pid; other_pid = korg1212->capture_pid; } else { From patchwork Mon Aug 5 00:36:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817112 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 41BB6C3DA64 for ; Mon, 5 Aug 2024 00:49:26 +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 CF3FF4DF6; Mon, 5 Aug 2024 02:47:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CF3FF4DF6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818878; bh=w51gyK8BRji5NWp78Yy/p3fxZBUPFXZIUKoW9IkJOhY=; 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=srC1yx+/cntVP+CIOY5Pzui8E+N/XT5OJDwp/WPaG1jflh1WRPzHLvepfrcgliynf 1GDEEkt50IYp6rJEo7Lvj+UwzI5R1sw/FqNrT7zOEqN+IpEZJH+cGtQSTaBMRaeYH2 6L6DSwEgPVc+FbaZwjuuskK+UuqhevsqYf36fxvA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 781CDF8971C; Mon, 5 Aug 2024 02:39:23 +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 16C30F897AC; Mon, 5 Aug 2024 02:39:23 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 59065F802DB; Mon, 5 Aug 2024 02:37:04 +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 E7C3AF800BF for ; Mon, 5 Aug 2024 02:37:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E7C3AF800BF 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=AOvPu1lH ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tCREf8kbhVwCgPAK9LZW13RAqfPqbpSt1V+qFokOW4zobSGTgGfzgH7dh8hzLCpyRFjemsHDvxrXNaOojRTIWejZxpmtOexNkd5k5r98m0IVClRY5MJUUth36U0auFtyJauF+Bzfpv2AIf2p7v5n04l1wfJJLbfyEpBrrVir8+BoQPPwUp5U9cZXbJkHiHG/M1IO2T3qOFJ4C9pR0jPx55r6bHfzraz4AF2oy8mAyLcGQmZjeR3I/Re6ss50bkdfEj/01S1W+gJM2u9T+XSA6mSCeSpuZLXrckAelzoZFB3MfGqb3oFGCtkn+ZSBLuec2eblG//tVI8oAnLi5kj3yQ== 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=o6E14dl9bU1XSn2qQdzNIJIGFp605SdCrlh0Wr0lhog=; b=Xo4dPkwkecduGQi/R/E9uqXKwW4mgk0Eyp3HJ5iNsVRdjhoXPm9NZ+cbNqwT56U+gLf7YOufVKPRpOAqn9B/CgByDs8tEi3DQUHf8asfKDqVTaWZP+3xlg9V5aonWgFMcUjK2aWkQFDRBpWZyhEVKMhaoXeg56019H0etCse0rqtd08Fl9cqFMTk1epTxyBodGQtIDvHd2VZih8EEMpGrg/YDVM8FSijRIXGy/4SZZWtsLxaIMoKkWs8JjUGcOaB/vSV9VU1cR+g7Y02UmaZPbnn/wQep9w9p4xMLcMtc3veZ9sZZdWTOlfiNMgY+dYHEdFEzPHrl9R7d4uupfWfUw== 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=o6E14dl9bU1XSn2qQdzNIJIGFp605SdCrlh0Wr0lhog=; b=AOvPu1lHvi65U/38lyWQLhJU+lTNm+BgmkzaYbD/vZOe3iOUbI/8qaZC+15dqyfYRtTD+Io5qOaFZUARF40I8OWUZ9MsHonlHcOH84mL3t0BFGXMemNsnVVTv8WGVoXYDs/f11+PDejosJigXucmOLrrq2jFyJumHnfiNZeG3uQ= 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 TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::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:36:56 +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:36:56 +0000 Message-ID: <8734nj24bc.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 026/113] ALSA: pci: lx6464es: 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:36:56 +0000 X-ClientProxiedBy: TY2PR0101CA0017.apcprd01.prod.exchangelabs.com (2603:1096:404:92::29) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: b929793c-0c93-4216-920b-08dcb4e6b5a5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: tMkKsSb6tHvwFOA+K0EGtFjmOKIhFydnHl9/O/XehUC+NiieJA+A6Vd9ECfBsmyFwXkcUN4jzJ0xoJKLFCVstktw85XZs0ZjxzLKWCLi7vm7wHk9XcMvxMFdQeCeR/QuSKf7x8rrxoOhgHQoTRQ6Q6wHknwHWKBjV1DV23ebjE5shfheKjdjm0S6CcIwjI6NEDx8Qx5YXuZfl2mZTBLQ0bPsqj1gmF4XnsWxvEAATHwCTWHsURcQUTRVBlHg73O1MMJCFWiqIasUr771eK8CXQMBRcdV3uXGy714u90ybKjIct6DS9TnZrU12+8iu4GrDUpIeEu/F61YPWJJLM4oeOLKF6IjjzZs6M4GLizYU4BTfdqx8QCLaPSD+Q+jZTyz+yPfxNRfgVYkQFB9fTm1zq2pjk8XxXT4Lgx9mhrtwHLhmd2AJZKfI1J+PfdeUfBNHX4Ftar3nyN9CV1G02kRBrBp5qBeV5RU7hf7IDH2JUuZsMaDkKNPz/T+bpbBsCN2lwaHF3OGtWd2kR/SSWXZjfb1E+XxBmzj5dZbOFgHUKY78wmCC+F9abLzCSKqrM/gkbM6/fbJoDrnYU/tgdmDb7LfIH4IvdpNLjDyIrJov8XWq6mzOLSXordxRQoSZvZJ2jaTjx98hm2xy1X278PfpbzRzMNbsMRcNeBy24BIdZ2WkLHhHJ1iZA0sQGwn1OZ3HrXvtPD4N0TabRV4r3byG5LzzoPrvPJ6DwzDbu7RTpEjwuvj6uSk29OIrjHR93ANzl8ZBb8m3v2XkrEgmBxZmCQvZEL4g3zgpvUA5Qnql0USaqfesgY5pZ0Kpt4aaJX2WrDp4Kzc+WPonNdt8oqyapKtMBy26sYzjkfy8A/oSqFJWpj1vxsCyD6V4tqdioTkQs9P9iP0w7WHpPGe502pKVAe6UFnYLCqIK1K/0sjPafCRClzDqRoRYVbAsm77KwgMo5UYV/Xg6FsgalOq4Me5iOZydmLfHJqQhzRgS01A/LAc9+IKpfEe0FQuKusJYS0GiI5adt1KaMvXXmAAH7wFrZrBo0s4cxUxPGc22ZJ1Uw9hwuuY1muD/B+DCdnw0Q78WoTMC/34JR7QKYMy8a8ZteQej0LkAp3SVijZ/oTWpOKl2sykJlLdWwlXG56kT6NKCg83El2KGGgMIgJE8xa4MTjYTG2+fV9/f14QsRrzR2qxW7APkoZfqYIL5UpseqSRxfnSaLayi+JbgwF3PslrtDlqyfj9RPMmiCCmxK6Y254W2WURZAnKzwL8boyi11PoLA51/LjJc5iZEKOuYtgDSvVwHTiqYEQrPDZ8x/RhjF76dzWkSwJYmCW6LmEJvtGvhfhOffcARpfxRuR745JHs8KPbbURqUp4OMhyzc6LzAKFoXEl2SFhYviG/dglekG+u6I/qV54GB9vw1Q7TZcew== 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)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KOIu/zavegrQ2uJiisuLVd+Ck6mLDqS6HuormBD7XgDs7MSuJ03HEun9V2hPQZcfQDK7/E1WdiGRjlhuELkeP+vp8OIDbcycaH5l2HSOKe26qTqODaoSMA2oOvym0NhsdDZGf/oHybzvoNIlM4ZzrGISsbazl6mtz2iRryYAZPxWVtlY4rUXTym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0B7bQgyP81TpxmNt2IF5Ovpxo4BLRqciHIfmW5ycs1WjNTwx1WIT6XlVquH1JD46EhcIS2djGLpWW6q/XQp+SIg4L+eZsAa2dtDRZzjfPFpedeBwtjGqIIzKHigCQtzTFi2PWClwpzbHntWrmt07847nUYdSbwBV0hvBi1HKY1DLL12zX15wh6Y3M/UxkgGQO8PrqcHTOesJLlj3lNpqQoXxHcN1O9rCdwNPpvbJ/mutsg6Z8XFhAGkYgoJX7zklL62pV1Xq0iVAYm4RHso+A0ciUgRoP64Z8WvDREbSdLIrh3/PMjUbmN4J0EFPpDyAA86H79GYP9e1N4oV4duzOni4pHpBgK/52FthyKwpZJLtOMfmnwdBQl02NrKwB5ohhHM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: b929793c-0c93-4216-920b-08dcb4e6b5a5 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:36:56.4726 (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: LfEOWjBmavKJVb2p6KpSAVfGvtmaH82E5ZVaFg9rEQ8Z/OcNkG4svjJtY3GY6JC3VoBH1ViiUA0mVDkFkKU0TWQPuDI+AyK4UCRvmvpKyaGoGPFWC8Nr+Lzg4f7ICwyf X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: 6Y2MO3GADLG63ZJ5TPE4ZTLS4SNUDEDL X-Message-ID-Hash: 6Y2MO3GADLG63ZJ5TPE4ZTLS4SNUDEDL 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/pci/lx6464es/lx6464es.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/pci/lx6464es/lx6464es.c b/sound/pci/lx6464es/lx6464es.c index bd9b6148dd6fb..721b4ea3103ac 100644 --- a/sound/pci/lx6464es/lx6464es.c +++ b/sound/pci/lx6464es/lx6464es.c @@ -98,7 +98,7 @@ static int lx_hardware_open(struct lx6464es *chip, int err = 0; struct snd_pcm_runtime *runtime = substream->runtime; int channels = runtime->channels; - int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int is_capture = snd_pcm_is_capture(substream); snd_pcm_uframes_t period_size = runtime->period_size; @@ -124,7 +124,7 @@ static int lx_hardware_start(struct lx6464es *chip, { int err = 0; struct snd_pcm_runtime *runtime = substream->runtime; - int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int is_capture = snd_pcm_is_capture(substream); dev_dbg(chip->card->dev, "setting stream format\n"); err = lx_stream_set_format(chip, runtime, 0, is_capture); @@ -155,7 +155,7 @@ static int lx_hardware_stop(struct lx6464es *chip, struct snd_pcm_substream *substream) { int err = 0; - int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int is_capture = snd_pcm_is_capture(substream); dev_dbg(chip->card->dev, "pausing pipe\n"); err = lx_pipe_pause(chip, 0, is_capture); @@ -186,7 +186,7 @@ static int lx_hardware_close(struct lx6464es *chip, struct snd_pcm_substream *substream) { int err = 0; - int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int is_capture = snd_pcm_is_capture(substream); dev_dbg(chip->card->dev, "releasing pipe\n"); err = lx_pipe_release(chip, 0, is_capture); @@ -268,7 +268,7 @@ static snd_pcm_uframes_t lx_pcm_stream_pointer(struct snd_pcm_substream { struct lx6464es *chip = snd_pcm_substream_chip(substream); snd_pcm_uframes_t pos; - int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int is_capture = snd_pcm_is_capture(substream); struct lx_stream *lx_stream = is_capture ? &chip->capture_stream : &chip->playback_stream; @@ -287,7 +287,7 @@ static int lx_pcm_prepare(struct snd_pcm_substream *substream) { struct lx6464es *chip = snd_pcm_substream_chip(substream); int err = 0; - const int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + const int is_capture = snd_pcm_is_capture(substream); dev_dbg(chip->card->dev, "->lx_pcm_prepare\n"); @@ -370,7 +370,7 @@ static int lx_pcm_hw_free(struct snd_pcm_substream *substream) { struct lx6464es *chip = snd_pcm_substream_chip(substream); int err = 0; - int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int is_capture = snd_pcm_is_capture(substream); dev_dbg(chip->card->dev, "->lx_pcm_hw_free\n"); mutex_lock(&chip->setup_mutex); @@ -515,7 +515,7 @@ static int lx_pcm_trigger_dispatch(struct lx6464es *chip, static int lx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) { struct lx6464es *chip = snd_pcm_substream_chip(substream); - const int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + const int is_capture = snd_pcm_is_capture(substream); struct lx_stream *stream = is_capture ? &chip->capture_stream : &chip->playback_stream; From patchwork Mon Aug 5 00:37:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816795 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 09996C3DA7F for ; Mon, 5 Aug 2024 00:48:20 +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 CD3D435D1; Mon, 5 Aug 2024 02:46:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CD3D435D1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818807; bh=CaYz35U0BrwmCo0iOY5skcYXkbmMfwDHib/aBG/5a3E=; 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=D3JqgwsQ559XmpnpfDDPiMw+0uSYrM/VhJh4mBFTAu9RZpCcv5lUFf+4XLiBL8t3P 4bFqszuqLCop5ZLgDLPSMpAszumEMT1dD1gCfY6U26GTIPZ/+ThPooX7GggVpKuwBa YLdtZLCD8fWEjaTvJdPuGx9g8oy1ESinCO+kvOe0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id EAB00F897E5; Mon, 5 Aug 2024 02:39:24 +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 25D8FF897F0; Mon, 5 Aug 2024 02:39:24 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A94D3F802DB; Mon, 5 Aug 2024 02:37:07 +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 DF612F800B0 for ; Mon, 5 Aug 2024 02:37:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DF612F800B0 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=kM70r7qo ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CJDfgdsgD7IPtAApQwBHjJFfaBBcNbp71Dmf7x8uWXO44mth1DhM/53glToQ9V2AdSuB1YP1P+S7oHvKb2cIz406JaPjUTiDQVpeJR3Ea2qkX9iqgOJPXFIjso7BpHruk6TOKz+XARYJ/YilxvymtSY0NIalt8shnyB8Ql08NexWK2rBg4Xae7DhRWH5IFq5gDqa4rJ4lrTVEw14sL8vAU93G4CVGydT4yswJxRJb4sAcPGQiQMUcBlVjd88V89cMf6iZSS20RPMzQTdbwsuKJ+na9RsvGcTABMCsmiXOH+79539DJx2zrloHzRb1Z8UoY5jC8AIuEWRGRQ1Q6+7Cw== 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=j5aejhi9EUF5c3ufjhP9ssq/Ihfsj+f/SlWVNf6wNVA=; b=j29dIbrpwuamE/MrCy0SxLUok64Cxy7luLCL16SUphleCtW7BABpmGOmMla8P+bHe9xfbDyzXe4Ut3tYh5WUTxbZSmGKI1XmQ/hmrw9N03Lk+/87Kj3I/M/IPg6adkRh77SwfWLcWVUXCogi85ooZLTTRFZ1sMBWCWjDCDlM3uf3tuv725wHdRwpjvayUnsGn5sAkZ6tIKOreRW3HFEaZS5BlUb0WIDtr0k6vLMpMae3Q8g+1XUOe8R5zr8PhFcAEsohkzfq42JEdTgW7RLdUWkCK7UJ6IlVl2tKU1v0yvzry6gOQnrykDHFkGU/gMUfKttuUx351XYJiJNjTOZUpA== 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=j5aejhi9EUF5c3ufjhP9ssq/Ihfsj+f/SlWVNf6wNVA=; b=kM70r7qoOR2xJTIfQcONaITaDv3A1jKrHAv1zrtfRcBdXXEII54zgZn9YypE7HojwGU+TBHS8yBotVIpodOOEBrhYLKVDRv4OplRdDyhJd8hCSTQu31kJONAcu+oJ1bfOayz6/W7ZfLRevILdUQpZShbVlba/7NEMDPT/feDubE= 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 TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::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:37:01 +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:37:01 +0000 Message-ID: <871q3324b6.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 027/113] ALSA: pci: 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:37:01 +0000 X-ClientProxiedBy: TYCP286CA0243.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:456::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_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: 1bb0c2cb-e5eb-498b-c9da-08dcb4e6b8c9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: u93rzA8ZTF9hDvGeZahsw6NjeGg/eRvSX/Zrox9SxzEsEbwYhBqcnv6Jo4pNbBoo4b/1l+L89bxF1RvHYxW8GCV1VFMPKK6HxImvl40k+LI1NAaXxwPPfoAFpbtUUqi5pDA6Iryb+xEy79yVgiwQwC+gg92xdAgX/ARcJEhx6//MiaGT/LuHx0hWs1xbXV0EEtywO7VTmBbnvjFbqRPRcCJeAmRXLIFuwCB+L4orK9QrOzgP59VF7ECaXwZBvA6HH5JvNXwX6aDsTcd8S5rWaQDgY5o//QmM7bDjoLko2qHiuorBgvMe7md0VAcV/rbbeZ+1R7kDOf8Ye1SSr7Ttl/XfAADSRNAb+N7dk8+zA1xW3sS6JiqzopWVFuTmGK1eCodzTxPugt/klUHLXbgXuDuPtpjjM1Ya1/3oIToesXDLfbvLopqbd9/fKyK0Ir/oX1kH3d6G7tbFlei17lAR6slFJdHF0pqOZlod17lKI49IOi720g82ek9kaEfTb8azf7IvQzKOTTzCcYaMGxer+ML4TOcfUhHrxJ4yJocUmBuAS6rzsNeGrssLo0Gs0VTFiNAxzDNehjtSNHypEYMp55lQW5AOSAHOxUpJfioIwmKB0xZBPBGIzBW+1bt+b3slufB2fJp917B+pDgPBhj08vQnW94ar/BRG3jPF4mheUonK11fv6C6S2qcWiLoWvX09aDrt8RHRTcVnRL4AHw0G2Kk5xk33F4UmYQL4TfnXKwq+WFaHC/us9KMm+ca8wEDsoMjf95tV7wPmCajSdEO07Ois+KncplSc+T1zSZhHUPedD/0iyOh/k+xr6QgOX1Yg/foVbcxYy60vCenwFBAFsDC487GFNgk2F4Nu0RKdupfVuU3y6nSB/6M2C1FqCwsjg94czYlz5+8kNE/398yDVHj/UT8H8qIr0sGNfdSjiOSFLqWBTrzVYZRLHEDPEe1uyNK3FvmxRjeGb0ErW/Lox8VLntQENHIOKXBBSYW4sIRsk2tlmkhaTTCyQgM5LIsWESUAPBxKJNsRbCcXyuttGdY0ARsGQG6lh9gobwiI9u7SQ9qtjWx5XhNxWlLsjNARJVYO8kk3azmTmqwam8RY35CTgjFP8wawPk0AI9u3S0noRwvHWASytflSqv+lwLrOhGnMOFdbOpMujfKp6jn5lHNwsosCc02LkWcBwNveNaL26v3Bu8iW3HgXv4DOo/vE8+mxO/Od7qISLN69fRZBggWAhIiN8GThsyovAlLU5LPEfoO/rpOJsFXU8dnIF5Sk5CV1UuMLU1q4kusVjLTCo6/Pbd8vKg7YvZX8KQlx2IvQe8XIEMTL0jlnmkHptE7Gr9So0RPDyoWxQwyGIfc4yhP5FJsCta0Zr53sCKfugbB4FKro9UXq9pmC9z+iRV3D05gR8QERFkGReownW/h+Q== 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)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7kGw2WNobXcRY57KUbfRe2cWskazxEqm/5KQ/GVfn15xTKLYa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cjXG+/pkIBoPjDo+ZjWaBgopwxzeOXtiE6nuySLHJwvIC8KcqafDif1p+PpluCh23gzQoA3/02Xm2LtzwAPSWOuaeDOwDUYqmbA1Cao48Qe16tIxzwolid92Nk7EGFoppyD82KmWVNc8oLY7zM/Y1dbruhcrF6QfAytdU1aSpW9b9G+bZLBTLu7qBDJh0ncCmWiahDqyLgrFlB7rIkfuNnozWnkXknhx0aIL9ybQS6V1dXfZ4I0bOnT52SPqAiFNAT+4DRq0Tet+tjcz78McDabP+xQWCmYlkP0WrRWS1YYd1wf1YecP72bWwuQlZnq3Esx1G/DIp5GiF7oH0Q83MlsWCrk6G9VtQQRjCngTEKyAVuIHM1GG3wSFVwA+8uciqn119Gp/YEmsFsIlF6aa1tFL0bQcQHB33Ae92jM3Qsy/pwEVqPYmxJ4U+aHmVnxRq0KMWMGscvNr/dVsyDEZX0DnE5CIwFxiwFcaRwkypYDo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1bb0c2cb-e5eb-498b-c9da-08dcb4e6b8c9 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:37:01.7843 (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: O9gFd7BwIlUyUQgE0gPF+ZY8YOx26STLS790Ho5MF1ZwzdbqZ5K+J7/GVl/+EcwOp0PXeWOwhoFUvv/1oVQYlNF2eqjGqYfbImfN2q19n4DlGFCGtU/GAkvzf5cQRryy X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: KOFO24OIL6QYYIAB4IIRQWY6C32FSSOA X-Message-ID-Hash: KOFO24OIL6QYYIAB4IIRQWY6C32FSSOA 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/pci/intel8x0.c | 2 +- sound/pci/maestro3.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index dae3e15ba534d..d9a6a9477bccc 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -838,7 +838,7 @@ static int snd_intel8x0_ali_trigger(struct snd_pcm_substream *substream, int cmd fallthrough; case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* clear FIFO for synchronization of channels */ fifo = igetdword(chip, fiforeg[ichdev->ali_slot / 4]); fifo &= ~(0xff << (ichdev->ali_slot % 4)); diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c index f4d211970d7ec..28634b2d8e5bd 100644 --- a/sound/pci/maestro3.c +++ b/sound/pci/maestro3.c @@ -1130,7 +1130,7 @@ snd_m3_pcm_setup1(struct snd_m3 *chip, struct m3_dma *s, struct snd_pcm_substrea int dsp_in_size, dsp_out_size, dsp_in_buffer, dsp_out_buffer; struct snd_pcm_runtime *runtime = subs->runtime; - if (subs->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(subs)) { dsp_in_size = MINISRC_IN_BUFFER_SIZE - (0x20 * 2); dsp_out_size = MINISRC_OUT_BUFFER_SIZE - (0x20 * 2); } else { @@ -1416,7 +1416,7 @@ snd_m3_pcm_prepare(struct snd_pcm_substream *subs) snd_m3_pcm_setup1(chip, s, subs); - if (subs->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(subs)) snd_m3_playback_setup(chip, s, subs); else snd_m3_capture_setup(chip, s, subs); @@ -1724,7 +1724,7 @@ snd_m3_substream_open(struct snd_m3 *chip, struct snd_pcm_substream *subs) s->substream = subs; /* set list owners */ - if (subs->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(subs)) { s->index_list[0] = &chip->mixer_list; } else s->index_list[0] = &chip->adc1_list; From patchwork Mon Aug 5 00:37: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: 816794 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 EEF03C3DA64 for ; Mon, 5 Aug 2024 00:48:55 +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 BB5414912; Mon, 5 Aug 2024 02:47:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BB5414912 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818846; bh=BYeiGQPqg8A1Pf2Fd1CwSq/SeOOJX2AcQtG/jlKbp/U=; 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=FmK5cPSK6698v9SBYJvhjwcxHpm/n0qohnwob1sLdnOFpoY2NPAOEc9YCVcNK7phr HIqUhktKUnaH8Q9jpDNDu4I5E2O7dC/LCRN1bXgXE/fSQZNxhtBKczGPdUGkiQ37gH 5JUv8CITEVeQtP1rDVJ9hOMq9CDw9Wajkg/zuueI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id BE658F897EE; Mon, 5 Aug 2024 02:39:26 +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 F2758F89803; Mon, 5 Aug 2024 02:39:25 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4C425F802DB; Mon, 5 Aug 2024 02:37:13 +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 3DF46F800BF for ; Mon, 5 Aug 2024 02:37:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3DF46F800BF 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=hn8l9NhV ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=O0AWWJWUBzQmJhWr1tG8QvOuKSvJnoBGFWRofZR9ipplSr+uSkj+2vUFXyK22l/nDpOCXPi5et460O9/bMmMzqjL8TSZ9cv+fAjS2zBV73frCoV9VkScPZyXAQNLLEPzPwlwH8yFBYm5F+6JgKJfhxJhhmjaPwNsUPCJjdpRm1qSQDpy2+YUqNQ80lNYKf0rmWnBkTQMw7aFPWyRzZKlJgiRqIyyizMaMB0RBeJxgI9sQj5EJKK4VCqolkMOC44cXH7hK/cGk1M0aXljo7yL5vdDNEf03qytyQTUGLsuIbeEOmQHZP9E7l/Wshy5l3xuGZLVF7yv+srUwtIU5nMWNw== 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=7H9u624bX6d2+JJGw1QV70upFuFqYwjbDQqa5wQRO8w=; b=SiipmnsytoR3JOsznP+ZdKIj9S/XskEhpME6CV9v84ETSh9ujQ2dBJ8j45FEGvfyk4dI44ZAUehg7vlxQHVVpm6kMs2CEybY3uDQ9zuuaQBKBjnt3++nrOLqhM6rUV2MyJ74X5E9KVxlnlqWZmBip/3RF3VWml7dRqhXc734SLZNLpjCWhGje59aDBmeeibJvdTo6Q5zeYqkkO75N4KlKceKL/5Jywf0qSPi8x0B+vt0+lAs7wVq9VpOTO/lttBjlXUCYvAgHtrBN7y9fdCJpfTK4/zgX3W2zu92bpYeJjkbscNnFEHsNxAZ5MSNKPRD1fgIJtZMdLYJGvhBCjIVuA== 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=7H9u624bX6d2+JJGw1QV70upFuFqYwjbDQqa5wQRO8w=; b=hn8l9NhV9sKRdHwZ8iX3g0/PSPVDoFds3Y0pygPqF+Jy9S7+XZrtXeJzqSWcRxuyQfA33CklbM2qHoDQW/w+wHBmok7vP3yIYNajnWDMjynPKoqWOlTAPSWqMPMa+6+nKl+kLTbZbppDTA4dJZl8pSatrGXNq77hBUrGpVY1wQM= 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 TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::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:37: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:37:07 +0000 Message-ID: <87zfprztxp.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 028/113] ALSA: ppc: 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:37:06 +0000 X-ClientProxiedBy: TYCPR01CA0195.jpnprd01.prod.outlook.com (2603:1096:400:2b0::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_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: f18d231b-9bd6-4fef-b701-08dcb4e6bbe6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Micro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BWdUsZ5dmPg8qfub8XrLd3CqPEzi2TawNeJ1jG9rH/14GQbTq3f1soSqJSP9yPxMl3tGRaiQtYhtP8aHwuIR6tJ7D9Y1DnQsboQecScVN9RZaLg8hZ5AzNe2J606yn9OM9dJrCbf202VWN+vC2BfFE2ckmX4p6K1qaRN7LYwLuhw0eQRlCOO0YAcBDfon1sC2VhYXarv1m+5g1gXcbZPdkIGGd+NBjY/C9+73W2JTrA23y08LGB60+IvN21z/eOycZrw90u6ulRH62CMPIjgY0xTYQchBhplv0nJkin6hc2/qvQcDavurymZj/TOowvkmbCB04Fk11q/v+AuAAmEcP12z1lQ6A== 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)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: beHv4ea38EoxN6qkbYhMGJPr4hpckJaVV07pR3h8PmelwaHNiNbojFWIiSE7miKv6JTTr7rrhExqSiDI/855qBZLXD2EkZOLzsN3Kd7OBb/eb7rZ81tDTlya3GyBdJoBLACXIE/YbVpQF1DLTi6obOhA/FzSb6o85Qk5JF5AAFhYTteXdCeihsD1FvjhF+zstg6ok1Fb3S9b0+z61LPd80vF2EagVHVF5QpI7WE6Gg5WuJ4ZjUu4uj68viv7BqkcFfJ66EiD7p8+mjSriNgANYMmHLeY5QF7zf6SilKKDsb6ZDZliC7mIDtNhHPHXEXpdnbQYoSD3O1KAl7syIJtJNnrqG7ecdMnBmnjo686XvRPVEm5m4ntJMh7L3vyqZpb9iCbb3VRhqtrj2l5MQt66g0/3L1j26TmBiJ6UVxUUMKxsarB6LzxgpOOhAVfw8zpdRbkt04cLvXQJFySfqWS2JP67GZXwoaXqAT5+x8PEfSCbr34a6wMTlBhby1iplCh+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PFvwBzO1EmPvGDBeTNl2DzLIHfe3ZBd2tepfo8LZ7Lx50= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: f18d231b-9bd6-4fef-b701-08dcb4e6bbe6 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:37:07.5328 (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: dzeARkYb4JWgWnyxqE98ie97TErHCCtdOg0F4XXm84SLJXSufc33gGv8m+Mhv0TzlZ5NH0QRdwYvyIMiDUogDDJaju6h7njoI0TAPgwdmUxRHvdmDqt+ex+SjV6mWALA X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: PGNM6ENT65NC5F7PX4UGGUQFRSMZAIJL X-Message-ID-Hash: PGNM6ENT65NC5F7PX4UGGUQFRSMZAIJL 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/ppc/pmac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index 84058bbf9d127..168c1e2535faf 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c @@ -103,7 +103,7 @@ unsigned int snd_pmac_rate_index(struct snd_pmac *chip, struct pmac_stream *rec, */ static inline int another_stream(int stream) { - return (stream == SNDRV_PCM_STREAM_PLAYBACK) ? + return snd_pcm_is_playback(stream) ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK; } @@ -251,7 +251,7 @@ static int snd_pmac_pcm_trigger(struct snd_pmac *chip, struct pmac_stream *rec, case SNDRV_PCM_TRIGGER_RESUME: if (rec->running) return -EBUSY; - command = (subs->stream == SNDRV_PCM_STREAM_PLAYBACK ? + command = (snd_pcm_is_playback(subs) ? OUTPUT_MORE : INPUT_MORE) + INTR_ALWAYS; spin_lock(&chip->reg_lock); snd_pmac_beep_stop(chip); From patchwork Mon Aug 5 00:37:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816798 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 D4E17C3DA64 for ; Mon, 5 Aug 2024 00:46:43 +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 A59884CBB; Mon, 5 Aug 2024 02:45:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A59884CBB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818734; bh=M1Aa293H281GOk1E3YLu379G+myrg67Q10m6OI4Y4Iw=; 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=oZaY6lD+/Rjwozx9/oTl8afBX8ItjO5QknKLhdyRv4uWnUu4ia53+cXW+AMSf1yCb Vd72oRvDcWj/obnsZeEj5T4OPcyGJ/pRWKxEcBxFFFzeZn56yqLFMf+vkN9f2CvtIx nC1XhnnpklMJYlLsoy+e9DeO0qyFxSTksuX/P9BM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8AA32F89733; Mon, 5 Aug 2024 02:39:27 +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 95D25F80C95; Mon, 5 Aug 2024 02:39:27 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2976CF802DB; Mon, 5 Aug 2024 02:37:21 +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 B8261F800B0 for ; Mon, 5 Aug 2024 02:37:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B8261F800B0 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=g5wIKwcr ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aZFsUazANDMXfVKVzOH4jKy2QJ4vwihgwLzWRGsGLZUIrRyVs0r5nuRtvaf6mtK3YyifiXhy1VqSFBFIL0cuGnygpYRGHdzqQnU6tiVz3ItEWSmayYZC/BV61D4ZW4T41c/ZcrnkvT4XTw7vsiJG6SuUMnpuw2llokMXISUFArmLbkkAXtXnOUax5V4W3M2ker4uY48tL9ziQNfev2huEUl4CiWvTT1yHaEWto6hwwV0RosP0zwaRztltU74CPSgs0No2uoWhBOXL0OH1hUTfJ1SBNmoi9HAJx74ASU7X6wFoCM9bL2ZVw21/sljdu6M5mKLLMdNpOu7eEqko6b5mA== 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=Sw4Syn7tMEI16fc+eE7GoMZvdS+tChLGFNwG5VAeIAQ=; b=lFivKm432Mpj5R2Aip+v8MCJJEIyQlF4ckYblcZ3BhagHwOd7YO5ZIJw4f8Ae9pHXDeC/u5l+mTHSxqSdiCKjZSn/YQiCyJrXzRwvh/8CLTlUCe4zfmzSEidZs5DgNnIh089w4D0/gOUT8bqNgEeM8a4DvZ79KpnGZm3J2nbfDdLNK8jmJpUpzAOK4i67B73pTcFkt7J/H6R3rWYFOoa+kkvwIEVqR9d+u/IrkOJ+pr48tbhiBK5HtcmqKYiT/rGQuvt0yuZaBNzE+Qme43qaacctjSHCgF0etzC/T2EWXu6CNTct91XCgPZuLZHHsSAFszRPRQ6Wof8gv+ujRXO8A== 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=Sw4Syn7tMEI16fc+eE7GoMZvdS+tChLGFNwG5VAeIAQ=; b=g5wIKwcrjpfP9QJoU6IgH602wnRvM8ARnnifSeQVSNSGastBn0fiZiE3HZTrJsB8DisqYk27H+3yeoVAEowEdFjJ6j0x5DLylwSKis2H57GXB461pn94wBPZmFYpog/pyMGdr9KyVoizFKR4zrio21qKNQ4ytTw3M0DfggE+9KQ= 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 TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::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:37:15 +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:37:15 +0000 Message-ID: <87y15bztxi.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 029/113] ALSA: mips: 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:37:14 +0000 X-ClientProxiedBy: TYCP286CA0277.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c9::7) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: cb6fed99-7014-454f-20c5-08dcb4e6c092 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13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ynixwL6tVAnSLIT5YxLqt9cQy8O/clVKaTxce9yO14nnVQnwSp77GlBgHWPEI7d8fm7wQkh4mN8Q2UKYM/blnVpnZSvCzdxqPm/xHDLp+6gHR+mi/InDrHdCJj13tt34QLHBO61pWn5tSYEQvQnkdFnl2gT+CnEKZ+TxxLGjYT/f8MbrsT2z5DPvYJGUMduBKRbqrNzyHSLcOspy9UEOvyyi0t9SIjNjNJLSDS3qJgLSSvcinL+CUP9xvCT2z13Jy8yG75S0Po6TSmsibjEZPB3Zt9lJnNFch440yc+P63YSos9D5aposB5dcxp0CC1q81vuxWXZVE6F/r1EP125HrL3Fe1tG+PYZOe75J2E6OFbHTzm+4UCKslCYq9yvV5rRYEgvyFew== 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)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yVzfyB9pf8IkB6YpfOyxVBBpQ83cDOUj+j0SmINJLWp75xC7/F/rUNXMQTdBX7OCQrfavhzh9R2aqae7RxjUDETcXr3SzXCyXuFQVRG2wT1B7WLX4tfwWj9w4fODUys9N89uDCVGmwXnyWxqzWlyfEzfNmzuqD3fX1nLTVyIpWrq6dp6m1or3pGrNbm/Z2FmmWwDxv6dfdt/ugc4r7SOS3Alu/XNBF5i9Dw/+kFhSoDHCHlWoCAlgT5XQZsWPQ57K40E8pCoZs+z1gzx5fTCA6q0P4s9znF0qZ9TMysUWELT+w9I7bt8TGXCkwIkVsk/oVDBZS6ovTvBROw7kssRUre+ZirY9+hgHx+SmD9IDg8viFTbeTkcoEAFCG+PadJ2V5d6kdbTc87d3tyzgQ8/F3Ys/BhFv9ZlM2ziLfVIb/ZGjSRlgxQPnslNR3gfbBFnkU2orh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u082S7TwcCUEFvZXaoyh7sH5dJ0djy6A2bVdDyANaRIhLO4+PSk7Cg91pU9iKamMuQcLpuR9m3zRFwRKzNSoaF80W4VeJ8hNe+4mYBRtA5Edw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb6fed99-7014-454f-20c5-08dcb4e6c092 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:37:14.8075 (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: DG9SC2iSPAi3iQXr7LsCXpstusoc8yfF725NlfwJpNZhYZO77cckT/H+i/D8WkC7gxtu+xtIwBMvz+KXvHTlDJ6W3ALBfWZz4wYmvNZS5CW08EJ1RLpLBoxYW4Lq7sjT X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: XZVZIIBI4KAHQD2FZZS4QROOJGYVQ6J4 X-Message-ID-Hash: XZVZIIBI4KAHQD2FZZS4QROOJGYVQ6J4 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/mips/sgio2audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c index a8551ccdd1bf8..a16f63f21dd18 100644 --- a/sound/mips/sgio2audio.c +++ b/sound/mips/sgio2audio.c @@ -447,7 +447,7 @@ static int snd_sgio2audio_dma_start(struct snd_pcm_substream *substream) udelay(10); writeq(0, &mace->perif.audio.chan[ch].control); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* push a full buffer */ snd_sgio2audio_dma_push_frag(chip, ch, CHANNEL_RING_SIZE - 32); } From patchwork Mon Aug 5 00:37:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816799 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 DFE57C3DA7F for ; Mon, 5 Aug 2024 00:46:10 +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 DF8C44C7F; Mon, 5 Aug 2024 02:44:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DF8C44C7F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818705; bh=nu9nZCnytCGQ3zFB+ND7OAfvLYFH/QXRJco+DbjfDc4=; 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=Xa0gDaRqQo1cxMqazRUn6b7NTvI0M0HtmwZaOxZRt0Y3Z2Po0zi8ilNoTSdaIkGJg zpopCYmvE87pvV5/lmk/EROtRiL9kwy2SZvOQuKrqQep9RkkXhv5brHfIlMcDy1w2m Tr5XmVrjEqUMmzLEDAosvFzgrPZUxSqt0kFcLMPI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A2132F8984F; Mon, 5 Aug 2024 02:39:29 +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 F3182F89834; Mon, 5 Aug 2024 02:39:28 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8F6A8F800BF; Mon, 5 Aug 2024 02:37:34 +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 88D35F800BF for ; Mon, 5 Aug 2024 02:37:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 88D35F800BF 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=gmeQJAee ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vSNjL3Me8cJKnlzQ2VFN6ASsrcE3XzS9hUis2BkuoCpRyw5aG67uAdlBwWCZQ9CO+bg+Frmy5bJxRjYJi04I4lg3XL6JMob0/ZF/XhTnM9NXGg9B1rRmmjZxa3RBhNtjSCvcCbYQJurBwPOe8UULN9nB0+R3IpsPWe4btosllxzEWde+6vwae78yxPPgGwPnJZoDQU9y/nYFR/WMj1d+z0HtjWwR6U7FPZOHQwMxPU9MOJ4yVEh/FS1WAZj+kE5D0KmRz4VDlKWzSRis2I4tk7KZLKyiBPxzgql6wkLdwfi7Vx5jsdPYJnsMhu9a9WeCuIM5b00h7QttHe//Bj/OPQ== 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=0LiorM7f5Ed/k2NXaSx6d0E558k24LxH7cojmjiBMkE=; b=Au/JXKOtka1TcpJNP2OZ4R3sfwOGdXBPtyuzRD6CPqUCholwfXimxEde+Bw+mL2qOxwEmCdIbiDNg+W13GsMgZNQK/gWEfeqs8khtoH2N1hfMwpQ+BdzkDhN1w3mH7F9vh03ZlluC7YrKVoJNGfYuX6K86cgNJrekFJMlKa+FCFPYEVob0ISAYGbwyWwgIFHzOsuQ/kR1qLBrqohm/13cVaCYq+PQLAXwO6F3PTrZAx8B/t0Opgkh9eiREDhN+gc4QVjQUoeW2LB25JsQ2oON06hjJyVHsFU7YgJrYTeNrh8Tom3bnRprSGip83K0uqYaD8oQ0It/oOmm1svrl8goQ== 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=0LiorM7f5Ed/k2NXaSx6d0E558k24LxH7cojmjiBMkE=; b=gmeQJAeeovyjI/PTiCKUyGkjRfurmK7Bo8WGpn+AqrwZ4dfdFRh1ugLdaAvZTwrTDG3eCqX9e1Ae986mz1Fgw3QHQwRadvV5MShCyNbMPP15rcslwD0hzyWo4ySU9K1d4UUQ8RZ0t/u/DvSK7XdmSy4p0Uc06XOu4kBfgJSF1xE= 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 TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::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:37: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:37:23 +0000 Message-ID: <87wmkvztx8.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 030/113] ALSA: core: 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:37:23 +0000 X-ClientProxiedBy: TYCP286CA0137.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31b::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_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: cc53b765-5c6d-447d-9066-08dcb4e6c5ef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: aCiTYSEnTbojOJVUBzXDPUXRc0tQJVDwGWPc9HyBRXCJiqZGsD5mHtRlgqra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RNaQZLbTLpJxs1Hl8ZebzdVRXFip3Qga1IKK0XJEs9HWgIHctz2pw7CNk3lzjdXOjnj35XINnrV1ID1utjQr9YMlvTQOy4vpKKd2wI7CfyudKpBzV+/AX8K+1kHyK0lobzyfBpTYWx48ybmlZV+9wmNqCr0SXQ2jwJ8uA7nmXF2N/BRFGzrbXRu2v+hu4YE3xjgqRD7D05j1bMZN8DHV3D5zTUgDqPsV2AUcEGXqttBPMLQ/CsywpdpVRP3N7cckwevtiI2ZpErJNkZpkxEdQ5BUg5oo5hZ4eVTld1g0E8dIQ== 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)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 78ipTg3jJ3KSBMZMeWrPPhJUSFrmJeh5aWP31XrS03tW/77LWg2OwokmDQ4bPSz44fgGibFq967K4p+593g1EKvHMEj8h4+CxGUHS9YVwRTz6ynOVN1ahJD9xE4yAdjEGtvELGNLumGax01iIsqi/74+d0mP4hKj+EE8jRTHTFbCTugbOAQykcxt9DTkg4B3EoZAf/dkkRbctM84ujxbMetG0CCzpQYt9i4f+vdbM0aL0BJIBtwks9j+qpjpPUIfNtJ7Vk2ilqv+3ijYjd53CIZhLrYBnh6qyzR043ObZIf48RKe1lcDAhyAOwjdnk5dHed3D8ufUlPTYuZaqNRxWjpXSn2Np20On2rsz/OahXgG0JvDtDm60hn6B/2/jIgfB1SMk4AdjBEMN36TcTr5/0/Sy3GVDDcwOS9tb+Dif5MMqOb0KDam3DIcysmJ7ucBIllCCvmaKN4+/GxF3evU1I5nqKnl4HuvMjcxFHibFWS0Gh0vBYvJEHZqzquAFE6Y+tfNvn6xFZk3/d7JLXKpGusEGbP1phypi3U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RyKm68J9E= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc53b765-5c6d-447d-9066-08dcb4e6c5ef 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:37:23.7358 (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: bKlUJCE/6o+t1xA2Bmt2r8eA7rUhEiqNdCjhStLwHtP+F/DWt67AyS1i5uKm8wKZ2fCp4F7ho0OQ8JldYINXTL/0zDLPtCl6s9uYDXA/5qAu46BuQmBJwhblMev6qphR X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: O4D75LUFPUGB6KECXBKO6B7SML22CVLG X-Message-ID-Hash: O4D75LUFPUGB6KECXBKO6B7SML22CVLG 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/core/pcm.c | 8 ++++---- sound/core/pcm_compat.c | 4 ++-- sound/core/pcm_dmaengine.c | 6 +++--- sound/core/pcm_lib.c | 14 +++++++------- sound/core/pcm_local.h | 4 ++-- sound/core/pcm_memory.c | 2 +- sound/core/pcm_native.c | 30 +++++++++++++++--------------- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/sound/core/pcm.c b/sound/core/pcm.c index dc37f3508dc7a..fdbfb13e4d18f 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c @@ -497,7 +497,7 @@ static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr) char name[16]; sprintf(name, "pcm%i%c", pcm->device, - pstr->stream == SNDRV_PCM_STREAM_PLAYBACK ? 'p' : 'c'); + snd_pcm_is_playback(pstr->stream) ? 'p' : 'c'); entry = snd_info_create_card_entry(pcm->card, name, pcm->card->proc_root); if (!entry) @@ -642,7 +642,7 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count) if (err < 0) return err; dev_set_name(pstr->dev, "pcmC%iD%i%c", pcm->card->number, pcm->device, - stream == SNDRV_PCM_STREAM_PLAYBACK ? 'p' : 'c'); + snd_pcm_is_playback(stream) ? 'p' : 'c'); pstr->dev->groups = pcm_dev_attr_groups; pstr->dev->type = &pcm_dev_type; dev_set_drvdata(pstr->dev, pstr); @@ -884,8 +884,8 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream, if (snd_BUG_ON(!pcm || !rsubstream)) return -ENXIO; - if (snd_BUG_ON(stream != SNDRV_PCM_STREAM_PLAYBACK && - stream != SNDRV_PCM_STREAM_CAPTURE)) + if (snd_BUG_ON(!snd_pcm_is_playback(stream) && + !snd_pcm_is_capture(stream))) return -EINVAL; *rsubstream = NULL; pstr = &pcm->streams[stream]; diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c index a42ec7f5a1daf..47fbbbdb5a8c7 100644 --- a/sound/core/pcm_compat.c +++ b/sound/core/pcm_compat.c @@ -300,7 +300,7 @@ static int snd_pcm_ioctl_xferi_compat(struct snd_pcm_substream *substream, get_user(frames, &data32->frames)) return -EFAULT; - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) err = snd_pcm_lib_write(substream, compat_ptr(buf), frames); else err = snd_pcm_lib_read(substream, compat_ptr(buf), frames); @@ -359,7 +359,7 @@ static int snd_pcm_ioctl_xfern_compat(struct snd_pcm_substream *substream, bufs[i] = compat_ptr(ptr); bufptr++; } - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) err = snd_pcm_lib_writev(substream, bufs, frames); else err = snd_pcm_lib_readv(substream, bufs, frames); diff --git a/sound/core/pcm_dmaengine.c b/sound/core/pcm_dmaengine.c index b134a51b3fd58..30db37652038f 100644 --- a/sound/core/pcm_dmaengine.c +++ b/sound/core/pcm_dmaengine.c @@ -72,7 +72,7 @@ int snd_hwparams_to_dma_slave_config(const struct snd_pcm_substream *substream, else buswidth = DMA_SLAVE_BUSWIDTH_8_BYTES; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { slave_config->direction = DMA_MEM_TO_DEV; slave_config->dst_addr_width = buswidth; } else { @@ -108,7 +108,7 @@ void snd_dmaengine_pcm_set_config_from_dai_data( const struct snd_dmaengine_dai_dma_data *dma_data, struct dma_slave_config *slave_config) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { slave_config->dst_addr = dma_data->addr; slave_config->dst_maxburst = dma_data->maxburst; if (dma_data->flags & SND_DMAENGINE_PCM_DAI_FLAG_PACK) @@ -444,7 +444,7 @@ int snd_dmaengine_pcm_refine_runtime_hwparams( if (dma_caps.residue_granularity <= DMA_RESIDUE_GRANULARITY_SEGMENT) hw->info |= SNDRV_PCM_INFO_BATCH; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) addr_widths = dma_caps.dst_addr_widths; else addr_widths = dma_caps.src_addr_widths; diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 6e7905749c4a3..34f45deaf493b 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -253,7 +253,7 @@ static void update_audio_tstamp(struct snd_pcm_substream *substream, audio_frames = runtime->hw_ptr_wrap + runtime->status->hw_ptr; if (runtime->audio_tstamp_config.report_delay) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) audio_frames -= runtime->delay; else audio_frames += runtime->delay; @@ -464,7 +464,7 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream, return 0; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && runtime->silence_size > 0) snd_pcm_playback_silence(substream, new_hw_ptr); @@ -1947,7 +1947,7 @@ static int wait_for_avail(struct snd_pcm_substream *substream, snd_pcm_uframes_t *availp) { struct snd_pcm_runtime *runtime = substream->runtime; - int is_playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + int is_playback = snd_pcm_is_playback(substream); wait_queue_entry_t wait; int err = 0; snd_pcm_uframes_t avail = 0; @@ -2069,7 +2069,7 @@ static int fill_silence(struct snd_pcm_substream *substream, int channel, { struct snd_pcm_runtime *runtime = substream->runtime; - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return 0; if (substream->ops->fill_silence) return substream->ops->fill_silence(substream, channel, @@ -2100,7 +2100,7 @@ static int do_transfer(struct snd_pcm_substream *substream, int c, struct iov_iter iter; int err, type; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) type = ITER_SOURCE; else type = ITER_DEST; @@ -2283,7 +2283,7 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream, if (err < 0) return err; - is_playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + is_playback = snd_pcm_is_playback(substream); if (interleaved) { if (runtime->access != SNDRV_PCM_ACCESS_RW_INTERLEAVED && runtime->channels > 1) @@ -2605,7 +2605,7 @@ int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream, info->stream = stream; info->chmap = chmap; info->max_channels = max_channels; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) knew.name = "Playback Channel Map"; else knew.name = "Capture Channel Map"; diff --git a/sound/core/pcm_local.h b/sound/core/pcm_local.h index ecb21697ae3a4..f08030e56aab6 100644 --- a/sound/core/pcm_local.h +++ b/sound/core/pcm_local.h @@ -35,7 +35,7 @@ void snd_pcm_playback_silence(struct snd_pcm_substream *substream, static inline snd_pcm_uframes_t snd_pcm_avail(struct snd_pcm_substream *substream) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return snd_pcm_playback_avail(substream->runtime); else return snd_pcm_capture_avail(substream->runtime); @@ -44,7 +44,7 @@ snd_pcm_avail(struct snd_pcm_substream *substream) static inline snd_pcm_uframes_t snd_pcm_hw_avail(struct snd_pcm_substream *substream) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return snd_pcm_playback_hw_avail(substream->runtime); else return snd_pcm_capture_hw_avail(substream->runtime); diff --git a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c index 506386959f084..2d55d3bf72d5b 100644 --- a/sound/core/pcm_memory.c +++ b/sound/core/pcm_memory.c @@ -63,7 +63,7 @@ static int do_alloc_pages(struct snd_card *card, int type, struct device *dev, __update_allocated_size(card, size); } - if (str == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(str)) dir = DMA_TO_DEVICE; else dir = DMA_FROM_DEVICE; diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 4057f9f10aeec..5e57ab50f4c0f 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -972,7 +972,7 @@ static int snd_pcm_sw_params(struct snd_pcm_substream *substream, runtime->silence_size = params->silence_size; params->boundary = runtime->boundary; if (snd_pcm_running(substream)) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && runtime->silence_size > 0) snd_pcm_playback_silence(substream, ULONG_MAX); err = snd_pcm_update_state(substream, runtime); @@ -999,7 +999,7 @@ snd_pcm_calc_delay(struct snd_pcm_substream *substream) { snd_pcm_uframes_t delay; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) delay = snd_pcm_playback_hw_avail(substream->runtime); else delay = snd_pcm_capture_avail(substream->runtime); @@ -1419,7 +1419,7 @@ static int snd_pcm_pre_start(struct snd_pcm_substream *substream, struct snd_pcm_runtime *runtime = substream->runtime; if (runtime->state != SNDRV_PCM_STATE_PREPARED) return -EBADFD; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && !snd_pcm_playback_data(substream)) return -EPIPE; runtime->trigger_tstamp_latched = false; @@ -1459,7 +1459,7 @@ static void snd_pcm_post_start(struct snd_pcm_substream *substream, runtime->hw_ptr_buffer_jiffies = (runtime->buffer_size * HZ) / runtime->rate; __snd_pcm_set_state(runtime, state); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && runtime->silence_size > 0) snd_pcm_playback_silence(substream, ULONG_MAX); snd_pcm_timer_notify(substream, SNDRV_TIMER_EVENT_MSTART); @@ -1798,7 +1798,7 @@ static int snd_pcm_do_resume(struct snd_pcm_substream *substream, /* DMA not running previously? */ if (runtime->suspended_state != SNDRV_PCM_STATE_RUNNING && (runtime->suspended_state != SNDRV_PCM_STATE_DRAINING || - substream->stream != SNDRV_PCM_STREAM_PLAYBACK)) + !snd_pcm_is_playback(substream))) return 0; return substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_RESUME); } @@ -1904,7 +1904,7 @@ static void snd_pcm_post_reset(struct snd_pcm_substream *substream, struct snd_pcm_runtime *runtime = substream->runtime; guard(pcm_stream_lock_irq)(substream); runtime->control->appl_ptr = runtime->status->hw_ptr; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && runtime->silence_size > 0) snd_pcm_playback_silence(substream, ULONG_MAX); } @@ -2021,7 +2021,7 @@ static int snd_pcm_do_drain_init(struct snd_pcm_substream *substream, snd_pcm_state_t state) { struct snd_pcm_runtime *runtime = substream->runtime; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (runtime->state) { case SNDRV_PCM_STATE_PREPARED: /* start playback stream if possible */ @@ -2130,7 +2130,7 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream, to_check = NULL; group = snd_pcm_stream_group_ref(substream); snd_pcm_group_for_each_entry(s, substream) { - if (s->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(s)) continue; runtime = s->runtime; if (runtime->state == SNDRV_PCM_STATE_DRAINING) { @@ -2916,7 +2916,7 @@ static int do_pcm_hwsync(struct snd_pcm_substream *substream) { switch (substream->runtime->state) { case SNDRV_PCM_STATE_DRAINING: - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) return -EBADFD; fallthrough; case SNDRV_PCM_STATE_RUNNING: @@ -3215,7 +3215,7 @@ static int snd_pcm_xferi_frames_ioctl(struct snd_pcm_substream *substream, return -EFAULT; if (copy_from_user(&xferi, _xferi, sizeof(xferi))) return -EFAULT; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) result = snd_pcm_lib_write(substream, xferi.buf, xferi.frames); else result = snd_pcm_lib_read(substream, xferi.buf, xferi.frames); @@ -3244,7 +3244,7 @@ static int snd_pcm_xfern_frames_ioctl(struct snd_pcm_substream *substream, bufs = memdup_user(xfern.bufs, sizeof(void *) * runtime->channels); if (IS_ERR(bufs)) return PTR_ERR(no_free_ptr(bufs)); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) result = snd_pcm_lib_writev(substream, bufs, xfern.frames); else result = snd_pcm_lib_readv(substream, bufs, xfern.frames); @@ -3433,7 +3433,7 @@ int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, case SNDRV_PCM_IOCTL_FORWARD: { /* provided only for OSS; capture-only and no value returned */ - if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(substream)) return -EINVAL; result = snd_pcm_forward(substream, *frames); return result < 0 ? result : 0; @@ -3596,7 +3596,7 @@ static __poll_t snd_pcm_poll(struct file *file, poll_table *wait) pcm_file = file->private_data; substream = pcm_file->substream; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) ok = EPOLLOUT | EPOLLWRNORM; else ok = EPOLLIN | EPOLLRDNORM; @@ -3620,7 +3620,7 @@ static __poll_t snd_pcm_poll(struct file *file, poll_table *wait) mask = ok; break; case SNDRV_PCM_STATE_DRAINING: - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { mask = ok; if (!avail) mask |= EPOLLERR; @@ -3876,7 +3876,7 @@ int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, size_t dma_bytes; int err; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (!(area->vm_flags & (VM_WRITE|VM_READ))) return -EINVAL; } else { From patchwork Mon Aug 5 00:37:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816796 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 0EF1BC3DA7F for ; Mon, 5 Aug 2024 00:47:09 +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 C0EB54D07; Mon, 5 Aug 2024 02:45:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C0EB54D07 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818765; bh=BZvktJfse6DJvdv1KZoBYZ/DlJ6YUma/3x69Hgn3tHY=; 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=YZR6xdqwrbeYNvNP2AUNPo4A89xK4GYT4R+YJN8sPOxE00uP8BXORMiZ7XbTOVcqn y3TxKIDt0hKA5iWch7MCBvdx8gDiZp7K08VL8XOkx9r8yYPEomrWhx/NUmZUpuPCDe M33o2F1w9avCJoSl1+K3Ifa57JhNMxP0Wc2WMThk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 818F1F805BF; Mon, 5 Aug 2024 02:39:31 +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 8DC0DF89849; Mon, 5 Aug 2024 02:39:30 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 30DDFF802DB; Mon, 5 Aug 2024 02:37:37 +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 15E2BF8023A for ; Mon, 5 Aug 2024 02:37:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 15E2BF8023A 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=dzjgFphK ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LOGp/HEc2nzEByAmShfx+Au9yxNnSffzAt2hnd1rxybe4ullej3j6OJTCWZS7m9qywUxf6p3gLDPxCfA4pHvIbTUx0HtS4tFXUG/YcSX1wePQNJMApjSDLwEgrmjROkcNE4IedaI1R9oM52Nj8mrpnuYlA88v7MmMlDoA4s7IWo21EoRVjXJO2HsOSR0X1RTXdJvCYj1jRkpC9X3PKgw/hos/K/mfLvvCL2Z9LjP98sOA1jxu9zUVbXm6TdqWd4onaMLFd5IiQ8pH+wQv91feWIktn7GMPAPThkSnhNgYk/crZMhL3nU4BhFxpYvUSIY+Ld+W8PYtk5nkOtN8RbsXw== 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=cU8s26hr/REx39uwIqvIC6UC8Mih1rf08xzWkM0Mq3U=; b=LVtUQdRhS60h1tkGpO3efm6qljAOJkOkF69oZj6LArbqdk0ShikKjzbUe5xaSZxY20QXLXpOp/iPBrUr7q9L9g4JVHkVPvGoh2DOotABUvYMfpAFKKBbhyZNEuiK1di+xLR5Hr5b0n/lsQUQ/01iX6ys58s+8W5cgiumCDdMl+Os+NOzBiAKjQ5TtcFQ4hoUhDlwq5qg4a4AryA3/Lq6MLiRxZ125kwRtxsHhNClF8XP2uL/HSp8LI96tiLwJUnQrlkXI5NNuqcA3xWYeieJTuoWEyJ2KpvxoMRtA9yvu74qGb7BmMq7UIA05Ve1NJZiKrsTODkqgKpr1IVkNQpt0w== 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=cU8s26hr/REx39uwIqvIC6UC8Mih1rf08xzWkM0Mq3U=; b=dzjgFphKVn5QqQ7ooyXurVP7ra3+UgofyunfBWCkNpTXaij+4iVoTG+AemQFtRKEdq9kdL/pSWavT2Blj93/O/tV/wfpvQTAhxejzDAM62d423dYhxRFy3P6zl2memiKFIZH1jWFDj/R0ZwXEPQ4qqB3s4aqW8REZKoXLnLMurk= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:37:29 +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:37:29 +0000 Message-ID: <87v80fztx3.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 031/113] ALSA: core: oss: 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:37:28 +0000 X-ClientProxiedBy: TYWPR01CA0031.jpnprd01.prod.outlook.com (2603:1096:400:aa::18) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: edc7e49b-ab78-4e1b-772b-08dcb4e6c918 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: 8h+awG9Ihi2jOe4vKB8dAVS5sL/epIDj4+8Vtp00Sqy4WJqNIVfTNThGHGun9drPrt3Qz8wMka/2wx9t8AJh3WxLM+uDIV5OMThFtAjhBmvDvDuq1q0aqjGqp/l8/lahS2KalRkqfKXZjfpqVkWD3cmhw2wg00KLB6dFOibXAnOB6e9ObVKoLfDV37MfREImvAmDkrXKTTROOw8QDans9SQ/06PPjCXJZTctnjquA2e/GqZ7d9PPweXZejcpdwqgSTVqYfBzEZ5ZpZT/rpR4MFMFBWcZiZHmDVu+5Sq7Vp+bVSgnb5rZpqQPZ9KZD2moOUxDKwnheZmBPo9K2p3zP+Q9WHAFI4Gdv5Zyg8xilBMPuqDZV0haMuTHw8ZyzfvF53tfiqbh0gvEgFHdMJisZ3LlH8+/NGS8ABvL4bjecnY+PLUzeNT64ULkLknQOtq/HZRx3JTKQIYxJUrjYtkAWMtBJY/IsdbC5qs237b5okomTWaHX9m3aZMGaYjnpUajXLn8FzfCasvnfeZ2fuFqm6IFAd2NDrcfNA3nP/QV0C2r9eDpzXH/xBZXQDF92R0wbyucCaKaxIy6BMUgJF0flCE4oHeUAy0PHp6eW5GYiXHQ1FALXTPzG47VceJsuh6DL1wxz/HFHAblVDtcr7KgC6madorn0MSEFsYaJiyqDZW02iNUXJulQMuTPzHIdB4Z9gfAL+6pLUFiCPpwNEQYYZ2cUZZWADkvofpOGcFPJEuOy3y+ai3hFpoUTqsGgp4KMWQ2z+aozCq4VdOOgW20iwI80YbS8t3e/4CV26LZs9DIR7T0TeWS9HbCEWHRyUvAy3NZCm59LPUEZkqFWvYjCzC3LnhVs1lzK0bI141V45h1YhUmxY1sNR1HOU7lLyhtjDX3Gj8HH1YMcH+lat40/3KoNSz+JMXlhfqMACP7bp3i4MZGol32REbndMY5axqKWG/8h11dXXHke0++ovLEHxcbjMSE/C3xYKH1tr6borknI0Ks+4SKfGAoDfA23NRSlAFfUbReKEhvnVCsxD3vnRTBQC8Hwvsjep0Wk3RoJfCw+EZavsQDjE1fm55J8ksnJ/bJnTJbSsFMSRhNkfpVPFijv+ics6qm8WOZ5nYfnfmlqzWeUCBi+D3OJ1N1f6vsD7MgzNBLXTmDkd0k49T/nhSl1CgYU88Y33ZpCRzAv2jqFbMP1CdjykDS5SJeJ8ERdxW+VWXDRMtQbxm1nyN92Y5temHiUK49GgcUwnz6fSaHioeVMM3FPnbuYZJH/CXwKJc559/M35herxqsQob54qGSIW7ZiUGWkcd7/kPtxiD1DG35ak+qFrgVviKtt+hn7bSOsxPaAB8QrdHOdG994PP1UABlXlJZGDWGwihcPcoxfczUEEjlIKfOXyooNumXNNXP4/M6ZejkZtEEBcYj9Q== 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: 9F9tzpZK3CAaetxPKEsCpDIoRsWucObyyXmDeGf8QoY+n01kXhJOuWA+B8JjMIsguUZvcx2htU/UBgaQ/y9ugVA1qpeb8ktMm4Kzk2XOtDhqkoZpTrcPZRqpO9dbFvLZhtee6hWhEFmDltTduYijWKbyR8SiA8PemGTDBqGUKciKRCGUPsKYQO3HFGLr+zCMxKG0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3SvM+vKjGiWrDqK8pKwIhfOJ++Z/sv86ZkktE/2p+6PfDDfx/2UPUu6yeBCNHI7KBlb4HsE8Y2GCdLiQXoDpppJMo9EBgW7w8r8wQwiicfJKY0EIKUtyOp2zUc+rgkm6p4M2ScwSsZBISJXnixTfPXrie8J33vjN8on+revjocAMtZIXHgdqDs53CTlaz9qJX4S6PCJip3I4f0ZNxTayO+UQyRvM6JEXZ+HrBrHtBsgqlrgEL92muEiA/4fu2z6zTXCTV9988+0GEhrldK7ww0pCeLMzKUoikexbcwPv980xeNx/NKqABGs6bIs1mwLc29ilQsNd5MfJiDLYU0i7lAWtGirPa0yVcgT5PD+nw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: edc7e49b-ab78-4e1b-772b-08dcb4e6c918 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:37:29.0137 (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: n0yIdWpWn2E2KmJSVD13k11bXHxGVwutXTbGWvqeZEWLMTH6Lh8l9u1NrHojK0B7uohcV69Gv/gsJ0xHsGs2+VMb52dXWShqsxEMJllWIZ2h7Q2owh3vSoNjcCb5hmT5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 Message-ID-Hash: DYBNBPXJNYQTTE55WY2DTSEBWLXLDX5J X-Message-ID-Hash: DYBNBPXJNYQTTE55WY2DTSEBWLXLDX5J 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/core/oss/io.c | 2 +- sound/core/oss/pcm_oss.c | 20 ++++++++++---------- sound/core/oss/pcm_plugin.c | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/sound/core/oss/io.c b/sound/core/oss/io.c index d870b2d93135d..86d25f2e01ea6 100644 --- a/sound/core/oss/io.c +++ b/sound/core/oss/io.c @@ -128,7 +128,7 @@ int snd_pcm_plugin_build_io(struct snd_pcm_substream *plug, if (err < 0) return err; plugin->access = params_access(params); - if (snd_pcm_plug_stream(plug) == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(snd_pcm_plug_stream(plug))) { plugin->transfer = io_playback_transfer; if (plugin->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED) plugin->client_channels = io_src_channels; diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 7386982cf40ed..aeaf9c69e791f 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -986,7 +986,7 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream) "snd_pcm_plugin_build_io failed: %i\n", err); goto failure; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { err = snd_pcm_plugin_append(plugin); } else { err = snd_pcm_plugin_insert(plugin); @@ -1003,13 +1003,13 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream) sw_params->start_threshold = runtime->boundary; } if (atomic_read(&substream->mmap_count) || - substream->stream == SNDRV_PCM_STREAM_CAPTURE) + snd_pcm_is_capture(substream)) sw_params->stop_threshold = runtime->boundary; else sw_params->stop_threshold = runtime->buffer_size; sw_params->tstamp_mode = SNDRV_PCM_TSTAMP_NONE; sw_params->period_step = 1; - sw_params->avail_min = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? + sw_params->avail_min = snd_pcm_is_playback(substream) ? 1 : runtime->period_size; if (atomic_read(&substream->mmap_count) || substream->oss.setup.nosilence) { @@ -2017,7 +2017,7 @@ static int snd_pcm_oss_get_caps1(struct snd_pcm_substream *substream, int res) return res; } #ifdef DSP_CAP_MULTI - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) if (substream->pstr->substream_count > 1) res |= DSP_CAP_MULTI; #endif @@ -2201,7 +2201,7 @@ static int snd_pcm_oss_get_ptr(struct snd_pcm_oss_file *pcm_oss_file, int stream return -EFAULT; return 0; } - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DELAY, &delay); if (err == -EPIPE || err == -ESTRPIPE || (! err && delay < 0)) { err = 0; @@ -2225,12 +2225,12 @@ static int snd_pcm_oss_get_ptr(struct snd_pcm_oss_file *pcm_oss_file, int stream n += runtime->boundary; info.blocks = n / runtime->period_size; runtime->oss.prev_hw_ptr_period = delay; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) snd_pcm_oss_simulate_fill(substream, delay); info.bytes = snd_pcm_oss_bytes(substream, runtime->status->hw_ptr) & INT_MAX; } else { delay = snd_pcm_oss_bytes(substream, delay); - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { if (substream->oss.setup.buggyptr) info.blocks = (runtime->oss.buffer_bytes - delay - fixup) / runtime->oss.period_bytes; else @@ -2272,7 +2272,7 @@ static int snd_pcm_oss_get_space(struct snd_pcm_oss_file *pcm_oss_file, int stre info.fragsize = runtime->oss.period_bytes; info.fragstotal = runtime->periods; if (runtime->oss.prepare) { - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { info.bytes = runtime->oss.period_bytes * runtime->oss.periods; info.fragments = runtime->oss.periods; } else { @@ -2280,7 +2280,7 @@ static int snd_pcm_oss_get_space(struct snd_pcm_oss_file *pcm_oss_file, int stre info.fragments = 0; } } else { - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DELAY, &avail); if (err == -EPIPE || err == -ESTRPIPE || (! err && avail < 0)) { avail = runtime->buffer_size; @@ -2429,7 +2429,7 @@ static int snd_pcm_oss_open_file(struct file *file, continue; if (! pcm->streams[idx].substream_count) continue; /* no matching substream */ - if (idx == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(idx)) { if (! (f_mode & FMODE_WRITE)) continue; } else { diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c index 82e180c776ae1..47168e175c966 100644 --- a/sound/core/oss/pcm_plugin.c +++ b/sound/core/oss/pcm_plugin.c @@ -54,7 +54,7 @@ static int snd_pcm_plugin_alloc(struct snd_pcm_plugin *plugin, snd_pcm_uframes_t unsigned int channel; struct snd_pcm_plugin_channel *c; - if (plugin->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(plugin->stream)) { format = &plugin->src_format; } else { format = &plugin->dst_format; @@ -110,7 +110,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames) int err; if (snd_BUG_ON(!snd_pcm_plug_first(plug))) return -ENXIO; - if (snd_pcm_plug_stream(plug) == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(snd_pcm_plug_stream(plug))) { struct snd_pcm_plugin *plugin = snd_pcm_plug_first(plug); while (plugin->next) { if (plugin->dst_frames) @@ -174,7 +174,7 @@ int snd_pcm_plugin_build(struct snd_pcm_substream *plug, plugin->dst_format = *dst_format; plugin->dst_width = snd_pcm_format_physical_width(dst_format->format); snd_BUG_ON(plugin->dst_width <= 0); - if (plugin->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(plugin->stream)) channels = src_format->channels; else channels = dst_format->channels; @@ -567,7 +567,7 @@ snd_pcm_sframes_t snd_pcm_plug_client_channels_buf(struct snd_pcm_substream *plu if (snd_BUG_ON(!buf)) return -ENXIO; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { plugin = snd_pcm_plug_first(plug); format = &plugin->src_format; } else { @@ -586,7 +586,7 @@ snd_pcm_sframes_t snd_pcm_plug_client_channels_buf(struct snd_pcm_substream *plu for (channel = 0; channel < nchannels; channel++, v++) { v->frames = count; v->enabled = 1; - v->wanted = (stream == SNDRV_PCM_STREAM_CAPTURE); + v->wanted = snd_pcm_is_capture(stream); v->area.addr = buf; v->area.first = channel * width; v->area.step = nchannels * width; From patchwork Mon Aug 5 00:37:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817116 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 3E355C3DA64 for ; Mon, 5 Aug 2024 00:46:54 +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 30E074CDC; Mon, 5 Aug 2024 02:45:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 30E074CDC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818747; bh=YzANhlxxRYqAXLpj7gdu/SdnFjIfvoworiPH44OC4pE=; 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=lGhOp33xDT7/Es3ywopcAHbmnA7WHRPoUxJx+CN6SddTRNGDmbulhZl0cUoFHka3K Ob4dxmizJqJSucUumb64N0B/+eBdNDCciGgxmTPb8kqm641+J163h6DIXIgzv4SJAp x7tzks3v84k6Za8wOK1UCS5cSer9DgTaFl5iEL6E= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2E679F805F4; Mon, 5 Aug 2024 02:39:32 +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 D1E9AF89857; Mon, 5 Aug 2024 02:39:31 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 87838F802DB; Mon, 5 Aug 2024 02:37:46 +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 CF887F800B0 for ; Mon, 5 Aug 2024 02:37:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CF887F800B0 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=NEMsNM+y ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZD1cHkGOctafzfyB+6dDPwFqrkJLqv6AG5jtY+4Mdd0SX1a/diF/HG6Kita+YPCsWWotwiD3ry056KlSjV2EyCkXbGXXrvPBA5gMbfXRIgbQqcjMnngq0tc1iqFnzdFPffPv03gYdXp7ZrBh7s3EvD5p0wbC+sSoMyBNsp55wlro79EH/UvU0A+vfAKfvEnwAznCAa5iACl/78zplKPVndf9uhqLHYfxTHYCa+4YN+D6/gE+JhJEooD9BtI/pNyjBJFbxCmWzavGuFp8CdOCocDeDtlYjVGovN+P2S+Z2ciSd1R21bhgrHaP1qXSWmnSeEtbVz16hYwy5lBfuMOlDA== 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=CIxH8knu3XKO+bXVAdI10kw5MlguLpwB/Y24QVulcnI=; b=BZysqBHCqUDa3tqDoftZnIGNaD2eMFrb/hLHFsRu1TZkc9dhPXj7NkFl37xDSJR95YGEfGOT1So8OL7UeOSZ33lIoVoEnjiZE+YKzwrx1bIKyfEKmXmxd+q3jNG14d2wSDSqMrKjf8N0W/kM9xhmkJaHGDf16LIFwucFc97P+cFOCLLu5iI/3/NZuTA6kL3t6MUV+D2DP56Y/yrENXiNdYbDINwvawlm9Uf7hB6KIwxAGez3jvHnc3H2dQDQzDJeuHJDRi1H+Py6qBjoRqg0NDVtBwfFabIhQqxSkgIZ4JH9ix41mRdv3pNieWE1h3Bi9U2yE+n5BYe4VqAd7OQeKQ== 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=CIxH8knu3XKO+bXVAdI10kw5MlguLpwB/Y24QVulcnI=; b=NEMsNM+yaz9+i5wB4kqS8/vNKdYhHbUdvSIggic/ba/xRkggxXiqrjatpJsKiUWVyA0rkyFESCH6qbLZqWdDz2mGXF5q1QqFHsaeRAwAqCUHdL5FjJGbvuBP4Wt2Edgt/K1DH0xyxZ1WoS1Sov/MoUjv42yKRU/FGvMBfv2yNPA= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:37:39 +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:37:39 +0000 Message-ID: <87ttfzztws.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 032/113] ALSA: virtio: 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:37:39 +0000 X-ClientProxiedBy: TYCP286CA0254.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:456::8) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: 00d772a8-c236-40c4-99ec-08dcb4e6cf7c 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: YgZ3VAmhbPPgyLL1cx57Zo/mPePYGtZlypnkzJ59B5xJyQpc5xl+1B2myIko42rOF7kvKRlq/4vte0SzOr369PUT0A70pOJYLZXFUkcKbkksz/75gfFNnhx9uneM10mJmTv+UMRZsOHbuu8ULVPRyg8zZZsFcIQQOWIBZVNPJCe1d2W6oweJesO7viE329nagiOVYJDWFlFFmi+MQPRUKp11GzT7nQ+4kYSH3+TcAh6yebLoMMBATDTX1M+ziWzaFmePBjEQ9gBTDS30PuOsRBj2YWmhOXOJ6kZ3KlE1acOuooUV6jKOSoAKZobOxNpzUpbebwJ2Cyhw2kgCjzDBAzvtouihembLVi2lbH2N5UpfaQvvYX6i84nBcDlyd7t0pgsHvGPU4nhlHdzU5iVkQQKxYap8KzBgOHev45hh9eRoqdOl6FLG9qg4AssSv4xnx3LFM+Y6SUWxjXQKhDtedHS2sMOngRmvQ9ODZNJ231oRtT5hJRVoqk2nBJPhP/OUvjpzHPOgJcf4qmuZiwowVYIzr5l648q/ABchx31HM7PVhqtJvepRUVg8Gx7qgAbfErpgyZxda1V+cobGf5hR3w1iN+XPuR3lg60cnDh+JER/51hSSrEBOxOCKprrtq1shIUN+7swvkD5nVEeJ6pRpoj602RfG0q4sTHg6fPIvHq+N78oGQPqLfRJE1hQ8s4LWdj4DWch77JPccHVSjhfi2E6av4NNwsEdSrQ7SC8yQbn9M1q5OqYZGwddJmhMg2+8MwUtpR66p8lQeE8LPz2by792YPy95brBdbCKAt+ZHMTko1Jto9K38nuBP+uAxypWIPRfJe6E1SCSwanR7gwdN8nu3Go8PmsAUcU1XUqAXwQUjmBFaGb4g9Z6zp+H9fiwLAUvUM14O05VuaMmPDZk5EFP7NpZ7DMdCwbTM4ZEOqlvFxvhjfcl0rz1vmpQKibKcxjbcLVqDE8o30aVUIkG6oBITImjqVV5R+3Nj1PsrGy6F21HB+Z+5HgHqBxx0NrPOhBxhFiZVWaC9sqIeC9WJfvgNP/87b4mqbSKxnCDuZ3vRhGtJW0TsnXVUr4Ktu0gNhGV2yU95G5CrcNQU8c1ixKjyyjw0UDgSqiCbhqQF49+F9gO3tNc8PZWZwHvBXgJXCOCGoEuu1c/RGZsiAXChp+KNReW3LhoNQfHER6uosm1EWmdm3SI7Wp2eX15lArKDk/jJxILkU2i7W9Lo4ShXsV3q3+WuaYOKJtp91ukCb334l2nQiiGKFFzV8Oi4OiymQDf+PDxZpgAShNOt/nuOpRkvw331fbicNYgwz3mfprlOvCpOGXrDbAlqKWjbe9NBkw4fmT8N4I6u4h43qFs0tr4DFzC7NuI9g15mGCam1fUnjDYjkSwFpfX48LLntSJ+3hOXTHQJ7Cp5v0iCYM/A== 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: Xy/wCmR4W/O0PVrBnjEWxiWEDKm/EtOiq7gfd1o1erSzDzw7TPi+GxMkvkKHkZXYjOE+dNpW0ofvqBmHPI51hyn1WcJDKFggUZK/YvYaS9hhwEYymoNuhSfn/3+ZvqgTZxYP4kxWIg2c1M2UDkcGSI70DYE8TPpqgwk5qhpy4DeF8P4ylpwh3+FC79EPi2j1tDi+xcu+bCe3UpvFQAxBsGWW9kNDSJwgDuq0w5ajXIJlNCz+OdfUcZqXy9t9LesjUwWuLiujF6J9THFxkj9eN6kpiOrfbbdS1GddJch/DFt7cxGRdidi7BI3Y5sNgC9uTXG3zE/v0wCJVsjth5C9kYiBgvBYVU4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WC92iyD/5IOrAWAU1TCKTl4BwC42TWngoK3C1e5PhoToiZYPWqtSwnACZXooDjstTLsHdtVBKH4jCQYOuqb/3yYPu9Nf6UN08c+lEhpAszNwXBqj2LsOMz7G/0QgEqqVa6d6TOAC3bfaouOzo0byNT9fqOacz5SOr1kpUldcE6nzfe0/Lm2y15aRWKQUegj+NytMVgbC/PUBDa11kfalMM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00d772a8-c236-40c4-99ec-08dcb4e6cf7c 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:37:39.7420 (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: iNnEt6nP2eThHsIE6wc6Id0M2VeTFfXNc51snJybgRtAP++FPIu4yuuvkqanhO/DX5KiARirc8a2+1CbVSXWBfX0ZfWySS1R6LlJa/GVeyuoAwLcavhtR0aBU1//NNXm X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 Message-ID-Hash: EAM6MJGK7QN5CCA7XKP4MS3V24LRKXZ6 X-Message-ID-Hash: EAM6MJGK7QN5CCA7XKP4MS3V24LRKXZ6 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/virtio/virtio_card.h | 2 +- sound/virtio/virtio_pcm_msg.c | 4 ++-- sound/virtio/virtio_pcm_ops.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/virtio/virtio_card.h b/sound/virtio/virtio_card.h index 3ceee4e416fc7..db6d164fada99 100644 --- a/sound/virtio/virtio_card.h +++ b/sound/virtio/virtio_card.h @@ -107,7 +107,7 @@ virtsnd_rx_queue(struct virtio_snd *snd) static inline struct virtio_snd_queue * virtsnd_pcm_queue(struct virtio_pcm_substream *vss) { - if (vss->direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(vss->direction)) return virtsnd_tx_queue(vss->snd); else return virtsnd_rx_queue(vss->snd); diff --git a/sound/virtio/virtio_pcm_msg.c b/sound/virtio/virtio_pcm_msg.c index 8c32efaf4c529..40e113a2de73f 100644 --- a/sound/virtio/virtio_pcm_msg.c +++ b/sound/virtio/virtio_pcm_msg.c @@ -230,7 +230,7 @@ int virtsnd_pcm_msg_send(struct virtio_pcm_substream *vss, unsigned long offset, msg->xfer.stream_id = cpu_to_le32(vss->sid); memset(&msg->status, 0, sizeof(msg->status)); - if (vss->direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(vss->direction)) rc = virtqueue_add_sgs(vqueue, psgs, 2, 1, msg, GFP_ATOMIC); else @@ -313,7 +313,7 @@ static void virtsnd_pcm_msg_complete(struct virtio_pcm_msg *msg, * If the capture substream returned an incorrect status, then just * increase the hw_ptr by the message size. */ - if (vss->direction == SNDRV_PCM_STREAM_PLAYBACK || + if (snd_pcm_is_playback(vss->direction) || written_bytes <= sizeof(msg->status)) vss->hw_ptr += msg->length; else diff --git a/sound/virtio/virtio_pcm_ops.c b/sound/virtio/virtio_pcm_ops.c index ad12aae52fc32..5d93d50f24023 100644 --- a/sound/virtio/virtio_pcm_ops.c +++ b/sound/virtio/virtio_pcm_ops.c @@ -337,7 +337,7 @@ static int virtsnd_pcm_trigger(struct snd_pcm_substream *substream, int command) spin_lock_irqsave(&queue->lock, flags); spin_lock(&vss->lock); - if (vss->direction == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(vss->direction)) rc = virtsnd_pcm_msg_send(vss, 0, vss->buffer_bytes); if (!rc) vss->xfer_enabled = true; From patchwork Mon Aug 5 00:37:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817115 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 37861C3DA64 for ; Mon, 5 Aug 2024 00:47:04 +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 B32294CF4; Mon, 5 Aug 2024 02:45:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B32294CF4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818757; bh=Vfl2XXpBnoEHmjsFNmwbqI5hkL1jb1VrisnAdZcKyRc=; 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=EoUrlAxbzqCtc9K9lwzESWgFz/sMMsptn6nHHeVDFndI91jG+taf7cp+0VNNWH8kJ FxVdBQ4+HLNdLH/swrO5wb46+amAj5DPhi0BwhR/uzsvo5nd3XtLWzCIWhsmU9PJlN XN9v4Pmf/skUSng/ErDe9hXcdIFK7JlcnWsUHYhw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 967CDF8974F; Mon, 5 Aug 2024 02:39:33 +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 692B3F8987F; Mon, 5 Aug 2024 02:39:33 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5D85BF802DB; Mon, 5 Aug 2024 02:37:51 +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 A24F6F800BF for ; Mon, 5 Aug 2024 02:37:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A24F6F800BF 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=I74AZUSE ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wsdu6dVfjo7PH05mFR/IHGnJRHRETxgBx/43xVxVx+y/kY1iTVv84Kzi1MLKCNbrI1tt78Fl/9MxYLUlAPVc7inrwptCZwv4StaDKOjU4pDEzHIILJsUxKum27pUtEsXxGkTUEpJo+jUP0fbqosTMD6M59IO8kgbasXO9ulX+qjvH4sYep8R+uzNWkbTfroRdJOYewSNiDa0uRA9R7d8K+R9vez6Q6rKp618NvbIueoTAhx6T5vTjmvKJ39DuWh+Fkf7ez4a8j5nX7C/a28sKQJ8MOrrv0RiEQfzGgFzxDk+4uKCxyKa8DrOwJRs+4PPf/rck6GpFTwMIZ8eXH2YeA== 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=J1Sc9YszcvEF6fexWzWsYE33pDn8Fx1LiXX+I3bls9I=; b=uXvz1jqBDw9WEMaNZ9Q2eUjknmUyZFOHj6MIXo9E+HVVgKSpwb3a/DuyoyHjH5vVirzGve5ajDJG+lZiSKMH81qD8gIgsjuNIEwn5eZJtgKSnQBmETNfEIAt1Gte2valnT1bKVa7PCrHRdBV3I3y4RGBHoF0wDCyKZeS77IViXLxTHOjl680q7LMREtCGyyqQvmKwasLK64pRB9vLs0Vmgchx/hHzMYIxA4ba3SmWLMVjZdikrCJ2gymXvBXQhSchgLGRLAOq7GOwR+YzjWtZlMEfy+Nk5LjCbjyGd/6gKGI7VcSF0nXzoa3prLZfdjSxCz1vlwzV41ty5q9B+8dCg== 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=J1Sc9YszcvEF6fexWzWsYE33pDn8Fx1LiXX+I3bls9I=; b=I74AZUSERahQ0ZM8xeUgCoUb1hHmX3oiMS/EtVJ6MuKSAsJZ87EXLTegevQuFupqz1N3CcVxaUDEUXhMqpU/w57VzweTIvW5WmWTfcq+ZLxJ2xNZNKEhH1k4i9CUMaS+DkRbKoC4S/m7GXedRKt4uLFloovATNEVFFi4Scu1iSU= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:37:45 +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:37:45 +0000 Message-ID: <87sevjztwn.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 033/113] ALSA: include: 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:37:45 +0000 X-ClientProxiedBy: TY2PR06CA0042.apcprd06.prod.outlook.com (2603:1096:404:2e::30) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: 6d42f780-964c-464e-d554-08dcb4e6d2cd 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: IUhojVQGPm4gbtnHeFF1q3AzNl+kcCHEp2UFOWWzKLoqSat1EXEpXtfC5lL3ABA50M7gh4d84hX8PKeluGC+JoztjhSzY+CL3tMdEsKOL5lYe7MupFNrPtnYEu7JYEvcVTj1hhaiK5VSRolN4A5xJEgJbdsohvtI7WKPmhHvenpiMmO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YmhitF+QpBqOt5J9DUIh3yPzYdtRKjWQG/eFT4TxMglXPbaHJbBbh2x5i5YuLDMgmVoTbs6SvbVwxmGyQD0NtlYCxdqHi/K4OHktumQALdu9LmpunTD6TlDPVptfC0bdF/PC5rttaaG7iJ9+MFqdStX+nnpPiuEeS5WbCvFOHyNQ== 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: nPAjpZ7z0MyYQvYwnk/zgX+Ng0FBsHLfYcVUGM0sQgF2rNFSeIOTVDLC9beBdBHhFl17p+3luvxWBUKMcZ47ZXakU59QTUMSaZN8LFv0NVgl3H+cB0liekydTy3Nmjt78n1qZ0P3RqJ9toJybNiBHzmL/KPbDy5kG8AzWf3FqAAqKL12rDGzKIMCuiUjC+pAVcu2lrHOUxb421HTeNqQmaw5R4MPSp3Wd+R76aSYlz6uuOYiYwvi7dRIy37rBniEaQC3zDKdWGMnTyd2ZDUGyFfk0RUTedrwrvot++D2G+ZsdUptXBjJYsVeDCrA1dBv7tA/XCcz3DVHF+PrKhOc26VEnO1wiJnkDH0UhOs0HUVjeqBqewUi/bAiAliY/r+hR8a12GNrJqqrC3mdK9Mtej2TEx59KBwWwyyg98oKnQlj3+6EeX1tUuF86ESeKRYXhlT7Ltmt56aUXUbVpOSH8s8MwiuVKXK/NkWsAUIUyo+4LS6RfRqaY7l1c2wY5SEje+OBDYPbH/1W+AzkGxBO9ekZWZS3tYtBYaO/iQwGzthfaIyJHDKup8YNOSDC8i3H/U3PMm+x70Ry8tOEdZE5H2jQyj7R8ihVBritgs44Gm80im4E7fB35hXK8klRMwChAahMhrVmg6D7WNjbrepW0LiLI1gSh+g8tKeJbr3mqFdAtYshWm06qAVtLHQ+9OuJyBOsxp8xNQTKaG1le34lGQl0W70yeluG6UK+QmazGYdRYs3JhVUy08iWE7t4QClBiJieyf/yII9HAto1tAcjPeQkse1Mjpeo4k+7uKs2NH8096F/deFN/fMKL0nfx4JVroGcJscQ1VqLlPho1fFY0sMTE+vz2F7WXFkQQ6zxvwtWYp0GICnXO+pPOiJc+1vaE7+QGRrRWorR1t/fJvM4QMINo1ewWOU/TBBAF7BYO3iOarpl0KESniI80fPRFMQYQE+UWixsOka1Z9abjhDnRm+/PCAC7eddgG00vJ62tUf50Xddw0Lynqn1Ht2g3Kerb63x97rTxMLusko6N+4wO9pux0XU3r0AOQjVoUYlcMQWeDj4+FjESkvPM7rMn72kaaqxWWSoky5M5bSu7lJk5KLYMtS5BMebyz4WoKzNXg/zLiKIFzqJGybRSJgYGWA4bWmeKI2T6u8igc2Lfp2CSsqsbOTBHmxlx4xJ7J4tb2z80/vANqpF4wTZTNsi9JAjBND1JWi1dU7sc1j59tzmI//nTiVuZSShZPDJN0DfA0Ap4/izn4wIm3gNHyxViSWRbh6p91YjVJS6eoz1ezWacTvGLoYk75WJgjFau/sFTLiYexZjKAY5BUH0s6GOTA7+vgeSeQuBMpUozEKrzHfDoxLU5ff1AwPqyCoJ5kVuoYyaPKdSK8fgcu867XZbi/oyzyy6CUyKC1wOLcRJbXqOUMWPawWI+p4QpzYkVzYi7btT7mwkK5tqqAwxzoTOVZYAjs5F70sICpGhw/HKC4/ulGQMcFZemdBaZxcNKENO2PocEOfMzj4PTXrTV+sBZSrWmDlvcGI+BN8oEZLGY6gYdV+GyCuCzdYWoYh02R3kX6elqpDSO/U3o0ACtZ+37hSDyjuQx9J/4xONfjM9rgX8Gd4Ykzg2uPXDYEscwAIO2qc= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d42f780-964c-464e-d554-08dcb4e6d2cd 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:37:45.2564 (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: Hc1iaU/QyOtWULfVXc2aVqUiVhnT8iMYtaaedaUhy4t59O60EhPBRSbCsFuOdsQ0sEqM/IdE8Tmt0A3TnARq8SfAnfqWyvW8kr/S8LzSS23ZkvRCx4Lp9ON02lmTsQ3A X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 Message-ID-Hash: Y76K77RSZCTPZGAEX4ZA3FNMYXXA5TNC X-Message-ID-Hash: Y76K77RSZCTPZGAEX4ZA3FNMYXXA5TNC 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 --- include/sound/dmaengine_pcm.h | 2 +- include/sound/pcm.h | 4 ++-- include/sound/sdw.h | 2 +- include/sound/soc-dai.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h index f6baa9a018681..3b2e31922f0f1 100644 --- a/include/sound/dmaengine_pcm.h +++ b/include/sound/dmaengine_pcm.h @@ -21,7 +21,7 @@ static inline enum dma_transfer_direction snd_pcm_substream_to_dma_direction(const struct snd_pcm_substream *substream) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return DMA_MEM_TO_DEV; else return DMA_DEV_TO_MEM; diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 69e535aeb8e82..00603c0e568e1 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -734,7 +734,7 @@ static inline int snd_pcm_running(struct snd_pcm_substream *substream) { return (substream->runtime->state == SNDRV_PCM_STATE_RUNNING || (substream->runtime->state == SNDRV_PCM_STATE_DRAINING && - substream->stream == SNDRV_PCM_STREAM_PLAYBACK)); + snd_pcm_is_playback(substream))); } /** @@ -1521,7 +1521,7 @@ const char *snd_pcm_format_name(snd_pcm_format_t format); */ static inline const char *snd_pcm_direction_name(int direction) { - if (direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(direction)) return "Playback"; else return "Capture"; diff --git a/include/sound/sdw.h b/include/sound/sdw.h index 6dcdb3228dba6..ab752dadea3bc 100644 --- a/include/sound/sdw.h +++ b/include/sound/sdw.h @@ -38,7 +38,7 @@ static inline void snd_sdw_params_to_config(struct snd_pcm_substream *substream, stream_config->ch_count = params_channels(params); stream_config->bps = snd_pcm_format_width(params_format(params)); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) stream_config->direction = SDW_DATA_DIR_RX; else stream_config->direction = SDW_DATA_DIR_TX; diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index bbb72ad4c9518..577bbaede90af 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -476,7 +476,7 @@ struct snd_soc_dai { static inline const struct snd_soc_pcm_stream * snd_soc_dai_get_pcm_stream(const struct snd_soc_dai *dai, int stream) { - return (stream == SNDRV_PCM_STREAM_PLAYBACK) ? + return (snd_pcm_is_playback(stream)) ? &dai->driver->playback : &dai->driver->capture; } From patchwork Mon Aug 5 00:37:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817111 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 1C4FBC52D70 for ; Mon, 5 Aug 2024 00:49:39 +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 404564E3A; Mon, 5 Aug 2024 02:47:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 404564E3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818889; bh=1+yuDF6s2LKsFPJh1ftoaKrbQmW/xr6qQDzGnVEOepk=; 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=iB5qqJOim3kR3xRNvrWF9PxaHzGR5q93nLh9UohGfZxRqouGQ9a/f3gVAVjBPIeoL cegx/yi4w4FJ55otElv8TWK6oqHTRA2FXCA4S9PHzNY/FqyHwGrxZ3YPHpeX8gCDC2 t7jljyhB3R7hb0ThDnRX7YLYWldHVfQDb6+hNY1k= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B846CF89846; Mon, 5 Aug 2024 02:39: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 0BBDAF898AC; Mon, 5 Aug 2024 02:39:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6A35DF802DB; Mon, 5 Aug 2024 02:37:57 +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 6894FF800BF for ; Mon, 5 Aug 2024 02:37:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6894FF800BF 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=MUHnCLzJ ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bfK+6x1NP3465brh1BKLIFk6wENg0bccirBkJsyZ3Lg18s7ZGXiNjpJxVHejMPxSV5hPok33nj6YWejLP1B7RTAj5vccWTMyPrJofTB+7a/qvmf+l78eI6zt2h5YXAoynr5G1ijneftLVYiA/uZsMAH+5+NRz19e1h5XA2uoRmh87nZO9LTteMADIRLh1BeV9eX1JmFB3iJquk9PtpKE8AX/adewoxCcvUjaIzjP19ZU3fHJroEVAOq44t5Tt5nTcFYndfwFR+/QmYf6s7MHWyk1n1P2yMVtrdSFInW6YQeQR05IZYovC7XlIgidPJH71i9w1+fLthFJlBAi+Ek8qg== 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=acvnMh1XypsY24mmC1F4wdUAJRkWHFir0PyFewqvnfU=; b=zLVGJyc9a8z0pR1jrYzj8sTyg3xvSJVuM3zoLJMpbsVdT8itcCFS8aev9AwJ6GMpC1EYZKKj8oFbagjyahcaIZy9WbfiW0jRxgGB1hlz1XXLUkONv5FwDkuOWRm3zCgmeHcqAldSbaPpj/N5LUdbbtAR//Sw3MTd3iG8eymkek7ziL8XsI7uzo7ch76l9ASHMnad81uPxMhVSX/roTTaqiBqLlx3flyAR0+efhKoor3eC6odc5D0z/Ly0SUkuxm2qVajSlz6qgFXpDQuY995gBZqygf99iY3jReCTcxpWe2fLNlqUSP9U8RbG+tQ0q8oHmxJh4nNqZvg55Pyqh0N/g== 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=acvnMh1XypsY24mmC1F4wdUAJRkWHFir0PyFewqvnfU=; b=MUHnCLzJwi5Ta6Ugw7gg4kVqbNVmsLVorvWEEvNaKNQLp8+RED2EY4GTqdQQYD+ny9TZ+dVLk8jjDBwu5eF6a0VbyI+ln8m0QW/LZsL5QkIYJyeCRWmBiWo7i7Wd49VYjwKJxcRvYs2qlpdrNWIR/bpHsqfjVMZ+Z0SFEzv/Qok= 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 TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::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:37:50 +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:37:50 +0000 Message-ID: <87r0b3ztwi.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 034/113] ALSA: drivers: 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:37:49 +0000 X-ClientProxiedBy: TYCPR01CA0115.jpnprd01.prod.outlook.com (2603:1096:405:4::31) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: 27e83857-26ab-46fc-dc09-08dcb4e6d5ac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: j9go+/3NE0ATkVQrYmvW9CqMecDBdd5uy/RovyUSkZmEiTHWPF+nsyRkWXe2Xo1FtkRVBqrXYKoWdc9ujaIStEPbYdexYZU6gECGQ+XqbzKhxPMgcQbRp+gssRgwbwzMBHmxy4KEbvv3hoAGt+v9YVSdbQH5RfA94fSEcyXusz83jfV8RwhNSWeTMdiHShR9RciOBuie4Qm4K5U7lok9lSj9+qhvsqD/Id0tcA7S/I4ue4+SS4lH2NXFQ07Rst9ytE8Yb36TclTtPqHMgnK6Tk8gUHMJkqbb+3tpZiOfTjEIo1g6MzDLIxj7BuLbSVxo1rhmoEdYxoY8Q+Wg4hF2qeTUkHuPGPcY+DfdeAjElaKUU0tybTpxv/XGbxTTWVb0jYkHJMvfRFJ49EDbl4bDhc5ABvA7229vtEV7coV5/rYJ0NOkDP6w+v2bxOYxqWXyxo1YaUiFbfN1Aj6WbeGMgSQYbG19WVufjN7P2+oLpP3DPL8nKEEyS/RlhgYIcWsQu1hnaAiOGq62dO5pLZMv/A960Q/vkISpwYnPI0S7qKuf7NlOjScxLuXq0MgJUxHpJRPbbgNUwNmO56ffAwTydJ7pyACl3eVoTbI07Yyx8xM26nhZb/o2K9XVe2c3c9ZjY/vTdKvPsIu9pigtEvtdUG7dKrp74bbYl76XXIndGfGrZ54osmhlQt09kN2jOHDatUPsBUJThoz037qyq/rdCnwZmBUYv0/sg/87eCRUMJkV7jPYMGQB1v19jDegBIcjzRh9ZnY9M8IVIPPNlqOiufc5QH7reyT50VR3uI5Dh/3YlUzUSyBuHjzAgz0iMG9ukG71OCN/AtzZHQWNTphTn8f9gDqIcPh2PA6dIsnTeNre3osP24KiwRyTEYYs+tqbnBTEqqM5Efz26I7II10T6VaVPW0iol/wawM7On9jJkoBpRicfNpPciTkaTErdElGiiPrZvcsrKg+r00q62XJUZsdumIdAQvTVFhQFFwfzYp+CeqBxSsCwIB0rFDuMaNzmK2uOElSJb6BVrJmCxIE+NTqRBID0xETKwShICaBITCdt1rBSraLdqusP63ru+6jm3sWEJpbsJPQYncwcRKNd2d6PrObOhN5oRt9OICw8z2k21+XyrgDTv5gwgAZ5d79qeRS+cA1en5mlH1kw9JV5Qla9HOVhClsPpleetpjYkrpVrcioVxHAzs5VIsEmLU77eoqXlW9oZKWfH5+fSOftRj7XGV1VlUOt3OYAcNBGHgO6+8tsZz8l31CA1kg9/vAAWkdzgV533ok7NIctK9A/os7FOAIphNNrrrtD88aX+bTUg6j9QOQNBfKceWwMcA2JMa9S3B2WTb2fPxgEWkRyfrR9OhgdRHn4qF+uhQuz82OPNh0UH4ao14A0jpavTaDDqUH1VqaxuhvaZHsWNJXhg== 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)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: O89QqK9LveEuYtCe13/qYH6XjI0sRKtQxFz6Plrlqx60vIegk7WAQ8v8U5DDuq8H5jDs6N0CeD4C8IcualfryQuv5NDD6mRSZc+f/Bedb/wxsAJEHXjQomJ3tlKKojYMqu5nnLLXJsl0MWeWPzBNcIIP7WnmLj3dEAvBNrMu958999bie6meWxvpIjdpWnJisvVlCIwxVxxooBrhFDj78Bcd639QiAC2tv4ftsDUk6CCdzm3B2I82y7mBeDYh4rvU7Hv/jybnJctCFrTW3QLZizyDwS62fwg8+RNkAiRPwPVtbBX2EEPmAHLRzGQdkwdXjeW8cg4jMWQnFKNQ6L6A6I1lXySMGMYudROGRJcX0mQ2ZOc4Gfq9+YchBes918as3vFNXcXctUYK4bkaky1kt+hWw5i+kyr1GyD2EOsU2298/jJ874UqU3Ir3pZTrD+qI9+2kyH8w7q57CnzJJJQ/hY7WTEdvU3clnvONuIuscfUt+fvfjte7Rt4l23EDkcH8xOsxGVtfdcfqXkN1fr0C4I5m5PNIp5O1TdEo0IWpH2tqEGPUR2MX8K2eRl+KL+iI7mu4J5VCNYM+JkgdKioKoajkFLxsA7o9Bi49O5Y+Dc/uDVlYjZ4zF6WPcIbA81pmpAHTTiPPtTFKrXlQtEhgasZjPs2z9rC7G4K/bPfdZrYN02+hebsZH7VwoXJeAtkdGyUsDMneSgKzPyg2m1ywR7NdKLJsxEl7cSfHVmFjMN7hE7vyvEkvOpu4uAd7BmLmrMNCnlcF6yd0VBpFrkQV1P4U2dMWeimRuvs2bdaXskI+2QwhDIuHvBQEVGRDzQPxn6f4cDevuXHCKIjF1yaYn/2a4vC8AxXo01RhmD0gvFHNbnA5wjv17RCQulVUEJ0ZKSjsh9dSOU6X7XLt858kqzfT7TOPCuZarxqizLk5tYd3n5aTWbcJsMDSE34eWy7Rjunm5Zay/OG3pUJmmIJf402bM0nARKU/s+lVwkhB6/ediHOHONf+N8CE2ntEhu4mYW0gnt4MH4USk3rQcc2o74J4ZRIsh8iNRs7aFaiOV1VDMhyGMwXgaQwOmXHCdX0K4mP4GFItt4ZH8T72ozJ0cRVHV7LaNNSMTNwhAC4VONIfRbcCXboJfKzQGi/1Om0HelE014BZztl7C3LmluknYLbkmuksuscfg4H1kApQ15j6twNsFzoyIuBhMWzdr7r5UCeyc5NCsHNJPAZ8oe874YjwBe0seD00eK20Ydjm6Q2QYvDK5wu6mQc9UuNMvczaBQyZRo4Pbl1XZIi6hiok4kCWL+bH3pk8p7T8eJEceJNM/sO8F6ucAWxw0/oytbz2tTaC6tAQeDzBlpphgJdeCJI/A/1oJ8s5Oiawr6TKWJI2rJGqacduGhQf8BEznCbNJn+nHP97/lv3gOu/tqA0NdMOWKUlvh4NsPSSI7EkycSJfL3B/kysLZh54B020Dn24d5XSHUuNri6hPHakzk9nHr/kFomFGHE0lRTHbi/UrmgPXpZffHn7oGhV09qhJTFRdpk/ROBtykLqJNs1sB2VfN3xicIUzYp5kC5Rdl+JCyDKqtCmm0vcnFN05l8xYaZ+W7Pke/KONYuFP949SanfNFaQRzGQFELiRPlE83U0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27e83857-26ab-46fc-dc09-08dcb4e6d5ac 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:37:50.1437 (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: ZvtkxgYDxWRdL6++nCXu/dTJjGjqw0DfIE2yUbdpXBQJtRZJrUl8B5+aVMDus2dBw3YGhayLAzNN8bMastwhRddxXX68kxne1tAyxq5bk+3+ugYu6YrgON+Va9vFlDye X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: RXV4U5IOWH7D6DCQR4LHSIVIUVXKN2SF X-Message-ID-Hash: RXV4U5IOWH7D6DCQR4LHSIVIUVXKN2SF 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/drivers/aloop.c | 18 +++++++++--------- sound/drivers/dummy.c | 2 +- sound/drivers/pcmtest.c | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c index 439d12ad87879..9d33aef59e95b 100644 --- a/sound/drivers/aloop.c +++ b/sound/drivers/aloop.c @@ -193,7 +193,7 @@ static inline struct loopback_setup *get_setup(struct loopback_pcm *dpcm) { int device = dpcm->substream->pstr->pcm->device; - if (dpcm->substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dpcm->substream)) device ^= 1; return &dpcm->loopback->setup[dpcm->substream->number][device]; } @@ -341,7 +341,7 @@ static int loopback_check_format(struct loopback_cable *cable, int stream) int check; if (cable->valid != CABLE_VALID_BOTH) { - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) goto __notify; return 0; } @@ -356,7 +356,7 @@ static int loopback_check_format(struct loopback_cable *cable, int stream) is_access_interleaved(cruntime->access); if (!check) return 0; - if (stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(stream)) { return -EIO; } else { snd_pcm_stop(cable->streams[SNDRV_PCM_STREAM_CAPTURE]-> @@ -418,7 +418,7 @@ static int loopback_trigger(struct snd_pcm_substream *substream, int cmd) cable->pause &= ~stream; err = cable->ops->start(dpcm); spin_unlock(&cable->lock); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) loopback_active_notify(dpcm); break; case SNDRV_PCM_TRIGGER_STOP: @@ -427,7 +427,7 @@ static int loopback_trigger(struct snd_pcm_substream *substream, int cmd) cable->pause &= ~stream; err = cable->ops->stop(dpcm); spin_unlock(&cable->lock); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) loopback_active_notify(dpcm); break; case SNDRV_PCM_TRIGGER_PAUSE_PUSH: @@ -436,7 +436,7 @@ static int loopback_trigger(struct snd_pcm_substream *substream, int cmd) cable->pause |= stream; err = cable->ops->stop(dpcm); spin_unlock(&cable->lock); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) loopback_active_notify(dpcm); break; case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: @@ -446,7 +446,7 @@ static int loopback_trigger(struct snd_pcm_substream *substream, int cmd) cable->pause &= ~stream; err = cable->ops->start(dpcm); spin_unlock(&cable->lock); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) loopback_active_notify(dpcm); break; default: @@ -497,7 +497,7 @@ static int loopback_prepare(struct snd_pcm_substream *substream) dpcm->buf_pos = 0; dpcm->pcm_buffer_size = frames_to_bytes(runtime, runtime->buffer_size); dpcm->channel_buf_n = dpcm->pcm_buffer_size / runtime->channels; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { /* clear capture buffer */ dpcm->silent_size = dpcm->pcm_buffer_size; snd_pcm_format_set_silence(runtime->format, runtime->dma_area, @@ -513,7 +513,7 @@ static int loopback_prepare(struct snd_pcm_substream *substream) mutex_lock(&dpcm->loopback->cable_lock); if (!(cable->valid & ~(1 << substream->stream)) || (get_setup(dpcm)->notify && - substream->stream == SNDRV_PCM_STREAM_PLAYBACK)) + snd_pcm_is_playback(substream))) params_change(substream); cable->valid |= 1 << substream->stream; mutex_unlock(&dpcm->loopback->cable_lock); diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index 52ff6ac3f7435..5e440f952449e 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c @@ -570,7 +570,7 @@ static int dummy_pcm_open(struct snd_pcm_substream *substream) if (model == NULL) return 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (model->playback_constraints) err = model->playback_constraints(substream->runtime); } else { diff --git a/sound/drivers/pcmtest.c b/sound/drivers/pcmtest.c index 21cefaf5419aa..ae308ede80929 100644 --- a/sound/drivers/pcmtest.c +++ b/sound/drivers/pcmtest.c @@ -351,9 +351,9 @@ static void timer_timeout(struct timer_list *data) if (v_iter->suspend) return; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && !v_iter->is_buf_corrupted) + if (snd_pcm_is_playback(substream) && !v_iter->is_buf_corrupted) check_buf_block(v_iter, substream->runtime); - else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + else if (snd_pcm_is_capture(substream)) fill_block(v_iter, substream->runtime); else inc_buf_pos(v_iter, v_iter->b_rw, substream->runtime->dma_bytes); From patchwork Mon Aug 5 00:37:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816793 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 195B3C3DA64 for ; Mon, 5 Aug 2024 00:49:39 +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 625704E3E; Mon, 5 Aug 2024 02:47:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 625704E3E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818889; bh=1yEQuyHIzoT2eoAhdru3hXRTCu2g+dQM5Ell5eKAl8c=; 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=ad46ZM0ai+RzUM5iY8jSTBCWjlktb9vmrof6cbZUh80mScaovlV+jOxd9vWcsK8Y3 OhjLkzooHGW5woKTt1MLBRR7iRX5GiNAKsUDl1l27SNOd2gjm+Md/zrpLJqEpOdx9z svc7ozasoSq/3xu7DgYEGL7Rp6TSVaSFMvnirXQM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1E350F80616; Mon, 5 Aug 2024 02:39:36 +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 27A1DF898CA; Mon, 5 Aug 2024 02:39:36 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 84732F802DB; Mon, 5 Aug 2024 02:38:00 +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 3880AF800B0 for ; Mon, 5 Aug 2024 02:37:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3880AF800B0 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=DziOK/V2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OlHVtYHJ0Zobg9p4gdtfLsYQidHmRS19HZvDcaiAKnLRNnkB5lUkN7X8dfsD4eZ4xwtJM8PU41CG8PIKSoEeKx7fQmeHqFmnslfFJmn4ahW+Ewwuc80bsUUm6bMHnqgmSrVP295eKVoOZDhU2japg0AapUKrFmjnUCZjxRmVYKzdluyhCqpmMPqvjJabztsIpd2IsglW4x0SPFPfCrJWcul3EZ5Fk6e4ZBQ/ldYwa/Mxjry5Mux3RSk3/gDYVNawvHbGbRcrstgD1c/bobZLBQ/Cfg4hTs0I/SkrCYa8yJZQiJ3M4Hzuo9eMESM/U0vAVGcM0Eu4bCjUfz5T/9iyAQ== 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=od4JF1EE18ALyLXED/p+4+5yxyPsJ4a+WL1HygEqqrA=; b=vCNxHK2GO7PhZxKYhyBaVh2/f010fMAsoj8Ut835KtzZEKBQLMJCiHv8/yRc5RAcF8gTVDA1pIEAiyKDUs2lJy4C7IIA2n3ftB06vPSKR91hDbExN8Afbqo7wx5lULqbYLLOwZ2Tf4CUU4IBvRyRICCKV7uX+WoBNFtn0x9JJi49niN4iVhr60AGbZLK4VZR/zvMRgLlpJz2jqV9Qy5IqHB/lSCSSGsulELLK1i1Ktkce0QZ50pMiLxTyNztfs1gM87R8qm6rEaBArjCdN71TrH5UVgEd10hdDEZp2jGXBGGLLpQNhI6DWEnAqLrmHKrbR7WsjNGr1CBzpIM93w+Gw== 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=od4JF1EE18ALyLXED/p+4+5yxyPsJ4a+WL1HygEqqrA=; b=DziOK/V2niv9pesDO7qFoNTzzkCZEAmVxSv8mSF9pk3AsB7f6l9AVZY+44LUMmpJ3+ZahuaMO+f7A0+MgZC2wU2x1IfbXIwb5sjlIZ+joe5wTHbVjUAZ9CW3tLt/i7k5DuH+c6Gm3N54ROp56JE/poDlEb1oFFVg8rsZmKJ+tMs= 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 TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::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:37:55 +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:37:55 +0000 Message-ID: <87plqnztwd.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 035/113] ALSA: firewire: motu: 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:37:54 +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_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: b5af83df-f2d3-4b14-4ef8-08dcb4e6d893 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: gujUsG68Z3GuAwiFkrZnL/mHyvXgojAcIP5/Idid+TxPjeqCn4nKX05+/Au5hdstwHEJ1j2oqaxKbtt67xQuMqjSpn7LPj8Z5k7W0qQL/iKvROu/5f5wyZz+jt4JkowNB/kCCt2hGyGZ0MHOmBLUiwtofmc6AqVygaacRDQ7pHcgSqQRUaUhGX8VVT7o0baCpbvr0OXeA8fDwMPYoWcHH2qU5k7I0NIylAATJf7p8aY6cBOR7Q8H6tLMYO4dIj0MB0pQWN4KCQoz3cgCkFkW7whoTo3q+fNregtmbMuhq/Mq7j6hFB/hRGdTXoI1wb9ARnyRMcKHZRSuR0sYBNpks+keQZfmT7VmpulA819ADf1TAGNSAUtKMaBTos2W4C7yqttt+X4KugrLugRZ/5/Ng4O8eh3FmV387Ysk2cjEtYwh7Wf8/zW7CYPKUsqiFgFG/MThXLDBwhqky0SUj08S+ZRmWvYCez+RcaFdoq443cQKvFc1qJ34/2cfR5i7lOYRJhACDYD8qvXehUR1MTX8y6m4Yd/lO7BH4CR4kSMHW9znen70Ll/M7hFy640lHiLDeI7Oy0xv+uT6BgfVBXeG//RIBiODY0EBFdHsT2XWHydd/zvZtVfHCxJVpNZAipj0iTLigJK9Gv402wIwckRDKUJBQDz+i0Bez69eGYhmyr9enEagYgbQX2GOI70HMTTfV8hFXbg1J09Z9Z6/JAKwCrosgzxOlSRY04RQzT5RQiw7OD+1QQqPJQ0NBj3KRtP4NVIkvsbbXmDEs11ncEr/gEvHY1j4tPKiGiiFHssvmuWD0+56FaJS86nGCFU3sClMHXjMZRfu7zdclKDZYlelQFrRO+stRUr/xbWSrZiDlgrG6Ww0h1wf4ze1hGKQZMqGeLjK7TLTPVcM/JWnxMVtc4d4QpwoJ/ALtGi+VBGYs+g550usuTZeLlMlFMpD4nAFUvfIB2lABBteLyWeXKbKroHybICqKCBcivlzZxpNjq/ad+diAdh6eEiSgyBLijHrxTTfGxc8T7nBD8/EcxW0OdEagkXFzU2HyN9CH6b9hTE4yHT9Y+5t/Yaz3raaBwy0dvwJcpdFFRXlCbmdhLIoizyiFwuJrPeMWBt72pARgnCfitskAWT3bqaOud5qp1TYeOReXTR/izhgFLQTRNcWSfa2yxQHHDDsSzbwamDNqgoPhbGNSwMzTzffkLcUapTBsY0jBYTqKCzhyTpSjfbLJKifPC3dNbQ+/RKv170f4w0rkWl3DJM1j+DMavCX6/8cS04qDdyCpYnSgHmcr2Gi8Qa7ihp8/Nu9WMWA1cdfQ1VsfdSLeaJjZ7KR62Nsghf3WmPypCQQTPc/tQPoJpECzuWizunEsPwMbUet13wUjp7UP5x79F9RJzwN8N4KWv45QXPatQ+JK1BXs5m1dj8Lcg== 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)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: w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YFcxkGf9nZLsbBywpDi/9cw4pLaWAiHlfRarzQn0YG4+EMeQjIHQq+qW+9jj5df3pKBFzD/5iy4+H/aO/HIoXMlZabSVZtHN1llPi4V6hNLdAfTLdhqyTpGDJ6HBQfrhmxFdU/3LnyFXmos1W1SXt1R3c+qk62Isvml3KBaVjOXVfEs4Dd0cA3KYppkthwx0N+wqc0K6sWb9kUjB0lyj8+XTw6sQcx1HB+2YBulptUZEElXIpczja0UpFHtmWprwzDqTiU6z1o1LV8i7st1yHjYfwUxgfDMPf34cnXLEaZWUXOHcV0u5NroiOarzmrxrEQd/aeRpMwW+nSv9I+QjPJ0b7k6fyQiXAMYhwg4XFNsAeo3BUwOpqlPDcKnnGQ9AtjUX2DuZQr8SEmgTTEVJa2r1tT0MNqeMyzJuLSl+WPVmRskolb1kbx9m5hMIU4wwRjZRwtr4JpFs3I7Dt7CdQ5HOUxkWzjxl/DHrIY7pXrmqTDLWYCeVg3CvvImWJsnAZwthmioxa4fKRabhGrzmPJ4KwhkuT+44MwgLkBkSyM0H9io= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: b5af83df-f2d3-4b14-4ef8-08dcb4e6d893 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:37:54.9494 (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: u0g0ZEdnN2BUoIavW7FSOMMKN+76Ipt/pG10ygmM44MCF+q2dc14u6SHlK66+YURzHKFLgF7SEql3lZGxmj8MxEiQYuGSn4y87tDNx03hFPOj4Bj3e5iS0wS03fqdFUU X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: 26O4DSZNZYRG6NLU66CK3XHIOT6RJGJO X-Message-ID-Hash: 26O4DSZNZYRG6NLU66CK3XHIOT6RJGJO 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/firewire/motu/motu-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/motu/motu-pcm.c b/sound/firewire/motu/motu-pcm.c index d410c2efbde57..411d2b3dccbb8 100644 --- a/sound/firewire/motu/motu-pcm.c +++ b/sound/firewire/motu/motu-pcm.c @@ -101,7 +101,7 @@ static int init_hw_info(struct snd_motu *motu, struct snd_motu_packet_format *formats; int err; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { hw->formats = SNDRV_PCM_FMTBIT_S32; stream = &motu->tx_stream; formats = &motu->tx_packet_formats; From patchwork Mon Aug 5 00:37:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817105 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 1A5DDC3DA7F for ; Mon, 5 Aug 2024 00:52:50 +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 7B72250B2; Mon, 5 Aug 2024 02:51:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7B72250B2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819085; bh=s4ttF09PIwfgLQmzw9LZqIwH70GVJX8Aei/bs+/cH+Q=; 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=UflGVE3eHb4KJKSrSZ7+5EHMy2kgZ2a0bNdJgtklbJONGuKTsR61nfaICyAmB06pk 2RIS3RY97w/n1bR7F7hhQTMasHglkPWAQIq6KWDNCiK0hFhw5wKxajyF2Vq7Uyx71P u8ijABcrlIvPZBUHgrJJkFEJ9/X3IQ9ztKr14puI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id DD3D7F89911; Mon, 5 Aug 2024 02:39:38 +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 81B75F808F5; Mon, 5 Aug 2024 02:39:37 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 82016F802DB; Mon, 5 Aug 2024 02:38:05 +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 09775F800BF for ; Mon, 5 Aug 2024 02:38:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 09775F800BF 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=kWnUkkni ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mdlzyEXNPKkK45qAdzRt273gWB3ZcENUp21qM3cllHUwXk4iHWOr3e0y36ycmRa3fBwlsHLWtIwFJmfFKWdFfp9x9KzAIaRLgkPre7eeCx4lQiH60iix+1tEWTg+30YYfY6o3AkQ+50mVw35KNmyXgrDeCXuB9xYOZwbFJlG+ihqoS/0YGQM0sjQ+ceeMjBOOfWlQDD19ztDXJv8C4iOnrICJbuOuTB07wUyy3wKRxQssT/deEXqM4Pn30JyY48+ahl6d/3KfAByEgPwVmj0mVoUGrEjiSRpAx3hlWmJIUH9Cg0UY50kGxR0msLggUt66wRRMWPjdPfchAwIOosqcw== 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=jovqRBzEtXrZT+MXCP4/uH2eQxe35LQMDQmD4cxTZ20=; b=y+Nz2UbaNAt2CSYDhIbNTLTTf5I3qfthbaFadZvDtcpkE9SPpg97nxSxNGHJ1rPFbehePy5p/IzQ990JTX1DEuV9/geNbccXgFIqO2fFhfpBTO+TW42qA9bOZZyAfzst4ZFzHvVvzG8DTYr47BllzKkGsrAnzD7fRlksH4I56w7UM/C1XhkQnRUHGeZqHM+EiZJfsRxp15IYJsCts837puoy7xXPnHP89YKZqYIHES7GfbJI9yonAybY+Ktom6kHwcWV87AbCmpo9Fsi6jmdrTWmsyPta0Q4B8/bq8psUKcGQd88BNOFJ+mbZoIatH4JOKEJJIVvusqLaaL3WzVO4A== 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=jovqRBzEtXrZT+MXCP4/uH2eQxe35LQMDQmD4cxTZ20=; b=kWnUkkniaR82tRG9rv6w4VQeNxFvBoaHq/eEFHNrl7XWUCG38IGCozdA7wy18YiDx/EmDkMKL3Ur1UgnqeTkDmi6LNIX6S7EXJ1bcMmoeWKy833b+qCwy6ktXvk/76QTpikwj7l0NxJy280JC3sK3pHN++BSXcETWMKC1WGmNX4= 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 TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::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:37:59 +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:37:59 +0000 Message-ID: <87o767ztw8.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 036/113] ALSA: firewire: oxfw: 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:37:59 +0000 X-ClientProxiedBy: TYCP286CA0212.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c5::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_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: 3c69c696-cdd3-4dbf-8514-08dcb4e6db64 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: KRo3ZJ8AfL65lb+ElgEEVZcFfcXtVR3CO6BxK0SHBD8p932mJLgkcfiBlCOoGfoma1jdW878/H/m2IAktJON0tx6s7eLcymyWsiKkzS+HlAwLWkw7x5KkYLlWEOQqxMn8DTsXloWpFsdSpypbKsm49Gix/9LLiGFWLoLLViirIs7jac6TJ67Boso02UM5w0b6HyOhd/Yo44xI9VwyZ5fAPR1FQKj94P6VW4cVzbXiUpzLQtUwm9R15QryErE9KmBiFuyEnXHP767+fSjgYTotEqG91bLcsfhILQgOZcVLKR2nlF/A/Px6HPpbjmS1jCsS0aok1ARPO3ydDsrqW02Rty5KCgp18ZYPJoE/HBmx9dWLCut6ClGQJ82z0v0yDYilbsap6vu28Jf21DYaapog6S3i/zXQrJGaLW/OBZqlUUYNCv3X0v5oobJ+AaF+VM/u5TN44bebc1pVed8R3mNiZWyQCKANfX8DRNgEow7aFfJV5pC9kpduWQ83NQt2NwdgSb37LRCbQRYHg2qs0G4E3PiBTVrCKD109tVpxeImqox9dx4tOyBLRWOdGo7K7DPd89betVy+T8GJPJTT1nYVuHw/qYTepe1wswR5utJQrxr96uSv/tJK1wSGpw5q0+JI1GPqFlznVsUg9ziHPtZ5oSOsaCdozIm8WJfQXqiPMMUT0PiBp2Re67ZwnNlQ9esF8fuH/V4NKE9hDmths8ZyygyCS5//udUf9OTWe2Bl9Y5dZnNtjtko95CgH4WCUE5lenqvMZttDiDKmgVIRmKlLWn3l6fgjo0gVI6QfWVchWt7JJxRf/STzCT1LLSqJ7B2WcqctdTzjIIfrD1CogU7ioJDVVX6R6jQu99B3N8/diXVqoi0XmYx+h/WScBtcHEpqTBhywJjk448OWH7Yq+/agzmBObIX+e1O9vqwe265zutbco0IqTSgfABaId7f1GPGdS3eQErBDs7iO8CqfFy7IZw79KeAOd8k6V6TFyHew8kaJDdTMyI2e7Lfgj9M1WSCGHL4QUoWOacti9LKxq2CcFyh2NPYM/dFTRMg36QaiCGcsYPm3BDumrJRaC823qcT7DLNbD8r3HOihtH7XemUis/+eI/MR3WW3WY6DX+mYBMOeTjXBbZyrZydMvoQ4dD7ze6g4y+oLE/pwkRSjztF/KorPoJik5QcBhGWEm7DmpHYCftfrT8orgEEi4QZYtXQwVIG7BxJrAqv7BOyOYqLsNdo6bhLTTI9Gqhzxx3QfRVOlvnGwlVvtlRSJC/muJVVjEqF6Oe91sDkmCGOGTP4GX7grG/mytqmXhxRLS9J5EEOfsief1nI+QQm1n/GekjcO4cOraliY7jPl4fovue8KytFYFhUwZjcXGsY5i1E3RxFBfcefj9M2tLElXq2TJfZrLgyN43QMjRVGh2WT8WA== 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)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QeVO7Zd9skfyfBFO0gPRuS/xuA/7xK7xKnTKoa5Y39PY9Vb80ziHiThzv309+QAV2YXZT3fdK4q3S6WsHtlzB0IqysHd93yibuynqXLx8LMa/+qLabhyYdO1qQ43qVSWi2qcMO/Z5y5sTIB3ggzvV2OYDgwVtwUoAhDkG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P/6PobPpjIG4oFIcSad8VePTCvDnMfYPHuisofRmlwHQJ8WcnBvF0Mrb9uXQLUpkd0X/WEVa6MSU9nXy5eAI5CRLToTMKp3hUMgG/juIaWM4rwPKzHAwcBR/DIngyKIZ5IW+rrBNZDr8ElX3Z1njDO/txK7zv5wLCbb2lpbD8DJ3SN+dK4sJfAFVn4d6j0Gu35C+86Z+e8pmRcJlVsC0wULd+w5+TvtQDtCnHFTWkq8FDzmGzSE2Aw+pfvzURBBNDMBmW3k4NvM5H2JnvLgzfH4b4IHGHZegTbcewpzv2BCxPbJuSACxxmY/yl8txJR+lvyvdFvjkPa5On0ku0TsDdtxi5RDSoq+7tK3QmNghfiEyfubAelH229+wPW4Akl1K2TeKgnhs0Ceak7sWI= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3c69c696-cdd3-4dbf-8514-08dcb4e6db64 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:37:59.6812 (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: odP4ActdDrgr5sxL8W+KSbWuZzfXLkZ9K429x4kSyjfe/AY2MEmqBUxl+6yucL79HyfMOdMNzxBeS93ZYNuTI/oEDHw3JwKkmWw1pomlEqYhgn6NhkP7SAttiYv2cfaG X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: BI3N77S7HBOXZ44EGQD2PMQGR7WTJ63G X-Message-ID-Hash: BI3N77S7HBOXZ44EGQD2PMQGR7WTJ63G 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/firewire/oxfw/oxfw-pcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/firewire/oxfw/oxfw-pcm.c b/sound/firewire/oxfw/oxfw-pcm.c index 5f43a0b826d2e..c0e67a0d10f1b 100644 --- a/sound/firewire/oxfw/oxfw-pcm.c +++ b/sound/firewire/oxfw/oxfw-pcm.c @@ -114,7 +114,7 @@ static int init_hw_params(struct snd_oxfw *oxfw, struct amdtp_stream *stream; int err; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { runtime->hw.formats = AM824_IN_PCM_FORMAT_BITS; stream = &oxfw->tx_stream; formats = oxfw->tx_stream_formats; @@ -150,7 +150,7 @@ static int limit_to_current_params(struct snd_pcm_substream *substream) enum avc_general_plug_dir dir; int err; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) dir = AVC_GENERAL_PLUG_DIR_OUT; else dir = AVC_GENERAL_PLUG_DIR_IN; From patchwork Mon Aug 5 00:38:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817107 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 49C82C3DA64 for ; Mon, 5 Aug 2024 00:52:13 +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 0563A5046; Mon, 5 Aug 2024 02:50:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0563A5046 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819046; bh=bAV5BV0q06/Z0Yt8or/mXIzxAHdygLVgFo0G1yPUBoM=; 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=XTOeYBpAH01MCKdAGW0bYtlV9DZtr7n+p8mBC+1tUnaRqMtqZu/AFhGhxv/aN8Hhf nP4k/SO/1OBQMZO06hd0ytpj8V/CvH57SvZunfRAHpVzKu7diZUSVPMxlZ4ho3TeNa VeaI04LqBHEI34IQ4HZoF9KD4B1R54vnC2dt7NOE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id AB7ABF89967; Mon, 5 Aug 2024 02:39:39 +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 E4529F805DF; Mon, 5 Aug 2024 02:39:38 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 72682F802DB; Mon, 5 Aug 2024 02:38:19 +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 B9A88F800B0 for ; Mon, 5 Aug 2024 02:38:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B9A88F800B0 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=HiYNh3/R ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YgSvy/IWG2jDEec4gCf152IcftuhqFMhxS1hmDLur2sYQJz4Uhidf8aiqPOucLtXuo8HPl7A9crZmTjtJvrYABSAAR7CiPVYhzQ/lqrvFYFvipICN7dXgqRB3aREHAWtFAgIagaiFiAoWMzkPSZD0OpuYb+mk2jDosz0NOenDiTq+vx4F94xxBT6bXGG3gp7vS5c1NWgzjknWFQFBekPqnu66HX/gXmQUijg0iOkePPURZglwenM+PVNBcRdqFA68kgQ9tv5WXtauguggSAzJLQOgqKcR8MCsFF3JWKb1GwDcFAIliq6uHo54rz+8MvC8Md1qFbTuGCHqb2nGykpsQ== 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=oW6KHFXVwx8L0pEHeBT87ZUc3ogZn+4saFVcPvn+Cmo=; b=u3qHh22Dqvmmk5ntOsJdFepoeIvfQzckuMOSWJpf96DFbkqTSPu+444Pcs67RZuhh3J0Q78vcz3zPU/LFKTPzaUHCFyPZwI8KOu9oqak2dDvqw2VEfX5yO3NHFgrby5jI8svRgIxZM6BGt+yjB0SVqgEk+546aQ1O9nSsdLKkBXNlwal++IbaT53o7dX1+653FEsJ0mJ9gOpuf7HfGQVAdPTjBCdj/9qUrU+nQW08XOif9WdJh1C9TBoS7dkXprKYgBqC6Uov6QhDYtL2zFSwHVsQRE8UcifEMKS8GrRQKQ/glNubqxgnF424bbtn4TZP2UQBIHpNo7dJx9xim4f4w== 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=oW6KHFXVwx8L0pEHeBT87ZUc3ogZn+4saFVcPvn+Cmo=; b=HiYNh3/RouNdCGcHjrTEMM+a3guXaMvbWkxAXxZABKOaI4kNxWGxwvriCDRuiXf6kDyDO8BwrzOQhJ70KxhfrSZdSColTkGJqgA1jqBKZ16IziiINwVupkthHJyZP3n89N6KjNC3nxUgRCJa1AzryV4ZjRYJ6HS5VskYTONw1qk= 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 TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::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:38:13 +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:38:13 +0000 Message-ID: <87mslrztw2.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 037/113] ALSA: firewire: dice: 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:38:13 +0000 X-ClientProxiedBy: TYCPR01CA0009.jpnprd01.prod.outlook.com (2603:1096:405::21) To TY3PR01MB10906.jpnprd01.prod.outlook.com (2603:1096:400:3af::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: c7574b2a-e52b-412d-7830-08dcb4e6e38d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: 5d1fGPFSU+gfVJwdLp+n5E7DRKF3FyWXg9qIh9T20CVLwcfxpNRGXEAbeD+V+wsTGaVHsFc1fBhzerDjoxWH3gJ1THWk8ZMuOrQDdbfKL/EDw1793KdkEuoksYIKtb7zHzcitRWvAyh+3h73gdATPPeE6qNqfqZHGiVSRn0WmdfjHCNomCf9c54TE4MJlME3/yjdZbn8S+q/BipLAqeJZMnr0MGnaNl+K8+7GuN4ymKoAQEMD0KpSdFBmY4z4hkrCJADAH59/xhngOrAl6FmkDyOJvJ8yhRGp1lS8diRAJwKDOGSJ4POM+JxTLhiDk3uPOHmGu2qE9F93mRvD90P19tVzoVS3UxoE9WVCKcL45ha/aHrkBpdm7Io44WRecjj6IzNsZ0AosV72sEUBuQsat6axr+Rk0L7ZY9LZpfFR8v5VIhAAH6A+jgMVpwQxmZ5DgTj3u8x7N89ap2wpSiFBA4dWeDQNe/g1VAe1P9ntyQRpmXHp+K2zhcdJAbv48rJ6NnJu2qS8BAooFYnRPLJk/rTZhaQkdfvimfM+cEW+vDRP2g97Z58PrKj7oKTbjwx7Q7OLZ933t66i1ePYAAt+6ecYmtLuqJes5oxNd9B7gb7ihGq5CU3Fo7qxjaL7lPTuSY4M/JDNcL01dib3M1hCOvNiBlMAoWXNM06LazqfIWiocjeLeVgSmyj+Y+2VZouuMaN2TC2N6JFYcA1155tEdgOFmEVVw+5CxULlfZHGRWHRwD27IiUyMRVZCMwt95vzLf2QkCrd3ymqMZicLcl3mY+I7/k81A+r15KXVgU2BkISq4UxoFqQMlhjCsJLSasrqJiI2i0dsXibhK5I961oDCJMiGSqumLk8hpmTMVyGXNZzoBawFD7rUyNK6xvwqQevB2WTvRf9pVTMOogL/IC6oh6PJ8lBQiMlw+7iGcaJ1oVJMYXunaXLaEtLY9LxiINtsYJM17OWo0qDDl98xUQvfBN3KKBaBU7i9q+7jTCpvSGfGY5eDLA16xjHelRmtH9HBVHCRX8e++nJfowzMYety2ek3IS/OAYf9uiJWInpCj8uO1g8AEnmDGk6FNADRq23Qa9qh/Sa8LjA2B9uOENrGOO5ohAHaeUFDF2q0BN/nVBJJ0+BFXDK/lmQANnEjic3cl15uVG3HE1G0SYNtcaQoOvKOqv6Oa+CHvAqcWp5PUUm77PcpisVS1aq+xq1LPhllgdnWOBZjl9vuWX8cZ9G/4hCQbY/TmzZxfwojTyakS0oJwQcScMGzSHyBUM8seSkk746KJjqMCJY7yC2c4j/1dKVteMYObASmB5WXgZ6JhJJIqe/YqqWjLzX/GA5IT34sdoptoZPWodoYEQTKVlLPBUDRnY7u0h/VtiM9Plij56/Bwn7B7JMNdZkQD7bBoSdq+y3xWNcg+oL93f6kFcA== 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)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tvNizW7iq/mOEAHkNicvxfJukZt0k6z0K+DgK/O24VbMoL7cWQ6T2IlyCBE/9fRWI0d6bC63XhynrM6uCzP6Cmd1J9drlr41sT9H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YQzW0g5Ui/g0iH9TyIqZ4XTS1M5nIbcxmzbo4BTT/bNHFi6L4T0xaIk6gHVXfkW9UFN6hXMuoBVbI7pO9v+EOijq93N+33ySnrJJwgvEZIBzY0h3f6bTx0SeHrppIkcyY+FqRFLbjpRqvIQGNgihq6BOblbdht/q8+k9n2yB/jpj43r/eU5PqM8JnWqPxMKjZq1RnbrlWNczBLiYZ4NjrS4ajSuVuBqGqzpFHwAOwBWrce4/jCld4FoGt15QRKb6idEG5qBO5SnsYA3XNChSULRs51Xx2tC+a248t8ZJG2ZJXuNuFF6z0XNIBtK9ntRSuTDJfLcB0+FUZaImpymZgIuISmXpEPD2XOG3/jMHBO/eLiLAGcBgznrQ492zCXt2x29ztWwOuK/8oweGFclZy4AjrhWgcICg+1HI8GMFI6IaQ8TqLKI33y0DY4plG5kxFMdsuB2upy2lyimlpgw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: c7574b2a-e52b-412d-7830-08dcb4e6e38d X-MS-Exchange-CrossTenant-AuthSource: TY3PR01MB10906.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 00:38:13.4970 (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: kvLNXruFDlb1pcZPOu2okS2qblOzcURHQsYrLJlzKGlE3Jk2XSNsCS5eNJckrU8Lcbj8zbDJVPFifq7yKN18K2Ow6fiW3s0NX8jOZnMJGd13da+CQxl9yWvPuaiDdx9g X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: LTDR6TMS7ZUQYJXJ2W7ZKYMYG2MOSMBX X-Message-ID-Hash: LTDR6TMS7ZUQYJXJ2W7ZKYMYG2MOSMBX 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/firewire/dice/dice-pcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/firewire/dice/dice-pcm.c b/sound/firewire/dice/dice-pcm.c index d64366217d572..063e16d153fa5 100644 --- a/sound/firewire/dice/dice-pcm.c +++ b/sound/firewire/dice/dice-pcm.c @@ -26,7 +26,7 @@ static int dice_rate_constraint(struct snd_pcm_hw_params *params, enum snd_dice_rate_mode mode; unsigned int i, rate; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) pcm_channels = dice->tx_pcm_chs[index]; else pcm_channels = dice->rx_pcm_chs[index]; @@ -64,7 +64,7 @@ static int dice_channels_constraint(struct snd_pcm_hw_params *params, enum snd_dice_rate_mode mode; unsigned int i, rate; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) pcm_channels = dice->tx_pcm_chs[index]; else pcm_channels = dice->rx_pcm_chs[index]; @@ -132,7 +132,7 @@ static int init_hw_info(struct snd_dice *dice, struct amdtp_stream *stream; int err; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { hw->formats = AM824_IN_PCM_FORMAT_BITS; dir = AMDTP_IN_STREAM; stream = &dice->tx_stream[index]; From patchwork Mon Aug 5 00:38:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816790 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 52266C3DA64 for ; Mon, 5 Aug 2024 00:51:34 +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 1798C4FD5; Mon, 5 Aug 2024 02:49:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1798C4FD5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819006; bh=1UujL1eLs4rK5a5BAs7CgUYbrOlYm6we5h3bR3Tkk84=; 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=WYuog1KL1JY9a8hLrjucQDBkavDc34+47M8YjPGA33BLd6E8Bp1Q2cFyo87pmC6qD CRr3aAXOqL/jihrGzglXSu9kpgAla9gGc21VB6jXFWqPgvgIJRfupTp/LWYCZdN8Q6 Z0c13f123N1BOwikQlKsbT3+4fNHzKcmsvL++02g= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4BC3CF8996D; Mon, 5 Aug 2024 02:39:40 +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 5CC57F89919; Mon, 5 Aug 2024 02:39:40 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 42C7BF802DB; Mon, 5 Aug 2024 02:38:25 +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 7A5F1F800BF for ; Mon, 5 Aug 2024 02:38:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7A5F1F800BF 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=aIFXTCai ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TNUaQ+NDW/a1wabIIZsVE5m5E38H8+g2tfwT9tgg8f7wIGORZGgDHxeJ+dxGBzzOasX1m5bB04VBo3VPS487l3KHVcYmpZzbWsjEEGD1vG22y2uvNSYY65lCbqw1UFylhn+GIME2GQL1IjlzD0mtaauaJJ03F5mAB2gcW1OxPzRHVHi+p68RMN2JJTQ5BLZ9amMRYQSZ/5kRRfVahnkgH5vcMzkeyozNMrMMJ5MnleHNpxp1P5PKxrm9nalsoqGbTKTRycpDg+1v2t4eBIBlYatqu4G/1LSt61wE9XJEKQ/9QzQlNpzd+aXKDGDjB5/0G/G2UhdsGOEFyjjCJ+L5fQ== 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=x79X8snJ4NKIkcwVBLfwQ3bh8abPmmro7Rwu7naeTIo=; b=g9UoX7O0UnRae7prdziXC4RDPg+Vi7nMUZMorTF3iLF6FJNtUQ+1trLxAn6wUGcSmLhMnuM2UUDy+xItPA4MlTZrTSVWHNCaSYOVb7ycknAEsr7qnuCfHaXyV7+Kzy9pIh5Pl+6gX0J3r32LcvOsQfamhZ2vsffQAnqtcKXlGTTvUfrjoFHL2mtxEbM2BBgaQfPd9PqU1/PpN4g+zTxmFn6valhYtcLkTqa55qbRxixOBKTpFtt3brFffoep8oP00YdyO20Ju6sLkDDpUQWGbJY1Yszq32ROTOb3BIOrNARF3Ohp9+M+mXA70EW/udCyA4zZ6iCcLZoLDRaUAUvbog== 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=x79X8snJ4NKIkcwVBLfwQ3bh8abPmmro7Rwu7naeTIo=; b=aIFXTCainh8RBb4fGpVQ1wiv13M450VxussYrN1fo3aHVZL1sT5xLtmY/+JbqUzdUwGJTBSYOdpQTzRKfVxyT3yaEqpK448OjjIFW2iNKKcZLggX14XoosNSXeZ8Lp8ke9OlNTNMPp6L6tu/Ejny0lniA7yL/obACKeqULp96bA= 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 TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::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:38:19 +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:38:19 +0000 Message-ID: <87le1bztvp.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 038/113] ALSA: firewire: bebob: 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:38:19 +0000 X-ClientProxiedBy: TYCP286CA0335.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:38e::13) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: af0ca22e-5cff-4a8f-e5d6-08dcb4e6e713 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: IMKe6tOdRzFWQibq464USUUb8tA1s5Gfy6ATx+Ir3c5SxIQYjDxQicSdpMc9V5JAztR1CQuUBcEXd6Y6L2F9/yM7icuxV8VJHSR4Vd+DByAHKaws4zeff2bt+3IDdsiz9xO6DN0Ar5lggzH8v37AIrIs5673Mk775iBel2k0mTg5Xjst+mdOaFFnt/dFFDQPH+GuVEhTXoK+ebp3MEdGTgFCAl8ZHZhfk5QskYh5T8UmXvdAyqCaefnCDQi4iuxLtMzz3TgFcnqscpRRZmGfGCIuZOG7kl8NVjz3OHkaTlBGZCfIkyYpo8Gjg5ry6vbCabi4fMnPD/CA+rBAQiCA3LnaFLCCBmH5k2otE9EaUJngirx835Hi5UtW7gEq9W2deLcXo4CQnCj1sDmy2EfEQ0JAGqo6mAlW99JGQ7974PkpOcUbDisZN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B10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uAsp68PVC4paDCg1Q0FkvAhS7S5rXyo0PZJnYyhr8Nl8+2BV7LieT2EO7cb4MTWZBzNeQT7CJ98NvjBQG2w1TkxlovYeCIXUR9E/DZuB3gNth0huMpOdC9P7A+sBdVadBd1AwaP/vfrbgB9j/X3QwAHkBHNjmYffyl28L87FGURIjh45SGHnulZA7Llxjk0bXbqfJL2xlf1+RR7zaLRYiNVllkLFvIFUuWWeVyzDL/T6RCGR7QEQSjHyiuKZbQbwC3ppPe/8GyvB35jqCesbfCDpm3n4LcnSqwui59DSfwtLjhaKdHSPP0n/7yMmQlkqcH8PdA3kSFIVXmprnJ0/yoTq+2Py3ZSxa05PvkvfEnf6DUvmmVB6xdNKDsBUmGZU1kYbb6hsmWIc8Bas1Psfa9dV5x7i0BvJayKIU/eKqg3ngg35B4YyRJyrhSpKc1CxV/3R5xIbxxgDJTqrUAIuDeinGGWfyqqe8qfZ3slzQgUgO0KiLjMbM1/AB1GOJ3eH4wfoPni3OKG56tu/JrZBr5XYGqb8fuo2o1bX4oMYulKy+VM8Gca5mq9mElbYFxRfC9QyI8wUKitHgrAXGmqQP1GatVhDuMN6mjL2euLObbuIgiW0hPdpb2bXXP9qiJV1bnZvrsfhayxo3YNljzCiPfdLuBZXIy1l/V5O0gudvjXxMT9Q3NEyDv9+XhTMqmVuiYnnr7MEQj2G3fa4ZYTybt/1IIKs7+4Y1R5Bb2zDdVmnBVCug87fmVwklLV05et5dkz36UCXtsM7+LuNbZFod3oLzpIimmdEtPHGp8LJfxy3NsCbO1LCvfCFVL1gNpvhqgDvIR1elx4EHLx4AF/2i6YIaim+BdNawa5jRkdAO0gk4f3+OJUhGLTj83C8rB6MTwjfcpv7orHaGI8VjJUW2yNh0yVZbn4aNCTPgBx2Li0IJqBjThgkVvh8PIGihczHTWb0goJ32coroTtjanxj1rNne4iXmGNRij6+STp0Iboi/CcdXSsPxTvY+wlh9TSisWO7wbEBxlxnfea7XT0BWBpHXfh+8euggvkgmaKwp0z/zfntf5p4QVdqIVO3YDYchWpK7eA/9h2K8mIl6Axm2MvjaQl9axacnN85Lc1QhBZqSyh4ahKAFOWUVtS7jzEnTSipo5mOdVvDxizIw4hSMEvwMHM+ZYSoPXwXoLZh5u35gjcGkwf0mhUvaY6qvkzRcuMj6MACcliwR/wPjp1Rrw2FAKezLyuNR+y/1LT+3ZbQruTnFZFSM6rQQwPOKdStgSgfrOQtsuETwFaTlZW8qk7j3BUnCybWN7jSbU0mTxIpKl3gPORGahIG6SiwonNZwFYU5QUN2AFsVVGwBqJiXKRQM1tkUVJ6F5DpGnaC2wbmpS8KoILpv/FTgSehvgQrGOBp7cfSo69i0cYdrmZtQwOZPsa+KvfP4+8w02U6uiyMLCPvFhwRjRa3vK9wIMj/3YmW1oVANacPeBE86DHTlwJ/2LVq9rAbnANC4RNymgLLQEBK9nqYskt3/oCB3ULoeeZawfc+Pi9oXgZQGtWrbcTcG1reoCwDaEdTM+904Rb+xHQG7gZApz2+GE2oEazeRybIHdtWecs9UiTtjjXeCp1rXWDSmixMwAQQ9wKBbZ4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: af0ca22e-5cff-4a8f-e5d6-08dcb4e6e713 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:38:19.2788 (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: B+5RQmJFyywznd1FJlvHqCYZHeCHKPR5w+aP4pBbeBGFfk6EANdGmT/DMLIK7jW0GBY52SGU15a1haw3RsIVHVzAIV1kjz6aS+CtKl+TpipGRxUPCJSBH2Tk3/fciKVC X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: MREHUUWD5NABU6ILWZGCJ4TWJPZBHHUG X-Message-ID-Hash: MREHUUWD5NABU6ILWZGCJ4TWJPZBHHUG 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/firewire/bebob/bebob_pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/bebob/bebob_pcm.c b/sound/firewire/bebob/bebob_pcm.c index ce49eef0fcbaa..882aab28dd96d 100644 --- a/sound/firewire/bebob/bebob_pcm.c +++ b/sound/firewire/bebob/bebob_pcm.c @@ -100,7 +100,7 @@ pcm_init_hw_params(struct snd_bebob *bebob, struct snd_bebob_stream_formation *formations; int err; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { runtime->hw.formats = AM824_IN_PCM_FORMAT_BITS; s = &bebob->tx_stream; formations = bebob->tx_stream_formations; From patchwork Mon Aug 5 00:38:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817110 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 04F9AC3DA64 for ; Mon, 5 Aug 2024 00:51:00 +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 6D8EC4F5E; Mon, 5 Aug 2024 02:49:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6D8EC4F5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818972; bh=pNwjQfUh9E2gDRg5VcfvhdkWk5SaXFwibPehWyuFWzc=; 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=ZYiA2WAYq9k1yYBM7Vo8ItPsUL8IdAyraVAnWEtjMFUzbUsllRhXSZyPFWPybVcIw xTx1mjKAwtBSyqpC0vIOSGn2bBx+0srHr3Q1EwvyYZr0a8zBwF9qC1beGEpkSO5fbm SiwSp0/yNlAqmT0NN9wiNFeFHBVhwrko3x3j4p2E= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6C2FCF89965; Mon, 5 Aug 2024 02:39:42 +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 D7730F89930; Mon, 5 Aug 2024 02:39:41 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D5D8FF802DB; Mon, 5 Aug 2024 02:38:29 +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 4ECA1F800BF for ; Mon, 5 Aug 2024 02:38:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4ECA1F800BF 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=UQD9ookZ ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rPfphjaW+D88UYjTYk2VxTnqOE+plj10bqBpxZOy+fQBp0fphbauITzVcR9XuVPDv3Vbo8rtZLj97HQBKr9jiceAirFXY6uTcSMnOZokfD8oQ01XGVNgECyTv1ghW4OTWSavskNwxoBUOUSf6JtC9N8wAqBlA3jUA3BRcUTaCkjDzPoRD8uw2ka2ByJgzzOSjMTj37UaHXPeXb9oAjRI0hOf6D2VABRA+nrf9VeSXIHI2WKDLj3yZEFMd33DxdcN/7UWzxHhhfAvBftJwAZ6raZoFt734TiFN3YTKvvdo2PDr8qZbsU5bZQeJfSrgrJvBq8jAfz4J+yweZ/bsIcvog== 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=wp1EuzhDLeCRQKsEz63bZ06RiCbh0qYe4w47qR2AS/k=; b=julXJLIPwVPWYsvsy40PZtbydP6tYA/XxiQStWL+s8MHZrhhSFpZnnkRGmdoAxeGkoy8U/AXWcEk1TinZ0q3JwQwaz1Sa5394hFT0o0XTfL41gy3Wnkh3tKRb24cw4A0DSLjN7lqwj7aljY3at/8yIOFrOp6xTzaK2REhy9ryDX5EU/H7XZOqf7T/Vp20ZoQmkEjDfjnWfDmxOa1E1kYeq/dW2YG8By0o0sHKHkBYt4FfSz13qkW9a1NKLvIGgVkAQ4eKgJ8oKu8H8zY6Rmw1zd6iEQ0dM27ztRNw14/LZGTINOX5lSORnpwGHE3GHuUgjRyxZOTYKA20XuWp1r+uA== 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=wp1EuzhDLeCRQKsEz63bZ06RiCbh0qYe4w47qR2AS/k=; b=UQD9ookZ1U+9RTqZ+9mn7VQMCti8sDtZwcyuGANplpYIu8TaBC/s1vPbmxcMD38vRppgHCYo2KG2o4zy+JfJJlQ/T2qDNgel4W2P1vAzaFeHtW5YSl3AyVRz5zsWbxEpzp5r+BqtNMXIMcogwzIduj+dDjFTKwmiiivuX19i0Yc= 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 TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::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:38:24 +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:38:23 +0000 Message-ID: <87jzgvztvk.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 039/113] ALSA: firewire: tascam: 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:38:23 +0000 X-ClientProxiedBy: TYCP301CA0054.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:384::12) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: d6b67132-90cc-4ffa-fabb-08dcb4e6e9d6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: MQwDWzKkfOj7+lzD3l4Y4MKjT9kEosCeSZ3k9CggYVvJu0DjKAZccbtITs8hFgzqNTAYE/DrMY4hs8TTCH682KNINTShmnYycarsa+wjXE+4wv0898AQ5f8NJtU46kKJ2CJg170FimahYlEmbe/f/rojdJUZongYdel/mIaGv/ppVrB2U5XwGSbEQWWVAqHKZSCf2Y/7RhDT4UYWJrgbJ0ndQANV14mmC113197iHaTYV9qfU5DfymwU+nrKOrn847LXT2RNgMyPpWY/Jr4nGSe84ehDJ+uI3ery2k+vaYVLs3/OexdU6QYMry4FEIq/hKW8xGisJB7pZJnnIfIq8N2qVa60jnPINYzKm0yWDgjbm4ibgCkxiIq8nQqXu2vMWF70/UeD0gdzaidgO3dj9M7SKNRB3tevakWc7MQJSVVGDZV/56gzePK44r21ViZX3bSuxp9wApvE8dBi2SkHJ/+oMFwVTLg2kpdoCHg7kWfEHRS9eE6O6TWbVPVJYUAN5yqSns/+ibaydI5W977CEyDeExGWpg6W1yluUlUm63HYIp8yv8LVVZ4m7jhNz+t4p3Nk1230lzx2oPD6/GQYiFTFI8RytTDBtxR2jWLJ85OkEJJPEe2sTplw8vXNarA6Isai9Lqik4ui1IvFWJkSb7RJg/kpXCVnv4AsMSQYVMKukX8/cYCu1oxj18bSSqRDlEqF3tSHmp7xEd7aV5IsflmVQllv24CeaVC1jgaVi2u+sjoVy23n/2HepOnSNhW8jBugFjEPxQgjadXEZmfmCrOgiN39KTFANBFrRlpWrk347+HaXJqIVy3BB5gPsvL4IVW7tJYnn5LmdyloeVN12Bfn0J0ej3k+T7kNkju7sl+/AA867z/6LPTaS5t51J2EZGpak2LadHm45lfN7rKxPs9G8PAPJOS4IyOiNYj+/S/CT90Bz3qv2KBUCgCa+IlSC6FntWOM2Uq1ZRwXMZmNwwUKFLoXcPEzJymUOJ/6HSJh8/noU+3GKthsFqVPXNT7+8lTsw2zWYR0CHDuDLRzOPRfBXYjfQ6TLLDJDV3lR0xms9XDyWiWDO+7x5LMRWyXbpxaU+0/FMLAryjqRmpAsIGMYnMatoOqNqHeB0/51c6sIhTiw4vblg0OstAHElfqY8oapAM5DTyWOOrAkmhF58s0/k4rhS6XqfQDKcSQenynaGQtnUEP9K0fYfEts3rA3PkiNUeWzuk9YmGRa1HB0jYfWs53gDGD+q097rCpPzbAicUNay1rPjsCCHZZjXzK5rdNtJpZF9JmCPaTtU6wVqrh+eKsEk06jQCW8vbPhyQzM6wtbjoikryiFCrBaBeIouNrxVuV/0N8/kgaLT+ES5z3WWScFC50hlvkzyvXKjqQcsAPCQe66csEKnZKCAbUTcCNNI/zWzWdKsspyLedCw== 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)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSp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3y+AZjunvr4iVajwe7DJ/icIX8lKvj/DXRSMT5Eek42nnC4wq9C090It/Y/TH27/YhSRUV5z3DB6Oc8CUfxZz3wix8ulIRoF/kEZ8FAf5byAovRcAFqq2DVcJjmeWbGG6FOlRWKIrTvr3fNkg5AtgBHDHg88BayzOMCHe1a3RSw8r2hEm98mYIU6iNtDljaChH7J0imZuvXz2wHPYI0ol0yEoGr2Wegb2MDYOTV3xoxahJImJL1yhQ/6SUd8FjFgOi2/tFMXEoYMDRGn88tBUX4XqRkVLeiRxIHMH1VQk3aPJxRrs8vlj07zARO1MVPJfetiA8vFat8lyrBYULhMTWLuD+mYg8jNz5IJOh7bHEXJjNTNoMG6DnEfnnIYzLKFCabKRGog9sbqSJIqN2AzTj8wAOaqrUqFH5Z2mJq3XVYszuA1t5AqHSFDRDJvCb8SGTncozTJ6NoZxXwdUfTsPrt1x36oou79+bf3eCMSFsOzWZH12BVvsKlPAPu4lzF+OOKOYu5jnFs6XZ6eWy5NWRnBptf20X4L+9e1Cqq510YbZXzsKN1Fu8aL1jj7xEkAY2ZelR0+uIftgR/QHyckFSVYqlg4EmwQb5YI= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6b67132-90cc-4ffa-fabb-08dcb4e6e9d6 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:38:23.9076 (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: D78WBMP8LFwfsHN4f+oomLr+3C/kwhmlsBmP+ZGLp2wODI2zS/YaHuIGR3sLYEnuHlhpt7Cp2ca/wWxSkWgiOo/8cRzPmomeTMx+BVPW1eq/ZjZvbq8nXs8z6lE0tdEw X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: SOTQTU75545XT2SOZK57YID7GLRJCRCI X-Message-ID-Hash: SOTQTU75545XT2SOZK57YID7GLRJCRCI 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/firewire/tascam/tascam-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/tascam/tascam-pcm.c b/sound/firewire/tascam/tascam-pcm.c index f6da571707ac2..29a8e7db7c30f 100644 --- a/sound/firewire/tascam/tascam-pcm.c +++ b/sound/firewire/tascam/tascam-pcm.c @@ -15,7 +15,7 @@ static int pcm_init_hw_params(struct snd_tscm *tscm, struct amdtp_stream *stream; unsigned int pcm_channels; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { runtime->hw.formats = SNDRV_PCM_FMTBIT_S32; stream = &tscm->tx_stream; pcm_channels = tscm->spec->pcm_capture_analog_channels; From patchwork Mon Aug 5 00:38:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817108 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 5C4D1C3DA7F for ; Mon, 5 Aug 2024 00:51:36 +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 19E8B4FDD; Mon, 5 Aug 2024 02:49:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 19E8B4FDD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819008; bh=KJ7hHIXeqPpXiCeZu4OKeUR7q5AtfLVCay8a1Iub3QA=; 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=M2rK2+WghAKD+ZqrUiITjx4+NXtpinYdr7jcxNZxleWqdcFY7NRXciManaMeY6z0E k8S+kIiXC0DQb9elBJ1+tMjIgxz1fG/3rb+7bKTxMtzkeluKbHbNwT6YMc34w4WaVe xDSexggOGWjIiiy2rTJF4KE9Xfu+7ajjvK37pwjc= Received: by alsa1.perex.cz (Postfix, from userid 50401) id E3DADF8060D; Mon, 5 Aug 2024 02:39:43 +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 767D8F8994D; Mon, 5 Aug 2024 02:39:43 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2E9DBF802DB; Mon, 5 Aug 2024 02:38:34 +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 BBC93F800B0 for ; Mon, 5 Aug 2024 02:38:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BBC93F800B0 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=jhURBzIY ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bDMgrchOgJqRRwSkmEYwEJa71tvC791lxdLKCZmOMYbmZEUkgs4i/mCZSgSzt2dm2Zdg/1DfHyFp9taV7iEZFfl+2a/v4YKXZsovl751rnBBikUFEP06vSf5aQghkgbcIj7mLZbZ8MEKWTbMRqkMuk9RGPB6ylDyzumCCUe+JJHNW9ukvFHeomKfQKCIVQ1MaLghFW9UuHPVriixJghad4RJEQmXjwjBIx0XGlXQkka6M7Gw6aeFi8NnkNVb6WSJt5hacCl5wiwGdg50qA/VLEO3sOsp/gVcCdgolSvYW7gU+WREtYkyxmFvUt00gaqoB8A6KDD5x/aeHcQNskPxJQ== 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=ZgMXDh5BBrEx3fDNH4NG18IPsWtxZY0FHEAj4bUfTqk=; b=Q0uRhwE4l9/B8VEZUiofoCSxfBf2N6IizPQ9u76F595d2taBXYDOMtAau4Nl1/12EbT+r0zJmxX8QvSrdilE47xiaQJ+3FUmAmnYdULwEDUihfYZb7rvg1ZEJPvca0m/rry9/cR0JANv7+BnWX+dtNfhdlp33znLejpAoCVnv8Yhz+mU1f2fwpVizcC8q+ZJA3fDXZeZrL4SEcdc4L91blDEt8sSqLt/bZORZ51Do6eROLYuPYApOyFa5nMbrTiJx5Vh6EQOMd4EHXVdnjzJGj3Hgc5R4OMF59KwMqDaZ1KqHAyOuLb41i9xlFlbWPk8GteRaA3NLBOryIXsOZ3AvA== 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=ZgMXDh5BBrEx3fDNH4NG18IPsWtxZY0FHEAj4bUfTqk=; b=jhURBzIY0kv2UIW85vIswfbBL54fKwpjlCiNvsqeBmGXcoUKSBhWpqyNHjADGw8SxbnYFcP1OGsM4auowbiz2CuHs48+6ps7dYiQgQBG/LG5C/746cBsFnLDItK6wl/DVIDpQ4hyq3xMyefqDwHUAKTFBxblT0Bs8kM6WoIMzuQ= 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 TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::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:38:28 +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:38:28 +0000 Message-ID: <87ikwfztvg.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 040/113] ALSA: firewire: digi00x: 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:38:28 +0000 X-ClientProxiedBy: TYAPR01CA0100.jpnprd01.prod.outlook.com (2603:1096:404:2a::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_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: 567a35fe-b585-4412-bf76-08dcb4e6ec7b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: v+sO8IglqNAxnVp1KTFsbgd6NyF3W1xypioNKGxk8z9U7ooXVLzvQf0p9vjMD1U82ne5Ljvyf8ISj6SCDGM7FXMjnwDke3gFC07UCGdQbyNK7zaaDREx6+j3WRXg9rJd8btdXqkw6PIR0tTS87a1kEFGFxbHrAvtcouW24vgNoJ2vHyCPnRF5mAc2lCjuy28bKNMd6QIHz2uI853seFvv9T8MQ/yVp/BFfukHv34tiiKf47FXLqsJPD6flDSJesQAl5if7b6x80AwYAV6CfDs+cHhlx0fz5iPwwTtqBLtaCApA+QC2pNRS/TKDnIcQvP74cQp3rmsDXmFLQEEqiAIgOQAvdL0FcMUMNesSuTAHRgeswqKagQi3wrmtArg4k0Bj44NVZ/vXKXcICWPFUCOA0OkA1/G2NfL6Kej3SHfTKIXkkCgc4FrIAMZawI4+wiquuictasxU3tn5he/il5hMpyR8kJk7uggwuXoQxo1GOlOvA65gMPyS0LOM34vIOaj2pUeTFdhmCejaupio5lKh/e0pw1VyZkRZDWZLxqDwE0optIXxTL7PjMFbbY5liECu+5jcsxs98AgoBdCJY6evAXHb1nl87hXonQpO1m+dKtFG01IlOZUHRtmCuxtVbmu1lEfvRYBHX5utqlM4rJ4xXRG4SHwxMPLDdcXmoilVF3bzwCKh+PWjAg+pTslurVlcGmjZ2Zz4CP0+6BQlxudyFIllKmm6lq9xn6V4QTQcqFwc8qtAldazLBeWYcGXY70OTwyuNOX5+YpgyI5dHQjJzjl8d+BGxAhU0hf0qfOoFAISa7dz/YEC91RQ8TqYhKPpYiSvcJlNANDmIHiiDpqdqeWJaQLftLM8711VnqxN5M1bFLUa/gQ6b/C3xOmZ9w+Co+vVZVHmpABbNZU/Eh6VTZDMbFXGHu2tpO6eo4unfDeHP5BvOf4+Uig3AYIx3TIJ4SAeFOBKaqBbwkNt3Cc5e22/fK8Jx06O+IhljDotPTwHuWuSvTg2saTJafHD+N20/ORXDrksBhlev7gF1df967UakNM7I5vRD9jC6NJpCjQWgYrNOhHrN34iOzM7x7HFZm4/bo0+CWUt8kQAh1hEhjsrN9fkrLffk9KfPTgbfpddK7tR5IEyP/EOdu/vpJiN62+OgDNHLkxdA9yLMTphVPwcLVKvLwXkyVBkA83m2RVyebyT7J7qnW1ZqrhQQldDnmJ6rWgrtArd6aYQY5FK9wsuWeJ0TPnL4XPMR02pnUmw6HexHN3sChAS3mguClzDdXXRmF9XWMArck0fQVbIqrAoiEev6i2tTVYgZhxZKmskV9H+Iap2y/wR+asUa6s1FzsGCVc3A+JhNtdiDEgtnxAOWkZkFWj9PGLQzRTtTiLr9q5c5PDrAkDOSLOVbRRcD9WQPRVSmwo7DPHtSs2A== 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)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zARYYYA9C5Qm/g09JRUgaxC3uwjGLvfxdeIC84I/jiAhV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VxCi1vQFDobMuZ5YWIwZmw5wj6ikcQeoc3/45EZAnOtGQPuZfKM7NAMsjO+wOAbGfFq5cK2SpRrLeu5TbdT6bIsLDFUGtarHGAQHrmkJ8Y7DdZuaJ1o0Vpv784msPgTZbnGyJcRoF88eTX3w/XJBF0VOqsAh44kiJop7boRjXKasyIZaSNBqY7UkPhysQe5hQBlLDDDxz8JL+mB/dmctsHhjC4Jp0qROYjs/H6k3A3PpVeyz42WjfHRqF8cCg5HeXbEsA2jx+HIZPpve5AjokJmC30dSCI7AmNGJiahTXsfjg+OsxoJhFSJfxY4ZGHRDKqobqPtwSlreaGmeeq1PJGzklRBKw9PG9Yijg5dZeZe1OQAl9YqEjThuJ6rLn7kElU04WnDGynwcEsMBa9pBeCcesNpvl487r5AqXaLDEQ0O48B7lIzUk7skVwgIFx4DBzDCXAhuHVB6dQZqa6VgWK4wOXSr91oV9Q6CMRkSqSQrdpQT1QK0oy1Gsy1MU6rYmWXs9QW/Q= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 567a35fe-b585-4412-bf76-08dcb4e6ec7b 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:38:28.3768 (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: 0++0KTCfFAGHaVIYs+DQlU8eiciyrsEM4mXK/ICuIGtaFC1/ikZOH/i75BL7nDsF15yyTa7spBCLkKY0EQZSxrxMOH6zI6qgKQ52PtODTM0CY6PRMecfxxehlb+nErPu X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: A64Y2Y6DHDSMSCGZG25HX4U7EVALHP6Z X-Message-ID-Hash: A64Y2Y6DHDSMSCGZG25HX4U7EVALHP6Z 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/firewire/digi00x/digi00x-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/digi00x/digi00x-pcm.c b/sound/firewire/digi00x/digi00x-pcm.c index 3bd1575c9d9c1..42ffed7b19e36 100644 --- a/sound/firewire/digi00x/digi00x-pcm.c +++ b/sound/firewire/digi00x/digi00x-pcm.c @@ -63,7 +63,7 @@ static int pcm_init_hw_params(struct snd_dg00x *dg00x, int err; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { substream->runtime->hw.formats = SNDRV_PCM_FMTBIT_S32; s = &dg00x->tx_stream; } else { From patchwork Mon Aug 5 00:38:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817109 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 A1E59C3DA64 for ; Mon, 5 Aug 2024 00:51:31 +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 5BAE24FC6; Mon, 5 Aug 2024 02:49:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5BAE24FC6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819002; bh=2XKVwY029ACuwzgxudgKtOh9IfCaKw5UPLRQp32xCwc=; 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=QJq9+btB9n62N58R935raW39aNgBy0OFUPzsNKr2Z0YCcF1zeTjO6CjnEGMJ7B9lo tNjXRn8xd5MQy/95mLlyAHDPABvQFo/uPNDma5NYMw3zRK+aznuRWOaP77RyxjmgjF /93SABOc6WC+8RbaRNPKF4cT5s3z6MMMZmBKVXgE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 821E8F80610; Mon, 5 Aug 2024 02:39:45 +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 BD5A2F89968; Mon, 5 Aug 2024 02:39:44 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 84ADDF802DB; Mon, 5 Aug 2024 02:38:38 +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 F1C46F800B0 for ; Mon, 5 Aug 2024 02:38:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F1C46F800B0 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=HKl14j+f ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iu4ila11lRul5NeqFxW2Zy2aqhQPdN93eUTZD2Yc+8iO7E6H3oSJo/PJW2uLu0JQ7CdDAn/jiNC5hyuxG3Ln+jdkh76Mzg5b07ai2fH6wEFLJ1/E+4eDLZsR/ifb1FVYcYdNSusyuAIlGtvy6ye8ET21NZ7mmM4PJkk5WH1KJwON0bODjXFI10rruIfddicXn39k6W8J9coFqiZ/uL/LgllWI9kvDhe2akEYGV3h2AGhwNd7S4IxcB69YfrNjc4x+wy4yz2FvkgNtxQ92U8Faplh8KLWCiMC9ay2GMtbiLdGfD/AJZO3SiWY1Ms/sGeRHmkRq1WgTRPX0/NxF7wKXw== 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=EwWBPIrvEEzNINeAu0VYLeEdb6PeE3NTbUPzBWPw94A=; b=t2hNUvzTMLy1ekm3QMMkyGbpOdslrgzjU7yjiiaZJaY92UiQ4JOX2XRWIdwx7r7t1um6rMccY0x9RrpmVEUlHLiGB9EOBuqmP1Ud1tyIX7gNpQlgSSL+HlyTEPLdTqvRuIhmRrzJ9JvisAus0SeS4JKuU88678/e7u4gyjjEXtW+vPxQ9FuyZ2EocI8Pu9B3EyLKqMmx/ODrJ9ArW1tq/0VnO3VjVH+iFe4fTv5BFZjw1G4d3EiXk9gD9OPunQaSzPfR5K1w1hsMQkUQOHbLU10UOLelyV6X9Z9nuyZKx4FseWTwtTMli0f17bK3oaV/v3G47lY6P+YFpSGVzlA5ag== 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=EwWBPIrvEEzNINeAu0VYLeEdb6PeE3NTbUPzBWPw94A=; b=HKl14j+fb6mtpduYW4BmunXDMD2+W7hsl/+H6psVGHXKLPFnzBt0pJlfuTfRsXUJKg1EjJQ62mqRKGnRxyr8gaG0BI53ruVekRhP5TbhqPO3FCrToWJwbRxct6BuR/4pYXop+I76FkpFW3YsLwlrGQ2jRrNO7CGTFatOx/NPrf4= 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 TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::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:38:32 +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:38:32 +0000 Message-ID: <87h6bzztvb.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 041/113] ALSA: firewire: fireface: 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:38:32 +0000 X-ClientProxiedBy: TYAPR01CA0109.jpnprd01.prod.outlook.com (2603:1096:404:2a::25) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: a486d03f-102e-4161-ac40-08dcb4e6ef1e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: S+yzwpQxdf+ikIyepAdbNs2ZB+MBrP7cvplZO5ZITs1dDv5ZBKhdDuMZm1n4xfug7gBL2m3OsM5qScS2OwacXMiRQnVTOIikA72/vLaxnsEswUkjpCliuXQt8dBh688xmN7rHgLx9UTE+GKWrS204omHy+WXohxxAK4O5BWFXumAwEHCPhRrTwHIKfOKrfF2PmuuZnJDaM4cDrbZ/5MX3glGoDoIk+1x2xj4vFaJuX0mOtylB/W/PAGXfNKj9IQKurN3Bd6ziL4d4WlSCy65weObn+umIImzJxkRBjkRWcc2tKJ+q167t92Yz6lrdhkFCA3A6/CIecNXonOX+IwkowTKtCVIn5qn645BnL5xldEx+b2w/4wgP9sP/P1GAOu8iq1e3k1Mpv7UM5EFwq6T/yoQcCkVE4SS3ucKqOV/ZmA+IQqiSiGrKyxddj1vB6tku9f1iqOdIxcPJhH/qspHjV8rEVzbvzL/tRdocCQo9BYLlX3jmyS2bk8NwT8VMt6pesUEY/UpdckfLxwY61Yd6sKIXQYneo/EknZjMfGVulZYge55eJeeVYSLsSugfdnppvJujV++ADY1u7sXIA1oMtd4Z3MKoglqVmWHD7mVe+ONJyOUgOqlTquRe2Pj+S3p56mvfCAGzDvijtQHr5RjkykZioOhlSKn+tMa2B+OMXLh/6AHNIkLSepV5p5RnGXImO/eQDoH9jzUi4XUobhl18dhpD6BcDUDlr2uG/NwIiRFOsbbzqTyztle+/A19VaYgkuWCtRkyvzBIYGnFYTnKKp696GOH5p48xVB9Yrd6thuUe/5ib7cI/RPRK1/bSEGLSMSLDr8nhPkKFdAWm4FYUs6CbkvljvqYDac8OvpYnrL0Hv+aSf+Cx3+94mocXwQl5/se6ZDtX/gvBqQEXTtaJyVULi0j7tJTOFO7vpjWnxEQyzmnVMksgtotZq8Fv920i7QVKpWFs79YrtQTo9AiBpKPEXO4IRUgd3eIvYCNvhSCpFTtuujmHl3xaKP4ckJUXFxC0ErVUGf4yjue8OOI6zq2JMQnEfAKyMhyw2bofxYxJfN2BwO+boqxsvNomSSRJh4Vwd3x8ZH+rDKcs4K7Sou++N1OiF8ZYreIiVAQfZHridcuh3mh0r+RAkFrVsBxqtA2oUyRwOOq7WXQhkW8ISpUDlEjNhwof+OkL8aXqrRqnjWwNw/W2X3o4905utr6YmOPqoJi7UdMER3RJt+6dolKSWunjLj1wGdvSUmqGuocmudrurOYN44jBf124Ivj95+NJctTXjWF/BVtN+GBy4DfTGUbMIWhvfQbmrPoJiJtYgVD364pqQxiaN+v5rwgaem602L7b/D5u+tkXEweWUHLSinwCAbjVZzHpzzrNq53QsHPQ8uo8us6c4D5VkxgYk70g8IvZ+a4rJOCzggoQ== 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)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bPhW7M1e5+px/mMX0VVKu0pH7FqtTROuJkYlHwjvBEC5bO5qeHClRZYtbRDsu6mmwAR/0/4dnTZwq+pytVhQU4daCfYRmbMx6wNk8rsT9JKIs4uutj2tN9z18gC8bqluoHocQE9KKTf7DfMGxvX0YptikJ/5/ggR7MzMOI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uE1CPAONFIKDcpZf0bOqlA9Vk7O9gaQBhzbI+/P1GMu0K15NmQveqpqwU9c4v1tX7LMEgIPGbfokejA2cJguK8daZwuTNDE9M2vndO7iuUQRJ2HZFVrgk1HFVfo4foWHRNDj3+OT8m5uYvwgy9pQEot56YkSu7+/Iy52ZT/WnD2zIpXkHb/j+/hr06R1DvbbrebuA9y7P2jU8d/ZbTR/sAVop6Rd9zAOLNAS/qOQ/qXUvdgi1G8cGn78IAI5iA6GfRNLKJHFiaihVikw2SjgVgxSB1m0l9IPCJnyAdaAr9NTjGUYLv27k72KcWv/T3CRlgs6qXRceeuo2VfFZnfF/jLUjO37eY/WPEn1wGuFX+5D6WL9CiGaOIlel+Dh8kZGlJBl9U= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: a486d03f-102e-4161-ac40-08dcb4e6ef1e 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:38:32.7772 (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: a6UWD34KXrof7i4h2te2k5EThdw5WyQtr7TuDR/hIaSTEu41WUclyQG8vs54Ma2+LKYZTnyTORDTPLQ07b+Qd9wx5BSu9ue2gdMja2/bv63xqKpLZyMEm0ibpW0dXNPF X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: VCETJAAYERA6LVGIHLGMQZHLQM2MT6FZ X-Message-ID-Hash: VCETJAAYERA6LVGIHLGMQZHLQM2MT6FZ 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/firewire/fireface/ff-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/fireface/ff-pcm.c b/sound/firewire/fireface/ff-pcm.c index ec915671a79b3..d17abff5bb1e0 100644 --- a/sound/firewire/fireface/ff-pcm.c +++ b/sound/firewire/fireface/ff-pcm.c @@ -109,7 +109,7 @@ static int pcm_init_hw_params(struct snd_ff *ff, const unsigned int *pcm_channels; int err; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { runtime->hw.formats = SNDRV_PCM_FMTBIT_S32; s = &ff->tx_stream; pcm_channels = ff->spec->pcm_capture_channels; From patchwork Mon Aug 5 00:38:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817106 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 36DF9C3DA64 for ; Mon, 5 Aug 2024 00:52:28 +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 C864F506F; Mon, 5 Aug 2024 02:50:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C864F506F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819060; bh=jXgaZdZKOl7qnpPkbnaRcKfMOOayye5uwYZuglSBSJc=; 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=HpHqkmQ5IXw5ZhKIcIoQvjOCyyf4iOqQR/T1vOr0oU3GdPLqr2ne5WUBjMn5Hhfg6 8Dw/WFRPm232zsIOvYBZRqIPqdyCQBMKFAkOXFnlwb2Elo+UvCbUiB31cYnL1ZVycO r53kBy6fiLKSwi8T9LuktMyVy5h92O9fCDurcLXg= Received: by alsa1.perex.cz (Postfix, from userid 50401) id AE8C9F8999B; Mon, 5 Aug 2024 02:39:46 +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 3AFA7F8998E; Mon, 5 Aug 2024 02:39:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DC23CF800B0; Mon, 5 Aug 2024 02:38:43 +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 7DD6AF800BF for ; Mon, 5 Aug 2024 02:38:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7DD6AF800BF 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=nDzjTtjE ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jjkH8aq9i/wWh9nf5H8DIt80xsLlLHkPK6qCuDsNAbNJymnHyt34hMC3qARBC8w2uuSleiWw1fN9dfyKnIB1SpFZR6KC4QZNIDg5C9FHmPrvLDGvs8H5ECnmFbmk7IslkTMN7vKzLZIRBbVMEfaa272HMaiMOOYFBBRbI9t7F6kRdYVwOXAyv1li61Wt1JCd3T7R898Y9dbZGg3zeCO8nO1QdQGG/3qAAbaJp9wPlFST7A1HGRurTSlFVTrBBWj3+eBmKfhzBeZoL2XBfwVZrIo9qTHGCo7lm+Bi3w4YeQjgG/Ic8QmLDR06tTw/VHWvzKKssCP/HX0apnyEXc4b8Q== 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=12hFgdz9hQo/9MZP/E11BDxFAIYz5mHJ0vBTVsFlMrM=; b=A5b3FKp2ZDrdnZCN1SW5NR4/BYgE7SzWSCJncwava31aBWyNkjRRP7fZQkVteUfOw8pp8d7/WcOZ1pF3bEHN542RD00aRtKX8gQ4TktnioRIofmsuu2u6LuX2USgzgNmJCMHg5ZifEBUaqK7Lhdpwz120qO5u356WwOIdt6WgUHv+AN3ZBcJmQp5v/8CPrj+KTY4EpXBwKafdEpBxgu8qdtHrIGQ/MZ8EQCdpEV4SHrcNIxGfmvpfotNQXJHDvemBFYtrJpzO41YJmcNg2LIhEVbEDuyL4VxnLFXigIlaPSuyDCHb702qOwumu/MTUVjQTE4GmW8eegPp4oRDjGmlw== 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=12hFgdz9hQo/9MZP/E11BDxFAIYz5mHJ0vBTVsFlMrM=; b=nDzjTtjEbqav7M4QPHVy/UbJgOlVOInSBPVbY4Hq7W7eUSmIQfRto40Xt7+ia9nx69AbgD8MU57yj7lECXMXe+koKyY/LXn9OZnkgEJJTESDbR1fCvk5yJS1zrALYYko7Gsnl7nmzLFmCimREWo/A9S4BjLqc+Sq5N546upVJBQ= 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 TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::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:38:37 +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:38:37 +0000 Message-ID: <87frrjztv7.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 042/113] ALSA: firewire: fireworks: 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:38:36 +0000 X-ClientProxiedBy: TY2PR06CA0022.apcprd06.prod.outlook.com (2603:1096:404:42::34) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: a3464bb0-00d2-49c0-d7de-08dcb4e6f1b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: CaXDUwVyGFumdXwx6uLVaC6xZfd5HQIZ1qLQ2LkbhSlfbxOMrDnNyfJMPttyGsHPHUMrTTTkuALZGtSQR8gcSJbv3lSdg7ZCf57iBcmGS/OpeDvF+G6Z5tJUTA2iuosQfYVYwqSQbKFxR+C0o2igbb+dBRoGghfzhGtNDM4zjC3scYzM2YTthxeBKfCxzh8UWEs77XdWvmSE1Jrf8TmiOAMjVRC77AgRe1RiFRZhpWjtMpJpbVPUmwZB4VFQloQ8y+ondvy9zhaWa5MD2mnlcgS6J9hYUYgCbkqCcLgr2bP5zgIT+vnMi91Av7t35ZbWa9VDYRADjNSzDKsDF/Pqp/H3cmxrpWvMw/2MVEuAH+u67ot/4wXCAALwD+0d3w6rqE+m+fKQp2QHqyWeaLXz95tWYQG8LSSg3eL5gszPhfriFO38VEUnx1naYzGZeFyTS+VVXbXuMb09EHC0w6W1iIXFZfhRtCzgQ3wiZ7bnmAcWbCzE5c+u3YdNMeF5PUqrdy9DsvCi9TVhzr0S/6JR19HxTcmZmhmUsVcdSvUeGpH0314sAMhhw7iElB5Zy89M8kTUaKRAZ/tcHa0a4Zc1tLlIa5wXurlfLTWFa6cvKKxDqi4wmnxBSKBNeUA7ZZOnAbhkGrgwIahXP00+J2LqbMlrO1rFZzsTlHsBtegHeeg6TFIqpK4qIbjzZtRbf9vtVulzrb+cuYpD6Lpp0sOMMvZFQeEHKqAPM2xc9+fMFbxrdy6pNWif2iCXYyhMwgFgxlgO7sr6N/zoZUsbK2YSmjiGG9yP8b75mH7TPZ4XMEpYX16w+cAmWQYPVo5OjBbLL9fF2XcvYKtUavJsku2hlj2sOm8SkvwMR5F06lafUSCqXESQo3VzOify82T9Md9FPWYqh9spWvLdZV8EJJ83pq1YRFCvfLHwJkbUBdKcarh4l2O/OJDMRVI2Z2cad9tCW2r12y9ovNL2FLlBuiLSLjqUMChK4DTQ7boZJwVereB5FnyzMMc1uQupLnzw7PlCNWMt9Ho22WSvadDGpaxH/8AVSydDfBxenOlrljXxnuLltimH3babq41rtPr/4232tJmuOyyQuE6a0AxtnXC92zhS0WIYbNXyvtuQJBF0xhpOe2aoj71FyeH96ayp2+NBA4WbRNoZqUFYdVr8yiO3K4cotKkrvwwo2BPGjVafUgJ87UJeabPXTKTZPBokAYpCyBmUvk1/f7F88zXb6iG1dT1J3xmRgq8bCO/5VJeQGTyIhEEMi3AlEwL3zRniLro5eoBPIVI8KU0dc7GNq2UhRAsj+Qn223qCHwSNqJ9stHiXsosrQiZceXyNmB0mnfe308Pbu0N8w2oZ7DhgslvfCkS4Is7S1b4+wmbshDV2gD6QkVEXD6V2+X8FA6HEzOPWAOfIqtYAbDjGccgYMmBc+w== 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)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kdQFXZlq9rC/v9Lu2zeQuY5P01W93r1CgN2a5YKS+5m7nBMUrQTU+1r9z7kFUXOMxGdKogm1XHLvGXTqKF1+yYEcbLCi6qIKZeOPJwM5eDN/ZzOnWLuRQhDlHVXS/FIbpRG5wgHtBqlN+4+9d+895G7+wW5HSpFZxdTLO0EYJWsMzLsJpHV30rxzmqaOxslkdOw5DcOb/IecD8G1p/aAzNoWEo8J3KNaajdfcwa22byre+LOYIulxwQNinf67ruTwVyhgSM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rkhp3y0kETYuJ8+crES9R6yp4V/JOKelrGCqMmBNhlApgw56NbJP0EkyiSzp85sMGuSOSrxoUr6vEOkZBNdE0wgXdwv5JmJuEG4RFShdvJaj6aqd4U07R/3t3c6IbVSwJ2s8Ieoc1HSwnXICjo38YpjUSeYLaRJKCZJ71IE6nc43kY9NKU0QEZCvNyL1p4HvlT9cka/rWTBddkF29mCOkc9eHeFDXjGa4l57qCDI0fpdgQnMOpOUdmCHK9xmxXyyRyunEqlyPD8Pq09mg6stkdwaRf+J664a2+J7x9A= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3464bb0-00d2-49c0-d7de-08dcb4e6f1b3 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:38:37.1073 (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: h8TZArFHHtV2khCRq6OqUEGqDiEg/pwSpljCQ4paFjAZVP/bP2EDNuNOs+Idt2+DDqfnTOcZFD1/HWkS8M4ga9GbhuErXPhLNMfCX642JlEWkimBT7vhnJu+EpH9Q588 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: B6EWIOGI2SOEUKN652XHFDIPVJCXNZZV X-Message-ID-Hash: B6EWIOGI2SOEUKN652XHFDIPVJCXNZZV 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/firewire/fireworks/fireworks_pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/fireworks/fireworks_pcm.c b/sound/firewire/fireworks/fireworks_pcm.c index c3c21860b245b..7ab42a6903e40 100644 --- a/sound/firewire/fireworks/fireworks_pcm.c +++ b/sound/firewire/fireworks/fireworks_pcm.c @@ -137,7 +137,7 @@ pcm_init_hw_params(struct snd_efw *efw, unsigned int *pcm_channels; int err; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { runtime->hw.formats = AM824_IN_PCM_FORMAT_BITS; s = &efw->tx_stream; pcm_channels = efw->pcm_capture_channels; From patchwork Mon Aug 5 00:38:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816789 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 166BAC3DA64 for ; Mon, 5 Aug 2024 00:51:44 +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 21DB84FF6; Mon, 5 Aug 2024 02:50:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 21DB84FF6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819017; bh=yby+K8sbLa1AzCJRJC/iAu2eKcIg1c7Eq/aZvkozcT4=; 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=XAHI0fq89wB+t+rn1z9lfpViHWhfSYSzW26n8J19589IKhQaB0YFZB3MlltOWMhrP pfmZHZvw1evF0UiWPHe0iue3iyrUBroJQbpW8eQOGtypLZvxJnBeeHMZ5oveR6zw8z wX65fAJ3+Yo1VWxRfMJwiZCZYyCmvIV5hIFGrAsc= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8CE52F899CC; Mon, 5 Aug 2024 02:39:50 +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 B4D9FF8985B; Mon, 5 Aug 2024 02:39:49 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 15EF6F806A1; Mon, 5 Aug 2024 02:38:54 +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 504ABF80602 for ; Mon, 5 Aug 2024 02:38:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 504ABF80602 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=YEukzmwr ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PO9uVY8c414K3GHr0Ek8B5dRLOaSwFHKt9bMmh331Mq6sIvBTT3g+GMX/E+GmGG2YSBkdiIliVtxBCc25go0y/xl+c3yrYR5fb1uqlIbB3EOw5eGRPJh2Q5yeFHBlaZHnoJyfskrHFSwTGaI+Jkat8nY6RPFdjoveAbmiSlAxAH2Hcs6bOwKROlk8NMkBkupIGrci3E28bKilCRcwOAyY6PQhH4iP9L5815c2mf0Wcd2loENwh+p3h4nka1QwCuPl6Ce1THjCOj/XIigQTYBfl269Y2Y3cyA6SblcmP3/4c9FJ3qzqvSJajB9/eHiOz3RlPSFBZXaYYQNmX38lE9dw== 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=Ch1ishbVL9mT6gtObRicFJ4osR/ashHveJ4Eei6CYvE=; b=FCdp0UjQcHMAff3KceDep+xRLaG+QlwdEfFcUw5zs2Nzj2SRtyHWTIj2dyJVZeaFHEAUPePWEnvPa9H6qj02+YHPVUjxYbc+2cz0TQAjaQHNealvQiBdHfsyHlpW/nmHwtem54+X0uiD8ebQZKh6S86Z+TQeNdnOWb6IscJY+E9tVd7ho13geksbtURU5J8/kZXIzWDl+jqMq7sn2hvAfrErvL4PufaWwsjdKYdOrjE0skbtKSfWw23PC86/BuaV/jpCDweKFOOmw2t1GKXdh/GULyNITJQ6/N3ZRaQJIjcb2bHR+VkpVhlvHoigolwP1IXPUwkUjdVIMNiFUlexwg== 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=Ch1ishbVL9mT6gtObRicFJ4osR/ashHveJ4Eei6CYvE=; b=YEukzmwrgKNmy9Yo09ydTSXtk7ftqLG1BEbdwWc+sCaX+gjIRKYA02MT5/DwWCDtedZMzMneihbXobSshb2CqbZy+7NJj5+g7mafzPNsxx6WAeKe3nBjOCi04gewCfEDNxbKaNORkRWfGqGMjR2tr2XrL489RQ+YywEJFdOk3RY= 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 TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::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:38: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:38:41 +0000 Message-ID: <87ed73ztv3.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 043/113] ASoC: ti: 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:38:41 +0000 X-ClientProxiedBy: TYCP286CA0340.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:38e::20) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: da5c1b24-e2a1-4efc-7dea-08dcb4e6f426 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: IsyP9jq0snHLyq0fXEtAnzn9Ux6D0jGj5KX3qjtu0j7EKHKeYuW8yY65+O/e1XeV0GVxhoe0uhEXp2bnSz+0+2yw/2kj4DqxVndDgBBnjiHXaUhq83pBcMlXFREoh+lQJdvvRoRx69m8hBwSn3KQKGp6VI2w6ENIxTGRN5G4FgkT0WmWd54s9lfncjs5qnS0Ow09+HV990B7k0BnjQAETq0H+dA+MM4/OVvfIZ3Z4RUGNYien//Q6DmhiUFgYxZnDZOkPGHk7hPK0sOH7VvVGLF4lL93tDbz4sovF34X495Ldx0FfJOTATEzHDKtzJH1x0UqkZMLFDOwwfrqnpCMOsaGfsbCw3IoIVtyKN2/YxsC9MJIPEojqmMolYlwz+nNuv4v9kL0XrVt9N1mWsn5zre7QkSBE6G+XM7Gs6HAyfhLyFYlSQDfjrV1kAxqC2jHfQaoJPYIe0JPNSXtxj4eeFDsaFfAzjMJcC4NTLscFBQsK/wLJp2c/T0sB1a8rMnZX+ZFJqw1rONKIxyk1PVmMhKtVP6HvqpXQQe1KlsdAVdo8deSn2E1ML5A4LOSS/vYOnKGmkGCzqUir4si2CPBYs/SknKTEkfx6GbLYK7LTlStOkZXnf28NtxUnzCmVBpEX3Q5kkTI/kw6BMxqm2G6PUmRok/pzjQ5YhYrQ7pxG6OB3Y7GgsL7c3Mu/6PanG+6/+6HOsWxHTDBW6yIWLA+ri1ayyk/MuegAOGg7+H49zpmqcFXhl8vSKM+jnLDuoKx6lYpxX49UnXU+fFy3eZOjzorxi8FsoBZDpzhVxJPF0HaDhg5Kp7lZU6qcLXG/FhpGXJl/tQi2voq0l5cf1beU8I5pD67nfm3O427/rvqrHuJU0jffDA7WixpAPwW0xqE0Mx1UwIxnUvijJUwj67hlHiA9ixDwEzRU/AR1oEtdYH9oCTgCiiXqV4qW5a7m6IN23cQrOHi61DrCe/b+S8dBmaDRDPS0/LaPwOkQ+5HZ//tFp+Ub39tlwukr0UxYuanT23p8hqbCkWvPp0VVqZ5YgUBi7p9lxZzIVNPXY8tUNPutGyh3PLt3vVCoSwCXgKTyD12yiuu8ZlUcNIvuGVWpkn5gbIoecGAATNPZxwUg4PCBFEBeveuTq+R+NozchJgcq1cbIJd3L2S66VNa+3g0/YA5/VLg7w63xnZyQuD/joUsupG3VjSfL3e+6syVEEnCv6395xRIW0XC1Uksu3VDcoNtz2JiCLqBLsulgcCg99AM4ssAnhSjv1lZGy12kuQAHeO0t5Oz/mQFs9/wvCYzC38HINV8LrRrRwIhA0B93uMcrrikNLklwyWlEXDyFI5sV7dWc2W3cQOCFk2VoobAns9urjzrONuDi8m6cpfZQctrbJ9eBwqlx6T4HEVqyGfxncj8ge6amnId3RG8q/+JQ== 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)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9rRSb/MJgYKByXiGCoibq3Fn+xrF3JdBpHU3U3qoXMFTpnufHuMPRSI8xaYwZlpTJbpXish2015+aD7K6JqMlLCbxZZNAUjR7Nk1y9Uf31mxbSN7Y1SvEiSW2+6zmtA/IL1poOQn5eyvL4G0rYyl1sKJIGYj57mpe4RFcFqm2SK9bCzV4Sj9sSK2VBm6GF9MzBbK1IERFP6G+LwzgGuChlE/hy2NebhSBX7B2CN3biv3meiCohgcjyXap2twO8DH0Bai+OIgiJ+nJG9BHSTYV1DXGqpo1hT07TPMzzTN3tNgOJzymGtxoMoeQ7WSKWqoFoKxmtDhDX+DFeIKusRUghYOtiXy/5FUqcNaeLqPdRlLGjk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dFVpMOUOwx66XIrOdGTj7WSi5K7+m7CtLa8NLBdkE+RFT+I7PSrSEmHOWzr6i4GN44Ibl3pdj4NoEbZTngLrCs3NR0gRDORf6K4ibFqYctcW10t6P+lLeaSP7XZzTVPQnpMNnwrWRAqztZBPHQag8J80l0IkaPiYx5WghxtNd3GeOlL8BfTFUJopetM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: da5c1b24-e2a1-4efc-7dea-08dcb4e6f426 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:38:41.2332 (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: roQeIffJd7pS7EjF6B9xxsC55QTogSxOcAaLmgnmdzUOQFBxwfJYJX5O5UA+D6FMqdJOHxnsnY1DvRwM7Ll1SbLjbMVPBCkl6J3XwJLtCZP3tEvNigxOh5K+JUR7e8ug X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: CYFCR6JIEJN2EE6QF3V4FX3DZNSZHLFM X-Message-ID-Hash: CYFCR6JIEJN2EE6QF3V4FX3DZNSZHLFM 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/ti/davinci-i2s.c | 12 ++++++------ sound/soc/ti/davinci-mcasp.c | 18 +++++++++--------- sound/soc/ti/omap-mcbsp.c | 18 +++++++++--------- sound/soc/ti/omap-mcpdm.c | 10 +++++----- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/sound/soc/ti/davinci-i2s.c b/sound/soc/ti/davinci-i2s.c index 0f15a743c7982..f509aaafa411f 100644 --- a/sound/soc/ti/davinci-i2s.c +++ b/sound/soc/ti/davinci-i2s.c @@ -190,7 +190,7 @@ static void toggle_clock(struct davinci_mcbsp_dev *dev, int playback) static void davinci_mcbsp_start(struct davinci_mcbsp_dev *dev, struct snd_pcm_substream *substream) { - int playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + int playback = snd_pcm_is_playback(substream); u32 spcr; u32 mask = playback ? DAVINCI_MCBSP_SPCR_XRST : DAVINCI_MCBSP_SPCR_RRST; @@ -485,7 +485,7 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream, } /* general line settings */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { spcr |= DAVINCI_MCBSP_SPCR_RINTM(3); davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, spcr); } else { @@ -641,7 +641,7 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream, xcr |= DAVINCI_MCBSP_XCR_XWDLEN1(mcbsp_word_length) | DAVINCI_MCBSP_XCR_XWDLEN2(mcbsp_word_length); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_XCR_REG, xcr); else davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, rcr); @@ -656,7 +656,7 @@ static int davinci_i2s_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct davinci_mcbsp_dev *dev = snd_soc_dai_get_drvdata(dai); - int playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + int playback = snd_pcm_is_playback(substream); u32 spcr; u32 mask = playback ? DAVINCI_MCBSP_SPCR_XRST : DAVINCI_MCBSP_SPCR_RRST; @@ -700,7 +700,7 @@ static int davinci_i2s_trigger(struct snd_pcm_substream *substream, int cmd, { struct davinci_mcbsp_dev *dev = snd_soc_dai_get_drvdata(dai); int ret = 0; - int playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + int playback = snd_pcm_is_playback(substream); switch (cmd) { case SNDRV_PCM_TRIGGER_START: @@ -723,7 +723,7 @@ static void davinci_i2s_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct davinci_mcbsp_dev *dev = snd_soc_dai_get_drvdata(dai); - int playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + int playback = snd_pcm_is_playback(substream); davinci_mcbsp_stop(dev, playback); } diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c index 2b1ed91a736c9..e7eabbd972e79 100644 --- a/sound/soc/ti/davinci-mcasp.c +++ b/sound/soc/ti/davinci-mcasp.c @@ -289,7 +289,7 @@ static void davinci_mcasp_start(struct davinci_mcasp *mcasp, int stream) { mcasp->streams++; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) mcasp_start_tx(mcasp); else mcasp_start_rx(mcasp); @@ -354,7 +354,7 @@ static void davinci_mcasp_stop(struct davinci_mcasp *mcasp, int stream) { mcasp->streams--; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) mcasp_stop_tx(mcasp); else mcasp_stop_rx(mcasp); @@ -873,7 +873,7 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream, if (mcasp->version < MCASP_VERSION_3) mcasp_set_bits(mcasp, DAVINCI_MCASP_PWREMUMGT_REG, MCASP_SOFT); - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { mcasp_set_reg(mcasp, DAVINCI_MCASP_TXSTAT_REG, 0xFFFFFFFF); mcasp_clr_bits(mcasp, DAVINCI_MCASP_XEVTCTL_REG, TXDATADMADIS); max_tx_serializers = max_active_serializers; @@ -913,7 +913,7 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream, } } - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { active_serializers = tx_ser; numevt = mcasp->txnumevt; reg = mcasp->fifo_base + MCASP_WFIFOCTL_OFFSET; @@ -1026,12 +1026,12 @@ static int mcasp_i2s_hw_param(struct davinci_mcasp *mcasp, int stream, if (!mcasp->dat_port) busel = TXSEL; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { mcasp_set_reg(mcasp, DAVINCI_MCASP_TXTDM_REG, mask); mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMT_REG, busel | TXORD); mcasp_mod_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXMOD(total_slots), FSXMOD(0x1FF)); - } else if (stream == SNDRV_PCM_STREAM_CAPTURE) { + } else if (snd_pcm_is_capture(stream)) { mcasp_set_reg(mcasp, DAVINCI_MCASP_RXTDM_REG, mask); mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMT_REG, busel | RXORD); mcasp_mod_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, @@ -1190,7 +1190,7 @@ static snd_pcm_sframes_t davinci_mcasp_delay( struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(cpu_dai); u32 fifo_use; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) fifo_use = davinci_mcasp_tx_delay(mcasp); else fifo_use = davinci_mcasp_rx_delay(mcasp); @@ -1509,7 +1509,7 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream, * Limit the maximum allowed channels for the first stream: * number of serializers for the direction * tdm slots per serializer */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dir = TX_MODE; else dir = RX_MODE; @@ -1591,7 +1591,7 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream, return ret; } - numevt = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? + numevt = snd_pcm_is_playback(substream) ? &mcasp->txnumevt : &mcasp->rxnumevt; snd_pcm_hw_rule_add(substream->runtime, 0, diff --git a/sound/soc/ti/omap-mcbsp.c b/sound/soc/ti/omap-mcbsp.c index 2110ffe5281ce..bb6a01b41ac86 100644 --- a/sound/soc/ti/omap-mcbsp.c +++ b/sound/soc/ti/omap-mcbsp.c @@ -217,7 +217,7 @@ static int omap_mcbsp_dma_reg_params(struct omap_mcbsp *mcbsp, { int data_reg; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { if (mcbsp->pdata->reg_size == 2) data_reg = OMAP_MCBSP_REG_DXR1; else @@ -413,7 +413,7 @@ static void omap_mcbsp_free(struct omap_mcbsp *mcbsp) */ static void omap_mcbsp_start(struct omap_mcbsp *mcbsp, int stream) { - int tx = (stream == SNDRV_PCM_STREAM_PLAYBACK); + int tx = snd_pcm_is_playback(stream); int rx = !tx; int enable_srg = 0; u16 w; @@ -472,7 +472,7 @@ static void omap_mcbsp_start(struct omap_mcbsp *mcbsp, int stream) static void omap_mcbsp_stop(struct omap_mcbsp *mcbsp, int stream) { - int tx = (stream == SNDRV_PCM_STREAM_PLAYBACK); + int tx = snd_pcm_is_playback(stream); int rx = !tx; int idle; u16 w; @@ -742,7 +742,7 @@ static void omap_mcbsp_set_threshold(struct snd_pcm_substream *substream, words = 1; /* Configure McBSP internal buffer usage */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) omap_mcbsp_set_tx_threshold(mcbsp, words); else omap_mcbsp_set_rx_threshold(mcbsp, words); @@ -797,7 +797,7 @@ static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream, * smaller buffer than the FIFO size to avoid underruns. * This applies only for the playback stream. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) snd_pcm_hw_rule_add(substream->runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, omap_mcbsp_hwrule_min_buffersize, @@ -816,7 +816,7 @@ static void omap_mcbsp_dai_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *cpu_dai) { struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai); - int tx = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + int tx = snd_pcm_is_playback(substream); int stream1 = tx ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE; int stream2 = tx ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK; @@ -839,7 +839,7 @@ static int omap_mcbsp_dai_prepare(struct snd_pcm_substream *substream, { struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai); struct pm_qos_request *pm_qos_req = &mcbsp->pm_qos_req; - int tx = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + int tx = snd_pcm_is_playback(substream); int stream1 = tx ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE; int stream2 = tx ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK; int latency = mcbsp->latency[stream2]; @@ -896,7 +896,7 @@ static snd_pcm_sframes_t omap_mcbsp_dai_delay( if (mcbsp->pdata->buffer_size == 0) return 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) fifo_use = omap_mcbsp_get_tx_delay(mcbsp); else fifo_use = omap_mcbsp_get_rx_delay(mcbsp); @@ -944,7 +944,7 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream, int divider = 0; period_words = params_period_bytes(params) / (wlen / 8); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) max_thrsh = mcbsp->max_tx_thres; else max_thrsh = mcbsp->max_rx_thres; diff --git a/sound/soc/ti/omap-mcpdm.c b/sound/soc/ti/omap-mcpdm.c index 1a5d19937c642..43637ce12b665 100644 --- a/sound/soc/ti/omap-mcpdm.c +++ b/sound/soc/ti/omap-mcpdm.c @@ -265,7 +265,7 @@ static void omap_mcpdm_dai_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); - int tx = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + int tx = snd_pcm_is_playback(substream); int stream1 = tx ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE; int stream2 = tx ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK; @@ -305,13 +305,13 @@ static int omap_mcpdm_dai_hw_params(struct snd_pcm_substream *substream, channels = params_channels(params); switch (channels) { case 5: - if (stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(stream)) /* up to 3 channels for capture */ return -EINVAL; link_mask |= 1 << 4; fallthrough; case 4: - if (stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(stream)) /* up to 3 channels for capture */ return -EINVAL; link_mask |= 1 << 3; @@ -334,7 +334,7 @@ static int omap_mcpdm_dai_hw_params(struct snd_pcm_substream *substream, threshold = mcpdm->config[stream].threshold; /* Configure McPDM channels, and DMA packet size */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { link_mask <<= 3; /* If capture is not running assume a stereo stream to come */ @@ -377,7 +377,7 @@ static int omap_mcpdm_prepare(struct snd_pcm_substream *substream, { struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); struct pm_qos_request *pm_qos_req = &mcpdm->pm_qos_req; - int tx = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + int tx = snd_pcm_is_playback(substream); int stream1 = tx ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE; int stream2 = tx ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK; int latency = mcpdm->latency[stream2]; From patchwork Mon Aug 5 00:38:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816791 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 496DCC3DA64 for ; Mon, 5 Aug 2024 00:51:26 +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 23A004FBB; Mon, 5 Aug 2024 02:49:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 23A004FBB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722818998; bh=IVl5Pnocno5JypN9QmpCuk9Uqn9w1YkaCklg587gOaY=; 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=HcnvBrJvIA7CA7cDrlnesTzeFZbw2efShRoBmWDF4HpuTpFyMIuuTcmmw3dGzJMIh 8YV4wD7O6s7YS/h3s9iAcE3rkNqgVJSpbX6L8hXRGh3rElvuMG+7zERY4GnHe/tXAp c6SLpsM70J4ApyNST6TS72t6TYrMhQq6OxlQh/8Y= Received: by alsa1.perex.cz (Postfix, from userid 50401) id C35C1F8995F; Mon, 5 Aug 2024 02:39: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 7D2BEF899DD; Mon, 5 Aug 2024 02:39:52 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E914AF808C3; Mon, 5 Aug 2024 02:39:06 +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 16038F80632 for ; Mon, 5 Aug 2024 02:38:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 16038F80632 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=M/aDZsmH ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XM/7Dr5DcJh1ASq/aCgBu/4lXKvs0N1WUIS18Mjc925senksRmfGv0pTwEwC45FJ2cl1YcGaHr6Qq94CCiT7JECb1hfqHvuTyL59gZhBuqj352IdVWDybE/SPQSKJlyebQNo8S0lnMfSp+Xj5Eb5UbqaWT4GSeOGRBgQgd/22BEmyZK+/19C//AdEhT6iBe8paXr0UoBHn4SKRqtv6AtToMY/Oz30el7f5WpBWtmG5ni0XmDqbN5MjoT/FWY4v7N0YioHo02+snSytQvqA/aIwmzYdo8yZTBXGzyYhlFVAGFH/QXvmXlJhbx6f8bVZjzDltAs/XYTFKmVoo8W8hiuQ== 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=d1Tnz0jM8EDkt1JVWqMhraSWs42HkTV2gkn31r6HzZs=; b=wkWbCgS8ddL0xpX2rC2qYNSjRXhdFoXr2BwQZIctHrIsAeqVMF9cnWcllo8y7HsSug5z3QC715EnsY6AkDV9LmGeodtYgOgzsyItsAw27aPxP/id06zLHp9Pnyst3265UMFIb0xKrCJX0PWS1m1sUaMZyUJ0NQZ96friAH4dyKO42jARNc1z9usEMIikl3qHc0v7bejnVSP8TdPoy/hVGqfxC4qBjIvLOT6T7iwd9RRxfkztyoVMhnu0h3UMn8GXqun4eCWwqcm7vBif9XawYnW/odcPBHU7aVTGg047wUyJ/3cxpMCPLRj0+MhEdEGXZvhh+vd7Tnnle3unXsxggg== 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=d1Tnz0jM8EDkt1JVWqMhraSWs42HkTV2gkn31r6HzZs=; b=M/aDZsmHQTIq0Et5PcPZ95F12FYieMwUaUa+ijA3sH77b3PWvPiZWw2Jc3koOQhOgO4EF0O7rqcJ+32Sp1Wy/hxoI5e5+78VI5JchD3vXmxaRaqxmM0WnRrvbJa2hr5DzAEVVIkwGsiX2ZsACxEygOryldSZ8LHawwWp0Uk/GOs= 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 TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::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:38:45 +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:38:45 +0000 Message-ID: <87cymnztuy.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 044/113] ASoC: sh: 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:38:45 +0000 X-ClientProxiedBy: TYCPR01CA0199.jpnprd01.prod.outlook.com (2603:1096:405:7a::13) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: d10e942a-6d6e-41ec-5c28-08dcb4e6f6ac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: UUE2ltwbmyhmJrIlfN0m6ZFpi0bnwjjifaAWe1IaNe7UpTBDJ0SKr+93hrIzOMOz8TyfGxud119orYfgbx02jKYUkwzl+OVK5QGf/SSwJEFUBkSLGR2ovue6Q6MdECnMEFKvqBMk99icH5nO7MUQic4ejMUkoUCPfuRfuG2zJ5eW03qJWkrD1jzDwQfPB8hZQwz9461j92473C00+xLDjHuDfX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0Bbm18dHsVDNwD03UZkdwTfxm5oJqZhRZwaShS+RFkDsyjbQ7przE1UoztGh1xKj9dBFaBCsEX7OUls6aWJEg+QGC3NSZYJlcCyeACDZQc2sMGTYkbtDx5tww== 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)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Jg0oyS8VxK0fvFnyXZPkjjpJLwaNHOaGey3qZI1iN1j3+g9xTLPs8pXhm06De42BCIC/YyJCryt8Nw0woQO7einx6tyaWZtdciw+PYYC4/Sc7SMkLZhX3iRqXCJwNOdTdqQ0S7/sn+rd+rYNhCFp315wvU+jjOaBTMrPHGJnOy5WUbyph0+Uq0HpXANJ3tTzZOhv87URfe4AOXs5eeKBfvdhe/V5FfBocJBWjTNevxxftXmGXHp3iM0NYAuinX6q5tK0fFUP4B93fYexlvJ5hDmVuYy9ExuRekqyXNZiZtrmRR2TTHX/JFpyUcHyFyeLHvbVFcO1YnMHmo3ujB8b63neezQfN7YEMHTe0t5+g2iL6O8eO2tke+9A6UvJnr7qf0D3bchxRFXgd+FtJQMP5s8R7PMI94pJHORr5ZI80CatSBMLLEYn539/4uFuWHwQ3fFMxileW5AuQsPafmVjurBifUbyL0dqA1h+T8YKRR11dPqJUAyBeXVPPycP5mZQzhkoAQmCI8+Z9quTMZw1pXr9irePx9BSDs0QU8/MZneCPUjvBqZfzrQOAnmeqgWd86UwaK0RYYKPO1xH7JyxVFjExDHOtN2OMIegw90HLparrGqxu0tg2x5fyZMyQe8O4/13hGA2OVifABsfh63xmwzTyn53gXhV7Iw+qywvUjKpixqhCgOFM3ey8TtB8QCIOfchltd6gw0bqXkSqufk/O87McmBt11PKAebabLMbcpuwy7PiTWehpas1MXeujPVT8IQvYfum3+ujWGgT7HwGgm8/XkjMZFBX43dMY97LdchEWFe3X6jXqJZTJLFiN3VJl+6D6ml/7nhe/k8zbyCC4x7acD0vXO1fnUjvOEZZx1jjF7qaDyaxoCR2+w1wUvnHWJ0h2QGo7bkW8UiMpu+oH+YVJgryTvWfu8o12xDv+gunaqT0oM7cnW7+TFw/pKuSxu6kF31TFlLk9uiJo3VCfpnXFEfuJtae+zanPwkiULTzwS/9NCFruRy99Sc2+a+D8Slhj7kTb2vydB4Ux3KWrC1aAVl1DiXmby48Ij6DC2fc6h9O9B6pglhb+i0LlXPit15ce+o6lfGHOUWn2OdeIddT6bdeQjOj9NCqcxPGG7a9M6aYp2uVRDWwnAUXdx7Th7kPkOAdhM3uSLEDPlWhkCgNyefp3gXArjni9Lraw0aKnmXuCUtzifqBwSgIj23L8STooz+clTfV9zVrgYNpuRIyEYufJy5sFJcngOYeuCqmo5uhcB1qwTH9Moxw2gPcIOrEJ5z5OnL+NkU+tFGKM2ifCGkKaORcESe8kD426ODjvjXHlwZyHuCGCemzfQwjq3MO+Usk6YUm1XBvWYspmPm12lxryzWsKW0wrAmnAb3p8IeV/euWZLJadfcurUUHloa8QGHegZqjyBJUXHAj2MuDgNkBLx4pOyjb/18pIUsttVL9TIkXWaVUM++4YxAi5sGxCjMaSm/ZPm5DAZx6BZgGKPTOTtJzCMuf0t33vPNt90eWgPE+kThck0cHho49hSSWR5gbeaiBcw7YZCEfGnwS/saaIq93LR1bwpNAiY2Z03A7zZ+anL4a7OajUQ7TrlK2qOsYXwGWsj+FkPPY5ibry24DqX3K9CeN4NV9FU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d10e942a-6d6e-41ec-5c28-08dcb4e6f6ac 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:38:45.4687 (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: 5FFhpisahyfj2QOPNKwUfZqfiwHlCLTXC7f7syE6zs1/DVIxxjG4KyhmDKSulg2OvyzIA+j6sUlqMgA3IHkv6I7QFtbmOTrH0liMLEGqfsNjYkGyz1E+mVzznuz+AjIu X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: OOOJSWXJDUW6VI3AB4GP3YN4QDUYUAGX X-Message-ID-Hash: OOOJSWXJDUW6VI3AB4GP3YN4QDUYUAGX 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/sh/dma-sh7760.c | 12 ++++++------ sound/soc/sh/fsi.c | 7 +------ sound/soc/sh/hac.c | 2 +- sound/soc/sh/rcar/core.c | 4 ++-- sound/soc/sh/rz-ssi.c | 14 ++++---------- sound/soc/sh/siu_dai.c | 4 ++-- sound/soc/sh/siu_pcm.c | 14 +++++++------- sound/soc/sh/ssi.c | 2 +- 8 files changed, 24 insertions(+), 35 deletions(-) diff --git a/sound/soc/sh/dma-sh7760.c b/sound/soc/sh/dma-sh7760.c index c53539482c208..32b30bbfaa88f 100644 --- a/sound/soc/sh/dma-sh7760.c +++ b/sound/soc/sh/dma-sh7760.c @@ -120,7 +120,7 @@ static int camelot_pcm_open(struct snd_soc_component *component, { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct camelot_pcm *cam = &cam_pcm_data[snd_soc_rtd_to_cpu(rtd, 0)->id]; - int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; + int recv = snd_pcm_is_capture(substream); int ret, dmairq; snd_soc_set_runtime_hwparams(substream, &camelot_pcm_hardware); @@ -154,7 +154,7 @@ static int camelot_pcm_close(struct snd_soc_component *component, { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct camelot_pcm *cam = &cam_pcm_data[snd_soc_rtd_to_cpu(rtd, 0)->id]; - int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; + int recv = snd_pcm_is_capture(substream); int dmairq; dmairq = (recv) ? cam->txid + 2 : cam->txid; @@ -176,7 +176,7 @@ static int camelot_hw_params(struct snd_soc_component *component, { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct camelot_pcm *cam = &cam_pcm_data[snd_soc_rtd_to_cpu(rtd, 0)->id]; - int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; + int recv = snd_pcm_is_capture(substream); if (recv) { cam->rx_period_size = params_period_bytes(hw_params); @@ -198,7 +198,7 @@ static int camelot_prepare(struct snd_soc_component *component, pr_debug("PCM data: addr %pad len %zu\n", &runtime->dma_addr, runtime->dma_bytes); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { BRGREG(BRGATXSAR) = (unsigned long)runtime->dma_area; BRGREG(BRGATXTCR) = runtime->dma_bytes; } else { @@ -242,7 +242,7 @@ static int camelot_trigger(struct snd_soc_component *component, { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct camelot_pcm *cam = &cam_pcm_data[snd_soc_rtd_to_cpu(rtd, 0)->id]; - int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; + int recv = snd_pcm_is_capture(substream); switch (cmd) { case SNDRV_PCM_TRIGGER_START: @@ -270,7 +270,7 @@ static snd_pcm_uframes_t camelot_pos(struct snd_soc_component *component, struct snd_pcm_runtime *runtime = substream->runtime; struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct camelot_pcm *cam = &cam_pcm_data[snd_soc_rtd_to_cpu(rtd, 0)->id]; - int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; + int recv = snd_pcm_is_capture(substream); unsigned long pos; /* cannot use the DMABRG pointer register: under load, by the diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index 087e379aa3bc4..59198f615ed6a 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c @@ -398,11 +398,6 @@ static int fsi_is_enable_stream(struct fsi_priv *fsi) return fsi->enable_stream; } -static int fsi_is_play(struct snd_pcm_substream *substream) -{ - return substream->stream == SNDRV_PCM_STREAM_PLAYBACK; -} - static struct snd_soc_dai *fsi_get_dai(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); @@ -492,7 +487,7 @@ static void fsi_count_fifo_err(struct fsi_priv *fsi) static inline struct fsi_stream *fsi_stream_get(struct fsi_priv *fsi, struct snd_pcm_substream *substream) { - return fsi_is_play(substream) ? &fsi->playback : &fsi->capture; + return snd_pcm_is_playback(substream) ? &fsi->playback : &fsi->capture; } static int fsi_stream_is_working(struct fsi_priv *fsi, diff --git a/sound/soc/sh/hac.c b/sound/soc/sh/hac.c index cc200f45826c3..dc724042d336e 100644 --- a/sound/soc/sh/hac.c +++ b/sound/soc/sh/hac.c @@ -237,7 +237,7 @@ static int hac_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct hac_priv *hac = &hac_cpu_data[dai->id]; - int d = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0 : 1; + int d = snd_pcm_is_capture(substream); switch (params->msbits) { case 16: diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 15cb5e7008f9f..9e719a01769ba 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -683,7 +683,7 @@ static struct rsnd_dai_stream *rsnd_rdai_to_io(struct rsnd_dai *rdai, struct snd_pcm_substream *substream) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return &rdai->playback; else return &rdai->capture; @@ -1004,7 +1004,7 @@ static int rsnd_soc_dai_startup(struct snd_pcm_substream *substream, * It depends on Clock Master Mode */ if (rsnd_rdai_is_clk_master(rdai)) { - int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + int is_play = snd_pcm_is_playback(substream); snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, rsnd_soc_hw_rule_rate, diff --git a/sound/soc/sh/rz-ssi.c b/sound/soc/sh/rz-ssi.c index d0bf0487bf1bd..d0afc9ced950b 100644 --- a/sound/soc/sh/rz-ssi.c +++ b/sound/soc/sh/rz-ssi.c @@ -171,18 +171,12 @@ rz_ssi_get_dai(struct snd_pcm_substream *substream) return snd_soc_rtd_to_cpu(rtd, 0); } -static inline bool rz_ssi_stream_is_play(struct rz_ssi_priv *ssi, - struct snd_pcm_substream *substream) -{ - return substream->stream == SNDRV_PCM_STREAM_PLAYBACK; -} - static inline struct rz_ssi_stream * rz_ssi_stream_get(struct rz_ssi_priv *ssi, struct snd_pcm_substream *substream) { struct rz_ssi_stream *stream = &ssi->playback; - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) stream = &ssi->capture; return stream; @@ -349,7 +343,7 @@ static void rz_ssi_set_idle(struct rz_ssi_priv *ssi) static int rz_ssi_start(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm) { - bool is_play = rz_ssi_stream_is_play(ssi, strm->substream); + bool is_play = snd_pcm_is_playback(strm->substream); bool is_full_duplex; u32 ssicr, ssifcr; @@ -682,7 +676,7 @@ static int rz_ssi_dma_transfer(struct rz_ssi_priv *ssi, */ return 0; - dir = rz_ssi_stream_is_play(ssi, substream) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM; + dir = snd_pcm_is_playback(substream) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM; /* Always transfer 1 period */ amount = runtime->period_size; @@ -808,7 +802,7 @@ static int rz_ssi_dai_trigger(struct snd_pcm_substream *substream, int cmd, if (ssi->dma_rt) { bool is_playback; - is_playback = rz_ssi_stream_is_play(ssi, substream); + is_playback = snd_pcm_is_playback(substream); ret = rz_ssi_dma_slave_config(ssi, ssi->playback.dma_ch, is_playback); /* Fallback to pio */ diff --git a/sound/soc/sh/siu_dai.c b/sound/soc/sh/siu_dai.c index d0b5c543fd2f8..e747d34b51580 100644 --- a/sound/soc/sh/siu_dai.c +++ b/sound/soc/sh/siu_dai.c @@ -521,7 +521,7 @@ static void siu_dai_shutdown(struct snd_pcm_substream *substream, dev_dbg(substream->pcm->card->dev, "%s: port=%d@%p\n", __func__, info->port_id, port_info); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) port_info->play_cap &= ~PLAYBACK_ENABLED; else port_info->play_cap &= ~CAPTURE_ENABLED; @@ -550,7 +550,7 @@ static int siu_dai_prepare(struct snd_pcm_substream *substream, "%s: port %d, active streams %lx, %d channels\n", __func__, info->port_id, port_info->play_cap, rt->channels); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { self = PLAYBACK_ENABLED; siu_stream = &port_info->playback; } else { diff --git a/sound/soc/sh/siu_pcm.c b/sound/soc/sh/siu_pcm.c index f15ff36e79345..27ee6fd6d35c2 100644 --- a/sound/soc/sh/siu_pcm.c +++ b/sound/soc/sh/siu_pcm.c @@ -214,7 +214,7 @@ static void siu_io_work(struct work_struct *work) return; } - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { dma_addr_t buff; size_t count; @@ -306,7 +306,7 @@ static int siu_pcm_open(struct snd_soc_component *component, dev_dbg(dev, "%s, port=%d@%p\n", __func__, port, port_info); - if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(ss)) { siu_stream = &port_info->playback; param = &siu_stream->param; param->shdma_slave.slave_id = port ? pdata->dma_slave_tx_b : @@ -340,7 +340,7 @@ static int siu_pcm_close(struct snd_soc_component *component, dev_dbg(dev, "%s: port=%d\n", __func__, info->port_id); - if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(ss)) siu_stream = &port_info->playback; else siu_stream = &port_info->capture; @@ -363,7 +363,7 @@ static int siu_pcm_prepare(struct snd_soc_component *component, struct siu_stream *siu_stream; snd_pcm_sframes_t xfer_cnt; - if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(ss)) siu_stream = &port_info->playback; else siu_stream = &port_info->capture; @@ -413,7 +413,7 @@ static int siu_pcm_trigger(struct snd_soc_component *component, switch (cmd) { case SNDRV_PCM_TRIGGER_START: - if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(ss)) ret = siu_pcm_stmwrite_start(port_info); else ret = siu_pcm_stmread_start(port_info); @@ -424,7 +424,7 @@ static int siu_pcm_trigger(struct snd_soc_component *component, break; case SNDRV_PCM_TRIGGER_STOP: - if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(ss)) siu_pcm_stmwrite_stop(port_info); else siu_pcm_stmread_stop(port_info); @@ -455,7 +455,7 @@ siu_pcm_pointer_dma(struct snd_soc_component *component, size_t ptr; struct siu_stream *siu_stream; - if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(ss)) siu_stream = &port_info->playback; else siu_stream = &port_info->capture; diff --git a/sound/soc/sh/ssi.c b/sound/soc/sh/ssi.c index 96cf523c22734..f77b4d9a4a205 100644 --- a/sound/soc/sh/ssi.c +++ b/sound/soc/sh/ssi.c @@ -135,7 +135,7 @@ static int ssi_hw_params(struct snd_pcm_substream *substream, channels = params_channels(params); bits = params->msbits; - recv = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? 0 : 1; + recv = snd_pcm_is_capture(substream); pr_debug("ssi_hw_params() enter\nssicr was %08lx\n", ssicr); pr_debug("bits: %u channels: %u\n", bits, channels); From patchwork Mon Aug 5 00:38:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816787 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 54715C3DA64 for ; Mon, 5 Aug 2024 00:52:48 +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 B251950AA; Mon, 5 Aug 2024 02:51:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B251950AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819082; bh=eQhB/6wMjwacnVwEX/cour12gs6QnRl6GHsflHPXrAo=; 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=BHOm8JlCN5/0CBaTuj4pkTHNDEsSLVscDftFs59t6pUm3ABsdIyqzQzHbTIqaYhoL 6EdPgywA7Pgau7kYTDF616+HNMRo3yS2w3ITlnL0lCmeFMCajVP5lLfUxkpSetZd99 h32q24G5qRo1iJKT3GZN6dLOCEcZBlTxHAu5GxoQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4AE6AF899D5; Mon, 5 Aug 2024 02:39:51 +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 F405BF899C7; Mon, 5 Aug 2024 02:39:50 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E5B52F89631; Mon, 5 Aug 2024 02:39:08 +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 69427F806B4 for ; Mon, 5 Aug 2024 02:38:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 69427F806B4 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=GoEJ84Oa ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=T9YBAkiOH2uy/CGLPmgKyB+F8lLNf56W9vBdd7z/J8CmKSMuM0zMGQyQ0v+INqLnyAmQTrBJEqkSBiZa7lHTPg91X3Tsi37glZefTIwdlcH4CSeWOWYD1dSiTTm4yjTcKCPM1xibUiEsR/NGo6iFQasUhaLBITF56xMjCFHlNCGgdZ6zI2UYAqASe20r3hjuIJnPpWzP8q2aCv6htJq7FRuBET5sWTteJA7V3UYWsZo0g+nFwPlN5vGV2pzt30Sbo7mcXQO0mKXfI6nD2wTxcxVjkm0Zh6dxzyQ5Laq3OUxdCwmmhLppt1HTkm5VFSh3Y3+dwMARNTpOplevJalF8g== 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=FwcdOztjSz00QX2aKUocDnSSeb//2DkuyFlFOYnZiZk=; b=Ntg9WfB2ehd3n3cqGuro+AT9Peh7BURockb1GfQV4nkvU1nZTC16pEucmob2lJFAW3ELTMpqPssNMWclusVMCWikNtOgM+uC2mbpIXAZrGmMo/nU1hItOGq+Voo9AbPGE5nztePNuhhSCAjedwbZyMKUQgv7HFOM4C7ibyz05vLNn+aGflJaBYmLn7uB963M/7O2ueHoPZEKWVNHRP41QFS0Sl/uG0WoHkZ5hAQanX1bjOP69JpWeZSU3jwhoCwdOtr09fNgaZm0XU8iQlyLuduvOjw3lLTDkj5g0xezHg5poj4KgB9u9wHoCfXwPdBRvcI2CVI4XVKHYkWAQaPoZg== 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=FwcdOztjSz00QX2aKUocDnSSeb//2DkuyFlFOYnZiZk=; b=GoEJ84OaU33RqOT8/h+H1SvH311X9ox+3UfzKEe7bGP96eC3HBnX/GOdL/quVL3zsW1VhKSoCF6BFf54Oe90KexBheBdvDnLXid4zJ1Z1g4SXVXAVO9EU4cqL1+vvAo3/t5GfT1xs57dL5ZHHIN3HqZlow8bnVlZWqzH2/z28sI= 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 TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::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:38:50 +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:38:49 +0000 Message-ID: <87bk27ztuu.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 045/113] ASoC: adi: 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:38:49 +0000 X-ClientProxiedBy: TYCP286CA0242.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:456::9) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: 3484fce0-ddfb-4035-72b5-08dcb4e6f950 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: dlbtg7tntTFhO2ag3CFKD1Tei6GkTpwXXATKnAo1GD1g2hUmx9hChy5+hO/iMmnihnnQKzXjSW+W0tX8A4DxtA/r3xPwAbIbBhsufUTGALQztMYDyzVVfEDopFz7kDe4OGrCNgjZ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9R9Rh/z0yagjUQUxP/11L7/ycFZwYe058RxyPkiSu1kQBDABxoHJkTF7N5k4H1MvoFgXA3UTyRfrIDmYMHt2IwOhxEr3viuU/1lKw38dECD3KWO5BovmpbnzDIeZ6ou1c87gTTXtF4DQjJfRlHMLoe6LitM5cZzn3ETCKs0RIeqtWZLI51Ed5e2Ay0f84EkJKeE21cejfaCQ== 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)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TEeizDqI6UTkgvCWDUp0IoBdDxK0/wzIQexoy+WDklZp8rZqWkwEYNvIfgceT4pl0E0ysC0RgRJ6oWmPzMJJnYGLyIe/ClK18Yo/jtn1MsEGFMMhrRQVeZh8VBjt3RAMqjuWOXXcsB5zyw+Ey9X2wZ1zb4XGS/SNsIkmgBqSOwm53YDWwE5tMtRdUiMiJqn/wEYtGyxwkVhnxIv37cRHzSvkXrthID8IUyde5Z059MN/txF+V/YoROx5f75HZEns2Ebx7TvW4KiuxVmtC/ccjvk0f9jyuV6dvqMqOfgmsCcqnXxwq4nGx60C6t8nS9HGCtykfJpI8LH5L2WuTtU9JUNFSFY5oN8GAqQW+FWkSRP6VJMgbyOd29LbcWQwPbdK8RwqIzlh30hTLuXOtubhY214Ub5kubqLY1J6r0xJMPXpPtq0SozvRjRwMFk/mG1YMVGgf+WsPxh4damdKozq9N+7q8tqMHsFfxLSzwIvFEKrnxI3YhJn0srKGA0I2zWYj1vG40s6FLVTvtUvsMKvhhYmRFl+G1BNk+EouDfl0lQPWlFt1BVmkOmLfjIJEUe8S3EJhQ+LZ2WjPc+nMMqpNEUV+tWGeI4wq0FLslI1FhpAptrNz3ipbpv7mb3Iqg1WJFK474R0mJve7gbu/BtXbg0SInliv/he8I24x8S38eFyVwlalNW/mPDD5aPJHVQupdRqPpJEvdLPl7LxADF8+MZY1bC53ooriS/sPNlabSmA4UxW6IYXGgGC6t/8NJJYOr8XtRmooCHOj4K0Nvomu/LtznGkQYs6oIbOMfb8O/9UoTEnWcwriGfKP7TnR0cBh19yKyifVh6ssxsp5wnAwL/YILhbcKRrhJE3pdA71m27ghRJ57YdY1gZVANt7jzkcvnaNlxx9U++WQT3asCPSQj87G0TY9h71XTpGw3c9tclQMganFGu+MSURdtycDviYDIzdiyntD4H4M2MQ3zFFy2hihDZTpsRGzF5kk1qXdoARUhyQOf39QsjoaxRyZN3+RZ5P7cohr+ASg6sQhFRAuZrG/ImG6SM7Uzf/5aauG48N9xTVXsDBM8clZZf4hs3X0Iik93ZzVquLtgHrJEiZ0gmP0RiGvJO5DweXU4NbI0asuPEeabT1lhW3cuP/92Hx191z1xCETimXtKHkDh+Kv02rvxHTLRrWxOlnWHvJ7Lww/uaTDP0DXhlai+XSJ+uAOYnonrTDfpGSPx8p8+968fa2XMaWWL86nL2rcCDS/0jvOdHsSJrDYw6FvTm/AufUX5TyWrgnH8pa1531zjIAv7rctPBJBX/oN4X0H1H9gSXqSEs3prLpXhY3iepT/LfZmfTQJBQzHSGkEMFl08RV3R4Kj50mDJ3+2Zzaxi9T2VRuqlDmCBINQQYtWa1c47jzSODgKg7ExoVvfYK8nfRPnEp81QP4iObNI5C+EIodTjwaGlaaxRkF5uZb9zJ28Y6rAHihNjY0kqnSK5qorzJw70bU/2VVwtVNxieazt2CBSWiCHZNshn8tOsuzNGEQaSdZcoWJm2hfFjzIIXpWYFOOH8Ea2V1cEHB1BAcx1kmBgExgrHone+CX2mONGl8cX5hgLf9rVrODrrl1cUeo0V9ArR+QoIiqQNeSpOjQaybCg= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3484fce0-ddfb-4035-72b5-08dcb4e6f950 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:38:49.8912 (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: ZlHNmintQtfmFCJDXhwMTpvF1hAmB8ehMH5hCuu7Eg4yeL5kO6Mpd7454Erx/OxyYWupF5QPDNnT+FF5RhVVjV5HWKNdwnNOLxhMjJN5tQUfKhQUxi/rRWb1OUNvbiCL X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: TEA25SN5DJUX6OCDJHV4VW66V5DUCPQW X-Message-ID-Hash: TEA25SN5DJUX6OCDJHV4VW66V5DUCPQW 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/adi/axi-i2s.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/adi/axi-i2s.c b/sound/soc/adi/axi-i2s.c index 7b25630757436..7c950a7b71eec 100644 --- a/sound/soc/adi/axi-i2s.c +++ b/sound/soc/adi/axi-i2s.c @@ -60,7 +60,7 @@ static int axi_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct axi_i2s *i2s = snd_soc_dai_get_drvdata(dai); unsigned int mask, val; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) mask = AXI_I2S_CTRL_RX_EN; else mask = AXI_I2S_CTRL_TX_EN; @@ -110,7 +110,7 @@ static int axi_i2s_startup(struct snd_pcm_substream *substream, uint32_t mask; int ret; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) mask = AXI_I2S_RESET_RX_FIFO; else mask = AXI_I2S_RESET_TX_FIFO; From patchwork Mon Aug 5 00:38:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817104 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 77831C3DA64 for ; Mon, 5 Aug 2024 00:55:09 +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 79F3E4985; Mon, 5 Aug 2024 02:52:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 79F3E4985 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819155; bh=nsEKi7KDRRpua5sTetmxxdDql0FNa8KTpJPJz/m7DLo=; 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=VmfID0IyyMJZ/kIIaEOG6JNYFeNA4YN9XZH6XP0iInHu+QEmT6+SOLOsTjX9G8PIs 9xqUcLEFpndZhRtE6SeDmQ7NMm/9YIZiXCdBer351sv/ol9mrDpXqhYJW6xcEmnriw FvjHUmXeiKA25/uyzfHOm1ua182lfPla+qX8uvGw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id F2BCCF89A39; Mon, 5 Aug 2024 02:40:02 +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 CC25FF89A09; Mon, 5 Aug 2024 02:40:01 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1CE9FF896DA; Mon, 5 Aug 2024 02:39:32 +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 DFBD9F80772 for ; Mon, 5 Aug 2024 02:38:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DFBD9F80772 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=CcGnlDfg ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cNqOKONDz+eIxdTxg8bRAt/cN+ab0AbL6w8i7dxgxc6m84WkKyPRIJonFmvPBfDpRtsmKr08P7P9RWS+6NSNjwOz9kSyDAaj0R26kuYl0YGO52p84n63iwLl5lIAfW4uGxIcdaW+HahnXWzBLwuzzhEBTzkp9AF6Ztj/iGytSoZodd4rV9m0KHNowr2R5l9gDWMCNatz0jboOOq0w5Baxcn7snG9wkPCxVDS3h9cXZmNp73TfQGL+Szc6Gz4I56Q9Vn6x2Hqe4zXCwMaa4wtDt2zvZbpN1Ef0a1Vy0fqcLNp/3odv/Zi0AEJI/42Fx4yVvZhOuFibpF6lUApevLN1Q== 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=kqUXevHHAlixeXM/1OxjdcwV14TUzsjb7SmcQR/fae8=; b=xuaTiV+GdEoj7O2hokpN46MknC4HKYYpksjEF/D3shBIKuPnf5BuMhJvilawLlSQ6lrBtHaVwlT/T4JDLuFqbOswoUxxrnD6zTTQQ6XuDEKhaWij/AI5SCRePjsd8itwwKGj5iCOf2x+t45lAk0UIgVup0k+jkx5F9WvsLb0mlrAhq7+L5TZFJHi3Zsrk2Fptis6Qj8uaTLXuqiO3Gfe4RzeWUudIdD9y5bv7uuwmn2S8FGwbr/Se65ZD2KjJR1avae34I2h6ub7PeX60jf7iRPwfXiV00j1M5gUpoHbPRWMzKVTDPbLMcFCL4ukCS2410+w5LHo0ncWLIA5rf7zAA== 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=kqUXevHHAlixeXM/1OxjdcwV14TUzsjb7SmcQR/fae8=; b=CcGnlDfgW8a43Z2z8rqmuazEs3TNSOKOEi2nzddho8JM29NhZ+a5RDyNOin2juEGGCas5k41pL2gRc6V5JIlsyhrL4U477VfUhTR6R7D0wKd+ax8YpR6I+oTH5gvGv+OWAfQRullW5d4GLp8DmPyRK30QgmyYC2rMunRc6BaHzE= 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 TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::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:38:54 +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:38:54 +0000 Message-ID: <87a5hrztuq.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 046/113] ASoC: amd: 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:38:54 +0000 X-ClientProxiedBy: TYAPR01CA0159.jpnprd01.prod.outlook.com (2603:1096:404:7e::27) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: 270868b1-cf64-4947-47c5-08dcb4e6fbeb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: n/W1zy4lqG3EH0JOeQ7anYvaJFOAh2pRv4z3lfzSM4IvL9U1MoOQJH88Mn62CQyiBv7V82KvP/vdPtw0TPXnnHxQaNbMAw66DM4mE37ODXyAV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9N+eJZmrK2tTkjskVbtE6E6GXYjC5IowhPLsbsJOnLKEQdd5wrIJcgv7uDKhyOZWWsXSp4h6i34jHAULMR0fYBjRdplZrCQr8/orkKipkdq5d2atksgQ+mUqvqJwoGd98UC7HTViJ9zHFYWIADepWAGJJuVekZ0PZRi5F+kQPiZo7d2BHDEyxrL1klqQbSvfrm7VF92hRG7sNf0jIAgUnchayhFUEJVFP92WA1t19UH6indqkYexUx9a3QhvA== 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)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WIyvfWxZEO1j2tmBbUxUvYusFvPedCwAh6kmYaZqoIpcrF29waX3tew5PKINocwWIOXJh+k535Ck6Bc+PIh8TXKuCwVHDkjpBDTJmL05jsX0CS8ikVAi8Ujd7esWUInUSUD6WgpMcNOleiz0oOxseD5o2q8ID5jjjRCrt0JtS4eHvsrRTBU1//drKMCHPMkVUnnlTM9Hbs7gBMFbeh55NIg2TMMIxqjlnBgsaPk3F3Wjs6p5OX1YbI40N/VF7xR5ATSCtvTGwt7bOxSJFAbsDl8Tb3Lc63XYLZMTYoz+ABsO5RRCJ/vcVew9tahJLULRf0Mm3gojgShoRQeZog7Aemy9cdW99NdHQDGxtqXMhy3v2CfFhfz8Dpa+whBA6fFwn32/52qHH3JFHz5YK8xqBx9GUBOKP1zJg/cWzddrfF2C2KhnNvPXDux6jzLfnKvDrn87PicbXos7N7cUNza1lW1ZGvxPEaIo28IC17/9m14OJnhPqtoSW+Q2us+PDb26uFY/he7A/y/oZJJnajCmbhHg2lrNPpmD3Onqf831ehBbWAvGwoTUJ5WtmYE+p6+DcZFZ+7ywIBwl/gmUbktiMT8sGpHduRYe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270868b1-cf64-4947-47c5-08dcb4e6fbeb 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:38:54.2734 (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: h49qLPR68J/jkTVoj2D31zW1ib40A1oCNVjDRe3Sp9CD8LhG9O2LFDrBu32RIxteVE21TjU2KQ77rQIlC+ATq1zpk/JjA0tdKEhBqzowRzFLUJNkhKHPvgaaCNrk9VXH X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: NT6USDEIMOHNMWEWLMYW2C5KGFKJVZI4 X-Message-ID-Hash: NT6USDEIMOHNMWEWLMYW2C5KGFKJVZI4 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/amd/acp-pcm-dma.c | 24 ++++++++++++------------ sound/soc/amd/acp/acp-i2s.c | 24 ++++++++++++------------ sound/soc/amd/acp/acp-legacy-common.c | 8 ++++---- sound/soc/amd/acp/acp-platform.c | 2 +- sound/soc/amd/acp/acp-sdw-sof-mach.c | 4 ++-- sound/soc/amd/acp/amd.h | 2 +- sound/soc/amd/ps/ps-pdm-dma.c | 4 ++-- sound/soc/amd/ps/ps-sdw-dma.c | 4 ++-- sound/soc/amd/raven/acp3x-i2s.c | 8 ++++---- sound/soc/amd/raven/acp3x-pcm-dma.c | 10 +++++----- sound/soc/amd/raven/acp3x.h | 2 +- sound/soc/amd/renoir/acp3x-pdm-dma.c | 4 ++-- sound/soc/amd/vangogh/acp5x-i2s.c | 8 ++++---- sound/soc/amd/vangogh/acp5x-pcm-dma.c | 10 +++++----- sound/soc/amd/vangogh/acp5x.h | 2 +- sound/soc/amd/yc/acp6x-pdm-dma.c | 4 ++-- 16 files changed, 60 insertions(+), 60 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index b857e2676fe8c..39d2b1538b27b 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -210,7 +210,7 @@ static void set_acp_sysmem_dma_descriptors(void __iomem *acp_mmio, for (i = 0; i < NUM_DSCRS_PER_CHANNEL; i++) { dmadscr[i].xfer_val = 0; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { dma_dscr_idx = dma_dscr_idx + i; dmadscr[i].dest = sram_bank + (i * (size / 2)); dmadscr[i].src = ACP_INTERNAL_APERTURE_WINDOW_0_ADDRESS @@ -268,7 +268,7 @@ static void set_acp_to_i2s_dma_descriptors(void __iomem *acp_mmio, u32 size, for (i = 0; i < NUM_DSCRS_PER_CHANNEL; i++) { dmadscr[i].xfer_val = 0; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { dma_dscr_idx = dma_dscr_idx + i; dmadscr[i].src = sram_bank + (i * (size / 2)); /* dmadscr[i].dest is unused by hardware. */ @@ -336,7 +336,7 @@ static void config_acp_dma(void __iomem *acp_mmio, acp_pte_config(acp_mmio, rtd->dma_addr, rtd->num_of_pages, rtd->pte_offset); - if (rtd->direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(rtd->direction)) { ch_acp_sysmem = rtd->ch1; ch_acp_i2s = rtd->ch2; } else { @@ -779,7 +779,7 @@ static int acp_dma_open(struct snd_soc_component *component, if (!adata) return -ENOMEM; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (intr_data->asic_type) { case CHIP_STONEY: runtime->hw = acp_st_pcm_hardware_playback; @@ -819,7 +819,7 @@ static int acp_dma_open(struct snd_soc_component *component, !intr_data->play_i2s_micsp_stream) acp_reg_write(1, adata->acp_mmio, mmACP_EXTERNAL_INTR_ENB); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* * For Stoney, Memory gating is disabled,i.e SRAM Banks * won't be turned off. The default state for SRAM banks is ON. @@ -861,7 +861,7 @@ static int acp_dma_hw_params(struct snd_soc_component *component, return -EINVAL; if (pinfo) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { rtd->i2s_instance = pinfo->play_i2s_instance; } else { rtd->i2s_instance = pinfo->cap_i2s_instance; @@ -871,7 +871,7 @@ static int acp_dma_hw_params(struct snd_soc_component *component, if (adata->asic_type == CHIP_STONEY) { val = acp_reg_read(adata->acp_mmio, mmACP_I2S_16BIT_RESOLUTION_EN); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: val |= ACP_I2S_BT_16BIT_RESOLUTION_EN; @@ -898,7 +898,7 @@ static int acp_dma_hw_params(struct snd_soc_component *component, mmACP_I2S_16BIT_RESOLUTION_EN); } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: rtd->pte_offset = ACP_ST_BT_PLAYBACK_PTE_OFFSET; @@ -1043,7 +1043,7 @@ static snd_pcm_uframes_t acp_dma_pointer(struct snd_soc_component *component, if (!rtd) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { period_bytes = frames_to_bytes(runtime, runtime->period_size); bytescount = acp_get_byte_count(rtd); if (bytescount >= rtd->bytescount) @@ -1092,7 +1092,7 @@ static int acp_dma_prepare(struct snd_soc_component *component, if (!rtd) return -EINVAL; - if (rtd->direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(rtd->direction)) { ch_acp_sysmem = rtd->ch1; ch_acp_i2s = rtd->ch2; } else { @@ -1125,7 +1125,7 @@ static int acp_dma_trigger(struct snd_soc_component *component, case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: case SNDRV_PCM_TRIGGER_RESUME: rtd->bytescount = acp_get_byte_count(rtd); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { if (rtd->capture_channel == CAP_CHANNEL0) { acp_dma_cap_channel_disable(rtd->acp_mmio, CAP_CHANNEL1); @@ -1190,7 +1190,7 @@ static int acp_dma_close(struct snd_soc_component *component, struct audio_substream_data *rtd = runtime->private_data; struct audio_drv_data *adata = dev_get_drvdata(component->dev); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: adata->play_i2sbt_stream = NULL; diff --git a/sound/soc/amd/acp/acp-i2s.c b/sound/soc/amd/acp/acp-i2s.c index 97258b4cf89b0..eafa6262e6feb 100644 --- a/sound/soc/amd/acp/acp-i2s.c +++ b/sound/soc/amd/acp/acp-i2s.c @@ -132,10 +132,10 @@ static int acp_i2s_set_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask, u32 rx_mas spin_lock_irq(&adata->acp_lock); list_for_each_entry(stream, &adata->stream_list, list) { - if (tx_mask && stream->dir == SNDRV_PCM_STREAM_PLAYBACK) + if (tx_mask && snd_pcm_is_playback(stream->dir)) adata->tdm_tx_fmt[stream->dai_id - 1] = FRM_LEN | (slots << 15) | (slot_len << 18); - else if (rx_mask && stream->dir == SNDRV_PCM_STREAM_CAPTURE) + else if (rx_mask && snd_pcm_is_capture(stream->dir)) adata->tdm_rx_fmt[stream->dai_id - 1] = FRM_LEN | (slots << 15) | (slot_len << 18); } @@ -176,7 +176,7 @@ static int acp_i2s_hwparams(struct snd_pcm_substream *substream, struct snd_pcm_ return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (dai->driver->id) { case I2S_BT_INSTANCE: reg_val = ACP_BTTDM_ITER; @@ -224,7 +224,7 @@ static int acp_i2s_hwparams(struct snd_pcm_substream *substream, struct snd_pcm_ if (adata->tdm_mode) { val = readl(adata->acp_base + reg_val); writel(val | BIT(1), adata->acp_base + reg_val); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) tdm_fmt = adata->tdm_tx_fmt[dai->driver->id - 1]; else tdm_fmt = adata->tdm_rx_fmt[dai->driver->id - 1]; @@ -318,7 +318,7 @@ static int acp_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: stream->bytescount = acp_get_byte_count(adata, stream->dai_id, substream->stream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (dai->driver->id) { case I2S_BT_INSTANCE: water_val = ACP_BT_TX_INTR_WATERMARK_SIZE; @@ -379,7 +379,7 @@ static int acp_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (dai->driver->id) { case I2S_BT_INSTANCE: reg_val = ACP_BTTDM_ITER; @@ -444,7 +444,7 @@ static int acp_i2s_prepare(struct snd_pcm_substream *substream, struct snd_soc_d switch (dai->driver->id) { case I2S_SP_INSTANCE: - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { reg_dma_size = ACP_I2S_TX_DMA_SIZE; acp_fifo_addr = rsrc->sram_pte_offset + SP_PB_FIFO_ADDR_OFFSET; @@ -464,7 +464,7 @@ static int acp_i2s_prepare(struct snd_pcm_substream *substream, struct snd_soc_d } break; case I2S_BT_INSTANCE: - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { reg_dma_size = ACP_BT_TX_DMA_SIZE; acp_fifo_addr = rsrc->sram_pte_offset + BT_PB_FIFO_ADDR_OFFSET; @@ -485,7 +485,7 @@ static int acp_i2s_prepare(struct snd_pcm_substream *substream, struct snd_soc_d } break; case I2S_HS_INSTANCE: - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { reg_dma_size = ACP_HS_TX_DMA_SIZE; acp_fifo_addr = rsrc->sram_pte_offset + HS_PB_FIFO_ADDR_OFFSET; @@ -538,7 +538,7 @@ static int acp_i2s_startup(struct snd_pcm_substream *substream, struct snd_soc_d switch (dai->driver->id) { case I2S_SP_INSTANCE: - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { irq_bit = BIT(I2S_TX_THRESHOLD(rsrc->offset)); stream->pte_offset = ACP_SRAM_SP_PB_PTE_OFFSET; stream->fifo_offset = SP_PB_FIFO_ADDR_OFFSET; @@ -549,7 +549,7 @@ static int acp_i2s_startup(struct snd_pcm_substream *substream, struct snd_soc_d } break; case I2S_BT_INSTANCE: - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { irq_bit = BIT(BT_TX_THRESHOLD(rsrc->offset)); stream->pte_offset = ACP_SRAM_BT_PB_PTE_OFFSET; stream->fifo_offset = BT_PB_FIFO_ADDR_OFFSET; @@ -560,7 +560,7 @@ static int acp_i2s_startup(struct snd_pcm_substream *substream, struct snd_soc_d } break; case I2S_HS_INSTANCE: - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { irq_bit = BIT(HS_TX_THRESHOLD(rsrc->offset)); stream->pte_offset = ACP_SRAM_HS_PB_PTE_OFFSET; stream->fifo_offset = HS_PB_FIFO_ADDR_OFFSET; diff --git a/sound/soc/amd/acp/acp-legacy-common.c b/sound/soc/amd/acp/acp-legacy-common.c index 4422cec81e3c4..35cd4b2b86cf2 100644 --- a/sound/soc/amd/acp/acp-legacy-common.c +++ b/sound/soc/amd/acp/acp-legacy-common.c @@ -112,7 +112,7 @@ static int set_acp_i2s_dma_fifo(struct snd_pcm_substream *substream, switch (dai->driver->id) { case I2S_SP_INSTANCE: - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { reg_dma_size = ACP_I2S_TX_DMA_SIZE; acp_fifo_addr = rsrc->sram_pte_offset + SP_PB_FIFO_ADDR_OFFSET; @@ -131,7 +131,7 @@ static int set_acp_i2s_dma_fifo(struct snd_pcm_substream *substream, } break; case I2S_BT_INSTANCE: - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { reg_dma_size = ACP_BT_TX_DMA_SIZE; acp_fifo_addr = rsrc->sram_pte_offset + BT_PB_FIFO_ADDR_OFFSET; @@ -150,7 +150,7 @@ static int set_acp_i2s_dma_fifo(struct snd_pcm_substream *substream, } break; case I2S_HS_INSTANCE: - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { reg_dma_size = ACP_HS_TX_DMA_SIZE; acp_fifo_addr = rsrc->sram_pte_offset + HS_PB_FIFO_ADDR_OFFSET; @@ -199,7 +199,7 @@ int restore_acp_i2s_params(struct snd_pcm_substream *substream, soc_runtime = snd_soc_substream_to_rtd(substream); dai = snd_soc_rtd_to_cpu(soc_runtime, 0); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { tdm_fmt = adata->tdm_tx_fmt[stream->dai_id - 1]; switch (stream->dai_id) { case I2S_BT_INSTANCE: diff --git a/sound/soc/amd/acp/acp-platform.c b/sound/soc/amd/acp/acp-platform.c index 4f409cd09c11c..d4b7355a1d989 100644 --- a/sound/soc/amd/acp/acp-platform.c +++ b/sound/soc/amd/acp/acp-platform.c @@ -192,7 +192,7 @@ static int acp_dma_open(struct snd_soc_component *component, struct snd_pcm_subs stream->substream = substream; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) runtime->hw = acp_pcm_hardware_playback; else runtime->hw = acp_pcm_hardware_capture; diff --git a/sound/soc/amd/acp/acp-sdw-sof-mach.c b/sound/soc/amd/acp/acp-sdw-sof-mach.c index 3419675e45a98..85f9fcbfe822b 100644 --- a/sound/soc/amd/acp/acp-sdw-sof-mach.c +++ b/sound/soc/amd/acp/acp-sdw-sof-mach.c @@ -450,8 +450,8 @@ static int create_sdw_dailink(struct snd_soc_card *card, cpus[k].dai_name = cpu_name; } - playback = (stream == SNDRV_PCM_STREAM_PLAYBACK); - capture = (stream == SNDRV_PCM_STREAM_CAPTURE); + playback = snd_pcm_is_playback(stream); + capture = snd_pcm_is_capture(stream); asoc_sdw_init_dai_link(dev, *dai_links, be_id, name, playback, capture, cpus, cpu_dai_num, diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 87a4813783f91..90b0716e5f2f5 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -253,7 +253,7 @@ static inline u64 acp_get_byte_count(struct acp_dev_data *adata, int dai_id, int { u64 byte_count = 0, low = 0, high = 0; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { switch (dai_id) { case I2S_BT_INSTANCE: high = readl(adata->acp_base + ACP_BT_TX_LINEARPOSITIONCNTR_HIGH); diff --git a/sound/soc/amd/ps/ps-pdm-dma.c b/sound/soc/amd/ps/ps-pdm-dma.c index 7bbacbab10950..256271a270286 100644 --- a/sound/soc/amd/ps/ps-pdm-dma.c +++ b/sound/soc/amd/ps/ps-pdm-dma.c @@ -193,7 +193,7 @@ static int acp63_pdm_dma_open(struct snd_soc_component *component, if (!pdm_data) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) runtime->hw = acp63_pdm_hardware_capture; ret = snd_pcm_hw_constraint_integer(runtime, @@ -206,7 +206,7 @@ static int acp63_pdm_dma_open(struct snd_soc_component *component, acp63_enable_pdm_interrupts(adata); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) adata->capture_stream = substream; pdm_data->acp63_base = adata->acp63_base; diff --git a/sound/soc/amd/ps/ps-sdw-dma.c b/sound/soc/amd/ps/ps-sdw-dma.c index 2f630753278dc..0f253912f032e 100644 --- a/sound/soc/amd/ps/ps-sdw-dma.c +++ b/sound/soc/amd/ps/ps-sdw-dma.c @@ -228,7 +228,7 @@ static int acp63_sdw_dma_open(struct snd_soc_component *component, if (!stream) return -ENOMEM; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) runtime->hw = acp63_sdw_hardware_playback; else runtime->hw = acp63_sdw_hardware_capture; @@ -270,7 +270,7 @@ static int acp63_sdw_dma_hw_params(struct snd_soc_component *component, sdw_data->sdw0_dma_stream[stream_id] = substream; water_mark_size_reg = sdw0_dma_ring_buf_reg[stream_id].water_mark_size_reg; acp_ext_intr_cntl_reg = ACP_EXTERNAL_INTR_CNTL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) irq_mask = BIT(SDW0_DMA_TX_IRQ_MASK(stream_id)); else irq_mask = BIT(SDW0_DMA_RX_IRQ_MASK(stream_id)); diff --git a/sound/soc/amd/raven/acp3x-i2s.c b/sound/soc/amd/raven/acp3x-i2s.c index e7f2a05e802cf..8debcd2487fe6 100644 --- a/sound/soc/amd/raven/acp3x-i2s.c +++ b/sound/soc/amd/raven/acp3x-i2s.c @@ -86,7 +86,7 @@ static int acp3x_i2s_hwparams(struct snd_pcm_substream *substream, adata = snd_soc_dai_get_drvdata(dai); pinfo = snd_soc_card_get_drvdata(card); if (pinfo) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) rtd->i2s_instance = pinfo->play_i2s_instance; else rtd->i2s_instance = pinfo->cap_i2s_instance; @@ -110,7 +110,7 @@ static int acp3x_i2s_hwparams(struct snd_pcm_substream *substream, default: return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: reg_val = mmACP_BTTDM_ITER; @@ -163,7 +163,7 @@ static int acp3x_i2s_trigger(struct snd_pcm_substream *substream, case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: rtd->bytescount = acp_get_byte_count(rtd, substream->stream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: water_val = @@ -209,7 +209,7 @@ static int acp3x_i2s_trigger(struct snd_pcm_substream *substream, case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: reg_val = mmACP_BTTDM_ITER; diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c index 3a50558f67516..0a6d63db2e52f 100644 --- a/sound/soc/amd/raven/acp3x-pcm-dma.c +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c @@ -113,7 +113,7 @@ static void config_acp3x_dma(struct i2s_stream_instance *rtd, int direction) addr = rtd->dma_addr; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: val = ACP_SRAM_BT_PB_PTE_OFFSET; @@ -152,7 +152,7 @@ static void config_acp3x_dma(struct i2s_stream_instance *rtd, int direction) addr += PAGE_SIZE; } - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: reg_dma_size = mmACP_BT_TX_DMA_SIZE; @@ -222,7 +222,7 @@ static int acp3x_dma_open(struct snd_soc_component *component, if (!i2s_data) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) runtime->hw = acp3x_pcm_hardware_playback; else runtime->hw = acp3x_pcm_hardware_capture; @@ -261,7 +261,7 @@ static int acp3x_dma_hw_params(struct snd_soc_component *component, return -EINVAL; if (pinfo) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { rtd->i2s_instance = pinfo->play_i2s_instance; switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: @@ -334,7 +334,7 @@ static int acp3x_dma_close(struct snd_soc_component *component, if (!ins) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (ins->i2s_instance) { case I2S_BT_INSTANCE: adata->play_stream = NULL; diff --git a/sound/soc/amd/raven/acp3x.h b/sound/soc/amd/raven/acp3x.h index 7702f628ecd68..2200c4f5ebfdd 100644 --- a/sound/soc/amd/raven/acp3x.h +++ b/sound/soc/amd/raven/acp3x.h @@ -126,7 +126,7 @@ static inline u64 acp_get_byte_count(struct i2s_stream_instance *rtd, { u64 byte_count; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: byte_count = rv_readl(rtd->acp3x_base + diff --git a/sound/soc/amd/renoir/acp3x-pdm-dma.c b/sound/soc/amd/renoir/acp3x-pdm-dma.c index c3b47e9bd2392..0bcd20ec70a6e 100644 --- a/sound/soc/amd/renoir/acp3x-pdm-dma.c +++ b/sound/soc/amd/renoir/acp3x-pdm-dma.c @@ -215,7 +215,7 @@ static int acp_pdm_dma_open(struct snd_soc_component *component, if (!pdm_data) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) runtime->hw = acp_pdm_hardware_capture; ret = snd_pcm_hw_constraint_integer(runtime, @@ -228,7 +228,7 @@ static int acp_pdm_dma_open(struct snd_soc_component *component, enable_pdm_interrupts(adata->acp_base); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) adata->capture_stream = substream; pdm_data->acp_base = adata->acp_base; diff --git a/sound/soc/amd/vangogh/acp5x-i2s.c b/sound/soc/amd/vangogh/acp5x-i2s.c index 7dbe33f4b8678..9e05816d4f5c1 100644 --- a/sound/soc/amd/vangogh/acp5x-i2s.c +++ b/sound/soc/amd/vangogh/acp5x-i2s.c @@ -101,7 +101,7 @@ static int acp5x_i2s_hwparams(struct snd_pcm_substream *substream, adata = snd_soc_dai_get_drvdata(dai); pinfo = snd_soc_card_get_drvdata(card); if (pinfo) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) rtd->i2s_instance = pinfo->play_i2s_instance; else rtd->i2s_instance = pinfo->cap_i2s_instance; @@ -125,7 +125,7 @@ static int acp5x_i2s_hwparams(struct snd_pcm_substream *substream, default: return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (rtd->i2s_instance) { case I2S_HS_INSTANCE: reg_val = ACP_HSTDM_ITER; @@ -249,7 +249,7 @@ static int acp5x_i2s_trigger(struct snd_pcm_substream *substream, case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: rtd->bytescount = acp_get_byte_count(rtd, substream->stream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (rtd->i2s_instance) { case I2S_HS_INSTANCE: water_val = @@ -297,7 +297,7 @@ static int acp5x_i2s_trigger(struct snd_pcm_substream *substream, case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (rtd->i2s_instance) { case I2S_HS_INSTANCE: reg_val = ACP_HSTDM_ITER; diff --git a/sound/soc/amd/vangogh/acp5x-pcm-dma.c b/sound/soc/amd/vangogh/acp5x-pcm-dma.c index 491b16e52a72a..73b4d879bbfcc 100644 --- a/sound/soc/amd/vangogh/acp5x-pcm-dma.c +++ b/sound/soc/amd/vangogh/acp5x-pcm-dma.c @@ -108,7 +108,7 @@ static void config_acp5x_dma(struct i2s_stream_instance *rtd, int direction) dma_addr_t addr; addr = rtd->dma_addr; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { switch (rtd->i2s_instance) { case I2S_HS_INSTANCE: val = ACP_SRAM_HS_PB_PTE_OFFSET; @@ -146,7 +146,7 @@ static void config_acp5x_dma(struct i2s_stream_instance *rtd, int direction) addr += PAGE_SIZE; } - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { switch (rtd->i2s_instance) { case I2S_HS_INSTANCE: reg_dma_size = ACP_HS_TX_DMA_SIZE; @@ -217,7 +217,7 @@ static int acp5x_dma_open(struct snd_soc_component *component, if (!i2s_data) return -ENOMEM; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) runtime->hw = acp5x_pcm_hardware_playback; else runtime->hw = acp5x_pcm_hardware_capture; @@ -255,7 +255,7 @@ static int acp5x_dma_hw_params(struct snd_soc_component *component, return -EINVAL; if (pinfo) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { rtd->i2s_instance = pinfo->play_i2s_instance; switch (rtd->i2s_instance) { case I2S_HS_INSTANCE: @@ -328,7 +328,7 @@ static int acp5x_dma_close(struct snd_soc_component *component, ins = substream->runtime->private_data; if (!ins) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (ins->i2s_instance) { case I2S_HS_INSTANCE: adata->play_stream = NULL; diff --git a/sound/soc/amd/vangogh/acp5x.h b/sound/soc/amd/vangogh/acp5x.h index ac1936a8c43ff..0d08e734f0db6 100644 --- a/sound/soc/amd/vangogh/acp5x.h +++ b/sound/soc/amd/vangogh/acp5x.h @@ -154,7 +154,7 @@ static inline u64 acp_get_byte_count(struct i2s_stream_instance *rtd, { union acp_dma_count byte_count; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { switch (rtd->i2s_instance) { case I2S_HS_INSTANCE: byte_count.bcount.high = diff --git a/sound/soc/amd/yc/acp6x-pdm-dma.c b/sound/soc/amd/yc/acp6x-pdm-dma.c index 72c4591e451bd..74ecea36e3dd5 100644 --- a/sound/soc/amd/yc/acp6x-pdm-dma.c +++ b/sound/soc/amd/yc/acp6x-pdm-dma.c @@ -191,7 +191,7 @@ static int acp6x_pdm_dma_open(struct snd_soc_component *component, if (!pdm_data) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) runtime->hw = acp6x_pdm_hardware_capture; ret = snd_pcm_hw_constraint_integer(runtime, @@ -204,7 +204,7 @@ static int acp6x_pdm_dma_open(struct snd_soc_component *component, acp6x_enable_pdm_interrupts(adata->acp6x_base); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) adata->capture_stream = substream; pdm_data->acp6x_base = adata->acp6x_base; From patchwork Mon Aug 5 00:38:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816788 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 F420FC3DA7F for ; Mon, 5 Aug 2024 00:52:17 +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 F1CAA5059; Mon, 5 Aug 2024 02:50:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F1CAA5059 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819050; bh=lHHTxCnS9bTf3K9AdSEqvIbgw20Dgp3DPBVMxGIxFUk=; 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=HQ4lOVqAwl+ZADu10AASFLdgVx8nli0KMXHw8M+GEr8AIfqdt9xYh81qyC16vRSCX s0lZoCloYtH9pC232q5lMGESpX9TVnNRCy03/uaIhDkeElb9+Ifxq8pIxilMRXr92L lOD92ruUWywpSrnLnVV9I7YsXSdwRH0KjS66uN5A= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 95637F89937; Mon, 5 Aug 2024 02:39:53 +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 73CD3F899E3; Mon, 5 Aug 2024 02:39:53 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2FF93F898BD; Mon, 5 Aug 2024 02:39:18 +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 3F7F3F80707 for ; Mon, 5 Aug 2024 02:39:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3F7F3F80707 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=RNYyF1xn ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yEBsiIY8FpZvv+1Ff4KuE5JI07HOSc6isb8PRMaLbv0zax6uNHnAS3L/lQCTnIx69dq814QvWN8TO8igcA2dhSsZYs6RnAfK0pqoanRw1DW8SPv2rDX4ubqLL/LP9mi6RWcqAmmyTcvLPoMiS7dgMpYBAhhTh4Ne+UFYPUZbi0vK4QfoKsweZeDWqNP2iWiZ+hYj3q0Att0BmyRWZmsIYfjMhwpuGFNiw+cZnmzV7BLv40GsKYXvaG82E2ujw968LWdCWov/NcpGQVn6GQcImjqdt8DPid5ScSbig0KP+rW2R3IqhNryci+O+07hUAjSA5iDQty6ZtomUqMTWRWVMw== 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=5Lej+1Z+Zoj2ID9gW3Ofwd6ys/YEwEu+ljlQzCJ4DCE=; b=mguBjebz9thcw0kBq7LVCfktASvHJtJ117+e2xlWSe4V+EhJ318qe5z1nxxRBvAB02ieiDy5tIoz9MFEpWTAP0foKeH7n+HyNuZJbOAM7icKhXlppmgy3fcQPRzlIRt6s0Ps0ve21w3BgaE+tuRwD8avTm9nTfjgHCmutUI18463vlBTYXIeCq4K+q6QfPWtEGLHiN8JXWZzDfI2mhLL2Be735HT6NUmiS8yTNO971zQq4ICVM7+FaVAjLFAbJdaYG/DJvwHQM22hlUO7f7ZexOqGjP56JvKHy0XxTXY/9bmzgmsr02FKy/ZQqNPSOUlYZ3ok49IjXy6Bnv9XgIQIA== 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=5Lej+1Z+Zoj2ID9gW3Ofwd6ys/YEwEu+ljlQzCJ4DCE=; b=RNYyF1xnypzj1ZT+dRHNy3JzxKTaxUjKO2VxfO/7vAEw0QbvOIXvibZ1RXqCOBCqpmeNKbEO9SRRXq3sJVNaLp8Wy9J9ZBoc+KCqmHZzl6+qz2rX4KGPhaHeppGfJZ0Z5vrp4UNarVq0KTf+lxxGdja54kaOsDe43M4LF05WHdk= 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:38:58 +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:38:58 +0000 Message-ID: <878qxbztul.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 047/113] ASoC: bcm: 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:38:58 +0000 X-ClientProxiedBy: TYAPR01CA0181.jpnprd01.prod.outlook.com (2603:1096:404:ba::25) 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: 755d8321-a599-4951-b0ae-08dcb4e6feaa 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: GAJoteSyhccrmv6uT7XyKNDl4s9jW8oUG1G2oElq3FzJy9C1ADhMOLkTRYJbBsygR3y0X/XZZpq75jc1UTefOUhKMYRDOC1GYA3hIIQvbBUrRFW9c6jgiGhSv69Tc4k2UpiFS6m3lPCS8ML2L6hk2bp7/17teg3cPqbc5UTmNezjYVbnSRKhUjamyTne2y1L6BnNkLTxNT+PODA/sKKXZJRxt82THZG/b1ImfseB+nQbA0msbwkVXtDkx/pToXqCWVPYJHN56L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I+jwCin7QzA+QBEGL2H0oHtg0Ps/ErB8fC0Gq3TAYMODTyYIl/W4RchSMtjouXJc1c07Udpxxlag== 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: w0BP9eG5++J/Qew6uUJMVTJ67e1a7L6OuBnNy3U9DTrG5nUUdOQQvCgMdSy8lymNBgl4ki9b2E8JQ9DLHVK67xHgUxPPh0FCBA+5QbGOVgMomx2eDuS5w8JpYXbaGLXsGzcQWkoP93CMxs6s18d+aOV7MrKaDzi8WPA5+UxcgRqLzPftZlVan9mIFNP6xc8mR2YM4ItO/Vv1bkOEFRJDfTGUCkkl7/tnDaiW2ETSaraHUIdGmMGb2JIsKRff9CJzXwOvuNqNlSY+npJ+VTIXWySonCgwQ7FYBQuCtYhdumHHZR8sM1Kz2Xo9y8hDWv2Rf01sangJbqmYepRQpFyorTFgAE2+emlARnkDNMpjDanJRR0geRkb4xqdVB/xfDFoxVSwtgy2MDNARGvu71wb0Nd6UTmDiEw8NlYMxIAu6PyFHcQM0r6Z9TZUkM4VcBcblybNZCdbOLXJltFeTx4+oi+wytVbaKaL850P2ggqCB3AkgfjAW5ODDLwxP2AEji8x5tsiUghrcyQwIz/br2LRr7sFguq29XNZcNer+BQlgc4+IzQqpxrfLGvmmU2SXgYtvkNnYkkQjPpf1IeItJ+vKgcGWuLVYnSPmr58bk/0TFzX+oEwi0/IyDhlhv+IGml1JPNWkFj1S1+9DKZikLQ1dAyxHkbdSszUJg41eIQNJntWX4t8Nn6zMf2+5OgbOFZXy1dotovrqkF93djPIgzsLJwfSGMcUIOc23FwtKLbN74bfiMXfltkSTgzcYe8jR3tpWxzSOtRtz+u3XGatV1woU1i9zXrT5THW2fpv8m95S8csNAOyfL8RCcrBD+C8R+7E6XATcd4gkH4QUVqBY7/ATUMrVXV6stIMQsupLfdlLwEaPZKvFaNX86rTNa+kQ9DlPiHWKVJbLSZlUZOZIcdmaDVDqtt9sQJwJMSd7O2DyN/cEs3a2Pv0DBENEuJBOHHkmcg40Wwh/G3iITS6zklhiOubwgH5tsk1RJepSK+03huUhoTOOvd5njI2LNZqSsjvDPzHGBYNOPNqs0ZU0gKWA3i3uVfRDc8DgqbUNeffgHk7WwLjZj14+1lKRr12J3hG19DePVrQVr9ez0Bq+qLfd0efxsjV4Aq023HD1M2imXcITS2g/zxo2xQG8dlsQJYqSC0e7W+mOpQh38/Dm08hMjf/bVDTIQ7Ie9215EEz32pqqOplJHi0hSWnuMs3sf3sDAYtoZLCeb5KVsyYjnW0qbkTx3rDKoNRiAloxsb/Za3/pEi8xSyPonks/lIUIuC1ZzKIJTWeCaBpJfyWdV4EwJ3ASNqGbhjsCVLvbeUeF7Ie20XnNpoC+clqfMHjtN4+1KpvNPH4/x8crpHw04q1lQR9H92qRwU4V2Hia00sxYbWJwRo2qn3TwruaTKP29sLpuVI3ZgnBnrBR24WGWy5B9SP1LnkOAhTHPvcnJVkcf0BLvqC3hkT3XeSPEnSem6MKQgJ7z0h9S7e5YGS7FJn7MMiP270EcaRC34wpmhQNnfwPIj/EZ11dc1B8MeuNJJFpDitHMkN76oMG9aenb2RqMUSxTRoBrj1W83thDy2adJnCwDaqUiMDGsmjhalsGxi5N/UdBNKxcO+9KYDsIErJO1hCQJxddHf2vGIlJCMo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 755d8321-a599-4951-b0ae-08dcb4e6feaa 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:38:58.8692 (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: 1ndOELl2kE5t7VMfbBdr9Admgk6FWLk/iJ3PveDpHsYfVcxip89S1KI3blWYZVG6FGOQk/six5u+aLT7Ibg0ovCwKO6zsxDCIOnifKTSeb8RcgyER64CHfBQ8EB2EF0h X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 Message-ID-Hash: OOGVEFMANJSTY4M633KODMTWNCAVQS7I X-Message-ID-Hash: OOGVEFMANJSTY4M633KODMTWNCAVQS7I 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/bcm/bcm2835-i2s.c | 8 ++++---- sound/soc/bcm/bcm63xx-i2s-whistler.c | 4 ++-- sound/soc/bcm/bcm63xx-pcm-whistler.c | 4 ++-- sound/soc/bcm/cygnus-pcm.c | 18 +++++++++--------- sound/soc/bcm/cygnus-ssp.c | 12 ++++++------ 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/sound/soc/bcm/bcm2835-i2s.c b/sound/soc/bcm/bcm2835-i2s.c index 9bda6499e66e1..54fcf85a1158c 100644 --- a/sound/soc/bcm/bcm2835-i2s.c +++ b/sound/soc/bcm/bcm2835-i2s.c @@ -628,10 +628,10 @@ static int bcm2835_i2s_prepare(struct snd_pcm_substream *substream, */ regmap_read(dev->i2s_regmap, BCM2835_I2S_CS_A_REG, &cs_reg); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK + if (snd_pcm_is_playback(substream) && !(cs_reg & BCM2835_I2S_TXE)) bcm2835_i2s_clear_fifos(dev, true, false); - else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE + else if (snd_pcm_is_capture(substream) && (cs_reg & BCM2835_I2S_RXD)) bcm2835_i2s_clear_fifos(dev, false, true); @@ -644,7 +644,7 @@ static void bcm2835_i2s_stop(struct bcm2835_i2s_dev *dev, { uint32_t mask; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) mask = BCM2835_I2S_RXON; else mask = BCM2835_I2S_TXON; @@ -669,7 +669,7 @@ static int bcm2835_i2s_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: bcm2835_i2s_start_clock(dev); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) mask = BCM2835_I2S_RXON; else mask = BCM2835_I2S_TXON; diff --git a/sound/soc/bcm/bcm63xx-i2s-whistler.c b/sound/soc/bcm/bcm63xx-i2s-whistler.c index c64609718738b..0980e35d12830 100644 --- a/sound/soc/bcm/bcm63xx-i2s-whistler.c +++ b/sound/soc/bcm/bcm63xx-i2s-whistler.c @@ -93,7 +93,7 @@ static int bcm63xx_i2s_startup(struct snd_pcm_substream *substream, struct bcm_i2s_priv *i2s_priv = snd_soc_dai_get_drvdata(dai); struct regmap *regmap_i2s = i2s_priv->regmap_i2s; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regmap_update_bits(regmap_i2s, I2S_TX_CFG, I2S_TX_OUT_R | I2S_TX_DATA_ALIGNMENT | I2S_TX_DATA_ENABLE | I2S_TX_CLOCK_ENABLE, @@ -146,7 +146,7 @@ static void bcm63xx_i2s_shutdown(struct snd_pcm_substream *substream, struct bcm_i2s_priv *i2s_priv = snd_soc_dai_get_drvdata(dai); struct regmap *regmap_i2s = i2s_priv->regmap_i2s; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regmap_update_bits(regmap_i2s, I2S_TX_CFG, I2S_TX_OUT_R | I2S_TX_DATA_ALIGNMENT | I2S_TX_DATA_ENABLE | I2S_TX_CLOCK_ENABLE, 0); diff --git a/sound/soc/bcm/bcm63xx-pcm-whistler.c b/sound/soc/bcm/bcm63xx-pcm-whistler.c index 018f2372e892c..e8542b2009f63 100644 --- a/sound/soc/bcm/bcm63xx-pcm-whistler.c +++ b/sound/soc/bcm/bcm63xx-pcm-whistler.c @@ -81,7 +81,7 @@ static int bcm63xx_pcm_trigger(struct snd_soc_component *component, i2s_priv = dev_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)->dev); regmap_i2s = i2s_priv->regmap_i2s; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (cmd) { case SNDRV_PCM_TRIGGER_START: regmap_update_bits(regmap_i2s, @@ -153,7 +153,7 @@ static int bcm63xx_pcm_prepare(struct snd_soc_component *component, dma_desc->dma_addr = runtime->dma_addr; dma_desc->dma_area = runtime->dma_area; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regaddr_desclen = I2S_TX_DESC_IFF_LEN; regaddr_descaddr = I2S_TX_DESC_IFF_ADDR; } else { diff --git a/sound/soc/bcm/cygnus-pcm.c b/sound/soc/bcm/cygnus-pcm.c index 2d1e241d83673..3dc204d0a34c6 100644 --- a/sound/soc/bcm/cygnus-pcm.c +++ b/sound/soc/bcm/cygnus-pcm.c @@ -252,7 +252,7 @@ static int configure_ringbuf_regs(struct snd_pcm_substream *substream) aio = cygnus_dai_get_dma_data(substream); /* Map the ssp portnum to a set of ring buffers. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { p_rbuf = &aio->play_rb_regs; switch (aio->portnum) { @@ -299,7 +299,7 @@ static struct ringbuf_regs *get_ringbuf(struct snd_pcm_substream *substream) aio = cygnus_dai_get_dma_data(substream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) p_rbuf = &aio->play_rb_regs; else p_rbuf = &aio->capture_rb_regs; @@ -317,7 +317,7 @@ static void enable_intr(struct snd_pcm_substream *substream) /* The port number maps to the bit position to be cleared */ clear_mask = BIT(aio->portnum); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* Clear interrupt status before enabling them */ writel(clear_mask, aio->cygaud->audio + ESR0_STATUS_CLR_OFFSET); writel(clear_mask, aio->cygaud->audio + ESR1_STATUS_CLR_OFFSET); @@ -354,7 +354,7 @@ static void disable_intr(struct snd_pcm_substream *substream) /* The port number maps to the bit position to be set */ set_mask = BIT(aio->portnum); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* Mask the interrupts of the given port*/ writel(set_mask, aio->cygaud->audio + ESR0_MASK_SET_OFFSET); writel(set_mask, aio->cygaud->audio + ESR1_MASK_SET_OFFSET); @@ -404,7 +404,7 @@ static void cygnus_pcm_period_elapsed(struct snd_pcm_substream *substream) */ snd_pcm_period_elapsed(substream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* Set the ring buffer to full */ regval = readl(aio->cygaud->audio + p_rbuf->rdaddr); regval = regval ^ BIT(31); @@ -597,7 +597,7 @@ static int cygnus_pcm_open(struct snd_soc_component *component, * Keep track of which substream belongs to which port. * This info is needed by snd_pcm_period_elapsed() in irq_handler */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) aio->play_stream = substream; else aio->capture_stream = substream; @@ -615,7 +615,7 @@ static int cygnus_pcm_close(struct snd_soc_component *component, dev_dbg(snd_soc_rtd_to_cpu(rtd, 0)->dev, "%s port %d\n", __func__, aio->portnum); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) aio->play_stream = NULL; else aio->capture_stream = NULL; @@ -652,7 +652,7 @@ static int cygnus_pcm_prepare(struct snd_soc_component *component, start = runtime->dma_addr; - is_play = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? 1 : 0; + is_play = snd_pcm_is_playback(substream); ringbuf_set_initial(aio->cygaud->audio, p_rbuf, is_play, start, periodsize, bufsize); @@ -674,7 +674,7 @@ static snd_pcm_uframes_t cygnus_pcm_pointer(struct snd_soc_component *component, * index (for capture). Report this value back to the asoc framework. */ p_rbuf = get_ringbuf(substream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) cur = readl(aio->cygaud->audio + p_rbuf->rdaddr); else cur = readl(aio->cygaud->audio + p_rbuf->wraddr); diff --git a/sound/soc/bcm/cygnus-ssp.c b/sound/soc/bcm/cygnus-ssp.c index 90088516fed01..73c231f5c1ed8 100644 --- a/sound/soc/bcm/cygnus-ssp.c +++ b/sound/soc/bcm/cygnus-ssp.c @@ -642,7 +642,7 @@ static int cygnus_ssp_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { value = readl(aio->cygaud->audio + aio->regs.bf_sourcech_cfg); value &= ~BIT(BF_SRC_CFGX_BUFFER_PAIR_ENABLE); value &= ~BIT(BF_SRC_CFGX_SAMPLE_CH_MODE); @@ -736,7 +736,7 @@ static int cygnus_ssp_startup(struct snd_pcm_substream *substream, struct cygnus_aio_port *aio = cygnus_dai_get_portinfo(dai); snd_soc_dai_set_dma_data(dai, substream, aio); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) aio->clk_trace.play_en = true; else aio->clk_trace.cap_en = true; @@ -754,7 +754,7 @@ static void cygnus_ssp_shutdown(struct snd_pcm_substream *substream, { struct cygnus_aio_port *aio = cygnus_dai_get_portinfo(dai); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) aio->clk_trace.play_en = false; else aio->clk_trace.cap_en = false; @@ -770,7 +770,7 @@ static void cygnus_ssp_shutdown(struct snd_pcm_substream *substream, return; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (aio->clk_trace.play_clk_en) { clk_disable_unprepare(aio->cygaud-> audio_clk[val]); @@ -932,7 +932,7 @@ static int cygnus_ssp_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: case SNDRV_PCM_TRIGGER_RESUME: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) audio_ssp_out_enable(aio); else audio_ssp_in_enable(aio); @@ -943,7 +943,7 @@ static int cygnus_ssp_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: case SNDRV_PCM_TRIGGER_SUSPEND: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) audio_ssp_out_disable(aio); else audio_ssp_in_disable(aio); From patchwork Mon Aug 5 00:39:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817103 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 D6AACC3DA7F for ; Mon, 5 Aug 2024 00:55:22 +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 31A234A6A; Mon, 5 Aug 2024 02:52:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 31A234A6A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819169; bh=ZVla2kCVfa7OyH6JF+K1WgC/yZlrEDto9pnX6hfnapI=; 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=LjFnhNZUFELtREo5k+JETehmn1cXs2rEn6EQknLpFQL5Tju+VsMICLNl+Z+n/Ek4x XVS72qhtQUD+FJ/vrejAdHcWKti4N8KSnYt1d+d7+LNpokesJs8qPmokGl1WsCYVuj HxbOwqAlc0M+f5ReUVa/NIt73U561m4XYHIJ3MX0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 77F72F89A4F; Mon, 5 Aug 2024 02:40:13 +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 11D85F89959; Mon, 5 Aug 2024 02:40:13 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3F7EDF8988A; Mon, 5 Aug 2024 02:39:23 +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 90E05F896F2 for ; Mon, 5 Aug 2024 02:39:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 90E05F896F2 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=cSPFrZCp ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Rprrc8CnulSq3eIEOjYdXT/R6PyGizQZARKtPK2K64SaUzO+4UBt6hf3TM/8VN5sez+6Z9YDpnvpqLJ4ro8gEYipTeGF+8aOr2dPyB6t6YZzRyFrqqDr8kVJRZKfA0Rdlf/cu7kOzS7AaBqQCQTz5fSv7hgVlmlGBhezTpwRO2bYZB/Yp9N0QC1dwbyqkcZyF0sjoIDP73baSlCdMaWX8K49LzUY7idg039LPVNDsh0VANX8M/DRWBCxe01eYUO0CY9XWUTMaktDfZcON4FP9H6X2d28K1g59AaDiDL6eWcWMJx/awPW1ZZON87Jh5i+MVnYI+mo3PdhBV7uJBVUwA== 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=diqNshMfNO0lQYIcWhAiRyqi4EE1UTUgbAzeKkTFsGk=; b=dNJPe1BOH/sAC916ZAjz4qRyeEmYlUBJlXczSdihT9EKreIRodsXObZexDzPohPWad9Se+t9t9mZbP9x52XcTq3UcrqpBA2ffXHbJ6eRM6XNOXDFtL2qfyDXdBAVdruRRnkUj4xWmHrlwuTijJWpxSSLNCboQiVYjzFKDoNCNVIytHHQgl0e5G4R0vr8hmW7h3JFO32CxDLKkuDNiB3LNxDoRH4m4wtzYythnB2x5rWYDyKhmNnlaEeWTD/xDYoZ2gGR6nJ+bEuGIRG5vdXy5ssBGPjatjlnVg8L55iq43sxFUJ+LNkWk/l01sF04JnYH37bc4b0DGLSsfFoq37FeQ== 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=diqNshMfNO0lQYIcWhAiRyqi4EE1UTUgbAzeKkTFsGk=; b=cSPFrZCpDPme3CZ63yjaEGBM3H+nhzn1LKmOtWadcaEKMfKh0C2zgb5a4/Jz+oYMwagkv2Fzt4ZVlrsVtNtxWWblJbel7DpCWeU4lwuuFxhOBrqDRFd31bYwDbXS1HcQn6yT4TkeOQmG7y3b7tjx/YNoIF5Sj2zBLWEl9afrzCg= 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:39:04 +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:39:04 +0000 Message-ID: <877ccvztuf.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 048/113] ASoC: dwc: 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:39:04 +0000 X-ClientProxiedBy: TYCPR01CA0148.jpnprd01.prod.outlook.com (2603:1096:400:2b7::7) 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: 70b70dab-b8b5-40b7-00ba-08dcb4e7021c 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: hsebqS8rhKR9qM3QLJpIWRjs/RCiXTvArChppTQMOTd9rf416Az+CGLtv+iBP7NRr640aR1Y9aE4hjf3T1uIuz2n5oVSwoWlzTtZbgdxLzTaj9RaSxWtr1BYxeiv/yzVuYSYp3XFWg699x4T/cid4B675PSgGxbFkihiSX0gz2UwDZ9/ao7m7niYRdVI77Jr5d76XPYkR6vH7N3wHxPlImfuFl4H8vMKI2I/uHCW6CyG4BgJGvOlPIoqparig+vUtG3KhAG1OzV+qQz6wo/k6AKXETYyvNLOPK8v54jb3kER2FXrE62bnd/QlmsCFB68Bi5237qFEfV9gMqQ6T5dZDjVJomo5skZ9WHE5OK2N+m5o0crHzxzFu0b8bzo8KQHjpEW/vRh206tVmFbPyTEnCKKqwAI9oj2FW6T05fnjb9G4nHBeRfNZlyUAtMTdXJdB9TuZ7nC8bfWyNgANNp4GyhLL8hm7+tyNJW/nE1gH/sBjOCf9btjhdtZOsWIlmuam6bBzkAt+UOsuV/o1cje1LPmoTiOvHg0/X8hBZwDrom2zSYMIvcseHFs2f2Xsqv3F17U/9IiFwcNsbWwCMDx1lBM+VzEWaL7I0iw2GOqzCwCGwWAdTe7/CoAsi8hN+gTMUejJYrWiO/VCrzw+9Q4vAzJdtCQXyM0roPP8WPOO1VtyE5CgLmYu+61hGfJjl7kZwbybESXMxus5nF7nOiBuzvhcTJfRxehT27werCdFHDa0YgMH4gp0PM0koQmYbUMPt0ZVlxxMFkpy1Z7AGdIqlLGqDBWzxASwPmPY64rN3y8KaqBQ/NP9s3YVFhmkKm/KzmyQ4s/TJNuRUWo26XmwRdyE1a+Ioz6906NcJ97YadDa4tzma/UvjdE7V8cKaAOW69Azk6PIlZL6UMhxOs4E24ODdp7zKmKGRbEVZVAf9wi+wIW55gX61YHS8ai+HtZjJEPA6/dgyZr5UeEIizbt9zTPatMahmqI1RLkk5ZaZvRBrRVnI0wFADfMVSoBQIluoiFKXSuaOs9H9FxmhQykTz6vfFLmP7t9aecpKZ4oxkZsGl0GrHXusgUNEVFlz0MNSIc2GVjkHKqLc6BCDhBZiX+Xh9wnrZoJB4oz44Wvi3ikDQb17C+SZfMu9mfKESXcVsKTmj2edGDsFBm5I4420rtGeOCQxuB6Qsa/WcSze11CbxN4P4RM1YG80sygInRgIDMKCLrcnNVH1slRtdNplS1ngKNDtnrub7O9Ki425XXXW3g5LLegUwOmqA8wVXVl41Ktn63RQRqfkjIpXlWdRbt4qomRvWs8aLoDXySm5neyL6sub3qrTmpfYIM4CFnqvrpcTlfPExIfSB72TZ4DgPAutUTf268jj3UmKH3hnG6CgFZHVKmFSugroDCah/yjcwqfcazNYdql3eZV6yi7Q== 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: 6fTSicm4/IPXv4G1kdyWqBbzdq8GGf2+eGuUHtLlyqZTWIyeMfMBs0RMintsudNSnRM5lXhstr+NqpxMAO/4hsIOEsGewsOAkZTyttYWdrljk6kWnGGVu589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7akLY9mKzpV5t7WbI1tQhWXBT8srm/wPStu6b7j43cmxoy59XmVcAo1MPc8kSNB+6m+03EEvZB8h02QRzCtZ11MM3FEjLtYTbp+Bj6MA4hG8zljiGA/Vse8Z0y+PkqyA34Tet0STpTeuKJlvLLa33NvQAxDclV20uS9UAC/DISTavB61okCfZumDhkdK9NAUikwfTa+9a4kNVPFhiIkh1BdYWMqh2l4HO8hahONa5K40PfGB7ZRT2o3E7we1cLcjXZsznsWH34AD9S7rNI3iOiZISiKAnbi0lOjjJXW80fGpLfC+sDFHnIc4coV3gYNVAdLtwBVFgT30uVI0JoDPp0r99T38zZg3EvWQXfaIPSzKeCI+29WTVZYBfXm/6v9Zdbdv8fdtYrlsEwy4VZ/18qe3k6g0825dWpnaTA0yCKKqBjaH2jjs= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 70b70dab-b8b5-40b7-00ba-08dcb4e7021c 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:39:04.6655 (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: +xtTOvRolP3bWeTJIyogDPntqzmq2DaNmUwtDE2S44XiMn262FugBThct+zL5lGMNDivsk9TTMOMMmcHtm1sprVAbo549oK1Zt/ma/dob0y2HBbzzFJ3kEWohbS0+yGH X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 Message-ID-Hash: IWPX3BUCS5SIQNYP4PZPB2KUALN4CQT6 X-Message-ID-Hash: IWPX3BUCS5SIQNYP4PZPB2KUALN4CQT6 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/dwc/dwc-i2s.c | 20 ++++++++++---------- sound/soc/dwc/dwc-pcm.c | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c index c04466f5492e9..874d5bf2985e6 100644 --- a/sound/soc/dwc/dwc-i2s.c +++ b/sound/soc/dwc/dwc-i2s.c @@ -42,7 +42,7 @@ static inline void i2s_disable_channels(struct dw_i2s_dev *dev, u32 stream) { u32 i = 0; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { for (i = 0; i < 4; i++) i2s_write_reg(dev->i2s_base, TER(i), 0); } else { @@ -55,7 +55,7 @@ static inline void i2s_clear_irqs(struct dw_i2s_dev *dev, u32 stream) { u32 i = 0; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { for (i = 0; i < 4; i++) i2s_read_reg(dev->i2s_base, TOR(i)); } else { @@ -69,7 +69,7 @@ static inline void i2s_disable_irqs(struct dw_i2s_dev *dev, u32 stream, { u32 i, irq; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { for (i = 0; i < (chan_nr / 2); i++) { irq = i2s_read_reg(dev->i2s_base, IMR(i)); i2s_write_reg(dev->i2s_base, IMR(i), irq | 0x30); @@ -87,7 +87,7 @@ static inline void i2s_enable_irqs(struct dw_i2s_dev *dev, u32 stream, { u32 i, irq; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { for (i = 0; i < (chan_nr / 2); i++) { irq = i2s_read_reg(dev->i2s_base, IMR(i)); i2s_write_reg(dev->i2s_base, IMR(i), irq & ~0x30); @@ -156,7 +156,7 @@ static void i2s_enable_dma(struct dw_i2s_dev *dev, u32 stream) u32 dma_reg = i2s_read_reg(dev->i2s_base, I2S_DMACR); /* Enable DMA handshake for stream */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) dma_reg |= I2S_DMAEN_TXBLOCK; else dma_reg |= I2S_DMAEN_RXBLOCK; @@ -169,7 +169,7 @@ static void i2s_disable_dma(struct dw_i2s_dev *dev, u32 stream) u32 dma_reg = i2s_read_reg(dev->i2s_base, I2S_DMACR); /* Disable DMA handshake for stream */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { dma_reg &= ~I2S_DMAEN_TXBLOCK; i2s_write_reg(dev->i2s_base, I2S_RTXDMA, 1); } else { @@ -194,7 +194,7 @@ static void i2s_start(struct dw_i2s_dev *dev, i2s_write_reg(dev->i2s_base, IER, reg); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) i2s_write_reg(dev->i2s_base, ITER, 1); else i2s_write_reg(dev->i2s_base, IRER, 1); @@ -213,7 +213,7 @@ static void i2s_stop(struct dw_i2s_dev *dev, { i2s_clear_irqs(dev, substream->stream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) i2s_write_reg(dev->i2s_base, ITER, 0); else i2s_write_reg(dev->i2s_base, IRER, 0); @@ -253,7 +253,7 @@ static void dw_i2s_config(struct dw_i2s_dev *dev, int stream) i2s_disable_channels(dev, stream); for (ch_reg = 0; ch_reg < (config->chan_nr / 2); ch_reg++) { - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { i2s_write_reg(dev->i2s_base, TCR(ch_reg), dev->xfer_resolution); i2s_write_reg(dev->i2s_base, TFCR(ch_reg), @@ -352,7 +352,7 @@ static int dw_i2s_prepare(struct snd_pcm_substream *substream, { struct dw_i2s_dev *dev = snd_soc_dai_get_drvdata(dai); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) i2s_write_reg(dev->i2s_base, TXFFR, 1); else i2s_write_reg(dev->i2s_base, RXFFR, 1); diff --git a/sound/soc/dwc/dwc-pcm.c b/sound/soc/dwc/dwc-pcm.c index a418265c030a5..673218e010607 100644 --- a/sound/soc/dwc/dwc-pcm.c +++ b/sound/soc/dwc/dwc-pcm.c @@ -200,7 +200,7 @@ static int dw_pcm_trigger(struct snd_soc_component *component, 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)) { WRITE_ONCE(dev->tx_ptr, 0); rcu_assign_pointer(dev->tx_substream, substream); } else { @@ -211,7 +211,7 @@ static int dw_pcm_trigger(struct snd_soc_component *component, case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) rcu_assign_pointer(dev->tx_substream, NULL); else rcu_assign_pointer(dev->rx_substream, NULL); @@ -231,7 +231,7 @@ static snd_pcm_uframes_t dw_pcm_pointer(struct snd_soc_component *component, struct dw_i2s_dev *dev = runtime->private_data; snd_pcm_uframes_t pos; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) pos = READ_ONCE(dev->tx_ptr); else pos = READ_ONCE(dev->rx_ptr); From patchwork Mon Aug 5 00:39: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: 816783 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 A265FC3DA64 for ; Mon, 5 Aug 2024 00:55:50 +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 2A7E74B30; Mon, 5 Aug 2024 02:53:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2A7E74B30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819192; bh=AEYQUOgiS5yuT+dBqJNW/fvf2fI9wTxUFOXKEwt/mzk=; 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=F6rxqGrkHrdP/Gt1Nf94hBChIuWznB92uTNApuuD2bPNe/zNq/Y+p9gCnDvD5v76y kT3lxcpM6imhy0xNQn3HCjU6L+5zH+Wpi4jcZkfgr+tHy2FC67NflhcPu5J0RdHKb+ QfdS7BK+a5TP0TiYIArGtluNvLp3Mc0xpHjbzmQY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 949A4F89A28; Mon, 5 Aug 2024 02:40:20 +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 1EC74F89A90; Mon, 5 Aug 2024 02:40:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CF198F899E7; Mon, 5 Aug 2024 02:39:40 +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 AC39CF89716 for ; Mon, 5 Aug 2024 02:39:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AC39CF89716 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=UztbJTu4 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Xrq7aWdyE5CGPTjjte8GgaUvtlXWxwCFCkHxi2ibglleeGVOcR4okhroid7By4DZMZE9GCGBmOCqqsuOGRjnvgQCiGsERtpC6BPn/GS6JFkVJPjAUZ35JowXQWiU/ZpnRI/bdJNxEEOU74cI7A3E1JfFwI79SHsLZJcgOe2aL9B4ZAE2LUCD5M/5Td2jlYklX7nen8w0pzL4K0Hu6hWNsNQUTSuUTXpjKhNVmJeiV7k37HSIbJLroH7eRHGEwhEh9GRvo1fjAds+3Tn7C66RP410F296sLJzpl1XFpamIAmT7/Rjbt9tXU7XwKvHKKsfbHoN8ClJk8J6t2zkPID9ew== 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=8NXzQS+bnHre3ul5uJipiQYpp/sXDiGAFdpM9yOOK8E=; b=EjjLWI0qrq09lwKqs5A2T6h7+Yk1Ao8tUNGgXNXRnSc5wTq39JonSGFDlgS08b4GtYdpCNIkb8BnsCQ5807lsgK4L48c4/r9zvfunV5fTbdrqWNWxo32uu4p8ojg/hP/YrCHRTr8fyU2IO6so/ydS8Nyw9JuhF794dAwXWWe6H5IgJbm6jpaOKiBRQit3UfdfanemmjOsnKmxwEaCz5Bpcm2xvKks0Cw0y1J3WnAQeWF0CRKgsJxNvmydo3oJ6oq1C2kLBUobE/0xAhCOMnYnVrG2a/+vM0ba4znWLpFxdlNkdk1XmoXeHGQPAXmKXnadF1EQzL0kkWXp3/Mi/X+PA== 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=8NXzQS+bnHre3ul5uJipiQYpp/sXDiGAFdpM9yOOK8E=; b=UztbJTu4MmIo8CCyr3HwyCjuwwKobyKptVmWo2wph1PWf5pP2l4FRbUnOiHXBWPsnlK/kMmzTEGTV26kDVdB53YDxQc2X30kFdtHwrI2v1KKwDcqH2keXzYbG1Q+N5kqCx1Kj/4RgalHF2+A/Sul348PtAjYcRGxdW8+h3lChmE= 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:39: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:39:08 +0000 Message-ID: <875xsfztub.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 049/113] ASoC: fsl: 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:39:08 +0000 X-ClientProxiedBy: TYCP286CA0115.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:29c::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_|OSZPR01MB9459:EE_ X-MS-Office365-Filtering-Correlation-Id: 0106e995-1011-4c9b-899c-08dcb4e704a3 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: NUUKWmhMkFK8eOBmS/7Nzm8iqcx5oFDwmc2vSdDCe4/47NlpBpsjKEz4iZg+GpgIObrLpddJeIOnMgytm9bdhL6KSk2X0KSX1sVX4OXWcxpTEeIFyvgZAK4wL4BJD/XiBhO0THZPlNvddr2kZoWG5mq0CBABqXg3ISnaoBxhwBE/hSaaztDQBiTvWr+18YUm+Wd0yVD9S58Gos91voyQzChVLOvObIM51DgA33sV8t9TPJsYj66SmKxt/iqquC5Xd6N4ujtjJjxasBOkSvdH1rPTMouyF+GvbDKkJtNsiqH8M2XqKclGGv/7s7LilEAiETtyH6F74DnorY5rRjDzzoS8Gtu9JleN67qmt/gX5ne0yyB+jZIMUss8AgMVADvkhtNtLKvEa1Y2wnxyw042vco8EMRalNGBaEH1BttTNWLvjty7h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B10914.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: zvUMPAygg8e/ZVOGgMjlDT1Abj2TCqsPxxhTXJlrGYhENwkifb+rdXykoRe84BO5MIJ7e1E2CgTZ8pg0EcguYXohO19kZ2XI1mrQH+KU9zSGdSK2CYCwkS0GqwUbYohl2n+R+wQwgwoab3Sb7JmZtzj6IvrSuOpZGSAXM1aV0+lgwK3pa6HCscXwxTk38x/yJMimLi/3S8Pq/m6tHfpnM0lhgr2txVCWqOUFIW3046MadfahjClNAAPPskHegtiUOolNGU7gejfXsh4OzW/IOYqKwtxbmwKgzDWPoLRYfnLBAocJTb+fhCGpx4sJEyUfACDWfpPnIHXp1+ffE6WpMpqGicgkHk9r0WR/8qopWmC4LRBMO7RWS+sKWsZI2BTzVhcppZ0Bl1AbbUMBWHN1d1d4l5yIcMnBKX7x2iqNg/p5OLyc2aB0eKOBCga817QoniGELRENR/6h6VQ2BRV6uRwWxSnVIhC8gQwMT6xabgcEQd7aQWnPnmIPg0/bT/SLr0cHu7HDRDQNdH9bjY34UmIXoL4kUXARIlA5Jp0tztm2acXLp+879+vdFsikPyo2Z4TcX6e2eJM+PrPp2aXm4/htOUxq5eUnnAsKrOpn/DUxbShD6p6w6qGLgSoiWXmSD/7FZu0yVX7z8MX4kygfWAafUkMrBL5t7GAmTvgTotWT7bUgT6dU3wGk7sBpNrb8zYkb+5kstk5vNhls6nSYs7EswyZkZadZZ8yTYMFpnDe+RAjaJUmgcqe0I3AL+K/JYgBXREXeS+NZP1j1UGfWi+EW53+ZGzoH9YtBGLXAvgBlSLvPpwIO83PSREqHiIwXTfWCWH9I+WHfRL822mnxemOguuNuXqUktVmRpESeQ1HeUkVrU85kf1+7XXOUoTzNtNqAI2TqQVFPrgPZ7AqEp3iYIvZN3SHW7LUyldbzp7kHG1wx/fpTAzf73rCYRNAotvtCxjgXf+2UAZVkiSxbSzUqTEvVqdKdinjHW2+ldCBuiNusFSroY1oVEO40yKFHaQhPHclW27+32cp20n4xGpKiDD0JsSiH/N6sNCQ9mXnpTE4Qk9926y3zLVUQYqOizCwBts70KcUG3IZaN75N9Jk4p5IIdNGzAPlC5hv66j65GrP3HGQ+ZBqTsJBoJpuvcoxlW31dMQHmb07pzuUGRqFfnLWAKF9MlL+mEsrW1Kvj80gVrFNwwttOdMnliP2tIMFyks7UzX1RqxJyKwizFNX6/oiXV9/iqc6sccBvt20vbeCJJlRy3/ZJwH/WbNiQ/FTOkAaAdw22Nrl56lHxI9zsnmsVZvNWDVvztB9AyXxPI2oqUb8GFUz9UgYhPpzJhsSxOEwiY6KP/KoZ8csfmuuyxTZ/8jBVVcQW4zSrftMonXxt32qSNuXslBpTMSlal4Tq8IAip+32XlTmvMoGTln22MJGoDZZhrfPn/h/8Ue+NjRrxu/ATtiXPwJ8D0gqnM48VXCfmmHUMOPhkpu/b+hJkXyJTV/LCKyJAvAUmDffKOGvHuqh0loqP3wo34X4qebkbgkESwSznlE1AFcLyE4Y5e0xBf2tOpM1e/UrhfitQkilZNoAqL5qkYtD/OYdoWBryzMlDHLlbxPDUGUv0DND2vDVaBWi0nP6n+WOfAw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0106e995-1011-4c9b-899c-08dcb4e704a3 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:39:08.8920 (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: FOXmqjkN2OydSOk2wCSh4kUqIHXRC9QCQcPOJsi/Bk/8kjYbftmSQgY2vT5weHR4VVYXiQSXUQbWm5b/6WomXKgeJZofmbCL4HJNOa0E2vMdI3VUBCsH3sTS76rfgn/z X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 Message-ID-Hash: N4LP6CBLFWR5NQC7DVQY3Q34MGKMKKZA X-Message-ID-Hash: N4LP6CBLFWR5NQC7DVQY3Q34MGKMKKZA 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/fsl/fsl-asoc-card.c | 2 +- sound/soc/fsl/fsl_asrc.c | 2 +- sound/soc/fsl/fsl_asrc_dma.c | 8 ++++---- sound/soc/fsl/fsl_audmix.c | 2 +- sound/soc/fsl/fsl_dma.c | 10 +++++----- sound/soc/fsl/fsl_easrc.c | 2 +- sound/soc/fsl/fsl_esai.c | 4 ++-- sound/soc/fsl/fsl_qmc_audio.c | 10 +++++----- sound/soc/fsl/fsl_sai.c | 8 ++++---- sound/soc/fsl/fsl_spdif.c | 8 ++++---- sound/soc/fsl/fsl_ssi.c | 6 +++--- sound/soc/fsl/fsl_xcvr.c | 8 ++++---- sound/soc/fsl/imx-audmix.c | 4 ++-- sound/soc/fsl/imx-hdmi.c | 2 +- sound/soc/fsl/imx-pcm-fiq.c | 8 ++++---- sound/soc/fsl/imx-pcm-rpmsg.c | 24 ++++++++++++------------ sound/soc/fsl/lpc3xxx-i2s.c | 10 +++++----- sound/soc/fsl/mpc5200_dma.c | 10 +++++----- sound/soc/fsl/mpc5200_dma.h | 2 +- sound/soc/fsl/mpc5200_psc_ac97.c | 2 +- 20 files changed, 66 insertions(+), 66 deletions(-) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index f6c3aeff0d8ea..29f32bf65c19f 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -171,7 +171,7 @@ static int fsl_asoc_card_hw_params(struct snd_pcm_substream *substream, { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct fsl_asoc_card_priv *priv = snd_soc_card_get_drvdata(rtd->card); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); struct codec_priv *codec_priv; struct snd_soc_dai *codec_dai; struct cpu_priv *cpu_priv = &priv->cpu_priv; diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index b793263291dc8..42d08db984e17 100644 --- a/sound/soc/fsl/fsl_asrc.c +++ b/sound/soc/fsl/fsl_asrc.c @@ -719,7 +719,7 @@ static int fsl_asrc_dai_hw_params(struct snd_pcm_substream *substream, config.pair = pair->index; config.channel_num = channels; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { config.input_format = params_format(params); config.output_format = asrc->asrc_format; config.input_sample_rate = rate; diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c index f501f47242fb0..abde5badf8383 100644 --- a/sound/soc/fsl/fsl_asrc_dma.c +++ b/sound/soc/fsl/fsl_asrc_dma.c @@ -55,7 +55,7 @@ static void fsl_asrc_dma_complete(void *arg) static int fsl_asrc_dma_prepare_and_submit(struct snd_pcm_substream *substream, struct snd_soc_component *component) { - u8 dir = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? OUT : IN; + u8 dir = snd_pcm_is_playback(substream) ? OUT : IN; struct snd_pcm_runtime *runtime = substream->runtime; struct fsl_asrc_pair *pair = runtime->private_data; struct device *dev = component->dev; @@ -131,7 +131,7 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component, enum dma_slave_buswidth buswidth = DMA_SLAVE_BUSWIDTH_2_BYTES; enum sdma_peripheral_type be_peripheral_type = IMX_DMATYPE_SSI; struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); struct snd_dmaengine_dai_dma_data *dma_params_fe = NULL; struct snd_dmaengine_dai_dma_data *dma_params_be = NULL; struct snd_pcm_runtime *runtime = substream->runtime; @@ -308,7 +308,7 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component, static int fsl_asrc_dma_hw_free(struct snd_soc_component *component, struct snd_pcm_substream *substream) { - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); struct snd_pcm_runtime *runtime = substream->runtime; struct fsl_asrc_pair *pair = runtime->private_data; u8 dir = tx ? OUT : IN; @@ -329,7 +329,7 @@ static int fsl_asrc_dma_hw_free(struct snd_soc_component *component, static int fsl_asrc_dma_startup(struct snd_soc_component *component, struct snd_pcm_substream *substream) { - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct snd_pcm_runtime *runtime = substream->runtime; struct snd_dmaengine_dai_dma_data *dma_data; diff --git a/sound/soc/fsl/fsl_audmix.c b/sound/soc/fsl/fsl_audmix.c index 1671a3037c604..1ee3f8f919695 100644 --- a/sound/soc/fsl/fsl_audmix.c +++ b/sound/soc/fsl/fsl_audmix.c @@ -283,7 +283,7 @@ static int fsl_audmix_dai_trigger(struct snd_pcm_substream *substream, int cmd, unsigned long lock_flags; /* Capture stream shall not be handled */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) return 0; switch (cmd) { diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c index c4bc9395dff7d..6754ea7372da0 100644 --- a/sound/soc/fsl/fsl_dma.c +++ b/sound/soc/fsl/fsl_dma.c @@ -166,7 +166,7 @@ static void fsl_dma_update_pointers(struct fsl_dma_private *dma_private) * system, we also need to update the ESAD bits. We also set (keep) the * snoop bits. See the comments in fsl_dma_hw_params() about snooping. */ - if (dma_private->substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dma_private->substream)) { link->source_addr = cpu_to_be32(dma_private->dma_buf_next); #ifdef CONFIG_PHYS_64BIT link->source_attr = cpu_to_be32(CCSR_DMA_ATR_SNOOP | @@ -395,7 +395,7 @@ static int fsl_dma_open(struct snd_soc_component *component, dev_err(dev, "can't allocate dma private data\n"); return -ENOMEM; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dma_private->ssi_sxx_phys = dma->ssi_stx_phys; else dma_private->ssi_sxx_phys = dma->ssi_srx_phys; @@ -473,7 +473,7 @@ static int fsl_dma_open(struct snd_soc_component *component, /* For playback, we want the destination address to be held. For capture, set the source address to be held. */ - mr |= (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? + mr |= (snd_pcm_is_playback(substream)) ? CCSR_DMA_MR_DAHE : CCSR_DMA_MR_SAHE; out_be32(&dma_channel->mr, mr); @@ -633,7 +633,7 @@ static int fsl_dma_hw_params(struct snd_soc_component *component, * get more performance by not snooping, and you'll still be * okay. You'll need to update fsl_dma_update_pointers() also. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { link->source_addr = cpu_to_be32(temp_addr); link->source_attr = cpu_to_be32(CCSR_DMA_ATR_SNOOP | upper_32_bits(temp_addr)); @@ -683,7 +683,7 @@ static snd_pcm_uframes_t fsl_dma_pointer(struct snd_soc_component *component, * only have 32-bit DMA addresses. This function is typically called * in interrupt context, so we need to optimize it. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { position = in_be32(&dma_channel->sar); #ifdef CONFIG_PHYS_64BIT position |= (u64)(in_be32(&dma_channel->satr) & diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index 962f309120918..ba577bd9ab477 100644 --- a/sound/soc/fsl/fsl_easrc.c +++ b/sound/soc/fsl/fsl_easrc.c @@ -1461,7 +1461,7 @@ static int fsl_easrc_hw_params(struct snd_pcm_substream *substream, * Set the input and output ratio so we can compute * the resampling ratio in RS_LOW/HIGH */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ctx_priv->in_params.sample_rate = rate; ctx_priv->in_params.sample_format = format; ctx_priv->out_params.sample_rate = easrc->asrc_rate; diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c index d0d8a01da9bdd..000abee37d0da 100644 --- a/sound/soc/fsl/fsl_esai.c +++ b/sound/soc/fsl/fsl_esai.c @@ -537,7 +537,7 @@ static int fsl_esai_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct fsl_esai *esai_priv = snd_soc_dai_get_drvdata(dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); u32 width = params_width(params); u32 channels = params_channels(params); u32 pins = DIV_ROUND_UP(channels, esai_priv->slots); @@ -758,7 +758,7 @@ static int fsl_esai_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct fsl_esai *esai_priv = snd_soc_dai_get_drvdata(dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); unsigned long lock_flags; esai_priv->channels[tx] = substream->runtime->channels; diff --git a/sound/soc/fsl/fsl_qmc_audio.c b/sound/soc/fsl/fsl_qmc_audio.c index 8668abd352080..bc7eef100c8ad 100644 --- a/sound/soc/fsl/fsl_qmc_audio.c +++ b/sound/soc/fsl/fsl_qmc_audio.c @@ -250,7 +250,7 @@ static int qmc_audio_pcm_trigger(struct snd_soc_component *component, switch (cmd) { case SNDRV_PCM_TRIGGER_START: bitmap_zero(prtd->chans_pending, 64); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { for (i = 0; i < prtd->channels; i++) prtd->qmc_dai->chans[i].prtd_tx = prtd; @@ -513,7 +513,7 @@ static int qmc_dai_constraints_interleaved(struct snd_pcm_substream *substream, u64 access; int ret; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { hw_rule_channels_by_format = qmc_dai_hw_rule_capture_channels_by_format; hw_rule_format_by_channels = qmc_dai_hw_rule_capture_format_by_channels; frame_bits = qmc_dai->nb_rx_ts * 8; @@ -566,7 +566,7 @@ static int qmc_dai_constraints_noninterleaved(struct snd_pcm_substream *substrea u64 access; int ret; - frame_bits = (substream->stream == SNDRV_PCM_STREAM_CAPTURE) ? + frame_bits = snd_pcm_is_capture(substream) ? qmc_dai->nb_rx_ts * 8 : qmc_dai->nb_tx_ts * 8; ret = snd_pcm_hw_constraint_single(substream->runtime, SNDRV_PCM_HW_PARAM_FRAME_BITS, @@ -637,7 +637,7 @@ static int qmc_dai_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { chan_param.mode = QMC_TRANSPARENT; chan_param.transp.max_rx_buf_size = params_period_bytes(params) / nb_chans_used; for (i = 0; i < nb_chans_used; i++) { @@ -672,7 +672,7 @@ static int qmc_dai_trigger(struct snd_pcm_substream *substream, int cmd, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { direction = QMC_CHAN_WRITE; nb_chans_used = qmc_dai->nb_chans_used_tx; } else { diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index d03b0172b8ad2..c0bc992e22b5f 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -525,7 +525,7 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream, { struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); unsigned int ofs = sai->soc_data->reg_offset; - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); unsigned int channels = params_channels(params); struct snd_dmaengine_dai_dma_data *dma_params; struct fsl_sai_dl_cfg *dl_cfg = sai->dl_cfg; @@ -721,7 +721,7 @@ static int fsl_sai_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *cpu_dai) { struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); unsigned int ofs = sai->soc_data->reg_offset; /* Clear xMR to avoid channel swap with mclk_with_tere enabled case */ @@ -783,7 +783,7 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd, struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); unsigned int ofs = sai->soc_data->reg_offset; - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); int adir = tx ? RX : TX; int dir = tx ? TX : RX; u32 xcsr; @@ -868,7 +868,7 @@ static int fsl_sai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *cpu_dai) { struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); int ret; /* diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index a63121c888e02..d860e54b1f5e6 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -622,7 +622,7 @@ static int fsl_spdif_startup(struct snd_pcm_substream *substream, regmap_update_bits(regmap, REG_SPDIF_SIE, 0xffffff, 0); } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { scr = SCR_TXFIFO_AUTOSYNC | SCR_TXFIFO_CTRL_NORMAL | SCR_TXSEL_NORMAL | SCR_USRC_SEL_CHIP | SCR_TXFIFO_FSEL_IF8; @@ -650,7 +650,7 @@ static void fsl_spdif_shutdown(struct snd_pcm_substream *substream, struct regmap *regmap = spdif_priv->regmap; u32 scr, mask; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { scr = 0; mask = SCR_TXFIFO_AUTOSYNC_MASK | SCR_TXFIFO_CTRL_MASK | SCR_TXSEL_MASK | SCR_USRC_SEL_MASK | @@ -706,7 +706,7 @@ static int fsl_spdif_hw_params(struct snd_pcm_substream *substream, u32 sample_rate = params_rate(params); int ret = 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = spdif_reparent_rootclk(spdif_priv, sample_rate); if (ret) { dev_err(&pdev->dev, "%s: reparent root clk failed: %d\n", @@ -737,7 +737,7 @@ static int fsl_spdif_trigger(struct snd_pcm_substream *substream, struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)); struct regmap *regmap = spdif_priv->regmap; - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); u32 intr = SIE_INTR_FOR(tx); u32 dmaen = SCR_DMA_xX_EN(tx); diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 4ca3a16f7ac0d..ad02a9e0154ac 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -680,7 +680,7 @@ static int fsl_ssi_set_bclk(struct snd_pcm_substream *substream, struct snd_soc_dai *dai, struct snd_pcm_hw_params *hw_params) { - bool tx2, tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx2, tx = snd_pcm_is_playback(substream); struct fsl_ssi *ssi = snd_soc_dai_get_drvdata(dai); struct regmap *regs = ssi->regs; u32 pm = 999, div2, psr, stccr, mask, afreq, factor, i; @@ -805,7 +805,7 @@ static int fsl_ssi_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params, struct snd_soc_dai *dai) { - bool tx2, tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx2, tx = snd_pcm_is_playback(substream); struct fsl_ssi *ssi = snd_soc_dai_get_drvdata(dai); struct fsl_ssi_regvals *vals = ssi->regvals; struct regmap *regs = ssi->regs; @@ -1109,7 +1109,7 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd, { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct fsl_ssi *ssi = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); switch (cmd) { case SNDRV_PCM_TRIGGER_START: diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c index bf9a4e90978ef..f89f778a0d89a 100644 --- a/sound/soc/fsl/fsl_xcvr.c +++ b/sound/soc/fsl/fsl_xcvr.c @@ -437,7 +437,7 @@ static int fsl_xcvr_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct fsl_xcvr *xcvr = snd_soc_dai_get_drvdata(dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); u32 m_ctl = 0, v_ctl = 0; u32 r = substream->runtime->rate, ch = substream->runtime->channels; u32 fout = 32 * r * ch * 10; @@ -562,7 +562,7 @@ static int fsl_xcvr_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct fsl_xcvr *xcvr = snd_soc_dai_get_drvdata(dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); int ret = 0; if (xcvr->streams & BIT(substream->stream)) { @@ -614,7 +614,7 @@ static void fsl_xcvr_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct fsl_xcvr *xcvr = snd_soc_dai_get_drvdata(dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); u32 mask = 0, val = 0; int ret; @@ -662,7 +662,7 @@ static int fsl_xcvr_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct fsl_xcvr *xcvr = snd_soc_dai_get_drvdata(dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); int ret; switch (cmd) { diff --git a/sound/soc/fsl/imx-audmix.c b/sound/soc/fsl/imx-audmix.c index 6fbcf33fd0dea..8e03eadc33888 100644 --- a/sound/soc/fsl/imx-audmix.c +++ b/sound/soc/fsl/imx-audmix.c @@ -74,7 +74,7 @@ static int imx_audmix_fe_hw_params(struct snd_pcm_substream *substream, { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct device *dev = rtd->card->dev; - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); unsigned int fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_NB_NF; u32 channels = params_channels(params); int ret, dir; @@ -113,7 +113,7 @@ static int imx_audmix_be_hw_params(struct snd_pcm_substream *substream, { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct device *dev = rtd->card->dev; - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); unsigned int fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_NB_NF; int ret; diff --git a/sound/soc/fsl/imx-hdmi.c b/sound/soc/fsl/imx-hdmi.c index fe47b439a8183..b6ce395f91bbf 100644 --- a/sound/soc/fsl/imx-hdmi.c +++ b/sound/soc/fsl/imx-hdmi.c @@ -34,7 +34,7 @@ static int imx_hdmi_hw_params(struct snd_pcm_substream *substream, { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct imx_hdmi_data *data = snd_soc_card_get_drvdata(rtd->card); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); struct snd_soc_card *card = rtd->card; struct device *dev = card->dev; diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c index 3391430e42532..9005150012c15 100644 --- a/sound/soc/fsl/imx-pcm-fiq.c +++ b/sound/soc/fsl/imx-pcm-fiq.c @@ -53,7 +53,7 @@ static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt) get_fiq_regs(®s); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) iprtd->offset = regs.ARM_r8 & 0xffff; else iprtd->offset = regs.ARM_r9 & 0xffff; @@ -93,7 +93,7 @@ static int snd_imx_pcm_prepare(struct snd_soc_component *component, struct pt_regs regs; get_fiq_regs(®s); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) regs.ARM_r8 = (iprtd->period * iprtd->periods - 1) << 16; else regs.ARM_r9 = (iprtd->period * iprtd->periods - 1) << 16; @@ -115,7 +115,7 @@ static int snd_imx_pcm_trigger(struct snd_soc_component *component, 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)) atomic_set(&iprtd->playing, 1); else atomic_set(&iprtd->capturing, 1); @@ -127,7 +127,7 @@ static int snd_imx_pcm_trigger(struct snd_soc_component *component, case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) atomic_set(&iprtd->playing, 0); else atomic_set(&iprtd->capturing, 0); diff --git a/sound/soc/fsl/imx-pcm-rpmsg.c b/sound/soc/fsl/imx-pcm-rpmsg.c index b0944a07ab470..3653eed2d5bc9 100644 --- a/sound/soc/fsl/imx-pcm-rpmsg.c +++ b/sound/soc/fsl/imx-pcm-rpmsg.c @@ -142,7 +142,7 @@ static int imx_rpmsg_pcm_hw_params(struct snd_soc_component *component, struct rpmsg_info *info = dev_get_drvdata(component->dev); struct rpmsg_msg *msg; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_HW_PARAM]; msg->s_msg.header.cmd = TX_HW_PARAM; } else { @@ -195,7 +195,7 @@ static snd_pcm_uframes_t imx_rpmsg_pcm_pointer(struct snd_soc_component *compone unsigned int pos = 0; int buffer_tail = 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) msg = &info->msg[TX_PERIOD_DONE + MSG_TYPE_A_NUM]; else msg = &info->msg[RX_PERIOD_DONE + MSG_TYPE_A_NUM]; @@ -214,7 +214,7 @@ static void imx_rpmsg_timer_callback(struct timer_list *t) struct rpmsg_info *info = stream_timer->info; struct rpmsg_msg *msg; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_PERIOD_DONE + MSG_TYPE_A_NUM]; msg->s_msg.header.cmd = TX_PERIOD_DONE; } else { @@ -237,7 +237,7 @@ static int imx_rpmsg_pcm_open(struct snd_soc_component *component, int ret = 0; int cmd; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_OPEN]; msg->s_msg.header.cmd = TX_OPEN; @@ -291,7 +291,7 @@ static int imx_rpmsg_pcm_close(struct snd_soc_component *component, /* Flush work in workqueue to make TX_CLOSE is the last message */ flush_workqueue(info->rpmsg_wq); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_CLOSE]; msg->s_msg.header.cmd = TX_CLOSE; } else { @@ -353,7 +353,7 @@ static int imx_rpmsg_prepare_and_submit(struct snd_soc_component *component, struct rpmsg_info *info = dev_get_drvdata(component->dev); struct rpmsg_msg *msg; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_BUFFER]; msg->s_msg.header.cmd = TX_BUFFER; } else { @@ -382,7 +382,7 @@ static int imx_rpmsg_async_issue_pending(struct snd_soc_component *component, struct rpmsg_info *info = dev_get_drvdata(component->dev); struct rpmsg_msg *msg; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_START]; msg->s_msg.header.cmd = TX_START; } else { @@ -399,7 +399,7 @@ static int imx_rpmsg_restart(struct snd_soc_component *component, struct rpmsg_info *info = dev_get_drvdata(component->dev); struct rpmsg_msg *msg; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_RESTART]; msg->s_msg.header.cmd = TX_RESTART; } else { @@ -416,7 +416,7 @@ static int imx_rpmsg_pause(struct snd_soc_component *component, struct rpmsg_info *info = dev_get_drvdata(component->dev); struct rpmsg_msg *msg; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_PAUSE]; msg->s_msg.header.cmd = TX_PAUSE; } else { @@ -434,7 +434,7 @@ static int imx_rpmsg_terminate_all(struct snd_soc_component *component, struct rpmsg_msg *msg; int cmd; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_TERMINATE]; msg->s_msg.header.cmd = TX_TERMINATE; /* Clear buffer count*/ @@ -530,7 +530,7 @@ static int imx_rpmsg_pcm_ack(struct snd_soc_component *component, if (!rpmsg->force_lpa) return 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_PERIOD_DONE + MSG_TYPE_A_NUM]; msg->s_msg.header.cmd = TX_PERIOD_DONE; } else { @@ -559,7 +559,7 @@ static int imx_rpmsg_pcm_ack(struct snd_soc_component *component, info->notify_updated[substream->stream] = true; spin_unlock_irqrestore(&info->lock[substream->stream], flags); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) avail = snd_pcm_playback_hw_avail(runtime); else avail = snd_pcm_capture_hw_avail(runtime); diff --git a/sound/soc/fsl/lpc3xxx-i2s.c b/sound/soc/fsl/lpc3xxx-i2s.c index c65c17dfa1747..536ace6de0088 100644 --- a/sound/soc/fsl/lpc3xxx-i2s.c +++ b/sound/soc/fsl/lpc3xxx-i2s.c @@ -75,7 +75,7 @@ static int lpc3xxx_i2s_startup(struct snd_pcm_substream *substream, struct snd_s guard(mutex)(&i2s_info_p->lock); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) flag = I2S_PLAYBACK_FLAG; else flag = I2S_CAPTURE_FLAG; @@ -107,7 +107,7 @@ static void lpc3xxx_i2s_shutdown(struct snd_pcm_substream *substream, struct snd guard(mutex)(&i2s_info_p->lock); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { flag = I2S_PLAYBACK_FLAG; regmap_write(regs, LPC3XXX_REG_I2S_TX_RATE, 0); regmap_update_bits(regs, LPC3XXX_REG_I2S_DAO, stop_bits, stop_bits); @@ -197,7 +197,7 @@ static int lpc3xxx_i2s_hw_params(struct snd_pcm_substream *substream, dev_dbg(dev, "Channels : %d\n", params_channels(params)); dev_dbg(dev, "Data format : %s\n", "I2S"); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regmap_write(regs, LPC3XXX_REG_I2S_DMA1, LPC3XXX_I2S_DMA1_TX_EN | LPC3XXX_I2S_DMA0_TX_DEPTH(4)); regmap_write(regs, LPC3XXX_REG_I2S_TX_RATE, (clkx << 8) | clky); @@ -223,7 +223,7 @@ static int lpc3xxx_i2s_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: case SNDRV_PCM_TRIGGER_SUSPEND: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) regmap_update_bits(regs, LPC3XXX_REG_I2S_DAO, LPC3XXX_I2S_STOP, LPC3XXX_I2S_STOP); else @@ -234,7 +234,7 @@ static int lpc3xxx_i2s_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: case SNDRV_PCM_TRIGGER_RESUME: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) regmap_update_bits(regs, LPC3XXX_REG_I2S_DAO, (LPC3XXX_I2S_RESET | LPC3XXX_I2S_STOP), 0); else diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c index 345f338251ace..07ddc3cd31890 100644 --- a/sound/soc/fsl/mpc5200_dma.c +++ b/sound/soc/fsl/mpc5200_dma.c @@ -137,7 +137,7 @@ static int psc_dma_trigger(struct snd_soc_component *component, */ spin_lock_irqsave(&psc_dma->lock, flags); - if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream->pstr->stream)) bcom_gen_bd_rx_reset(s->bcom_task); else bcom_gen_bd_tx_reset(s->bcom_task); @@ -160,7 +160,7 @@ static int psc_dma_trigger(struct snd_soc_component *component, spin_lock_irqsave(&psc_dma->lock, flags); bcom_disable(s->bcom_task); - if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream->pstr->stream)) bcom_gen_bd_rx_reset(s->bcom_task); else bcom_gen_bd_tx_reset(s->bcom_task); @@ -219,7 +219,7 @@ static int psc_dma_open(struct snd_soc_component *component, dev_dbg(psc_dma->dev, "psc_dma_open(substream=%p)\n", substream); - if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream->pstr->stream)) s = &psc_dma->capture; else s = &psc_dma->playback; @@ -246,7 +246,7 @@ static int psc_dma_close(struct snd_soc_component *component, dev_dbg(psc_dma->dev, "psc_dma_close(substream=%p)\n", substream); - if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream->pstr->stream)) s = &psc_dma->capture; else s = &psc_dma->playback; @@ -271,7 +271,7 @@ psc_dma_pointer(struct snd_soc_component *component, struct psc_dma_stream *s; dma_addr_t count; - if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream->pstr->stream)) s = &psc_dma->capture; else s = &psc_dma->playback; diff --git a/sound/soc/fsl/mpc5200_dma.h b/sound/soc/fsl/mpc5200_dma.h index d7ee33b5b9a8d..42460f2b3906d 100644 --- a/sound/soc/fsl/mpc5200_dma.h +++ b/sound/soc/fsl/mpc5200_dma.h @@ -77,7 +77,7 @@ struct psc_dma { static inline struct psc_dma_stream * to_psc_dma_stream(struct snd_pcm_substream *substream, struct psc_dma *psc_dma) { - if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream->pstr->stream)) return &psc_dma->capture; return &psc_dma->playback; } diff --git a/sound/soc/fsl/mpc5200_psc_ac97.c b/sound/soc/fsl/mpc5200_psc_ac97.c index 0423cf43c7a02..cb96b0ff74396 100644 --- a/sound/soc/fsl/mpc5200_psc_ac97.c +++ b/sound/soc/fsl/mpc5200_psc_ac97.c @@ -151,7 +151,7 @@ static int psc_ac97_hw_analog_params(struct snd_pcm_substream *substream, /* Determine the set of enable bits to turn on */ s->ac97_slot_bits = (params_channels(params) == 1) ? 0x100 : 0x300; - if (substream->pstr->stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(substream->pstr->stream)) s->ac97_slot_bits <<= 16; return 0; } From patchwork Mon Aug 5 00:39:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817102 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 AACF8C52D70 for ; Mon, 5 Aug 2024 00:55:50 +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 D03604B2D; Mon, 5 Aug 2024 02:53:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D03604B2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819192; bh=57sckNHNa8QKD13VJgOcOepyqlHAeuMNZ8R3gh27Ifs=; 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=qOEYrODOeZtZs+Jd4VXRoblWLs3TmzeMreaBVAcbWJArGJo5F1vx3omOK1rQBzrKp Lh3NGNO3UWmZELCLXyMuqzdxhrN2G0pA/QSkOSiaCUOFJQn0N1kPvr05W1tdX+BTx9 YA+BXthrUsGDCCZDvXfG6w/ps+RIZctngYuaJBZA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 91C5BF89A6A; Mon, 5 Aug 2024 02:40:05 +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 4C2B3F89A2A; Mon, 5 Aug 2024 02:40:05 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D40B9F89772; Mon, 5 Aug 2024 02:39:24 +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 38834F89758 for ; Mon, 5 Aug 2024 02:39:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 38834F89758 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=py93YUlY ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HMjXHMq3AQYvj/b8KBlKpgniBOCKewdA3T7704NWdnAgk+VtoTBRdW9TyHAIKC0q6UIfs7YOUrlfkjP/zOXxNwHhWrdckCqz7v1w68MpXy3NYSLR4A6atRz7DlB8dRWwMHAspR5bTD3zSH9Ej8crtW3oCvpGnyZ1LbYEPrgk3vtSU3HkwGQm1ERKBVVbd703eIeCDKhjjtfJDAyEvNut5fnpPrcqxDZRyvawNUGKTUN8CyoDJOYYJf6niUek44mCqahP49NUrbecVl3W6hTdZ6RiHti6IBhCL4j7j98F0MWGrAe2IIN0d3LvQhR2x9FpYtzHqFO446GWuoBlFrPkhw== 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=Kv7uzY5AJm3G0Y5hhGyeH1bVSTRuT4ydXV9fgIk/S74=; b=fiTCrh98Wi5sfoLy81sWk1u0LiJL3AqseY1cAWd2Ri1hLCZLxPS0KEKO+uKS7U2k3mIrDxz6Wjq9o8djCZbeddt9tindwdXtWqMmV1QbJOMNvGS5a1y45zDTwiorD/we9Ww/0chNRggdfO+lbQDyV54bhQGbjJBYvwvQkZCaYDROFaz4uCLbmczuN3mRuPHuFkPYBJDDqI+4hKDeQ9CiLKrfNS9cm8zyOGE4lOLYYuaSyKdmo8MFg9XqudCw4n9+ywPbD2kGYyUeoPQZZ9sogwqgqV3qyqw4hhybIsQ/BBRmOWUbQCF+x+3ZH3EoRjA1ZJZeROR4Pe3cbJrnvrJGgg== 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=Kv7uzY5AJm3G0Y5hhGyeH1bVSTRuT4ydXV9fgIk/S74=; b=py93YUlYOILYJ4Zjpklz85ZTfrP5j1aLCV8P4HB7ANmHUg3oDsVayfN9D4ltDwCmzjdLkgQZGYMfsQXx4mvVGY9p034rMqJDWPi3dJIB6Suy9Cg/smfD4maCQofE9urQdfyTalUgOVg//jJfO4+MKYe1I7vg8J+wbOlqNQ0kYaw= 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:39:13 +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:39:13 +0000 Message-ID: <874j7zztu7.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 050/113] ASoC: mxs: 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:39:12 +0000 X-ClientProxiedBy: TYAPR01CA0023.jpnprd01.prod.outlook.com (2603:1096:404::35) 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: cc673470-5ab7-4cbe-9288-08dcb4e70713 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-Ant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LPatcGBMZhfV3lMhmP3SfXnVRFQToEe42OSdeR/eyKsnONVreQgutJSBQvpwQzlzl6R+rnzf/8njfdCEjtQa49UbM60QJ9KP/Pd9W0a2WETBdX1HK2XKupfv2FVzEz2Ed0s0kz3rlnhut0Y+1P8LOT6dCyhbuVDjuPxYV+URtewuvnFzbe3t1BzzuBLTw/HAQPItl4gvlVTkDqL1/U2jhgPG+DO2chOQGqqqLcp1WYpmDZHU79uPJbA+9xt3lrF/f/EpYXEPPW3YBLXbpaEIqzYUmyssrxBzKKDUCWbTYzRYmgO/EhzJguQvm0e/KKiYHGZzYEuYUMr5tIrLnh62JZ3Jdyw== 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: fJ4Lde+OrB2LayrzU8LUPTeSn2RJCSUgaDmwvh93mFNF8823JKf2rEUHlwsXGZeV519Iu+PlIDGAsyGkVgY0XVB+Tp+LXCpZIrvam2BnUSloLWLONdm5TSzTbJuNCX59h/5thOVDqJfNF0f5d+rgItTR4oFpfuqyQWHlE55A/a9WK6+Bj4VI7VCeQG01Y32bsz194QW/joXLQIL6mNnKgUSMBX/koi4XY0ysaap/R6+y1A5shiUcHB9Jo1QjAwxrZtWrftBRQopWT1RkeDskUm83iatRJpoG6gVHHLOYg56O4IdAfoBuoCnOwRCJNB7pLQn9+GrGEXJWR6O8gDNUlGapWqcIZnsQiY1/vEzORwunMcn90wr1mreRl9ratS1FEyUogy76d7riQT8EubdC8PeA455c63sw6Wl5yHHEwTwZ4E8XLs9p7xIe/KnfMRascSG70WmGIDh1jCcZcwbrOmZzJ/qZT7J+sQI/HVmXpe3cGLpgIr/VRCwbe46ZWz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9Wv7ZGFsVeaFJa0RKv44w8kZwUyFBwu4v90JauckoGe3D4YCcekJK6wckLg= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc673470-5ab7-4cbe-9288-08dcb4e70713 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:39:12.9670 (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: SouN3OWDYbLQhArShV7ux9zSvki/Jt0kbb+L9BsAzubTKhuLkhAcmSnEZF/TTpSSG+hkhz8X3p4erGLiZ9Ds2gAAEpN9+BoylrnN5z69DMHJEOgNJttlhIJZ3U93zUyx X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 Message-ID-Hash: WL527QOIYEPIRVF7W2RLU2AIXIF6BV65 X-Message-ID-Hash: WL527QOIYEPIRVF7W2RLU2AIXIF6BV65 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/mxs/mxs-saif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c index 3e3a62df3d7e3..2a3d8038d4362 100644 --- a/sound/soc/mxs/mxs-saif.c +++ b/sound/soc/mxs/mxs-saif.c @@ -489,7 +489,7 @@ static int mxs_saif_hw_params(struct snd_pcm_substream *substream, } /* Tx/Rx config */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* enable TX mode */ scr &= ~BM_SAIF_CTRL_READ_MODE; } else { @@ -560,7 +560,7 @@ static int mxs_saif_trigger(struct snd_pcm_substream *substream, int cmd, __raw_writel(BM_SAIF_CTRL_RUN, master_saif->base + SAIF_CTRL + MXS_SET_ADDR); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* * write data to saif data register to trigger * the transfer. From patchwork Mon Aug 5 00:39: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: 816782 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 89B1DC3DA7F for ; Mon, 5 Aug 2024 00:56:44 +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 249EB5172; Mon, 5 Aug 2024 02:53:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 249EB5172 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819242; bh=rOD3TXk5bj4z3mjxuC3Fl8S8+so7WHyaz/Otlstnc9o=; 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=ikpVApNu70MvHq9ZrL1tCaN3z4wsX0l+ye7WsVHM/QsWoifvrNyWCMisVViZmGD4n 8+o4kM9+aJml7a/RM/3GcIJ0/mjLeyAn+cysUvym6syAUEcJ2lvgpDqZLrr8DUzLep tuWgjquzkAsd/b3O3oG+kDL9Rh4IKA+4xlXXjPNs= Received: by alsa1.perex.cz (Postfix, from userid 50401) id AC592F89ACE; Mon, 5 Aug 2024 02:40:27 +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 5FF0EF89ACF; Mon, 5 Aug 2024 02:40:27 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6CBB4F898F3; Mon, 5 Aug 2024 02:39:45 +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 CA88AF89818 for ; Mon, 5 Aug 2024 02:39:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CA88AF89818 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=fflcawm7 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pc5JQdFDnbH4Ze8A5ktTav7wgVpAzguCM+rQ/zBRGa6vowaaKBAiVyyysLjcqBMreXV65EE/tq6xi+HmNpeck0tg5Npt6iz4Y7eIkM+W3kKPvhP/V9bRGiD83oslg3uUpb3fxDdSlGUpKTUTxi2n0WOQFI71QUnPDCN+4tZrj7W6iDNlp8USdjQns4HX4Ug75LXoetrFWBEVyqfIwRkudQRm3w7lmrvWUAY4uaAAfBI2yhqkXx0rSEQVcF/WEfIn962iBexhA/WLuQAV2soT0h2YSUUYnfKAl6mpvtBpkV1yfvCwnuyhCK3KD7+U6yZcDNjWDyQK2aBBD7ag0rg8Jg== 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=zWB17jvfIiZnDthuCCeUpJuGrjhGo9LcHQV0ke7wCSw=; b=rsmueK9rs4Ikxbs5vmlxnWucvMirEItWwLza1N2mQaiO509sNAtIH2GXojvmssDlCxr4XkFHijrvvgOfdAFgoyss1zLZ+/hGHh2sN+4zo8SBp+1+Ymebx2nh7QORwsqp1vNqwN+diCf7ZKeivFdvlUq3OS3rVDOHu984Zxx9zgthFSQ9lACNrNMW2/8X/0YD+EBVVP4l6NIcuFcYwJatUjLGfv6KmQlF5iQi7uBL1hH6kRGRRh7v8+KDBWwTo9FKCpjoEcV0OOZw2cjEkhwFHUH3OQoFD83EYjaCSZta2oBLy1V+ul9wCxbVb19nFP40ZJxmBClqjq3WRjiZLn8DqA== 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=zWB17jvfIiZnDthuCCeUpJuGrjhGo9LcHQV0ke7wCSw=; b=fflcawm7jhydYrzqsXb3FjLIeg56wth5ufZpNa2nBF9Ypkp/jod9wcyiKrcaT2F6vMzd/RWwyHtruaKAAkJgkatO+O6jAL0Z0okCvz8O2yZ07MF3wfYlJ0FlS9ZGvGUxPkUivPHmPzhiTjOHLdh8O8iH9IAVMeiZShPkjpOhqcU= 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:39: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:39:23 +0000 Message-ID: <8734njzttx.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 051/113] ASoC: pxa: 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:39:22 +0000 X-ClientProxiedBy: TYCPR01CA0060.jpnprd01.prod.outlook.com (2603:1096:405:2::24) 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: 79567008-06c5-4f1c-f7da-08dcb4e70d15 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|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QjqtIFc5oQvP0LD8qbuN4ch/ZiCsGQClZjqUOcI3ksNrDLYyh2QiQijI1vdDhDdahEEm/5hUxHPU3T7kYIhlPvhNM4I82hJtEiBr/X/g2Z91sYo6RX7jhZ+CvdiE8wNBXeoq2A03udo9tGxMmzBuSeJO67MQckgaA5mIeJAgVl7tMj8EkEEZqgjNh+IhjZ33VSKP5o0aiZS49al7kd30/Sddd8OsFwBSSYFZe3fTjch3ih1HaStUziOXhUuDmKtiUbeACv1l/mBAOBOAaRTF44MuBHMr1xIkRowORZ/higF6wwQQOEKAQfQ3NIVdWMGUYnXVMDg40C1Uc5IsoNvcM/XY3qivEzLWS487WqstwhbjUvRdaLekp0cbxJIhrw5fs7DEK7qpqZMqsgmgmUvDrt8Akg== 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: j2y8At5Cv9GH3H65VKFsoSnGU8ZdnassQPeEsI7PNII70uqBf3Yf7z5jQhuAp3+mR//Y8HRu/S3NSOkCO3Gc7CeXHEDsgFdX1nEcdwnzniAzV+pJm19C9XLy43B4GTbOeSANez3lryR1QAPpgCquFFv1z20wn3wlnjQVoD4Ph4cLIzimVdGWj4YYZilw+YnSJ5dJ+KIkT3hVD8ADdXmktvZkgMQjoE8bZ8chSWa3c1tm+nkuv/LTPXn6+sRnSi6BY+SOeDOnbmHHXWNXQsfOvrWvGfpD8AppypoWldpvXfYRqxPDuBdDTWfKjl5nTc9vY41F2leSoAskFuFuX1Y5neaLU4MdvggnaNdlsy4wOpOe7BstSZCD2v9DhcM29wUYHNiW3v8fo0HOY/+KuDLoYyIKa+KKUn/e3fI+rmUwMJsjabzHu6aylUIUC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tH0QFV+WahVMukI5TLJfamz6t6eVpyxrC2gDzdeGxeJVutz1PE0L/yRle2L70N079FsGH3vB/1z5UszFn17hRJV7VwpHh3LlbVS3NEmSVECrRkVXTBledgkv4LoWsx5Airk1BR7QOk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79567008-06c5-4f1c-f7da-08dcb4e70d15 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:39:23.3937 (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: ufUd3M/A1mN3/mjrHDVOpIkw9dKkvjzs6rl25u76UzSb96DVMjqZMHVVpivxoTSob6kGKr1JMBj4K0n2wyhcT9qpkCsWv/agQTWD1J7EkSfRdKhBmkhs79NTpcZ4PSJl X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 Message-ID-Hash: 4ARJJTWLINPW4UVJ5BEOCXK3NZFS3GQD X-Message-ID-Hash: 4ARJJTWLINPW4UVJ5BEOCXK3NZFS3GQD 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/pxa/mmp-sspa.c | 6 +++--- sound/soc/pxa/pxa-ssp.c | 6 +++--- sound/soc/pxa/pxa2xx-ac97.c | 6 +++--- sound/soc/pxa/pxa2xx-i2s.c | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sound/soc/pxa/mmp-sspa.c b/sound/soc/pxa/mmp-sspa.c index abfaf3cdf5bb6..229b1ebe720d9 100644 --- a/sound/soc/pxa/mmp-sspa.c +++ b/sound/soc/pxa/mmp-sspa.c @@ -266,7 +266,7 @@ static int mmp_sspa_hw_params(struct snd_pcm_substream *substream, params_channels(params) * bits); } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { __raw_writel(sspa_ctrl, sspa->tx_base + SSPA_CTL); __raw_writel(0x1, sspa->tx_base + SSPA_FIFO_UL); } else { @@ -296,7 +296,7 @@ static int mmp_sspa_trigger(struct snd_pcm_substream *substream, int cmd, if (!sspa->running_cnt) mmp_sspa_rx_enable(sspa); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) mmp_sspa_tx_enable(sspa); sspa->running_cnt++; @@ -307,7 +307,7 @@ static int mmp_sspa_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_PAUSE_PUSH: sspa->running_cnt--; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) mmp_sspa_tx_disable(sspa); /* have no capture stream, disable rx port */ diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c index b8a3cb8b75978..82f91f951619a 100644 --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c @@ -88,7 +88,7 @@ static int pxa_ssp_startup(struct snd_pcm_substream *substream, dma = kzalloc(sizeof(struct snd_dmaengine_dai_dma_data), GFP_KERNEL); if (!dma) return -ENOMEM; - dma->chan_name = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? + dma->chan_name = snd_pcm_is_playback(substream) ? "tx" : "rx"; snd_soc_dai_set_dma_data(cpu_dai, substream, dma); @@ -551,7 +551,7 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream, */ pxa_ssp_set_dma_params(ssp, ((chn == 2) && (ttsa != 1)) || (width == 32), - substream->stream == SNDRV_PCM_STREAM_PLAYBACK, dma_data); + snd_pcm_is_playback(substream), dma_data); /* we can only change the settings if the port is not in use */ if (pxa_ssp_read_reg(ssp, SSCR0) & SSCR0_SSE) @@ -683,7 +683,7 @@ static void pxa_ssp_set_running_bit(struct snd_pcm_substream *substream, if (value && (sscr0 & SSCR0_SSE)) pxa_ssp_write_reg(ssp, SSCR0, sscr0 & ~SSCR0_SSE); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (value) sscr1 |= SSCR1_TSRE; else diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index 80e0ea0ec9fb3..9a8e08b30ebfa 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -95,7 +95,7 @@ static int pxa2xx_ac97_hifi_startup(struct snd_pcm_substream *substream, { struct snd_dmaengine_dai_dma_data *dma_data; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dma_data = &pxa2xx_ac97_pcm_stereo_out; else dma_data = &pxa2xx_ac97_pcm_stereo_in; @@ -110,7 +110,7 @@ static int pxa2xx_ac97_aux_startup(struct snd_pcm_substream *substream, { struct snd_dmaengine_dai_dma_data *dma_data; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dma_data = &pxa2xx_ac97_pcm_aux_mono_out; else dma_data = &pxa2xx_ac97_pcm_aux_mono_in; @@ -123,7 +123,7 @@ static int pxa2xx_ac97_aux_startup(struct snd_pcm_substream *substream, static int pxa2xx_ac97_mic_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *cpu_dai) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return -ENODEV; snd_soc_dai_set_dma_data(cpu_dai, substream, &pxa2xx_ac97_pcm_mic_mono_in); diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c index 849fbf176a70f..664116396e8ff 100644 --- a/sound/soc/pxa/pxa2xx-i2s.c +++ b/sound/soc/pxa/pxa2xx-i2s.c @@ -163,7 +163,7 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream, clk_ena = 1; pxa_i2s_wait(); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dma_data = &pxa2xx_i2s_pcm_stereo_out; else dma_data = &pxa2xx_i2s_pcm_stereo_in; @@ -179,7 +179,7 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream, writel(readl(i2s_reg_base + SACR0) | (SACR0_RFTH(14) | SACR0_TFTH(1)), i2s_reg_base + SACR0); writel(readl(i2s_reg_base + SACR1) | (pxa_i2s.fmt), i2s_reg_base + SACR1); } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) writel(readl(i2s_reg_base + SAIMR) | (SAIMR_TFS), i2s_reg_base + SAIMR); else writel(readl(i2s_reg_base + SAIMR) | (SAIMR_RFS), i2s_reg_base + SAIMR); @@ -218,7 +218,7 @@ static int pxa2xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd, switch (cmd) { case SNDRV_PCM_TRIGGER_START: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) writel(readl(i2s_reg_base + SACR1) & (~SACR1_DRPL), i2s_reg_base + SACR1); else writel(readl(i2s_reg_base + SACR1) & (~SACR1_DREC), i2s_reg_base + SACR1); @@ -240,7 +240,7 @@ static int pxa2xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd, static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { writel(readl(i2s_reg_base + SACR1) | (SACR1_DRPL), i2s_reg_base + SACR1); writel(readl(i2s_reg_base + SAIMR) & (~SAIMR_TFS), i2s_reg_base + SAIMR); } else { From patchwork Mon Aug 5 00:39:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816784 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 DF8D1C3DA64 for ; Mon, 5 Aug 2024 00:55:27 +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 912A84AD1; Mon, 5 Aug 2024 02:52:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 912A84AD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819176; bh=OHcwhhRaCQ5nNh2KNCNC7TLahmlzqbvIXsQPJDIyK0M=; 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=TRrkfOpeT2Pvk7uHn6NYUGFBia4LPSzBuJGVpn7UnvfQvKjxbdwl/RfJBi0dgN1ch h6G/Ix27nK/LG1SOcUOk5Ns3QtI0CzX2HBMocwBF1w2nrqBU8wopEUK1n/bYwoUFP/ LJUYI/+AJIHjEQ3PMsBD5E6pVk9JNVTMnO2eJwLg= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5BCCFF89A5F; Mon, 5 Aug 2024 02:40:25 +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 1B252F89A99; Mon, 5 Aug 2024 02:40:25 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 256DAF805F7; Mon, 5 Aug 2024 02:39:45 +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 C3603F89857 for ; Mon, 5 Aug 2024 02:39:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C3603F89857 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=jC91EYWM ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wBf4EFiBDjJGNpr+wb/9r78PskstqyuHJiWQXhC7AV30RG9nBh0zm6n8DaKZI6azp9GnTJWzzdRLoJbI/S5itrRmwpQks4tjJ+oYl1aMmE2Mx2jD4WwAvLrRDWHpc6W5pFvZpzHRRuutAe1ChNG808O6DXdyOl5CG6gcl2U6+dcHf/nZoiOKbmXHc+5YjrSkZe9ufqk4syHtewuT42/rBdCxmqwl3GygzyJd0Mg65pgjKofzqZzOlJHtFqy3WzieVw7k2qF9yVbkJGnINtrgKmje4/WkIm6WCxIzJHgsIdefnyJr2qW4mAEeoh0W73eM3Q4p+x2ifjTI7Kr716MjSQ== 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=ZiIntsRbiAsnvD4yM2VDU50+xHcFYUuOQslpju++csQ=; b=GvB+fm3WNYGVxXouct5Qz6hDbjpzgfLb4N7hB2r5SgZQU7RgpXPTQMXhVr4KEvzggVkuWrEWsRGPrvnGUk4Z0ZlNmrCh50L2tKOixXE8Et8tqkKz9FwP1zMwFp+GGFBW7e6l6RAcjvQemQZ62VKM14ZuCgUWAxYenoKIkYcZ6EAC5xdJ14FtDq5+FhNrIE8mhUX2Dp1WKzWAKJD24ztcAh0oAUmW0TYyjSyl9EGHnVypECvidC/+pXLhUHkT7DxFfTjkzp91vaLLVq3PsXoq833k5ZfW5gLhHssahFC5OE9OkpNA27JWHuTkGbJkAs5WRpo2JhGEdlw7D9uuk4ZsKA== 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=ZiIntsRbiAsnvD4yM2VDU50+xHcFYUuOQslpju++csQ=; b=jC91EYWM1apzfITeU8D8EcOVMz0BheUFA1h4fAnRTAQPdGr2857d4Qyj7YPAV4kO8VNosMjJqDIRqkDRgsVVS/wIqYm7crT85B/gR5JrN7SFwf3ZL8t1+0hxYigw8d+H+eAfy1Xn81DqrK0JNaOS2k49ebtQhvPDB0ORWuq70CI= 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:39:28 +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:39:28 +0000 Message-ID: <871q33ztts.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 052/113] ASoC: sti: 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:39:28 +0000 X-ClientProxiedBy: TYCP286CA0315.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:38b::9) 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: d920519b-067f-43ec-0cdd-08dcb4e71030 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: 3khgLI2xAa71ybtAmUa+/BpbackG/kbAZQIrMKgRB0zZAvemTGJNFQu8WEUaIPZJfgitokpwEXS7vhns2Fh00MEzvqbWVepP7P9K1uC/s3Y7Rg8zsz7b85SMyob5AZ63/geya8zlRqEmaJG0N5LMC+BBo2BgPw9Jt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fdwRbJZRKV0dysgjoqO58HYRJDALUZCooAsOTw3TKiCTPojSySl2xfNU6Znmw1hJMWO8rUzwcvOjSBciSsbnQVE2iO3EhAI975CTSNbicvVFadgXFCDFiwIvZFIwTe60vEObaTgAxgR4TQrjz9gld2gvytkt2iU4pAobGFHbBNLDu0GBLLVkIcdGxmUA4TutA== 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: Mg0ca+X11KeGUBnB15Ib13yZzC14HKLu+UByrvaVJvO3NsZXdHWEfZMu/WW6SE4DGfxJdsd3FXB4p/YCrEZKzlfOmonWlP4HYOIHv2BZu+0r6X529f9hkGL889XTHMHsKGSMTWKCkL5W+bFNe6zze8l9ZhZ4BjDqUvk5LyYbLVwbBcKqbr9Qi9zNNsjXFQRQ33IzIKOZBVIUli71rFpSKK6zcdqgCxSiQfhhKgmQewVm0Mc+2rcDV6dfYbzWr8Ytim71Nl1pBSYeek+VLCO8pAnoWxBc57u6S7SRY2kQhLe+cd9ClTUOgmEWQawQY+T4WQYRJ4ZrHSoeDvwKbhIi377boc9FxzQTxLzn3avipYTV/oyD0LQeWiUi3BirUJj9jRbuBLBC7VSsZj2B2Qq/RGQxIv4zmI3NmbbtIwHdjrGqgHkl7QpfRGcMd4fQpFNWY09urZxEfcnT+8nDWbJpGXrEYMt5Y+a70IWxTWfEVS5WO+FJR/ppRoEn0nt4OKpYxRehvx//vI8VBExxgx/fG6e41UPTdCt2B1c+AsVIbTWvDjC7mG4qxmp0o8QUHv+W3F//bfzARc1RJVDJAwH4bz/8OfL1lLRcOtSrghZGmXalCMFDd+o5yES0AzkWTO2DUlvPPuLVvPxCeRoNXiDm1iRxJ5PgvCSeItzO07u3uMoizeBzOfHEbzTTZNOEmmFSAssy4su+S01nTYVK2/Hde62zmJIffynEhNW+7O9yMCOIbRd5begqCmNenVi3EFG8ENkitJAVPNlFVHwklY0titVDmFkyNuJR9qSbSapCCkzLXkzWO3pfBV+cPi4QLcUlif3CYtVkCPu5D2esFjQhwOga9MMuN0wKwrcDKmP57jgjNz5edoJ7PlBpQ/fskow8vIl1xjEO9t1sz/5/n/C85vpc/AywXSRu+prA6Xz3SQ3EmmjduIC0P/RLIbWp4/Sikf0BR1tAzYHi/+JsZ8VoshP5Aa1WB9iIqxE1zeGAVqjci7ZwHsax9DrvwlFrIAWDD7BgbU+gACHSzNJtIPDIAkSb//5GVI6ljqswOL+wjUg/x3JAtsCV89WSUWgl8NHoAzd3WlLBXsp5dxu+fj+ToU6AXKOjNZvFrwV+HPcIRjlOCjOR6szQd13WMhxIWHKoqgUQ4hdRaiHSqoZp+RJ6LQD3nKeVteSmEIh9WaAVK2eNa+T8p+VCyMOVEad8w2swJe2y+0oM0xXv1KTlArhiHpQSN+J6Adusp9L9BjxBIyeCVq2pnSJHUMLY1eNhtIhJZwaURVVNV43EAKN/LEps/zgfyDcDvWt+xcqsg8DK61eSIIEKDCIV9gOop3VZ2WNuuD1BrMxZNJOlnStCoWFagao9SZWTic1WJmtByC2TAqBFTgHSZnHcFmRMj5CA5eL4I0Y1J1oL1k9Gv/N9QMIHdw1kE+GxMVdboqpW2KndRVnKMgZoR1I4zTnoZehr5rCoi0mCZNX118IUlRfDYOkIUb45WfdATyMtbaSAwWDdVzWEmyYNeThJsQmainhANFr0c7tKqVUJ5/k+HBeo0bFgUMmKroEja+hjsGA0VOQvjzjCZgYqKf98a1OJk/sxB+YuZFfECPADVOJQYTHu93hcXXqOahIcKqdES6eQWqcg/X4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d920519b-067f-43ec-0cdd-08dcb4e71030 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:39:28.2671 (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: S6xFSgb/kpOKddD0S9uUXgZilJ6LJEyacfZEY1hM9nzYYb8MSTJhjYe3EFZDyvlSopJ4MVnWEzFFb1I5knCKna8ji7PRbdSw5ZzbVh9k5lDvYIdOcpEznqKsO/po9NWw X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 Message-ID-Hash: 737D27RHIN6OW24KLZM4LF73LI4QUFVS X-Message-ID-Hash: 737D27RHIN6OW24KLZM4LF73LI4QUFVS 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/sti/sti_uniperif.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/sti/sti_uniperif.c b/sound/soc/sti/sti_uniperif.c index ba824f14a39cf..75520b8827ca1 100644 --- a/sound/soc/sti/sti_uniperif.c +++ b/sound/soc/sti/sti_uniperif.c @@ -337,7 +337,7 @@ static int sti_uniperiph_resume(struct snd_soc_component *component) struct uniperif *uni = priv->dai_data.uni; int ret; - if (priv->dai_data.stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(priv->dai_data.stream)) { ret = uni_player_resume(uni); if (ret) return ret; @@ -358,7 +358,7 @@ static int sti_uniperiph_dai_probe(struct snd_soc_dai *dai) struct sti_uniperiph_dai *dai_data = &priv->dai_data; /* DMA settings*/ - if (priv->dai_data.stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(priv->dai_data.stream)) snd_soc_dai_init_dma_data(dai, &dai_data->dma_data, NULL); else snd_soc_dai_init_dma_data(dai, NULL, &dai_data->dma_data); @@ -440,7 +440,7 @@ static int sti_uniperiph_cpu_dai_of(struct device_node *node, dai_data->uni = uni; dai_data->stream = dev_data->stream; - if (priv->dai_data.stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(priv->dai_data.stream)) { ret = uni_player_init(priv->pdev, uni); stream = &dai->playback; } else { From patchwork Mon Aug 5 00:39:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816785 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 DCD35C3DA7F for ; Mon, 5 Aug 2024 00:55:18 +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 DD79849F7; Mon, 5 Aug 2024 02:52:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DD79849F7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819165; bh=MrHl/wFqz544WiV37Y+wTgj5w019RkGulZzw7fG22+0=; 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=hFTWT/pn0KG6Xb2lAPXupzsyUxzA15eIY2GlmHbnaR7xRRe90gGG7GQ35eYs66ujO +mZbmVIvTfbCYgtNORkYZvEcFaOsn6jaoJHm6ICwi8rmk0RtlfEite1lndfvGRG64b 5otToiEjBN12wAer5IB7iyvm0CPuP1V0llX8GRGU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6B52EF89A1B; Mon, 5 Aug 2024 02:40:15 +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 2F0F2F89755; Mon, 5 Aug 2024 02:40:15 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 963E0F805D9; Mon, 5 Aug 2024 02:39:50 +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 CA3DEF8962F for ; Mon, 5 Aug 2024 02:39:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CA3DEF8962F 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=aaJOL9OU ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YLBswOE90iVRHAlWDmB9BFKK33L0ktmCRWVMt7u/u8P41lZD2Uy/uNH8EZ36iHJi0ZTsTuqaK0McR4Oi7mY4SvPSGDL9B3crzt9+qp7P3yA8v9sJ/amGRliYhDEbB3t6hB8aWVSOTsEcSsH13wxUfeIvMpg85BK1EvNN4AWkKmaUKNoJ7Cs5+yF8nssbQJXCXBVNw6MYR4IQNyvJYgxC8N15+5ueWFhnF9/OBUgaPFRJsmIByOqnDbJfbt2ATmJIm3GXq4mzLk13P+0fxEIg5iDzBSZ3CflD9gx6EZrCeh2tC4Rm9QiJZKFE8gMiyxs/AaIcqdtpdjs8w6J/SGsEyg== 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=Wzvkin/sh7n7ol9McnO397vFmn+9c0d3PNkl1UBzJNk=; b=Xy69s3/SWY+etRzcM2GwWGv7D1yKyEEzmAtcd1miJ1kJcW3L+LbMb4aHo1Thn9wwhPLV37QVtXIQF6gk9rwUXNDB735m9oS6VvaGKwSoFPAbI/cM3IDgGEvEKm0/e7C3+EGzUSm6r4TMw7+51B5dlOXRvlU6MK5ovimDoUFjsMio0u0fTW4ASje6CxrZWHCWbONN0l0cPr/tsmpBjTU8nbueW2/KTA6+XOekd7Bz1gc7rIIh6DM3AnbBphNwGZPwY4MiDnRkPMlRG0qnm5ITzMTmAKc1ugf0Irm0RH+iBeFKceOwgngVnYU636hdDWJlZSFSWaQVH7pc0GbgQeJ7Ig== 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=Wzvkin/sh7n7ol9McnO397vFmn+9c0d3PNkl1UBzJNk=; b=aaJOL9OUaL44qTpoBcfrfuLYbE67lKmQs7djpJCkw36fErAYHPSnlD3s5ZPDyD4mP5hFrCX078O/T1XnJwxWoE2Da/c+EEercws1F4H79sqLcpCwYkuXLpOSn0Mbl8ahxtws5gmcshGDjoFSH28CR4MnNWo6/K7Y+1bv3zxUYo4= 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:39:32 +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:39:32 +0000 Message-ID: <87zfpryf97.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 053/113] ASoC: stm: 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:39:32 +0000 X-ClientProxiedBy: TYCP301CA0002.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:386::20) 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: 7053ef70-af0f-4dd2-7315-08dcb4e712d7 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: luXP+S75Ltxqs85jYbuywxzRaQVTAR3e/z10gf5bgxwolhfvrl+h/tLw1FG2y2sDeRQJOPEr/NyZ/D5KO/+jwESF5D3TOUtnaHBDpRC1vk1gmlBSN4BJNdqOhZKxURB9JNsGGWGp8K5ZrttCc09YJINhBUPcRH0QsyfQC1Pkrb76OpJi+RwVXqJemep6jc07zeGbXx1fWtr2w147vVwX/w1Rl3Y2NrY/wdUEP8yL7dNf7CDq898A3bDdz4pdySU7yTTIIQsHaZu0/FKPLJlBKoMYfgsUgTE2jIe1DTGpoG2DIE/oPSb+Njjn/ccGVtllKT3QWxQbc07D1Mces91vtw6lAysN2Nm8KKfSn32xAg6oFqmVFibftCKZXaxHgK7bDbGGlJergtvfrqfKWEJSVvtzdIzkf/zuBYYmuIA4qh+dKkvGtcC6wQ8ZHHzBRMHpwd1rOJjPBEFflRLzQrJBoSOZNR8jY9hCsc5buDY1LDuQpqq7s0FW61Vl/bFEQU/dYe7dA4Vmze1hu21N92JK8pUkwX96col69dS7utCbcu/0496dN+utvxggHLJ4DcN+xIs19kVY3OXCQh62aBZ0srqG9o8cfNXjwuJjjRChdpzz072r7o8UuN+vwt2wegbBrE0ZfCw3zMAHT58f9osyGUS5D/yGk0NTOd0sstVWfAfgaOQHNLPEnLLK8/CuAGTyKDuUR2YpjheHmyt6IY3/J7yKC0Md6x/1aLjSqYxQ9QcdhO/lqbwjxx+lAHdiltM3YUHMYpcIwMcN9PfvmZJ4Z4pcSqJ/wDkS8eN/hRHoZX3rRSrcp7QjV85WH0oMXPoFopEuz+LEEtRVpLVKwiHfzAes464F/tAyezxb0tiNbmgF28H005LD1+XaPTEZ7l+fFIpSAZpydj69AkCwuaVCDFc8e2BLtdJ6Jar1nV4j19hiJIGXsbWnPfpIgnXW5rMdBa8VXl8C9ro1Ticqxc2p9ducUugZPgIb2JFlT+fJQAX6lI0IjRTZDTIvif/W4f26jLx4MvPNryqbRnTEF6Tmfyv7uzTEajetiSMbCT6xIDa334uQkn6RNWhV6AajFphkrFHKXHtz1gaHWkSR/9l85FYW97dYNV2pWIjfu+uWTutZYUELsXpPYBkIuUgEBsjt3EohlS0b59W6dsITTvFSlGNgU5ZDQiGd+GNNenA6+DmJA5A49FYCNm/BuJCVBGH5OyzI/ucdVwr+RQ+WQzmTyLSRk1OKoQLvmbA650fb1/1x4831Wh/Q6XQAZPc+RELtTsx5nxFJLfneVVRSJFVSxOHjmggYg/cus2ob+UqoXwUET5JzCTsBfXndQ5YBJ2JNwuVH6Ny/g998Y96jh3idqpatRKuDN0eEsXRqVyIR8gFiUm+UkaTiOoZ2Fg1Ruqzjlj28bXSi5MT5Q4s2Eq657A== 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: D/TofCWSOdLuqp4BkB2mKhx1PZWXquU64v7bf5s/CTjBwfjYf7JUXL1TlonjyFTDSibBCbp84z4oUk8OC4uv5W8IZqVmx2onredWr4g94EUedtl9xROPzd7FZq2WRNA+mUzUSSxTSeZXw388nQpFD1EZ9sKcbXjx0l/AcT8/r6vxSv2Tp4Beiap5cekOJ08Ke4PSitWTnOqikEVTJSqxd0EeenByqfZqUxVFAA2fcL8CYm4WYIztAR5TXAe65CLihC8jGDqsl65MpybWflVhbGIFM72EXB50y2jawQr4yMPjynBM0BMaoLpqggnUpsbLbFh/Oriu8DUrVIcTZ3Z/34r4dYN/waYrGGbtUYkG7MMl7oA5g+LqPRnnlQOFjMs6cfbkL3I36xW2vOQCH+0SH8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4026/Ec2fOSArLgZXeu60+PC7zlpmSfYCHXJdJyYnq4ZdVvtQ83FUdKroPr7PfIBZq7wf5ytI+b9TwK8B8T4tk7Vj+Mjcv5vgWpoZBO6TAc/FDYeaiYNkZ86N28f1TeU3tdZGjnOEFNttSc9y0xyuAeclE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7053ef70-af0f-4dd2-7315-08dcb4e712d7 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:39:32.7240 (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: ApiAjgKGyvHGMt3T9HQ9egOuhupBy405GO/FUdK4Y1pV9MH2YQWeIW5Szjo3Nw/4J9wxRINz1/8GvXZimuzdtjc203qDdrZgdTxQbREJiLAFtDCLKoMOUI2Izw+M8Pmp X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 Message-ID-Hash: GPX2YZU5HGEGLGHCTHVMR4OA3QRUQPH7 X-Message-ID-Hash: GPX2YZU5HGEGLGHCTHVMR4OA3QRUQPH7 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/stm/stm32_i2s.c | 2 +- sound/soc/stm/stm32_sai_sub.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c index a96aa308681a2..d6654fc9f1a7c 100644 --- a/sound/soc/stm/stm32_i2s.c +++ b/sound/soc/stm/stm32_i2s.c @@ -813,7 +813,7 @@ static int stm32_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *cpu_dai) { struct stm32_i2s_data *i2s = snd_soc_dai_get_drvdata(cpu_dai); - bool playback_flg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool playback_flg = snd_pcm_is_playback(substream); u32 cfg1_mask, ier; int ret; diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c index ad2492efb1cdc..ff8d98e574f2b 100644 --- a/sound/soc/stm/stm32_sai_sub.c +++ b/sound/soc/stm/stm32_sai_sub.c @@ -38,8 +38,8 @@ #define STM_SAI_DAI_NAME_SIZE 15 -#define STM_SAI_IS_PLAYBACK(ip) ((ip)->dir == SNDRV_PCM_STREAM_PLAYBACK) -#define STM_SAI_IS_CAPTURE(ip) ((ip)->dir == SNDRV_PCM_STREAM_CAPTURE) +#define STM_SAI_IS_PLAYBACK(ip) snd_pcm_is_playback((ip)->dir) +#define STM_SAI_IS_CAPTURE(ip) snd_pcm_is_capture((ip)->dir) #define STM_SAI_A_ID 0x0 #define STM_SAI_B_ID 0x1 @@ -1406,7 +1406,7 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev, sai->spdif = false; if (of_property_present(np, "st,iec60958")) { if (!STM_SAI_HAS_SPDIF(sai) || - sai->dir == SNDRV_PCM_STREAM_CAPTURE) { + STM_SAI_IS_CAPTURE(sai)) { dev_err(&pdev->dev, "S/PDIF IEC60958 not supported\n"); return -EINVAL; } From patchwork Mon Aug 5 00:39:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816786 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 8DE7DC3DA64 for ; Mon, 5 Aug 2024 00:54:45 +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 0E3F238FA; Mon, 5 Aug 2024 02:52:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0E3F238FA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819133; bh=kdSk6DECpGoT28xkw/OJQtgQ0+/lr/sU50a469vO0HU=; 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=Re9fuqHfBch41dtG+IlSn388wkNAL/hnguyyPhmMdI/YBWyFQTfQ6IeK+1iE+3Ep0 xqd3Mtt3kiW7CQ3RIZd69eMh8TpQb/1ONwEMmk2Yc6wrRLo+6I3Rb9fwKwO66KqyTg 7wIpWJyKAVWR0iP/SKB1GKL4gKNfPZzXFs9Apgtk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6A36EF89A17; Mon, 5 Aug 2024 02:40:24 +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 774AEF89AA5; Mon, 5 Aug 2024 02:40:23 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4535DF898C2; Mon, 5 Aug 2024 02:39:57 +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 F0EF3F8994A for ; Mon, 5 Aug 2024 02:39:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F0EF3F8994A 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=Op4tWC7W ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=R4PUV134LkWTxz0dDweF1xKaL8laVMfnRCaX7BkHNBEIFY/XUmIrVW82lHzwm7l9G3H5NJVU1gSLlCUVd7y/9WEBN8lRU1MSzEdZpHXRat+naiRbmuciTCbEM+Xxb0o+CUrtIfumenMnfZtdyiUE6S0g0Au9OnYonIj687O7gQLfznziKRjz1qu+21WyHoStsqljKLxXB8z0PamlYKzj66CkNZL/8oAMsZxr+8OtCYmV31nrv0JLfJWGOLGE0wHbDdbdl1qHbCVwDvQmwkoLos9ISctZI46aHkx5qzhxVVGcYqW7508xpHZ9D7MG+Jb5Aa61aqQdIrshfZSXrJz6Mw== 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=Sli65yhRKxn/i96KFCrnXlOcfpmE+B1fCKXllIuLv64=; b=bb4s11eca7b38Qo7EeDf3uSUDPaopnQAU7QUODoiz0CSQCudtIoburnzQwwTp4nJPqXLdiH31j+l2D2o92/HcMITD0QEywoeGWwbkgwyooE6uhx3fiIH0fQ8FY8Yhw//NqPXfOpQ/kvblnEihbGwlLO8bIYeow7U8xTkOi9Kc8GY3MKuZVJVTveEFw1XdR/Gujw7zmwTwRa6uxtZPiaQbESVduLFOG2Al5ETb+Z6r5tOBRjbXTtgOgowRMJfTqbZUabfYvnZUTmyy76ddY49SHCR/sagxvbKyfcp8Ad8Ozv2/meOA2uPjKybl/mj30pYa1ow95InxPbNpC9ehIcqKA== 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=Sli65yhRKxn/i96KFCrnXlOcfpmE+B1fCKXllIuLv64=; b=Op4tWC7WEG0VgG691e1hvoEc4LwFxvvitU/X4c4UcOaP9XBRitVAdkkxfHnAjmgEkbnQHwI+Lb5tXsGr5gQvKUjpYH9bqWYqF724vG6Q9KKr7beWfKFHnrEZh6grgI2IULVQMXNX7YWrNH/KKbT2T2SmH+x4O2i6v8UMq+cgVWg= 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:39:37 +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:39:37 +0000 Message-ID: <87y15byf93.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 054/113] ASoC: sof: 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:39:37 +0000 X-ClientProxiedBy: TYBP286CA0029.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:10a::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: 24dcd254-428b-4c4b-4fc6-08dcb4e71592 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: vpvylBj3mw5GyiCDEb/KByALcaMzwDkvSyQLcGvZpVPe0YEtsm8/Ro0T1fpDbkvqrl6X3ZJyGM7eyJSdmtjl5k4mFI868/BFmmI/tyQya9vdYaguG4qHXRdLIPhlul8e44QdUWpT1CU1gUUKXESIs2ncAGSKnZblOrMd6csXa8Uc/hXy60YXfaL/yEDt8H9X5NSnUlEM8+CnI2iTj/kd4Kz4cEpwU2flMYV/pIrDiZZTLmzILVI3w4FjyDe90a2j1mm3V9+SQ7VATzlsE6Y5L5218J5sWK9nqBCTW96A8U4m/BWCd6yMuDfu7nFwotBYz27TBD8+6bgzK0MtRg9S+Z8rZpHYLf6RcyBxeRKMAhoTypZC0P4swq6vSEYZMEWfdfVKmFfgJSz0RyFSl3DsG1uvztV5uRYXz2Y3I8nf7f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01MB10914.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: SzHDgS+4r6HEHV/LksvbHM4Y/josFOxL4qAVwUkqYyPGPg5w3gc94kZSmDW3b4fVw4jXwjBnXRjUQjwGSsjTogJcz/6SEZIjcVqDyDBIlucmQZdecLttVupyrxqg9CN8vnZ2QNTXvVJYOpCzjEieLiXUxIY1JN4nLOnTuH5522I6wjxv5eEujBC4Z7gpz1Avk1TGw9fyubN0x6NDLbkmCm8tyZyVSnUpqxrqnJmYrhMl4PYjO34OZ98aIUbZzSrt4kZ318ITT9Nu3ej97QuKVP09WdHd6lbBfGVXN34oHTwpGleUrUcuIDKvOlkF+fxyQuFUTCJX3onR8sP0VgSAdF9+aVtE2W6YKat7GK/Ygml0XPAsEXZQU+zDBOD1vgwTW0Ww75BABFbT9luZSuSUBS4X2y8bleyKmNErqW0XJqlp55YC9LnYcnsKNhmBDetpPkWtmn0W60DhoJNLW6kCFqeJ8HyeI0tSZZpplfYA4RjWKplTBJTFUKL3UBC9wyKvGgMqZJYCxoEA72Q7HOVU5tmq697WFbxYGlTwOAqFwJjEUhxznth7n0eGsgLJKvKi2e9kyFsRyTjmjPlZd64a8XYLGW5xGQN4Zh7Cec9R4i4mpqWoR69xp9mXlcNOOVme2sBgAarms9ikO5/2CQnSif+Lxvg3gfAY9jTkZsbicGTrJZfmf+aodsB6WvFdmv14NfJCZ68U3xD9LdGjfogUMWFIT2L1cPpE8JCriJ9iDem2XBOtzA9XECXNx70D6A1aAQ1zoSC3UytJQJz2fSNt+yP9cEQ1nYAWvk2URTONuBkVsJtKvAJEbozyv2Dn8unwUwqS3wO6vXMDmMWXXEu6YRrTFIgpuVB5Uxa2007/WRyeb5EJoz9aKEfS8eec+tXG+zkPIbBoaiuQv6uicvTMxm5FHxoeKIWN859hgvmmphGQMnH9D3Zkuy72tSiUtV1+T/RuT54cxu6ZETJvkAZiZ+cg+ZLGNrVDDRMvaB4VoevuIMfEcZwXYOb89lAsEjjv8teutYuzja1Pwl1ROv7zXID4KabeuC8s+uU9pAQl15kz0bbDrQV7aOxU7Vs8WovPOoTX+xHhaps5Sh3R3IxYmv3YG7J1X7obMiMtsBFrBQU3SALPo8wHnLmHR3frq/lmaTvko1IWSIJOwcF7JFdizcdB09mcsq7H41zfd9BQGRLXJra0aEopMY2rKRblrhWSd21SSjUxa281kYSAtw8yH7lbCAKfEz11OC/qj0j3ouC4LEooaVOyqb1CE+3GQGseG94mlI6obH1fidBQTDvKoy02BppUShU83xCRv0JyL3KTpgq4BNPZ2PFAruYWm7rLVB2+Snnv1Ph6mSp66sDc5Xdg7o1ctxfLluIMfJYMWpekJQplrgbxQznELfWBfE4uM2+0isjZfCiZGA/vW29z4MYStSmv87zTPcKFRDlwyTxYCXLgi6U/B1cQAfgQy99jlZdnpCA9XTTNxfXb2LhK6fQImTrrjUQZgdSDZNds+nJFuo54WpNF3pGV5ZvIYEsWlyozzIJPv/++alm8iUD1QnInmri7GLEBQb89XU+zznVmuZKAA4qJ/iyPpqN064BDM3h71kupraqRny44ZI5w5HpNCOhiacRWY/kqS4gyoqk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 24dcd254-428b-4c4b-4fc6-08dcb4e71592 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:39:37.3809 (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: kf+WuqxhOad8P5aB+wKuGtz+NR/7F160Fhum98Vb34u4hD69AYtL2U7sEOTxyNvp3c+ivFYxpkex9dp851B3L/F5VrNvpBn6RYk2PBvs19Ij1+O3RjB3CsdqoLYYAFlY X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 Message-ID-Hash: 5NO2YUWNSYDTTHBQRKGHTQO7HLTGKNG3 X-Message-ID-Hash: 5NO2YUWNSYDTTHBQRKGHTQO7HLTGKNG3 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/sof/ipc4-pcm.c | 6 +++--- sound/soc/sof/ipc4-topology.c | 10 +++++----- sound/soc/sof/sof-audio.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sound/soc/sof/ipc4-pcm.c b/sound/soc/sof/ipc4-pcm.c index 4df2be3d39eba..52e6983acba64 100644 --- a/sound/soc/sof/ipc4-pcm.c +++ b/sound/soc/sof/ipc4-pcm.c @@ -345,7 +345,7 @@ static int sof_ipc4_chain_dma_trigger(struct snd_sof_dev *sdev, msg.extension |= pipeline->msg.extension; } - if (direction == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(direction)) { /* * For ChainDMA the DMA ids are unique with the following mapping: * playback: 0 - (num_playback_streams - 1) @@ -681,7 +681,7 @@ static int sof_ipc4_pcm_dai_link_fixup(struct snd_soc_pcm_runtime *rtd, if (pipeline->use_chain_dma) return 0; - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { if (sof_ipc4_copier_is_single_bitdepth(sdev, available_fmt->output_pin_fmts, available_fmt->num_output_formats)) { @@ -1044,7 +1044,7 @@ static int sof_ipc4_pcm_pointer(struct snd_soc_component *component, /* Wrap the dai counter at the boundary where the host counter wraps */ div64_u64_rem(dai_cnt, time_info->boundary, &dai_cnt); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { head_cnt = host_cnt; tail_cnt = dai_cnt; } else { diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c index 87be7f16e8c2b..ce14acb6770eb 100644 --- a/sound/soc/sof/ipc4-topology.c +++ b/sound/soc/sof/ipc4-topology.c @@ -511,7 +511,7 @@ static int sof_ipc4_widget_setup_pcm(struct snd_sof_widget *swidget) if (ret) goto free_available_fmt; - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { struct snd_sof_pcm_stream *sps = &spcm->stream[dir]; sof_update_ipc_object(scomp, &sps->dsp_max_burst_size_in_ms, @@ -1668,7 +1668,7 @@ sof_ipc4_prepare_dai_copier(struct snd_sof_dev *sdev, struct snd_sof_dai *dai, * of the RATE, CHANNELS, bit depth is static among the formats then * narrow the params to only allow that specific parameter value. */ - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { pin_fmts = available_fmt->output_pin_fmts; num_pin_fmts = available_fmt->num_output_formats; } else { @@ -1783,7 +1783,7 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget, * Use the input_pin_fmts to match pcm params for playback and the output_pin_fmts * for capture. */ - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) ref_params = *fe_params; else ref_params = *pipeline_params; @@ -1828,7 +1828,7 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget, * For playback the pipeline_params needs to be used to find the * input configuration of the copier. */ - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) ref_params = *pipeline_params; break; @@ -2225,7 +2225,7 @@ static int sof_ipc4_prepare_src_module(struct snd_sof_widget *swidget, * For playback, the SRC sink rate will be configured based on the requested output * format, which is restricted to only deal with DAI's with a single format for now. */ - if (dir == SNDRV_PCM_STREAM_PLAYBACK && available_fmt->num_output_formats > 1) { + if (snd_pcm_is_playback(dir) && available_fmt->num_output_formats > 1) { dev_err(sdev->dev, "Invalid number of output formats: %d for SRC %s\n", available_fmt->num_output_formats, swidget->widget->name); return -EINVAL; diff --git a/sound/soc/sof/sof-audio.c b/sound/soc/sof/sof-audio.c index 9a52781bf8d8b..9ac03dc5a24d4 100644 --- a/sound/soc/sof/sof-audio.c +++ b/sound/soc/sof/sof-audio.c @@ -308,7 +308,7 @@ static int sof_setup_pipeline_connections(struct snd_sof_dev *sdev, * purpose of connecting a pipeline from a host to a DAI in order to receive the DAPM * events. But they are not handled by the firmware. So ignore them. */ - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { for_each_dapm_widgets(list, i, widget) { if (!widget->dobj.private) continue; @@ -623,11 +623,11 @@ sof_walk_widgets_in_order(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm, continue; /* starting widget for playback is AIF type */ - if (dir == SNDRV_PCM_STREAM_PLAYBACK && widget->id != snd_soc_dapm_aif_in) + if (snd_pcm_is_playback(dir) && widget->id != snd_soc_dapm_aif_in) continue; /* starting widget for capture is DAI type */ - if (dir == SNDRV_PCM_STREAM_CAPTURE && widget->id != snd_soc_dapm_dai_out) + if (snd_pcm_is_capture(dir) && widget->id != snd_soc_dapm_dai_out) continue; switch (op) { @@ -950,7 +950,7 @@ snd_sof_find_swidget_sname(struct snd_soc_component *scomp, struct snd_sof_widget *swidget; enum snd_soc_dapm_type type; - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) type = snd_soc_dapm_aif_in; else type = snd_soc_dapm_aif_out; From patchwork Mon Aug 5 00:39:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817101 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 4EB65C3DA64 for ; Mon, 5 Aug 2024 00:55:57 +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 58E024B85; Mon, 5 Aug 2024 02:53:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 58E024B85 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819198; bh=ikIGSsWHUrXUZKIgtKDkxZAyIvpk7G63R76DSix7veQ=; 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=bYeueax9bLW7xp8k1NFkpcqNJ2J0FByxCmNlrNSCr+VXB1UjVbSHiTmCz3YplxZSa H5rqtrD9VYggAQyC9uJTz47Z3WbaCjyvaGLRqKSLtC9PdyUrFhN14H/NwqxqsbojOS W43AF7BABo5MUxEZ5YEPYuz1EQ3HSx9v2fTamBac= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2A64DF89A4A; Mon, 5 Aug 2024 02:40:18 +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 52595F89A5F; Mon, 5 Aug 2024 02:40:17 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 39D4EF8991E; Mon, 5 Aug 2024 02:40:00 +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 AA6F4F89997 for ; Mon, 5 Aug 2024 02:39:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AA6F4F89997 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=TyPhwEea ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tGb77omZaOAdTS6e0P24Xu0ifwFpv7gAEU6sYJZ/LaN22d1FBEmKWPmm7UoGbAMS7QXm/Rtzxro6qN0VlTQWCQ125Iwqz+63z0LqSJ1nyNS0ZU6ybeyK7+k4Yx+QZPJIn9Gr0R3/1+Fd5GoD82LGcEffDFWDzKA24Y1V675RS8KFRK+YZFZLHuSmvD8DIZortli6ZrBSuDKnmfa/x5/sAy5n5wKIJbO6iuOqvNt9V6Q1lIpYNIut0nbsiUUCkfo/SEWL5PpfK6hxMs96Imtwl9OsQ+bHyRPTXRL7YHUXvMNxdWOe1LNNH1awgyWf0dIEOm81NrrWZKK3IeRN9wX02Q== 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=uk3WOoxMmhZvyRmuJ4vLaw+rmnTyhnPOx5ac3Ip81d0=; b=TYE+tr421m7/OR8O1Osfu/529I2UNtbW9bfTsazzww2nizXizv6LVvz+5x1eMFOFRjQyoC3fPreilH03r+PRQn/+puroKUyd/z8S8NVncuNtjqbxKOnc0crCSTDvWQ4Pc12IcUXHW7mhYlcZPztp16sQb9Q84++RuAslDtGKr1krycxeqCCTQ6qMycS+islrKeShuVcsoqeuBzsO/WHk3MVhq/oT/rh19xulU7F3iaB46D/SiTWLgq9u67EqRcaL7mEa72KCDUp/qlAjKlZzEYv3Rpe3/J00Lb6wWjIBxqHN/TUOefWtrIOAw2B0fSUvQzlCbtV3JWTfzk5q0rOjAg== 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=uk3WOoxMmhZvyRmuJ4vLaw+rmnTyhnPOx5ac3Ip81d0=; b=TyPhwEeapo8ByK5FoHpwcMp1F3XrWaSKL0a+MTZgy2sy0tFb6mO9CnRnaXjd+MQ0NN41A8TPVBWBbPNSoiD1srhx+Az2s94WPI0GrUCd9jZk/hUMYsnJpiM6U8eOccsLG0uPj5a+d1G5JlAWJyDj1TOzvvjIkpHg4JwgAQ0+0tU= 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:39:42 +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:39:42 +0000 Message-ID: <87wmkvyf8y.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 055/113] ASoC: sof: 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:39:42 +0000 X-ClientProxiedBy: TYCPR01CA0131.jpnprd01.prod.outlook.com (2603:1096:400:26d::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_|OSZPR01MB9459:EE_ X-MS-Office365-Filtering-Correlation-Id: 7bf56b5f-c843-4b2a-3b2b-08dcb4e71877 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: ksPoa5Q+37OUgq751yPsNFl0czYHU9LURGPX/fwDqSwvdmIRvCJUe0x/Vm6cjoP49d3T9HddRAcc8fgpaxA4flj+towb1G2a6scNPj6azHTf1RVwY8QxR6tp3HRzRzqYX4YDoK0tYPPi3lL5fTVn6JqHO4WGAExQ3J66KoDQ7JtVP/V8l5LFRinQK9Lj0LVuL4zWByNWz5pnGDihLGu4jJVdETkDBXqkYlAjN+QyMDKiV99168qFcoTYF+29NleIAfoX7BZEFYPGHaLWbU9I9ZgptzLna+Ub7SnlAsKyrPnDZXpkwNY0m9cmWwLRg7fH6A9yaKverTfsM38LIonCTbF+B+6PyuLfR8DKQo/M1gx6QAU/+fKYZt8O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-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: NmA7arPcgsSON0Po1fBpzkTBxdELEGX+3SQM2fJSl0VG5CMXnrZ7mtqeBr8y+zOlOVXqzETT8DncBiOhDceMXcnavVSz1wfTfmbaNKNrqAnZndlrfBR5NK7hm8ScR1ltH1Y4bJnqWs36o02n+FPSjD5DDLvnkgjVbEgBpwidnZL2sPvp/P0q6cONLg9Xu7kHEOM2IzMqvf5rojI1lNd4DKG4AJtsdigeJFCZbWHP0VWJtmL1ZwfvaUX3KD43wqCUozwotxJ7vcT44LSrFyTKMueYFE1YbYoygKP/Q7tJxVtO8EXaVYyn/UtMc75HLEjqmfNE21adS0MeMFtjTSrQMM4f3qTp/jqDzFjoSmhMrzaq+GsJPzdIEkhYU13gFYb4iGPrdZcTSLkrylOcbAzcuB3RA0oiE88V/igFsNFSzjoMkqSAdHNBa0BT8U68EPg1sK3wqVa7jPh04BUuWfWZRC8SBSJQ52EdtV7AEsbVGRViYqL9NFw+sQLzYX1o1yiTJbY3d97n38HoOPve1ionpMrR+VYkSGIKd43Owe4ZKfb+8Ki3VSkvUv2ANZzpP1D3l1BZy9P1sAN7HGwKEMuxs4AKTChYTXlapL1IcYLRZLDp6SHRFTzcqOKbsXWzCWITMO72S+KEgvm/3VHy0b3NlbSNonkG8IV3a8pbs7ap++9fNu7dX7+jCowqk4Nf3wJHU9CsjjN6hEl2NaJlgCCLhvUmTcblFQLLC3QZcCfOtB3LSIzFiXxWjldsOBJwM5Zvu9hbXsbFTXNyVT7HULasHuVHlYpxkw+UweJYxB/QcpMaFu3Tsh/UEloVOc+9P6+VIeI7RwYYM+LE3+0BJ3qZUyOoprSlFESgO5vROMIn7O0sFW73jhvt5RY2xFqyQ/e/6aOvVsLLpP5Pho19L/bS/4SxLSWSATN/k+UINKYo82ZZyTR5bYASG3MPFaQY9GZmWW8XjkDaTY6hY4jyC4REy/I/doD5PL/il3/avbAZogFgKnxblWXnSD5JbzEVO7VA5M/VvGjKMPweYxA52f6x2hG471E5tScOLHnyxT0XzPRqBSutOEjnnDFb7XXR3p0HRQhqh/CCXmwvPtUdpa8FSOTlN2cMh4yUWwgsc2yT3XlwhYrWWrxAjDi7TlwzGzms/hraRzZ71At1d+FBGyEuSlAQ0kFNklQi1qcPG/q9H4uK7blKfkPVu00v3WP4Ao6De7O1KYa1ESqjuIANOiD4qGiNXy2+L7s7sosVZRtDTQQ3YluRVmBIoCrtXhf2l9rQBdc/itMBpYZhpAC6Kn0RQLOwqa1Nbvs/H/xiMatXVfKGYev3wal3ILOoxvdP1fEpsXvRs1S0UNJJ0b7cgHr5Ebu79HknsUzQQOo+tKEIE8CL3oNgBbTUY/jmIK+qMuPFxRpBclABl9Kjms64raqJ7HciguDoEAxuMCKHG1TdJi2nQphkbW5bkTRL1NqxCfmOhwQee/rB1QfeeP3dSQ6CwpvPcDFlwet6d0u2R53Llm9utGeBIfzbENa/5OyW+Yz3lr89/WkiDI8ul/ClW8A4tm14X/30EX83xmQcMrf0cj+K3CkqjT0z1KbHPDQNYBmbIXxXZzr8vUCjlV5yviuracWw5V/t5cC1W76wLeyK8MU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7bf56b5f-c843-4b2a-3b2b-08dcb4e71877 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:39:42.1564 (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: /ggq3RH9u9vsqUx5EpIud7yuJ0+fb84/68MUGxwiBhPgasUioj+yHhD1YMFflqj+JusmZ2WXjVlKx2sNuEugk+AC7zJ1WpGHyItu+HYmXypfQtLqIk1fIBcn29qrjZV6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 Message-ID-Hash: PRKLTNGRYFRZTOREHRW4UVSYCOV5BTBE X-Message-ID-Hash: PRKLTNGRYFRZTOREHRW4UVSYCOV5BTBE 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/sof/intel/hda-dai-ops.c | 2 +- sound/soc/sof/intel/hda-dai.c | 4 ++-- sound/soc/sof/intel/hda-dsp.c | 2 +- sound/soc/sof/intel/hda-loader.c | 2 +- sound/soc/sof/intel/hda-pcm.c | 4 ++-- sound/soc/sof/intel/hda-stream.c | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sound/soc/sof/intel/hda-dai-ops.c b/sound/soc/sof/intel/hda-dai-ops.c index 484c761478853..c00fc981f8059 100644 --- a/sound/soc/sof/intel/hda-dai-ops.c +++ b/sound/soc/sof/intel/hda-dai-ops.c @@ -198,7 +198,7 @@ static unsigned int hda_calc_stream_format(struct snd_sof_dev *sdev, unsigned int format_val; unsigned int bits; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) link_bps = codec_dai->driver->playback.sig_bits; else link_bps = codec_dai->driver->capture.sig_bits; diff --git a/sound/soc/sof/intel/hda-dai.c b/sound/soc/sof/intel/hda-dai.c index 1c823f9eea570..0b5d3c5693ab0 100644 --- a/sound/soc/sof/intel/hda-dai.c +++ b/sound/soc/sof/intel/hda-dai.c @@ -123,7 +123,7 @@ int hda_link_dma_cleanup(struct snd_pcm_substream *substream, struct hdac_ext_st if (!hlink) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { stream_tag = hdac_stream(hext_stream)->stream_tag; snd_hdac_ext_bus_link_clear_stream_id(hlink, stream_tag); } @@ -174,7 +174,7 @@ static int hda_link_dma_hw_params(struct snd_pcm_substream *substream, hstream = &hext_stream->hstream; stream_tag = hstream->stream_tag; - if (hext_stream->hstream.direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(hext_stream->hstream.direction)) snd_hdac_ext_bus_link_set_stream_id(hlink, stream_tag); /* set the hdac_stream in the codec dai */ diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c index 4c88522d40484..f5be61a6f4ba5 100644 --- a/sound/soc/sof/intel/hda-dsp.c +++ b/sound/soc/sof/intel/hda-dsp.c @@ -542,7 +542,7 @@ static bool hda_dsp_d0i3_streaming_applicable(struct snd_sof_dev *sdev) if (!spcm->stream[dir].d0i3_compatible) return false; - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) playback_active = true; } } diff --git a/sound/soc/sof/intel/hda-loader.c b/sound/soc/sof/intel/hda-loader.c index 75f6240cf3e1d..ec46529974a5e 100644 --- a/sound/soc/sof/intel/hda-loader.c +++ b/sound/soc/sof/intel/hda-loader.c @@ -262,7 +262,7 @@ int hda_cl_cleanup(struct device *dev, struct snd_dma_buffer *dmab, int sd_offset = SOF_STREAM_SD_OFFSET(hstream); int ret = 0; - if (hstream->direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(hstream->direction)) ret = hda_dsp_stream_spib_config(sdev, hext_stream, HDA_DSP_SPIB_DISABLE, 0); else snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, sd_offset, diff --git a/sound/soc/sof/intel/hda-pcm.c b/sound/soc/sof/intel/hda-pcm.c index f6e24edd7adbe..d5a630da5a218 100644 --- a/sound/soc/sof/intel/hda-pcm.c +++ b/sound/soc/sof/intel/hda-pcm.c @@ -237,11 +237,11 @@ int hda_dsp_pcm_open(struct snd_sof_dev *sdev, * All playback streams are DMI L1 capable, capture streams need * pause push/release to be disabled */ - if (hda_always_enable_dmi_l1 && direction == SNDRV_PCM_STREAM_CAPTURE) + if (hda_always_enable_dmi_l1 && snd_pcm_is_capture(direction)) runtime->hw.info &= ~SNDRV_PCM_INFO_PAUSE; if (hda_always_enable_dmi_l1 || - direction == SNDRV_PCM_STREAM_PLAYBACK || + snd_pcm_is_playback(direction) || spcm->stream[substream->stream].d0i3_compatible) flags |= SOF_HDA_STREAM_DMI_L1_COMPATIBLE; diff --git a/sound/soc/sof/intel/hda-stream.c b/sound/soc/sof/intel/hda-stream.c index 3ac63ce67ab1c..c83b260c35f92 100644 --- a/sound/soc/sof/intel/hda-stream.c +++ b/sound/soc/sof/intel/hda-stream.c @@ -33,7 +33,7 @@ EXPORT_SYMBOL_NS(sof_hda_position_quirk, SND_SOC_SOF_INTEL_HDA_COMMON); static inline const char *hda_hstream_direction_str(struct hdac_stream *hstream) { - if (hstream->direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(hstream->direction)) return "Playback"; else return "Capture"; @@ -667,7 +667,7 @@ int hda_dsp_stream_hw_params(struct snd_sof_dev *sdev, SOF_HDA_CL_DMA_SD_INT_MASK); /* read FIFO size */ - if (hstream->direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(hstream->direction)) { hstream->fifo_size = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, sd_offset + @@ -1030,7 +1030,7 @@ snd_pcm_uframes_t hda_dsp_stream_get_position(struct hdac_stream *hstream, * is not accurate enough, its update may be completed * earlier than the data written to DDR. */ - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { pos = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, AZX_REG_VS_SDXDPIB_XBASE + (AZX_REG_VS_SDXDPIB_XINTERVAL * From patchwork Mon Aug 5 00:39:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816779 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 79073C3DA7F for ; Mon, 5 Aug 2024 00:58:18 +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 2A28752C9; Mon, 5 Aug 2024 02:55:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2A28752C9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819337; bh=4IKzE/0l6+rAy+h0bK7iSf8LM5SK26AwN1VMZBa1tEM=; 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=NvNkBQY8ckSDzAXZP7wLEU+TrxybZ9c+RrT+HCll1cJBCICTYxpp7Qmy+TEr9JHm8 8qa8Tj/APkVr9dAxOAIoEBI4iyEJ3mEQesle36t5XPAFCaS90ANczHagwOZ5QUrJQ9 MlzhxNFCSrR+CqMWjxESCVEEsemsWSkcL58A8YH0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 09476F89B5F; Mon, 5 Aug 2024 02:40:44 +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 31373F89B43; Mon, 5 Aug 2024 02:40:44 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0F884F89A19; Mon, 5 Aug 2024 02:40:03 +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 76CAFF899CE for ; Mon, 5 Aug 2024 02:39:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 76CAFF899CE 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=LCpb5vxZ ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TdfgM8/HT/79HmaxQD4F6MYhNx+8/LkjFt+gpQ25b+kPHPTp747xdGalhs+SIfchtzFiHeB+/mEzsr+XqDAoxfbJE0MJCfqZ+a36xu653amNPW/+8SVyAWdMXw84UvOk8caiEZViAALnZLWtf50Km8HqohbnRgbbwoNEt/sR1TMKwcQYfIkxQTlEMOE/exKj9ywuFSOmZHPAMItS6KGuMR7JzzNS3p89ZDktCJibZshqW2hnHmjMDtQ9rYNsjw2gJacIxsZTbqit5HE9C5DWDyUXRUzu5lgTDom4YmQfa67ckJB2hZTF+FFYcwt0Wm1LcUm80rEfEDv5PAP7AyEzng== 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=sdlERduANgxTCIKQW1Wf2vcHnEtrtSsPVn4SI5YZBLA=; b=E55nYkF4mgF0imuBWN3V2RuDE5gv1lOo2lRDw8zP2ybn9TVTsTWm1HSwmCvaIu5SQONmbOuI05eRRCFpyvnSGCZdQyaPWqa0mpqLv8EfYNPfK6AvR5FV7YtXiRpnpTudJB2c+2HHp6XB6iavtazdR8aw4EkuI6bC07F6M/HgQkt6pX3zPj4ZiGPlKrUGHbPjOeGT7IHpnmXFJas71/3AvokRaYNT/YAD0C4nLuBPNuqZLqWW2MYseIW9Vu+Pa7mSuchZ9Gg+7uRaLIfcQvwYVwukiQG4dmUjtXeZ95NiNjFARYwOQnv9PlWDSwsrHuVpEnZb/zO6Xskr8DnJikGqHw== 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=sdlERduANgxTCIKQW1Wf2vcHnEtrtSsPVn4SI5YZBLA=; b=LCpb5vxZubtf5WP9vXNEhSDC9ZEqZaeWmbelCgHg9z/n6ei8AtcE1e0NayRIruRR0eI/jwJhwL7U7Aihiy3LEBxve95ZtG1bzbk9xJ+OICy+QKwGZ7RIAdX8+xSOvXTbEZBmRLaAuXifplDbOIImQqIlkrnmcDhDh6G8BKV8aw8= 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:39:47 +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:39:46 +0000 Message-ID: <87v80fyf8t.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 056/113] ASoC: qcom: 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:39:46 +0000 X-ClientProxiedBy: TY2PR04CA0008.apcprd04.prod.outlook.com (2603:1096:404:f6::20) 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: 83b25108-146c-4309-5c02-08dcb4e71b14 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: qWtHgdWLhn52TXfwojw68TZNGk9m72zt5tA2Bj4aPA2OoeWxsqf/v9omAnrZDqJfasMjWNXCEn8ibdRnTh6I5Xqb946y5lk3h5flNFod3cjBapfZunrX8l5YtUxvK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KBzggJZjVv5tITs4kpvNLOuO/XHoYaezY3d5RGBqW7QpP+79zmbavf96UNTiwObr+nb9k3n5NHX2RY6MizsTfzLnUPWckDSS39WSswVd5fPJSxzwBsCJU0Pqg/kgUb1zYHu13PHMDryAqQ7+VJbypt6F5JDQKIzVOxOD+d4AVuVQU3NCgClu8yyLvDFBuexAbWwQUqD1NU3YgEl0j7cRbxELVSxs08SA== 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: QHWQX+lJobd8a6y4lXYIrqxMhxeeNNIN+VPEHk7Zc7oSAxktuu0xz6Fy1toz2da5v4hkpYEwtrM0pcgkxpFaYUWmH9e+/SmEuL8TGoTojN+XV3WingvKHdJYVU7wfvGD2SDrgTg0wPp8LJm2u4DIL8uFMiFUDbdop6EI60pPacBQk4pmEsWhKd7Cq8vymqab6jfN2bkb4vc/AcHSbIOVH1ZCdmwFyczQSh+aBbD+CJWN65HOXBb8raJilKaLnqJZ7eu6poWLY4DBp1ZXKSoJeWUoYQS83I9t9Cvo/Sfr6g0dWqlDAJhInUUtOjhWhBu5MVmOZwdRtCWjWM+98jsmbBaowpiRHQ44do4ekJIbEY3RQACOpKnJwgZFa96UgxQGN94rY2IrmxkQ+tv16zbv7/UZzbu5hZUQjUUXPMLpKhs+u15T/2lI3ijK3c3ZhvuQwOdWywNyK2AZ5o58bp0fpcReHvR4SQZkC2Fqb5GXlT6dv5xwLKxrAYxPesWzGTHgPmh+OfoVofOrrzyagOOX4xSwSB1TqTHLW6qcuEJPb0ubsPBCiUtm4Q5P/A8Xuu+3F0XU/85gOXVurz4xWAbIE+vnfuJWY49uCMWsyCGIR1sZi0a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-146c-4309-5c02-08dcb4e71b14 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:39:46.5978 (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: 7ZB04sNGtDPzHAgPw83fsCVroZY62Kmnbz+n4BIpsCxLaTbz/1691uEcUyTrPAKqEacYMUDvxhE+s195hQvtFWWg+hD8WuYXFzsouxWEpee6VdT8odvxKg0wwMkAGDEE X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 Message-ID-Hash: 5XICHGYIGGPJSHD6FFVZCMO6LYXJIFSA X-Message-ID-Hash: 5XICHGYIGGPJSHD6FFVZCMO6LYXJIFSA 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/qcom/apq8096.c | 2 +- sound/soc/qcom/lpass-apq8016.c | 2 +- sound/soc/qcom/lpass-cpu.c | 12 ++++++------ sound/soc/qcom/lpass-ipq806x.c | 2 +- sound/soc/qcom/lpass-platform.c | 8 ++++---- sound/soc/qcom/lpass-sc7180.c | 4 ++-- sound/soc/qcom/lpass-sc7280.c | 2 +- sound/soc/qcom/qdsp6/audioreach.c | 2 +- sound/soc/qcom/qdsp6/q6apm-dai.c | 10 +++++----- sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 6 +++--- sound/soc/qcom/qdsp6/q6apm.c | 12 ++++++------ sound/soc/qcom/qdsp6/q6asm-dai.c | 16 ++++++++-------- sound/soc/qcom/qdsp6/q6routing.c | 2 +- sound/soc/qcom/sdm845.c | 4 ++-- 14 files changed, 42 insertions(+), 42 deletions(-) diff --git a/sound/soc/qcom/apq8096.c b/sound/soc/qcom/apq8096.c index 4f6594cc723ce..a5305f33c32c5 100644 --- a/sound/soc/qcom/apq8096.c +++ b/sound/soc/qcom/apq8096.c @@ -46,7 +46,7 @@ static int msm_snd_hw_params(struct snd_pcm_substream *substream, return 0; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) ret = snd_soc_dai_set_channel_map(cpu_dai, 0, NULL, rx_ch_cnt, rx_ch); else diff --git a/sound/soc/qcom/lpass-apq8016.c b/sound/soc/qcom/lpass-apq8016.c index 9005c85f8c547..5dfcd547cfcd5 100644 --- a/sound/soc/qcom/lpass-apq8016.c +++ b/sound/soc/qcom/lpass-apq8016.c @@ -126,7 +126,7 @@ static int apq8016_lpass_alloc_dma_channel(struct lpass_data *drvdata, const struct lpass_variant *v = drvdata->variant; int chan = 0; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { chan = find_first_zero_bit(&drvdata->dma_ch_bit_map, v->rdma_channels); diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c index 5a47f661e0c6f..81036c49bce1b 100644 --- a/sound/soc/qcom/lpass-cpu.c +++ b/sound/soc/qcom/lpass-cpu.c @@ -113,7 +113,7 @@ static void lpass_cpu_daiops_shutdown(struct snd_pcm_substream *substream, * Will not impact if disabled in lpass_cpu_daiops_trigger() * suspend. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) regmap_fields_write(i2sctl->spken, id, LPAIF_I2SCTL_SPKEN_DISABLE); else regmap_fields_write(i2sctl->micen, id, LPAIF_I2SCTL_MICEN_DISABLE); @@ -185,7 +185,7 @@ static int lpass_cpu_daiops_hw_params(struct snd_pcm_substream *substream, return ret; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) mode = drvdata->mi2s_playback_sd_mode[id]; else mode = drvdata->mi2s_capture_sd_mode[id]; @@ -249,7 +249,7 @@ static int lpass_cpu_daiops_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = regmap_fields_write(i2sctl->spkmode, id, LPAIF_I2SCTL_SPKMODE(mode)); if (ret) { @@ -320,7 +320,7 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream, * turn off the shared BCLK while other devices are using * it. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = regmap_fields_write(i2sctl->spken, id, LPAIF_I2SCTL_SPKEN_ENABLE); } else { @@ -345,7 +345,7 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream, * To ensure lpass BCLK/LRCLK is disabled during * device suspend. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = regmap_fields_write(i2sctl->spken, id, LPAIF_I2SCTL_SPKEN_DISABLE); } else { @@ -378,7 +378,7 @@ static int lpass_cpu_daiops_prepare(struct snd_pcm_substream *substream, * the data flow. * (ex: to drop start up pop noise before capture starts). */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) ret = regmap_fields_write(i2sctl->spken, id, LPAIF_I2SCTL_SPKEN_ENABLE); else ret = regmap_fields_write(i2sctl->micen, id, LPAIF_I2SCTL_MICEN_ENABLE); diff --git a/sound/soc/qcom/lpass-ipq806x.c b/sound/soc/qcom/lpass-ipq806x.c index 5c874139f39d4..dbaaed1f3d8e3 100644 --- a/sound/soc/qcom/lpass-ipq806x.c +++ b/sound/soc/qcom/lpass-ipq806x.c @@ -97,7 +97,7 @@ static int ipq806x_lpass_exit(struct platform_device *pdev) static int ipq806x_lpass_alloc_dma_channel(struct lpass_data *drvdata, int dir, unsigned int dai_id) { - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) return IPQ806X_LPAIF_RDMA_CHAN_MI2S; else /* Capture currently not implemented */ return -EINVAL; diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c index addd2c4bdd3e8..f8e223e73fa02 100644 --- a/sound/soc/qcom/lpass-platform.c +++ b/sound/soc/qcom/lpass-platform.c @@ -329,7 +329,7 @@ static struct lpaif_dmactl *__lpass_get_dmactl_handle(const struct snd_pcm_subst switch (cpu_dai->driver->id) { case MI2S_PRIMARY ... MI2S_QUINARY: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dmactl = drvdata->rd_dmactl; else dmactl = drvdata->wr_dmactl; @@ -364,7 +364,7 @@ static int __lpass_get_id(const struct snd_pcm_substream *substream, switch (cpu_dai->driver->id) { case MI2S_PRIMARY ... MI2S_QUINARY: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) id = pcm_data->dma_ch; else id = pcm_data->dma_ch - v->wrdma_channel_start; @@ -1230,14 +1230,14 @@ static int lpass_platform_copy(struct snd_soc_component *component, void __iomem *dma_buf = (void __iomem *) (rt->dma_area + pos + channel * (rt->dma_bytes / rt->channels)); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (is_cdc_dma_port(dai_id)) { ret = copy_from_iter_toio(dma_buf, buf, bytes); } else { if (copy_from_iter((void __force *)dma_buf, bytes, buf) != bytes) ret = -EFAULT; } - } else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + } else if (snd_pcm_is_capture(substream)) { if (is_cdc_dma_port(dai_id)) { ret = copy_to_iter_fromio(buf, dma_buf, bytes); } else { diff --git a/sound/soc/qcom/lpass-sc7180.c b/sound/soc/qcom/lpass-sc7180.c index e6bcdf6ed7965..6898e9254a78d 100644 --- a/sound/soc/qcom/lpass-sc7180.c +++ b/sound/soc/qcom/lpass-sc7180.c @@ -80,7 +80,7 @@ static int sc7180_lpass_alloc_dma_channel(struct lpass_data *drvdata, int chan = 0; if (dai_id == LPASS_DP_RX) { - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { chan = find_first_zero_bit(&drvdata->hdmi_dma_ch_bit_map, v->hdmi_rdma_channels); @@ -89,7 +89,7 @@ static int sc7180_lpass_alloc_dma_channel(struct lpass_data *drvdata, } set_bit(chan, &drvdata->hdmi_dma_ch_bit_map); } else { - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { chan = find_first_zero_bit(&drvdata->dma_ch_bit_map, v->rdma_channels); diff --git a/sound/soc/qcom/lpass-sc7280.c b/sound/soc/qcom/lpass-sc7280.c index 47c622327a8d3..d5a1c27652e48 100644 --- a/sound/soc/qcom/lpass-sc7280.c +++ b/sound/soc/qcom/lpass-sc7280.c @@ -115,7 +115,7 @@ static int sc7280_lpass_alloc_dma_channel(struct lpass_data *drvdata, switch (dai_id) { case MI2S_PRIMARY ... MI2S_QUINARY: - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { chan = find_first_zero_bit(&drvdata->dma_ch_bit_map, v->rdma_channels); diff --git a/sound/soc/qcom/qdsp6/audioreach.c b/sound/soc/qcom/qdsp6/audioreach.c index 4ebaaf736fb98..cd7d99f9b8b40 100644 --- a/sound/soc/qcom/qdsp6/audioreach.c +++ b/sound/soc/qcom/qdsp6/audioreach.c @@ -1309,7 +1309,7 @@ int audioreach_map_memory_regions(struct q6apm_graph *graph, unsigned int dir, s void *p; int rc, i; - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) data = &graph->rx_data; else data = &graph->tx_data; diff --git a/sound/soc/qcom/qdsp6/q6apm-dai.c b/sound/soc/qcom/qdsp6/q6apm-dai.c index c9404b5934c7e..26c6051a53a0a 100644 --- a/sound/soc/qcom/qdsp6/q6apm-dai.c +++ b/sound/soc/qcom/qdsp6/q6apm-dai.c @@ -280,7 +280,7 @@ static int q6apm_dai_prepare(struct snd_soc_component *component, return ret; } - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { int i; /* Queue the buffers for Capture ONLY after graph is started */ for (i = 0; i < runtime->periods; i++) @@ -306,7 +306,7 @@ static int q6apm_dai_trigger(struct snd_soc_component *component, case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: /* start writing buffers for playback only as we already queued capture buffers */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) ret = q6apm_write_async(prtd->graph, prtd->pcm_count, 0, 0, 0); break; case SNDRV_PCM_TRIGGER_STOP: @@ -356,9 +356,9 @@ static int q6apm_dai_open(struct snd_soc_component *component, goto err; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) runtime->hw = q6apm_dai_hardware_playback; - else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + else if (snd_pcm_is_capture(substream)) runtime->hw = q6apm_dai_hardware_capture; /* Ensure that buffer size is a multiple of period size */ @@ -368,7 +368,7 @@ static int q6apm_dai_open(struct snd_soc_component *component, goto err; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, BUFFER_BYTES_MIN, BUFFER_BYTES_MAX); if (ret < 0) { diff --git a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c index 9c98a35ad0994..3189a10b2f28a 100644 --- a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c +++ b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c @@ -171,7 +171,7 @@ static int q6apm_lpass_dai_prepare(struct snd_pcm_substream *substream, struct s q6apm_graph_stop(dai_data->graph[dai->id]); dai_data->is_port_started[dai->id] = false; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { q6apm_graph_close(dai_data->graph[dai->id]); dai_data->graph[dai->id] = NULL; } @@ -181,7 +181,7 @@ static int q6apm_lpass_dai_prepare(struct snd_pcm_substream *substream, struct s * It is recommend to load DSP with source graph first and then sink * graph, so sequence for playback and capture will be different */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { graph = q6apm_graph_open(dai->dev, NULL, dai->dev, graph_id); if (IS_ERR(graph)) { dev_err(dai->dev, "Failed to open graph (%d)\n", graph_id); @@ -224,7 +224,7 @@ static int q6apm_lpass_dai_startup(struct snd_pcm_substream *substream, struct s struct q6apm_graph *graph; int graph_id = dai->id; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { graph = q6apm_graph_open(dai->dev, NULL, dai->dev, graph_id); if (IS_ERR(graph)) { dev_err(dai->dev, "Failed to open graph (%d)\n", graph_id); diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c index 2a2a5bd98110b..38d8aaab876d2 100644 --- a/sound/soc/qcom/qdsp6/q6apm.c +++ b/sound/soc/qcom/qdsp6/q6apm.c @@ -195,7 +195,7 @@ int q6apm_graph_media_format_shmem(struct q6apm_graph *graph, { struct audioreach_module *module; - if (cfg->direction == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(cfg->direction)) module = q6apm_find_module_by_mid(graph, MODULE_ID_RD_SHARED_MEM_EP); else module = q6apm_find_module_by_mid(graph, MODULE_ID_WR_SHARED_MEM_EP); @@ -218,7 +218,7 @@ int q6apm_map_memory_regions(struct q6apm_graph *graph, unsigned int dir, phys_a int cnt; int rc; - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) data = &graph->rx_data; else data = &graph->tx_data; @@ -236,7 +236,7 @@ int q6apm_map_memory_regions(struct q6apm_graph *graph, unsigned int dir, phys_a return -ENOMEM; } - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) data = &graph->rx_data; else data = &graph->tx_data; @@ -273,7 +273,7 @@ int q6apm_unmap_memory_regions(struct q6apm_graph *graph, unsigned int dir) struct gpr_pkt *pkt; int rc; - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) data = &graph->rx_data; else data = &graph->tx_data; @@ -538,7 +538,7 @@ static int graph_callback(struct gpr_resp_pkt *data, void *priv, int op) graph->result.status = 0; rsp = data->payload; - if (hdr->token == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(hdr->token)) graph->rx_data.mem_map_handle = rsp->mem_map_handle; else graph->tx_data.mem_map_handle = rsp->mem_map_handle; @@ -575,7 +575,7 @@ static int graph_callback(struct gpr_resp_pkt *data, void *priv, int op) case APM_CMD_SHARED_MEM_UNMAP_REGIONS: graph->result.opcode = result->opcode; graph->result.status = 0; - if (hdr->token == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(hdr->token)) graph->rx_data.mem_map_handle = 0; else graph->tx_data.mem_map_handle = 0; diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c index 3913706ccdc5f..3e3d2847f992b 100644 --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c @@ -187,7 +187,7 @@ static void event_handler(uint32_t opcode, uint32_t token, switch (opcode) { case ASM_CLIENT_EVENT_CMD_RUN_DONE: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) q6asm_write_async(prtd->audio_client, prtd->stream_id, prtd->pcm_count, 0, 0, 0); break; @@ -258,11 +258,11 @@ static int q6asm_dai_prepare(struct snd_soc_component *component, return -ENOMEM; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = q6asm_open_write(prtd->audio_client, prtd->stream_id, FORMAT_LINEAR_PCM, 0, prtd->bits_per_sample, false); - } else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + } else if (snd_pcm_is_capture(substream)) { ret = q6asm_open_read(prtd->audio_client, prtd->stream_id, FORMAT_LINEAR_PCM, prtd->bits_per_sample); @@ -281,12 +281,12 @@ static int q6asm_dai_prepare(struct snd_soc_component *component, goto routing_err; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = q6asm_media_format_block_multi_ch_pcm( prtd->audio_client, prtd->stream_id, runtime->rate, runtime->channels, NULL, prtd->bits_per_sample); - } else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + } else if (snd_pcm_is_capture(substream)) { ret = q6asm_enc_cfg_blk_pcm_format_support(prtd->audio_client, prtd->stream_id, runtime->rate, @@ -385,9 +385,9 @@ static int q6asm_dai_open(struct snd_soc_component *component, /* DSP expects stream id from 1 */ prtd->stream_id = 1; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) runtime->hw = q6asm_dai_hardware_playback; - else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + else if (snd_pcm_is_capture(substream)) runtime->hw = q6asm_dai_hardware_capture; ret = snd_pcm_hw_constraint_list(runtime, 0, @@ -401,7 +401,7 @@ static int q6asm_dai_open(struct snd_soc_component *component, if (ret < 0) dev_info(dev, "snd_pcm_hw_constraint_integer failed\n"); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, PLAYBACK_MIN_NUM_PERIODS * PLAYBACK_MIN_PERIOD_SIZE, diff --git a/sound/soc/qcom/qdsp6/q6routing.c b/sound/soc/qcom/qdsp6/q6routing.c index 81fde0681f952..7e7ad072700d2 100644 --- a/sound/soc/qcom/qdsp6/q6routing.c +++ b/sound/soc/qcom/qdsp6/q6routing.c @@ -1055,7 +1055,7 @@ static int routing_hw_params(struct snd_soc_component *component, struct session_data *session; int path_type; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) path_type = ADM_PATH_PLAYBACK; else path_type = ADM_PATH_LIVE_REC; diff --git a/sound/soc/qcom/sdm845.c b/sound/soc/qcom/sdm845.c index 75701546b6ea8..daa38d07a50f2 100644 --- a/sound/soc/qcom/sdm845.c +++ b/sound/soc/qcom/sdm845.c @@ -84,7 +84,7 @@ static int sdm845_slim_snd_hw_params(struct snd_pcm_substream *substream, continue; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) ret = snd_soc_dai_set_channel_map(cpu_dai, 0, NULL, rx_ch_cnt, rx_ch); else @@ -115,7 +115,7 @@ static int sdm845_tdm_snd_hw_params(struct snd_pcm_substream *substream, } channels = params_channels(params); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0, 0x3, 8, slot_width); if (ret < 0) { From patchwork Mon Aug 5 00:39:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817099 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 9A5D5C3DA64 for ; Mon, 5 Aug 2024 00:57:37 +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 342D2525E; Mon, 5 Aug 2024 02:54:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 342D2525E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819293; bh=8jmCrPdpLocqNKg4z33xnHD6Qw5aZbINp6YoNea6wZo=; 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=cSmkhjol42fdOaeVbTX1o7fsN9uQ8J+sXk/TiJ3SMR7vbOwqMyJtujPETbw0GjN8b MSd5KkfxClN/opV1yyvxV4s/Dla13slnWHJWm38+a3BUPFhMJqIZhjnxbkgF51wtu5 MIPWBMSYM5egICo2McFJWmA+ZuPWlZZ9dApm1KgY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7D054F805B2; Mon, 5 Aug 2024 02:40:38 +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 A05C1F89B1B; Mon, 5 Aug 2024 02:40:38 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 301DCF8069A; Mon, 5 Aug 2024 02:40:05 +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 492EEF899A9 for ; Mon, 5 Aug 2024 02:39:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 492EEF899A9 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=QWieQEnu ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PFyrT7LMrQ0cIEyEAH7vW36DjuGxspIou6uPBoZENr6Tto2xzKMBG80+XzRSVNrjLAujqU7LbFSHNApTGr006D749WcwX7ysg1Gc5arUopAVxBWWXyP5foeGY5xZj0SGntzGwO7ZNAlzfKA1cQtHHMUlx06fv+55WV0PIULZDAw2xQnIoNrVPAZsMLoWdF82Fuosrs9hUCHo3WvlfbywljF8F2+BSXyXTOYNM8FNDsouo1+qLRqJHnO8isD8kWhgDHK4tL8IuyG9aidWJssHxrFu8TYhh/f3B1JW6wjjlKx+Tf1pIAsvm5YWTRy1t2LVo9oMBS997NkAuycMrUrSfg== 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=HYtrNYv/kg2CePMswQDA/S5NZEOx2q29Oodw5gpHO50=; b=GFMixgXIXi1dE8fje/DWRDcDvVKiGtUJXD/n9PfKvhUNijZ42d8Zo8/2T8i5PBvFPHAVR99Yhe84x5pkIBb+W6R+UUVErYLICinRtwDvsh5JmRJnoXZULKNn+uomGD5VYM4qtx1jUqngEJm+xQwyIee8Hasr0kJ7PdRqzD4vCWd585QNkNiqGRTuLbVbWaacLTaan3nLl8vQC7xlvN2TzqLQ3Zc98t/0L5GMZ/KtjasIRg1vpv3sXCYAbv4/GrUx3e3wRZIHM5SUGIWVS7v6JaBB0LEyRlz0PMsUfQUdHkHPxgC8yxdoIaeNX40fpk7G8uswBBfWjpa5mqD3rOXumg== 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=HYtrNYv/kg2CePMswQDA/S5NZEOx2q29Oodw5gpHO50=; b=QWieQEnuQBQx2OyK6h+SWAKwc3u1Om56P4esVkuk4ZFOG+psAK6z5GWlxbT+hitsj+ueUgWBxYGk9Ee0LmCL7ECaSGCQzX1hewRFx3CekwIzhyilRGfkvfy7ztrhqJMirujIG2e+JTZkCTEBr50lNHVeUvnRNSKJOejij61Hn7I= 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:39:51 +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:39:50 +0000 Message-ID: <87ttfzyf8p.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 057/113] ASoC: sprd: 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:39:50 +0000 X-ClientProxiedBy: TYCP286CA0285.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c9::20) 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: de5bf3fa-2cb8-43f8-edcc-08dcb4e71daa 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: Yx0dx/KRkC2Mp/lvAVjDipTWPapsqIlnksheP3SZIDPIGqdHfzo0y+QmKrcikJd+37sc3LKM5hRwlH5iF5FT0vkeLYa9arMaRz9CaLN4BH+0SFWRoIk4bnfYFQk7YK1or3E3J7rGNmRZdEYnnhv8vWCHqFXGQQehgcJ78kNu0Oo2OXtovwXFITSmgZKZa4H4XwgWrIlpy+mFb+p1k2ji8kl+/VFP7RyswqB7UXwHHQ2xYrcJAaJgz7wa7Mz7bc7CVHqtBPe3TGilrgcOaXnwdZTBknlkZNQMK9WhbCzDBgT74A8876U53JZeUjmLP0RaOS6aNZ0RMLL9N8v2DO0p4Jv5GynIghbSmNzUawAKjX3QhS5mMuFdxFNpuKaieAeM0Hz5TOU8yb8Fb6s/iBPJm6ws5Xpf/kILnFcidK/qbNwYS+xA4FlrO1tK6amtboBSAqtTp/6A8zSc8c3sfVTcjD+HquP+dgAQoIQdzUsC8GQnApMiRRM7oZVb+3xEx+r4iTX7h0ia7t3Ng4zvgQFxwWmuxnq9478hdT1/X98TOiWbkxjvUCcuGo1voqN74i0CskUDa7uT4pHvARUMm3fYTSaLPUu7ZWrvll/lR68zXKb4Mcj1FbP/o/WsHMHPxm0IAyHj20kNZvf5NnJUBSgSsHzLJfxSzChFH4s9nQ4B6PdsNE6MyW60/ruWLz2ccbrkRegENTbXDwB1WwqVppwMqDgtGiFfnzS87stiW618+mzHqSZ6od7UsvqKL1VgURGAJl3egCiRRFPlXlZroKiQQp/rgmNYlHSHfctgt+mtLYgQhOZQNlK0DuPCS9TxXKmGdUTmkIYaeN1xdbr0Jfb8wN4dUHVmlgrjjWVIZPViKaIIq/kNk02BPaYARNY/5sHXq+1gNzMN/u9sQZGmTi58NttCEkafHAmr+oHXx+Ng2o5nocS0skrYUKGjEawHfCDHFtgbw1rLoa2ctRPaZnjzwJ+gi95Do4U2C09Ctl/JL6aW0HwaIrTMxI4jOMg61DmU7lTYLcJFSMARdHHhHIut+vs5zJZ8KxY5HUzehT9N2+qUyUc2P1xb2spDZNc0IUvM3n4MyVZ9FlWAJDPvvxY+nrHq8e6dMLFDLUNUt8JB4vnfkL/CIkqTC1OgoUVt4iEEiwG+t6kJ389CBqDjlu/iXFJX+A9WEkChOMHeltaTEYs16u5UBdNp2YAxHj4xnVJE4/lbvrBpJ8F7oqPPeu3Yp+Uf2u8qIPy5p8IS+cqMP6nYItdW/498qkn06HpisfICk7st5Fs9wMK3nuBC0x/a3S7wIrOkFJJLWtw0hw062A//NKehJ8dZvbEbgeWBml4Qr/PjICxp3JJbFvZjGeYxQUN8TsCCX4Tl/iYp2duxDmEU8yR59H8HXqmmyPiCMRYvhRZhUIkgHhG2UxEvWhl51w== 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-Ant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a5Cp9k1OYqlUvVvfd6j5Dr+kzm8dh/XIRxCltGfECQkXaY2NNCRx8JCSj6ZmFp4x1U7nxgwAD9DdyaYncvMy8R1xq9JtmQbRq43hG04OpOYbbNC9z4hm5zWJCbrRJbMBb2FhYMHpRnaRos1v8PnERGE8+Wu5E02Ri2wCNsMWLc5Z4EqN1tVyyQLRRkNOVWQRHmLvU+Qg4Hq30Fe7EJfjV9b1OHH34R/Np1e5C3K5zrpgt9IymWiigsqpVNqXhW/4GS4uJgyepSip+TwLWFdzxg1HnalydJUa84Lml6xg0KfYVTavk9ZsdrOsyZ6ss3t/nppA/6yCylFm9KMCfa/yPTzvVMIDUTzr5dVvGmPC57culpN/IO5cmse80NegUQb2iibPY4CvqArhR9AYvcXSbrgCnjwql7+Pej429Fr7pS/inmI6gHgWMP9ViivRLbaSQviT+PU7xH+c+Jy3MK+c9F1NWDim/USZ42mmll8tGjriUYdXbdRfnrcQ2NIWgAEvbvgT2bWqSBDH8H84gIJ89ISNf/MuRKMLxle0vMULCVm7diGhNV7YNFSIlVBHVuLjJyLXTarfCOYAiKAMN42DmAXUw4CsMNFcnpg7wNXhPHg= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: de5bf3fa-2cb8-43f8-edcc-08dcb4e71daa 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:39:50.8842 (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: Dwm793ETU2OErgLQ3pIdq2niQ1NYh3LFw7O3bYAsCOx7OFbJFptfKS8Q211nONii6EwA/fn9/ZRSRpNLWZcIAnAaM3Xbn5pGsNQJ6peHF3lgvOTpL3z7hN2V9dVJz7Kh X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 Message-ID-Hash: UNBG4XWI37FQ5TP3TMKV5TB3273IGXCG X-Message-ID-Hash: UNBG4XWI37FQ5TP3TMKV5TB3273IGXCG 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/sprd/sprd-pcm-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/sprd/sprd-pcm-dma.c b/sound/soc/sprd/sprd-pcm-dma.c index d6b96cc2f7087..b7149322b9858 100644 --- a/sound/soc/sprd/sprd-pcm-dma.c +++ b/sound/soc/sprd/sprd-pcm-dma.c @@ -195,7 +195,7 @@ static int sprd_pcm_hw_params(struct snd_soc_component *component, size_t totsize = params_buffer_bytes(params); size_t period = params_period_bytes(params); int channels = params_channels(params); - int is_playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + int is_playback = snd_pcm_is_playback(substream); struct scatterlist *sg; unsigned long flags; int ret, i, j, sg_num; From patchwork Mon Aug 5 00:39:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817100 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 E6A6DC3DA64 for ; Mon, 5 Aug 2024 00:57:08 +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 A601849C3; Mon, 5 Aug 2024 02:54:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A601849C3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819266; bh=BF+AZguoCo7V+mfNfBSorDhXKpVTtVPWTnoPcT41ILI=; 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=btwtVK90hgDUYcir6eWONJwm2hp7yX/7YlYjz9Od8zstQLKIaYKoOeEQeND6SZGbh FxLMHBPLgnQvg93iQC2rHgYkhrD6rNdVT6oVPDxIM6zY2w4Zj2ma2wEH5jmIiBfeNh SstnLBjf9YDjcPw4iHJT62L8ixeqUqmMIsaY7iAE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id EF4A8F89AB4; Mon, 5 Aug 2024 02:40: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 4BEC3F89994; Mon, 5 Aug 2024 02:40:35 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 57B03F89A5A; Mon, 5 Aug 2024 02:40:20 +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 06AD6F8988A for ; Mon, 5 Aug 2024 02:40:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 06AD6F8988A 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=B+eUyzHo ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ts7GP2Lj6hA3sbNu59PZ7hvMqEkEpt+DNlwPeWfxyFj5KoWdBaZt78Mi/oiVBiWyOSWKIe0cynxwJErZE7UXErDTarUwrRBbyfJfvf4BB6juJcXoiqYe3+esZaldnbXKZHH2SbTGL6be5TMP71PbUJI+OsSIBc8glmEYEcBvbK8YlFMIiCaWsxCCkbWpJ3IJKMIpugrNYMtKPpPad+m5KOzK6SgyES7JA+dq2UWYKkDX21R5XDJy5PQu8ksVve/nc2GUgGPsdkrre6NvRBbilSMi2mPiNSorpWUzaw3omUU1kLolRMdyARHrQ/h2HbLhIXgjXG0EAJnwTovyOCt2Ug== 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=e7o6TiQnaMaRLBaT95lA/r0JnmPt6tWmU7DxJR+d8e0=; b=aBQaRxslZWv1kxKyj30WHMTJPJVEHqpEG6R3Wg0EEjzZOk+D1b34lTBwcxbVbj0NAvqc+QT9RTVpWNDl3l7r3RJuqNzSL1YPoeEOFGE+syAa72QynjNZ7BXKnva4D7OWJaG8OTcn5vKUPb8MUA0hTSWdoJ4Rbttu/gtYGMUZ+Li02eZI768c2uD/O5klVHqCibCh7E35mxeum99NENPw/gKhQ4+PdkhSrpHdnI8QxXxZl5RJVROxyNm6xbPIwp6sDkglpojA5iTbf0OTEMbjqKXhS9f/+lGQgiaDgiP34Xa2NxvKoU3ZAxO5ib6h5atgxo0o6i+lfWe8jF9RXKBQ5w== 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=e7o6TiQnaMaRLBaT95lA/r0JnmPt6tWmU7DxJR+d8e0=; b=B+eUyzHo8r9IlsKRDGfWGCrY+Ym6/q3zyxomksAv+Q9+o5AKc1FPCUl7o2EBgKDogzJdrIlUJ0Of4ZukAJEFVCuwJh4Tdpp76a6Um3kf7gEI9rCGa6B7vcr2k8JyNaIrd31GQRZPP3uE1gIzCfG4vBUZj2PHLSXJ+cCSYpP+1bI= 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:39:55 +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:39:55 +0000 Message-ID: <87sevjyf8l.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 058/113] ASoC: au1x: 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:39:55 +0000 X-ClientProxiedBy: TY2PR02CA0063.apcprd02.prod.outlook.com (2603:1096:404:e2::27) 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: e9ecd055-0ded-4b08-6948-08dcb4e72068 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: H7TiixdF9Q1PDysj3bRb5kjMM1gn6y8nX6H21LRKlTK8iFf8EJWndc17Id3qVbWKS1txGcTMfrfOQowXBcb/02hSmmYltL+OJcQsNBAr8DMrtsR1aA6pvgqanzTRuXNYAWuvJHlerEVA4aPRNmWHG3glolvEqNjXCnt1UfzBO5ZieN5UDBZcndKi56m12FZqTGfHXSu9CWceAwWOAYvhixsozokIz4jY4Es4EEyPHUdoSfIAufFQAnBHxEAwbGyCvZlJ9gwV38Ci/adPYH1PnSawbpCk57xcCEpQeVWvEtnn71ahkoHh9rr0lOVgJDk+mCxKOl2bVpOmNo80gfuBtFN4AtxfcQkCo2XAh6469i5rP7Y/fIpL9PA0GRYjB+cuFmSsDKvMC5W98FhXYZA3eZipd3KqyCVcSjWX9Fac2far+H1RCZ8tD8QFJQvXIbdJC7eQ6XaZDWGpSrmjYU6z/LD8lIyAhZHDOEEHbhv+aoo4A7oTciK2UJgiKkhcm4ADHcPFT1OKZFT2X69F5AgYTaD6juY9gWDAijM+ByIbXVRpQWtS8R+xY6Zx8NXR0DsRUGZkDi7i2e8YxFBupbQhV/g23VkJb+KkWNA9MDYcXFMDswhw0gBgEc/Avnf5gzZnOtO/AHYfSLV4eD/lukyONYkkPy45oCvvKhlflpWff4qmaZpNMWtcRi12urs5Niup9iZRczpLHZkdQEPIgpbSm0elSbolfNnTmXbjLPo5+ggt3V1s2moCq3p82cVrAo3tInx0AQznufGEcO8TK4PhniPrkGXygXtrt4H4eLNXR6/VGjWPD4pZYg1z30fayFyOgZzFXsyerxQBedX/HhIzjry5RDXPALwfr6hie06u93cAblRUTSlFSvRHi/utsp6a5dXJAHxB6WdRufTlt7CEeuyiGU0q+8HpC0u93dAo8Zw0UHwvDWmjnoPda5g5MObDufzQhDknXiGygjAYzpBwKqTQ0PSwPGIsz1M3MS1YBvBonl+wFypB44W9MiB9VWbYqoCC+4JPzZ604Qz+Nha+e3ZRODxiOQsrrEPlJfsQpFizYug/X1e4lAkeg0fdMM8EV9TMjRiUx8O2j7jRLAw6UNMb2h9/+L9KLYEb5OVly1DLp+ulMZg3Uz/dHSAEj4dqqQ5lHyweVdjEyktcBEbdv2iSpB9l29VfzKZUg84lMgjmxiGzQ02NNEnRPt2TZ8ms/uXyhcHCV+bA2jq7oBrgjJweyoD7LRDzlUViH8urpCKmKvHQRHVwxWbK0c7PL6ooUCB7bs9t4RkFBFcsZJeWJXuOuF67ENVWoXJfbaVr20W4eXhmcZ0jJJCvjGQpH5vl8j4YdyZRUJYljmOK11W9JQ+Iv/JkG9zDr6UyveeAxDbsPXjhJstBoTHdIQPRjqIvdZMuMfZTSGGiv0rHW5JZUA== 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: 8C0tjgkLPqglJO3bV1/57eZvZMmQH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bNXlVqLFWyZ/yIBcEUrUeCpnu/0udJPaTQNLzn1I2kKJch5OglnuyNjMwrSkxKFA0IG37JtO4g7q1wG2sDgnkkL6JqXDIucVDcV8HFwOcgCHMatXj6xiqGlG/xuc2yz/P1qB7ruO+Ts22wS+n5PgaGxdi+Y5aTMW+Xyw/ROP7YPH67FKUJgwoA3s+TUC+/42P8+YUn8QsQV8crp/ErVqfUH+14S2irpx3TdnPwDb7a2zv+zV89V205M+RVnnUSrMUwb2asoNCm96gb3sYUO1r/AIzVViHekpQ7XQ7Rfw7cG9QecVfI8eIkAHwHCS5n3e+GOI64jKGn8KQBUcRaOLVuql+4XijP4Gv7gRb/qPE/8SHUJEw77cod0J/miFRuLF07w0UAVQWmYE5T/hi3JfvN/vjVjEQcTjMHEa8hgCKDlHouUCXX1G60PwMGTbhIhI6vSx3517GrxV4lSxWWWcNDoquDyyp8DbgXcD7Z+7xm4ldDKS3ZrbkM/f4HcdMgeQDJZ4UT+OOOF8q1+MF8HR99GvXnX7I= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: e9ecd055-0ded-4b08-6948-08dcb4e72068 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:39:55.4782 (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: cTuyk2GDnxH/3ILek6EzTHOh8fpoeDgGDqoUAtvgYBe16qbtFWF4axh2njFS6YaPN5IVIOOVtnoedAEivrS1VfwdpAl4CFpwci++ezOh8weWhrbAQ6nXGdGtLdkggfYL X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 Message-ID-Hash: ISNYYJCMMTS2I2LA6V6QFYMPKZQK57WW X-Message-ID-Hash: ISNYYJCMMTS2I2LA6V6QFYMPKZQK57WW 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/au1x/dbdma2.c | 4 ++-- sound/soc/au1x/dma.c | 2 +- sound/soc/au1x/psc-ac97.c | 10 +++++----- sound/soc/au1x/psc-i2s.c | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sound/soc/au1x/dbdma2.c b/sound/soc/au1x/dbdma2.c index ea01d6490cec0..307cfbc7f713f 100644 --- a/sound/soc/au1x/dbdma2.c +++ b/sound/soc/au1x/dbdma2.c @@ -158,7 +158,7 @@ static int au1x_pcm_dbdma_realloc(struct au1xpsc_audio_dmadata *pcd, au1x_pcm_dbdma_free(pcd); - if (stype == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(stype)) pcd->ddma_chan = au1xxx_dbdma_chan_alloc(pcd->ddma_id, DSCR_CMD0_ALWAYS, au1x_pcm_dmarx_cb, (void *)pcd); @@ -235,7 +235,7 @@ static int au1xpsc_pcm_prepare(struct snd_soc_component *component, au1xxx_dbdma_reset(pcd->ddma_chan); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { au1x_pcm_queue_rx(pcd); au1x_pcm_queue_rx(pcd); } else { diff --git a/sound/soc/au1x/dma.c b/sound/soc/au1x/dma.c index d2fdebd8881bb..7a8ff759ab4b1 100644 --- a/sound/soc/au1x/dma.c +++ b/sound/soc/au1x/dma.c @@ -200,7 +200,7 @@ static int alchemy_pcm_open(struct snd_soc_component *component, return -ENODEV; /* whoa, has ordering changed? */ /* DMA setup */ - name = (s == SNDRV_PCM_STREAM_PLAYBACK) ? "audio-tx" : "audio-rx"; + name = snd_pcm_is_playback(s) ? "audio-tx" : "audio-rx"; ctx->stream[s].dma = request_au1000_dma(dmaids[s], name, au1000_dma_interrupt, 0, &ctx->stream[s]); diff --git a/sound/soc/au1x/psc-ac97.c b/sound/soc/au1x/psc-ac97.c index 1727eeb12b64e..62627ec731063 100644 --- a/sound/soc/au1x/psc-ac97.c +++ b/sound/soc/au1x/psc-ac97.c @@ -37,14 +37,14 @@ (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3BE) #define AC97PCR_START(stype) \ - ((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_AC97PCR_TS : PSC_AC97PCR_RS) + (snd_pcm_is_playback(stype) ? PSC_AC97PCR_TS : PSC_AC97PCR_RS) #define AC97PCR_STOP(stype) \ - ((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_AC97PCR_TP : PSC_AC97PCR_RP) + (snd_pcm_is_playback(stype) ? PSC_AC97PCR_TP : PSC_AC97PCR_RP) #define AC97PCR_CLRFIFO(stype) \ - ((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_AC97PCR_TC : PSC_AC97PCR_RC) + (snd_pcm_is_playback(stype) ? PSC_AC97PCR_TC : PSC_AC97PCR_RC) #define AC97STAT_BUSY(stype) \ - ((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_AC97STAT_TB : PSC_AC97STAT_RB) + (snd_pcm_is_playback(stype) ? PSC_AC97STAT_TB : PSC_AC97STAT_RB) /* instance data. There can be only one, MacLeod!!!! */ static struct au1xpsc_audio_data *au1xpsc_ac97_workdata; @@ -230,7 +230,7 @@ static int au1xpsc_ac97_hw_params(struct snd_pcm_substream *substream, r |= PSC_AC97CFG_SET_LEN(params->msbits); /* channels: enable slots for front L/R channel */ - if (stype == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stype)) { r &= ~PSC_AC97CFG_TXSLOT_MASK; r |= PSC_AC97CFG_TXSLOT_ENA(3); r |= PSC_AC97CFG_TXSLOT_ENA(4); diff --git a/sound/soc/au1x/psc-i2s.c b/sound/soc/au1x/psc-i2s.c index 52734dec82472..bd4a75fec9822 100644 --- a/sound/soc/au1x/psc-i2s.c +++ b/sound/soc/au1x/psc-i2s.c @@ -39,13 +39,13 @@ (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE) #define I2SSTAT_BUSY(stype) \ - ((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_I2SSTAT_TB : PSC_I2SSTAT_RB) + (snd_pcm_is_playback(stype) ? PSC_I2SSTAT_TB : PSC_I2SSTAT_RB) #define I2SPCR_START(stype) \ - ((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_I2SPCR_TS : PSC_I2SPCR_RS) + (snd_pcm_is_playback(stype) ? PSC_I2SPCR_TS : PSC_I2SPCR_RS) #define I2SPCR_STOP(stype) \ - ((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_I2SPCR_TP : PSC_I2SPCR_RP) + (snd_pcm_is_playback(stype) ? PSC_I2SPCR_TP : PSC_I2SPCR_RP) #define I2SPCR_CLRFIFO(stype) \ - ((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_I2SPCR_TC : PSC_I2SPCR_RC) + (snd_pcm_is_playback(stype) ? PSC_I2SPCR_TC : PSC_I2SPCR_RC) static int au1xpsc_i2s_set_fmt(struct snd_soc_dai *cpu_dai, From patchwork Mon Aug 5 00:39:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816780 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 21056C3DA7F for ; Mon, 5 Aug 2024 00:57:45 +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 CF9D438F1; Mon, 5 Aug 2024 02:54:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CF9D438F1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819300; bh=jD3jdd01lywzk5OaFp9sJbRzB9qifED9jzWkT5YfVm0=; 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=owdIvCfpgythS+w5XLdN8dF2O5GMQZYYp6ohT34+c+Ijc6uL87nYB7xy1hUccT0jk Y8THyyuhsOUMM21yqOVpPVCcDswfqGW7aE7EmwUl5Iy/+eEQluUnrk5xuGBj8T9dQK trmW+rJgUzBidn+j7N4+YIZo9MdRKgTQbmK6Usdw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id AF303F8067F; Mon, 5 Aug 2024 02:40:41 +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 4554AF89B33; Mon, 5 Aug 2024 02:40:41 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D7DABF89A29; Mon, 5 Aug 2024 02:40:16 +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 A9491F80624 for ; Mon, 5 Aug 2024 02:40:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A9491F80624 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=dW4Zl1Qo ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=d3fo1wR/KuoRYzT9RY5qHaLdvUzftet+YDqOg+dsfUyQH7TCGAGg/2KfOCZ9pf8YT9ZKq9Wul5d8rj8kTGRjCUpl3+2EFAofNHHF7TfUlh19N80DMTyp7gge1ZngZbCywjaN/we748UT+mUKiLekr2MEmS8Vd8ORhXWYCFg1R8U8UuZZHEGQIMVm8l7EDjvyScx8zWpR4cVfUx00me4x/DfduIXE1iP/1X84InMwM2wLEMF3aV7nUx4Y+Q3Xd1v4LfgvkL+NOsRC0f6QryJtYskAMFkgcBEzo2cOqcH89y2/mb88O3jdB6x86/JZxcl+KapzXOu5C9bwXyeRxAtYPg== 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=mUgbNhARjoegvwgtNCo7MUNh7GYdwpYywqkR/DU77BM=; b=gqI0ISi9uWivrUTexA08PMqzes0SXt7TiWYfl8MulF2kh8LAyrH5GY1ExS7WXZvER54OaUnI/0E0tPIyTYiAVNFCjZ/6aeLMOlCmHMsUIawJbjiw4hDabq/Uu10BUZy5phg3WpbPW1gX8I6lyn52xLyH2yGiGl26ISLNTxm+8dasKRKGf0LXvG+ABLepyTvOeO5un+2gWX9h6exm0pPLOaE6QyCgPpTB1fkXYtcdQ4ch4SDrZQsT6o/PL5z7ClDZNTOAlSlX4gStfiHVqtc9p3emCqa/mvO0zzlFrT9Ottdg0tj4fxQwUPdqv9s7cMlaY5pKWj/cOyIOHA2r2vGvXw== 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=mUgbNhARjoegvwgtNCo7MUNh7GYdwpYywqkR/DU77BM=; b=dW4Zl1QoyIG5erFgAb/gpnP6UrmYZwu8/D2KTR/uVPHdwV6+Wf4bTD4U/tcbULFi7hw82zZn9tu91OhVj1QEjO+SN8LkQv/FNbWKw2LU2RFcTRm/ajtOTF/9G1xe5PS3UL7NE+iY6P7yBTOFu3/AB/YP9RkbVJW03q3yajiXeA0= 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:39:59 +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:39:59 +0000 Message-ID: <87r0b3yf8g.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 059/113] ASoC: apple: 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:39:59 +0000 X-ClientProxiedBy: TYCP301CA0041.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:380::7) 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: 10f30503-438f-4aed-c940-08dcb4e722fe 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: /J7+lKX4pgabmcUOM6+l8bLNlVXjN7l12HFsTuGXaom+dckacSrE249ypdghP+yvwRgE0YpIa2mjmgJjL6ho7QFW43chhe8n5stRBmQ25v5y9PdR8g5Z5TKmHpwHkt7FZn4y0AqXLm53skklGhEw5DYFRmugqxLNTPHE2pXNsXgiFGq0tyav24aGLBUgqCWwDIi5j63W02FuovR1/hfSOch+eFZZMeAaw1BPKbr0Ay45YbDzpvfybV4zFMTkbA4AhTWZq24O2RwBgM0MB04tpCmbLHAMzb/OL2yZu/m/4smEtmHJaLhoIOEdxAhLxjHCtsUUc664Ws/weqkohmKW5T2eXwJWv0nTHOQSBn43A/rehhIQnc0XegYRPWDoAaqGbHnnwE+uHNSAkQhmhfHckyS3vI/zz4Jt6j8Pp22Z+Od+fzJ7eXI2OIQbARlyReXsL9Tu9E1Hch4vzvyESu8VrVTIJJJ0E9EPL2NnWggO5RLV6UTscwGIjS72fDGFbPbvro4t55S07oroHb9uppDMNc0qqyuHaxDAG5toi6RUmIZvzhFoNU47TC0jMYPl+zpQJjgUSFK3pvdp33VXUvLvz2yXWK5YuMYKEaGFmzocQm3psGD1yvN/dL8v6bIWorjD7xiZIOhrxcCH1iO5Lc5R6qgnGvmlr/we62CHj25BOmlFCWS+K5Lno4GBbq8jx4SCYNziqbp3p+pTJ3ycuLQUqaXllSI1mpi9v4TaczsC6Hwhe8JuiutNj5tZhY17Q8CGPskygAwm6pxV0krR04wWa+3Z9lP7kr8J+VJlc8pp8ld7PpvK81zzD9Ji23ylQeSRYGWtPbCdRSZAzdur7qm1bn4ToukuwwIYYIs/ZNGjBc6ne0L9Tl3Bs9wZaLcnoBiiduVf6YhyPEcm05GuReIxukIIom7Dj5dMS6WTW+sTs/ObTk8DpqI2bHGJGOP3FreYvGcgFMSVxsH7XtXRsxKlW/9rp7nGcyRG/yPeMEmbSbDLzeD3jMlEM46XBKBJheGL0rHS+MWPdiYy4tGw3Dny83fLJgfnXmb6TfgmP6Gmqlb5F2GXRUFmr7D7sw1eZPuRtDfk5Uv1fOSVLPoofU8YE6/WDTfzw2YLpVPEy9aN/fSWgnwdrbHOzWHMLDXKXRXOmytUPig7CCATbgcoFvgvVt7ztpTOvUFnCEiZ9g67gUmRx7N2FIDDq6pfJUOqOG4AXoHnY4k+bV0tGXlMYs3hOgOTWa2hAs+uq4SuP5fkUxUqsrwcKmVL2Wydeoc8/6Do7ydTqMlRmSG05l7rzEp1hhre+hv5OoqrujMHYOqrpYDK7KS8DA3AxwN8qgXN5VKMP9dEjzwkRcdpucqDSC7i1MEiL2/waLssz3x5xKqiEZUpzdKMPbo2B1rHZABi801pmgJBzvSp5cq8KdGx4sToEQ== 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-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AvkgfNlo1Q58/XX2nDKmlLqfrLYDXq5hy0eOFPyg7Ei+g6leFlb9R5hFqMqzux6IfbeDMInkx49XYd4GkJXeQIcBGylNAo6lPI+rBRpzJfr4Cf5jTVAW3DeMKmReM9gFecPnHx//bqGsxbH18a9bv5UTBUiIa/mGtPvbSim7+A/BzVxyukWtodAmNfgKtsFKJxLwqzk2VBtkMe+Odl/vE3zuiQz6XBEtOiP6v4uagwPbPvYisEhZ6o8WmuiLT8SEqc9HEcBZtb44Lt5+edWWwdT2dtRK6mX9x0R8I2MDc6V1FdGNfP/tNu9VCBukNGlzHFl4u/MFsWftVw25/S0MNJx5DHtqJaQMNC72doMmOEj62XxVHmHveT4v0udKe8oRrIEroVHNAYwLkT1/bdmNs87F+TQyYXEnhfYBJjPxlF0KxnFQzRUy7iVo2zIjbm4TyQ27i7rSPEu9YIoV+v0pwW+/GdLaUs+w2xed0NEqvh7SUi/KD2KcJx3ZDGoSgZBy8NrcDrqhJgCJEocPQCB+yvLXKZu/tHiVRvxMHUVfjHOCCdevJr6kXTPVrMsPN+NKnkWAwbTcZgLLVFIbGgdf3+0J0GQ11yYxdAjbCKefJvRHU4I4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 10f30503-438f-4aed-c940-08dcb4e722fe 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:39:59.8696 (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: mnI5APbOwwhKn52a2rEKRbtA9HEi5S/j62XxkmP34LB6VQPtGyaiqH3igG6JE9RYW63+dMUKFgT+efuxluXl1dr8g7rfWnU0aOUK0vTv/f4i+VSQQ1EaqFUcmLhsqe05 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 Message-ID-Hash: HGMYBZUY2RYQI5MELFGRFTMLW6AGZT5B X-Message-ID-Hash: HGMYBZUY2RYQI5MELFGRFTMLW6AGZT5B 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/apple/mca.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/apple/mca.c b/sound/soc/apple/mca.c index 3780aca710769..60a5ecbd5f756 100644 --- a/sound/soc/apple/mca.c +++ b/sound/soc/apple/mca.c @@ -193,7 +193,7 @@ static void mca_fe_early_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct mca_cluster *cl = mca_dai_to_cluster(dai); - bool is_tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool is_tx = snd_pcm_is_playback(substream); int serdes_unit = is_tx ? CLUSTER_TX_OFF : CLUSTER_RX_OFF; int serdes_conf = serdes_unit + (is_tx ? REG_TX_SERDES_CONF : REG_RX_SERDES_CONF); @@ -230,7 +230,7 @@ static int mca_fe_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct mca_cluster *cl = mca_dai_to_cluster(dai); - bool is_tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool is_tx = snd_pcm_is_playback(substream); int serdes_unit = is_tx ? CLUSTER_TX_OFF : CLUSTER_RX_OFF; switch (cmd) { @@ -570,7 +570,7 @@ static int mca_fe_hw_params(struct snd_pcm_substream *substream, struct mca_data *mca = cl->host; struct device *dev = mca->dev; unsigned int samp_rate = params_rate(params); - bool is_tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool is_tx = snd_pcm_is_playback(substream); bool refine_tdm = false; unsigned long bclk_ratio; unsigned int tdm_slots, tdm_slot_width, tdm_mask; @@ -844,7 +844,7 @@ static int mca_hw_params(struct snd_soc_component *component, if (ret < 0) return ret; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) slave_config.dst_port_window_size = min_t(u32, params_channels(params), 4); else @@ -895,7 +895,7 @@ static snd_pcm_uframes_t mca_pointer(struct snd_soc_component *component, static struct dma_chan *mca_request_dma_channel(struct mca_cluster *cl, unsigned int stream) { - bool is_tx = (stream == SNDRV_PCM_STREAM_PLAYBACK); + bool is_tx = snd_pcm_is_playback(stream); #ifndef USE_RXB_FOR_CAPTURE char *name = devm_kasprintf(cl->host->dev, GFP_KERNEL, is_tx ? "tx%da" : "rx%da", cl->no); From patchwork Mon Aug 5 00:40:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816778 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 2A52DC3DA64 for ; Mon, 5 Aug 2024 00:58:50 +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 DD7CA5439; Mon, 5 Aug 2024 02:55:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DD7CA5439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819368; bh=nYhDtJJxz0GtgSsPqfNC176hRFTxIadSr9V1ydLfELw=; 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=P8tyk2iV4RJI8Tfkx/lAxvClHO3uFoVkPCbGsNxx8/dqxBx62oRmlR4DI8ACHbc+U rAJgEqt8EkEnJokmels+XhCC1nbOz+vx0Xis4yH5g6Z4QqxX9KlNvt7shbkIylWkQd wRBDn0jTGdUNB0nh34CHPhvOByr5IcwBOfXKyi58= Received: by alsa1.perex.cz (Postfix, from userid 50401) id F1368F89B6A; Mon, 5 Aug 2024 02:40:57 +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 922FEF80649; Mon, 5 Aug 2024 02:40:56 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7A1C2F89AEA; Mon, 5 Aug 2024 02:40:26 +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 ED969F89A44 for ; Mon, 5 Aug 2024 02:40:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz ED969F89A44 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=pKdgBLdC ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PsXwsoE0nWIi7Lt7+tFjBEFRRUEaSJBqbVlUzfkKuC0f2TCrvtARwMtGbWvzkDRaIYNrYF3JHyVcmC/M85HNZmUxiXAOluYkH+H1CGNcoDSlK3RPFbO082fSYW6mpv3VkXE3e3cvy7AkcY2M+gCDd2S7itvHwrWsu/NnfZ0ZFN5D5AdWNbyNlG09b3oSlAm7e1TQcol4Qz0pM/dbkJGhrlwGMvdXBjnSkqSIHvvHzpS0A/Kqnaq76NCJ1HFswo02E9cuFQn+y0lxn6GCJ2ojGur/ETZ6wgeFaSxJ26QCt+f6Q+P8X9/Noy8g7b/KUsyRxOVhh3W94JbzWu06t9wTWw== 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=Jiz4f3PvFB1vAvw15wSKm2E5Q/WtEYRPvjpgw7U1K/c=; b=E8bkTj59n2S+1aGA3dlGfHF4GZduiT7glrkvqBOT799IoGnpT9MHkWbiqWeKGa5lbVstahEzVbzH5/9kSTJDQ7ZeECwunhU6rRzRKxM7Yy5qb4ayw9sjiO+1311CjOZv8Tl3kOaod7m0QDoKd/UMWuyvY/i9Fi/gngSsy75AwWFCAGK6l9b/P8IasqqIOk1qOhYsGH2z9EU8ZwOYRwi/P3kdvX0wYn5S644czqpUg1E9wrtw0cxkUqAm6yQfSboUKuj0J8IL2c/1lo3VaCRWqoL762FAdFg1QpTk7mVLAzg06rdm5gVbcAlQZzfO1FWUuflqUdTrCXmTN5dBaGpT3w== 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=Jiz4f3PvFB1vAvw15wSKm2E5Q/WtEYRPvjpgw7U1K/c=; b=pKdgBLdC7b1fjHsgH0k3AGOxJ1B1juqIRbSjYxzhZ82Gse09zsVRUX9bffHJ9fan/I8H/SKTxnTETYPUqPi9DYhvrgZGNmyHdpZ3yk8PsuoxbZH/FXV6PJJ+u+do8FNXdbqpfXQvVBJLyXt1XyHlvlhEBTbApxQxCBToPE64k+k= 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:04 +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:04 +0000 Message-ID: <87plqnyf8c.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 060/113] ASoC: atmel: 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:04 +0000 X-ClientProxiedBy: TYAPR01CA0081.jpnprd01.prod.outlook.com (2603:1096:404:2c::21) 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: a0411bf7-4a9c-4688-58a8-08dcb4e72596 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: Det2qIaIdfOeBrVGnijpWInVW9N4/mGmDqDd8a+fD0qfr8/BKKUphnie+dGvaSeYGX+oQL6rBTEyadP53GE0Buy1qavmv6y/gAM90JvTVxqBkNbzdSdJzAna11GGga0KU+yXpDm6muLBkyLEkJUvJa4SdMUDF+/uSmM7EnQlu0XwY9V/ZT5HMNfLgkMSmgUQKV0hHCvj1QJdaLc/uNc2DXXoY96cv0vwJPaW8t51QgnxzLFEKN+Ea46iqJcytDK4o68wCIJLZ/FxrfZTejbhr+NgDWj+4Xw4eql91KLzggQ6eFDaNxuYN4CBhszWVIHd17Sk0uaSw00v5npHfrew1ZqOwSVRg6m0w4CUl5N0SmAqw+smju2bZ6SCrUdswayn0OxRSO+ngZdhxoG669yznkgdOzni8iBLoATfzzAvfFkDMs/Yl2T3epvtDP3P3IDpJ7/5lhLUCxuJ0GA8VJ39JpWAfA2/lSuTimVwOUrpmisfbCbvCt87YeakgihPXqEPbJqdkrczUqWUKpFYP3BCYmecNootJPbet9hWfAcv4WqyhlpDPuKEhvCCLWaWZgK+1phe/fCcf4LbA2dEfYmrETRK6SJyfClb9M76GC+t1miTRZzHLqpCKrs6CY0I8elr+lSAZ5cW+TzjwUfoZNiY8062EyHLSZLrI85sHCvOvNfDMGsj0Q5hGk7czuc4k18LZsPQ6jMD7iX5JW4LqOW40JHWuiPr7kDcydXrisV4CWwdo+IKIAn5VWwqghzuPLUrJHR582AnEqFa7pYYsR188sGTUGhqlO1MLiOloZGqdnIKSOK3eLbTIylXFgAC9GnUFltXVy2jG/Evgtr1eS+NepeoQInOy/6LKw3I8TweDSG29ePJE/PhAwCPlhwSnTIw7ZhPx6suFuqtD31jgRph/efdQk/iBbUUF5BUiYGUdVBbKNS8xwE8Tdu27osTRdqEQVxi739LVLHHBIHvHMuFwr3nns/xoz9ys7+w/Du++piAmd9L6yeUjIuKkZbljwSWKOijnaKqWShrfGhUFBEPsyqfYjsamJC0U0av5p+UsNn3kkSHW1lfktKSV9S7diOoOZbQt/NJ8xYTGzPcjukwqttsvBz7yav3UDey06UE9vBLwZpbECE/yrHjjBdW2juFAsPVT21c1F+LgefkSKKSg/RTEANRfdOT5+A+9OkB8eSKypywyPvLV4sGCu4mNz93At3oWUMu38DKnJN8LOeACSVIDt6EFjPdPHmuJT1rfTpMc+c4YywWmWOce5S+a/Oo4eZJf0CETkjjjALV8qvQSgGdR+1jbxobUxi4DBYdhzR8bnlVKCES/5I0n4/MeoBj3yQBxDuFONS3xqIn5DB/JjDLSIjMKRouYWgOj4K03xMcZdRyJwPSzYtOacX+5A3BLF66d/NlL0vIpPml79ERyg== 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: 842GAAM9h5WharxwqJ7k10LuaGeeqfmbHapHBvczClR3EFVrHATKGpJD4ZLutRZ/eqwSq/fE5xdabhqA/mhZqz163ecV75ufBofuU1Og5/GC6M2f1Sx4W12JtormsfjyhmZi2KaP05mlNRIv7iSCwlLBMhnUbzQ5kOOzzVuqybKGIeSv6V4BKgeCqxgXWuyUgreeGTFwqxaWTM9H76Egrd60FODELnrSAVkShOG2sM1BAE/T9VEnnyuLNcDAoOMr6eHFdwvbd8PwRagpSvyQeHBj6KIZvqZHvLMqp8dAb9iX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/shK+SHMhehZuoqPxq4NoNJkFZ4+YZkguVGEXNarkxGX3lwmC7qARI9Qvp3UdNsZ2x01nJgh1A2NrZgmlGAxMy942dHSDQI+HwFGJiu/0yC5/OynL1lsz6vpY5dvIBrV4BIedotqQxd8vOb6gFtyJPKBFliDiTXZcVZ2SHPV+hX+b2jh5PbYeIUnhsnysnGsj/8VrdjBxQxSpsJCNE1G49sbUsZRsJeZXqfqmPzHHlHtfnrYgY8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0411bf7-4a9c-4688-58a8-08dcb4e72596 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:04.1539 (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: P96EwjUOCtBnxKDqrpNvBe9j+8rLNVH7u5D5ihQV7RSy5gqgMrMgCBcAE1kqdgYh01yUJ0NOu35sG86r14TM1o2wyLisMIQs1fXow0EN4a8gqLGBHlwvWU0OBAmHHmSw X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 Message-ID-Hash: F34HOTOWIGUORQMMTT5ZI4FD54TXNHJY X-Message-ID-Hash: F34HOTOWIGUORQMMTT5ZI4FD54TXNHJY 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/atmel/atmel-i2s.c | 6 +++--- sound/soc/atmel/atmel-pcm-dma.c | 2 +- sound/soc/atmel/atmel-pcm-pdc.c | 2 +- sound/soc/atmel/atmel_ssc_dai.c | 10 +++++----- sound/soc/atmel/mchp-i2s-mcc.c | 6 +++--- sound/soc/atmel/mchp-spdifrx.c | 2 +- sound/soc/atmel/mchp-spdiftx.c | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sound/soc/atmel/atmel-i2s.c b/sound/soc/atmel/atmel-i2s.c index 6c20c643f3218..97bf80ba45531 100644 --- a/sound/soc/atmel/atmel-i2s.c +++ b/sound/soc/atmel/atmel-i2s.c @@ -272,7 +272,7 @@ static int atmel_i2s_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct atmel_i2s_dev *dev = snd_soc_dai_get_drvdata(dai); - bool is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool is_playback = snd_pcm_is_playback(substream); unsigned int rhr, sr = 0; if (is_playback) { @@ -324,7 +324,7 @@ static int atmel_i2s_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct atmel_i2s_dev *dev = snd_soc_dai_get_drvdata(dai); - bool is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool is_playback = snd_pcm_is_playback(substream); unsigned int mr = 0, mr_mask; int ret; @@ -477,7 +477,7 @@ static int atmel_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct atmel_i2s_dev *dev = snd_soc_dai_get_drvdata(dai); - bool is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool is_playback = snd_pcm_is_playback(substream); bool is_master, mck_enabled; unsigned int cr, mr; int err; diff --git a/sound/soc/atmel/atmel-pcm-dma.c b/sound/soc/atmel/atmel-pcm-dma.c index 7306e04da513b..f65c30a5dd4f7 100644 --- a/sound/soc/atmel/atmel-pcm-dma.c +++ b/sound/soc/atmel/atmel-pcm-dma.c @@ -60,7 +60,7 @@ static void atmel_pcm_dma_irq(u32 ssc_sr, if (ssc_sr & prtd->mask->ssc_error) { if (snd_pcm_running(substream)) pr_warn("atmel-pcm: buffer %s on %s (SSC_SR=%#x)\n", - substream->stream == SNDRV_PCM_STREAM_PLAYBACK + snd_pcm_is_playback(substream) ? "underrun" : "overrun", prtd->name, ssc_sr); diff --git a/sound/soc/atmel/atmel-pcm-pdc.c b/sound/soc/atmel/atmel-pcm-pdc.c index 7db8df85c54f3..81ad08d436a34 100644 --- a/sound/soc/atmel/atmel-pcm-pdc.c +++ b/sound/soc/atmel/atmel-pcm-pdc.c @@ -96,7 +96,7 @@ static void atmel_pcm_dma_irq(u32 ssc_sr, if (ssc_sr & params->mask->ssc_endbuf) { pr_warn("atmel-pcm: buffer %s on %s (SSC_SR=%#x, count=%d)\n", - substream->stream == SNDRV_PCM_STREAM_PLAYBACK + snd_pcm_is_playback(substream) ? "underrun" : "overrun", params->name, ssc_sr, count); diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 3763454436c15..3a8dd39537db8 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -290,7 +290,7 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream, if (!ssc_p->initialized) ssc_writel(ssc_p->ssc->regs, CR, SSC_BIT(CR_SWRST)); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { dir = 0; dir_mask = SSC_DIR_MASK_PLAYBACK; } else { @@ -337,7 +337,7 @@ static void atmel_ssc_shutdown(struct snd_pcm_substream *substream, struct atmel_pcm_dma_params *dma_params; int dir, dir_mask; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dir = 0; else dir = 1; @@ -476,7 +476,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, * each direction. If more are added, this code will * have to be changed to select the proper set. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dir = 0; else dir = 1; @@ -717,7 +717,7 @@ static int atmel_ssc_prepare(struct snd_pcm_substream *substream, struct atmel_pcm_dma_params *dma_params; int dir; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dir = 0; else dir = 1; @@ -741,7 +741,7 @@ static int atmel_ssc_trigger(struct snd_pcm_substream *substream, struct atmel_pcm_dma_params *dma_params; int dir; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dir = 0; else dir = 1; diff --git a/sound/soc/atmel/mchp-i2s-mcc.c b/sound/soc/atmel/mchp-i2s-mcc.c index 193dd7acceb08..017f363ed389d 100644 --- a/sound/soc/atmel/mchp-i2s-mcc.c +++ b/sound/soc/atmel/mchp-i2s-mcc.c @@ -517,7 +517,7 @@ static int mchp_i2s_mcc_hw_params(struct snd_pcm_substream *substream, unsigned int bclk_rate; int set_divs = 0; int ret; - bool is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool is_playback = snd_pcm_is_playback(substream); dev_dbg(dev->dev, "%s() rate=%u format=%#x width=%u channels=%u\n", __func__, params_rate(params), params_format(params), @@ -733,7 +733,7 @@ static int mchp_i2s_mcc_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct mchp_i2s_mcc_dev *dev = snd_soc_dai_get_drvdata(dai); - bool is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool is_playback = snd_pcm_is_playback(substream); long err; if (is_playback) { @@ -789,7 +789,7 @@ static int mchp_i2s_mcc_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct mchp_i2s_mcc_dev *dev = snd_soc_dai_get_drvdata(dai); - bool is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool is_playback = snd_pcm_is_playback(substream); u32 cr = 0; u32 iera = 0, ierb = 0; u32 sr; diff --git a/sound/soc/atmel/mchp-spdifrx.c b/sound/soc/atmel/mchp-spdifrx.c index 33ce5e54482be..653c575e9a1f6 100644 --- a/sound/soc/atmel/mchp-spdifrx.c +++ b/sound/soc/atmel/mchp-spdifrx.c @@ -436,7 +436,7 @@ static int mchp_spdifrx_hw_params(struct snd_pcm_substream *substream, __func__, params_rate(params), params_format(params), params_width(params), params_channels(params)); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { dev_err(dev->dev, "Playback is not supported\n"); return -EINVAL; } diff --git a/sound/soc/atmel/mchp-spdiftx.c b/sound/soc/atmel/mchp-spdiftx.c index a201a96fa6906..1e73a720ff6bb 100644 --- a/sound/soc/atmel/mchp-spdiftx.c +++ b/sound/soc/atmel/mchp-spdiftx.c @@ -358,7 +358,7 @@ static int mchp_spdiftx_hw_params(struct snd_pcm_substream *substream, __func__, params_rate(params), params_format(params), params_width(params), params_channels(params)); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { dev_err(dev->dev, "Capture is not supported\n"); return -EINVAL; } 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+GD15DbEF8yoQ8kiavxpEdLUxlbsPeqP7m01xP3tjehizFOqQgZ6LpS5cnKwbiO0Ir0ZHmal7CB1fig45azU5lskFNKzRB/oL8zjgzx3lFSQjAXCrW1Sx/X152LLZ7QSuDbBy0XUUWbaEKJQL1I4c/l8s7PbU42iH0CzoR+MDC81W1Et5x+jUv4w18Q1WNZ6QRFNWZ9TV81xMJla8i9hvTlbcRJb9C58iniUiCYWoWt3EzlxNPz8hc64ZbgcMg6V9DsUEd+YsII7C0U9TKpe8JWeyPnRij19RYW9cndlvp4LrAOyPv4Zt+xt7qwwmn6r/XuO351Mo2UGpVPX6+lJxBDDY1ITJFSTrMi02+XHtbY3F39h4gcCnA1it+MTSvf8zBf1mRVA51qIENQu9gUErrTt1UL230WJPgPFu7WubYlmvOSWc6/rT+m6QCGr6+VNai1I0xzGKN2VrScorFaTuZj2DbOoRXNa88nz6SbOUk1mFxmhFyssO+Z7LOT+NvSDQ19sHTLUtWiGi85Yqur6JbqRVQRfoZiWAhl0bJ9uJh2sNj1e3wahM2Q3QjW4XumvaI4KUfJyJ5W8y3DV2pwhrjj/eqHynqH7IKLwdrfaeSYXkPa0lOzRhZMOGomv0PiT0uGMP9fSSvID+b8DclMAcoWWUXPKrEhkqHJaqMsp6pNY5B2D7Pny6nbzzeXiAcFajaGDUS8tl52hnBkcte4itCjt1EUyqOSzwmSn+X/Ag4UcCvTszi6GuBz3ZyLY0Wb+H5dvlh/T21xZf1a0TA88ueyUzsDS36oqU25USp1mFi+Mt6oZuaADkZxCxdsbsxq0Q8YOTPXtlV9+goM5PN2BrBR9m4FE4jfZUrfufMjG330ILmVpfoc22hMVcFIT4tAjcqVaepB6elgmwh2cXkCf64VPIiNG224+cPdlsadHMEVS2sTufnQ30wMSVD8Rjy22iB9Bz1eVj5DoeSMpAc2//aIbgyjmgUS1h1cVGwyFmbf4ilYitfl91V8GhZafF7mo1Qv8jYbDIFZGQdymIcSnQtaXm/mg== 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: Fw14Sqy8LPHJM62fYepnx7qF7QbVUtB7GloxC076fMCY6AdPp9avDdu48ejW4ivv0fN3vzweyxtiTbV6blbr11/EL+qa59vvhfCenbUoIlNSAP/17TZJTqflfxMbU6Ve01q/DWPNd0jqNne6h2o1bT5xz2H7RfjqpIVQK+Z6YG7veGLjILYovS4T16MZQ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23Ofs5b9xsKRgOaRXUo7OcN7CEufOMB1eqVN7pPGfwa9sTy12RWwP1/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); From patchwork Mon Aug 5 00:40:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817098 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 D4719C3DA64 for ; Mon, 5 Aug 2024 00:58:04 +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 8B0D8529D; Mon, 5 Aug 2024 02:55:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8B0D8529D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819320; bh=75M3W4tVW9VeOc3MM+rbL8QGy0lIRnEwziVOJroiqOQ=; 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=CPVZeJEG9qLVnw5L92einmUMsTa+sgIddR1paxGimZFfX0KRVZ+5DvRyFjbuHJ51Y jKdttDz3XJPaKTo9oYEg82KO1UD9dKBWJGncfOrDrenApDj4VN1VsRdxV4mlGGT5KA cpp1r6kzIqzf4akhbim5OtpOVZhCEkMgRBW05Cvk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 97333F8067A; Mon, 5 Aug 2024 02:40:47 +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 A5A56F89B63; Mon, 5 Aug 2024 02:40:47 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 11197F89AE2; Mon, 5 Aug 2024 02:40:33 +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 ACB24F89A35 for ; Mon, 5 Aug 2024 02:40:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz ACB24F89A35 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=a0gxzLkS ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pXzAnQrxY2LWf0DK86sPZcVr3+Pp2dW8zdPOpLiV2u6oqqL+xFblQfEH0s871sVNh9kKBYk8BnVhm/CcIJErcOtKIL9CHArHL1L6C+VDLFFGhcBMGdZSTlNffRAGN0DFAaremQ2Hkouzu1g4cqeYWIKSNAtjFJokVRmSXt6Wo/mzi9z+yxgM7Yc+2qUfZSxCZ9dQZt7vWwRt6/68zOw4ePeUqEQVVU+ASEvCqYfeyqzUPJWuz+UrvU3kuJ6oA3rjquoutuTYEaJM2PywBBIUSXcuyN60FvztykvVPKV78CeMQA5/zsYTX46rYuUSAQfDCFJmfwfckI7JYOKo9+InKQ== 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=kxRIoimJe05t2bsWKGO+/4Yh3+LXfJPxjHOA16YHuZ8=; b=gaWdf+S7gxq70YXPbHm3sYHVurf9SZ+QF/j0+WUjeH7qniYWm7cxXAOKqGVUZpiKEXPXorgv16GTtWEOmLCtEgWyfmf11PCWO58GxwMlPnhPwkZ8Sp4NKdDVdk17BtpTrExnSP+H5YAIJBWjid6tiwWY8jdWORF9bstaXaR1kD3SNvwNr+WcEmIlhkAptTzAqu3M6kegynplpch/AY+C+Rbs7X5hLrx3OJ+MwYcawoLfEm+buXUhmE2wd6MBiZfCrHuHBtF/GhNOeLa/A3EeGp3yvP382tQUQFrwSuHeQCvigaFoxHFw3XQ5rOhUqCjqklLRgiTqnV1R3gpLmEmw/Q== 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=kxRIoimJe05t2bsWKGO+/4Yh3+LXfJPxjHOA16YHuZ8=; b=a0gxzLkSRFBSzJb6cFD7lYfPQdRtbau7Wr3vcmtXC6XV3zz4+1yshIgZXnZ2X+5b0mdPMZvmRDcE+as2+wfWVU0U+62XTf038PoR4w1Y5l0e9KjZAFXaMPjh+oLwANtYVWWo6QGXWBHhPToePMe7UnJMcMA59/Y4XoC8rGfjCxk= 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:12 +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:12 +0000 Message-ID: <87mslryf83.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 062/113] ASoC: 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:40:12 +0000 X-ClientProxiedBy: TYCP286CA0257.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:455::8) 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: 944a19d4-bcb0-4bac-c189-08dcb4e72ab3 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: Gvb3nm7ohmvwAan/Fta5CjsNa7NJVnWe0l/kwehd2n7Pphfr3J3c87Wo6GJ+sHMcI+prPxA6dtPpChlnEvuzZG30VVLDvTlC7SzStg0l1CYhyaP0RRmmyvZZBWvly+segHJSRu7VTqA7Lch6OKJlgBaEo+zRm7If5F9w6zhg2HjGdwGQjAoI2TqYOyy2vaRw9Dx9uLke/hFQPGrZrQoahHF5UiPyUmwf+QtnJ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s8YnaIAAPUmf5XnJ/Q/KFsYropMAMsRxZ5Kdd6MqT0mUSjmDIO9xCm0+DP7wj/m+MCCTi7+Kf4miz8vyrElib2LQUv+3wf2GYF3mRvkjo+bEnFItc4boA== 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: lMe25fXS//aO5TPGkigH6QkjIKzwcMvMF59GliZzWtYWJojS2vKkurtflbzoDAtRVLY4MoBrkJKbyGVnG2waFVPBrkPHSXRov0zduTh/oMhF6qsLPk3HoU/UiUoBy9xRH4hVh9VJfW5YcXGqs878lp90DQ6oUZ8IlkmW3Bl63bu5krp09ScwWgW4lW50+twzenGf8bGlB9bSuucCVH7nqZcP5/78BlSj7MbWT129uaWUODtrM++/hs0EQ7OVNdGG8o/CvxOo114EZYOW/kF2nvc7fEDu2N2mFpD9UOajoZ60qQJfhhKSrg4Hq2XjNs1Z7lYbRDzzzbBb2nY4ovveWsVJRak1kJEVs7H6qvE1yU1kq4HketwH5ymnf0pTVcQlCt6Bg1TOoTxCivbH5rcL4WGBTiFxVuNRYQsP1gvmE8wjD7s/u08FmkN36LQ3OZ0WDGVATmBTc029dZUk0Spss3ZWXTmQrxVGR7A0R1WQYosWngdHeByEyarLKJd59zFK265I41pkvYI7c95QVLedg+dd9+rN+B2G2dtMJ/tQ1/1qHTJKq7nvFosXh0JIWQf+z9RCzv4DGYS+QR5+M0j49uRy/R1jY9mcF5OrPOIXyWWe4vgB5u2GmE3fHBz73ngjJtKneKAjEio7EeDOZrGLkDcdxermO1GYgMCJB3Vc4uBR1vxKN3pazxHcbYG76xL+PlZiZLr4NiSKrMJAoOF1Jsl36CTPanY3BJ4sAydFDVIhg4N+lNm4nacCyoGRiQNZvE8bQ3klyiRY0HK+orVwzVV9znjT1Ju+mIsl5sIxzz58nFHbK61p1ooB/CEyQwh+KqL8DlVP7u2uPg0lyNcilXlY0JSJcRK/LUvsgrlpAztKxlbjBy4QH8ciWY0C7qLzNl0VeSC5Ci0BcOyhdMyuFPw/YSULRj1EOBpvgxkzPpBkmKfbVNh8Jz0AWqtoDb01RPUgPqLGInhT7UMzej+Oi3hD7jLrtXhht25akaAZlqp89QDgwdF5X4JcAhv/15ztrdTqThfPpql9t+KvpP6mqaZr/rSLL/PxSaTjHn7fkYJkKkrVQr5hcTHD1PNPMcVTiK9aiV38EFAEOzrGNJ/O6O7IGhh0K69tHH/v8HdOuZdRk8aVQgeYjjqFE2K/fAnS7qPgInFZ+z1Ka/7okR03PEx757SNHE9MfT1biubOiVJkNnoguoQ/Z7IKGvH7WUrIkTg2JG5b3e9Pm3BDHptkrWGdgioziTDz9jLryC5KLOvE+2taeownwtCzsvpg/CgNNhGOsOWH+hRC0/Wonv0GqS4riu9Jw0YyVTGs4w2fDW1GEScqt4IW6xuB8NqqXQ9SLCVsMjNOH8gDH1Xw+QKZ1Pq1SZde8Bs41Co/5T6hh9JbmE3ZDyM1Q9PE/ZD5HJtFRwsFlHBWGS/jQglMgnyX/RARN3imnKcvEOCDVU3SopL/mKgI1cGEkHvhXWAoXXwJBuxiLKG0KwOx07HEyaE7y8YCRgMi8xcwYu5wKdB22Tu22Kcxs+nkVEJulijYOFAiLDg74LPAAWsEXnqYdPE7puYbgPBq5855YBqJDi4SEAey0x7h7IbItBj0CW2K87Sr0GTpksVkp3FQFKeSKdGoYh2SF3CegFpTJ6wb7kmtIAs= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 944a19d4-bcb0-4bac-c189-08dcb4e72ab3 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:12.7454 (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: SQ4vBiGo7hIxn9C5VXriDnMNgruvZL87cAbd22LoEuT8Qpd4C0JAma4vBzx2D0HQT5t3IVQ6Gz4sefDA5NR0ye1OCNa1Wgaf03uADAabTLCO/ZRAyYwyZAaH/rR9KXxJ X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 Message-ID-Hash: H76Z343XSOI47M6FO37QWSIDK5RCV4FH X-Message-ID-Hash: H76Z343XSOI47M6FO37QWSIDK5RCV4FH 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/atom/sst-atom-controls.c | 2 +- sound/soc/intel/atom/sst/sst_drv_interface.c | 2 +- sound/soc/intel/boards/bdw-rt5650.c | 2 +- sound/soc/intel/boards/sof_maxim_common.c | 2 +- sound/soc/intel/boards/sof_sdw.c | 4 +-- sound/soc/intel/catpt/pcm.c | 4 +-- sound/soc/intel/keembay/kmb_platform.c | 28 ++++++++++---------- sound/soc/intel/skylake/skl-pcm.c | 14 +++++----- sound/soc/intel/skylake/skl-topology.c | 18 ++++++------- 9 files changed, 38 insertions(+), 38 deletions(-) diff --git a/sound/soc/intel/atom/sst-atom-controls.c b/sound/soc/intel/atom/sst-atom-controls.c index 38116c7587174..0c6ce403148f8 100644 --- a/sound/soc/intel/atom/sst-atom-controls.c +++ b/sound/soc/intel/atom/sst-atom-controls.c @@ -1333,7 +1333,7 @@ int sst_send_pipe_gains(struct snd_soc_dai *dai, int stream, int mute) dev_dbg(dai->dev, "enter, dai-name=%s dir=%d\n", dai->name, stream); dev_dbg(dai->dev, "Stream name=%s\n", w->name); - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { snd_soc_dapm_widget_for_each_sink_path(w, p) { if (p->connected && !p->connected(w, p->sink)) continue; diff --git a/sound/soc/intel/atom/sst/sst_drv_interface.c b/sound/soc/intel/atom/sst/sst_drv_interface.c index dc31c2c8f54c8..f02ee7f48a2a4 100644 --- a/sound/soc/intel/atom/sst/sst_drv_interface.c +++ b/sound/soc/intel/atom/sst/sst_drv_interface.c @@ -487,7 +487,7 @@ static inline int sst_calc_tstamp(struct intel_sst_drv *ctx, fw_tstamp->ring_buffer_counter); dev_dbg(ctx->dev, "mrfld hardware_counter %llu in bytes\n", fw_tstamp->hardware_counter); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) delay_bytes = (size_t) (fw_tstamp->ring_buffer_counter - fw_tstamp->hardware_counter); else diff --git a/sound/soc/intel/boards/bdw-rt5650.c b/sound/soc/intel/boards/bdw-rt5650.c index 3c7cee03a02e6..a5df4d3067d71 100644 --- a/sound/soc/intel/boards/bdw-rt5650.c +++ b/sound/soc/intel/boards/bdw-rt5650.c @@ -150,7 +150,7 @@ static int bdw_rt5650_fe_startup(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; /* Board supports stereo and quad configurations for capture */ - if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(substream)) return 0; runtime->hw.channels_max = 4; diff --git a/sound/soc/intel/boards/sof_maxim_common.c b/sound/soc/intel/boards/sof_maxim_common.c index fcc3b95e57a4f..f520442bbb096 100644 --- a/sound/soc/intel/boards/sof_maxim_common.c +++ b/sound/soc/intel/boards/sof_maxim_common.c @@ -196,7 +196,7 @@ static int max_98373_trigger(struct snd_pcm_substream *substream, int cmd) int ret = 0; /* set spk pin by playback only */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) return 0; cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index d258728d64cf5..5818c21173032 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -846,8 +846,8 @@ static int create_sdw_dailink(struct snd_soc_card *card, WARN_ON(i != num_cpus || j != num_codecs); - playback = (stream == SNDRV_PCM_STREAM_PLAYBACK); - capture = (stream == SNDRV_PCM_STREAM_CAPTURE); + playback = snd_pcm_is_playback(stream); + capture = snd_pcm_is_capture(stream); asoc_sdw_init_dai_link(dev, *dai_links, be_id, name, playback, capture, cpus, num_cpus, platform_component, diff --git a/sound/soc/intel/catpt/pcm.c b/sound/soc/intel/catpt/pcm.c index 81a2f0339e055..c32c101e65b9c 100644 --- a/sound/soc/intel/catpt/pcm.c +++ b/sound/soc/intel/catpt/pcm.c @@ -83,11 +83,11 @@ catpt_get_stream_template(struct snd_pcm_substream *substream) /* account for capture in bidirectional dais */ switch (type) { case CATPT_STRM_TYPE_SYSTEM: - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) type = CATPT_STRM_TYPE_CAPTURE; break; case CATPT_STRM_TYPE_BLUETOOTH_RENDER: - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) type = CATPT_STRM_TYPE_BLUETOOTH_CAPTURE; break; default: diff --git a/sound/soc/intel/keembay/kmb_platform.c b/sound/soc/intel/keembay/kmb_platform.c index 37ea2e1d2e922..eab7b8223b51b 100644 --- a/sound/soc/intel/keembay/kmb_platform.c +++ b/sound/soc/intel/keembay/kmb_platform.c @@ -170,7 +170,7 @@ static inline void kmb_i2s_disable_channels(struct kmb_i2s_info *kmb_i2s, u32 i; /* Disable all channels regardless of configuration*/ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { for (i = 0; i < MAX_ISR; i++) writel(0, kmb_i2s->i2s_base + TER(i)); } else { @@ -184,7 +184,7 @@ static inline void kmb_i2s_clear_irqs(struct kmb_i2s_info *kmb_i2s, u32 stream) struct i2s_clk_config_data *config = &kmb_i2s->config; u32 i; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { for (i = 0; i < config->chan_nr / 2; i++) readl(kmb_i2s->i2s_base + TOR(i)); } else { @@ -199,7 +199,7 @@ static inline void kmb_i2s_irq_trigger(struct kmb_i2s_info *kmb_i2s, u32 i, irq; u32 flag; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) flag = TX_INT_FLAG; else flag = RX_INT_FLAG; @@ -270,7 +270,7 @@ static int kmb_pcm_trigger(struct snd_soc_component *component, switch (cmd) { case SNDRV_PCM_TRIGGER_START: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { kmb_i2s->tx_ptr = 0; kmb_i2s->tx_substream = substream; } else { @@ -279,7 +279,7 @@ static int kmb_pcm_trigger(struct snd_soc_component *component, } break; case SNDRV_PCM_TRIGGER_STOP: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) kmb_i2s->tx_substream = NULL; else kmb_i2s->rx_substream = NULL; @@ -378,7 +378,7 @@ static snd_pcm_uframes_t kmb_pcm_pointer(struct snd_soc_component *component, struct kmb_i2s_info *kmb_i2s = runtime->private_data; snd_pcm_uframes_t pos; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) pos = kmb_i2s->tx_ptr; else pos = kmb_i2s->rx_ptr; @@ -419,7 +419,7 @@ static inline void kmb_i2s_enable_dma(struct kmb_i2s_info *kmb_i2s, u32 stream) dma_reg = readl(kmb_i2s->i2s_base + I2S_DMACR); /* Enable DMA handshake for stream */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) dma_reg |= I2S_DMAEN_TXBLOCK; else dma_reg |= I2S_DMAEN_RXBLOCK; @@ -433,7 +433,7 @@ static inline void kmb_i2s_disable_dma(struct kmb_i2s_info *kmb_i2s, u32 stream) dma_reg = readl(kmb_i2s->i2s_base + I2S_DMACR); /* Disable DMA handshake for stream */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { dma_reg &= ~I2S_DMAEN_TXBLOCK; writel(1, kmb_i2s->i2s_base + I2S_RTXDMA); } else { @@ -451,7 +451,7 @@ static void kmb_i2s_start(struct kmb_i2s_info *kmb_i2s, /* I2S Programming sequence in Keem_Bay_VPU_DB_v1.1 */ writel(1, kmb_i2s->i2s_base + IER); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) writel(1, kmb_i2s->i2s_base + ITER); else writel(1, kmb_i2s->i2s_base + IRER); @@ -474,7 +474,7 @@ static void kmb_i2s_stop(struct kmb_i2s_info *kmb_i2s, /* I2S Programming sequence in Keem_Bay_VPU_DB_v1.1 */ kmb_i2s_clear_irqs(kmb_i2s, substream->stream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) writel(0, kmb_i2s->i2s_base + ITER); else writel(0, kmb_i2s->i2s_base + IRER); @@ -556,7 +556,7 @@ static void kmb_i2s_config(struct kmb_i2s_info *kmb_i2s, int stream) kmb_i2s_disable_channels(kmb_i2s, stream); for (ch_reg = 0; ch_reg < config->chan_nr / 2; ch_reg++) { - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { writel(kmb_i2s->xfer_resolution, kmb_i2s->i2s_base + TCR(ch_reg)); @@ -678,7 +678,7 @@ static int kmb_dai_prepare(struct snd_pcm_substream *substream, { struct kmb_i2s_info *kmb_i2s = snd_soc_dai_get_drvdata(cpu_dai); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) writel(1, kmb_i2s->i2s_base + TXFFR); else writel(1, kmb_i2s->i2s_base + RXFFR); @@ -695,7 +695,7 @@ static int kmb_dai_startup(struct snd_pcm_substream *substream, if (kmb_i2s->use_pio) return 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dma_data = &kmb_i2s->play_dma_data; else dma_data = &kmb_i2s->capture_dma_data; @@ -713,7 +713,7 @@ static int kmb_dai_hw_free(struct snd_pcm_substream *substream, if (kmb_i2s->use_pio) kmb_i2s_clear_irqs(kmb_i2s, substream->stream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) writel(0, kmb_i2s->i2s_base + ITER); else writel(0, kmb_i2s->i2s_base + IRER); diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c index 613b27b8da134..2ffd511eedfe4 100644 --- a/sound/soc/intel/skylake/skl-pcm.c +++ b/sound/soc/intel/skylake/skl-pcm.c @@ -189,7 +189,7 @@ int skl_pcm_link_dma_prepare(struct device *dev, struct skl_pipe_params *params) snd_hdac_ext_stream_setup(stream, format_val); stream_tag = hstream->stream_tag; - if (stream->hstream.direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream->hstream.direction)) { list_for_each_entry(link, &bus->hlink_list, list) { if (link->index == params->link_index) snd_hdac_ext_bus_link_set_stream_id(link, @@ -225,7 +225,7 @@ static int skl_pcm_open(struct snd_pcm_substream *substream, * disable WALLCLOCK timestamps for capture streams * until we figure out how to handle digital inputs */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { runtime->hw.info &= ~SNDRV_PCM_INFO_HAS_WALL_CLOCK; /* legacy */ runtime->hw.info &= ~SNDRV_PCM_INFO_HAS_LINK_ATIME; } @@ -319,7 +319,7 @@ static int skl_pcm_hw_params(struct snd_pcm_substream *substream, p_params.host_dma_id = dma_id; p_params.stream = substream->stream; p_params.format = params_format(params); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) p_params.host_bps = dai->driver->playback.sig_bits; else p_params.host_bps = dai->driver->capture.sig_bits; @@ -574,7 +574,7 @@ static int skl_link_hw_params(struct snd_pcm_substream *substream, p_params.link_index = link->index; p_params.format = params_format(params); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) p_params.link_bps = codec_dai->driver->playback.sig_bits; else p_params.link_bps = codec_dai->driver->capture.sig_bits; @@ -645,7 +645,7 @@ static int skl_link_hw_free(struct snd_pcm_substream *substream, if (!link) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { stream_tag = hdac_stream(link_dev)->stream_tag; snd_hdac_ext_bus_link_clear_stream_id(link, stream_tag); } @@ -1193,7 +1193,7 @@ static snd_pcm_uframes_t skl_platform_soc_pointer( * or greater than period boundary. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { pos = readl(bus->remap_addr + AZX_REG_VS_SDXDPIB_XBASE + (AZX_REG_VS_SDXDPIB_XINTERVAL * hdac_stream(hstream)->index)); @@ -1226,7 +1226,7 @@ static u64 skl_adjust_codec_delay(struct snd_pcm_substream *substream, codec_nsecs = div_u64(codec_frames * 1000000000LL, substream->runtime->rate); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) return nsec + codec_nsecs; return (nsec > codec_nsecs) ? nsec - codec_nsecs : 0; diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index 602ef43211221..cb51b98b92c9a 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c @@ -198,7 +198,7 @@ static void skl_tplg_update_params_fixup(struct skl_module_cfg *m_cfg, in_fmt = &m_cfg->module->formats[m_cfg->fmt_idx].inputs[0].fmt; out_fmt = &m_cfg->module->formats[m_cfg->fmt_idx].outputs[0].fmt; - if (params->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(params->stream)) { if (is_fe) { in_fixup = m_cfg->params_fixup; out_fixup = (~m_cfg->converter) & @@ -618,9 +618,9 @@ skl_tplg_get_pipe_config(struct skl_dev *skl, struct skl_module_cfg *mconfig) } if ((pipe->conn_type == SKL_PIPE_CONN_TYPE_FE && - pipe->direction == SNDRV_PCM_STREAM_PLAYBACK) || + snd_pcm_is_playback(pipe->direction)) || (pipe->conn_type == SKL_PIPE_CONN_TYPE_BE && - pipe->direction == SNDRV_PCM_STREAM_CAPTURE)) + snd_pcm_is_capture(pipe->direction))) in_fmt = true; for (i = 0; i < pipe->nr_cfgs; i++) { @@ -1612,7 +1612,7 @@ int skl_tplg_update_pipe_params(struct device *dev, if (skl->nr_modules) return 0; - if (params->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(params->stream)) format = &mconfig->module->formats[mconfig->fmt_idx].inputs[0].fmt; else format = &mconfig->module->formats[mconfig->fmt_idx].outputs[0].fmt; @@ -1642,7 +1642,7 @@ int skl_tplg_update_pipe_params(struct device *dev, return -EINVAL; } - if (params->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(params->stream)) { res->ibs = (format->s_freq / 1000) * (format->channels) * (format->bit_depth >> 3); @@ -1666,7 +1666,7 @@ skl_tplg_fe_get_cpr_module(struct snd_soc_dai *dai, int stream) struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(dai, stream); struct snd_soc_dapm_path *p = NULL; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { snd_soc_dapm_widget_for_each_sink_path(w, p) { if (p->connect && p->sink->power && !is_skl_dsp_widget_type(p->sink, dai->dev)) @@ -1745,7 +1745,7 @@ skl_tplg_be_get_cpr_module(struct snd_soc_dai *dai, int stream) struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(dai, stream); struct skl_module_cfg *mconfig; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { mconfig = skl_get_mconfig_pb_cpr(dai, w); } else { mconfig = skl_get_mconfig_cap_cpr(dai, w); @@ -1813,7 +1813,7 @@ static int skl_tplg_be_fill_pipe_params(struct snd_soc_dai *dai, goto err; dev_dbg(skl->dev, "%s using pipe config: %d\n", __func__, pipe->cur_config_idx); - if (pipe->direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(pipe->direction)) pipe_fmt = &pipe->configs[pipe->cur_config_idx].out_fmt; else pipe_fmt = &pipe->configs[pipe->cur_config_idx].in_fmt; @@ -1903,7 +1903,7 @@ int skl_tplg_be_update_params(struct snd_soc_dai *dai, { struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(dai, params->stream); - if (params->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(params->stream)) { return skl_tplg_be_set_src_pipe_params(dai, w, params); } else { return skl_tplg_be_set_sink_pipe_params(dai, w, params); From patchwork Mon Aug 5 00:40:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817096 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 4704DC3DA7F for ; Mon, 5 Aug 2024 00:58:59 +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 D367A5455; Mon, 5 Aug 2024 02:56:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D367A5455 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819378; bh=IAMDvzRra5MeuVT1tM2FeOOX5KqdE+0He4WrUT6IZmI=; 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=jR6HQf17HL4+uJIRgu2OxTRaN/G2FEJpFOqvN06GtnJw8tOyAIba4Dm4Jdy9WhaAS QUsB8T3/ApYJOa1UtJKvW5LPZ3nJ3lCn5ilQsyvOQl0nJ4CcxJCOMNz7mGL1s1YZTy yI2xzGtb+8+ad9e8SO/q4AIQue1+u+jimGavgzzY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3B2F0F89B9D; Mon, 5 Aug 2024 02:40:58 +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 38145F89BAD; Mon, 5 Aug 2024 02:40:58 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3144FF899F1; Mon, 5 Aug 2024 02:40: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 9394EF8990B for ; Mon, 5 Aug 2024 02:40:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9394EF8990B 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=MdT7GRF2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DQVaUIcdLqm7lG6oml0Q/9HUvjC6NWLBcryVD+cJdsvbsJyhoOma2C02RMdKtweVwRYKIqPxaWT0GSLEcEmL+BWfli02EJGLL0W10fHyUmib93NyrNxgqexI7bUP3unEHDBLJ5JZZ/AlGw8sBBF5PECjsUMQW/l2A41gvi/I7/XXn2mFCwSasnyztzS859L0qwYEMPDugtoC7eDrooW9+xq+Ckwjm/I+n3ViJtKGvQwULal04K1QHEqKstOQx/GzfK0N6ajNzLl0IY89GIOAMYGFofema82njBV1O2JKt+kpvJIR+4hSaxH7DINaJXbq2K2yazm968rDQSJl1O3CTg== 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=FW5a6qc7CqTdA20LP48e5waaE0QSt6DPfGZDBEvYLsc=; b=Z0pX2P+SljSLkxGRhMscnRAHYxYwQE1g7GFA2r0BTjyPysyMgEkA3+jM70vbhEpSe0Rd1cpl/eIg7trc46Rav7BnJ41SEy+UkBjGchpq1u5e74E6WEZmZAKwh1C7Zo7MQ17iF7YbFI2TGQ3gIH39Gv9q9wtpQzaDRQBmFxyBaZYAjjG7sMwP9xd1+ecepi46/xy1wx3lm3GwHBLerv7g6J/uPJeWtnuAgXD4w1G3ol/Jf/s3ydMaJFABHrJRwBkiuQ7fDEjnMSjJXXKb2d2PjcWIDTuH81ObiZ0H2dF+wRntSop4aol0bA1TSCx9k6PXtnN7kOqI6ZGMuuxLeaKe3w== 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=FW5a6qc7CqTdA20LP48e5waaE0QSt6DPfGZDBEvYLsc=; b=MdT7GRF2d+H7sRZgQvnQNNw6jr9b8Wgr/gwzKjCE4rvlxSCI1rjeKD1qv4BqiupG1dTrz0bJZ+EUrxqchaQGdV9YIPRIMW7Rt2k2jVnI+gkXBeYshF7i2i4bqd++IFF3eihCPLODz7GyT2R6BFPNWZfRAHgLtMMWqiOenBXszqk= 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 OS3PR01MB9302.jpnprd01.prod.outlook.com (2603:1096:604:1cf::11) 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:17 +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:17 +0000 Message-ID: <87le1byf7z.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 063/113] ASoC: soc-*: 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:16 +0000 X-ClientProxiedBy: TY2PR02CA0055.apcprd02.prod.outlook.com (2603:1096:404:e2::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_|OS3PR01MB9302:EE_ X-MS-Office365-Filtering-Correlation-Id: 880f5b9a-f3df-48fa-ccf4-08dcb4e72d47 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: dwxGdyNrR/QWB+2Nnz5HpIdcYaUF5EuKDLziowkbwdpbhJ2hNUt6a/Y7vHPCSASU+eR5ugTzC6Qicd9Td9X6BZZ1xzbfx1Fs4IvhQ8g3mSBaYFkbwjd1bdxFyuSyTuqkDbnrnpSFA5Bdq5bjmbBXEnVm5GgGOtQqqcKU713mDQk8vQqyDmQnTPh0LsiCgaA0TXiYXeDHDEpQPF8ARAQtM3hxaa59wAI73kgQL9XBO59R5+Hwl95HO4w8dWcK39A7WjQX/AomoUdo6TLAWAcE+jXPjgj3Eh/qRg8lxcDW+ua0ulFDx+vWxDiAEefTY0GKbD58/R4IhDeeNiYsArrQxuDNEq3Yd9L0vEbUsJ9fBkVdBxKXGiWV3lmQKebOzC2hWJ8qEFv6LfwQR/h6/9WMubdX3YWlEgQYAIH4s+Mh0bkBoYOkpwcUToLdkdSIDnsaSdvnqp8gkSxs0NTohwC7ugltcPRGukQDnHz9uCiNhDPTxlZEBBXHrECEvqOlct2xQ2hJ6axV6GuhAc5KpT698slUEkHyD/hmeQVMLgqcDeVWxYQOxZK6+O69zrdIELTBhnX/7KUwLJ14MqSlgyNshC8ygZx7sNzfPsapHqm/ArQqjfJcp8X2M+8ZIscbLdEcr3mhOmAmyMw60aPaWPZctG0bRfQq13Yv9r5vQetagt1EGe0Hva09Fnf8jWdjqQcgtQWH5p2dkTdXkG4O440UJvD7lPLn6ysKS6vB/U6v1syuI4YNqvA8jNqna+1Iod1z4qV50cNi1sidxHuEUy5iD0xRg14vPKgkZWy3bxc+7SBZoPQmJSe3+sciS1WNAXSiZtCrGcodYJql8o/tvAYEpJ8/CpLH+HnWCdZqcgwwRP29qCrGPioGcnxTKrWQXO+YzOpBR8kRYFMbWpANz3QLs84wJuT1KkKXlwdY1AmqwpOrsZj9b2P9goWuKl6766l102Gwdj8PlVPTT73Fe9ICKZ5WZFEbTMkxKlalh2KMF/XKpxby/UhXtr8m0QvfQA9ie9/m8ZRpqY8GcXfgs1+o+g5HDnYaNO1RFpsy2jw5U2MOnOEaAgXpCtPMmLMVNWoYBraGp70n43velWg8+v8umqMuZiRsAM2Ly5RiLlSJifTvPhAmvembb92ekdkg3WBaRx1soXfxUDV+pirkSIpmz3kU9exI7JXsCq1r1QQNbjp1t4DlDk7ABbDo2oUFfNzP/eYGzs9OjffOGLbxqoqKZtvUJMX91FHoD7bZ6c2VJSeu4LBGvtfTYo0QIi8+KAQYlV/nXIRZxtF/QT+LUwZIjIEoKDLGBq0a+Vkob/wzpDndnWzcV6Mm+P9l49x3QO/1pEStvnyEkC5Uj5RAK1J502J74oX2nFCUZGwZletzG6YAGyvaU/yMWDpGVafyQP7yptNKFhN0aVgVjMDZiMU+cQ== 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: PEJWKpj0gUddbFXKdgS5PbcCYY4QRDJzIYs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tWq/KpB1XHpp3TZ/1wrQ8PbqjkSXY4HM7ZMHccQKXD7e3H9gYFZfCbUJ63ThlR5SN15e3gJg/V4ZB2WPuFKCntn5TmnX6WWQatNAGpSCuILo4CJ1RCALGnLnuenjkj3XagR2hfWsxFf9JF5kke8q9b/C2ouPQW3+6Z/wDkiHd/gP4gCyjslg0lfNrnhKSJ2DY46rNf8xIi2U1isK4yzX9N8kDFW7/4DZ7e1OJnaWaSPfqk1FasxjR9w47XGqpA/rLsVmJvvA3JCwPDyo5rjQigyvuRjbPTZiAGpcx/4hhfu0YkKw9WXMJOeDkb6r4hauZpIvntwG2So4GPHzYSOWr50QRJ9G/bBO9Bn9Fad2avULV1bJjQ+D1LPmiDTiN04fJATMGKWaS+8g4swIsjb4nzT1VRNWjDbiI8Xy5bBSOPJrN6Tu+p8M4QUekphaIoEXNDg/vHYLXZ0h3YxanLd6jOocwy5pRlZbtLdzgPz5JiNnW8giE9/yZ3dpBmnEzgLh8OrJ4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 880f5b9a-f3df-48fa-ccf4-08dcb4e72d47 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:17.0775 (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: IH2hkaagf8Oq4sfxXR8KURVMTufKDYGWlxA2hOEz6HqP42IHnQkPf5dq3A6C4zwZqL1IpgipHuR1KpDEYdx4VNyQ7cTVtsOKMm00sH4RkFbJLJwT1p3Bc/oosT/Sjjkc X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9302 Message-ID-Hash: HQUWEKDEMMYMSGY6Z6M4B4BTCJSEQ4A2 X-Message-ID-Hash: HQUWEKDEMMYMSGY6Z6M4B4BTCJSEQ4A2 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/soc-core.c | 2 +- sound/soc/soc-dai.c | 2 +- sound/soc/soc-dapm.c | 4 ++-- sound/soc/soc-generic-dmaengine-pcm.c | 2 +- sound/soc/soc-pcm.c | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 20248a29d1674..286e872ae4547 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3456,7 +3456,7 @@ int snd_soc_get_stream_cpu(const struct snd_soc_dai_link *dai_link, int stream) * CPU : SNDRV_PCM_STREAM_PLAYBACK * Codec: SNDRV_PCM_STREAM_CAPTURE */ - if (stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(stream)) return SNDRV_PCM_STREAM_PLAYBACK; return SNDRV_PCM_STREAM_CAPTURE; diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index 9e47053419c16..28a0a7a0993af 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -379,7 +379,7 @@ int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute, */ if (dai->driver->ops && dai->driver->ops->mute_stream && - (direction == SNDRV_PCM_STREAM_PLAYBACK || + (snd_pcm_is_playback(direction) || !dai->driver->ops->no_capture_mute)) ret = dai->driver->ops->mute_stream(dai, mute, direction); diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index d7d6dbb9d9eae..0d60942f64113 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -1312,7 +1312,7 @@ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, snd_soc_dapm_mutex_lock(card); - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { invalidate_paths_ep(w, SND_SOC_DAPM_DIR_OUT); paths = is_connected_output_ep(w, &widgets, custom_stop_condition); @@ -4539,7 +4539,7 @@ void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, void snd_soc_dapm_stream_stop(struct snd_soc_pcm_runtime *rtd, int stream) { - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { if (snd_soc_runtime_ignore_pmdown_time(rtd)) { /* powered down playback stream now */ snd_soc_dapm_stream_event(rtd, diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index a63e942fdc0b7..4265e8052d6bf 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -297,7 +297,7 @@ static int dmaengine_copy(struct snd_soc_component *component, int (*process)(struct snd_pcm_substream *substream, int channel, unsigned long hwoff, unsigned long bytes) = pcm->config->process; - bool is_playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool is_playback = snd_pcm_is_playback(substream); void *dma_ptr = runtime->dma_area + hwoff + channel * (runtime->dma_bytes / runtime->channels); diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 5520944ac9ddc..8f501178195e9 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -905,7 +905,7 @@ static int __soc_pcm_prepare(struct snd_soc_pcm_runtime *rtd, goto out; /* cancel any delayed stream shutdown that is pending */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && rtd->pop_wait) { rtd->pop_wait = 0; cancel_delayed_work(&rtd->delayed_work); @@ -1517,11 +1517,11 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, switch (widget->id) { case snd_soc_dapm_dai_in: - if (stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(stream)) continue; break; case snd_soc_dapm_dai_out: - if (stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(stream)) continue; break; default: From patchwork Mon Aug 5 00:40:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817097 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 9BC73C3DA64 for ; Mon, 5 Aug 2024 00:58:41 +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 8ADB6530D; Mon, 5 Aug 2024 02:55:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8ADB6530D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819359; bh=8pgZPLzpETYsEjk4S5mKJr/kSvZF0jU8EIjtzsLOq1E=; 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=AxceahUbWmJPamF5OMtAQkCWqKUIb201gKqQqFr1/PLA9fF2rc7xLA0bGQS1HZ3Kb wE5n9YWq8IAJH7r+OTJxEuDYf24CBUQHWPxAdplu5xZqb17QsL1bLVF0SgIoFG4Fr3 G0146fG3ES2t8UYo+HF3SEY3RvVjv9OwWhBFVyuk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5FF84F89B6D; Mon, 5 Aug 2024 02:40:54 +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 3C47FF89B76; Mon, 5 Aug 2024 02:40:54 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5B9E3F89AE1; Mon, 5 Aug 2024 02:40:35 +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 DD5A0F89AB5 for ; Mon, 5 Aug 2024 02:40:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DD5A0F89AB5 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=g2g/PsyX ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LeQ7+pi1cAUIJdbMxgXCRanm1tsu7kmkqcjV68kebBrnhsOnvua/KF8rcNI4IrzUSTQbUMgrYBMozQKZTaXFfXncbvrrtxJbs/q/dTJm8zK5bL6viARlbdmud4TzLRQRmzdkr8aot5jd5APlHtFePI9I/BwZtAnf3pMh/bZsQx1FnjllMUZUwfzBqaUIZAJzAEHAxx7Yfh6ZZlLhipdPFBCyU1wV5xK9f8fHeVYV855N1HmXAVl0JiQlfGYW5pLNepx6SeunObM8bwPXS9tGnAEcXWXQkWHW47lAljm7La7wtM+iRHCw/9c4QIRhpWbMpZOu3U2DaOnSRia5sXo/Cg== 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=VQwoA9N2310Uv1b3t9PCch1GoJUUIBOIEb5NAg6nWC0=; b=MUtvX9DgXUIxbAn05M2QDjSPoqLGy/9QD7HOZd7Fl1+OScrjo8Xb12jL/UEgCi+wfJrc0e4ZZNnoNO37Eqa+xms18nTC9JrDX9QbBTrUswOUDVV6oNFO10ByDr19QrRBlt/4KqD+kKtsCHEQptm/G44hAy+Akg3lbdIBPws02EJ8U1FBInPrNefiXDSqP1dnuIZD0L0bE9GEuTBJH8z6u1cueHVnm5F0EgBludZrnKwxbrCXFI1ljzJJNLR00BuBD/Mc4KsVJ0EH+vFoS5kjQ4Cl/nWFl374TXxgX7KbLjvCve7aDjU0akHGkFPGN59HB51aohJpTdcpy5AdEwbDIw== 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=VQwoA9N2310Uv1b3t9PCch1GoJUUIBOIEb5NAg6nWC0=; b=g2g/PsyXEt/vIyPLNJfcyj2sYByi23nx6Y6Jl7h0CbrMUt/AOzOI6iHvCiQ64p6d1+xFVX4OB8PMzgOjNJ6KIVIEbtB4Eg1lJdyXDMktNo9M6jm8yek5lHrS8DP8SIQb/IVcZABWoub4hlj8m9s6H0G2/hRPPelQIE0pMEdAxcM= 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 OS3PR01MB9302.jpnprd01.prod.outlook.com (2603:1096:604:1cf::11) 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:21 +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:21 +0000 Message-ID: <87jzgvyf7v.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 064/113] ASoC: spear: 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:21 +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_|OS3PR01MB9302:EE_ X-MS-Office365-Filtering-Correlation-Id: ce77ba9d-ec14-4129-588a-08dcb4e72fd3 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: qT9G3A1tnLaoHpPTgIuv1I5vwQfEBrXUS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nZ8omYaiPj1g2hy66Au1CXJFJ3ptkoHCCVX9/qpReQpkH0Ve7y8ZF0m52gGv7t29yxNIGKs3aZrQIHNFdvhv7xs8lZl8PU8ZxntDHLzWRNYNThnFFGcQhE5kaJTdddWEVP6lHidcpNrfmH8ns14rvKHCUsXKphff5Gwjl5mIFmPGSaqBAn+MpgE7D64+PBvvlk6MCMwENuI/PyXfGr/duZtpomqF5xqNiw+yoqFyWVYlIG/mV83P6GJLt/fMzGbObKpUyAn525TIUdbOFRhc+sc/jlX1/xk01ZOLEkoNr7Yq7leU8fq/b9+VA== 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: N0RDeJD6alQOuCyLOqo1Dzan0uslEYqJjYO+7ksR2hHkmXOOdcnLDe0G+Cuk3Yxtz5I0bIwO4yYLLavWkbBRX/vb1bRwvSg1Dpd/cilXY1trZB12bBI1Gborlgv9BuY0JfErpKvueCLwy4AxhdZggpaWEiQAxOw8xgBWEWosuoyrle98WREsRkJr5Q/UR/XhMR51wWOQ6QdWi2NNW0vIs7k5WMYcoCiYOLyKlKjf+VhoJQtRXEtlErirCiXZ1l8M5SGXvPjf1dZwU+g9Qzt/VQNTTT0RSC6gIN40DmxINTXpbFxJBi/Juu6G/VLgbkyavaUYZF/McTQt78Nf17hIMtCVjDRvZj63o79maLcMy4GR1z5ri+WJsZZPGGFFXaSj/VsiWAO1jMR361O4UekODi8jibzZYq5EgRGyujBcb2Y9QOE3m31vbk7CGC2KxqjTNv9hpxJeBGLszIK9SZGMrwQFmEtUsGuPbUgaiprSuX+GUYwbS7WljcTkMT8uBYVFrBBlVQY5GwMkDuoRxm/jDltEfb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qP1BQVGCxHnBIHZZwEXCOpuUMROza7w= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce77ba9d-ec14-4129-588a-08dcb4e72fd3 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:21.3479 (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: A2QJNUcnwfGIooAZQQg25YCTYEraqJvFdmctY7lY24+RLDgZJ5jeqzI9XiseFYQfe67aCS5mMc353NF9s0a9WQXeNnu0gxiXa+rnEznzgtDE7OFegPcWHMQsyN6i8Tiq X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9302 Message-ID-Hash: MR4ZFOEBLG5NSIHVKPV7TH7KEUQIZB3W X-Message-ID-Hash: MR4ZFOEBLG5NSIHVKPV7TH7KEUQIZB3W 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/spear/spdif_in.c | 6 +++--- sound/soc/spear/spdif_out.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/soc/spear/spdif_in.c b/sound/soc/spear/spdif_in.c index 4ad8b1fc713a7..fb1b54019194a 100644 --- a/sound/soc/spear/spdif_in.c +++ b/sound/soc/spear/spdif_in.c @@ -68,7 +68,7 @@ static void spdif_in_shutdown(struct snd_pcm_substream *substream, { struct spdif_in_dev *host = snd_soc_dai_get_drvdata(dai); - if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(substream)) return; writel(0x0, host->io_base + SPDIF_IN_IRQ_MASK); @@ -98,7 +98,7 @@ static int spdif_in_hw_params(struct snd_pcm_substream *substream, struct spdif_in_dev *host = snd_soc_dai_get_drvdata(dai); u32 format; - if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(substream)) return -EINVAL; format = params_format(params); @@ -114,7 +114,7 @@ static int spdif_in_trigger(struct snd_pcm_substream *substream, int cmd, u32 ctrl; int ret = 0; - if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(substream)) return -EINVAL; switch (cmd) { diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c index 469373d1bb418..a95a9b9e61e3b 100644 --- a/sound/soc/spear/spdif_out.c +++ b/sound/soc/spear/spdif_out.c @@ -63,7 +63,7 @@ static int spdif_out_startup(struct snd_pcm_substream *substream, struct spdif_out_dev *host = snd_soc_dai_get_drvdata(cpu_dai); int ret; - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return -EINVAL; ret = clk_enable(host->clk); @@ -81,7 +81,7 @@ static void spdif_out_shutdown(struct snd_pcm_substream *substream, { struct spdif_out_dev *host = snd_soc_dai_get_drvdata(dai); - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return; clk_disable(host->clk); @@ -109,7 +109,7 @@ static int spdif_out_hw_params(struct snd_pcm_substream *substream, struct spdif_out_dev *host = snd_soc_dai_get_drvdata(dai); u32 rate, core_freq; - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return -EINVAL; rate = params_rate(params); @@ -155,7 +155,7 @@ static int spdif_out_trigger(struct snd_pcm_substream *substream, int cmd, u32 ctrl; int ret = 0; - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return -EINVAL; switch (cmd) { From patchwork Mon Aug 5 00:40:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816777 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 9C0C0C3DA7F for ; Mon, 5 Aug 2024 01:00:34 +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 5FBE1339D; Mon, 5 Aug 2024 02:56:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5FBE1339D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819406; bh=w4POZFC8qzCasyoyfYf3hhQyxmo2cgU4bohFHq6IT5w=; 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=MW0vuNORx31HM5nenT7EYH+kqTt4f725kV6DjZIAo0QTfMMqkz4zj2agfVMQXviwb zgO1F2QBHrXqM/KRuFd2FjWGqE5tKNYd9AQf88L7KvSupF8oHwJANn+O1T/Q3V1edg erloe6YJ49IXC07PyaTi17fQYIoZ+/F2XPbkA+ts= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2CC35F89BD2; Mon, 5 Aug 2024 02:41:03 +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 DAD86F89BC0; Mon, 5 Aug 2024 02:41:02 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CD14DF80673; Mon, 5 Aug 2024 02:40:43 +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 89606F89A8E for ; Mon, 5 Aug 2024 02:40:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 89606F89A8E 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=F7vE0YF1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=d+RFLlhGwVMLN2h4Onx88gqsk5Sed6WLPuepHHHwNZpzIO7eJXTa+HiHl5rBjKWVppIF7uDMw4xSva90xPa1hacIae4MqxnB2cbbyx8RDO0A/f+oMLOPwoCkUNxx8Ynh6nIIIXUPhOQeNzetXYmHTnTtjBMCPQ+22Gg1Jk/isEKyKHJUWzxEnXqxV3doNHHLm10bBOpyBFqmJZzn3ziDC975BMu8ryge12ze00JyxnuIiUdAFH2XA8BNyGCWxKwNsHo/bxE5tIyFc4YuY8RR/yETrBr7wttBP6EsgyLqO1bM387EhxVnPxFwepS63FbMSso5L0S6WyoHQVCO0uKeBQ== 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=6HvUe/NFKSULjc/2Zipssjdlc2fWORF+gcJjjGqjJb8=; b=uLbpIyelGBhDTPYDRDheRiRHgWu+dpCW7NqPxJ56/Tmj2AGUKplx5HOtmrfT8NBlf19CuQrh8grV+ZZ1a16y9jFpUaULcRgvLMLMFJH0klmPbV0UhtU7Ov5oGsqGeOIA196OefGFUGeXREjBKoe7n2rYbwtxJLATNOwrEh4bVPHXqDezobjJdKQJNQdJHBNP6dXRB62yB2edNeSmiCn22lD1Jy6OJ76CA5S3xyFJvT3hDCuuc/NxBw1gaQNua0PP53WiV1n+gFWgh/ovfbFxvjgJG0ijDx7j+njRup1oUt3qpQOXNRxS0d9qxTIcfnYq/pd8nlvMTNzlkR1RLIc70A== 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=6HvUe/NFKSULjc/2Zipssjdlc2fWORF+gcJjjGqjJb8=; b=F7vE0YF1Ov8+D+uNUf1NsiXUnrGh7q3CM0oH6eEf44zMxXyyDaFm3zB5CQ9JhDY9mziU55eoYYLS1mzeXWAZYQrwqjdM0KFlMuuRUxTmJzxKnzzPMbxwxAOcB+RS6cGZvKeIic82VkqQDbxELlHMDJoN8hBfSC8mfW6gn0EdppU= 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 OS3PR01MB9302.jpnprd01.prod.outlook.com (2603:1096:604:1cf::11) 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:27 +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:27 +0000 Message-ID: <87ikwfyf7p.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 065/113] ASoC: sunxi: 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:26 +0000 X-ClientProxiedBy: TYCP286CA0358.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:7c::9) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB9302:EE_ X-MS-Office365-Filtering-Correlation-Id: 87160f72-7a33-4688-7048-08dcb4e732ff 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: +RBiRCky5A4H5LRKyAeDNkYDBEAyxyK597MQ6HSdI2r+hrDpinMgmSY8UjZFQAHtSk02Ml1ZMnfBMidD57OmTqGtbZ1IFCHH+NFlZdtoHQa7ewh+mmUVGdp6EU+JLhWk+YSPT/elo5rbsERWR5fDFEPH2yJfi1e31dOKYoU/GKPSsh2H3lo3bKsfuZubp4FgYH0nSB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5tbD7QIf0PvN+zmc6fJXOLJ/spLbW6NuSCFmab1skkNrk00yTim+JJZvhf1N/zkAi9Qil64qz1O5ol1522PQSHHpaTEBd9NSJVXKp/tfVPRJHjbtvIQ20yY1mXuvrMunZtQcW4qyRltntUOSbkiIlRfscelqxqwg5tQ== 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: wcx0lVzeLPUAKDE7bqkCnAQ+7htTmprUamEtPV0mjdh3MHXUNRGzTWhyc1Y1CsvIq3PZeL4zGlKpWynlc33UGPvfGn5qL/RlNWe0zR68pcXDNBNe1Y0vRYv6/FkX2fJYbfWAbX6VEjFgEQef1m+clhSdMdjM0kjr4Mp3qfRjFvYTQlsuDSpDz4QF6APheqX29XjWc6U2H/TrF+KrJfCs6Q1nBbRsNMl3qyZixH9BPhjaSHCnfaEatxmLM6fw+JdM5IKKOSvpj4o0FhV/pIbUhcpGkQQPYOL/x8yYGIkEDTC9eQYjP/WryormikLfU+XTU+ExAQBKMuvrU5WaZWOo34bn0sYVCIPZrCWCLa97tcWwwpB5Z1VJY9SIeJAx+MrtMTvc5cjaJ0sm+hr91WqDMecKFPyeQdDsRLA4ajYfVTVLHVeaZeVJiWaP/ZiDaKI64buVnsBPHLVVgoABXF3fdyOxuVnaHxrEhGMcw9eTGwTv7DZ51xZ5V1LpuV5wHceg6Ss7SVigDctD/vkTtJPww0b0kta5cJJRkmprcqBRjGjR+11a8vDleGG/sd7yZamFO0pw4LBWCXZyAwxIodW5mGvi6mwsRsSoHsvxrXox89wWzom65krXrwzGrBpQ0yGKqrR9vtVauQb9HnROroTv8bR2e7O54DdEgKOnMcnJx/ZnWiVSWgAScTe8t+IfAWvLxIAaGN0aqqOb9o83pM9k2xsOVlfRJ6KBbGyh/ewHEYuK4eDCsDnGCR9146cno1JP1X1fu0BHSSAKK7Lj7+/YYkAFAuuRA/Kv3LqEjc57E6iEgy2GqYkkYIqP1nnK4cnup0/V3adZZPcgO3sefrvDOYbvzLAMjwySBL6TavrVu5ec/GaAi67pIG0XF+qFl+p5L+EDp2ou6HL5xw73ls4bgDGjGkzUWGEc3k/zfIhczNG7blg5XuRK7MgNWOOwMhtGrRK8W+FCrt1vwKxJ2/W/70THNaFdNSoWt6Gt4dvzzK//fwjcjlZqo+3TlBSBOLZAZHL92+VPzZ51aauRJL4D0Op9VFFEvWllqCSetwx3SVg4jMrPVxNwtWqEmId0SYqBunYW+RGWES6ZhJ935BSoddQj8DlLkiEUtQjsny4K+tORX5CczyWwo1VAhGN1GRRCSrfWhbx/z7pkuVaw47OMIMzoU1rAj3w/flRocyw5/OaeV+cFE1jDqq8/1FP8HXHfjF/EywWxwNhYmF9MS1jSmsWroSXvek2YJ7P0dxMp3gBKLNoyleA0vNELNOe7PLRWN8/neAF5m1a9XA6xybwZQCvWgTrc458q1kL6Sov0tuIb9YeSFz1zRuyAKYn53aLXkLevFbShKG5ML8SN/DEx06np0z0WTTP/cSIlHLv/IZiihQcdvjdD0qmdZvONYjDHD+mUo9ZjmcLGFH0iV1t+GJ7IMpgnaKASaQgN0f8bIQ0bA/U1R3l7i+ZmiKfF4pulHrl60inF43xjgccaVDp+7rIT0JAKW3GNGm8siq5ltA/Mf1jXP6lckR0p8B/QaoZYMU3b35SsZud4ZiT4HqLDmQMSBKaHuNwCIdusKsJ+kDdPeIDv21E241Mlh5xBrxLnSgtRzdi07uU+vj5yBix1ZTgZzpa3xCTX/gSMEfLsGDc= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 87160f72-7a33-4688-7048-08dcb4e732ff 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:26.6593 (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: oDP6SxeL8XwQdgjj/cTa/3zn+WXr7wR+6U6K6Z4L2cl4rZOmNa+RX/ytR0u0kQWpcqqr7b3f+Ox/FIwmcH68NwD23JTBg6myLDjpn8fRvQXPKNVq9qlZ8lwBDv8anN1z X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9302 Message-ID-Hash: LSAZS4OGI2TBAPJJXS2TBKHT5QV3CTCC X-Message-ID-Hash: LSAZS4OGI2TBAPJJXS2TBKHT5QV3CTCC 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/sunxi/sun4i-codec.c | 8 ++++---- sound/soc/sunxi/sun4i-i2s.c | 4 ++-- sound/soc/sunxi/sun4i-spdif.c | 4 ++-- sound/soc/sunxi/sun50i-dmic.c | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index a2618ed650b00..edde5cb84ab61 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -285,7 +285,7 @@ static int sun4i_codec_trigger(struct snd_pcm_substream *substream, int cmd, 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)) sun4i_codec_start_playback(scodec); else sun4i_codec_start_capture(scodec); @@ -294,7 +294,7 @@ static int sun4i_codec_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) sun4i_codec_stop_playback(scodec); else sun4i_codec_stop_capture(scodec); @@ -385,7 +385,7 @@ static int sun4i_codec_prepare_playback(struct snd_pcm_substream *substream, static int sun4i_codec_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return sun4i_codec_prepare_playback(substream, dai); return sun4i_codec_prepare_capture(substream, dai); @@ -569,7 +569,7 @@ static int sun4i_codec_hw_params(struct snd_pcm_substream *substream, if (hwrate < 0) return hwrate; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return sun4i_codec_hw_params_playback(scodec, params, hwrate); diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index 5f8d979585b69..0b1bce325f04e 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -1033,7 +1033,7 @@ static int sun4i_i2s_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: case SNDRV_PCM_TRIGGER_RESUME: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) sun4i_i2s_start_playback(i2s); else sun4i_i2s_start_capture(i2s); @@ -1042,7 +1042,7 @@ static int sun4i_i2s_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: case SNDRV_PCM_TRIGGER_SUSPEND: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) sun4i_i2s_stop_playback(i2s); else sun4i_i2s_stop_capture(i2s); diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c index f41c309558579..989cebb55798f 100644 --- a/sound/soc/sunxi/sun4i-spdif.c +++ b/sound/soc/sunxi/sun4i-spdif.c @@ -248,7 +248,7 @@ static int sun4i_spdif_startup(struct snd_pcm_substream *substream, struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct sun4i_spdif_dev *host = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)); - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return -EINVAL; sun4i_spdif_configure(host); @@ -364,7 +364,7 @@ static int sun4i_spdif_trigger(struct snd_pcm_substream *substream, int cmd, int ret = 0; struct sun4i_spdif_dev *host = snd_soc_dai_get_drvdata(dai); - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return -EINVAL; switch (cmd) { diff --git a/sound/soc/sunxi/sun50i-dmic.c b/sound/soc/sunxi/sun50i-dmic.c index 884394ddaf86b..1b662b40b7b6c 100644 --- a/sound/soc/sunxi/sun50i-dmic.c +++ b/sound/soc/sunxi/sun50i-dmic.c @@ -90,7 +90,7 @@ static int sun50i_dmic_startup(struct snd_pcm_substream *substream, struct sun50i_dmic_dev *host = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)); /* only support capture */ - if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(substream)) return -EINVAL; regmap_update_bits(host->regmap, SUN50I_DMIC_RXFIFO_CTL, @@ -205,7 +205,7 @@ static int sun50i_dmic_trigger(struct snd_pcm_substream *substream, int cmd, int ret = 0; struct sun50i_dmic_dev *host = snd_soc_dai_get_drvdata(dai); - if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(substream)) return -EINVAL; switch (cmd) { From patchwork Mon Aug 5 00:40:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816776 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 A1944C3DA7F for ; Mon, 5 Aug 2024 01:01:00 +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 957D33A26; Mon, 5 Aug 2024 02:57:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 957D33A26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819430; bh=jE8KH36tyH1Y57k3yx7h0opIjyUKDJYTLOVnLAJTy6E=; 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=mCX8XmG6IHCYCx3bfHRP+sGhv0tJAYrUyiXeverig1gb4QJsb8ZExmDeEXRZm6R/a fT98eiR3fxjBCfpgdk3jlWRxfASPcuJQ1YO88P4oLU0dbP5B6jXhB91WoyfG4qVhzz X9C9dBtWqmGX1HsLtQu5pW8bkRvZE1juSiyuBM9k= Received: by alsa1.perex.cz (Postfix, from userid 50401) id F3A61F89C0F; Mon, 5 Aug 2024 02:41:08 +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 E72FCF89C05; Mon, 5 Aug 2024 02:41:07 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A7AE9F89B5E; Mon, 5 Aug 2024 02:40:54 +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 31CEDF80688 for ; Mon, 5 Aug 2024 02:40:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 31CEDF80688 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=HL91gG// ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IcWQwxZHhEpqVtVwm7LRXEFyLYF+wXraeMNxAxR9L/60XkYVByfJ45UjFXEt5XHZ40Ks/h5F6bUx7qPNHPqkvfr6Qgo6RTqUjMq4zuwy2owJ/5s4dvyR19HbRpIPxSe8h4Z30sbnezGtnTeM1WyUATyPymlqqYw+X7VJ4A6LhWXD11UZemme0FxS2yVdIgRy4nhiYyqVEKA+CF5FREuRT2km8SApAn5Qm6StTJJFjNl5E18lnxREqz7HdyG9bL9XpshvqUpmsVL3AGBLuqvfjfyfOsxyKHDyfb5Cakzzt9BEIju9wDTs1bJRHfiNsoQp3VgIjHACApkPS2VgMA67ww== 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=gjbb72CLScHpNKCs8p4LtmKCCE56Zyr3leDrloQbTXY=; b=GilnhDV4eQ99spXBpAPWPAxogNkBPb4trWnY4Thwlgm5t1cS9G+EcyX5trH8UU16cdHmjsBtHeFD9nEJxRVC9XKPFhqqcyz2uLDdV8WU1MYElB1DBKjJsJihUtX0KKRqTMcwWz+/Ldl3K6SUKQb1/rHG2e4SXRSGLClNNUoODWKt3R0RgxDC36qu+rB9g3cRgVl+9UDfYZZ57YZVtaD6CVtk72F0m1GsTbPhiNLaun0l4lu0JYXQFooHoGZKgslgjSX3MjrRZIZxTuHynqiflInDjq/pM2eJN4QE08pNe3lKr89scYRE3jT1Cm+v++p4V6ywleBiFtcuLqDekU05CQ== 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=gjbb72CLScHpNKCs8p4LtmKCCE56Zyr3leDrloQbTXY=; b=HL91gG//cQ9MBhGBxTtjyQH2jWzvmZpaaKHW3nHJsgx6xIAvFr+5Z7CGCvLqphNYsxVxVOFL0A2RajgmZ1CMFChVwJGq3jx/l9IXA8uxKMMq+bUoO9eBoaRJ7+wyAtL1CsLUPQRqhP97DcWBBbRYEWI3Cg4K8gUl0lXegdeYL5s= 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 OS3PR01MB9302.jpnprd01.prod.outlook.com (2603:1096:604:1cf::11) 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:31 +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:30 +0000 Message-ID: <87h6bzyf7l.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 066/113] ASoC: tegra: 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:30 +0000 X-ClientProxiedBy: TYWPR01CA0005.jpnprd01.prod.outlook.com (2603:1096:400:a9::10) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB9302:EE_ X-MS-Office365-Filtering-Correlation-Id: 13a555b4-38f3-457a-2fec-08dcb4e7356f 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: uvazzlAzCGZKQhezRb7yL2xAWgii/61/eRtfNJSWplVVmE7SKf0S7eJw77E0z0au1BmC9mu64L5JJi+EFlvWZhCnC3aYe86buMfAFOlSSDLqnLxXhQ4RKCPQfPTBKnouIX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0JGYQ3cFmETPFpJyoJekp17dcqeByj7iqDAKIbKdXxjhzjcuwNUcry3MSxDAJQ7RCCB1PZDN/DyhRfer84/2zRKQuX+gL2huhik6/AzOIuxs1h04ErjOwuy9wnM6WjeDhcOahjgd/pTZaj2MD9mz/zJjjdJj1GzeNW66z6yc30vYOVFQmwUY430oHnZCqNMzs/adJUGcXkQ== 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: fSCZQe2U7T2CO3a/FkekdRnv+T1J9Fb/HgyxF+uRbvvNoTY/pwBuBuXRA8IqzB3N1ar4rA89HtnZmKU6sdyH5vBOnoYNYlg6aHs+6G9ElhrB8vNspSVajbZ+yFrrmfunAnUOZ8+ZQ7nPry12HVOJ14W2StdkX2+RLwzVLd5P4Nz3LJ/WCsm9Rr6NTJp/JCtoMyok15YO8iiuWhcb91uS9655RPj5XLff+wiwoSzd0JcbXtKBTknpTG8TFEDGH/k7u1K5F7hGGZi5VnUreOe7CQiJvp8tJ+QJSITrLsczo9SLe1IpQGL1CsRvuTAcJehMj0g2sjeCHY04RDgWEPa1+TO91KWUirUyAf2LUUPfVPNtHqGGqDPk1AURABAQJtH/lISMLIX2eaw97yq0piy/hCJav/S7DfJ7VekW5F/97SR5CpK//1nhhzyImZJ9Itb5wHEfkKNn1T9Om6s/MlQEQNfd3DOy2kLqANTiAAt562Ds5UJYxxIj903zWcf92GEdt2nP4HulCSVJi24C4GQLNaSWd7EYpQE2qI2wJlhUt2mTBDkUYdgxSluXQtCxxx+dsY9FOt4wU1hp2fLnCk9RIZGBQuvZGQA8WOTXAlpoWBim8eigP16d5IP/riWdfg4xwxHwHZE6cl9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Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 00:40:30.9168 (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: iPD3XUgIk38ShI7tA/LWlYi9PGYI2jBCVDh0/L0uOg5jMpniegPgAaY6eD3E/fk2ba7DcDart+kVJQrgOvV9/EghmG2MvLHoAfnlKEP6TcXds4M3xc3sAwSTDp0XsIBC X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9302 Message-ID-Hash: ZKGY7VSIAE6KHH7BFDDMFAN7XTHPPFKE X-Message-ID-Hash: ZKGY7VSIAE6KHH7BFDDMFAN7XTHPPFKE 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/tegra/tegra20_ac97.c | 4 ++-- sound/soc/tegra/tegra20_i2s.c | 4 ++-- sound/soc/tegra/tegra210_admaif.c | 2 +- sound/soc/tegra/tegra210_i2s.c | 6 +++--- sound/soc/tegra/tegra30_i2s.c | 6 +++--- sound/soc/tegra/tegra_pcm.c | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sound/soc/tegra/tegra20_ac97.c b/sound/soc/tegra/tegra20_ac97.c index 8011afe93c96e..0314402361558 100644 --- a/sound/soc/tegra/tegra20_ac97.c +++ b/sound/soc/tegra/tegra20_ac97.c @@ -182,7 +182,7 @@ static int tegra20_ac97_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: case SNDRV_PCM_TRIGGER_RESUME: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) tegra20_ac97_start_playback(ac97); else tegra20_ac97_start_capture(ac97); @@ -190,7 +190,7 @@ static int tegra20_ac97_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: case SNDRV_PCM_TRIGGER_SUSPEND: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) tegra20_ac97_stop_playback(ac97); else tegra20_ac97_stop_capture(ac97); diff --git a/sound/soc/tegra/tegra20_i2s.c b/sound/soc/tegra/tegra20_i2s.c index f11618e8f13ee..330400d0e530c 100644 --- a/sound/soc/tegra/tegra20_i2s.c +++ b/sound/soc/tegra/tegra20_i2s.c @@ -232,7 +232,7 @@ static int tegra20_i2s_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: case SNDRV_PCM_TRIGGER_RESUME: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) tegra20_i2s_start_playback(i2s); else tegra20_i2s_start_capture(i2s); @@ -240,7 +240,7 @@ static int tegra20_i2s_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: case SNDRV_PCM_TRIGGER_SUSPEND: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) tegra20_i2s_stop_playback(i2s); else tegra20_i2s_stop_capture(i2s); diff --git a/sound/soc/tegra/tegra210_admaif.c b/sound/soc/tegra/tegra210_admaif.c index 9f9334e480490..e79711ea65dc9 100644 --- a/sound/soc/tegra/tegra210_admaif.c +++ b/sound/soc/tegra/tegra210_admaif.c @@ -299,7 +299,7 @@ static int tegra_admaif_hw_params(struct snd_pcm_substream *substream, cif_conf.client_ch = channels; cif_conf.audio_ch = channels; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { path = ADMAIF_TX_PATH; reg = CH_TX_REG(TEGRA_ADMAIF_CH_ACIF_TX_CTRL, dai->id); } else { diff --git a/sound/soc/tegra/tegra210_i2s.c b/sound/soc/tegra/tegra210_i2s.c index e93ceb7afb4c4..74a0ada1e98c7 100644 --- a/sound/soc/tegra/tegra210_i2s.c +++ b/sound/soc/tegra/tegra210_i2s.c @@ -95,7 +95,7 @@ static int tegra210_i2s_sw_reset(struct snd_soc_component *compnt, unsigned int cif_ctrl, stream_ctrl, i2s_ctrl, val; int err; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { reset_reg = TEGRA210_I2S_RX_SOFT_RESET; cif_reg = TEGRA210_I2S_RX_CIF_CTRL; stream_reg = TEGRA210_I2S_RX_CTRL; @@ -673,12 +673,12 @@ static int tegra210_i2s_hw_params(struct snd_pcm_substream *substream, srate = params_rate(params); /* For playback I2S RX-CIF and for capture TX-CIF is used */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) path = I2S_RX_PATH; else path = I2S_TX_PATH; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { unsigned int max_th; /* FIFO threshold in terms of frames */ diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c index a8ff51d12edb5..edcb7095bf0ac 100644 --- a/sound/soc/tegra/tegra30_i2s.c +++ b/sound/soc/tegra/tegra30_i2s.c @@ -188,7 +188,7 @@ static int tegra30_i2s_hw_params(struct snd_pcm_substream *substream, cif_conf.truncate = 0; cif_conf.mono_conv = 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { cif_conf.direction = TEGRA30_AUDIOCIF_DIRECTION_RX; reg = TEGRA30_I2S_CIF_RX_CTRL; } else { @@ -244,7 +244,7 @@ static int tegra30_i2s_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: case SNDRV_PCM_TRIGGER_RESUME: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) tegra30_i2s_start_playback(i2s); else tegra30_i2s_start_capture(i2s); @@ -252,7 +252,7 @@ static int tegra30_i2s_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: case SNDRV_PCM_TRIGGER_SUSPEND: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) tegra30_i2s_stop_playback(i2s); else tegra30_i2s_stop_capture(i2s); diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c index 05d59e03b1c5e..1ed74f6b6431a 100644 --- a/sound/soc/tegra/tegra_pcm.c +++ b/sound/soc/tegra/tegra_pcm.c @@ -164,7 +164,7 @@ int tegra_pcm_hw_params(struct snd_soc_component *component, return ret; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; slave_config.dst_addr = dmap->addr; slave_config.dst_maxburst = 8; From patchwork Mon Aug 5 00:40:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817095 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 DE1D8C3DA7F for ; Mon, 5 Aug 2024 01:00:53 +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 7DA2938C0; Mon, 5 Aug 2024 02:56:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7DA2938C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819425; bh=pZXQkenLZS4PlIyxVPNguTu/bb3Zm46mzqXGzzF6uV8=; 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=AuPueaTn7AqMY1XWe3ExHG98NtqE6t/XiRR4H1v3xc7GxecC2i8ME9IWfZj/Zs23N 9fz3EdSqIBvoTCocX0MVm2X9rI4t6g59NzYswoCTi42lvlYjeSe4Bcr+VNzkkJGniD 1r7GzCdqfGzZFo8GaVh7e8kO+XC2w1HROmYjIFkA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 44CFAF89BE5; Mon, 5 Aug 2024 02:41:05 +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 64FB3F89BE9; Mon, 5 Aug 2024 02:41:05 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B91D4F89B6F; Mon, 5 Aug 2024 02:40:53 +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 98C5AF89AEF for ; Mon, 5 Aug 2024 02:40:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 98C5AF89AEF 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=APy78nyO ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VggTISKcacDBxU/USlPW+93fcGuc9fCXoY9F0sIk73vB/qofps0Av1wA1uhknxegrSqZXSomtQwUNfcNDY3yR/Qs3Ie4MQENnhKD23SOBVuKhyI6+QZeDp2ICRK8LWYeHCeom6ugOV2T6Zn+QDdmrI5Lc6C6YJfXSCCeJAtnJjGnm083M9JBZzBN6SxXPP5jzOAmoPGfYLvCctrq5FFYmUHYfW8n9avn+sPvSR4t5dc8xbe618htVij4HKhfSnRPZM84S6RTzMpMt/BoIQQyEGxm0+AkceCYuPH1WocvPV8fodBwTEwuw6k8wD8rYMbUwCgGfRATp925jSU/7GZexQ== 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=IBjz2IzpTVLNw/vY+NfoHHqifRx2NXLe/j1yeG+Uw/M=; b=nOl1LckIobEWo1GQYXJraUlxTBU/S3r1aHJUClA4UvJuPtYFnFXw/8vDNhiXmzKAetziE+a/oIrzlQMWGA7x+dpGhsuIEFZBjVtXF8nM1Bj+ijalmlXt4jwashSkUAWj07BfR5z0EzuXzyi633J6mPXwF59qsCND1NQ8fqOw6vEQUIHKZbqBki98Z3QSDAyYKsvDEzcJvxnT/h8rASQxVpcj7RMAvMsRqkAvoCE+J67CR5GLt1MuAOjic1DaJTRcnniB32j7BrzoOZogZ4Vek+wOPQmjCVKLf1TueNzAekDdIVOcrsHErTBM+pKa4g90f4EHzxvQ0ocU9M00aeSC0Q== 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=IBjz2IzpTVLNw/vY+NfoHHqifRx2NXLe/j1yeG+Uw/M=; b=APy78nyO8GsjoR8qdj+u2g5AyHaE3Se0mkX0MWyQAxonYtz4WcJQQgDZIihzZSO4+tcscPBGPaXPZheHyQqgO4fsX2mwUXAfazfSwzn1/nTsLtJzUItBM3J9QmRdVvMxxiKuZxjwYGZvHBo4/g6dds3mbHPc9h6OCMiiYPbUZvQ= 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 OS3PR01MB9302.jpnprd01.prod.outlook.com (2603:1096:604:1cf::11) 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:35 +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:35 +0000 Message-ID: <87frrjyf7h.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 067/113] ASoC: ux500: 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:35 +0000 X-ClientProxiedBy: TY2PR06CA0007.apcprd06.prod.outlook.com (2603:1096:404:42::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_|OS3PR01MB9302:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d0e7cae-091d-4ba8-674d-08dcb4e7381b 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: eBAfGHsuZhUcrgNsOBN98TPTKZdc6ONXWCFaaci1qHzGvaGTq6jXZJ3qDGqyxXK4rAHkjG/FMHqMK5tT4wSRt80y816G+kNIzIS1TxOs/Ur1HjSLf9TUphZxrUSCRrOvwWAB3+yrSF/IZPfa5Vz7oaR1llD7/qbBkLuZvEBkn67AaPvEtHYkgA22ysfm3W8sUPY/PDPEtCaROpsaSRBY2gTyCtxaEUXCUQXZRUyfDpS2LwXhITsGIrNv2+VwvZ81y0nXMdjKTiwSHE7mnIaSrLn0OajE+rdmcsleukPhwykkzgeb+EWqzWEwf4XlkPDJIOksf9AfT15FvjzGFWuJJnQJO4NrS6oL5b8uxSNdRG/rkRrQAorp6YqkzehwEJX/d0LRFE2b0Q6corgiK0zzUjxjVAB/EOxyA3OyWND9HbQpOLEQF6hvOSiF/Z9iI80wiWCuOQYr04M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R:; 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: DLQFpIj3YsSRvX41o5WiGui0eSwse9xA9opI68dvxBNRsn9TMO+HB5M+DvbkcHI1eBShbSL8BkyVD0qIRJbYu9Hp4NAE08FcAtOU60sUa/N2wpSTKeywhu10aHfbYvDKXY959tynTHdqGybTrpHNbz4pBmsu90nTlZVYrBZyCvKufxRP8LwpOX0SaHwCBvDf30J1Ea/SUH/8zazxEK9Mg0IjOZowmyP4dU7CpS5Ru/A88RbKbf08svTRgS4KE5Wkrcpl8wrhbaXZru5TpOZVsH6l1Dp0gdrEYdSjdsUrbiYwzzwPX340GqVivYpfkedNweTN/Qkq/sI/A7y/rJ7kdt4dHORurvkaM3v0ZjmRmuXGzn8+asRy/ACPH0hAKAVR1rgLiDfbm3YqKZygFYyuKtDJ6GBLc1cyDKUMuyKBN/C5TekSBXHKGK9rbKkos6da1rKf+2sz+fEtAOjP6fAArk3ePIgJg+n6OOt94F6f6MSqoai3fjL8PmKeu6xk3SZGsvdBv0a9m23sBgaIWd+ybeiw0tfKotVL1la1yEopu39g+qWyI0JBEfmr9HuJARIGE7MxgBjbfZI1MsYEs54W36GzULPAOvYP+5e0RePTfp+28OZrTLVfGvrmuKy1pFVS8xncesLdNBPUOzNyZ2H1a3Tsu8ITuj+/kK5EBO9F3FO4JP/o2Qhp6PwqMm9i9EzWuv88RV8xIJsebF2/N+A2dcv3wIP51Zur0jGnPXDd2257xYFAEV1+bkyRTNBd4B7euTk0CQDGvhfBFfoOH1N2zwcHykb6UmiHrCDbwq0fMedCnOEFNwZ7XIgptYapt8xgrOcVCkNug+XwNXdo6p8mxpaEqTJnGUstZzcvm37xtxCz0kGeX7U0exPBwoYpm43ahjQJqWWk8+swu1xc/oXPhpg4Oq3d/sbHbBJNGeBY6xHNW7jizCPAH5N8JkRltSA5iLMqyzZol+bJNNHhNV9H0qkO0aWQCF/87mbI4eKd0WH4gkHz8v+wSRm5UkRIgd/Fevo+aNdN7+Fs8V3RUbjP8TwCocGCf+6w/LGoKg+YKCBxFV9VB/uzOJwf9TDcriu9NX65veFWc7oxpuODa4A0ltH48tpDAG+10JmuPKrDcUVK3jy8q/Pdj3fNKTwvBIxv4aheAohHkIC7qKWn/Ga24hxcN6G5guf+aA0V8qrn/5HceG4SKZx3HK5hsWEaL0i4bFe+vEhoOlN2QS5bnMPr7Mm1SrgGV2zyvkVRJ625a6lAnu9bQ47bGXAFOTW+vr/I9azJ2uDsPPaGXo23TUw95OCOHDO5BDz4zt6rUOVau5vyEntPU7FP1YMUGNeOX/Y/rBfYzwMvc55BrTt2Xuzgl4Rbb7A21nlfBBpWvJ4xn1teqY9VoHiZ9iE7cJXeqG/FbFn7mFZUXZmBflKxJkh7hbImntjn2GUKQpN1D9FBG188sf4cJWFIri9XJ9t1RYDS3HT/iTUWfsUmsMhFthMc72G4buiTKyWxq6yjmsP35v4k+ihVi/Fx/xQWGIbZ/8bDeCeNftrMWU36SLrsEUh1A2zA8QAiTNmf7L6y9RhuE6Fl3pkgimuTFaBYGwjW+waE5Ccl3jJLuKp9RQo8dqPelSyflElkwCRBUyrseUV0HFY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d0e7cae-091d-4ba8-674d-08dcb4e7381b 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:35.2696 (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: ddMHlX7v8PBhEapwbOwJufqQhnUTBfk0HseGpLamaxYmq8eG1KkQ3cbQCaaYgTjdwX7GYXV98TqxdneNatEkOR0qHhqnzWNUlz/Um0dR56xezHBU3ygdgsyycQcpuq/4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9302 Message-ID-Hash: 3N5HRXVMNQETHN5PMREUG3FBXPVQJR3I X-Message-ID-Hash: 3N5HRXVMNQETHN5PMREUG3FBXPVQJR3I 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/ux500/mop500_ab8500.c | 4 ++-- sound/soc/ux500/ux500_msp_dai.c | 6 +++--- sound/soc/ux500/ux500_msp_i2s.c | 4 ++-- sound/soc/ux500/ux500_pcm.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/ux500/mop500_ab8500.c b/sound/soc/ux500/mop500_ab8500.c index 710b6744e0136..102d4922d6e62 100644 --- a/sound/soc/ux500/mop500_ab8500.c +++ b/sound/soc/ux500/mop500_ab8500.c @@ -203,7 +203,7 @@ static void mop500_ab8500_shutdown(struct snd_pcm_substream *substream) dev_dbg(dev, "%s: Enter\n", __func__); /* Reset slots configuration to default(s) */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) tx_slots = DEF_TX_SLOTS; else rx_slots = DEF_RX_SLOTS; @@ -291,7 +291,7 @@ static int mop500_ab8500_hw_params(struct snd_pcm_substream *substream, /* Setup TDM-slots */ - is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + is_playback = snd_pcm_is_playback(substream); switch (channels) { case 1: slots = 16; diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c index 3fd13e8dd1107..1a02d66d45cd1 100644 --- a/sound/soc/ux500/ux500_msp_dai.c +++ b/sound/soc/ux500/ux500_msp_dai.c @@ -312,7 +312,7 @@ static int setup_msp_config(struct snd_pcm_substream *substream, msp_config->tx_fifo_config = TX_FIFO_ENABLE; msp_config->rx_fifo_config = RX_FIFO_ENABLE; msp_config->def_elem_len = 1; - msp_config->direction = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? + msp_config->direction = snd_pcm_is_playback(substream) ? MSP_DIR_TX : MSP_DIR_RX; msp_config->data_size = MSP_DATA_BITS_32; msp_config->frame_freq = runtime->rate; @@ -423,7 +423,7 @@ static void ux500_msp_dai_shutdown(struct snd_pcm_substream *substream, { int ret; struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev); - bool is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool is_playback = snd_pcm_is_playback(substream); dev_dbg(dai->dev, "%s: MSP %d (%s): Enter.\n", __func__, dai->id, snd_pcm_stream_str(substream)); @@ -511,7 +511,7 @@ static int ux500_msp_dai_hw_params(struct snd_pcm_substream *substream, case SND_SOC_DAIFMT_DSP_B: case SND_SOC_DAIFMT_DSP_A: - mask = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? + mask = snd_pcm_is_playback(substream) ? drvdata->tx_mask : drvdata->rx_mask; diff --git a/sound/soc/ux500/ux500_msp_i2s.c b/sound/soc/ux500/ux500_msp_i2s.c index fbfeefa418ca7..36819fbd66781 100644 --- a/sound/soc/ux500/ux500_msp_i2s.c +++ b/sound/soc/ux500/ux500_msp_i2s.c @@ -565,7 +565,7 @@ int ux500_msp_i2s_trigger(struct ux500_msp *msp, int cmd, int direction) case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - if (direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(direction)) enable_bit = TX_ENABLE; else enable_bit = RX_ENABLE; @@ -576,7 +576,7 @@ int ux500_msp_i2s_trigger(struct ux500_msp *msp, int cmd, int direction) case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - if (direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(direction)) disable_msp_tx(msp); else disable_msp_rx(msp); diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c index b7f38873d2d8a..65a2125e36594 100644 --- a/sound/soc/ux500/ux500_pcm.c +++ b/sound/soc/ux500/ux500_pcm.c @@ -50,7 +50,7 @@ static int ux500_pcm_prepare_slave_config(struct snd_pcm_substream *substream, slave_config->src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; slave_config->dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) slave_config->dst_addr = dma_addr; else slave_config->src_addr = dma_addr; From patchwork Mon Aug 5 00:40:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816775 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 31BC3C3DA7F for ; Mon, 5 Aug 2024 01:01:38 +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 387C34D20; Mon, 5 Aug 2024 02:57:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 387C34D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819470; bh=A2DFeQzgOPJ8fIwuRwR3jWIDQPuwvVLfj0YNcmFVjf0=; 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=D/sSppGQRS/9ra17FSi+Af20EnogSYYUvuRvpnVnX0HauhvkNT0BiQ74gmMoDEi3j xVrXwJEYtxXZV2iromY2rLM243KqOYuhko03mD9oLXi6dMuKv9DpMxDUW7xeQFhIyV QSXPAyEaiKKPSc4nLuEvf4Jui0BU3Bk4keexiuN0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id AFB4AF89C38; Mon, 5 Aug 2024 02:41:13 +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 1EB03F89C3B; Mon, 5 Aug 2024 02:41:13 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BDFF7F806DA; Mon, 5 Aug 2024 02:40:57 +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 5C4D1F89B0C for ; Mon, 5 Aug 2024 02:40:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5C4D1F89B0C 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=YiCqy7x6 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JSEddH9Q0BWumYZ64KIdS28CP/j8cgQZUTqMYE0kxygKMcA/WDeolPgJ7zNk2Suf2JKNTXWMeZ7Q5hwilt2G99ss3SL/9/x/uJraGXBoCLiyGOEZ1gkdwmKYGraxbC4/OumZtJJL/CPmwjSh0/19775sTr3PCiQ/L4Z/X/9YqdT0PUXdBz68uegoMXN5TjnpAGA0a2T2OGbcY2xpL+H9utNYomIP2oegCjtYMFBBldJIF5/UQ9P8QONhiOeIBxiTw4DeJQ/IxFSW+b7p53c4wgylACIRJofR1p4WEuAtXPeahhG0btQap/roypwaqawfCJpJaCPfcwD8KuGQ+WkS0Q== 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=EFmMAJmEu/yqoYFvs64zEs1aRIIgfZmhvAsXUNEJqOs=; b=tnthdQUQVizrwK8nT6V65qKPmd0oyeV0iZ61E8T1OHBon4xQC1ufq3Z9AXNLs1Z5JU01Mfz0BCAa5f/Dt+gzaa7LiiR17/6nRQ+WnpGmb4Wv4tYYVwv+pXIuWAvn2lCUADzG0Q7j65G4O4dwcxl7HcAYkHreuGuTUlV429bNEqlFp44NHPRMBFSdJovbhLXEDPoVz4E7nxwpCyRoBnMubdzk8D+WbV4dqhGu4i4e1XsLxxde8VT/kKsJWmT26FvYg+kQuw7mvp2HSOSgoUULibla4NVRw4SJuoGImuSaspE0SPtsp1hb1LbfcbE7U8Y7XiOoyNoVBXLThWqYJCQqRA== 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=EFmMAJmEu/yqoYFvs64zEs1aRIIgfZmhvAsXUNEJqOs=; b=YiCqy7x6uOGGAJk4qMdGOuJDPBGSKpMpXYgnogwIH1Wx5/+Nl5sMIusYw44EKnShLjo7un52DEXpjMQbag7QZQRaMHXNhQzog8Dwr/2E7KWVXo5ySlACRHt414XzuMiruuNmuyv4xSTUTXcIQ0WVdvS+BZIMwFoZMlxhTcNYzuA= 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 OS3PR01MB9302.jpnprd01.prod.outlook.com (2603:1096:604:1cf::11) 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:40 +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:40 +0000 Message-ID: <87ed73yf7c.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 068/113] ASoC: cirrus: 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 A