From patchwork Thu Dec 22 07:36:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chancel Liu X-Patchwork-Id: 13079495 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 7D49CC4332F for ; Thu, 22 Dec 2022 07:39: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 A240C3423; Thu, 22 Dec 2022 08:38:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A240C3423 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1671694782; bh=p2ex0/leaIG5t+7HfEkjHWhX87dJLpCgXksITV8LZSE=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=gpUg8Le6KsulNkJBSLpJquzkfCmIjx2bY32RqFVNfMCggGP2xjAm5qt3ITuU22Q8H MMk/16pFrN3ut0OIqQhR/D4NdHMtgzZeyh5lmX2Ev6kBAGy6mrR8U4/iUvo4zVr5o1 0JE+xWDWZBAXo2n6PnOktkzPmqANKv+GHXqpFnh0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A6CAAF80539; Thu, 22 Dec 2022 08:38:08 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1AEDCF8053A; Thu, 22 Dec 2022 08:38:08 +0100 (CET) Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2068.outbound.protection.outlook.com [40.107.249.68]) (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 79E14F80537 for ; Thu, 22 Dec 2022 08:38:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 79E14F80537 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=RAQDSDDx ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EFhYMSk22jKqRO0uqn5xQO9SuciKMZzV2DSW2dI7Xb+WiM9TmY5ALZw68JQrDzB8UFnxQ8fsmYTzPT5NgGmpUa/F1IKfdwLzUrkgoEEb46JkkUj5ZMtLMkL9pslOK3IofXvxLRcnKbFa6w/rcGak5zYpytSHhImQsM2Wgllj1ld8oCaXbhmSLY/JVQ1q4ZHJjiD5xXTDJkUtWRJuMeVY/17a28cxkiEDtcYtNGxraJrrhb2DnJd4GGT6ZrrszseNzioC+NT4CZODlYsIzKsQ2+aCHwSzgnvie6JppBugNN51rCWxg4EWElx6NUh6crzFsT4bP9/UvwddOJs5ijOeUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=hegXW4IkTRNCp/QL2Fb493fkmLJRkeLVs83hlQZq6Ts=; b=bl30NHTxP06i66mMGjxBNzRP8bhGlHR7RwErOMoy/T6MEZrI7m1QFYlshUxsB8yR+3Wb46L6ReOUL15a22yWsqyb1wSOCBuhw1XLOfwRZRVhHDTXb4XRjNOQkpmJvfNKq3cM1rO7P85ODUiB5APKCC1O1qJ0PdgrG4Wis9SswCq+VsnoYweSpVqbz+ycYXVNyNw6Mdwa4OwaFGVnJk755oNTfqAhi0J2HN6v58aK8Qslq3iE3h2I8SIDNKLIYZQe21OhgHaGK4fnUemOwE229o7Lq2o0ynPmleyjJrrQaGcdzehLRMCuMPK7zH6ZI/t2USzYoxumVGqSRS3g/cJ+Vw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hegXW4IkTRNCp/QL2Fb493fkmLJRkeLVs83hlQZq6Ts=; b=RAQDSDDxOcfDRKGXoixEMpoH09r/0sXfHQDbHiM+1DOkZGElhzXFt1yZRNw+llsDgw8QJNo4vWdjxrPNaZRIP4erGwLfvCbTAkg5YfHNrTzGcjFhILbpi15+s85u0k7APNwnr3P6tPevtBzHPTZSF32ujY4QpF5+pfv5iRsnIv4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB4211.eurprd04.prod.outlook.com (2603:10a6:208:5b::30) by DBAPR04MB7272.eurprd04.prod.outlook.com (2603:10a6:10:1ad::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Thu, 22 Dec 2022 07:38:04 +0000 Received: from AM0PR04MB4211.eurprd04.prod.outlook.com ([fe80::c1e7:eafb:408c:6ae5]) by AM0PR04MB4211.eurprd04.prod.outlook.com ([fe80::c1e7:eafb:408c:6ae5%4]) with mapi id 15.20.5924.016; Thu, 22 Dec 2022 07:38:04 +0000 From: Chancel Liu To: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, perex@perex.cz, tiwai@suse.com, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] ASoC: fsl_xcvr: Add constraints of period size while using eDMA Date: Thu, 22 Dec 2022 15:36:18 +0800 Message-Id: <20221222073618.1064415-4-chancel.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221222073618.1064415-1-chancel.liu@nxp.com> References: <20221222073618.1064415-1-chancel.liu@nxp.com> X-ClientProxiedBy: SI1PR02CA0035.apcprd02.prod.outlook.com (2603:1096:4:1f6::8) To AM0PR04MB4211.eurprd04.prod.outlook.com (2603:10a6:208:5b::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB4211:EE_|DBAPR04MB7272:EE_ X-MS-Office365-Filtering-Correlation-Id: 3dddba45-6f4d-4a02-a9a7-08dae3ef75d8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TtIcRh9jAShnfrGotjDG1GvYwIkjkxg4gGvUa+hz2rdB8NQ6B9rREtHj8PJRd8DzPRzjaa2IqU2skf4t1AO3E2gGsnOP3l5uNJSB+FpuFAjr3WHbo+KB52jqr07UzH4hrlXSkS6KZnNSi58MwGdO6g8wpAOBAdVlB0C+LP6/Ym2SHPR6zvqSccmwrQ19G8qwXPevC6r0ycqbzSLc1MeZe/7EU/Ng9F6F7RbW3LF/PV/VdYFxD+HlnpFsQ6QZCZtTSD+zwe+zCha4wcpHiawErMq9Me5+WNOH8uh4+ap+cMfaLgPHXXQZ5GyaKe7Ie/s3xag9rBIW0svl+sc1oJfptrT8VlJQ8fydamyp5GAeBgxDlaAJgDTOqOOgFLipCkthAIox34BH7n4iiyMsvupnQIaxsKY0JIsinugRZ/7pHYgt2UD/nqZtmJQz5aWkYBgmiLiAlRVKm0bs/2S6lghwDDqNck9HITBjxJgDZ0Ta4gKbzyJk4wtIMCA8GMRrTcxWcR1JDs6/tZ49ik2j5zmDQGan6EaOFhVluath8c0JWB2kuRG1/tfM/EO8oX50xL/so32+p2hQe6LFeVp1asqXXxmGpQ6WC+fLTlWG7vFzlJvqGiL8YiKj9B/S4K12KPlj1TpfIqBwxX3xXdjd8d6SkE0fTiOJOzPjJjwCeXXJxDBNFhcYbcGde4brigUSpZSnUcYrZxtcjIVlvzGqb4CmzA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR04MB4211.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(376002)(346002)(366004)(136003)(396003)(451199015)(41300700001)(2906002)(8936002)(4326008)(66476007)(66946007)(66556008)(44832011)(7416002)(86362001)(8676002)(316002)(5660300002)(921005)(6506007)(186003)(6512007)(26005)(38100700002)(38350700002)(52116002)(6666004)(36756003)(2616005)(1076003)(6486002)(478600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GUhl0JqA6d2FRIiGdgaS3631MzzIoSAYV8bR2fwKkszq+byEFoPY/+Ie+bbCI98Wj/AZX6js8DCqHU+Bf1+gUONqN94jrCtMcnZQTgrSYwdKx5n2hBnUipvRlTBPsEV4o5MzHjmyZLqOcTv/pAr5mqeBopaZaUprXuBZa4ZEKcXS/IkTO5vZuKvIKLAEsM/70C43+RcHFmqrQI3SQ4md/GITGORcQ2v7+7jIblQKD/4Qc1MHRcyQ1qrUiN0CG35Qaw5FPMP80Xt4pIH+wUvXX9KaDuXHQz5gMK0oYBUcQJCTCSt6PwDLUSt+fsb61shNgLqQ5sns9gVeec8ka4iAAbLqUVxOg4g5OD/EYV66zrJr9YGe9W49kjwGHuOb6pm2jiszR62OqLJD9fG3G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lzj4CrTaIvTx68RzO2C1++BaH9opQPVI/WNEboddiCdshzGntmJQgAmjvZUtkVu1JiMhAu+Q1+X6xTQ9vbESkkreyCaqgedDWOwv+1q6c6y3Ad4SPC+ZK85EFQCfPaWZo219eh X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3dddba45-6f4d-4a02-a9a7-08dae3ef75d8 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB4211.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Dec 2022 07:38:04.3449 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wPCPrFZw4HP76xFMDrE2NAHU/MMtmvN3lejUQtKErgLS6u8jbhnYZLc5HRru1Y9FcUfP2kUnvfpJoOC9WV2luw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7272 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chancel Liu Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" eDMA on i.MX93 platform requires the period size to be multiple of maxburst. Signed-off-by: Chancel Liu --- sound/soc/fsl/fsl_xcvr.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c index c87ae864df77..bb03c04bae9c 100644 --- a/sound/soc/fsl/fsl_xcvr.c +++ b/sound/soc/fsl/fsl_xcvr.c @@ -22,6 +22,7 @@ struct fsl_xcvr_soc_data { const char *fw_name; bool spdif_only; + bool use_edma; }; struct fsl_xcvr { @@ -538,6 +539,16 @@ static int fsl_xcvr_startup(struct snd_pcm_substream *substream, return -EBUSY; } + /* + * EDMA controller needs period size to be a multiple of + * tx/rx maxburst + */ + if (xcvr->soc_data->use_edma) + snd_pcm_hw_constraint_step(substream->runtime, 0, + SNDRV_PCM_HW_PARAM_PERIOD_SIZE, + tx ? xcvr->dma_prms_tx.maxburst : + xcvr->dma_prms_rx.maxburst); + switch (xcvr->mode) { case FSL_XCVR_MODE_SPDIF: case FSL_XCVR_MODE_ARC: @@ -1207,6 +1218,7 @@ static const struct fsl_xcvr_soc_data fsl_xcvr_imx8mp_data = { static const struct fsl_xcvr_soc_data fsl_xcvr_imx93_data = { .spdif_only = true, + .use_edma = true, }; static const struct of_device_id fsl_xcvr_dt_ids[] = {