From patchwork Wed Jan 4 02:39:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chancel Liu X-Patchwork-Id: 13088156 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 3380DC4708D for ; Wed, 4 Jan 2023 02:41:56 +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 BD5ED8164; Wed, 4 Jan 2023 03:41:03 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BD5ED8164 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1672800113; bh=Anscl2HuxOFojrou46izftfhYFFdoiERvCB2KnYfKn0=; h=From:To:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=eiFUHFIhv48p7DDlY/tddrYfLT8305Irr6finZeiTpTK3tZEyFapfOr7zbxND26RB VXvHuAqtfwAlIGL9QIgs5j8c/VsFzUCxvANT1eLkw7Q1MRyIqphRUkwPg9XXkN4jf0 3ySdpqA3tEd8rlto/OZrP8Dd69VQZbY5LW8IoRz0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 48ADBF80551; Wed, 4 Jan 2023 03:40:37 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 24E1EF8055A; Wed, 4 Jan 2023 03:40:36 +0100 (CET) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2088.outbound.protection.outlook.com [40.107.20.88]) (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 115A8F80551 for ; Wed, 4 Jan 2023 03:40:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 115A8F80551 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=lhoeWhxV ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JWrQ1v8i3t/NN2rzP+vRPtodLcUkVkvY9CMQ8MLAuZRMdy3wO7d6teY2zIeDGhd5CdeJ9uZTc/ZT3TlzfsIGQW/TNUE4jzoeUlq1e5VmBQllG2jou4JlmSW42Vzkr1kpPJPm13scQv/K4/0+trppL6If6m/r1oW7h3WJcak2DjpOP+ED3z5fhNDurwavZRfjCJztrU1n+U58UboGn5a3H7BQy5W34D5vM/BsHQqR+/BNgZ42T2VMKsJ1kMD/5g0RfwTXR019wAUVObgs57Ye092IbocqUbwnX14mOdhBYe7PPWd/AkJfTDE1rH1s3yVFkdUTKbM2BIPIGKVy3xe/Ig== 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=jfqqfKq+p5L47STbaiUShceGluBUv/TPjceQ6WfftIM=; b=EBxI14q1YL4DazbFnFhDO7iWb0nQ8ZYWaF5NutNqBQXIj3eOWcitSJaiumCZIH1lWn+Xtl2X0q2Ueh6W6SGxA+oMIBLDVKR0sU7QX0ly/EYUSrokI+F9saTjmwZrGD5m4KZVJJEuhAkFumkS6n2nfbfJMSElvou1s0Fx16xyf/vB19nkp9wfGgpbd4w7hppVfqHZOed64jqnMMRwikTpLVxdc/zJsQkDsX49YTvBgW3OmEsGGSwPvugQCn7umfSbIPPfdcFN4KQTWNJRtEjzHOgu8R3cmFqOlS3+eTjlnVLVdEff+gDWF6JB1nIUOtZIW1e2tNt/WN5YzBhj/HoxGA== 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=jfqqfKq+p5L47STbaiUShceGluBUv/TPjceQ6WfftIM=; b=lhoeWhxVfwBtJ9Ij2fWglthZe69BPN1bALFBfKoPHlfxtAGe9vzrCrY0GvPnpvRl3Q2YNyS7FPiFa8dqXDfHtmy7JzeK225wFXTOReFs/FIAPZxCzG/E2TAhBtgccV1JvpSIWBYbKwILEaoILyGwhll8lbwsEO6drdnsViWV2Zk= 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 PAXPR04MB8491.eurprd04.prod.outlook.com (2603:10a6:102:1df::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Wed, 4 Jan 2023 02:40:31 +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.5944.018; Wed, 4 Jan 2023 02:40:31 +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: [RESEND v2 3/3] ASoC: fsl_xcvr: Add constraints of period size while using eDMA Date: Wed, 4 Jan 2023 10:39:53 +0800 Message-Id: <20230104023953.2973362-4-chancel.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230104023953.2973362-1-chancel.liu@nxp.com> References: <20230104023953.2973362-1-chancel.liu@nxp.com> X-ClientProxiedBy: SG2PR02CA0130.apcprd02.prod.outlook.com (2603:1096:4:188::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_|PAXPR04MB8491:EE_ X-MS-Office365-Filtering-Correlation-Id: deb709da-4e7e-457d-f6e6-08daedfd0c1c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2y5t+7/Zfok6umTtS7E7NBqtige4x8338vyycTDikSGMTyDd3vBYuvQAwg20XgFA83dVjrJKvKfJaa9gajxqqIq4dWRNgf7WsCGY+a9cciMAECiz2k+yJox+ZNO5D5fO/BtcfernsO7EDcbnpRfhU702E1L1yytmKLqMZ3b6CC5/xL/F0y8NxC4PRpbUG5aRUK9fgQKECd+NRrsYxez6OLvekBQch7ldnQ7a7afIw28PjJ4hTdIMVDaSUNclgMv2Bn5NpOXTiQzaVZS7EJ7kxOGw75j9INgYiuU8eQLlZ+Z4FbhQCFFS4MbmiBqX6QQ2Wctz2k2acRSnhMvyn4xX77LUy/2m7StwnMFTyHFdPschEfHItXgpmc1zvyCUab0l1ACilT35pGTCGtH2fpwCuaCgdbQJDedewhwAP7lMUf7Y1DbjcHgJOzQHT27YF9JC3EIUwUTvAXX8VjbK8rIs3ssEugyNazQhMvRoxRbtHajLjG+dyhZaAQW44SG2voqjtG8lYIQk5BIiINeiGt9QTO0ynj9uRPBnrYvSdYercNCCC6W9ELGIdavj+OSeibNTkxFiqwV14k8RZKytWrZUvNqD5y7n8QpYXjv897UmQ8jvY6zdJezu2yZOS29xwKjXrpFoehkbbEq9B7+ENkuN+tUwusxG3W/CZ+zR6RoiOedTZA9qi+zHNv6JfoWDxmm6EefPA/zfFsJhbC34MOf89A== 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)(136003)(39860400002)(376002)(346002)(366004)(396003)(451199015)(8936002)(7416002)(41300700001)(8676002)(4326008)(66476007)(5660300002)(66946007)(66556008)(44832011)(316002)(2906002)(6506007)(52116002)(6512007)(6486002)(26005)(186003)(478600001)(6666004)(86362001)(1076003)(2616005)(921005)(38350700002)(38100700002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZEg6KyT26XnxtLUr5ruWoIxFCwr42QOYmsuE0WV8Y1SnyWljZPpjz3GvoNifqfTyoRaWhta2cGQG20JmEdpNAD9PP1b2gjv6ZFU9SvzQDJ7szU16cwtN2FpZNXBeX2YhpCqiOTxyQupr1nuzajgM0DbeI3kqcpBwvb05HRI/w8gATHbGjU/85cknXeSVnAnnzw4F4yGNskF4qSfTVKfF/tFgEtmPSL/9ZWfpp0uqq5B9nEhJKqSc4ZyHIkuGaQtbr2o/RiBHI8pf/B441GercUypeQt94B8mHadj+gSNy62S1WE8TVYDOMqUR6k1dBQx6yw0H9S9tKedEqpEUUxcJXdU7Jr75e1mW8zQ06fneoZb17sgXTUmVKQLUVYy2UIJ3334RiImp9XlIGUJYtb5jvroYKnQsLt0hCarvEQ9IhTNe6OmXh0W6lA1t+P2y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1kHOb49PKKv9eUC3o9/RKTGL3IZmksnuianIjTYy+bXGtzkt6exUT0lx/fu7e X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: deb709da-4e7e-457d-f6e6-08daedfd0c1c X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB4211.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2023 02:40:31.6298 (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: 1m3vuzFTrsF5hhBP9WhWG4dgbzUxj2jlJ0P/d9mFvHjoTNA3eBOU22diDLhhyrHQ3TtfoVYp5gHJCHqM5ex/Ww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8491 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 Acked-by: Shengjiu Wang --- 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 b794158a7876..2a78243df752 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[] = {