From patchwork Mon Jan 16 03:41:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?VHJldm9yIFd1ICjlkLPmlofoia8p?= X-Patchwork-Id: 13102576 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 A5AC2C54EBE for ; Mon, 16 Jan 2023 03:45:48 +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 85A7D4DF6; Mon, 16 Jan 2023 04:44:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 85A7D4DF6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1673840746; bh=9r1Rc1br3RGEsy9yZ8z/puZJZ/V5LIOHdlnaI0+wzKo=; h=From:To:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=PlR1rN34lMiDC8oUNV0/0SRnxlOoya2aON4zQzlKfm5GhpnzaFZPj/15UZUkmXZip 7+esW7Hz5xxn3cu9xrN9Wx3Dm6IL+ukgy0U/F/WszDIQ+KXLnhtROtKgFkgbywltni PrOEovWLs1bm0gS8wDWPFYFX0LGjLkw4q1Waccco= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 02FF0F805BD; Mon, 16 Jan 2023 04:42:24 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4A283F805AF; Mon, 16 Jan 2023 04:42:20 +0100 (CET) Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B9EE2F80578 for ; Mon, 16 Jan 2023 04:42:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B9EE2F80578 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=EYFaxBmf X-UUID: acc3a5c0954f11ed945fc101203acc17-20230116 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=eh4Cs4ZcRBlSDIsPuhVfHQleWBG2pqk8rqGH33Owp/w=; b=EYFaxBmf/G+uRzF1ZmS0XZfqZQk8CWOO5MERh4O4ZG8bJ3wjfqZy2UGwr4UIoOrkK3YwDMXZ6itRkNEjnyu39sLmp6xGBMg9cUsE9b8CTKJkr5DUHeOHMavs6vSZkYq1PKr48dNYK+7oxnlo3g+k6HWBo9yCTz4cVapNMaotJlA=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.17, REQID:2b89389f-bb20-49fe-b847-10653533c312, 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.17, REQID:2b89389f-bb20-49fe-b847-10653533c312, 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:543e81c, CLOUDID:eeed568c-8530-4eff-9f77-222cf6e2895b, B ulkID:230116114137D3YUGBJE,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-APTURL: Status:success,Category:nil,Trust:0,Unknown:0,Malicious:0 X-CID-BVR: 0 X-UUID: acc3a5c0954f11ed945fc101203acc17-20230116 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1704851698; Mon, 16 Jan 2023 11:41:35 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Mon, 16 Jan 2023 11:41:34 +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; Mon, 16 Jan 2023 11:41:34 +0800 From: Trevor Wu To: , , , , , , , Subject: [RESEND,v5 00/13] ASoC: mediatek: Add support for MT8188 SoC Date: Mon, 16 Jan 2023 11:41:18 +0800 Message-ID: <20230116034131.23943-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 v4: - refine etdm dai driver based on reviewer's suggestions - refine dt-binding files based on reviewer's suggestions 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 ASoC: dt-bindings: mediatek,mt8188-afe: add audio afe document ASoC: mediatek: common: add soundcard driver common code ASoC: mediatek: mt8188: add machine driver with mt6359 ASoC: dt-bindings: mediatek,mt8188-mt6359: add mt8188-mt6359 document .../bindings/sound/mediatek,mt8188-afe.yaml | 208 + .../sound/mediatek,mt8188-mt6359.yaml | 97 + 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 | 2588 +++++++++++++ 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, 12595 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