Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3753179rwd; Mon, 22 May 2023 20:15:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6urMSR616s91bKSpdsVj5+XL0fF1dA33RtpzsQyMYW7qM3JFYpTku87bqm2/MFh4iSAPO1 X-Received: by 2002:a05:6a21:1514:b0:105:63b0:5bf8 with SMTP id nq20-20020a056a21151400b0010563b05bf8mr9570727pzb.18.1684811717740; Mon, 22 May 2023 20:15:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684811717; cv=none; d=google.com; s=arc-20160816; b=tFyHSPlN0+MrzDv/siLRdpxNN/qBgYUzLYW4WfPPWpKbUHQiaG63xREV1iw0CVwozT BMfeVrme7nmED6ngMv1g+aXfyJRPdL+qe4qZzSQH0wXxBsaQIHgCxO8AVQzCekTbGiQU gVX8W8yEZYNXrzTWQIL+sUHwPGOXm6nj1L9GsgiNVeTo4kZnWtiJ53L6uKU2Y+37Jy1D 1+OHBY52cJo4Ih/iN1BIciXMoAybS6JYKXW4k7L293a+erUfc+TUz55GS0boQz/mmvrv t9nI8ZbMsAkhSAODImigQ3Y2Gfyg0GKiBxfJXDjatR+1JcA/DfPa/TDyhNa0LpVhf9zd /wuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xAqn1KruCdx2EZzBuCbck+aI8EqCLgKQVJzvJgdn2lw=; b=A0QEjwqdlGVetGjhRJwHb8Rm2+e2nKymEe6LfZLlz/Dktg16hq8JrDocnPISL9wXQy j8coJs5QNQiIIW71QT8ZBPFr6ip0JOFbR5MvTRPm3vHhpV7qnUJp2rWECFwJ2FXf5DWd CVVDs23xq/raZRyRQVsw3bGjxhof9By7PPzkQoTd6Lmb6a1L1VdBVRXi/m6smpE2FYoJ GK1l5DwrZkZYcs1QPcRAZh4yu5FgY91y9RUVJf/1JnxCXPRJO+HYzGTGu+Yx4KotRQVK OdTJcOAOReulrDT030CVtqN2icpQ8i6n9E6NkJ3rDdIYqlyeqsFwjVexdGdJyzhw0xqt XZFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="d/WY78kk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ft4-20020a17090b0f8400b00232f57260c1si7893053pjb.1.2023.05.22.20.15.02; Mon, 22 May 2023 20:15:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="d/WY78kk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235202AbjEWDAT (ORCPT + 99 others); Mon, 22 May 2023 23:00:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234958AbjEWC7n (ORCPT ); Mon, 22 May 2023 22:59:43 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CAA6E0 for ; Mon, 22 May 2023 19:59:41 -0700 (PDT) X-UUID: d95b1aa8f91511edb20a276fd37b9834-20230523 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=xAqn1KruCdx2EZzBuCbck+aI8EqCLgKQVJzvJgdn2lw=; b=d/WY78kkA65AiI4Iy0CDQp/B5VA0riMBjeY7xtxboQMVEbL6CgsgXRlyRUWgoe+4ZkU4W3bwUQy2s0owUHcL4+T6jXXP/QDWAOmL4EIihaNclTj7V7vWHcUa85fkennCXMC4+zxrJqultj2WccoMA/0sAtc3B57G63prjXzG9oo=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.25,REQID:ee969c12-84b9-489e-96db-3a56f4be801c,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:70 X-CID-INFO: VERSION:1.1.25,REQID:ee969c12-84b9-489e-96db-3a56f4be801c,IP:0,URL :0,TC:0,Content:-25,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTI ON:quarantine,TS:70 X-CID-META: VersionHash:d5b0ae3,CLOUDID:efa3b4c1-e32c-4c97-918d-fbb3fc224d4e,B ulkID:230523105937NXVLJJ9E,BulkQuantity:2,Recheck:0,SF:17|19|48|38|29|28,T C:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:43,QS:nil,BEC:nil,COL:0, OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: d95b1aa8f91511edb20a276fd37b9834-20230523 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 226277113; Tue, 23 May 2023 10:59:35 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 23 May 2023 10:59:34 +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; Tue, 23 May 2023 10:59:34 +0800 From: Trevor Wu To: , , , , , , , , , , , CC: , , , , , , , Subject: [PATCH v2 1/2] ASoC: SOF: mediatek: add mt8188 audio support Date: Tue, 23 May 2023 10:59:32 +0800 Message-ID: <20230523025933.30494-2-trevor.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230523025933.30494-1-trevor.wu@mediatek.com> References: <20230523025933.30494-1-trevor.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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éter 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/mediatek/mt8186/mt8186.c index 419913c8474d..cc91c2928fb6 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 = { .ops = &sof_mt8186_ops, }; +/* + * DL2, DL3, UL4, UL5 are registered as SOF FE, so creating the corresponding + * SOF BE to complete the pipeline. + */ +static struct snd_soc_dai_driver mt8188_dai[] = { +{ + .name = "SOF_DL2", + .playback = { + .channels_min = 1, + .channels_max = 2, + }, +}, +{ + .name = "SOF_DL3", + .playback = { + .channels_min = 1, + .channels_max = 2, + }, +}, +{ + .name = "SOF_UL4", + .capture = { + .channels_min = 1, + .channels_max = 2, + }, +}, +{ + .name = "SOF_UL5", + .capture = { + .channels_min = 1, + .channels_max = 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(sof_mt8188_ops)); + + sof_mt8188_ops.drv = mt8188_dai; + sof_mt8188_ops.num_drv = ARRAY_SIZE(mt8188_dai); + + return 0; +} + +static struct snd_sof_of_mach sof_mt8188_machs[] = { + { + .compatible = "mediatek,mt8188", + .sof_tplg_filename = "sof-mt8188.tplg", + }, + {} +}; + static const struct sof_dev_desc sof_of_mt8188_desc = { + .of_machines = sof_mt8188_machs, .ipc_supported_mask = BIT(SOF_IPC), .ipc_default = SOF_IPC, .default_fw_path = { @@ -607,7 +665,8 @@ static const struct sof_dev_desc sof_of_mt8188_desc = { [SOF_IPC] = "sof-mt8188.ri", }, .nocodec_tplg_filename = "sof-mt8188-nocodec.tplg", - .ops = &sof_mt8186_ops, + .ops = &sof_mt8188_ops, + .ops_init = sof_mt8188_ops_init, }; static const struct of_device_id sof_of_mt8186_ids[] = { -- 2.18.0