From patchwork Fri Dec 30 05:54:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Wu X-Patchwork-Id: 637884 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 523CEC10F1B for ; Fri, 30 Dec 2022 05:56:50 +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 6CE391765; Fri, 30 Dec 2022 06:55:57 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6CE391765 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1672379807; bh=5akwGp99QsYGmjRyCtWSgpIdJ/91BOkDlkWIdDm71qs=; h=From:To:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=l6wzNjIr+4UiU7J5YDU/fcp/6DhU84Yzf1/6AKWMAOkP51Ceq12m33Zluw2Pn8NZo 4Cayr++3yluAqN1XIc46WL9ezzq84+NMEcjSXIZpUuR/Ol3qJH43/UilOYL3IUWvuQ CoVI5KNx8xn9uIe9s6roKBkeN3IWRFkCw7teDAcE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 04D4FF80544; Fri, 30 Dec 2022 06:55:07 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 263F8F80424; Fri, 30 Dec 2022 06:55:05 +0100 (CET) Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) (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 59B17F80424 for ; Fri, 30 Dec 2022 06:54:57 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 59B17F80424 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=mediatek.com header.i=@mediatek.com header.a=rsa-sha256 header.s=dk header.b=CZfbvziP X-UUID: c9dd9c6c326d49b797bf50aa3459c47b-20221230 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=xYt3xlXktF9xW4hXj/eVHX+tJHxTC09pCroozFtLqK8=; b=CZfbvziPg67T74N6B7/ND2xiBIR4BxzGWgNxUUQvwshnjmPAh6PEZgYFQP/KuqnDwlBAHMkIsD0YK7UdEacYTt8AhKtdZ0yUL2t5QJaafU55MOdQo18yVShfz2dD02GEy9qfX+jq3Yc0C/60tJXAZ7hzb0hnYZIu9To7zKJ6MDc=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.16, REQID:da5a71c8-1604-4f27-953f-18fbe9edd829, IP:0, U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.16, REQID:da5a71c8-1604-4f27-953f-18fbe9edd829, IP:0, URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:09771b1, CLOUDID:8c32d18a-8530-4eff-9f77-222cf6e2895b, B ulkID:2212301354498V0LHW32,BulkQuantity:0,Recheck:0,SF:38|28|17|19|48,TC:n il,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OS I:0,OSA:0 X-CID-BVR: 0 X-UUID: c9dd9c6c326d49b797bf50aa3459c47b-20221230 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 296271895; Fri, 30 Dec 2022 13:54:47 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Fri, 30 Dec 2022 13:54:47 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Fri, 30 Dec 2022 13:54:47 +0800 From: Trevor Wu To: , , , , , , , Subject: [PATCH v4 00/13] ASoC: mediatek: Add support for MT8188 SoC Date: Fri, 30 Dec 2022 13:54:30 +0800 Message-ID: <20221230055443.16024-1-trevor.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-MTK: N 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: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Project_Global_Chrome_Upstream_Group@mediatek.com, linux-mediatek@lists.infradead.org, trevor.wu@mediatek.com, linux-arm-kernel@lists.infradead.org, angelogioacchino.delregno@collabora.com Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" This series of patches adds support for Mediatek AFE of MT8188 SoC. Patches are based on broonie tree "for-next" branch. Changes since v3: - replace apll_ck with apll to sync with the relationship in CCF - add mtk-soundcard-driver.c to support codec parsing - drop mclk-always-on-rates support in mt8188-dai-etdm.c - refine dt-binding files based on reviewer's suggestions Changes since v2: - drop CLK_IGNORE_UNUSED flag - include bitfield.h to reslove the issue reported by kernel test robot - rename mt8188-afe-pcm.yaml to mt8188-afe.yaml - refine dt-binding files based on reviewer's suggestions Changes since v1: - remove bus protection functions in case of unmerged dependency problem - replace some bit operation macro with FIELD_PREP - simplify register control by regmap_set_bits and regmap_clear_bits - fix dt-binding errors - rename compatible string for recognition Trevor Wu (13): ASoC: mediatek: common: add SMC ops and SMC CMD ASoC: mediatek: mt8188: add common header ASoC: mediatek: mt8188: support audsys clock ASoC: mediatek: mt8188: support adda in platform driver ASoC: mediatek: mt8188: support etdm in platform driver ASoC: mediatek: mt8188: support pcmif in platform driver ASoC: mediatek: mt8188: support audio clock control ASoC: mediatek: mt8188: add platform driver ASoC: mediatek: mt8188: add control for timing select dt-bindings: mediatek: mt8188: add audio afe document ASoC: mediatek: common: add soundcard driver common code ASoC: mediatek: mt8188: add machine driver with mt6359 dt-bindings: mediatek: mt8188: add mt8188-mt6359 document .../bindings/sound/mediatek,mt8188-afe.yaml | 208 + .../sound/mediatek,mt8188-mt6359.yaml | 93 + sound/soc/mediatek/Kconfig | 23 + sound/soc/mediatek/Makefile | 1 + sound/soc/mediatek/common/Makefile | 2 +- sound/soc/mediatek/common/mtk-base-afe.h | 19 + .../mediatek/common/mtk-soundcard-driver.c | 79 + .../mediatek/common/mtk-soundcard-driver.h | 14 + sound/soc/mediatek/mt8188/Makefile | 15 + sound/soc/mediatek/mt8188/mt8188-afe-clk.c | 658 ++++ sound/soc/mediatek/mt8188/mt8188-afe-clk.h | 115 + sound/soc/mediatek/mt8188/mt8188-afe-common.h | 151 + sound/soc/mediatek/mt8188/mt8188-afe-pcm.c | 3359 +++++++++++++++++ sound/soc/mediatek/mt8188/mt8188-audsys-clk.c | 205 + sound/soc/mediatek/mt8188/mt8188-audsys-clk.h | 15 + .../soc/mediatek/mt8188/mt8188-audsys-clkid.h | 83 + sound/soc/mediatek/mt8188/mt8188-dai-adda.c | 632 ++++ sound/soc/mediatek/mt8188/mt8188-dai-etdm.c | 2591 +++++++++++++ sound/soc/mediatek/mt8188/mt8188-dai-pcm.c | 367 ++ sound/soc/mediatek/mt8188/mt8188-mt6359.c | 785 ++++ sound/soc/mediatek/mt8188/mt8188-reg.h | 3180 ++++++++++++++++ 21 files changed, 12594 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt8188-afe.yaml create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt8188-mt6359.yaml create mode 100644 sound/soc/mediatek/common/mtk-soundcard-driver.c create mode 100644 sound/soc/mediatek/common/mtk-soundcard-driver.h create mode 100644 sound/soc/mediatek/mt8188/Makefile create mode 100644 sound/soc/mediatek/mt8188/mt8188-afe-clk.c create mode 100644 sound/soc/mediatek/mt8188/mt8188-afe-clk.h create mode 100644 sound/soc/mediatek/mt8188/mt8188-afe-common.h create mode 100644 sound/soc/mediatek/mt8188/mt8188-afe-pcm.c create mode 100644 sound/soc/mediatek/mt8188/mt8188-audsys-clk.c create mode 100644 sound/soc/mediatek/mt8188/mt8188-audsys-clk.h create mode 100644 sound/soc/mediatek/mt8188/mt8188-audsys-clkid.h create mode 100644 sound/soc/mediatek/mt8188/mt8188-dai-adda.c create mode 100644 sound/soc/mediatek/mt8188/mt8188-dai-etdm.c create mode 100644 sound/soc/mediatek/mt8188/mt8188-dai-pcm.c create mode 100644 sound/soc/mediatek/mt8188/mt8188-mt6359.c create mode 100644 sound/soc/mediatek/mt8188/mt8188-reg.h