From patchwork Mon Nov 1 08:00:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Daniel Baluta (OSS)" X-Patchwork-Id: 12596017 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E08AC433EF for ; Mon, 1 Nov 2021 08:02:41 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A418460EB9 for ; Mon, 1 Nov 2021 08:02:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A418460EB9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D812816A0; Mon, 1 Nov 2021 09:01:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D812816A0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635753758; bh=hCX+EC8kax6QrYmBYSlOrqgIqwYgMYRg3QNVSrO1xSA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=JjIhxV9j2m29sZM/xpyEnh6A9QYqJjYWruFNXTlCKKnwEcgUNBJTl4azzGBO/Htop t7d7+NqLoVVjj5azD3dCEh41XlFARgBEhnjUsQLhJOZlvesxoTUJFAmPBYWHzU5PsY yH6oq8crbIDLQxmlB8aRP7IczZHMCr4CvFOyNaek= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5A83EF804E6; Mon, 1 Nov 2021 09:01:06 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DA4FEF8026A; Mon, 1 Nov 2021 09:01:00 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2076.outbound.protection.outlook.com [40.107.21.76]) (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 61918F8025F for ; Mon, 1 Nov 2021 09:00:53 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 61918F8025F Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="NvQfYI3b" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z1e7AvgBzE1k844blub1AYAad8HBxKsWIpP++b7KMIkhycUSaF5z4HKD+OrCEVLS8Ns4eoQjhmgpgwvZp1aDQ69L5ZhvgV9UPrPG4vouDZ2j9YV1QTq6iojiPoc5o2/Obzz6sC4RH8dfgxnKRlpOl6W9NzlCuQvG/VGrONueerZjyueZlGqGvEOxr/RifAQ21FbwweP0OF40L1ICZSv4e+wG60dbucfY4aEy3FbUBcbIAGUoS/8N5Hy47jYqt77TT/BTaifXQPpd8mjC5TlfeYouhFSSKpTn0Z/7HdyI25fPpjtvNs5vZbnsPfPvOeVIj6+zjmyvQQ4EEMSPBk4sTw== 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=QK3wmLOkLI5eOaYP33H8x3DD08z4kqfJ2cGMooeGb9I=; b=Dx9MJVqJIx3xQk9bpmbrojykVClGX/Cv3TMVPACO57ODvpzi/myASwN8MrNr6M61Uetnj8PQB44iog8LqtVPGCKTeAMLZo6W8iYEiAjDg1DVsMm31gLY4o2cL9yaa7EyA6Ro0qFALl4DpEWSm2YOe6I/uPMYvA//xm41nohRZkW/Hvmp/t1wHYYmAGQnXFwKS9gfAlR5E11POJawxnLzeQOYVgnGfxCfAaIrTw7mZVikJ3efOQOm18wOuYaqlZeCypgz6Tr4+0G08G95+On3rt9GXqHCQZspntu/BO5+H+j5J2YCwXtRNrAToEOcW7RCkGUIn6KR5ur5+3IdWVgiOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QK3wmLOkLI5eOaYP33H8x3DD08z4kqfJ2cGMooeGb9I=; b=NvQfYI3bnHwY+2zhcxKfxEXZxXz7Gp2M3+YYEeviSspezUBm1vrGmvifwh62yE2O85QOVVgmrFw1bKciC5lOh3KICJwR3eyMDDJ2XDsbQcfGx6RfRTtxPh455NaMjti8Ms3HjSK+VeSos2L4m2etYywDwz+uCKTabV+6V/FF+QA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5151.eurprd04.prod.outlook.com (2603:10a6:803:61::28) by VI1PR0402MB3664.eurprd04.prod.outlook.com (2603:10a6:803:1e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Mon, 1 Nov 2021 08:00:48 +0000 Received: from VI1PR04MB5151.eurprd04.prod.outlook.com ([fe80::85af:f8be:aa99:ba5f]) by VI1PR04MB5151.eurprd04.prod.outlook.com ([fe80::85af:f8be:aa99:ba5f%3]) with mapi id 15.20.4649.019; Mon, 1 Nov 2021 08:00:48 +0000 From: Daniel Baluta To: broonie@kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 1/6] ASoC: SOF: mediatek: Add mt8195 hardware support Date: Mon, 1 Nov 2021 10:00:21 +0200 Message-Id: <20211101080026.297360-2-daniel.baluta@oss.nxp.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211101080026.297360-1-daniel.baluta@oss.nxp.com> References: <20211101080026.297360-1-daniel.baluta@oss.nxp.com> X-ClientProxiedBy: AM3PR07CA0070.eurprd07.prod.outlook.com (2603:10a6:207:4::28) To VI1PR04MB5151.eurprd04.prod.outlook.com (2603:10a6:803:61::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2a02:2f08:5719:1500:cdb2:376b:257c:429a) by AM3PR07CA0070.eurprd07.prod.outlook.com (2603:10a6:207:4::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.9 via Frontend Transport; Mon, 1 Nov 2021 08:00:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0cbfb0cd-ede8-4615-937a-08d99d0db711 X-MS-TrafficTypeDiagnostic: VI1PR0402MB3664: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A2GB3ffQBGKoaRc3ar/nMrJemXJ7Kwnx6GsddxR5QC4hueVhfR5spV/tAX2AIQD+yT28D13PTSA42K8ETqVkWeACc351BDzb5lzsYuvnuj9a2SdzYPj+w2hIRtr8iJeGVDcUOORdq+utaLO1UenQavW0jnnV2QGa+mtWiMyo6T2cD8NmmDGn0wxfkcEjh2zStHXS2At/jZu9EwQ7XqGUYVQuZbWeq+3IxEAvvElwiNyEzdizeYM2wXLN/Yf7s6UBN0oJ1UD1wqzcVl7P9SOMG2FV8j4nnv7wkfNwD7pYo+r3TlIfi9mFlm+cYMgO9mPdm27sIol3sfpcrhOWTL+nS2d9XbbPj/RH0fCSfgzsGEG4VEzrlP/cr4omSpkE5YgVbvn9+rKJJyNuOxqYTr7ERimgRRUUsslQrv1cXaM4B6p2nk1ZK4SitafinzAJYX/2mALaZS2Yg1SDWcX0G6D0R/Yj+KSb8afyqTHrfylEpT2DCmqa1cDSW/49gL7kQn69gTH1EkZN5kgzmM9KycmaGEHwVLO3w3n+X5Bq32mxiwRMuYRkegHty+Zukoe7+0tsOGl7Tv3+YWJlWuzWvPWbQBaUy0HnrazSPqv8qw4SMvW3p4CtTQtBi0GFaPI0+wASyeFewpgHF+yjrELHAq/3Sw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5151.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(86362001)(54906003)(6666004)(66574015)(7416002)(6512007)(316002)(186003)(52116002)(508600001)(30864003)(5660300002)(4326008)(2616005)(1076003)(66946007)(66476007)(66556008)(6486002)(6506007)(8676002)(8936002)(38100700002)(2906002)(83380400001)(44832011); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?85gew9HrJ6GOiJkF9pCJOT0E39Tr?= =?utf-8?q?rT5qyMPd5fe+08CZGTiMJZE8QF3jYoEsYZQJTe5ruX4vXSc55HkAUaK+UZHaB3pQi?= =?utf-8?q?pMNAx53ku9KEE0v1QutPCR98d7AKZyqOCvqCSo6F26j29ibkKuqlOxbsQJ10UKUeH?= =?utf-8?q?Hx8IH6DhTIrNHWOU8ySHSXHht8s48J7R9XSoaDQjqN/L9rcfLGLGqfeV4UVbLo+Fl?= =?utf-8?q?NGGlbpnbxdPaboSWTNbwg7ZsRN4CjI7fAKUdAevJEf7P+rTvRxbX32O+88MceHSrC?= =?utf-8?q?Kyegzh917LdRq6lIKI80RRoE0CT2A7W5oexHci97GvPZtF//RSPmbEWmcgO5X30XP?= =?utf-8?q?snuayrQPF/Ab9Hy63Zz7PIXLTvtOVRL2YCZc6i3syEi8gF0RtHGzVK/js5l/apo83?= =?utf-8?q?nBEGX/8k+kOBIaNYDMHvGdtT3XrNSUKBFqFtsBwEUc7e1artre6pkps4p/dMW1PJu?= =?utf-8?q?4/40MoET0l+B57h3dZp7sP/p0dwvJ+ilhpkhZRzm5OYLlfffwFQoXYNb8sEkwod1h?= =?utf-8?q?NtCs8bMumLYB38T/DaejF7N11f5CqjVyS5gkEYbK088sAe2SFbJdF23pdGlIoVO20?= =?utf-8?q?F5hP/nP4fLtwinVm1OJpbYke21zT6bdVI9a9X2hOgq/mojx6LxVl7j9pxfvaerZGF?= =?utf-8?q?2/alMLmibtKhhID0ctM+hlJfmBfdet9HqUQb00MDRtUHYdT7I6S/+CpCif6u0L1eL?= =?utf-8?q?vVZOWBJFUoSXGPH+IU2zUpr3JDtVHPYoXW0SAuy9NzIBNdDFAiE4ZSW8YixP+94hG?= =?utf-8?q?3lZVj+EY+5eEq7KoZE07uHaCFKsT4ChectFpsZQti3B9tecSU9hIOV6nxW68bDhIx?= =?utf-8?q?yWWstK2PsmJ3hA5gbeiYYEwWq+qcKJYDcjWv1FxFil4nKajM83NR3xiUlVMZyO6iL?= =?utf-8?q?DgJkdlUPlVmavGZAHqRQ8LWIud3h5FXPzAS3D5UlToK7Yphj6wMZLrv34gvLJam8T?= =?utf-8?q?E9hX7/XCtd3OwgL80jmCIA8MtSdCnzSekfxhSs9MBd4em4uX44MfshBAQEoXUlQiF?= =?utf-8?q?/wDlw4fMpjYP3SYO4Aw4APVE1s2meijkU5DNc5jr3c0FvsP7svdxfM2Kj6XsX4q2L?= =?utf-8?q?9H2QYBdgcsiejCEC63IYYYYjJKk6dYRmLcIDsxn/eeBJ/xURG3CXhg9lTnN2VQXHF?= =?utf-8?q?WVLsNqExqwFWwVPZlMmmwICuAbz0tsGr0h5n+rBPIfujFXx5gFn9j6uVnn1Q4Kndd?= =?utf-8?q?kEaH3rLWV970Kv0nVzXgkpGmZkgnvzMoJfaVLgRYTy9zl/kkh8zJ2jqUb1evz4woy?= =?utf-8?q?/FQghYM/GKlyjkvmcQiZ+dGI2HOI0+eTnscN4PH6NtEm25LGp21hdfIg79nF0B/5z?= =?utf-8?q?p1yBD8xvhQU6LYPiwEb88Pnljub3zK0BpaTrsifogtPYE27BnrvoY4gqcxxOAJGI4?= =?utf-8?q?3LJL7NFiP9bWQPcDoykpjvFqPQH47XuHNYGumq18jGaCKnh0co6HS2mTz52WlMcen?= =?utf-8?q?n57W1Ggt1dta0QpssFn2ZMcJMUvFxg6M/VI6J5ZxUIohPu9czAk5PpZnni/4yRKwM?= =?utf-8?q?zaXMaXWORdm0CbhnLK41b7NospqNDYAKBqqxcAQoH/7xfOoeDcpkJnoiRlh5pSCH0?= =?utf-8?q?NDhTUoUtKjhbI7Wy6DTCXy4DvqHTwmQA3x0XD297lcCvr5p+puaOUE=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0cbfb0cd-ede8-4615-937a-08d99d0db711 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5151.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2021 08:00:48.3752 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: f1O+RrTUwG3Iv98kze995WYFuPA0RxkmPnuBecPa00vrA/nyL1FKCsY6kBryVSzr3nVPMkXG1Q7dBT9twSvUTw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3664 Cc: guennadi.liakhovetski@linux.intel.com, daniel.baluta@gmail.com, kai.vehmanen@linux.intel.com, Daniel Baluta , ranjani.sridharan@linux.intel.com, lgirdwood@gmail.com, linux-mediatek@lists.infradead.org, YC Hung , pierre-louis.bossart@linux.intel.com, peter.ujfalusi@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: YC Hung This patch initialize to support SOF on Mediatek mt8195 platform. MT8195 has four Cortex A78 cores paired with four Cortex A55 cores. It also has Cadence HiFi-4 DSP single core. There are shared DRAM and mailbox interrupt between AP and DSP to use for IPC communication. Signed-off-by: YC Hung Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Signed-off-by: Daniel Baluta --- sound/soc/sof/Kconfig | 1 + sound/soc/sof/Makefile | 1 + sound/soc/sof/mediatek/Kconfig | 33 +++ sound/soc/sof/mediatek/Makefile | 2 + sound/soc/sof/mediatek/adsp_helper.h | 49 ++++ sound/soc/sof/mediatek/mediatek-ops.h | 8 + sound/soc/sof/mediatek/mt8195/Makefile | 4 + sound/soc/sof/mediatek/mt8195/mt8195.c | 334 +++++++++++++++++++++++++ sound/soc/sof/mediatek/mt8195/mt8195.h | 155 ++++++++++++ 9 files changed, 587 insertions(+) create mode 100644 sound/soc/sof/mediatek/Kconfig create mode 100644 sound/soc/sof/mediatek/Makefile create mode 100644 sound/soc/sof/mediatek/adsp_helper.h create mode 100644 sound/soc/sof/mediatek/mediatek-ops.h create mode 100644 sound/soc/sof/mediatek/mt8195/Makefile create mode 100644 sound/soc/sof/mediatek/mt8195/mt8195.c create mode 100644 sound/soc/sof/mediatek/mt8195/mt8195.h diff --git a/sound/soc/sof/Kconfig b/sound/soc/sof/Kconfig index 89fba4fa671a..fd6ae0629a1c 100644 --- a/sound/soc/sof/Kconfig +++ b/sound/soc/sof/Kconfig @@ -236,6 +236,7 @@ config SND_SOC_SOF_PROBE_WORK_QUEUE source "sound/soc/sof/amd/Kconfig" source "sound/soc/sof/imx/Kconfig" source "sound/soc/sof/intel/Kconfig" +source "sound/soc/sof/mediatek/Kconfig" source "sound/soc/sof/xtensa/Kconfig" endif diff --git a/sound/soc/sof/Makefile b/sound/soc/sof/Makefile index 32a5f6370c5b..6f76927e0a1c 100644 --- a/sound/soc/sof/Makefile +++ b/sound/soc/sof/Makefile @@ -24,3 +24,4 @@ obj-$(CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL) += intel/ obj-$(CONFIG_SND_SOC_SOF_IMX_TOPLEVEL) += imx/ obj-$(CONFIG_SND_SOC_SOF_AMD_TOPLEVEL) += amd/ obj-$(CONFIG_SND_SOC_SOF_XTENSA) += xtensa/ +obj-$(CONFIG_SND_SOC_SOF_MTK_TOPLEVEL) += mediatek/ diff --git a/sound/soc/sof/mediatek/Kconfig b/sound/soc/sof/mediatek/Kconfig new file mode 100644 index 000000000000..aeacf0e5bfbb --- /dev/null +++ b/sound/soc/sof/mediatek/Kconfig @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) + +config SND_SOC_SOF_MTK_TOPLEVEL + bool "SOF support for MTK audio DSPs" + depends on ARM64 || COMPILE_TEST + depends on SND_SOC_SOF_OF + help + This adds support for Sound Open Firmware for Mediatek platforms. + It is top level for all mediatek platforms. + Say Y if you have such a device. + If unsure select "N". + +if SND_SOC_SOF_MTK_TOPLEVEL +config SND_SOC_SOF_MTK_COMMON + tristate + select SND_SOC_SOF_OF_DEV + select SND_SOC_SOF + select SND_SOC_SOF_XTENSA + select SND_SOC_SOF_COMPRESS + help + This option is not user-selectable but automagically handled by + 'select' statements at a higher level + +config SND_SOC_SOF_MT8195 + tristate "SOF support for MT8195 audio DSP" + select SND_SOC_SOF_MTK_COMMON + help + This adds support for Sound Open Firmware for Mediatek platforms + using the mt8195 processors. + Say Y if you have such a device. + If unsure select "N". + +endif ## SND_SOC_SOF_MTK_TOPLEVEL diff --git a/sound/soc/sof/mediatek/Makefile b/sound/soc/sof/mediatek/Makefile new file mode 100644 index 000000000000..e8ec6da981de --- /dev/null +++ b/sound/soc/sof/mediatek/Makefile @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) +obj-$(CONFIG_SND_SOC_SOF_MT8195) += mt8195/ diff --git a/sound/soc/sof/mediatek/adsp_helper.h b/sound/soc/sof/mediatek/adsp_helper.h new file mode 100644 index 000000000000..346953dd22db --- /dev/null +++ b/sound/soc/sof/mediatek/adsp_helper.h @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +/* + * Copyright (c) 2021 MediaTek Corporation. All rights reserved. + */ + +#ifndef __MTK_ADSP_HELPER_H__ +#define __MTK_ADSP_HELPER_H__ + +/* + * Global important adsp data structure. + */ +#define DSP_MBOX_NUM 3 + +struct mtk_adsp_chip_info { + phys_addr_t pa_sram; + phys_addr_t pa_dram; /* adsp dram physical base */ + phys_addr_t pa_shared_dram; /* adsp dram physical base */ + phys_addr_t pa_cfgreg; + phys_addr_t pa_mboxreg[DSP_MBOX_NUM]; + u32 sramsize; + u32 dramsize; + u32 cfgregsize; + void __iomem *va_sram; /* corresponding to pa_sram */ + void __iomem *va_dram; /* corresponding to pa_dram */ + void __iomem *va_cfgreg; + void __iomem *va_mboxreg[DSP_MBOX_NUM]; + void __iomem *shared_sram; /* part of va_sram */ + void __iomem *shared_dram; /* part of va_dram */ + phys_addr_t adsp_bootup_addr; + int dram_offset; /*dram offset between system and dsp view*/ +}; + +struct adsp_priv { + struct device *dev; + struct snd_sof_dev *sdev; + + /* DSP IPC handler */ + struct mbox_controller *adsp_mbox; + + struct mtk_adsp_chip_info *adsp; + + u32 (*ap2adsp_addr)(u32 addr, void *data); + u32 (*adsp2ap_addr)(u32 addr, void *data); + + void *private_data; +}; + +#endif diff --git a/sound/soc/sof/mediatek/mediatek-ops.h b/sound/soc/sof/mediatek/mediatek-ops.h new file mode 100644 index 000000000000..e0ffa69ecb0c --- /dev/null +++ b/sound/soc/sof/mediatek/mediatek-ops.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ + +#ifndef __MEDIATEK_OPS_H__ +#define __MEDIATEK_OPS_H__ + +extern const struct snd_sof_dsp_ops sof_mt8195_ops; + +#endif diff --git a/sound/soc/sof/mediatek/mt8195/Makefile b/sound/soc/sof/mediatek/mt8195/Makefile new file mode 100644 index 000000000000..bf23d88db828 --- /dev/null +++ b/sound/soc/sof/mediatek/mt8195/Makefile @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) +snd-sof-mt8195-objs := mt8195.o +obj-$(CONFIG_SND_SOC_SOF_MT8195) += snd-sof-mt8195.o + diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c new file mode 100644 index 000000000000..945601a0dc37 --- /dev/null +++ b/sound/soc/sof/mediatek/mt8195/mt8195.c @@ -0,0 +1,334 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) +// +// Copyright(c) 2021 Mediatek Inc. All rights reserved. +// +// Author: YC Hung +// + +/* + * Hardware interface for audio DSP on mt8195 + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "../../ops.h" +#include "../../sof-audio.h" +#include "../adsp_helper.h" +#include "../mediatek-ops.h" +#include "mt8195.h" + +static int platform_parse_resource(struct platform_device *pdev, void *data) +{ + struct resource *mmio; + struct resource res; + struct device_node *mem_region; + struct device *dev = &pdev->dev; + struct mtk_adsp_chip_info *adsp = data; + int ret; + + mem_region = of_parse_phandle(dev->of_node, "memory-region", 0); + if (!mem_region) { + dev_err(dev, "no dma memory-region phandle\n"); + return -ENODEV; + } + + ret = of_address_to_resource(mem_region, 0, &res); + if (ret) { + dev_err(dev, "of_address_to_resource dma failed\n"); + return ret; + } + + dev_dbg(dev, "DMA pbase=0x%llx, size=0x%llx\n", + (phys_addr_t)res.start, resource_size(&res)); + + ret = of_reserved_mem_device_init(dev); + if (ret) { + dev_err(dev, "of_reserved_mem_device_init failed\n"); + return ret; + } + + mem_region = of_parse_phandle(dev->of_node, "memory-region", 1); + if (!mem_region) { + dev_err(dev, "no memory-region sysmem phandle\n"); + return -ENODEV; + } + + ret = of_address_to_resource(mem_region, 0, &res); + if (ret) { + dev_err(dev, "of_address_to_resource sysmem failed\n"); + return ret; + } + + adsp->pa_dram = (phys_addr_t)res.start; + adsp->dramsize = resource_size(&res); + if (adsp->pa_dram & DRAM_REMAP_MASK) { + dev_err(dev, "adsp memory(%#x) is not 4K-aligned\n", + (u32)adsp->pa_dram); + return -EINVAL; + } + + if (adsp->dramsize < TOTAL_SIZE_SHARED_DRAM_FROM_TAIL) { + dev_err(dev, "adsp memory(%#x) is not enough for share\n", + adsp->dramsize); + return -EINVAL; + } + + dev_dbg(dev, "dram pbase=%pa, dramsize=%#x\n", + &adsp->pa_dram, adsp->dramsize); + + /* Parse CFG base */ + mmio = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg"); + if (!mmio) { + dev_err(dev, "no ADSP-CFG register resource\n"); + return -ENXIO; + } + /* remap for DSP register accessing */ + adsp->va_cfgreg = devm_ioremap_resource(dev, mmio); + if (IS_ERR(adsp->va_cfgreg)) + return PTR_ERR(adsp->va_cfgreg); + + adsp->pa_cfgreg = (phys_addr_t)mmio->start; + adsp->cfgregsize = resource_size(mmio); + + dev_dbg(dev, "cfgreg-vbase=%p, cfgregsize=%#x\n", + adsp->va_cfgreg, adsp->cfgregsize); + + /* Parse SRAM */ + mmio = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sram"); + if (!mmio) { + dev_err(dev, "no SRAM resource\n"); + return -ENXIO; + } + + adsp->pa_sram = (phys_addr_t)mmio->start; + adsp->sramsize = resource_size(mmio); + if (adsp->sramsize < TOTAL_SIZE_SHARED_SRAM_FROM_TAIL) { + dev_err(dev, "adsp SRAM(%#x) is not enough for share\n", + adsp->sramsize); + return -EINVAL; + } + + dev_dbg(dev, "sram pbase=%pa,%#x\n", &adsp->pa_sram, adsp->sramsize); + + return ret; +} + +static int adsp_sram_power_on(struct device *dev, bool on) +{ + void __iomem *va_dspsysreg; + u32 srampool_con; + + va_dspsysreg = ioremap(ADSP_SRAM_POOL_CON, 0x4); + if (!va_dspsysreg) { + dev_err(dev, "failed to ioremap sram pool base %#x\n", + ADSP_SRAM_POOL_CON); + return -ENOMEM; + } + + srampool_con = readl(va_dspsysreg); + if (on) + writel(srampool_con & ~DSP_SRAM_POOL_PD_MASK, va_dspsysreg); + else + writel(srampool_con | DSP_SRAM_POOL_PD_MASK, va_dspsysreg); + + iounmap(va_dspsysreg); + return 0; +} + +/* Init the basic DSP DRAM address */ +static int adsp_memory_remap_init(struct device *dev, struct mtk_adsp_chip_info *adsp) +{ + void __iomem *vaddr_emi_map; + int offset; + + if (!adsp) + return -ENXIO; + + vaddr_emi_map = devm_ioremap(dev, DSP_EMI_MAP_ADDR, 0x4); + if (!vaddr_emi_map) { + dev_err(dev, "failed to ioremap emi map base %#x\n", + DSP_EMI_MAP_ADDR); + return -ENOMEM; + } + + offset = adsp->pa_dram - DRAM_PHYS_BASE_FROM_DSP_VIEW; + adsp->dram_offset = offset; + offset >>= DRAM_REMAP_SHIFT; + dev_dbg(dev, "adsp->pa_dram %llx, offset %#x\n", adsp->pa_dram, offset); + writel(offset, vaddr_emi_map); + if (offset != readl(vaddr_emi_map)) { + dev_err(dev, "write emi map fail : %#x\n", readl(vaddr_emi_map)); + return -EIO; + } + + return 0; +} + +static int adsp_shared_base_ioremap(struct platform_device *pdev, void *data) +{ + struct device *dev = &pdev->dev; + struct mtk_adsp_chip_info *adsp = data; + u32 shared_size; + + /* remap shared-dram base to be non-cachable */ + shared_size = TOTAL_SIZE_SHARED_DRAM_FROM_TAIL; + adsp->pa_shared_dram = adsp->pa_dram + adsp->dramsize - shared_size; + if (adsp->va_dram) { + adsp->shared_dram = adsp->va_dram + DSP_DRAM_SIZE - shared_size; + } else { + adsp->shared_dram = devm_ioremap(dev, adsp->pa_shared_dram, + shared_size); + if (!adsp->shared_dram) { + dev_err(dev, "ioremap failed for shared DRAM\n"); + return -ENOMEM; + } + } + dev_dbg(dev, "shared-dram vbase=%p, phy addr :%llx, size=%#x\n", + adsp->shared_dram, adsp->pa_shared_dram, shared_size); + + return 0; +} + +static int mt8195_run(struct snd_sof_dev *sdev) +{ + u32 adsp_bootup_addr; + + adsp_bootup_addr = SRAM_PHYS_BASE_FROM_DSP_VIEW; + dev_dbg(sdev->dev, "HIFIxDSP boot from base : 0x%08X\n", adsp_bootup_addr); + sof_hifixdsp_boot_sequence(sdev, adsp_bootup_addr); + + return 0; +} + +static int mt8195_dsp_probe(struct snd_sof_dev *sdev) +{ + struct platform_device *pdev = container_of(sdev->dev, struct platform_device, dev); + struct adsp_priv *priv; + int ret; + + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + sdev->pdata->hw_pdata = priv; + priv->dev = sdev->dev; + priv->sdev = sdev; + + priv->adsp = devm_kzalloc(&pdev->dev, sizeof(struct mtk_adsp_chip_info), GFP_KERNEL); + if (!priv->adsp) + return -ENOMEM; + + ret = platform_parse_resource(pdev, priv->adsp); + if (ret) + return ret; + + ret = adsp_sram_power_on(sdev->dev, true); + if (ret) { + dev_err(sdev->dev, "adsp_sram_power_on fail!\n"); + return ret; + } + + ret = adsp_memory_remap_init(&pdev->dev, priv->adsp); + if (ret) { + dev_err(sdev->dev, "adsp_memory_remap_init fail!\n"); + goto err_adsp_sram_power_off; + } + + sdev->bar[SOF_FW_BLK_TYPE_IRAM] = devm_ioremap(sdev->dev, + priv->adsp->pa_sram, + priv->adsp->sramsize); + if (!sdev->bar[SOF_FW_BLK_TYPE_IRAM]) { + dev_err(sdev->dev, "failed to ioremap base %pa size %#x\n", + &priv->adsp->pa_sram, priv->adsp->sramsize); + ret = -EINVAL; + goto err_adsp_sram_power_off; + } + + sdev->bar[SOF_FW_BLK_TYPE_SRAM] = devm_ioremap_wc(sdev->dev, + priv->adsp->pa_dram, + priv->adsp->dramsize); + if (!sdev->bar[SOF_FW_BLK_TYPE_SRAM]) { + dev_err(sdev->dev, "failed to ioremap base %pa size %#x\n", + &priv->adsp->pa_dram, priv->adsp->dramsize); + ret = -EINVAL; + goto err_adsp_sram_power_off; + } + priv->adsp->va_dram = sdev->bar[SOF_FW_BLK_TYPE_SRAM]; + + ret = adsp_shared_base_ioremap(pdev, priv->adsp); + if (ret) { + dev_err(sdev->dev, "adsp_shared_base_ioremap fail!\n"); + goto err_adsp_sram_power_off; + } + + sdev->bar[DSP_REG_BAR] = priv->adsp->va_cfgreg; + sdev->bar[DSP_MBOX0_BAR] = priv->adsp->va_mboxreg[0]; + sdev->bar[DSP_MBOX1_BAR] = priv->adsp->va_mboxreg[1]; + sdev->bar[DSP_MBOX2_BAR] = priv->adsp->va_mboxreg[2]; + + sdev->mmio_bar = SOF_FW_BLK_TYPE_SRAM; + sdev->mailbox_bar = SOF_FW_BLK_TYPE_SRAM; + + return 0; + +err_adsp_sram_power_off: + adsp_sram_power_on(&pdev->dev, false); + + return ret; +} + +static int mt8195_dsp_remove(struct snd_sof_dev *sdev) +{ + struct platform_device *pdev = container_of(sdev->dev, struct platform_device, dev); + + return adsp_sram_power_on(&pdev->dev, false); +} + +/* on mt8195 there is 1 to 1 match between type and BAR idx */ +static int mt8195_get_bar_index(struct snd_sof_dev *sdev, u32 type) +{ + return type; +} + +/* mt8195 ops */ +const struct snd_sof_dsp_ops sof_mt8195_ops = { + /* probe and remove */ + .probe = mt8195_dsp_probe, + .remove = mt8195_dsp_remove, + + /* Block IO */ + .block_read = sof_block_read, + .block_write = sof_block_write, + + /* Register IO */ + .write = sof_io_write, + .read = sof_io_read, + .write64 = sof_io_write64, + .read64 = sof_io_read64, + + /* misc */ + .get_bar_index = mt8195_get_bar_index, + + /* Firmware ops */ + .dsp_arch_ops = &sof_xtensa_arch_ops, + + /* ALSA HW info flags */ + .hw_info = SNDRV_PCM_INFO_MMAP | + SNDRV_PCM_INFO_MMAP_VALID | + SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_PAUSE | + SNDRV_PCM_INFO_NO_PERIOD_WAKEUP, +}; +EXPORT_SYMBOL(sof_mt8195_ops); + +MODULE_IMPORT_NS(SND_SOC_SOF_XTENSA); +MODULE_LICENSE("Dual BSD/GPL"); diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.h b/sound/soc/sof/mediatek/mt8195/mt8195.h new file mode 100644 index 000000000000..48cbbb5aacb5 --- /dev/null +++ b/sound/soc/sof/mediatek/mt8195/mt8195.h @@ -0,0 +1,155 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +/* + * Copyright (c) 2021 MediaTek Corporation. All rights reserved. + * + * Header file for the mt8195 DSP register definition + */ + +#ifndef __MT8195_H +#define __MT8195_H + +struct mtk_adsp_chip_info; + +#define DSP_REG_BASE 0x10803000 +#define SCP_CFGREG_BASE 0x10724000 +#define DSP_SYSAO_BASE 0x1080C000 + +/***************************************************************************** + * R E G I S T E R TABLE + *****************************************************************************/ +#define DSP_JTAGMUX 0x0000 +#define DSP_ALTRESETVEC 0x0004 +#define DSP_PDEBUGDATA 0x0008 +#define DSP_PDEBUGBUS0 0x000c +#define PDEBUG_ENABLE BIT(0) +#define DSP_PDEBUGBUS1 0x0010 +#define DSP_PDEBUGINST 0x0014 +#define DSP_PDEBUGLS0STAT 0x0018 +#define DSP_PDEBUGLS1STAT 0x001c +#define DSP_PDEBUGPC 0x0020 +#define DSP_RESET_SW 0x0024 /*reset sw*/ +#define ADSP_BRESET_SW BIT(0) +#define ADSP_DRESET_SW BIT(1) +#define ADSP_RUNSTALL BIT(3) +#define STATVECTOR_SEL BIT(4) +#define DSP_PFAULTBUS 0x0028 +#define DSP_PFAULTINFO 0x002c +#define DSP_GPR00 0x0030 +#define DSP_GPR01 0x0034 +#define DSP_GPR02 0x0038 +#define DSP_GPR03 0x003c +#define DSP_GPR04 0x0040 +#define DSP_GPR05 0x0044 +#define DSP_GPR06 0x0048 +#define DSP_GPR07 0x004c +#define DSP_GPR08 0x0050 +#define DSP_GPR09 0x0054 +#define DSP_GPR0A 0x0058 +#define DSP_GPR0B 0x005c +#define DSP_GPR0C 0x0060 +#define DSP_GPR0D 0x0064 +#define DSP_GPR0E 0x0068 +#define DSP_GPR0F 0x006c +#define DSP_GPR10 0x0070 +#define DSP_GPR11 0x0074 +#define DSP_GPR12 0x0078 +#define DSP_GPR13 0x007c +#define DSP_GPR14 0x0080 +#define DSP_GPR15 0x0084 +#define DSP_GPR16 0x0088 +#define DSP_GPR17 0x008c +#define DSP_GPR18 0x0090 +#define DSP_GPR19 0x0094 +#define DSP_GPR1A 0x0098 +#define DSP_GPR1B 0x009c +#define DSP_GPR1C 0x00a0 +#define DSP_GPR1D 0x00a4 +#define DSP_GPR1E 0x00a8 +#define DSP_GPR1F 0x00ac +#define DSP_TCM_OFFSET 0x00b0 /* not used */ +#define DSP_DDR_OFFSET 0x00b4 /* not used */ +#define DSP_INTFDSP 0x00d0 +#define DSP_INTFDSP_CLR 0x00d4 +#define DSP_SRAM_PD_SW1 0x00d8 +#define DSP_SRAM_PD_SW2 0x00dc +#define DSP_OCD 0x00e0 +#define DSP_RG_DSP_IRQ_POL 0x00f0 /* not used */ +#define DSP_DSP_IRQ_EN 0x00f4 /* not used */ +#define DSP_DSP_IRQ_LEVEL 0x00f8 /* not used */ +#define DSP_DSP_IRQ_STATUS 0x00fc /* not used */ +#define DSP_RG_INT2CIRQ 0x0114 +#define DSP_RG_INT_POL_CTL0 0x0120 +#define DSP_RG_INT_EN_CTL0 0x0130 +#define DSP_RG_INT_LV_CTL0 0x0140 +#define DSP_RG_INT_STATUS0 0x0150 +#define DSP_PDEBUGSTATUS0 0x0200 +#define DSP_PDEBUGSTATUS1 0x0204 +#define DSP_PDEBUGSTATUS2 0x0208 +#define DSP_PDEBUGSTATUS3 0x020c +#define DSP_PDEBUGSTATUS4 0x0210 +#define DSP_PDEBUGSTATUS5 0x0214 +#define DSP_PDEBUGSTATUS6 0x0218 +#define DSP_PDEBUGSTATUS7 0x021c +#define DSP_DSP2PSRAM_PRIORITY 0x0220 /* not used */ +#define DSP_AUDIO_DSP2SPM_INT 0x0224 +#define DSP_AUDIO_DSP2SPM_INT_ACK 0x0228 +#define DSP_AUDIO_DSP_DEBUG_SEL 0x022C +#define DSP_AUDIO_DSP_EMI_BASE_ADDR 0x02E0 /* not used */ +#define DSP_AUDIO_DSP_SHARED_IRAM 0x02E4 +#define DSP_AUDIO_DSP_CKCTRL_P2P_CK_CON 0x02F0 +#define DSP_RG_SEMAPHORE00 0x0300 +#define DSP_RG_SEMAPHORE01 0x0304 +#define DSP_RG_SEMAPHORE02 0x0308 +#define DSP_RG_SEMAPHORE03 0x030C +#define DSP_RG_SEMAPHORE04 0x0310 +#define DSP_RG_SEMAPHORE05 0x0314 +#define DSP_RG_SEMAPHORE06 0x0318 +#define DSP_RG_SEMAPHORE07 0x031C +#define DSP_RESERVED_0 0x03F0 +#define DSP_RESERVED_1 0x03F4 + +/* dsp wdt */ +#define DSP_WDT_MODE 0x0400 + +/* dsp mbox */ +#define DSP_MBOX_IN_CMD 0x00 +#define DSP_MBOX_IN_CMD_CLR 0x04 +#define DSP_MBOX_OUT_CMD 0x1c +#define DSP_MBOX_OUT_CMD_CLR 0x20 +#define DSP_MBOX_IN_MSG0 0x08 +#define DSP_MBOX_IN_MSG1 0x0C +#define DSP_MBOX_OUT_MSG0 0x24 +#define DSP_MBOX_OUT_MSG1 0x28 + +/*dsp sys ao*/ +#define ADSP_SRAM_POOL_CON (DSP_SYSAO_BASE + 0x30) +#define DSP_SRAM_POOL_PD_MASK 0xf +#define DSP_EMI_MAP_ADDR (DSP_SYSAO_BASE + 0x81c) + +/* DSP memories */ +#define MBOX_OFFSET 0x800000 /* DRAM */ +#define MBOX_SIZE 0x1000 /* consistent with which in memory.h of sof fw */ +#define DSP_DRAM_SIZE 0x1000000 /* 16M */ + +#define DSP_REG_BAR 4 +#define DSP_MBOX0_BAR 5 +#define DSP_MBOX1_BAR 6 +#define DSP_MBOX2_BAR 7 + +#define TOTAL_SIZE_SHARED_SRAM_FROM_TAIL 0x0 + +#define SIZE_SHARED_DRAM_DL 0x40000 /*Shared buffer for Downlink*/ +#define SIZE_SHARED_DRAM_UL 0x40000 /*Shared buffer for Uplink*/ + +#define TOTAL_SIZE_SHARED_DRAM_FROM_TAIL \ + (SIZE_SHARED_DRAM_DL + SIZE_SHARED_DRAM_UL) + +#define SRAM_PHYS_BASE_FROM_DSP_VIEW 0x40000000 /* MT8195 DSP view */ +#define DRAM_PHYS_BASE_FROM_DSP_VIEW 0x60000000 /* MT8195 DSP view */ + +/*remap dram between AP and DSP view, 4KB aligned*/ +#define DRAM_REMAP_SHIFT 12 +#define DRAM_REMAP_MASK (BIT(DRAM_REMAP_SHIFT) - 1) + +#endif From patchwork Mon Nov 1 08:00:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Daniel Baluta (OSS)" X-Patchwork-Id: 12596019 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74834C433EF for ; Mon, 1 Nov 2021 08:02:50 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C930B60F70 for ; Mon, 1 Nov 2021 08:02:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C930B60F70 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3C3D216CF; Mon, 1 Nov 2021 09:01:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3C3D216CF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635753768; bh=0AdWe+wESoIZLkxShjcJpWZfEBeCUzz5t4tdBvx0xeU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=jWNT3ptbj89L5heJpDrX0URUf9ec9QyVM95OMcrqHoSeh+3OwnGzprwfE5bppzNIz 1yIoChHf3CKh3Lj+YpIwqGL3BQF9xPRPgfbDh0CcPg1tAB/MIN3rsESRNYjVci53a3 54JL6hmgg8/JkKNCEn1WoD7grZjZ+l+40SbXF21g= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C8E8CF804F1; Mon, 1 Nov 2021 09:01:16 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6E8FAF804ED; Mon, 1 Nov 2021 09:01:08 +0100 (CET) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-ve1eur03on061b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe09::61b]) (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 7095DF800F8 for ; Mon, 1 Nov 2021 09:00:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7095DF800F8 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="B5UESwyL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gzAfdJeoEPj/Z/W/jgXqdW+Tw06u6xkErJHMkUouc9iLnCrdfBmdvJLsXH6xVuybdy9ZyHMAW8VDSCU/NXbYFaCytFnxGQtQn0c5CRfKdtPhe9UEGAaUiTJ7lFabcXGAB6wQ4PHl5b0+g6suez2A5qiqDuvOemZy5ImPkqc3KEI6jGdnoubQPCVFUVlYKxYc1W8I2obwb5xtzStrP44JZN9CM6eUqhmzTWvYAxprfy367DP9qi07GKHqdMJr6Zj077/jTq7Lcn9M6fOARPfgso06boW+anrHEvuYugAA5YWv8EGAz7Y4eZ5gXlWSZ+/XbiVaWFqyrfi2oZOeaKQL1A== 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=Aqt20fJUIGTFP4E/vWRRVNFTpG1mnUMB2/YdINTbsV4=; b=fIV2CzHBr/UsfNGnn03UXqBZJqQOD9rin2L8SWPjyaEI+Y80TExsBnsRcjWna4mXiE8DjCpCTQpqNU9PSwv8c4cZHaWshmiRleywdDuQSnxSMAVVjNLqHdYW3JKIRSom6udsCdpl/jOEbHluLwURWy9TRPKEclwkv386KNHoCl6xiJL8Ym8kZqtH/xOb5sjy2xv3fh8IqA0Utm8rc9+yjotYBOtV1od66r88hKFFcZwtztaRVWIVfQU2xQkUD7zafAgHkyKWwxhmd5WAq1SakTiaqZWck1rzxGF2+ZAUOLeKwZzh6R9JVSmgGYa3aKnjFVR+RmJ3Z2/nCK1pWHK54w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Aqt20fJUIGTFP4E/vWRRVNFTpG1mnUMB2/YdINTbsV4=; b=B5UESwyLVTEjNWZB3za2DG72jGdw5Wogp2Hk4F8yZYKyw6pDCr5wyKTyIJvocJV/s9krzKwh4J+l9n5yjN3NG8L8sLKAFm5AX7jbuvXuNZNXVCvqEY8CcLM/+SOyoDUCw9JD5lR0ClkoUY6iciiPkjr+lAK8Ncv7YA8uX2T06wA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5151.eurprd04.prod.outlook.com (2603:10a6:803:61::28) by VI1PR0401MB2430.eurprd04.prod.outlook.com (2603:10a6:800:2b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Mon, 1 Nov 2021 08:00:50 +0000 Received: from VI1PR04MB5151.eurprd04.prod.outlook.com ([fe80::85af:f8be:aa99:ba5f]) by VI1PR04MB5151.eurprd04.prod.outlook.com ([fe80::85af:f8be:aa99:ba5f%3]) with mapi id 15.20.4649.019; Mon, 1 Nov 2021 08:00:50 +0000 From: Daniel Baluta To: broonie@kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 2/6] ASoC: SOF: tokens: add token for Mediatek AFE Date: Mon, 1 Nov 2021 10:00:22 +0200 Message-Id: <20211101080026.297360-3-daniel.baluta@oss.nxp.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211101080026.297360-1-daniel.baluta@oss.nxp.com> References: <20211101080026.297360-1-daniel.baluta@oss.nxp.com> X-ClientProxiedBy: AM3PR07CA0070.eurprd07.prod.outlook.com (2603:10a6:207:4::28) To VI1PR04MB5151.eurprd04.prod.outlook.com (2603:10a6:803:61::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2a02:2f08:5719:1500:cdb2:376b:257c:429a) by AM3PR07CA0070.eurprd07.prod.outlook.com (2603:10a6:207:4::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.9 via Frontend Transport; Mon, 1 Nov 2021 08:00:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1c9dd50a-e17b-4483-0c26-08d99d0db816 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2430: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2449; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EqxBmEOIB79aqUgcsADftyXcxLEnzYkKud9uGRBuEls6BFN/jLs+TETgRXFe6ozov8CmvhQAAAYCD60JHGKiKjtcY5oW57MURWOOvf//1yq0CQTzRsd0j/V4FJrEA3gqKwhZnIgOwysBlr9g7dEkT+/vmy2R8JYCMXkk8hFh0rcN01fyJXlLdUkZfRV7ucOXB/AwJbvMChI8WHwuoLcJc3+qAHzRqM7uLk1KFvfqWaBJATbR8dXd2JsLTqKHbPSKuM6GKUEV0ctujlomEpeKFdU8JBWbiHnVMV2RwAMet3CeNhw614AQ01Mf/WZNzzXjqUAXa+XLSHMCscquNhCR6IGkqFHurm3He67c2VKBcOoDPuZdXxxxsye2oxM3fDfExesmaheyh5as8yvtjFeZxXMg/EhCyGkVjKNV+qzlsUT89GWk79ZqJ7DDO8C2lwzwSPQiUTU7ENS9OR14fo3KDUHBAYcY9wniipeTOmOD7LIUNHjeK2qMLINYle1X7RxNpi9Jbd+HCkLwFvpsbWm7g3gbw9XF1gxZ36sX6al6VWOwYFFN6DDvOy4Ww60teyvdHdr7GqFS6CXar7pQ0T4a7L6nyUeUX2UTxTM6JD+bckCsFvfk8Mhj/fDJvm0LyttAmxtL/1Et8LMuq1lSp8JOPA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5151.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(316002)(8676002)(508600001)(54906003)(6486002)(8936002)(6506007)(1076003)(5660300002)(52116002)(6666004)(44832011)(6512007)(66476007)(2906002)(7416002)(2616005)(66946007)(38100700002)(186003)(86362001)(66556008)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?sKQtG1D2tdnw3lZI4IMjx6O5AVk2?= =?utf-8?q?zjY3XHJWZyge6NnN4vNg/Z7S9UsxgTISy0+EB9A2lc/TuGhT5ebh5/f2PD6hDx0H8?= =?utf-8?q?bUGzrJXnXIS10qNEsMzTeuH+ZgJKKgY1abjfjHIxuW5MXiNtAt0kYmxUEqAjRZ93c?= =?utf-8?q?iQ+Bw1AXEdDO04XcBttQ0OS1b+01h2h6GKpuw4MN7zDC0gn1CdK/os4kJSs6mgct/?= =?utf-8?q?igbw2sg3rqvQnvljjIza+Hkw3vIAhBfADDCVX8gh/uZbbgFGe3l+/ti12mQ0tDNRO?= =?utf-8?q?ONN36co+MyAvR5PsW7f8TSlRSROarx/02lLPZM+2GZgPzrQQVLqhaGlT8NV+ISHK1?= =?utf-8?q?D8wKNSy5RB9Suy7U3DJpz3G6slm0y3XNQjvjxX4PrPkedVWgYSqkLi70SFjlQ8sxR?= =?utf-8?q?YeW+Tn5QZf09ok82NfF9zLZdmXPVtitSULX+mbLITv/bxthJ6mpSn0rEXppzT2MoG?= =?utf-8?q?70LwSlQhGYXCmJZ5ia8M0B0KQRrliWo3nHyLo5I3ZMhlaBqfQxloOryZVAOZty8uM?= =?utf-8?q?2fWWfFctyUGJnYFGEclHMeIxnNsQqIuA2KxEi8BR+w1t1/26DXjE6Pgdrd5z3h+A+?= =?utf-8?q?5aoddVmkOx88xTPAZ89IxOEEgc4fk4bZ7s3iZ0P79izele2WFdBWcqWsZlgjAyM5S?= =?utf-8?q?yUthEF+jihNGVB0fAhDwOJsa3+dwFxUf/GNhEujdKeDsSmh+JIp16Px+PMwtreRq4?= =?utf-8?q?M1A/OsG5/g84uBKxAsUbhrJUHWIh1BNyNdGk2JIL3WjNxH1KJS4hXwGKU/jncm9qp?= =?utf-8?q?JRjw3pLeEAevVmhDIfmmy0utxFegADqNUsjToo+gU9K9YEGf9xCRAqwpXXoaXK6mY?= =?utf-8?q?L6X7qb8WeuH7p4XaxZl3/hoFSr5wlGKd72gcRGnVKI75qdptWroM1dvv9Gi+L9yMG?= =?utf-8?q?gxHBjuCb6jdI8gTx6EbYi3kYCGzpC7hv1bxeqRZxITXWoIrrkt/WyVP5PIyVIkDf8?= =?utf-8?q?KScndmIlD0wdXZei4cO0L2yhgE5IF7pYZVLWuz6KGbwHmFi0iyjfi7g86dapATyhb?= =?utf-8?q?05ZJJ2NRVPzATIV510GqOpM7nkg6hTJ8VIVA58nAm6bq/ljyWbdfTp58inEGqL0QE?= =?utf-8?q?fKtBFxY6x8TDD4HR309FdH9bHXiQnJTqzqhufmR4of+WSAnb4EGQl8i+ZPDXZBGn0?= =?utf-8?q?y0c1lgmib00OzMscFR9SLQCmtoVu9agKzB6kxU7yJas/hkydnm/dE6vkiUq4ED0Ru?= =?utf-8?q?6LHavezXCcVz65L+xedoVgkM/Tu7E+1P6cGrvNDbBJ6NfZniaIP0jLE3hwhROeHeX?= =?utf-8?q?l/81iNRXKq6aRr7Nz2GQVr25nhKit/v+JzDMa3x6xrSGe59w5YKQT5kgTIU7SDbSH?= =?utf-8?q?xDK4831Xf+QwMBZaseQuEfpCo3dFWMIPUTEEtNbMKQeAqixG4Hy7q52aHLQzZ/4UA?= =?utf-8?q?gPXcOIFIrOov0pNy4v0mGVE5WXdF7K1fUi9bCv8kZjD09fLJ1m5/KSdg2yq0c/FB9?= =?utf-8?q?99qbutL3UvfPNNyLI8UpuHNs23cwYur3n+zHRPpbPMmTQUaUammtm9kKShXnIPksK?= =?utf-8?q?ZDQ3K01qWZrbk4TGASiRocIOUKKrCbOo5z5V1VFiurI5ZnuuYei0DDmYAoYD0eITH?= =?utf-8?q?lmPBdjMIMc0FN6KXwLiSFm8sHwWBSb+oDEBfVsEl42tIB0Y+e5h3C0=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c9dd50a-e17b-4483-0c26-08d99d0db816 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5151.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2021 08:00:49.9923 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cx6JJlzCq98sDjkq/HnSqM4ICmM9NROzjSnFVnRmv/qO8rJIR3fJ6q2i4xSx7I9aqJNo4naAb00OR3IduB+FVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2430 Cc: guennadi.liakhovetski@linux.intel.com, daniel.baluta@gmail.com, kai.vehmanen@linux.intel.com, Daniel Baluta , ranjani.sridharan@linux.intel.com, lgirdwood@gmail.com, linux-mediatek@lists.infradead.org, YC Hung , pierre-louis.bossart@linux.intel.com, peter.ujfalusi@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: YC Hung Add the definition for Mediatek audio front end(AFE) tokens,include AFE sampling rate, channels, and format. Signed-off-by: YC Hung Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Signed-off-by: Daniel Baluta --- include/uapi/sound/sof/tokens.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/uapi/sound/sof/tokens.h b/include/uapi/sound/sof/tokens.h index 02b71a8deea4..b72fa385bebf 100644 --- a/include/uapi/sound/sof/tokens.h +++ b/include/uapi/sound/sof/tokens.h @@ -140,4 +140,9 @@ #define SOF_TKN_INTEL_HDA_RATE 1500 #define SOF_TKN_INTEL_HDA_CH 1501 +/* AFE */ +#define SOF_TKN_MEDIATEK_AFE_RATE 1600 +#define SOF_TKN_MEDIATEK_AFE_CH 1601 +#define SOF_TKN_MEDIATEK_AFE_FORMAT 1602 + #endif From patchwork Mon Nov 1 08:00:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Daniel Baluta (OSS)" X-Patchwork-Id: 12596043 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2C22C433EF for ; Mon, 1 Nov 2021 08:03:21 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C3CBB610A2 for ; Mon, 1 Nov 2021 08:03:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C3CBB610A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C122116CA; Mon, 1 Nov 2021 09:02:28 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C122116CA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635753798; bh=xkn4YHb6rptgE9jOZf7AvbiHtULKfHMCgupPxFwtkXA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=VwvDzWMSDlycgsqx/8nGaenzD/ZtSxAuqQ1uYk3HH59QqoZ4sNzPf+jnkJHPrH2wY DXsruQKWqtgdgyf3tCj+PRABfMXNS1yjvuNxHcUhNYyklQcuDy1Ysh250yp59d0npO +myd02+X7ZAVBKF6wysgcqEmxf+O+OwLQLHA+l1Y= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AD27FF804FE; Mon, 1 Nov 2021 09:01:27 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 15800F804EC; Mon, 1 Nov 2021 09:01:08 +0100 (CET) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-ve1eur03on061b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe09::61b]) (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 E0CA4F8010A for ; Mon, 1 Nov 2021 09:01:00 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E0CA4F8010A Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="X7/8oyK5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SKeNsGJd4t8dx2JCM1Q9uIF/OdXjUBhjkbzI734CpZ3VFtuEQp6ycckrWUJM/aBiYp8CgC3mUyqTZ/W86fi3Sds0usxssR9kJlscZ2+BCeuMQFvNTeiMtLkIKq9zxWPS0yuE2TXGQmF1X9Sp5h9cL3A6UPVWmuo+QKZJfS8NNyLBLxPosqPXRPkkP7gz3hC/kRW+5Y+wm7ZlnDW+zKS9uOm8VpdzvCC4Cmyuqa7t4nl96JW1nKdSAcgr/5MtvI7BEGWt1TRWy9337VecirdkkToL24RPTsjC8CNRsh672n0TWteUuZXZWtpjvXD00n/c9pXlPaalwR/2zlczOZmcbw== 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=F/3xGWUwSSLI5yvDRcxvTWnoQRrkSl9b0fOqNKLsC4o=; b=BGBkJFnGtBuy/sjDpLw+N+/LVwYxcIBH4E3wOgVFN9Vt57I3uk8Ml4sVu/K7CxzPGIPDy6f79UBs6psaz0aqAEubLdl/1Q8HNnKAImKiF3h0hueB3AtLPZnp8LnPRgd6kRaUbX40FsLVDXc8iceCUVs1KnU+84ieTVAmv/83Vi7NaH2gSRnIiVhImU0aGOT4phODwJ1AU4Pr3DjV4VKBLgirYXa2FR9G5c5YwK4bA8dw2CYvkMOHckFzdNdlc2td/m2ndf4jQX5SAJ+2GQF+9HhK7rJjWcCZpHOTWY8vRY6BKVjlgVmm9LjptTunZWemmSJpgEfzEtfPolIskdF3Ew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F/3xGWUwSSLI5yvDRcxvTWnoQRrkSl9b0fOqNKLsC4o=; b=X7/8oyK5o4OvN3KVnqctIbC5eZ+cNczsAvbq0pSW4AKQkAnRrBJx0ngbD1pyn8wUjpc+ygCWjDqDkSoAe9x0mQn6NEPzNnnJnUFtQFYpzlTH/xd5gxc1g4rj0wVPZrPVLFKuDvmeGtt/kVrLx1S/v5qOdfMvMwjzPvVf+etwKJI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5151.eurprd04.prod.outlook.com (2603:10a6:803:61::28) by VI1PR0401MB2430.eurprd04.prod.outlook.com (2603:10a6:800:2b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Mon, 1 Nov 2021 08:00:51 +0000 Received: from VI1PR04MB5151.eurprd04.prod.outlook.com ([fe80::85af:f8be:aa99:ba5f]) by VI1PR04MB5151.eurprd04.prod.outlook.com ([fe80::85af:f8be:aa99:ba5f%3]) with mapi id 15.20.4649.019; Mon, 1 Nov 2021 08:00:51 +0000 From: Daniel Baluta To: broonie@kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 3/6] ASoC: SOF: topology: Add support for Mediatek AFE DAI Date: Mon, 1 Nov 2021 10:00:23 +0200 Message-Id: <20211101080026.297360-4-daniel.baluta@oss.nxp.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211101080026.297360-1-daniel.baluta@oss.nxp.com> References: <20211101080026.297360-1-daniel.baluta@oss.nxp.com> X-ClientProxiedBy: AM3PR07CA0070.eurprd07.prod.outlook.com (2603:10a6:207:4::28) To VI1PR04MB5151.eurprd04.prod.outlook.com (2603:10a6:803:61::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2a02:2f08:5719:1500:cdb2:376b:257c:429a) by AM3PR07CA0070.eurprd07.prod.outlook.com (2603:10a6:207:4::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.9 via Frontend Transport; Mon, 1 Nov 2021 08:00:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3a3925e6-9b90-44b9-d058-08d99d0db901 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2430: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:608; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c7kgBUQJzIdYrbtdk//+16HYBYX5h6YyQsydMZejR0UVjY+xVQsuex2IiAHrDGTmelImFJlHD6DLMOqs2C8xYkCof2SUuv3qRND80zYCuQgnI1o0ZB0pA0PXTSD2mJprFt0R+XYWAwyRhb7uD5uWpBE9ucIbp0ChyddWFnz3A6QEL16GoXQ8ibk686qUjWmAKDvrkr3TpHvQvHlYXbjQ7wq8JPfWSiehK8PcrSv6uDkHmDOMLWf/KdS9RXBBXY+YF/vIdK9J38MjYJSbRLX339vGf/sOtC6egNzPXq4gFTHJlk+LLDmXQvPUYyU3sqxmMgPM2RbEZ8Z9i7j2Ti+Xnw+in8JV22TpP4HrD58OvSdQjvd7YpbweeHAEKLn1KI+ONz4ez0rMmNo2YcWuDizICFUTB2mgdJG7AZheHmsMMmqeQEfNMYqeStAFhWV1AX73KYTTTnhsOE78xAfINT34o8o1ZuZ1WdErIosWEU7DTN9pzYZpCW+I1Q7SmgQlznpjKqpSuDYnN+Hbi++3DGp0g9md+I1VKoGcidPZkKg4vjKXVDQtcYmp5nxOM77RV9zuWDrEhKwNNFP3D2dcfNn54GHWFXtDGyM1kJNz9D5yX6iCLMj5Jzfp3GeC/phBaNBcrU/dBMst/KGom52otrLIg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5151.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(316002)(8676002)(508600001)(54906003)(6486002)(8936002)(6506007)(1076003)(5660300002)(52116002)(6666004)(44832011)(6512007)(66476007)(2906002)(7416002)(2616005)(66946007)(38100700002)(186003)(86362001)(66556008)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?0C6yzBAiIWGDbT2juqa50qEA2mDM?= =?utf-8?q?FEzgK0IOHaOC0rExxI7KNlZO0zi1a/pMsMLnbbsv2/JWUCWqRBSDVLdB8rqQ69Y9G?= =?utf-8?q?bXLjnyqEkcUcBXHwE7hX/aCkgUSUehfPfeyduq0fAYQEQEM7ckbi4WX/SSh7wnujx?= =?utf-8?q?zjYnjpG4v5ndz7FGXvAhVq9aONv0IV5t5BFFYf0z3hDQ+XiJHphwcRKehZTBp1OcL?= =?utf-8?q?y4iQhqLaq5cmgxmuusUhTXixsCmWyGHXwaheMcMgttfNE/768HgE1wiyn1GMSWmRB?= =?utf-8?q?LOOhznRJvahHCyAR0tAUztKgmH2jSqNTf8doRjVD1YDz2LQpRz/mvMxVsZ7J1RqvF?= =?utf-8?q?Kwvafz5dlAbWuOsXGW8vBR6itRA00ky6pZYP/XOu4tuDzeBD8YAWGmcaeOt9P6gTJ?= =?utf-8?q?av0MS8dMCGRovHh6KGzDDZfT909xsR/eFysW1KN5jCMesyQVh/Yyyt+vex08UEkm6?= =?utf-8?q?MiHdILbrt0RndiTTde8rU/N/dix0Z/J2QuGSsPTbcfIsv0F/uSNk9C2Fg553eeiic?= =?utf-8?q?MOtOCpNGA+wntVOu2kj0uo6Z9RtXRX37iYmZCDI8R0zEfPcuoFcRe43w1AfsiyVt+?= =?utf-8?q?MB9Bl9XDOWXEqUq4VfhgJ9t4LOTyxSXiwt3QTS80i6iWayUJO9sPxIK71ah0lLIo9?= =?utf-8?q?6mUoU7VwKSm5C6tvYbwzr3DtGXhKnLTMgDY2pbWQQdSS1jNzw31faOVgOXmL+G1ef?= =?utf-8?q?ttl8cUKbuh761Gu24Ia1YCFimvfQJWdoG0uBi5nlk6KOXBlWN/YBxxGfj8dW00Dkz?= =?utf-8?q?DYZtPKhm7S6OlivoF/QcJl9brL0YKELF10Ou4F0TIXvo2rAVShNaSsAtGbis97ZjB?= =?utf-8?q?/7U3dnbYnlsX2PWRjwboz+uagqQ+aybIbS7NP/e8eFfm5zlYc84MjGMVFi7FWEPjY?= =?utf-8?q?RsPnlWYNYohdsfznkjdhfYYXVzktp+99o90WC5TACI2Z8eobImCGzwmafSPBSGhLx?= =?utf-8?q?2GNUENHumX487jttPdyzN6ixVKImlWkxx1Xb9ItylYSWyglKGGd41/rgPodu4V8VF?= =?utf-8?q?rFq/anEv3SZpnu7x9UAKF+9thPphdAlIwd4CU67ViQnFzLcdzZ+2q8s3QhJkKfysU?= =?utf-8?q?2nu5Kc5l+LDDWToZkkk5MJ8gmjgB+VeO525AnBWXkj9Jgtwr4Q5/qQPYAfjifW6UY?= =?utf-8?q?/XhpYZFWe9gjOoQAjvEX3nwAVBzI3dcg5GjOogA18P5Qi6We/ZJ090O7sipJKOksq?= =?utf-8?q?hsYWBU8EJatbW2qjFMrq+P8YKoGcMwY7CDlbaoKQVxVvWFeg43yMk4XiWx70n0geb?= =?utf-8?q?3jddB4Tc3oiPTC8nCYnMb7an+SRvtkQmpslqTVsrXS96tJx5LACb1ifOXhoS4pARv?= =?utf-8?q?trLPS9ageiXXjJwYg9LkreJGTDEJPcqzbnKyiZgjHXSKw4qjpdYySnYVd8bVTELrK?= =?utf-8?q?VjBGp064AeZIulQ7AYq/7wA7J+5T1FNYQAO8f59kQmucd1VyzZwNvXX8Zw7LnEBhu?= =?utf-8?q?pA/4knA67oU7++1RVyhEd1pN/2QuCmaLuYlAq9qkiHr37d+fy29IklzQ5Yuz3pU78?= =?utf-8?q?1fprl2Aqv7CpasUEHOgIh7kZgIS3icHhdyigEy1fEpOh7U9At0uYsywXzMQSrB4NX?= =?utf-8?q?n13SUt4BsVtecxQW7g2GlrJ5uJrvFkkkBOsc7ZcS+XI4N9l04yJoDxk1/q5zieZMU?= =?utf-8?q?1igXnuyY6J?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a3925e6-9b90-44b9-d058-08d99d0db901 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5151.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2021 08:00:51.4964 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: j9uQ3BhtHT6RXS6CO8rgbLIRvMtKjBwPbEPHXxujxvvsAR2La/mvrC6d9VGM0FeapHyaSUE2gcyNeOY8R6MrEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2430 Cc: guennadi.liakhovetski@linux.intel.com, daniel.baluta@gmail.com, kai.vehmanen@linux.intel.com, Daniel Baluta , ranjani.sridharan@linux.intel.com, lgirdwood@gmail.com, linux-mediatek@lists.infradead.org, YC Hung , pierre-louis.bossart@linux.intel.com, peter.ujfalusi@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: YC Hung Add new sof dai and config to pass topology file configuration to SOF firmware running on Mediatek platform DSP core. Add mediatek audio front end(AFE) to the list of supported sof_dais Signed-off-by: YC Hung Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Signed-off-by: Daniel Baluta --- include/sound/sof/dai-mediatek.h | 23 +++++++++++++ include/sound/sof/dai.h | 3 ++ sound/soc/sof/pcm.c | 12 +++++++ sound/soc/sof/topology.c | 59 ++++++++++++++++++++++++++++++++ 4 files changed, 97 insertions(+) create mode 100644 include/sound/sof/dai-mediatek.h diff --git a/include/sound/sof/dai-mediatek.h b/include/sound/sof/dai-mediatek.h new file mode 100644 index 000000000000..62dd4720558d --- /dev/null +++ b/include/sound/sof/dai-mediatek.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ +/* + * Copyright(c) 2021 Mediatek Corporation. All rights reserved. + * + * Author: Bo Pan + */ + +#ifndef __INCLUDE_SOUND_SOF_DAI_MEDIATEK_H__ +#define __INCLUDE_SOUND_SOF_DAI_MEDIATEK_H__ + +#include + +struct sof_ipc_dai_mtk_afe_params { + struct sof_ipc_hdr hdr; + u32 channels; + u32 rate; + u32 format; + u32 stream_id; + u32 reserved[4]; /* reserve for future */ +} __packed; + +#endif + diff --git a/include/sound/sof/dai.h b/include/sound/sof/dai.h index 3782127a7095..5132bc60f54b 100644 --- a/include/sound/sof/dai.h +++ b/include/sound/sof/dai.h @@ -13,6 +13,7 @@ #include #include #include +#include /* * DAI Configuration. @@ -70,6 +71,7 @@ enum sof_ipc_dai_type { SOF_DAI_AMD_BT, /**< AMD ACP BT*/ SOF_DAI_AMD_SP, /**< AMD ACP SP */ SOF_DAI_AMD_DMIC, /**< AMD ACP DMIC */ + SOF_DAI_MEDIATEK_AFE, /**< Mediatek AFE */ }; /* general purpose DAI configuration */ @@ -97,6 +99,7 @@ struct sof_ipc_dai_config { struct sof_ipc_dai_acp_params acpbt; struct sof_ipc_dai_acp_params acpsp; struct sof_ipc_dai_acp_params acpdmic; + struct sof_ipc_dai_mtk_afe_params afe; }; } __packed; diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c index e40c2212a999..1bf7e60be772 100644 --- a/sound/soc/sof/pcm.c +++ b/sound/soc/sof/pcm.c @@ -807,6 +807,18 @@ int sof_pcm_dai_link_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_pa channels->min = dai->dai_config->esai.tdm_slots; channels->max = dai->dai_config->esai.tdm_slots; + dev_dbg(component->dev, + "rate_min: %d rate_max: %d\n", rate->min, rate->max); + dev_dbg(component->dev, + "channels_min: %d channels_max: %d\n", + channels->min, channels->max); + break; + case SOF_DAI_MEDIATEK_AFE: + rate->min = dai->dai_config->afe.rate; + rate->max = dai->dai_config->afe.rate; + channels->min = dai->dai_config->afe.channels; + channels->max = dai->dai_config->afe.channels; + dev_dbg(component->dev, "rate_min: %d rate_max: %d\n", rate->min, rate->max); dev_dbg(component->dev, diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index 2f2aa63943b2..b3ad3a604918 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -379,6 +379,7 @@ static const struct sof_dai_types sof_dais[] = { {"ACP", SOF_DAI_AMD_BT}, {"ACPSP", SOF_DAI_AMD_SP}, {"ACPDMIC", SOF_DAI_AMD_DMIC}, + {"AFE", SOF_DAI_MEDIATEK_AFE}, }; static enum sof_ipc_dai_type find_dai(const char *name) @@ -806,6 +807,19 @@ static const struct sof_topology_token led_tokens[] = { get_token_u32, offsetof(struct snd_sof_led_control, direction), 0}, }; +/* AFE */ +static const struct sof_topology_token afe_tokens[] = { + {SOF_TKN_MEDIATEK_AFE_RATE, + SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, + offsetof(struct sof_ipc_dai_mtk_afe_params, rate), 0}, + {SOF_TKN_MEDIATEK_AFE_CH, + SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, + offsetof(struct sof_ipc_dai_mtk_afe_params, channels), 0}, + {SOF_TKN_MEDIATEK_AFE_FORMAT, + SND_SOC_TPLG_TUPLE_TYPE_STRING, get_token_comp_format, + offsetof(struct sof_ipc_dai_mtk_afe_params, format), 0}, +}; + static int sof_parse_uuid_tokens(struct snd_soc_component *scomp, void *object, const struct sof_topology_token *tokens, @@ -2991,6 +3005,48 @@ static int sof_link_acp_sp_load(struct snd_soc_component *scomp, int index, return ret; } +static int sof_link_afe_load(struct snd_soc_component *scomp, int index, + struct snd_soc_dai_link *link, + struct snd_soc_tplg_link_config *cfg, + struct snd_soc_tplg_hw_config *hw_config, + struct sof_ipc_dai_config *config) +{ + struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp); + struct snd_soc_tplg_private *private = &cfg->priv; + struct snd_soc_dai *dai; + u32 size = sizeof(*config); + int ret; + + config->hdr.size = size; + + /* get any bespoke DAI tokens */ + ret = sof_parse_tokens(scomp, &config->afe, afe_tokens, + ARRAY_SIZE(afe_tokens), private->array, + le32_to_cpu(private->size)); + if (ret != 0) { + dev_err(scomp->dev, "parse afe tokens failed %d\n", + le32_to_cpu(private->size)); + return ret; + } + + dev_dbg(scomp->dev, "AFE config rate %d channels %d format:%d\n", + config->afe.rate, config->afe.channels, config->afe.format); + + dai = snd_soc_find_dai(link->cpus); + if (!dai) { + dev_err(scomp->dev, "%s: failed to find dai %s", __func__, link->cpus->dai_name); + return -EINVAL; + } + + config->afe.stream_id = DMA_CHAN_INVALID; + + ret = sof_set_dai_config(sdev, size, link, config); + if (ret < 0) + dev_err(scomp->dev, "failed to process afe dai link %s", link->name); + + return ret; +} + static int sof_link_dmic_load(struct snd_soc_component *scomp, int index, struct snd_soc_dai_link *link, struct snd_soc_tplg_link_config *cfg, @@ -3286,6 +3342,9 @@ static int sof_link_load(struct snd_soc_component *scomp, int index, ret = sof_link_acp_dmic_load(scomp, index, link, cfg, hw_config + curr_conf, config); break; + case SOF_DAI_MEDIATEK_AFE: + ret = sof_link_afe_load(scomp, index, link, cfg, hw_config + curr_conf, config); + break; default: dev_err(scomp->dev, "error: invalid DAI type %d\n", common_config.type); ret = -EINVAL; From patchwork Mon Nov 1 08:00:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Daniel Baluta (OSS)" X-Patchwork-Id: 12596047 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06D08C433F5 for ; Mon, 1 Nov 2021 08:03:54 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 850B960EB9 for ; Mon, 1 Nov 2021 08:03:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 850B960EB9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id ED63516CC; Mon, 1 Nov 2021 09:03:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz ED63516CC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635753832; bh=sYM+AQ2VI90tlRMyWDAGtQm/3ejy9/P9gDykux3i5Ys=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=O2jlHpCqgAQn+5R8Fsr3GxfE9rPBGyMvcwZ0yiUm+YcPXtHXT/LXrlfQ273lyGALk qyaAugFxcB+F2LDdHKZDz4ZRG7mYCG4dtX7llK09hCBStJFAuunDQX3Ksyc1PjsFdX So/RDi6N/uhsK16mLIOoBRVMOFYoV9ZnIb/kkLSo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 57CE9F80515; Mon, 1 Nov 2021 09:01:33 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C968BF8010A; Mon, 1 Nov 2021 09:01:16 +0100 (CET) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-ve1eur03on061b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe09::61b]) (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 2D6D9F80269 for ; Mon, 1 Nov 2021 09:01:02 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2D6D9F80269 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="UyUS4FDK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QT1qf1haEsgiGtUxS9M7WGmDBOF5fot4GivfYsCj4xu9Z4tOuca/uJfrEGVvVBe8Knc7C/R3UF9xeAlC/FoRo88KiVC0r550zhquBHfw4Q0eQDJqEePPSxp1cBStk4zv+ghCZhavOLzl9wMabyCSrC+DmclihN9WPGUerw+q4n9lip2YUPtxuXjvlxQCJqGqzxRgPvNc1C6sLeZTY67+eC/t3CIxU+mRIAuZgDtksL3f3HwlUUNMpoFowCx+XDky0a5WynFut2LQGi0agxRlDTmjJ5CG4S71/RLOIn6in3OCvetF4fbu3hPmq1Pn/M4joUINzESjEWER+h9+ErlAlw== 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=F1LywNPRrl9Cu1ZbF82MTzYSGrbHurHEZM0KMMfh3iM=; b=CHGdotp6UcLU1ksq5WcHcMyK19fjKuOzS5MnM4WRdfIvR0JcA9m7MIVYAdjHo72ayHeGxtAKl/mCXJqbnY4LDDtOHCzZaHgIxEpfYU/A8HPCLYokV2o+lqLLWH//ZdKWq0OIfhvyV+7SvIBLl/Tj1kppdwiX5uzfmZddqeqchAoyQqmNGOdOlMdjpHV/G2UxDjl4i8rzBS/91zLg+R5esGC2aqj3wjK4H1dmJxY5PkSG5o+1wvqcDXsfLmASusARcPvv4C/79qTfzqZlqdFkIEeWlgw+0RMO2UAzZyT5VTsaDtsPc+1UBHax8rWlqszcP6JA1p/TWq5Q/eiok1a/Lw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F1LywNPRrl9Cu1ZbF82MTzYSGrbHurHEZM0KMMfh3iM=; b=UyUS4FDKPmGykZGEGfmsrcWMaOZl7/uywMzSYVqUZ5YPpQdE3heWMCWUXeTiX7m/LklBv5CZNjHc27YMjPGpoBQWZuAw4+zKLTk5UeHbQBfHhKMfYHA9hEnnetTeL8jI943VOO6Ebcp1VdvQr96K6W43vYHElM8BiBwVw6Xy/O4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5151.eurprd04.prod.outlook.com (2603:10a6:803:61::28) by VI1PR0401MB2430.eurprd04.prod.outlook.com (2603:10a6:800:2b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Mon, 1 Nov 2021 08:00:53 +0000 Received: from VI1PR04MB5151.eurprd04.prod.outlook.com ([fe80::85af:f8be:aa99:ba5f]) by VI1PR04MB5151.eurprd04.prod.outlook.com ([fe80::85af:f8be:aa99:ba5f%3]) with mapi id 15.20.4649.019; Mon, 1 Nov 2021 08:00:53 +0000 From: Daniel Baluta To: broonie@kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 4/6] ASoC: SOF: mediatek: Add fw loader and mt8195 dsp ops to load firmware Date: Mon, 1 Nov 2021 10:00:24 +0200 Message-Id: <20211101080026.297360-5-daniel.baluta@oss.nxp.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211101080026.297360-1-daniel.baluta@oss.nxp.com> References: <20211101080026.297360-1-daniel.baluta@oss.nxp.com> X-ClientProxiedBy: AM3PR07CA0070.eurprd07.prod.outlook.com (2603:10a6:207:4::28) To VI1PR04MB5151.eurprd04.prod.outlook.com (2603:10a6:803:61::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2a02:2f08:5719:1500:cdb2:376b:257c:429a) by AM3PR07CA0070.eurprd07.prod.outlook.com (2603:10a6:207:4::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.9 via Frontend Transport; Mon, 1 Nov 2021 08:00:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b3df016d-f463-4392-e28f-08d99d0db9ed X-MS-TrafficTypeDiagnostic: VI1PR0401MB2430: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1332; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r9ke5Ptk5URX2ffJhAbv3FyoXA1BrUNXyUe8tUuS/P6u1Bri1cVGMvjB1pedLfW62ZnPiCEpHIsT6qObRJ6qVyY9K87kUsA0/fZSwwBn5UBRjaEDkETgbSx3bV5Ql/KFuvBqA+TV7xiJTOb7tLoqd3lMT+8XYTWkqUbnckC7LcKrxGzGZnf2doHjoUnv9YjJj/gQ2JaCzXbIJEad2379zR1OXZHdj38cS7gB7iEnLrLeElCAw1y4u+eSDmPoB2vE6y7Ngbyq7TQYOz2q5HSNiMBlO8Fuv/i1HoF3XRqNpFM2YOofzbn4ibFGVpKk8ke+BEaq/J/W6K1cSSLJ8xmI9ecIZ59zT0FeAvtLuXBfb6/e24rU3mMWPRlyX4atVwfqFjKkF++aYdbsonA56jNTmbvU29U2n7j9jY5XFE7ZvrdJ6GY4Gzy4oly+M6Xxme4+k4bq5lJ0+pzikVp1JTczhDD5bieFX90SnV+iYPAuFnaJFsg7a2oYZDatFTH/zSRpgN3tb/sgX7rNCnieLJuClKeLY3YWa8NfZIqhWkrBUvCoHN7py6JagexboXJkJgL46+7e2TY2VcFpXgbyRKb+ftJwuyv/lcW0Imoo9uoLYVKDHXMGjjKlHZ45kf3LilH1KKvaQhqhlbcvzn42aBLa8w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5151.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(316002)(8676002)(508600001)(54906003)(6486002)(8936002)(6506007)(1076003)(5660300002)(66574015)(83380400001)(52116002)(6666004)(44832011)(6512007)(66476007)(2906002)(7416002)(2616005)(66946007)(38100700002)(186003)(86362001)(66556008)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?/+KfD5EMNO872rMmAxXtI4jOjBQ9?= =?utf-8?q?CN778MliaNCxONi3RiE8CmCAfVrn8oZAbjZVJo79cbQCLQkWIQTk/kUaDsHa+3ZQX?= =?utf-8?q?sp4B7201omdcCXkaIISXtLbHj4YgHY3N+KDWE3KgDE1Gcc+W1/AMLnJRiv3uoI+Ue?= =?utf-8?q?+ZhhzTe8ny4z7hymMJdlxm2Mzja+i+uj/qJPVrnr+IU2qN8a9gcKizpldggLrNiWg?= =?utf-8?q?VGHtNELBpUF//fsb690fNSCVXcA/Enjh7CliuwE2xa7yymmbdaoRiKDMqJyCqQZF0?= =?utf-8?q?MdzoBBhwHAp6tMXdQj6TrUecoJJCOWZHHbqe3eHcpRj6JsrVuQsxcWkmvEl4grh6w?= =?utf-8?q?2dcMLONP6vMQ4YOCwuNLlLLYpVs1d02Jzu9EIPgUegjKunBQkb1cJ+H7EBowzC7aT?= =?utf-8?q?+9e31Q702bbXsPu47bNipvknKqJ/ULPgpnCVZ/e1S8iVhRpmKTJjSRaOGXKs3Al66?= =?utf-8?q?P7oBPC5fY/zd3qZp3FUaP9oj+8yY2RPkM9lnlQKi1+/urA/aGRAXf9HdHbzXsOzfq?= =?utf-8?q?i5Qx/2MrHa4dLBuSOYfV33hqmoBQ8j8Z4vUzZELZQO9EQGCrTp71dVBMrka/M8CLe?= =?utf-8?q?He8sYVQZS7Z5G/LbsLtUPRbeMo0INZuBz+/fwqtpNwIpl7PqVhP076fa1xjT+BGcp?= =?utf-8?q?FEkz6K/s48hDJzcxhbPF8JYSVQkWdT7MZb8vouxkEuSYRwRuLK1QKWtPNuRUHhSp/?= =?utf-8?q?xICDuMUO1aZyO8rD7pdNc127cvkN40STYucn22YniJl7QbJCKUmf1VSya+bfpursM?= =?utf-8?q?Hjcu68UuReSEf4m1Q5IQNyLPG7jX6JeTGon3Th7izDMr7qkFAfF+2FiKPRu98+fB/?= =?utf-8?q?IH6qwnsLS37pZcwqRFZ3hAK0T+ECpHZl1lA8rFgjLGCngN/lXIF3mUYHNPCjS+6+Q?= =?utf-8?q?9YGqDPcmgmPf1vc1dZmlA0dKPOxj2deRTB9LWOnHPot9uNoUJEOyXQKr0t9Efwbaa?= =?utf-8?q?+klN9imGZF6F5Fsgmb7RrLtf/erT/NOeguRqKL+nsAZLMYai+rGTkFtVQWu50T/jM?= =?utf-8?q?hWbJEVTA7cHp8C9E3omxF7D+sq0mAkReOLxyvjYe5ZP72iFgFPosfcxdTCmRGSL0c?= =?utf-8?q?oqT1Lu+TOkK+Sqd18HZbca3cY/aQ/QlIyZeO1UAkBKSsEItB6wqA1M/A/cf/nHHkJ?= =?utf-8?q?AJOr3uFp3/4EBI+mYA6r9+I3j9X1hEpCD/cU75yNVqikje3RpJQIgQFiF/6QX0jZM?= =?utf-8?q?DLF9e1IQHRMClcXz8TPlmJAwVp6iSOjhHGJsnA98NzgljnqcHMd+Hjuh6VMYScFZ6?= =?utf-8?q?EnbZMeWExU9PaX4T74DL2A8XoqXD7FUqH8J343qjg97uRdBzs6vdVNyEBHPyHr7UA?= =?utf-8?q?OB9REWzgkcCZ/jyphxCiBsUqfVMtux0a4jAFdx7NDFC5L3AzBiMDfF9byh+5sMXm/?= =?utf-8?q?xTxsJ5E04DkwOEpkt/L96Sx1T6wvJ8EkmGjEwag9uA3AA6PWEc4xUtq+H314WbLnQ?= =?utf-8?q?qw0tQ90apY7Qoc+hSd5DDNAoWMOEtBgEJ540ctic19u+psdANJzeQsqyJ8oYuypyG?= =?utf-8?q?LuIjg0aJUQDEE/gCg41AkhQ1UZvmiQgnRLpII9nhU/HmmgDb7SnDTF/11YGYX3iU4?= =?utf-8?q?5tjM6MyjDJ684pUPkWnIy4BuWErLufBXodnAgbbeJjLQQ7tZUVZUtb08Nxbeip03G?= =?utf-8?q?KfIwk3VNOJ?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3df016d-f463-4392-e28f-08d99d0db9ed X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5151.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2021 08:00:53.0735 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mZFXN04+v44lk3ZhJfuC1bmu7viMCNOTaBQfcsaS1bB8ZFAdpO8owhix30AHAUF/y8EimdVkarS+uGcYPGkUoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2430 Cc: guennadi.liakhovetski@linux.intel.com, daniel.baluta@gmail.com, kai.vehmanen@linux.intel.com, Daniel Baluta , ranjani.sridharan@linux.intel.com, lgirdwood@gmail.com, linux-mediatek@lists.infradead.org, YC Hung , pierre-louis.bossart@linux.intel.com, peter.ujfalusi@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: YC Hung Add mt8195-loader module with ops callback to load and run firmware on mt8195 platform. Signed-off-by: YC Hung Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Signed-off-by: Daniel Baluta --- sound/soc/sof/mediatek/mt8195/Makefile | 2 +- sound/soc/sof/mediatek/mt8195/mt8195-loader.c | 56 +++++++++++++++++++ sound/soc/sof/mediatek/mt8195/mt8195.c | 8 +++ sound/soc/sof/mediatek/mt8195/mt8195.h | 3 + 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 sound/soc/sof/mediatek/mt8195/mt8195-loader.c diff --git a/sound/soc/sof/mediatek/mt8195/Makefile b/sound/soc/sof/mediatek/mt8195/Makefile index bf23d88db828..60fca24c068a 100644 --- a/sound/soc/sof/mediatek/mt8195/Makefile +++ b/sound/soc/sof/mediatek/mt8195/Makefile @@ -1,4 +1,4 @@ # SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) -snd-sof-mt8195-objs := mt8195.o +snd-sof-mt8195-objs := mt8195.o mt8195-loader.o obj-$(CONFIG_SND_SOC_SOF_MT8195) += snd-sof-mt8195.o diff --git a/sound/soc/sof/mediatek/mt8195/mt8195-loader.c b/sound/soc/sof/mediatek/mt8195/mt8195-loader.c new file mode 100644 index 000000000000..ed18d6379e92 --- /dev/null +++ b/sound/soc/sof/mediatek/mt8195/mt8195-loader.c @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) +// +// Copyright (c) 2021 Mediatek Corporation. All rights reserved. +// +// Author: YC Hung +// +// Hardware interface for mt8195 DSP code loader + +#include +#include "mt8195.h" +#include "../../ops.h" + +void sof_hifixdsp_boot_sequence(struct snd_sof_dev *sdev, u32 boot_addr) +{ + /* ADSP bootup base */ + snd_sof_dsp_write(sdev, DSP_REG_BAR, DSP_ALTRESETVEC, boot_addr); + + /* pull high RunStall (set bit3 to 1) */ + snd_sof_dsp_update_bits(sdev, DSP_REG_BAR, DSP_RESET_SW, + ADSP_RUNSTALL, ADSP_RUNSTALL); + + /* pull high StatVectorSel to use AltResetVec (set bit4 to 1) */ + snd_sof_dsp_update_bits(sdev, DSP_REG_BAR, DSP_RESET_SW, + DSP_RESET_SW, DSP_RESET_SW); + + /* toggle DReset & BReset */ + /* pull high DReset & BReset */ + snd_sof_dsp_update_bits(sdev, DSP_REG_BAR, DSP_RESET_SW, + ADSP_BRESET_SW | ADSP_DRESET_SW, + ADSP_BRESET_SW | ADSP_DRESET_SW); + + /* pull low DReset & BReset */ + snd_sof_dsp_update_bits(sdev, DSP_REG_BAR, DSP_RESET_SW, + ADSP_BRESET_SW | ADSP_DRESET_SW, + 0); + + /* Enable PDebug */ + snd_sof_dsp_update_bits(sdev, DSP_REG_BAR, DSP_PDEBUGBUS0, + PDEBUG_ENABLE, + PDEBUG_ENABLE); + + /* release RunStall (set bit3 to 0) */ + snd_sof_dsp_update_bits(sdev, DSP_REG_BAR, DSP_RESET_SW, + ADSP_RUNSTALL, 0); +} + +void sof_hifixdsp_shutdown(struct snd_sof_dev *sdev) +{ + /* Clear to 0 firstly */ + snd_sof_dsp_write(sdev, DSP_REG_BAR, DSP_RESET_SW, 0x0); + + /* RUN_STALL pull high again to reset */ + snd_sof_dsp_update_bits(sdev, DSP_REG_BAR, DSP_RESET_SW, + ADSP_RUNSTALL, ADSP_RUNSTALL); +} + diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c index 945601a0dc37..88da6c2de070 100644 --- a/sound/soc/sof/mediatek/mt8195/mt8195.c +++ b/sound/soc/sof/mediatek/mt8195/mt8195.c @@ -305,6 +305,9 @@ const struct snd_sof_dsp_ops sof_mt8195_ops = { .probe = mt8195_dsp_probe, .remove = mt8195_dsp_remove, + /* DSP core boot */ + .run = mt8195_run, + /* Block IO */ .block_read = sof_block_read, .block_write = sof_block_write, @@ -318,6 +321,11 @@ const struct snd_sof_dsp_ops sof_mt8195_ops = { /* misc */ .get_bar_index = mt8195_get_bar_index, + /* module loading */ + .load_module = snd_sof_parse_module_memcpy, + /* firmware loading */ + .load_firmware = snd_sof_load_firmware_memcpy, + /* Firmware ops */ .dsp_arch_ops = &sof_xtensa_arch_ops, diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.h b/sound/soc/sof/mediatek/mt8195/mt8195.h index 48cbbb5aacb5..929424182357 100644 --- a/sound/soc/sof/mediatek/mt8195/mt8195.h +++ b/sound/soc/sof/mediatek/mt8195/mt8195.h @@ -10,6 +10,7 @@ #define __MT8195_H struct mtk_adsp_chip_info; +struct snd_sof_dev; #define DSP_REG_BASE 0x10803000 #define SCP_CFGREG_BASE 0x10724000 @@ -152,4 +153,6 @@ struct mtk_adsp_chip_info; #define DRAM_REMAP_SHIFT 12 #define DRAM_REMAP_MASK (BIT(DRAM_REMAP_SHIFT) - 1) +void sof_hifixdsp_boot_sequence(struct snd_sof_dev *sdev, u32 boot_addr); +void sof_hifixdsp_shutdown(struct snd_sof_dev *sdev); #endif From patchwork Mon Nov 1 08:00:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Daniel Baluta (OSS)" X-Patchwork-Id: 12596045 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03CC2C433EF for ; Mon, 1 Nov 2021 08:03:39 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 564A560EB9 for ; Mon, 1 Nov 2021 08:03:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 564A560EB9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9B41C16C5; Mon, 1 Nov 2021 09:02:46 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9B41C16C5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635753816; bh=OJpGgYRNIncpF2GwbiQ/mq6gk1bqLz+54+/80XqZOhQ=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=rKleCJNDX4XH7pyN/fUbnh/4A6cVbpQhpcO/2evUEGRKbFid62SP+/Ndo3uTmhZ6x gElYYqKfWwRiEq6vyCa50Z8PqqzC9gyI8v4HnXfA63GVHql297EmPMFj/xt++//gWT 5pTBE0ejTLt6tsho42f5C287NygkDucD6XsRHZUc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E4552F80508; Mon, 1 Nov 2021 09:01:28 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A5B7CF804F2; Mon, 1 Nov 2021 09:01:16 +0100 (CET) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-ve1eur03on061b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe09::61b]) (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 EAF95F804B1 for ; Mon, 1 Nov 2021 09:01:03 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EAF95F804B1 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="bAL+m+UJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cE14NhI/usy5G6AB7Gzcj+w526+2mptmyLU8KSSetRUnAK+SgjeQur13Ue1nBTW3uRJL+bkdAtzi6vokFTHhalaNtt8SQ77Mq8CfXqBgNjoZ/+yGwir0uUzjpS00uus4rq4L6qychM2rILWehZhcU9mwMoxw201IC8V5m/iQVBYgQfp3pM+5KBMSSOn8ytD/PnhmPW6pBYgNd3qbv41OzIxzqSD1n8chHddCoxoQDIJo7Thn6a344UBCP//pqAPR0LC27gYkZvh+y2xKxebJzXfeuNsrlUaRXugm312cug3i8NfXc9u41P0eCwvvBrdFsScHFS5RYsu9gVjNZb249g== 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=cG8P/WfZcRAHN57UVOx+Wd+RrVgZpkhz13HcXc8Xm+8=; b=UvKUdJZl/htNWK9Mey3KudOjtV9peAage9DtcwUN+/X9StH+Bw9HwZDwSBtij5BI/lKMfdOjksuIgINBROvoC7GlePDZIGia6Q24KmtxSwVCLet6mj8wdx/ioYBSqheHt0pnCjbF0MN6UKGMuLKML5zSfGhNIpodZXUVPiMCPcMd/jFP4CA0q26Mgj+qdLrgy2QL5bw6sOczpG7EvgnUNQEQyP1qeoQIzGPdqlXxuAFC+ur9QI2NAf7sScJWPFH3DPyoZ12YMWhPqsRS8PZwkTenL/vk4XjDRUEn8+1izUfecM3vINwk8rIk4dkHF77tNQRkXVrjevlGxF6Xq0UIPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cG8P/WfZcRAHN57UVOx+Wd+RrVgZpkhz13HcXc8Xm+8=; b=bAL+m+UJvKI2Ew3oC435IQ/VBbtZ/7ap+7IRK+QpcQyVcDJoTT+iZYYFMNTnCfduRyGENCln0fp+3sAyrExjzN+DwxjgPVkwIjRC27Bs67Jek0BetpZ8GzynKgwjRvtbSrWWnz6T7ssBmqUSJS11zy1WbY3GP4xeHSWStTPM7eg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5151.eurprd04.prod.outlook.com (2603:10a6:803:61::28) by VI1PR0401MB2430.eurprd04.prod.outlook.com (2603:10a6:800:2b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Mon, 1 Nov 2021 08:00:54 +0000 Received: from VI1PR04MB5151.eurprd04.prod.outlook.com ([fe80::85af:f8be:aa99:ba5f]) by VI1PR04MB5151.eurprd04.prod.outlook.com ([fe80::85af:f8be:aa99:ba5f%3]) with mapi id 15.20.4649.019; Mon, 1 Nov 2021 08:00:54 +0000 From: Daniel Baluta To: broonie@kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 5/6] ASoC: SOF: Add mt8195 device descriptor Date: Mon, 1 Nov 2021 10:00:25 +0200 Message-Id: <20211101080026.297360-6-daniel.baluta@oss.nxp.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211101080026.297360-1-daniel.baluta@oss.nxp.com> References: <20211101080026.297360-1-daniel.baluta@oss.nxp.com> X-ClientProxiedBy: AM3PR07CA0070.eurprd07.prod.outlook.com (2603:10a6:207:4::28) To VI1PR04MB5151.eurprd04.prod.outlook.com (2603:10a6:803:61::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2a02:2f08:5719:1500:cdb2:376b:257c:429a) by AM3PR07CA0070.eurprd07.prod.outlook.com (2603:10a6:207:4::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.9 via Frontend Transport; Mon, 1 Nov 2021 08:00:53 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1e7550ad-8ac4-4874-9e6b-08d99d0dbad4 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2430: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1201; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OT1v0NMNEVyYjCX3MI+b26GYWR40vFqDNFZPfHZxcfXUzZxDVf//lAVB5hdC51RU6aF1jxwsziS6LBoSGG8efRy9KDF012lFIOlb5eXU1DfwqGx620+kXYCjHvoC4HLFmRWBSoDxvjaHdpbz96TWqGAxKdUTz/Lx7z6x+XJZJzWN+JH+L4edU01DG3A0fyEDB8a/3dOmbBXTk1tpHoD4Q4m2uUDtfKmi8G+AvX6hUUDxvCf6JkdN+atZj0uB5SZsHJwCSrlGuk+59J95cQnUQsA3d+eUm5JdroDzvWoIC0emefvEvsvW6I+HfajOkEfWmiVWiFj7lQsb/fkVAWhXk6mHRuHnBfb4CF6jRzeYToQruFVo3x5kGhDFt1gX5Xm6MRZ68dpl7Bx9rs1xtk4yIHfQWaBB9OpIj7uJ+RFLIEJqQtvGVF8t94YHGWfxxMvZsJo30I5emQn9Z3SFC/aMYLEdc/AGofh/4KLQQ9XnWf33Gx44AwCojrjmQFUKwbj+rgzkcCw4TYwezscNbVmg86J4JqJIM31K+nUUuT+A/lOVmzfrN+7PxlozGKvZdUeXKCqYiWH+/NEaRW6eMDMoLCLQJYPQqM3S8dMb0918zoYdCgZTT5evVBRuYNTp2vIDRuNmdl2LaXSQ0BT/8IOqxQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5151.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(316002)(8676002)(508600001)(54906003)(6486002)(8936002)(6506007)(1076003)(5660300002)(66574015)(83380400001)(52116002)(6666004)(44832011)(6512007)(66476007)(2906002)(7416002)(2616005)(66946007)(38100700002)(186003)(86362001)(66556008)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?sWPw2L6K/E4FpMQ7iRXbyQYdZESz?= =?utf-8?q?yEuxA8wDJ+Efp5KhtK03j6izyqjZ6vlAnUrVOiZL02yZz4FIMp0U8WqmExKEzjbh2?= =?utf-8?q?OTeulycDox0Le8cRwKfvyVZkeio2ccaEOGqWUo0s5KPQ+EFZVc6ykmsvjXch1fNQY?= =?utf-8?q?OtGfEEGAF+TpK3lR14vKh8T30brksNtu6kJPB0EZtvgHRVwPkPryPrGPGMmhq+WnT?= =?utf-8?q?KU8lfhCWoUAHeLxImlO/xCL3SOEiPg+eTRX+Ih2tfZmTsKtIcKGLwHzD5nrXXziMz?= =?utf-8?q?8FC41BkbBxJ6F0/15v4Baws5lT1ZRmIi9XZ3sKwFE0YE4YiywTL7Ii+MAM9a1ByDI?= =?utf-8?q?WYkIAQp1m+w70oqLyhr8k0oBVfnoBDfrQeDm0IAJLJxn2TihTUl8/NQUp0gHrRws2?= =?utf-8?q?2wbT5pMROOO+6oMgOogKlQnFYir+uGk+bSnzlVj2+Idc/oZxifTGJdM8pYyvAf3yu?= =?utf-8?q?pGiZ9zutVcBm3EDiG6aDbpd/lrPu0QCatGm7niSNpAL0zAKFtzTq1Xy4pU/wyxp3i?= =?utf-8?q?CyJgksmJqKD8prn5ea4Z3nJ65NxI8fnXcwjQ312E8hilAJrd+kzsvse8Cacuo70hb?= =?utf-8?q?EAbjDjssy9OiDW8kmbceP3CdI33xOz3TZQQvifbHcQBNVz8NdTikRf+gKPGgIkaT2?= =?utf-8?q?vsF+AbTxR+Y9V595Ghwz+f3cjFObIL9XYfH0XUcfU8rQX/hpM1pSLhP/D91eZh8iY?= =?utf-8?q?SbLftQf8V41K7aDyBz1GZLQP5Fc70i0fI87OchpsHRPZ7vuLDD/Dtn3buIplXKd0s?= =?utf-8?q?sHyRkgdS1PM2y1NZLgyQ8wuG4WlS4RG70OBj7zbTiqxt5vAZQV7rCTL8UslU0Vbue?= =?utf-8?q?FfZizchgN/PkDD6vzucOIOjrmAGPlGPyzq3MqeZdGFAF2pVwvcR519j0JTexvvnSn?= =?utf-8?q?mDL4vghczFg2UZsF9g+1RSAjvGBQdQQuOeWm7XEPO64mN+eiCTNflFXoZZ6iNl0ov?= =?utf-8?q?+E4nLUG67tPfw8kofun5clKF0d0RstFjgIzVpNrvtBXeC8k8SEsHXzRKW0lwBp28F?= =?utf-8?q?gUc24uUfrnpjEfIgKGTx5LSKAjtJBpjTf3Hq9KEOeI2TIDZ5qnNaQRLW+ODUc7ebF?= =?utf-8?q?zEvYY9CTQViWR9FH/krubMKDy5X27Ws3mfwVQU96gGaRj6oWz/hEynh/YD5Zra5KT?= =?utf-8?q?Pdm/XhyBxC2mqgV0/eKb/6UlSDVU3ithGvKt7GqdgxrZmoECxUE2tOHHNMwOdKLOo?= =?utf-8?q?WdeRt+JE1PWjq1HqNyOKxKRrDAt68aTcSwlXjJEmLK9nlLGa3A4SYZVbJv+gJ6Fni?= =?utf-8?q?ay33SeiNmwIqRERkBPi/m3iUAg1VTQX9WTuiFxJL7OrkC7POxMsOD6mQnq58TG7qX?= =?utf-8?q?ggvQTZkk5OTHj34lRZgtNKoRhzSktCvSMK8FkuiF0FdGh7gnCK9f5ckxZ0rbJxaUD?= =?utf-8?q?FgnfcAJ+ALMbn2zoBYDowd3ihrXrJVMwX3MbcSl7MurhJklplNyeCqoXqx39ONLA9?= =?utf-8?q?k9wfXJUYNuRha78EPY4f1B+1t1Ym+tzGGt2bUjcK99O87RrLDRDJEB7dGFXORKy9r?= =?utf-8?q?8P6oq/xQwHBBcYlalNevPHsrW0r6YhxXbaJKiRyoczhp5DiZ8jEXe0FRnIdMMre01?= =?utf-8?q?9ck3K59H/7fMIAj4iOK086FuyHuxtTG6cYrKWu7qYeU4bXJ6ROfUvo1HHgNXkIbw4?= =?utf-8?q?tDSRglK82g?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e7550ad-8ac4-4874-9e6b-08d99d0dbad4 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5151.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2021 08:00:54.5747 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pj7h+X9deZmePj11gQdqwp2uiNcnR0TNBuoTkOOiytnJvIt1XvH6MwAJLje7UUYyEtnF0OYdJzphM2cbkjgWNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2430 Cc: guennadi.liakhovetski@linux.intel.com, daniel.baluta@gmail.com, kai.vehmanen@linux.intel.com, Daniel Baluta , ranjani.sridharan@linux.intel.com, lgirdwood@gmail.com, linux-mediatek@lists.infradead.org, YC Hung , pierre-louis.bossart@linux.intel.com, peter.ujfalusi@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: YC Hung Add SOF device and DT descriptor for Mediatek mt8195 platform. Signed-off-by: YC Hung Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Signed-off-by: Daniel Baluta --- sound/soc/sof/Kconfig | 2 +- sound/soc/sof/sof-of-dev.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sound/soc/sof/Kconfig b/sound/soc/sof/Kconfig index fd6ae0629a1c..0147d089553f 100644 --- a/sound/soc/sof/Kconfig +++ b/sound/soc/sof/Kconfig @@ -42,7 +42,7 @@ config SND_SOC_SOF_OF depends on OF || COMPILE_TEST help This adds support for Device Tree enumeration. This option is - required to enable i.MX8 devices. + required to enable i.MX8 or Mediatek devices. Say Y if you need this option. If unsure select "N". config SND_SOC_SOF_OF_DEV diff --git a/sound/soc/sof/sof-of-dev.c b/sound/soc/sof/sof-of-dev.c index 885430a42226..412cbb824b84 100644 --- a/sound/soc/sof/sof-of-dev.c +++ b/sound/soc/sof/sof-of-dev.c @@ -13,6 +13,7 @@ #include "ops.h" #include "imx/imx-ops.h" +#include "mediatek/mediatek-ops.h" static char *fw_path; module_param(fw_path, charp, 0444); @@ -50,6 +51,15 @@ static struct sof_dev_desc sof_of_imx8mp_desc = { .ops = &sof_imx8m_ops, }; #endif +#if IS_ENABLED(CONFIG_SND_SOC_SOF_MT8195) +static const struct sof_dev_desc sof_of_mt8195_desc = { + .default_fw_path = "mediatek/sof", + .default_tplg_path = "mediatek/sof-tplg", + .default_fw_filename = "sof-mt8195.ri", + .nocodec_tplg_filename = "sof-mt8195-nocodec.tplg", + .ops = &sof_mt8195_ops, +}; +#endif static const struct dev_pm_ops sof_of_pm = { .prepare = snd_sof_prepare, @@ -130,6 +140,9 @@ static const struct of_device_id sof_of_ids[] = { #endif #if IS_ENABLED(CONFIG_SND_SOC_SOF_IMX8M) { .compatible = "fsl,imx8mp-dsp", .data = &sof_of_imx8mp_desc}, +#endif +#if IS_ENABLED(CONFIG_SND_SOC_SOF_MT8195) + { .compatible = "mediatek,mt8195-dsp", .data = &sof_of_mt8195_desc}, #endif { } }; From patchwork Mon Nov 1 08:00:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Daniel Baluta (OSS)" X-Patchwork-Id: 12596049 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18782C433EF for ; Mon, 1 Nov 2021 08:04:33 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8D64260FC4 for ; Mon, 1 Nov 2021 08:04:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8D64260FC4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E24F616E3; Mon, 1 Nov 2021 09:03:40 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E24F616E3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635753871; bh=QIlBLTofvB7/qZLHcAWlWMyLlvlcWEDAwKQRByh9V+I=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=pGtVV4ROfzGVgTUsAktz/cTrJoCF/YhOjKw1YbhtXQWGPRZHUmch3pv2QpQjmFKmN nbY/hxAdXJPO4YO09L1mG6JaUMvRXCx3MzmRPTf/c3zocjjFOlD0+QYNM52olDP1XR xQLxs2P6CKrlInhLqNUELOJEpya3tl+lUoCtKKFs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0F81DF80524; Mon, 1 Nov 2021 09:01:51 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4031BF804FF; Mon, 1 Nov 2021 09:01:24 +0100 (CET) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-ve1eur03on061b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe09::61b]) (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 5754EF804E5 for ; Mon, 1 Nov 2021 09:01:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5754EF804E5 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="CWr5eVfL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kQw8agy4ZZ3AsGzBYBm+glKt265e0t+VTnPQlisKHixy3EC8462M7RqCX3ofNz7Lz2IbwYrrTiKCRGw4Owx/zTZKTCOZTThqH+9Y92u+sw6JHuUavp1JaEErD0Pglbj2y2zTQgUm/Iutcoril1exKfqPnALE8R0bq19yR0Ddyq2UehoFRG+LBSICv6CZxiYTnTC1f5/hWb4RTIMx9n6BEnHObgjvdnvdp66IIclU5iNTseQJ0c6NXRpW/mfIVyBkxGVqCzDrU0AdxxnwcokJXfvBqGIR/nELAdfS2P4vfbdOscmG7RN5EdVx2+fOGajY+6tfj9fFGvwt5lbijedNHA== 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=1q71ZX0OhL93dqzfgutAr7YL9qPpnE4lAhTciqDhHtA=; b=OLk8ZlPRcQP2ctavDyCyTo3x39oG/84dB8805GjsWVlV+mHPIVqGPJGMMej8pO/nBSvpP+BgQw+6CJUgpSFDZ4AhECrDn89lBaW4Vv7LPeyH20z56KT7xeQrxI7CzrShTmb2inekPsTJAhW9AaIAX/309NQ/TLAg4zIo6ByDr2AzoBMxcRluEY5fOBAK7EgtCv3XjnbXvQy6B2LRyUDFRPmu4MEyj3fdi22tI7iAeeWRlySk4wcQ64Kb0gfvXUy8FIdD6YRs/5xAbDWNmLKyLMGYiXyEd5uaum2U8Q+ifaNw0Llg2O33YOYL6Nlehky/u3wItJAoC3PMpo16cey04g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1q71ZX0OhL93dqzfgutAr7YL9qPpnE4lAhTciqDhHtA=; b=CWr5eVfLgLe2EzoESluDzrj1MbcjhTq2OR8eMii1mw88UO11XTWBgpEN1eWUW27PD3s/VK+32OL6dhZR55tbjgAtdpS4b/nnGkYBbObOjp4g1210ufTk0PVvkm8WfhXrc4ZmksVTxL7gjDOLdlwagsKPFriXbzV/ibgYvrWgQi0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5151.eurprd04.prod.outlook.com (2603:10a6:803:61::28) by VI1PR0401MB2430.eurprd04.prod.outlook.com (2603:10a6:800:2b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Mon, 1 Nov 2021 08:00:56 +0000 Received: from VI1PR04MB5151.eurprd04.prod.outlook.com ([fe80::85af:f8be:aa99:ba5f]) by VI1PR04MB5151.eurprd04.prod.outlook.com ([fe80::85af:f8be:aa99:ba5f%3]) with mapi id 15.20.4649.019; Mon, 1 Nov 2021 08:00:56 +0000 From: Daniel Baluta To: broonie@kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 6/6] ASoC: SOF: mediatek: Add dai driver dsp ops callback for mt8195 Date: Mon, 1 Nov 2021 10:00:26 +0200 Message-Id: <20211101080026.297360-7-daniel.baluta@oss.nxp.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211101080026.297360-1-daniel.baluta@oss.nxp.com> References: <20211101080026.297360-1-daniel.baluta@oss.nxp.com> X-ClientProxiedBy: AM3PR07CA0070.eurprd07.prod.outlook.com (2603:10a6:207:4::28) To VI1PR04MB5151.eurprd04.prod.outlook.com (2603:10a6:803:61::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2a02:2f08:5719:1500:cdb2:376b:257c:429a) by AM3PR07CA0070.eurprd07.prod.outlook.com (2603:10a6:207:4::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.9 via Frontend Transport; Mon, 1 Nov 2021 08:00:54 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fc06250b-86bd-4c82-9f66-08d99d0dbbbf X-MS-TrafficTypeDiagnostic: VI1PR0401MB2430: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1284; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gixH+zPFUGQLFOeNwssajxmTA1CXsBuw6Mon77w2JOxxZ82wBqZsx+/oWq5fVVNhA5jsSh1PhLQfIN3GQ9T5JhZBgi3uPWu37tse0mG5PAlzVsjizDZqx4EjkJQcpOmQJi6d+ztz7Oq3tcOqdKStmDNQSq9xP19uPjjcksZ01DrA9R2+6BbUxfnAs0yP3ieGVstrFpk2IKJs+lOoct1ceCZ/0kOU+iF1nI9thXMjXgA+qc4Vq7hyEvSsPWhu+75zWFR+s7H3TzD/yCBEAf7L2U6V62AAMnhfMQgSWUJTAq90nYB++70I/2GnXSCpZHdCiK2GdgN6WVsHSHZRaZKQp4iIoQjbakRKrgGSTb3PNpjHpoD8xWjExwQg4u7TM/kN62WKOVHNCc8wLXD8F0WC8irFQ/s052ez4S1hD8EuwB3HvkJC+yC+GTdbyGnP+kWX0iHcPHnthPASh4RSfdevdxuptWEhuKG3RDUQrYhoUvxoTJrSpnpO2cBrOUqnSpmIDXENEiHUF5Afr66xfdNpT7rUf5sncdyJ8NTGJijnzZ1FvhE3SeB2jFePkvXYoIULq9tamwE+3EC9Ily/UiRn5v7l/WpKk50yLUQhONHStV/J9tCO/wp8T8gfGxjay+mj+v9pFsah8GCp/0+w4y42NA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5151.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(316002)(8676002)(508600001)(54906003)(6486002)(8936002)(6506007)(1076003)(5660300002)(52116002)(6666004)(44832011)(6512007)(66476007)(2906002)(7416002)(2616005)(66946007)(38100700002)(186003)(86362001)(66556008)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?12osTB8q8paRA0S9WH2DUgwfW8aN?= =?utf-8?q?V2go6yXFbLMQlZzvhAfQNP1m8K8uJ7vvM3pCEFIxfHqD3UKmlYaHIiMYGlTDvrplI?= =?utf-8?q?FYiciGNXEeR4iaLYDgSUQeseVwxV1F5zMz328BrYEblgMczHO8Rl+QYs2KUPDTXx2?= =?utf-8?q?B5pbbNAQCOgatVwX4N+J11+eLJgIGkh7Oo8BBexuK5ThOTMvagz6uZsftWzw0Jh7a?= =?utf-8?q?y8BhF+wm07j+uG9IXw2vCxllVQAcmiusUidipFEwUwd+Z69tA+ux468A7Y6KEQUsi?= =?utf-8?q?HtOX6k6j1P2cKhdcY8pfjPc3xsZ2an23uUrlyHU0U+SWOsXc7Y7+Vgs+Zptip/CMI?= =?utf-8?q?jRorhQTG1Li8Px04goakfp4xhVx+ieJACPEOZj5p5z1OvHqAXbH4e4x49pYvd60N1?= =?utf-8?q?K13WF8jU1z+fe1XUVttZUAh78+U/vEAJ85U/Shio8ecalqjXOY7TRlLoRA+a8jAzr?= =?utf-8?q?UFqGDYOk4J98WGdhl7/zZNuW2g14zrb4sTW+edFM6FoZpCYHS07+/suwT8St7wBYF?= =?utf-8?q?aIvvqnYAHrLUAaqoDrLH+RxuoWRPQDacsfTPBA8mfGUFGatv6vwgcQzz8JX2M7eJH?= =?utf-8?q?Mxe8NfW06PkXepGskGSdBCeVhJKefjb1GGZV3tFvZ2XJCBWRKr6COCW8wpQBMN+ui?= =?utf-8?q?tXI9oF+f00H1unW1ErDUkV/E9vPPSCWy9cM80jhJmf9MNHT+4EI0ayZYp8nX9uAL0?= =?utf-8?q?euWfFvQVCepbuf1Sm3s6gUEcBwBsY74CuxtumvUOJZTQiVg6uVpdMBxSurLzNE1xh?= =?utf-8?q?LFpBFu6G36nSUgOU/icfiwYakGcnjVdtQzelGEDW3vPWbvjTvbPKiCC/FEiEHQJOX?= =?utf-8?q?gECCCjMQ/2sEPuKc8VJWwGuEekp4RMqRkuSqa/IcX9yYWD9r+rVYk3eN3zDYJd8c1?= =?utf-8?q?SvgiIJVUlXZeFPj3H7y5FjWc3XQpCagmLyphkqfiuHhyBTsjrwl8ykL2+pGbHb+Dj?= =?utf-8?q?UsCMl0O6Hxm5aEClk2OUIE/cvLarK8JQruS899BGm/EkJo/xJ3jsoEHffS7uBmrqw?= =?utf-8?q?1I114Klut2YlIZF48eMOMeZ0lyvlCaL2lROaAP5zmuB/NksXkxRH9U4NroO763nw+?= =?utf-8?q?xI0oLxG+j3GYmAPaxKO83egwvY14Uf9JDcm8fge3mX/SdkqGlSMQ4rjVX/1OmOrDc?= =?utf-8?q?lL9GCwCocuAfFt5/dOXkhaKtaRZI1fca1bbCWBGt70dF5s+K4/tl+YWAjzCBeB8EJ?= =?utf-8?q?hlDFtITnAR1IsviJQ2g9dfHfUj413lVHf+ydrjj8Nud7xw3WjJmfoUmTbodlmTYuP?= =?utf-8?q?6pHN0ufuWC+WeYfFm16kYXCWmO7slUznBInN5jpReQkVN0Me2ELLqxQJpk8fTEyS9?= =?utf-8?q?OXFZUsJ+Zl4wmg4xWaYdue/3Lyonax51rNk7vAKcKmzRMexjhs4GP8oTDUslREREv?= =?utf-8?q?vrySV0hbPAHO2AlOwn7dTssf7iBB3zCMtCD/eDA6Klh60Iv8SoaDq4TOYMq/8jr/9?= =?utf-8?q?gKLy5jEzaL7zVm3BnCQOahlp6lBM2jihC876NqGsA7IVxvNEMAzleyAKdrcKSOlY2?= =?utf-8?q?VrD74pBigdAXfD9SxA5C8gjYjRXjL9hSMR7F3s56or3xXny0HUz3DSDlBj1oRmxRG?= =?utf-8?q?anGSbWa48WW5stz99zmUWUx1lIBO4jYe8lQAzmKEBSy3xASXM+Rm4Y=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc06250b-86bd-4c82-9f66-08d99d0dbbbf X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5151.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2021 08:00:56.1188 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9CDZbjyQchYSGWQh+7+/B8ZyWuCYltxNZZky2FxEERX51wPBwTVdmfG8pXPddCg/j9dtdCZJ+xYhcHZtR4b4Uw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2430 Cc: guennadi.liakhovetski@linux.intel.com, daniel.baluta@gmail.com, kai.vehmanen@linux.intel.com, Daniel Baluta , ranjani.sridharan@linux.intel.com, lgirdwood@gmail.com, linux-mediatek@lists.infradead.org, YC Hung , pierre-louis.bossart@linux.intel.com, peter.ujfalusi@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: YC Hung Add dsp ops callback to register AFE DL2/DL3/UL4/UL5 sof dai's with ALSA Signed-off-by: YC Hung Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Signed-off-by: Daniel Baluta --- sound/soc/sof/mediatek/mt8195/mt8195.c | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c index 88da6c2de070..99075598a35a 100644 --- a/sound/soc/sof/mediatek/mt8195/mt8195.c +++ b/sound/soc/sof/mediatek/mt8195/mt8195.c @@ -299,6 +299,37 @@ static int mt8195_get_bar_index(struct snd_sof_dev *sdev, u32 type) return type; } +static struct snd_soc_dai_driver mt8195_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, + }, +}, +}; + /* mt8195 ops */ const struct snd_sof_dsp_ops sof_mt8195_ops = { /* probe and remove */ @@ -329,6 +360,10 @@ const struct snd_sof_dsp_ops sof_mt8195_ops = { /* Firmware ops */ .dsp_arch_ops = &sof_xtensa_arch_ops, + /* DAI drivers */ + .drv = mt8195_dai, + .num_drv = ARRAY_SIZE(mt8195_dai), + /* ALSA HW info flags */ .hw_info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |