From nobody Fri Sep 20 20:38:32 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6CAAC7EE24 for ; Mon, 15 May 2023 05:26:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235533AbjEOF0G (ORCPT ); Mon, 15 May 2023 01:26:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234111AbjEOFZ5 (ORCPT ); Mon, 15 May 2023 01:25:57 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F789172B for ; Sun, 14 May 2023 22:25:51 -0700 (PDT) X-UUID: efb70004f2e011edb20a276fd37b9834-20230515 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=oWjWdFK+UzXUxIC1PHVEcLcVfmOLCn7lAe5Vf/6IX2c=; b=X9qGVwD8xM3qd00EuogpOox0yuFdzKGMEzf1M2F4QUJRHji4E4tj8dyIEiSqDjPoWueHMHKyN0j+0GhVub3YrcAU+3u+k5LEDOeBWPCmold0Qtp8yKR7mZ39qAEa7Uyb8ROrm2ZcXQwcNc8w+iSrVyIznqD6Gb0MlBSQKbJoYgs=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.24,REQID:ff97226c-de39-49bb-b7be-fffd7399568d,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:178d4d4,CLOUDID:f8bd2a3b-de1e-4348-bc35-c96f92f1dcbb,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: efb70004f2e011edb20a276fd37b9834-20230515 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1304088002; Mon, 15 May 2023 13:25:42 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) 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.1118.26; Mon, 15 May 2023 13:25:41 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Mon, 15 May 2023 13:25:41 +0800 From: Trevor Wu To: , , , , , , , , , , , CC: , , , , , , , Subject: [PATCH 1/2] ASoC: SOF: mediatek: add mt8188 audio support Date: Mon, 15 May 2023 13:25:39 +0800 Message-ID: <20230515052540.9037-2-trevor.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230515052540.9037-1-trevor.wu@mediatek.com> References: <20230515052540.9037-1-trevor.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add mt8188 dai driver and specify of_machine to support mt8188 audio. Signed-off-by: Trevor Wu Reviewed-by: Pierre-Louis Bossart Reviewed-by: Yaochun Hung Reviewed-by: P=C3=A9ter Ujfalusi --- sound/soc/sof/mediatek/mt8186/mt8186.c | 61 +++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediate= k/mt8186/mt8186.c index 419913c8474d..3a9c81418c1f 100644 --- a/sound/soc/sof/mediatek/mt8186/mt8186.c +++ b/sound/soc/sof/mediatek/mt8186/mt8186.c @@ -594,7 +594,65 @@ static const struct sof_dev_desc sof_of_mt8186_desc = =3D { .ops =3D &sof_mt8186_ops, }; =20 +/* + * DL2, DL3, UL4, UL5 are registered as SOF FE, so creating the correspond= ing + * SOF BE to complete the pipeline. + */ +static struct snd_soc_dai_driver mt8188_dai[] =3D { +{ + .name =3D "SOF_DL2", + .playback =3D { + .channels_min =3D 1, + .channels_max =3D 2, + }, +}, +{ + .name =3D "SOF_DL3", + .playback =3D { + .channels_min =3D 1, + .channels_max =3D 2, + }, +}, +{ + .name =3D "SOF_UL4", + .capture =3D { + .channels_min =3D 1, + .channels_max =3D 2, + }, +}, +{ + .name =3D "SOF_UL5", + .capture =3D { + .channels_min =3D 1, + .channels_max =3D 2, + }, +}, +}; + +/* mt8188 ops */ +static struct snd_sof_dsp_ops sof_mt8188_ops; + +static int sof_mt8188_ops_init(struct snd_sof_dev *sdev) +{ + /* common defaults */ + memcpy(&sof_mt8188_ops, &sof_mt8186_ops, sizeof(struct snd_sof_dsp_ops)); + + sof_mt8188_ops.drv =3D mt8188_dai; + sof_mt8186_ops.num_drv =3D ARRAY_SIZE(mt8188_dai); + + return 0; +} + +static struct snd_sof_of_mach sof_mt8188_machs[] =3D { + { + .compatible =3D "mediatek,mt8188", + .sof_tplg_filename =3D "sof-mt8188.tplg", + }, + {} +}; + static const struct sof_dev_desc sof_of_mt8188_desc =3D { + .of_machines =3D sof_mt8188_machs, .ipc_supported_mask =3D BIT(SOF_IPC), .ipc_default =3D SOF_IPC, .default_fw_path =3D { @@ -607,7 +665,8 @@ static const struct sof_dev_desc sof_of_mt8188_desc =3D= { [SOF_IPC] =3D "sof-mt8188.ri", }, .nocodec_tplg_filename =3D "sof-mt8188-nocodec.tplg", - .ops =3D &sof_mt8186_ops, + .ops =3D &sof_mt8188_ops, + .ops_init =3D sof_mt8188_ops_init, }; =20 static const struct of_device_id sof_of_mt8186_ids[] =3D { --=20 2.18.0