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: 13752898 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+vrydL968Mfut0HoS5TQHFHQKlILkUdoWut5ppFDYvzCnMaZ3aSoWBshygp470rPYKEz73lq7GQjTm4P/zPfqvVrBT372LqzwLt5G0z9jLMR9ahqpoDtzUsCncXKVfLU//2NzEonY2/dgQK8q7UIix/Nreo9lSIVpmb3uU20z4w+XR+tTO0Mu6KN8xsfv2Sk6+3ulIso7BI9ySQyNIz9Tq/hJpi3VV37Ca5J/FTtMeF9eSxGIX7HGLsnItkW0EQCiHFjfX3IkbTIGtWwfl1UXU2S8VvoVQpZMi8x06QfBF8XYHssBXjd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;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+TnoH1zZAnjplGmw1lWYzrz+JTXq8LDIbpiReZG25oUdFZitln86ZKmy4DAk3IkROXWiCxLLXax+nTsqv7DngvTIwKYnVRGJeO7cN0UkjUNcVuGiw/17EZc06TpJp2Xi90PwDkGLGVmMGVX3MQHYvtv+IncfwyLEqdQDbJ1NN/4UKXpS8N3JeuTsO1Nw+CiOsEXgtme2fS++jKbOkXRvc8ex6zKbzaeXjBv+1WEATOOoiRQXvxEpbiqybRoPGC9R5HBURgp502t0Gc36dYp98PoSxi3PcdA6HKQhBZ44hpCtXqqY9ZmxUg3GgpiqBr4GzeZyJ/TbwYc5CajXHZ+txj5PooshDe82GmMKmcha+FixDC/BplelCiFQupQh5933bIm4ZqBK+aWp//mK2rjUYQrax7Xuftf8Ur8FbLkl9HJYyHQECWbZCp9aI0sqIiLv9YPe6F8OXeqfiUZKRYsub/Whrd0Ubmi7+TQoxDH6trWRAHddL6v0rZfFB6jSNGXmR8dZs9RFszDTQjjpRSawZMT2eQlqDqW9zwzbojNjnOfXpbw1h380EFaumj12Lu6HSRN002iVmIQZSd0lNQODUQdE+8MoDTOd9sEkEaLUbQNE/q8SJKQbuTMAcrdTEkBw6nlSo+RAxLGIOvDhRC5Cs+5vldkmNPwNxE03LGx+dzCdYyvnR2T+mwJiSn2q79itIsA+9/3PXOpU5l+PN0K6/9uf4MTFHh6fFf9jCuNui+fOgei8pkEkg37eNDFcQkp9ANhfEke9S3jIG0Hz4fYEAKgugeQt+hVAyLMbpfQvLjnOAtuxBJ0OZtXb2b7nijI157WpaZXP8KuFBQzt8z1IIN0V1WE/0QdDN6Ka6HAM8mfoA1jID1qBcHB0S7j92ZcRAMAqTXcKnaqcy2FFMuYqtUhf0XLh3SG3cRwIqlN84QkDTQ0fbdlb8qbcM9mjnVY/8PF2MY/oDECchmKXyeSHJUe8ZCc/+rZ5wP0w2sfszQVMo4bBmz2wwxi7UroUPhPG/lyIY1ouzI65QPXqmxQrngzg1Q= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-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;