From patchwork Wed Mar 20 09:02:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xingyu Wu X-Patchwork-Id: 781608 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 878B0C54E58 for ; Wed, 20 Mar 2024 14:08:31 +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 A4E9E2BE4; Wed, 20 Mar 2024 15:08:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A4E9E2BE4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1710943709; bh=ONzqAvwUNfaFMlHkphyJmlrYxFn5CyBnXWfv0cM9OSk=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=cHmu46NJAaCnHjDuYyllRcEKk4Wpif3449ADShnxiC4v5R7FexFlMOYHGV3BvkEUL e2Xzvo50K707eKKSpmjMobJTMaXzQMgv6vJxaaEmlJbJMU6rFxZF0yOE5hOlHzqH/g agmQGbVokCuGQ1e0cn7YAGMKcXZ1qTrg4dGnv04o= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1EA25F805D2; Wed, 20 Mar 2024 15:01:10 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 102FCF897F0; Wed, 20 Mar 2024 15:01:10 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 37083F8055B; Wed, 20 Mar 2024 10:03:20 +0100 (CET) Received: from CHN02-SH0-obe.outbound.protection.partner.outlook.cn (mail-sh0chn02on2070f.outbound.protection.partner.outlook.cn [IPv6:2406:e500:4420:2::70f]) (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 EC14FF80088 for ; Wed, 20 Mar 2024 10:02:53 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EC14FF80088 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UZ9nkn6dozFZq7FHwg1dCf2WXPJaBvV0578N2+yphM2lkDlzsOWyO1QHDVt0epStSsMGhjnf/Xmxqp/Q7jEUoKUuFoVy/eRsA43uBzgvOcrOMDVjbzN8MDNnTfwtGjiKWsyiF+OaGYHoUFTle1AXucW4QVdj9C5IcTmmlg3CjZLFSiXKmivhMGrxxctgBpzui7Dou4w7xvc83bOslHeGf2zMClrJybYAeq1K/rD5+7uvpNaEDwaEDjY/s8ovdH3esV3VMW/7nZAls87ijFn1VF4MfZkBeCr9FcifmTl22EINy5O2npKhMEvlmkpgWtEbsdVU/xFkoqVY3cOkBNKpSg== 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=mPXS35Mgmsq0Yo7y/ZoWP0MHJubZp52kjY+EfrHIIT4=; b=lZcfr9zvqJbUu1CDemJStMsCJXLKKzshkXF1qbp8LdlHL7yjr4OqjZgZOSzVcMpcCxiq3AiVyF0I6qCeo6x+8vng11dWBjYllv50plw7iGsFKFhZOg0la08LFsjzXnrhk5uz9X47z1kUJ5AqD/993fIFMRkL7dS/FL7trKJgiw6II8Z2/ZMNzESMzjuP55OvApNfymKhnSAEP6TiHgWbNXwSXi23zVvHcYe8GwxcQiuDDP5vUzLEkErFU/rNC6TeM4yhr4FvWpBma5bCuHzlFhtsR1+k/butxU9246XuKuQDE1vW11aUmBbEBjeb2WAimScshmjrZAcFIqKE++ePdg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from NTZPR01MB0956.CHNPR01.prod.partner.outlook.cn (2406:e500:c510:8::10) by NTZPR01MB1116.CHNPR01.prod.partner.outlook.cn (2406:e500:c510:8::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.21; Wed, 20 Mar 2024 09:02:46 +0000 Received: from NTZPR01MB0956.CHNPR01.prod.partner.outlook.cn ([fe80::7d98:f313:525d:fea6]) by NTZPR01MB0956.CHNPR01.prod.partner.outlook.cn ([fe80::7d98:f313:525d:fea6%6]) with mapi id 15.20.7386.022; Wed, 20 Mar 2024 09:02:46 +0000 From: Xingyu Wu To: Liam Girdwood , Mark Brown , Claudiu Beznea , Jaroslav Kysela , Takashi Iwai , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Xingyu Wu , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-sound@vger.kernel.org Subject: [PATCH v2 0/2] Add Cadence I2S-MC controller driver Date: Wed, 20 Mar 2024 17:02:37 +0800 Message-Id: <20240320090239.168743-1-xingyu.wu@starfivetech.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SHXPR01CA0025.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:1b::34) To NTZPR01MB0956.CHNPR01.prod.partner.outlook.cn (2406:e500:c510:8::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: NTZPR01MB0956:EE_|NTZPR01MB1116:EE_ X-MS-Office365-Filtering-Correlation-Id: 4880d82b-ddce-4107-5766-08dc48bc82bd X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wB/gredxukOF+eKXUIp/D1rHvhb3oPVCyVtxNX6zROZffhVTnW/gbjBFsejWLUwsAjbNdiFp0gMwgU7KBUinLOM1cbpHetnZGoQpKho4+9zVDgP3Do/vGoxU/nJno0wh4LtVbQcBgOAoIrSH1Iddj28rfvMHHgWjkiWz/bkZWH0UNHxkvFYGwX620QsMLwcnOi31XYmJ0guWSVxNguPx+14bsnFHtRabdn+cV9/sqCi84hr7jHMU1ArxiOWyW1cK7uMpVOxSlnZpotBwVXHa2KtCyjdQbjpOBjjg3pSGVZk6NDPYLdAerRAEVrieSWK5+ucpvylYEBryOILQmdlYRi4mMxyEsUgwAjEKSOyiy5aAAUzA5tbkqIrxHAiEVgzkC8cbsgoMBDthRbj0dcGfpoQ0/+POtcqbu0qhepB1XHFVXYFZ9wuiuPfKy/DI07uMtj9DveIc+rMv3aD+gB7S5CbYFQJnvmCx4RJJvxoCkrZtOFnzuaqk/CkqkOeqbPX21rprlpiGpZG/255V3j0pQa0XgHxkfwtxIYcNfekFAfujMJka0OFgFGZ+i7RxYAKDayf5HdRhdqtIoRIdJyqJy5qozOWBH4vHXOy5zxpnJVcmILrufdTZvEhFrHfXIH4e X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:NTZPR01MB0956.CHNPR01.prod.partner.outlook.cn; PTR:; CAT:NONE; SFS:(13230031)(41320700004)(1800799015)(52116005)(7416005)(366007)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hOThtqO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LBWz8dP3kZjdPuX7610DH+wMBTiC5tGmQc8sLhbRoU8SiddclVUayIarYyEKSWeeqAi5d72C+kwG3Dc3cbc5OSltQ3gV5EgUV3NrbQ0awHMJUFAmtSPiHh58Z/wWcLjlBdYqfULFka7A9Q08MWvCiuqyn/L41EX0BIBwHAiRgaQcs3sDF8oHAh8SZtP7J5vpYr1B5yQMTqS0XxnLg+DFxLzRC0j2Uj4T8LvxxhmX2x5XH45gJnXQzFJ+sX/h2IeAunKSdupIK4qK2AyVYSFTG74jP4iJGZ0j2JrOd0SVzCGAGdavdbCJsCoHjJ1wY05Ol90CHvKMbe1F1vlp5epMRo1LlAzl2hYL4n1TzHZnc/w/PXhPVq24VZSqzZ3j+rQH3p16033hTmhZv6iXSRh2zaFvi6ltGLJEWVBD9KZ3YkC+KR9dZGxWxVaA4ispuP1YMy+0P1U+4MnBbieVTom9aLqskn+xspJQBMpucKaPuiJf+XWb8xVONVrg2+YjVOT+mrHa/b0E+FoNVumsKWftvooRg== X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4880d82b-ddce-4107-5766-08dc48bc82bd X-MS-Exchange-CrossTenant-AuthSource: NTZPR01MB0956.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2024 09:02:46.5361 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5WDgEM7oB22GgPtZRcgL/Hw0JLUaCChE/OoBB2qMFiuoP44JyrY7Py8l/WJ/c/HWHUj85GUUMUjqSH0xLBySE1VQv/uUBXRyJsZ/4ITJ83E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: NTZPR01MB1116 X-MailFrom: xingyu.wu@starfivetech.com X-Mailman-Rule-Hits: nonmember-moderation 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 Message-ID-Hash: GGQXY4LAJQGJLNB2CGHLHZYHJZNWFADO X-Message-ID-Hash: GGQXY4LAJQGJLNB2CGHLHZYHJZNWFADO X-Mailman-Approved-At: Wed, 20 Mar 2024 13:59:43 +0000 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: The Cadence Multi-channel I2S (I2S-MC) Controller implements a function of the multi-channel (up to 8-channel) bus. Each stereo channel combines functions of a transmitter and a receiver, and can switch freely between them. Each channel has independent gating, clock and interruption control. It also support some of these channels are used as playback and others can also be used as record in the same time. Four I2S controllers are used on the StarFive JH8100 SoC. Two of the I2S controllers use two stereo channels, one of them use four channels, and one use eight. It had tested on the fpga with WM8960 and PDM. Changes since v1: - Added new compatible for StarFive JH8100 SoC and a special property to be got as the max channels number in the bindings. - Dropped the useless '|' in the bindings. - Moved the drivers to a new folder named 'cdns' and modified the name of functions. v1: https://lore.kernel.org/all/20231221033223.73201-1-xingyu.wu@starfivetech.com/ Xingyu Wu (2): ASoC: dt-bindings: Add bindings for Cadence I2S-MC controller ASoC: cdns: Add drivers of Cadence Multi-Channel I2S Controller .../bindings/sound/cdns,i2s-mc.yaml | 110 +++ MAINTAINERS | 6 + sound/soc/Kconfig | 1 + sound/soc/Makefile | 1 + sound/soc/cdns/Kconfig | 18 + sound/soc/cdns/Makefile | 3 + sound/soc/cdns/cdns-i2s-mc-pcm.c | 262 +++++++ sound/soc/cdns/cdns-i2s-mc.c | 724 ++++++++++++++++++ sound/soc/cdns/cdns-i2s-mc.h | 157 ++++ 9 files changed, 1282 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/cdns,i2s-mc.yaml create mode 100644 sound/soc/cdns/Kconfig create mode 100644 sound/soc/cdns/Makefile create mode 100644 sound/soc/cdns/cdns-i2s-mc-pcm.c create mode 100644 sound/soc/cdns/cdns-i2s-mc.c create mode 100644 sound/soc/cdns/cdns-i2s-mc.h