From patchwork Mon Jul 1 11:30:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 13718032 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 B02FEC2BD09 for ; Mon, 1 Jul 2024 12:45:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=TqveFrD/1PHIy0E8P+KaxTJIcmaej9qy4xJZ6jJ5cN0=; b=wBEPo9UkwqduQQdoGa1qbh+jm1 fUnsDCCIor2DJAYTpmPk7AU9lpPEdUOW9ofrHHNgP2vY4CCh2bbtzemeqMtvWphNxPH8XuGiufuF5 E0HLAdMnTGwFabfUnCN5dJ0DAHdO41V0K2r2X9Pk9rdsCnU/lJZft8/9csbMbNl8v+OPei6IT4HUR +6H3tq0AWhe6bUEiYctYkfTdekWXINQ7KuiUfmL/mAuUZBYqd8ufKNZytb20GI0bjw/Xlne83jYkS HQwSdb4OqbUxjjARP3myDgZ5e31WPCrepkl41rKwWIWqp9S2sydcRnsfGIa73l4X/PL/lscjj2b45 N1U/Jc1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOGPK-00000003K4M-3ADb; Mon, 01 Jul 2024 12:45:22 +0000 Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOFGD-00000002uAJ-2gLq for linux-arm-kernel@lists.infradead.org; Mon, 01 Jul 2024 11:31:55 +0000 Received: by mail.gandi.net (Postfix) with ESMTPA id 4AADC240004; Mon, 1 Jul 2024 11:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1719833510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TqveFrD/1PHIy0E8P+KaxTJIcmaej9qy4xJZ6jJ5cN0=; b=ANN/2CkkQrqrO4xZK9u8ClRYRFb5eKoKlcj7yRDCdnZ/9TiyxlLkJjTAve49Nx3kQf8MlB /62guWb9ZBsXWoJY5WY6cvBiMU/RMfTxashgUO/JCcF6lKlMXUKqHNLnIPLCz/zvoi9NiW Wx8tSqaZruOasBKpnyaIlbzxju3oXeHITfVLQtYvuHbYv2A4PqJ9UEj2mJfsNBahZfkzTK I2qMiWLpTIz38BkgEm/l1sA5aLZonUm4pkA0sf73hW6ZCyt5wYZZ3moV+wC0dCxB1WlzF3 DkDaRYEBbd7h6mjSQOw6HY5ZL9nbJC5Q1a8vjoirhzMFJVi8gCKB9GwOZDc8uA== From: Herve Codina To: Herve Codina , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Qiang Zhao , Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Jaroslav Kysela , Takashi Iwai , Christophe Leroy Cc: alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Petazzoni Subject: [PATCH v2 00/10] Add support for non-interleaved mode in qmc_audio Date: Mon, 1 Jul 2024 13:30:27 +0200 Message-ID: <20240701113038.55144-1-herve.codina@bootlin.com> X-Mailer: git-send-email 2.45.0 MIME-Version: 1.0 X-GND-Sasl: herve.codina@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240701_043154_029038_5667C1DB X-CRM114-Status: GOOD ( 13.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The qmc_audio driver supports only audio in interleaved mode. Non-interleaved mode can be easily supported using several QMC channel per DAI. In that case, data related to ch0 are sent to (received from) the first QMC channel, data related to ch1 use the next QMC channel and so on up to the last channel. In terms of constraints and settings, the interleaved and non-interleaved modes are slightly different. In interleaved mode: - The sample size should fit in the number of time-slots available for the QMC channel. - The number of audio channels should fit in the number of time-slots (taking into account the sample size) available for the QMC channel. In non-interleaved mode: - The number of audio channels is the number of available QMC channels. - Each QMC channel should have the same number of time-slots. - The sample size equals the number of time-slots of one QMC channel. This series add support for the non-interleaved mode in the qmc_audio driver and is composed of the following parts: - Patches 1 and 2: Fix some issues in the qmc_audio - Patches 3 to 6: Prepare qmc_audio for the non-interleaved mode - Patches 7 and 8: Extend the QMC driver API - Patches 9 and 10: The support for non-interleaved mode itself Compared to the previous iteration, this v2 series mainly improves qmc_audio_access_is_interleaved(). Best regards, Hervé Link to v1: https://lore.kernel.org/lkml/20240620084300.397853-1-herve.codina@bootlin.com/ Changes v1 -> v2 - Patches 1 to 8 No changes - Patch 9 Add 'Reviewed-by: Rob Herring (Arm) ' - Patch 10 Remove unneeded ';' Modify qmc_audio_access_is_interleaved() Herve Codina (10): ASoC: fsl: fsl_qmc_audio: Check devm_kasprintf() returned value ASoC: fsl: fsl_qmc_audio: Fix issues detected by checkpatch ASoC: fsl: fsl_qmc_audio: Split channel buffer and PCM pointer handling ASoC: fsl: fsl_qmc_audio: Identify the QMC channel involved in completion routines ASoC: fsl: fsl_qmc_audio: Introduce qmc_audio_pcm_{read,write}_submit() ASoC: fsl: fsl_qmc_audio: Introduce qmc_dai_constraints_interleaved() soc: fsl: cpm1: qmc: Introduce functions to get a channel from a phandle list soc: fsl: cpm1: qmc: Introduce qmc_chan_count_phandles() dt-bindings: sound: fsl,qmc-audio: Add support for multiple QMC channels per DAI ASoC: fsl: fsl_qmc_audio: Add support for non-interleaved mode. .../bindings/sound/fsl,qmc-audio.yaml | 41 +- drivers/soc/fsl/qe/qmc.c | 32 +- include/soc/fsl/qe/qmc.h | 27 +- sound/soc/fsl/fsl_qmc_audio.c | 591 +++++++++++++----- 4 files changed, 506 insertions(+), 185 deletions(-)