From patchwork Tue Jul 30 01:33: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: 815350 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 (alsa0.perex.cz [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 85B85C3DA4A for ; Tue, 30 Jul 2024 01:34:05 +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 CEAE0AE8; Tue, 30 Jul 2024 03:33:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CEAE0AE8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722303243; bh=TtDKbSNql/AqfF87YrEALkDtAxCQRolyOPwj1aiMlQE=; 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=d0Dt2gLcS6j0/njBJkSN33pOyOOYGcxVzPbyDB2umLQ83dR/yh2krFt9VwXnkmjBC g56Kv0wGaa6OOtmvURDvOoubVjQhDoVmpYvqFSeFX+9v/4+ZTH5zP9QX5JMPExm4lA t/+iKYl88tQByaXQjjIB3s7+AsIYk2Eod0789j/I= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A452DF805B5; Tue, 30 Jul 2024 03:33: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 51879F805AF; Tue, 30 Jul 2024 03:33:33 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0BF93F80448; Tue, 30 Jul 2024 03:33: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 26DFBF8007E for ; Tue, 30 Jul 2024 03:33:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 26DFBF8007E 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=LnxmQUm0 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MhjtxZVdpal/AmOsveFvMGKOArJmMm/Bn46WzGpgB1Bkc4JPn2FspfpydJBY7sVbvav06/AtavlmdvO18FOEgLBmUvBmijgZzl6NOq/joq1dNMEJ+NwKKMn9bmHgII+OdNdJH7hclv042fouEEPkb1fRlk+k99wDpMMvSHPR7TUr0Ct3VfqlxwkJEpAy1JiYAlzAbtOAVGouQLEUyw8cMQG+MlcldIIOfQbDa5/mbW0hYoxbjhoFdmu7/+CaEb608YqSkIVpWZHFop7FLJzbtrG5AgwhfIdtTyRn+/0QwEYc3CgNc5T7V1aeH5jt+AP4Ha8RjGLaEMbyMwt20J9vxg== 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=T5k4QMWimaRNAs6BGlCKrh1lMVMXlDZmUW4ASKTi1Tk=; b=x4z3I0erS+H2aCHcSVXU2crwxuUh+Tt/8X98IeCCEfWgRLIhKonxiIXcSr/o4zqkudAGZLhKtQ5SBRpcUEeiwvRQwLjyPHb0GVFcjEbjH2V3D5WsWEABHVm5ke2lAFxOJ3gvvaeim0f1wEhCAeyKeBYY4wQRIWKExNoD9yjlXaiDq3Zwq8gxvuPquXSwa35Py8sDXZmTiuZg3Ylq3oxfHynWzY1pRk3hKBqWHJubBMjzY9uxidX1EPOuULR6YVKVkGK9v+1gXMC0XoIifxb4OgRxD+1+RbWcPFxdCzmRW+t/8yLSQa5Bf7y0qZXORZ0AotKNxUDM1+nRuenSXzKANQ== 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=T5k4QMWimaRNAs6BGlCKrh1lMVMXlDZmUW4ASKTi1Tk=; b=LnxmQUm0xSMy672l6nNVA4WjpnDqGDlw4tfiSTzq5OQ4YsozNOfZ45j6XW1mOPHZSdtDv8k2wi8cM11fMD8eOz/YWOiKyZmBhqwQCP+vqLH36zyxSxLY0NaPJXIiwnNGmyJmpUGMucTjJSSZt2GiXMJ+d/0Lebk+Ow1aVQHrfqw= 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 TYYPR01MB7901.jpnprd01.prod.outlook.com (2603:1096:400:114::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Tue, 30 Jul 2024 01:33:14 +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.7807.026; Tue, 30 Jul 2024 01:33:13 +0000 Message-ID: <87zfpzk6jq.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 1/2] ASoC: soc-pcm: move snd_soc_dpcm_can_be_xxx() to top User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <871q3bll5c.wl-kuninori.morimoto.gx@renesas.com> References: <871q3bll5c.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 30 Jul 2024 01:33:13 +0000 X-ClientProxiedBy: TYCP301CA0067.JPNP301.PROD.OUTLOOK.COM (2603:1096:405:7d::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_|TYYPR01MB7901:EE_ X-MS-Office365-Filtering-Correlation-Id: 041edb19-d137-4f65-39bd-08dcb0379455 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: S/uMVUfb2++HyGnOw627dSKV/6u/fQMvZVDZw5eUjR0IpotI5nzg3+Qyulihfbt/fVhrQcQHT9Nu9UbwQX1/tBkTSnnr7UtoLcc5ifwyeLXedKshdrtf8vAleVRrfJyZkLmt+UMbG6Ls9ozc2A+XRaGsJL4q2A0mMWvHK59V6Jwthl7RQWIIwpeFnUhQ9+e0OozBbJxULPgMZGlJtOD+4qy8ce4D+CIK9zdqLmZqebkYiuZ4Q/9H+OnDjrRZYz/J1ObtKrd3dxOyzXwsF8FwqV4j6eXJ0qrYcgySUzLoKWE/eTNyUJCekBwMoXVLp9LxxmfRV3ZZ6ATkUvdMTlQTyo8MQ0hXIxQrXnoHQ7JQukPOmqRioJgOARsJD7zmjGLO3dsy5yies2Yol5aaHexmSCS5yC5mZES402WQcI80Wtuq1fr9Gg5NgjmuIrGJXRNGRdj7F10SHkiV1uxf5NeOPIBm/+Qk963BkeLJeknG3ZRP4OvPmKItoF7EXQUvdGhI9UqUO040D14kmdg/iCsdUVFdKEau0R6dyPgWkdANc1iRxHPW9pfaNa/utrFwyRWDuSt1mOjlHJB3L1MZmmzuBPinLYZqHaTJwK96o1CloaGxXBsV0/5MZNrv3OZFBF9WaT+JoXugv4DRG0amOO0ojS7v7th3l6hNuHUWQuZ7jkn/CjR5AcIiCJu4VHkgV+pwrAD+7PMAcUD6FpSb4CSc92INvfceIPvtBXLtnG7iifB7rAe1RMqYZj8ahHQoe07OjOTvcIKSmAuAiHCxUI87PiZ6CCpQvC7xqEgR+VtrtCsxNLyOjf1nDOL1ysiCKy7TnluMuO+8ASj3w3ZzZdTTMOWho3zHNDCdeN5bOupXE+2xt/tG3HQTOh9/vsvWb9WvXVnBxYrHcX7qSwo9zmUZ2HacnedJKCUdI3xxuWQoXg0Mhdq91L9PUsRmEi0SyQFgile+T0XTgv/i8EcAfF7/3b8jZRZpQOasjon/HG0VTpjtdUjTpw0wVz7pyBbI4Mr7VMDATeIr0UbNKLVjHlE8QxNnXM0ocUnkAmjd7dLx4goqXY2QGWfsujIvY0lkhzqI7s9IPJ7BjIL0iG8Q5zJOWm5kKaGJTPBhCYHAwKAwRAd1meE5hJLa695GCncnLQ8UpBiY0RMD/QPNl6enVTt6w5AlwdKuTamPxu6ipkxJZ6LPKWNjTZRLPyc/eEJ5G5nrCV2Y/Vmbpt0oQ+35DDBd7uHwu07HnlpYhtICTGq6NkpTUYoufrV+FJLsdVpOoGYc3Iahv550xf2LgoUlJED8N2qASrfuqj04tcKe7NuzlsyGP9DtNcazsRjbh1Dq/6ehiy18FrYeRoChn+PmIqvLPvX4xC8ESM5It+XDNjj17GLNCllDktK86bXlCkmqly5Higehk2Wo1DuA6w6OiOOhnA== 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)(376014)(52116014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tOnhnkgX7dWiOReOru6thbB3D4Rv0Q3w2xBARXVroyMj/U2jBB2/E3qNnUubkgbiEfsTRLcX/mxbl65adLmegiTNNd/M2qdCv4hGgiyAPXdWjeq6O6728kcy1LXdrcfx8JW4w8BJQXn3gD8pXJqxAP3t45r68Ffu2xYi7VX4esk+fvyUOqbda9IkKAlLBqOCnB8KL12q3en6cMNS3lSfZLdjoE59nUQwsXCDBFNgqMPGpa46Orbajdo0UyreIivxql8q0czkAAhwRi395tR5bs1Dc1Thtm3uOF35bBDJqXahEcXHEYe3TS3lEwLcYKLFhUriVumcFiS5WyPJKusPl+Q02DnAsBHJRNqrENZrkTm7f4LDOer6soJ3qjsFtJRNbf0aOvRcboAYLXHFvBwziwj93uD75mpFVKd9MmJcxU3grozQyazEbJUxUEiV16F/SG9oCXO2RJ/5AugiqOwzKnFwWKJ9H2bOM1RBQIYE6h4F/efS2Uv9QgiMdjiKQ14DKyoWyAbVSP4Q7FV56Yyw2l9SsDVAK9XMnj+ksW+5JBNbgAJj9X+hTrhj5DFj8Z5vDnmwDYv5rIUuB1qxPKvkp5DxYl3vGzTV04CB/VCk/5OfHp0bhVsxD/nLfRbGjyGJpmQBGMxkxmRF/0Q+CAvaL0YH6NZ8x4l9JjOSL09U21e0s9knJdisDpFlXRsknL/dJOUiIvdhYWAs6aebO9eT0bo9Kp6GLUu0GLBhwyj+X3xcWgQaB7ocDzNJQKfBNLZQ9dz8XY9xUqce09meqpkYV8dWUj2RzEstJSEurIOAHf0sbwEhyqTPQdEbfx6da+6WSV8jtFtsoayWWgrbDWkCNwPJYzbehssHELq390QzOHAPJ4ukD68m0BEH7I1W4P+wH+T6DNdBHiP+hHYxOP0MWIaC04gDY6pdtEVvkLKBXunYJPB7UrAz6iwtD8hZTV2UxgbdlytbKkK5GTG7D/HQ5PWMrmZBiue/4ghwEqGB8oS/kXahRe7k4cXjbwAknVQIQElCbgfD2GNoNd7uBlolS/U4dw5ziPU1ZSR7vj71epwtLuaX9dzX8u/BtPWLUB35JwYui1eBZxFBD45Jn16cSHweVvmVYW5L82ig0I8YwHdJsz7BF176YHGqSLQ/5H3kUkv+MAaugbgY0g5couqAdy7EPGj+Nbn6fW1SieyJ/z39G71eXizvNpczMB578fMloez0vpg2AODWfutSyijnikkmhPEW0zRg1wyWOvw+Iv1WaNor4kkB0OHmRU+j7XCWnXfgGrhRLikKWtOwnzJgK0PJq140UVrjh//ImMqhOLgXHKOxZOOnklc0fZFIegTcHzTfckO5YSCQLurVGnv17AekNwfvBytZkA4JVrSJRVQYcIu/n+2VEcDI7YJOx0SwxT1e0H+fwChJGg3hMbUsgEMa5VTdnsWZBkUWkqFOgJL56DBRGA/3EcSNxUMCGWv48/FSUH9v7/lno4FsB6eKFc5Zpu46RTIs4gt76pHbXARU5sTGMaDOp+UaDzaURh5dVnGJlUHocmYyUJVEA6Vy77z2Pf6mGinh1Afy5JOmG3xW8f8wq0h77GJxhZrZN5o4k2drHgpjNBi5+7OOiLDPUIqrFIrSjjklFDlUHAcUcj0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 041edb19-d137-4f65-39bd-08dcb0379455 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 01:33:13.9019 (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: pDR3Kz9xhTH2O9DnLrbCqs0Gm6pPjy8MerDKsN9tZ9cqoigJcGlg25qNvNiK51h7Kwjt37b1VNEIcGRt5JLyBUhJPafd1+vUvTChMRaBxC9ng6LUlXtu0Ft2zMIHGBgl X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYYPR01MB7901 Message-ID-Hash: 23MJ3KYOYRG7SFBD5AGRQAZVH3OWNLMF X-Message-ID-Hash: 23MJ3KYOYRG7SFBD5AGRQAZVH3OWNLMF 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: This patch moves snd_soc_dpcm_can_be_xxx() functions to top of soc-pcm.c This is prepare for cleanup. Signed-off-by: Kuninori Morimoto --- sound/soc/soc-pcm.c | 204 ++++++++++++++++++++++---------------------- 1 file changed, 102 insertions(+), 102 deletions(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 5646525ad7924..961fadc6fbf88 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -49,6 +49,108 @@ static inline int _soc_pcm_ret(struct snd_soc_pcm_runtime *rtd, return ret; } +/* is the current PCM operation for this FE ? */ +int snd_soc_dpcm_fe_can_update(struct snd_soc_pcm_runtime *fe, int stream) +{ + if (fe->dpcm[stream].runtime_update == SND_SOC_DPCM_UPDATE_FE) + return 1; + return 0; +} +EXPORT_SYMBOL_GPL(snd_soc_dpcm_fe_can_update); + +/* is the current PCM operation for this BE ? */ +int snd_soc_dpcm_be_can_update(struct snd_soc_pcm_runtime *fe, + struct snd_soc_pcm_runtime *be, int stream) +{ + if ((fe->dpcm[stream].runtime_update == SND_SOC_DPCM_UPDATE_FE) || + ((fe->dpcm[stream].runtime_update == SND_SOC_DPCM_UPDATE_BE) && + be->dpcm[stream].runtime_update)) + return 1; + return 0; +} +EXPORT_SYMBOL_GPL(snd_soc_dpcm_be_can_update); + +static int snd_soc_dpcm_check_state(struct snd_soc_pcm_runtime *fe, + struct snd_soc_pcm_runtime *be, + int stream, + const enum snd_soc_dpcm_state *states, + int num_states) +{ + struct snd_soc_dpcm *dpcm; + int state; + int ret = 1; + int i; + + for_each_dpcm_fe(be, stream, dpcm) { + + if (dpcm->fe == fe) + continue; + + state = dpcm->fe->dpcm[stream].state; + for (i = 0; i < num_states; i++) { + if (state == states[i]) { + ret = 0; + break; + } + } + } + + /* it's safe to do this BE DAI */ + return ret; +} + +/* + * We can only hw_free, stop, pause or suspend a BE DAI if any of it's FE + * are not running, paused or suspended for the specified stream direction. + */ +int snd_soc_dpcm_can_be_free_stop(struct snd_soc_pcm_runtime *fe, + struct snd_soc_pcm_runtime *be, int stream) +{ + const enum snd_soc_dpcm_state state[] = { + SND_SOC_DPCM_STATE_START, + SND_SOC_DPCM_STATE_PAUSED, + SND_SOC_DPCM_STATE_SUSPEND, + }; + + return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); +} +EXPORT_SYMBOL_GPL(snd_soc_dpcm_can_be_free_stop); + +/* + * We can only change hw params a BE DAI if any of it's FE are not prepared, + * running, paused or suspended for the specified stream direction. + */ +int snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe, + struct snd_soc_pcm_runtime *be, int stream) +{ + const enum snd_soc_dpcm_state state[] = { + SND_SOC_DPCM_STATE_START, + SND_SOC_DPCM_STATE_PAUSED, + SND_SOC_DPCM_STATE_SUSPEND, + SND_SOC_DPCM_STATE_PREPARE, + }; + + return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); +} +EXPORT_SYMBOL_GPL(snd_soc_dpcm_can_be_params); + +/* + * We can only prepare a BE DAI if any of it's FE are not prepared, + * running or paused for the specified stream direction. + */ +int snd_soc_dpcm_can_be_prepared(struct snd_soc_pcm_runtime *fe, + struct snd_soc_pcm_runtime *be, int stream) +{ + const enum snd_soc_dpcm_state state[] = { + SND_SOC_DPCM_STATE_START, + SND_SOC_DPCM_STATE_PAUSED, + SND_SOC_DPCM_STATE_PREPARE, + }; + + return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); +} +EXPORT_SYMBOL_GPL(snd_soc_dpcm_can_be_prepared); + #define DPCM_MAX_BE_USERS 8 static inline const char *soc_cpu_dai_name(struct snd_soc_pcm_runtime *rtd) @@ -2960,27 +3062,6 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) return ret; } -/* is the current PCM operation for this FE ? */ -int snd_soc_dpcm_fe_can_update(struct snd_soc_pcm_runtime *fe, int stream) -{ - if (fe->dpcm[stream].runtime_update == SND_SOC_DPCM_UPDATE_FE) - return 1; - return 0; -} -EXPORT_SYMBOL_GPL(snd_soc_dpcm_fe_can_update); - -/* is the current PCM operation for this BE ? */ -int snd_soc_dpcm_be_can_update(struct snd_soc_pcm_runtime *fe, - struct snd_soc_pcm_runtime *be, int stream) -{ - if ((fe->dpcm[stream].runtime_update == SND_SOC_DPCM_UPDATE_FE) || - ((fe->dpcm[stream].runtime_update == SND_SOC_DPCM_UPDATE_BE) && - be->dpcm[stream].runtime_update)) - return 1; - return 0; -} -EXPORT_SYMBOL_GPL(snd_soc_dpcm_be_can_update); - /* get the substream for this BE */ struct snd_pcm_substream * snd_soc_dpcm_get_substream(struct snd_soc_pcm_runtime *be, int stream) @@ -2988,84 +3069,3 @@ struct snd_pcm_substream * return be->pcm->streams[stream].substream; } EXPORT_SYMBOL_GPL(snd_soc_dpcm_get_substream); - -static int snd_soc_dpcm_check_state(struct snd_soc_pcm_runtime *fe, - struct snd_soc_pcm_runtime *be, - int stream, - const enum snd_soc_dpcm_state *states, - int num_states) -{ - struct snd_soc_dpcm *dpcm; - int state; - int ret = 1; - int i; - - for_each_dpcm_fe(be, stream, dpcm) { - - if (dpcm->fe == fe) - continue; - - state = dpcm->fe->dpcm[stream].state; - for (i = 0; i < num_states; i++) { - if (state == states[i]) { - ret = 0; - break; - } - } - } - - /* it's safe to do this BE DAI */ - return ret; -} - -/* - * We can only hw_free, stop, pause or suspend a BE DAI if any of it's FE - * are not running, paused or suspended for the specified stream direction. - */ -int snd_soc_dpcm_can_be_free_stop(struct snd_soc_pcm_runtime *fe, - struct snd_soc_pcm_runtime *be, int stream) -{ - const enum snd_soc_dpcm_state state[] = { - SND_SOC_DPCM_STATE_START, - SND_SOC_DPCM_STATE_PAUSED, - SND_SOC_DPCM_STATE_SUSPEND, - }; - - return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); -} -EXPORT_SYMBOL_GPL(snd_soc_dpcm_can_be_free_stop); - -/* - * We can only change hw params a BE DAI if any of it's FE are not prepared, - * running, paused or suspended for the specified stream direction. - */ -int snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe, - struct snd_soc_pcm_runtime *be, int stream) -{ - const enum snd_soc_dpcm_state state[] = { - SND_SOC_DPCM_STATE_START, - SND_SOC_DPCM_STATE_PAUSED, - SND_SOC_DPCM_STATE_SUSPEND, - SND_SOC_DPCM_STATE_PREPARE, - }; - - return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); -} -EXPORT_SYMBOL_GPL(snd_soc_dpcm_can_be_params); - -/* - * We can only prepare a BE DAI if any of it's FE are not prepared, - * running or paused for the specified stream direction. - */ -int snd_soc_dpcm_can_be_prepared(struct snd_soc_pcm_runtime *fe, - struct snd_soc_pcm_runtime *be, int stream) -{ - const enum snd_soc_dpcm_state state[] = { - SND_SOC_DPCM_STATE_START, - SND_SOC_DPCM_STATE_PAUSED, - SND_SOC_DPCM_STATE_PREPARE, - }; - - return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); -} -EXPORT_SYMBOL_GPL(snd_soc_dpcm_can_be_prepared); From patchwork Tue Jul 30 01:33: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: 816356 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 (alsa0.perex.cz [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 914EFC3DA61 for ; Tue, 30 Jul 2024 01:34: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 C15CD846; Tue, 30 Jul 2024 03:34:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C15CD846 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722303263; bh=RdX2cfM+AZ4QUJJ3Niil2Za6CN9pG0oe/RYxOlzHfNg=; 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=DQLZIyc40mFnJro7uUhyT1/Rckf3KM+JoLmNYQcPkJ2RnnbHUnP43cbRJMs7bkBbi JHXnSOk+Znk2aM/ruKEX1UYoM9FLQLrXDxao2I88tyqzKelRWd6ZBOSbfYz+WShlUs KvsYl01eU7vj1JsqiliSiS1GBiejuBRVIZgIHZdM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 03116F805C9; Tue, 30 Jul 2024 03:33: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 4E80FF805E4; Tue, 30 Jul 2024 03:33:40 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 11623F805C0; Tue, 30 Jul 2024 03:33:36 +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 06790F8007E for ; Tue, 30 Jul 2024 03:33:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 06790F8007E 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=UgnYJvux ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jz4zL+Feq4X6I6x1KHmJgtt6fPNGVYP5Epdqa0yn6cL/e4mEJSfn5e127f/dOdPVtZxg09IO76lXbaKckLrowDi79CSO06YxgbPxEIk64YTawxdvjgVnNE70t+9Y9u9d23kmuXc9Ygz5RwYP4vAwHHjbBZzEBMYUkfGO0gkRnpXLdkCV9sM8eQ7tsnFUkzlZKi41tzjiBNi/u9dbX30HJtYNcFXdjwAp3WIQtJ291h9RsUvkFjLkeyU/FE95GMe63eJs2qSaYG/HgC5lBWPU8XgNkcjioGLjZYP3XR7KaYgAeKZlhKuiSjc30wkFPY+Q7uVh/K/5m+K57BiGmZIxIw== 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=xgg3BGm+ozSaRVfBljcEnjYirZFcrFQLRddrRdkFeJQ=; b=JdJsU/e3ypxsv5R80ndy0IqgmvRxp6Ks9ci5qdFoKcHbDwr0HcM4+5ACAEkiQyP5IIoNTgcPwrB+bo0X3Y8+YQvKudlh4lIU2enMIFOMZcODnURon/CicjBhMKLFX5TY0zLP/q8qjPEMb2dZSQHJ8tObthalzTXTqRcNgHHnA7bMFLgw/VJ9L/lJsN2C9dQDw0eSDCUStRWxlfmAV3ZHcs5aEoiprXOYritBxn0KJShyNuT119fzhh7LYuvaVFDsKEWfA6NNawq5Lh4BqgNGtvsMljQJBNx7JNExiPMqRVnWTJSenHXWM2CuBqnSpgELTm2OulJ5hjLydQJIBnaHeA== 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=xgg3BGm+ozSaRVfBljcEnjYirZFcrFQLRddrRdkFeJQ=; b=UgnYJvuxKaB6OkrbRGoz3MSW5ciiMxjNnPQw3Ad6kkX9clIDPVQIhbTWjygEzSOFsaKXEYcIFA3TIDK8CQDd6S4yyNZcY4OoAwFVHIY+Cu9c9o2rQrpETYeunkAn+NkYSng2bDAoqpsgwMAO/uCWX9UTactUpY23GU+bKpEaaPU= 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 TYYPR01MB7901.jpnprd01.prod.outlook.com (2603:1096:400:114::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Tue, 30 Jul 2024 01:33:25 +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.7807.026; Tue, 30 Jul 2024 01:33:25 +0000 Message-ID: <87y15jk6jf.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/2] ASoC: soc-pcm: makes snd_soc_dpcm_can_be_xxx() local function User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <871q3bll5c.wl-kuninori.morimoto.gx@renesas.com> References: <871q3bll5c.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 30 Jul 2024 01:33:24 +0000 X-ClientProxiedBy: TYCP286CA0241.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:456::6) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYYPR01MB7901:EE_ X-MS-Office365-Filtering-Correlation-Id: 263e01dc-60dc-4601-379e-08dcb0379b0a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: LAoXTipyQJgNdFvnhGScg1uJSYpdRG7OoZnsepp5m2ReTrBzkLvro/OsulANWkLgz0XPPT0gHg71rdA+KPTBP027CuqNW9OJbqpcQVR0M/Xip6o5rnwPO4mSGdT9QiOT4OpqoobaJlXx87naGCWB60J91ONcozgfybXhpWvdPV6QOO5dpo4+sMB/Owo7nNMUC1M0NaOSFhDUciCAwbm32orE2Eon478XIzdUrL/T6Rx3n/hGG7iJFjRmnUoTVQ1uOmzZb/ViLzEMYYTl3hTsad+H5Ba3F8FQsgz7De6w/sVryvF5U7uJC9EvxlHd//M8lxxelCDvbK7lcYLDoqDOS71Dx9sClFmCeMje+e1/CNaoaCDHT/pBQNJwbMcR4phD/GQ0+4VO4dDSQe2WoELvjTSkjONKD5/yIhoUN+yo4+zpmFZMvK6PCW6Xy0J94d4NN9JV5/poPWrsrryYrT6MZ1qMmntG9TlvoM3nrilCVMwfmpWxHMMX0Ky1xwjCnp6brFF02jILQQ+Go/HarcsetWvY97Z72sja0QHX9HVzXgawZDPVpBm3AdhC8JvdtuP9T8eiBLLorcRlNtxjDlDwREJxyQ167Lfp80QDd7FSyPl62z/zxZnVKlq39CXh4NnUb8iK6oXx+HA5TMOS+V0U2JQm8nF/Ex42MKg1u/L10/UItztTJPZFW4AqkEzGipQMfiRvXb1O65LSRGkSvCzh8Jnvkwr+jBYGnkcU5jGOz8PcMUNH7gpUZM0ty/hF8v50kl88T8iXScxr+vbOvf8qbkXrteQ1N0encSUt50apBEwVMMWe6r8AtHHpQUGXtceAeOmePoj6f+9rrsJQj2IqxaK86vgwiZn5+XEuo5ztKPjG6rln+9zvC6Sp98UMrqAMOiLeYLwB9PxL8wnr+nvHbA7Q2aYOdZlst52/mzO9MKg5vcrlISA7C1V0OaIXmFh3ENlwxbviUOsqzkhLUcna88rvq4jvQZZbBJ5IgnkxKeBPQryKHBlCVeMz9pNMAMqSWjj/+u2REmKYrhLR24w4vr8m7ygSBO1rAHs80oFCX67BqSgCJ18Y5/Q+x6ras2vRUmS+iQWRzlksi3H+yumoTcfCDB7SbbdSVQLqVNUM065mkF2vujGNMmK5PsS+BRQqXBTfHbmAi51IAz2uyUg0u3KOV8qWPDpkIN000oyyYDoWJ7s+c3ev69x27Vk5egE+O9BUErCHqTdIpDlgYYxrI0an0Ntyo5eOzT0iMmhHV1GQ8ziOe+KGVhREuDW+oiqy9vqz74tmm8H0+axU+G0Ba+FkGWSbW9H/AiB9haPrtgc4ZszXp0cJCtZ49Hs97GbDyBvx4/apQwePa116/hk3pLvwgO/jfNbVKdNF8OwCqvUdrVVZA+4OFUNaNRvSYOmluhAthHf3PNvJayzCjDKiFA== 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)(376014)(52116014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: G8NJcd5b6qNhk7zDVowwSYo3E++fSV2CCREZ83mg/n9kXo1rUqN13wUf2lLjn+519j5QvxtqrTps0SXck0CxHYSxB6GzfhpngYNFQjAHeoT37b80/vj1V8qyvhNiohNzBkgbz4JtHE8kEpvwxVI7v7NzwlqyTK9AlQ22Ka7OMr6AUbZ95aU0+tCN7gp6Tdjg0GMLdD5YrANMuqlQ8jJFhGQVhGZYduFWQRNi4mNSVkRdYaDXeYvN5EDP043E5S2Lug/G6MvQKh6FGbCa0FAnjN1TAfQr+rYvMxdx5gwlU+pzMifiSUg3qw459QWuYUp6PMFKRojfgok6DoP6c4KSsO6/L/5KNgkSJ+w9efG1HCE5m6PTsgqlpdysQbbOjzLRRVYUSlZrdjapxpfWqRpu7dsUSH7littI/KVrEp0RshI4EbXWKbqJUyW0eD2AUztcUNjswjO5O4WyDqcyB2nh+sfPv3hoM143sktEQhYwHq3h7f00w8br9NVyvyylEIqxMp+eSKBteiLBvUiI8EKQ5XYjqMktpJ7PE9yzC7UbUEsLVpGQLDV999D02Mi9gnmt5o7w4RRIQY2EoiDlrH17zcXuxTUw+HyYbP2Mi7X5AYRYR1NInILtalrHpxwyJY5gw5QUSmNLrmXTz2qOrli2etYMBQodf8QtcVJJ1Senebe7dfuEo4nx8ajJZz1lHT6uN95UaX/lG03bN8p+XS3vrNk21guDdTC6Yx9VryBN9PyPm1iRlpcJLR+S23Q20BI27/G4aZSG3Ga1NS66jIA/CoG+nfGF+PBfgTHZVI1y6H+a6hssETLcHEwKBWNi4UPZZPOhxc0s6RMfctq5gzpc+erSwgCn9JXjsPM6WKHNMQ3sYLkRYDHhpc63Ig/B6zbrCI6whYdgQiaA/sEvtIZe01hbByeTDV7lqvwsOy/7Xwe6ner6co3HMmb9PDWB1sbbbPcFhMr1KNTz9xAEqiRkhpzh0ueHA7MFwMUqCRqZXl1kJCGD2Qgd9LFMz9s10fUPSz9IiDRarjIuGHuGtjotQfln4qeZuacybADkwHJQLnDAEkYatTPYSJPONRIU3/PxGAE4RZ52qvIvGKlq/g20AJVex3WaU/bCMWqmD8PdfKg8rpWa5wYKhz+Co6cfusACQg2pRBNFvYuTJaFopgxJ2uSmkZ/OMPAuZIc6oczG5RZu6y2/o8oqXc2eqAeOdzYdWObK//i0kK4gpJqem5UUjXpZBw/l+314+Q/vIC2hiJ4oFKHyJEsayttEuotvIHi3Peuxnp+tt7JmmRo7qk6hixIKrQCXP48V9Rw9rTB4nZNMX5vdAxOm73iU93vBNKMsO2g1Ft+PzVScsL36w9OJem35wtLNqv5xmjAZwIZPeS7iGXck0R/5bK231Sgf041ZZfke1YqexJpgbVUfyu0+wzxshQ9E7BlE/ahxSl4tnFjsMCreZd5gJ4DR13jXaL1ARqCqYjb17cIM5s2nK/1tqFXE9IVhoPADScZTwdnf9T2K9xG6cj244/z2/rJRrD7Na2BNqNNnGX5a151ftyendxPlED7ZH0ox1FcJmbbUGfYOcFMy8Ku3yuI0cGVvN8yIi3ZTVh9QmMyNC98sJHzXO6uK3gAgb70ojDEUY9SEAeU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 263e01dc-60dc-4601-379e-08dcb0379b0a X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 01:33:25.1450 (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: 2G4q7AaJqH42bMmE9ux3Aeur9de623ZeL01YU5MzE4cu1ekhjMRnkxm22a67YTHKgM/UZbfgmxt0XrIXiwgKVN+xPqSKClVWR955KDxSZRGwOrQ0wJFn7TFdgj+d0dVW X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYYPR01MB7901 Message-ID-Hash: RELMRVUAD655DXH6SX4Z5IYWJCILCNNQ X-Message-ID-Hash: RELMRVUAD655DXH6SX4Z5IYWJCILCNNQ 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: No driver is calling snd_soc_dpcm_can_be_xxx() functions. We don't need to have EXPORT_SYMBOL_GPL() for them. Let's makes it static function. One note is that snd_soc_dpcm_fe_can_update() is not used in upstream. Use #if-endif and keep it for future support. Signed-off-by: Kuninori Morimoto --- include/sound/soc-dpcm.h | 18 ------------------ sound/soc/soc-pcm.c | 23 ++++++++++------------- 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h index 773f2db8c31c8..c6fb350b4b062 100644 --- a/include/sound/soc-dpcm.h +++ b/include/sound/soc-dpcm.h @@ -113,24 +113,6 @@ struct snd_soc_dpcm_runtime { #define for_each_dpcm_be_rollback(fe, stream, _dpcm) \ list_for_each_entry_continue_reverse(_dpcm, &(fe)->dpcm[stream].be_clients, list_be) -/* can this BE stop and free */ -int snd_soc_dpcm_can_be_free_stop(struct snd_soc_pcm_runtime *fe, - struct snd_soc_pcm_runtime *be, int stream); - -/* can this BE perform a hw_params() */ -int snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe, - struct snd_soc_pcm_runtime *be, int stream); - -/* can this BE perform prepare */ -int snd_soc_dpcm_can_be_prepared(struct snd_soc_pcm_runtime *fe, - struct snd_soc_pcm_runtime *be, int stream); - -/* is the current PCM operation for this FE ? */ -int snd_soc_dpcm_fe_can_update(struct snd_soc_pcm_runtime *fe, int stream); - -/* is the current PCM operation for this BE ? */ -int snd_soc_dpcm_be_can_update(struct snd_soc_pcm_runtime *fe, - struct snd_soc_pcm_runtime *be, int stream); /* get the substream for this BE */ struct snd_pcm_substream * diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 961fadc6fbf88..9ebf07d349d8f 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -50,16 +50,17 @@ static inline int _soc_pcm_ret(struct snd_soc_pcm_runtime *rtd, } /* is the current PCM operation for this FE ? */ -int snd_soc_dpcm_fe_can_update(struct snd_soc_pcm_runtime *fe, int stream) +#if 0 +static int snd_soc_dpcm_fe_can_update(struct snd_soc_pcm_runtime *fe, int stream) { if (fe->dpcm[stream].runtime_update == SND_SOC_DPCM_UPDATE_FE) return 1; return 0; } -EXPORT_SYMBOL_GPL(snd_soc_dpcm_fe_can_update); +#endif /* is the current PCM operation for this BE ? */ -int snd_soc_dpcm_be_can_update(struct snd_soc_pcm_runtime *fe, +static int snd_soc_dpcm_be_can_update(struct snd_soc_pcm_runtime *fe, struct snd_soc_pcm_runtime *be, int stream) { if ((fe->dpcm[stream].runtime_update == SND_SOC_DPCM_UPDATE_FE) || @@ -68,7 +69,6 @@ int snd_soc_dpcm_be_can_update(struct snd_soc_pcm_runtime *fe, return 1; return 0; } -EXPORT_SYMBOL_GPL(snd_soc_dpcm_be_can_update); static int snd_soc_dpcm_check_state(struct snd_soc_pcm_runtime *fe, struct snd_soc_pcm_runtime *be, @@ -103,8 +103,8 @@ static int snd_soc_dpcm_check_state(struct snd_soc_pcm_runtime *fe, * We can only hw_free, stop, pause or suspend a BE DAI if any of it's FE * are not running, paused or suspended for the specified stream direction. */ -int snd_soc_dpcm_can_be_free_stop(struct snd_soc_pcm_runtime *fe, - struct snd_soc_pcm_runtime *be, int stream) +static int snd_soc_dpcm_can_be_free_stop(struct snd_soc_pcm_runtime *fe, + struct snd_soc_pcm_runtime *be, int stream) { const enum snd_soc_dpcm_state state[] = { SND_SOC_DPCM_STATE_START, @@ -114,14 +114,13 @@ int snd_soc_dpcm_can_be_free_stop(struct snd_soc_pcm_runtime *fe, return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); } -EXPORT_SYMBOL_GPL(snd_soc_dpcm_can_be_free_stop); /* * We can only change hw params a BE DAI if any of it's FE are not prepared, * running, paused or suspended for the specified stream direction. */ -int snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe, - struct snd_soc_pcm_runtime *be, int stream) +static int snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe, + struct snd_soc_pcm_runtime *be, int stream) { const enum snd_soc_dpcm_state state[] = { SND_SOC_DPCM_STATE_START, @@ -132,14 +131,13 @@ int snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe, return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); } -EXPORT_SYMBOL_GPL(snd_soc_dpcm_can_be_params); /* * We can only prepare a BE DAI if any of it's FE are not prepared, * running or paused for the specified stream direction. */ -int snd_soc_dpcm_can_be_prepared(struct snd_soc_pcm_runtime *fe, - struct snd_soc_pcm_runtime *be, int stream) +static int snd_soc_dpcm_can_be_prepared(struct snd_soc_pcm_runtime *fe, + struct snd_soc_pcm_runtime *be, int stream) { const enum snd_soc_dpcm_state state[] = { SND_SOC_DPCM_STATE_START, @@ -149,7 +147,6 @@ int snd_soc_dpcm_can_be_prepared(struct snd_soc_pcm_runtime *fe, return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); } -EXPORT_SYMBOL_GPL(snd_soc_dpcm_can_be_prepared); #define DPCM_MAX_BE_USERS 8