From patchwork Tue Nov 15 07:19:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: V sujith kumar Reddy X-Patchwork-Id: 13043286 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BA1E5C4332F for ; Tue, 15 Nov 2022 07:21:07 +0000 (UTC) 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 241B61630; Tue, 15 Nov 2022 08:20:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 241B61630 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1668496865; bh=CHvukpPaM/vpg/EGzROnCVPpxyVeFssIUbYxue/CkOQ=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=prDTJwWuRaHbflz9hj1X9ftIiWSRXm0mnhTsiW9vOPWdq1W8ojWYOwXiFv1gBGo41 PALA2fQuyhqstCSdLteoRPq49K5eytcsF0AIan9g0bRqirUBPFoLgforngY2Hg4HCO qbkkKH+5y/piRF5O5mqIc5zzQ8TspKxUasivgRg4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id BCEA1F8016D; Tue, 15 Nov 2022 08:20:13 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 20C4EF80171; Tue, 15 Nov 2022 08:20:12 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2062e.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5a::62e]) (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 C81B9F800B8; Tue, 15 Nov 2022 08:20:04 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C81B9F800B8 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Ip+sE7+k" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UEdyknLonhkUkDc1Eu+AS+wzmoIJFYccUGjxUW1k82kWy7E2E4So+8QpJ+uMOzllpMTCIJmTkfpNM0FdiFdqRyuFVm5ZxPbINafBtQ2ov3G73FnFt9Rzz8bPz2Sk6p3a3aHVV7tPF8MYeoEgyjJlX8xgS6gKS4hg1piyhcHcODS6C0EKTjN4QNLvL1VZSjRkFw8A5FJG44WhfiWDvPaRkSXvFT99LdLMcwq1XsJFW+zmFGk+G96nT4E2xO1yRm4/M5zBb8DFbViw3Vj16AHzQ/Oa5NTiIEdHGSBtO9Mo8rsIUS+sGNkiO6c29jLMG8KVrHDIs+RXDfZG8m1VWjrWuw== 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=3pgG9VSFuO6OG8GM/Y0pcfImjhIJDDUBwo/trrE3kRw=; b=NqWgVSBv5tY0ZHk3b2iYM9cWa95annHlg16MncV+JHmkrfS7EIQT4+1uDOD9Q+H4PV2yTcuWQW19eTHzQRJ42ejmF/iTz8L87d18gLmkm4hcu4wVt3pVMEyhJlsLwDyU83PrfFhS91Ia/mhEETX+6KzsqwIoCUCfduwND0zD0q8Gtw7b9V3Tv+v4ZNx49a51K2yw6fSfgdCxC3wFCPyhx6qbwt2AUNDZpsd7GPxcBk2qQtSs2b3Ucgd2/ITg0xeVHSxelis743lTlqONcAIANUjjfdgLy8XM9boqQd2p6dyPXlPZxnRzCzDFB4PYGtRYAssMXGyJJMthlhiCXNttNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3pgG9VSFuO6OG8GM/Y0pcfImjhIJDDUBwo/trrE3kRw=; b=Ip+sE7+kAVorjS1DhJq110zwJp5u/GiiYk4HYcnH7Ht2CqXkRKwWKSaKzdilgHUcP28peMLn/DMI/5dZ4Wnfz7IZ+d4lG/XPYUshUq3x+FuaYTfS3w+HLvVHcWfX0pGTeuXPSWOE9I+0nMOwOXbBBGMwGbyFswRI8/g0t8iVHAU= Received: from BN7PR06CA0063.namprd06.prod.outlook.com (2603:10b6:408:34::40) by SN7PR12MB7249.namprd12.prod.outlook.com (2603:10b6:806:2a9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.13; Tue, 15 Nov 2022 07:19:58 +0000 Received: from BL02EPF0000EE3E.namprd05.prod.outlook.com (2603:10b6:408:34:cafe::17) by BN7PR06CA0063.outlook.office365.com (2603:10b6:408:34::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.17 via Frontend Transport; Tue, 15 Nov 2022 07:19:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF0000EE3E.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5813.11 via Frontend Transport; Tue, 15 Nov 2022 07:19:58 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 15 Nov 2022 01:19:53 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 14 Nov 2022 23:19:49 -0800 Received: from sof-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 15 Nov 2022 01:19:44 -0600 From: V sujith kumar Reddy To: , Subject: [PATCH 1/4] ASoC: SOF: amd: Fix for reading position updates from stream box. Date: Tue, 15 Nov 2022 12:49:53 +0530 Message-ID: <20221115072001.1931617-1-Vsujithkumar.Reddy@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000EE3E:EE_|SN7PR12MB7249:EE_ X-MS-Office365-Filtering-Correlation-Id: 507890a3-c8eb-41ed-5356-08dac6d9cd88 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BvqL5Z+GirOquKgsGFfIYVWRBNHS/nbjN2L0uFJb5vFo8vcjHVGN9sX/1kw3WExVMGHMJVQv9d1x7dBq/C6cvl/7HDadNZunIFHTJoGw0X9w+KGHB3fS/+ZWvsd4Ms3DRuQ40+xF8zvXaNBDLnxjcNIfiIojM0G+sbnKqTl1F9LE11gKGaym8HGuGKLgwB0KSKJ0pH9ltjEYlBP4+pyUu+nIm2NdaA9B+jwVBuz7DrbNxd+er0YNLbFguhA7N43OX9qaMOng0FPcU8TvsXsJWI+mg4VCgNOoqmWWbyHuU53NZELm/a/T2TNfJhe9rnKDJZ9Kzr4WnLk/wI9HraLkAiaFpWztaRmMZDnb6OFJd83qpfGkH2OOveFSyu0DDgEfWwiAl5awbgWP/NRLkmRy4URAMEUNpYbYJws/KnKb0es7O3qNfsRgmZUcSatfHK6bO4MiuzLPIMTidUtntcJaDfSrulb0NHGeQsE8emMTh6fBbfaSScHfP7zeMWsggczgLPAe5FTAxLBdkPj52HII+hEl8d4DbtqJPgqAttQIYcymh45zuYTct1aS7ZJubWR43griyHno46iPtlca2vmjQUqD6RJ8Jp4tIGrnEGsSu0gXdvyFGJpHIL4ju0JdtyW3bvnK5N1zIt/7b8Bb4bb1zQeze8xUrUEmz2JvAa6OnGpkO4mKr5PFlG4BErFjeipZCKe5VH9/gKKP5+zOjRoKh0frbHXd/a13ZOlKOtIhxEsXetyjfhmZZe9QcrQme/HgD8H24Z471Fc7OwD4VTsDb1CFdZNlH+Eq9NW+yE0/w+3PPEIawVjHz/OefL7ONivm X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(346002)(376002)(396003)(39860400002)(136003)(451199015)(36840700001)(40470700004)(46966006)(81166007)(426003)(15650500001)(478600001)(1076003)(47076005)(356005)(2906002)(336012)(82310400005)(186003)(40460700003)(41300700001)(110136005)(83380400001)(6666004)(54906003)(40480700001)(7416002)(7696005)(36756003)(82740400003)(8936002)(4326008)(26005)(70586007)(86362001)(70206006)(8676002)(5660300002)(36860700001)(316002)(2616005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2022 07:19:58.4343 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 507890a3-c8eb-41ed-5356-08dac6d9cd88 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0000EE3E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7249 Cc: Daniel Baluta , Jiapeng Chong , Sunil-kumar.Dommati@amd.com, ssabakar@amd.com, Kai Vehmanen , venkataprasad.potturu@amd.com, Bard Liao , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Pierre-Louis Bossart , Liam Girdwood , Ranjani Sridharan , Vijendar.Mukunda@amd.com, V sujith kumar Reddy , Peter Ujfalusi , Ajit Kumar Pandey , open list , "moderated list:SOUND - SOUND OPEN FIRMWARE \(SOF\) DRIVERS" 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" By default the position updates are read from dsp box when streambox size is not defined.if the streambox size is defined to some value then position updates can be read from the streambox. Signed-off-by: V sujith kumar Reddy --- sound/soc/sof/amd/acp-common.c | 1 + sound/soc/sof/amd/acp-ipc.c | 30 +++++++++++++++++++++++++++++- sound/soc/sof/amd/acp.h | 4 ++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/sound/soc/sof/amd/acp-common.c b/sound/soc/sof/amd/acp-common.c index 27b95187356e..150e042e4039 100644 --- a/sound/soc/sof/amd/acp-common.c +++ b/sound/soc/sof/amd/acp-common.c @@ -76,6 +76,7 @@ struct snd_sof_dsp_ops sof_acp_common_ops = { /*IPC */ .send_msg = acp_sof_ipc_send_msg, .ipc_msg_data = acp_sof_ipc_msg_data, + .set_stream_data_offset = acp_set_stream_data_offset, .get_mailbox_offset = acp_sof_ipc_get_mailbox_offset, .get_window_offset = acp_sof_ipc_get_window_offset, .irq_thread = acp_sof_ipc_irq_thread, diff --git a/sound/soc/sof/amd/acp-ipc.c b/sound/soc/sof/amd/acp-ipc.c index dd030566e372..dd6e53c63407 100644 --- a/sound/soc/sof/amd/acp-ipc.c +++ b/sound/soc/sof/amd/acp-ipc.c @@ -192,13 +192,41 @@ int acp_sof_ipc_msg_data(struct snd_sof_dev *sdev, struct snd_pcm_substream *sub { unsigned int offset = sdev->dsp_box.offset; - if (!substream || !sdev->stream_box.size) + if (!substream || !sdev->stream_box.size) { acp_mailbox_read(sdev, offset, p, sz); + } else { + struct acp_dsp_stream *stream = substream->runtime->private_data; + + if (!stream) + return -ESTRPIPE; + + acp_mailbox_read(sdev, stream->posn_offset, p, sz); + } return 0; } EXPORT_SYMBOL_NS(acp_sof_ipc_msg_data, SND_SOC_SOF_AMD_COMMON); +int acp_set_stream_data_offset(struct snd_sof_dev *sdev, + struct snd_pcm_substream *substream, + size_t posn_offset) +{ + struct acp_dsp_stream *stream = substream->runtime->private_data; + + /* check for unaligned offset or overflow */ + if (posn_offset > sdev->stream_box.size || + posn_offset % sizeof(struct sof_ipc_stream_posn) != 0) + return -EINVAL; + + stream->posn_offset = sdev->stream_box.offset + posn_offset; + + dev_dbg(sdev->dev, "pcm: stream dir %d, posn mailbox offset is %zu", + substream->stream, stream->posn_offset); + + return 0; +} +EXPORT_SYMBOL_NS(acp_set_stream_data_offset, SND_SOC_SOF_AMD_COMMON); + int acp_sof_ipc_get_mailbox_offset(struct snd_sof_dev *sdev) { const struct sof_amd_acp_desc *desc = get_chip_info(sdev->pdata); diff --git a/sound/soc/sof/amd/acp.h b/sound/soc/sof/amd/acp.h index dd3c072d0172..1529c6d9bf9b 100644 --- a/sound/soc/sof/amd/acp.h +++ b/sound/soc/sof/amd/acp.h @@ -138,6 +138,7 @@ struct acp_dsp_stream { int stream_tag; int active; unsigned int reg_offset; + size_t posn_offset; }; struct sof_amd_acp_desc { @@ -199,6 +200,9 @@ int acp_dsp_block_read(struct snd_sof_dev *sdev, enum snd_sof_fw_blk_type blk_ty irqreturn_t acp_sof_ipc_irq_thread(int irq, void *context); int acp_sof_ipc_msg_data(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream, void *p, size_t sz); +int acp_set_stream_data_offset(struct snd_sof_dev *sdev, + struct snd_pcm_substream *substream, + size_t posn_offset); int acp_sof_ipc_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg); int acp_sof_ipc_get_mailbox_offset(struct snd_sof_dev *sdev); From patchwork Tue Nov 15 07:19:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: V sujith kumar Reddy X-Patchwork-Id: 13043289 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DC09CC4332F for ; Tue, 15 Nov 2022 07:21:57 +0000 (UTC) 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 5F47A1684; Tue, 15 Nov 2022 08:21:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5F47A1684 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1668496915; bh=dzLpFVmjbfct/WfRieQjfmGiVYVLvDasmbI0CYOXF8Y=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=irJsHsL1wC2BBajWVw3F+JQeoDxDyVLN9NXIJ1zcavgUt+PyiXO3RpKIBM3D/PdJo 9SJlen5L5wacOa7C0EQtKMxd4yic0EJ7Ar3xs3RtVBeQ6sUN0qzf8LaVACMR9eZYdy i/T6EJE9l/mY+krFDUyBcRoFVwjJN7AWMQggGGhY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 260A7F80549; Tue, 15 Nov 2022 08:20:57 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BA3DEF804DA; Tue, 15 Nov 2022 08:20:53 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on20609.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5a::609]) (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 A96CBF804C2; Tue, 15 Nov 2022 08:20:45 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A96CBF804C2 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="S7HOKDw5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JZr92QU9Gaaz/7i03FOuSPorfk+BR/liKbEHzB/exPj16jxaJYNruPOJ7SKGy2b7NliF3/JxrySNLu3tfUOcv8ozJJlrYXL82PoX4uVkHtX7jZ6iqagoN4CSB0Ajz7ZVmuOZ5zHEG884SyBm/+hE5SJfZt96tzZtuMHlXRz8BwHz3NRqyiOrJvOyAg741XPrMWso+4GSAeb/hm3HTqtUc5Rt8hfH6NtJSKciCydU/5O++7KcKODhXUdC1J86D+XgcuQ2qrOIfp5Ud5yTz3/b5cx3E7mkOyFlCQuuStqbx4OlKuP6wfNfHHtv97/LhFSSoIhf8YyVbBMK4hs01ShcqQ== 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=vCXHXG5BtEYgf/+BYK3iyUAIplq/6UzsISAOKgrXkEU=; b=PqWZZjPNdOGT1CnqThp+hG+FLy2xG2dN6J+1e+s6MUUjatRYkAqGgd3j0IKY0VkZ438KT3ByEQ5jKzO6Y+sbNRPq1CO+ZZZRmHY73V97CxXQB8tWfSNiKvnm8L1Ef9+npd0XdpejhqrcV5HxmhMce/3VZfdFSwNvTIzpdCL649NOWvplGcnhJYgaaDvmOZnbg5wZnccyWivUnoPnn4NC/O4PdT1/qScMVAEhu2j26E2RJUDk5HEM2MtE8dzX1JRNmIoZ3RpUygWD6pUqZvuYuJtI8m1ufyurQRtOksbJbbCOnFMoCFZJDRGgO7oEzp/uGE6yUJYEbDc958QOBWTOZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vCXHXG5BtEYgf/+BYK3iyUAIplq/6UzsISAOKgrXkEU=; b=S7HOKDw5MkhIvP1BxGNyLn1FzuGMdJuO7Znq/OZhC6/SfsxQkPxpvnzb3PpJfM6qOJVLgnXkEPEh/GNFzAOlZc3I2i0hO7yqHty7unSGjwUMRhbus0+9x8tcjtEU30wU6ByxMh+1TCivykGHOkI0Ay5Sqm/Ikvh9BPv/N0MaOxI= Received: from BN7PR06CA0062.namprd06.prod.outlook.com (2603:10b6:408:34::39) by SJ1PR12MB6266.namprd12.prod.outlook.com (2603:10b6:a03:457::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.18; Tue, 15 Nov 2022 07:20:34 +0000 Received: from BL02EPF0000EE3E.namprd05.prod.outlook.com (2603:10b6:408:34:cafe::fe) by BN7PR06CA0062.outlook.office365.com (2603:10b6:408:34::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.17 via Frontend Transport; Tue, 15 Nov 2022 07:20:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF0000EE3E.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5813.11 via Frontend Transport; Tue, 15 Nov 2022 07:20:34 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 15 Nov 2022 01:20:00 -0600 Received: from sof-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 15 Nov 2022 01:19:53 -0600 From: V sujith kumar Reddy To: , Subject: [PATCH 2/4] ASoC: SOF: amd: Fix for selecting clock source as external clock. Date: Tue, 15 Nov 2022 12:49:54 +0530 Message-ID: <20221115072001.1931617-2-Vsujithkumar.Reddy@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221115072001.1931617-1-Vsujithkumar.Reddy@amd.com> References: <20221115072001.1931617-1-Vsujithkumar.Reddy@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000EE3E:EE_|SJ1PR12MB6266:EE_ X-MS-Office365-Filtering-Correlation-Id: 15bd6ff4-12fc-4a1e-32e9-08dac6d9e2dc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v08EEO4kHVKEXndxD3FeTwyFW8puM1jt4NQQQ+NDPItEkrbTLwndMsPzqIArCUFfRXaJjSJGT6UhWdLyi0QeSD4ta079LiOlaeh00tb3acUPbORBZx2M0+0xUMeRw3MDjNqoUDbDKr4ZFOvjBx3IVzdtj2EbE7AV1VxDNLWe/5zYExH3fGFFe8SUBpc5BGArXkCcC3MeKsWFLxF6+QMPgDIETVWPlGSYkkZXXU3tKN5zqGOVYHJD8idEcUQAAUVfFFu/+XX96/zp5xcF3FuW28pJiTaVQG/GN279cP8sqxB/PHpIEK+ccKP6ovkTAGUs/TAKa59XDPmowWsysCw+6poBA8VGTV0H1NHsZRUvlUIxT3uYhQS/4d7WbP6Tgm2eU6FIFeg4oRf3ys9sUdfzokHZq8vlE30E0irw9B4Jd1J0FpUTJrdNSIHZlpAjjPfsgV53IEuMyOxItIsZadb8a5CUAeVEQxKZWkLwInpZNygnSm5EZSg9GcqdBWdZiWxgqVt7zfMFc874wMrCSRRqQ4lheLyYrENhqZ/l/4HdPFj6Q9n9p3Xgok7vw5qSB6w5pThYCG19BtlZq9jDxPrc5Bp1UuATS6NYRCdiL94QtnVl1gd+Ta4Q95+S1BiH2ML++k3M/s+8MEL2LohiOy6fBNdY/B85E3xnS73peVb54jcAlUOo24ldoVXRI21QAPB4iOMu2btBkL1Dv1vhItiVlZv6t3wvBITCAYSPuVNRVK9RxN00rdkjOC4rTeNJz3S8BleJmQbEDjXlxjLxww+Q++rIIWCzqennfUj8wFYVS3rVg0crwlNSdllsJd+frypd X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(396003)(376002)(346002)(39860400002)(136003)(451199015)(46966006)(36840700001)(40470700004)(82310400005)(40460700003)(36756003)(40480700001)(86362001)(83380400001)(26005)(7696005)(1076003)(2616005)(47076005)(426003)(336012)(186003)(82740400003)(356005)(81166007)(36860700001)(7416002)(8936002)(4326008)(8676002)(5660300002)(41300700001)(2906002)(70206006)(478600001)(70586007)(316002)(54906003)(110136005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2022 07:20:34.2162 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15bd6ff4-12fc-4a1e-32e9-08dac6d9e2dc X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0000EE3E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6266 Cc: Daniel Baluta , Jiapeng Chong , Sunil-kumar.Dommati@amd.com, ssabakar@amd.com, Kai Vehmanen , venkataprasad.potturu@amd.com, Bard Liao , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Pierre-Louis Bossart , Liam Girdwood , Ranjani Sridharan , Vijendar.Mukunda@amd.com, V sujith kumar Reddy , Peter Ujfalusi , Ajit Kumar Pandey , open list , "moderated list:SOUND - SOUND OPEN FIRMWARE \(SOF\) DRIVERS" 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" By default clock source is selected as internal clock of 96Mhz which is not configurable. Now we select the clock source to external clock (ACLK) which can be configurable to different clock ranges depending on usecase. Signed-off-by: V sujith kumar Reddy --- sound/soc/sof/amd/acp.c | 4 +++- sound/soc/sof/amd/acp.h | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c index 36966643e36a..47115a77c92c 100644 --- a/sound/soc/sof/amd/acp.c +++ b/sound/soc/sof/amd/acp.c @@ -390,6 +390,7 @@ static int acp_power_on(struct snd_sof_dev *sdev) static int acp_reset(struct snd_sof_dev *sdev) { + const struct sof_amd_acp_desc *desc = get_chip_info(sdev->pdata); unsigned int val; int ret; @@ -410,6 +411,7 @@ static int acp_reset(struct snd_sof_dev *sdev) if (ret < 0) dev_err(sdev->dev, "timeout in releasing reset\n"); + snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->acp_clkmux_sel, ACP_CLOCK_ACLK); return ret; } @@ -456,7 +458,7 @@ int amd_sof_acp_resume(struct snd_sof_dev *sdev) return ret; } - snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->acp_clkmux_sel, 0x03); + snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->acp_clkmux_sel, ACP_CLOCK_ACLK); ret = acp_memory_init(sdev); diff --git a/sound/soc/sof/amd/acp.h b/sound/soc/sof/amd/acp.h index 1529c6d9bf9b..76ad963faec1 100644 --- a/sound/soc/sof/amd/acp.h +++ b/sound/soc/sof/amd/acp.h @@ -69,6 +69,14 @@ #define BOX_SIZE_512 0x200 #define BOX_SIZE_1024 0x400 +enum clock_source { + ACP_CLOCK_96M = 0, + ACP_CLOCK_48M, + ACP_CLOCK_24M, + ACP_CLOCK_ACLK, + ACP_CLOCK_MCLK, +}; + struct acp_atu_grp_pte { u32 low; u32 high; From patchwork Tue Nov 15 07:19:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: V sujith kumar Reddy X-Patchwork-Id: 13043287 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8E842C433FE for ; Tue, 15 Nov 2022 07:21:31 +0000 (UTC) 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 726C01672; Tue, 15 Nov 2022 08:20:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 726C01672 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1668496889; bh=nnYBkn27+b738KucElNB8N6K172p9xIeGEno43BJm70=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=l01YK4cXHK8czwRMfVquNLdN8vL2ZGeJQLPb1T9EyqusgjWfbhzGo+Gf17ph7ZUsC Hb0IeeShAOOfGw1l17OCqtQLmmZvPf8cB3n3Z41Z82EORRJ3Pcy/PHNWSEji56v3ok 7S18G9ngh4kbmi3xmlqb/5YNvMomALKvYfVsvoec= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C4AA6F80538; Tue, 15 Nov 2022 08:20:24 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 06EB3F80557; Tue, 15 Nov 2022 08:20:24 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2061a.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5a::61a]) (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 12627F80538; Tue, 15 Nov 2022 08:20:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 12627F80538 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="dEsVzRRZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VgL+XM8ZsCDaczX0XTL4spiRVkMZA7L1dGHMFMxueDi56TJQqVt6sbfcoIU27IiazvVgVdWYNJEMeotajaw6JZ7NoH/n63Lw+LPfnN3RvVZa5q9hFXDuKvoQM5y48PzQRSCFOu26UDDgkMnwU/5cklQxSAagBw6WQBb1AEfuNAPiNF1PHUz5ssVvvmaQYUEEXw+03a3aZ3FHvvHV+nEsDuXpe24qGlcKsmUWlniWjP2OS8kLYAnHpGmxyB7oB14ck86CNhgyHdC8uXeXyfgWa+uMBoRjzqYTPINx2ZMB7Uou/958aBh80K2hktjBmcqbr2413++qc77P31ddJnbrGg== 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=cko9owEkAFRf80SlZ7NAXX75SMbmM3Abj8wmAJNUYFs=; b=MsyjzL7DZ8OBWCfIB+AShEiDY3Jes9e8SK9EZDa11nTONBzI4XDgxl7r7hmjio8SG5+JlJKvDvLjYOgw9S67kO0IM+KsOmcuZb8YjPi1JQbDt+QpRJzQWjoErbXm3f2Hzke2JoXIvhCwpySV5W3bMuSNg+7xZJidhEwaU1LMJVOKffxDhKrm03qsEbLdtWGs35fH8jc1YLBRdK3CeUbXd/xQhigrHwinmHlHJd+AOTDdW4Afo6tHfFDw5TO3UVwN0WHw1V2X5CBg/w47B2GD3mS+dQLSaVwZL/Uju9qqZQMLEC5LX9VNlyxRbMqeJXHu+sjBMHtyJrVhtRdrC9SGJA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cko9owEkAFRf80SlZ7NAXX75SMbmM3Abj8wmAJNUYFs=; b=dEsVzRRZJZZIwAcaORjGiqvXDaOTDpV8sOr11ss09Wf1nCMT+mGnNEN6J0Ni6nb+9BVIzReDXo2+e5HVIa06VVT+8l1PiJG3gx4UannsLWVl4dbAefDamcEQum6Yr0CuOJLgR6SgFmmy+/o33edWRNoSJk0l0BSxNiByKPX/aFM= Received: from MW4PR03CA0297.namprd03.prod.outlook.com (2603:10b6:303:b5::32) by CY5PR12MB6477.namprd12.prod.outlook.com (2603:10b6:930:36::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.16; Tue, 15 Nov 2022 07:20:11 +0000 Received: from CO1NAM11FT080.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b5:cafe::dc) by MW4PR03CA0297.outlook.office365.com (2603:10b6:303:b5::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.17 via Frontend Transport; Tue, 15 Nov 2022 07:20:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1NAM11FT080.mail.protection.outlook.com (10.13.174.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5813.12 via Frontend Transport; Tue, 15 Nov 2022 07:20:11 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 15 Nov 2022 01:20:10 -0600 Received: from sof-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 15 Nov 2022 01:20:04 -0600 From: V sujith kumar Reddy To: , Subject: [PATCH 3/4] ASoC: SOF: amd: ADD HS and SP virtual DAI. Date: Tue, 15 Nov 2022 12:49:55 +0530 Message-ID: <20221115072001.1931617-3-Vsujithkumar.Reddy@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221115072001.1931617-1-Vsujithkumar.Reddy@amd.com> References: <20221115072001.1931617-1-Vsujithkumar.Reddy@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT080:EE_|CY5PR12MB6477:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c71a070-5b13-45a7-872b-08dac6d9d54d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lHRQmLtro3RLw7LnOE2QaJHg5zz6znwclGIvPNqSaFOoF2eHHbM0vlyxzbKC/xtaILB8xqK0b6osYzXBLR5nza1pmVjr+D6cTKUaA7eHdlwIHl7lRFdwxA1Ng8dQWP0DcbhC/AqE30wvyDiRH3+kHMGo+TSZYXui4lqlfHphmyUG6GWfG0vHP/FPTDqDoF2lLuxbj52GfiaGLonSbsJJikGZX+vn0sMX5TluC8ab9SSX4hZwQbYMYfkJcC/NKQbrAYZGVRIc/J/K9NYvSYTV9Dj0Z67ddx0l2XnWYOU1TaeMAYIKwWyqai20hkEU5htQvx0YuN00EelS8EODrHbA9EaKyWAtkCIRwixjAf1G9l2T7QivuZSPZSQWg9Upgy5iYejR5YSGofWmjWNBhIgRKpA+LQX6oC743t/kbss1ZgQwcmUo7OK7st9MkyqnhEXSq+9iM9DAPb73dphmq/lnclNjN5vHkrbPtX5Q02KWMK+ohp7A/wgc57TKLJpwcyNfOR8rrOKkw8yxF9UWDK6PXxSdsO13bhkfLNkjsQ9JdEWE81ftBFzXZRucwSWv2rftQwmJvBQdOMZdHZAMCGEV6QlJ1e44TPyuSuCrW2jH0nGZXOCacROO25OloaGjYoGZavgw33+ZQX/cVIE/XBPEi3DtT+LgH/wEUGlzDcnJQtVcAkU43i/X09o1imgbKMjcXEz+asHYE3oJlGYcnrrBeXtXF3uk1FLY8atC/onR2jYBp8RjXnEbm8eHaK5xIk4CaTHffYvv60zXFXkZMaNhNu1feqkwk7lKa35KBE4Z73A460XwfFGIf2vXpKhEuwHj X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(396003)(376002)(346002)(136003)(451199015)(46966006)(40470700004)(36840700001)(2906002)(36860700001)(70586007)(7416002)(4326008)(41300700001)(8936002)(70206006)(40460700003)(8676002)(82310400005)(5660300002)(40480700001)(86362001)(82740400003)(36756003)(81166007)(356005)(54906003)(478600001)(110136005)(26005)(316002)(6666004)(7696005)(47076005)(336012)(2616005)(426003)(1076003)(186003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2022 07:20:11.3614 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2c71a070-5b13-45a7-872b-08dac6d9d54d X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT080.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6477 Cc: Daniel Baluta , Guennadi Liakhovetski , Sunil-kumar.Dommati@amd.com, ssabakar@amd.com, Kai Vehmanen , venkataprasad.potturu@amd.com, Bard Liao , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Pierre-Louis Bossart , Liam Girdwood , Ranjani Sridharan , Vijendar.Mukunda@amd.com, V sujith kumar Reddy , Peter Ujfalusi , Ajit Kumar Pandey , open list , "moderated list:SOUND - SOUND OPEN FIRMWARE \(SOF\) DRIVERS" 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" ADD HS and SP virtual DAI driver to support AMD platforms. Signed-off-by: V sujith kumar Reddy --- sound/soc/sof/amd/rembrandt.c | 16 ++++++++++++++++ sound/soc/sof/amd/renoir.c | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/sound/soc/sof/amd/rembrandt.c b/sound/soc/sof/amd/rembrandt.c index dcb64a23e121..5288ab882fc9 100644 --- a/sound/soc/sof/amd/rembrandt.c +++ b/sound/soc/sof/amd/rembrandt.c @@ -23,6 +23,7 @@ #define I2S_BT_INSTANCE 1 #define I2S_SP_INSTANCE 2 #define PDM_DMIC_INSTANCE 3 +#define I2S_HS_VIRTUAL_INSTANCE 4 static struct snd_soc_dai_driver rembrandt_sof_dai[] = { [I2S_HS_INSTANCE] = { @@ -112,6 +113,21 @@ static struct snd_soc_dai_driver rembrandt_sof_dai[] = { .rate_max = 48000, }, }, + + [I2S_HS_VIRTUAL_INSTANCE] = { + .id = I2S_HS_VIRTUAL_INSTANCE, + .name = "acp-sof-hs-virtual", + .playback = { + .rates = SNDRV_PCM_RATE_8000_96000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 96000, + }, + .probe = &acp_dai_probe, + }, }; /* Rembrandt ops */ diff --git a/sound/soc/sof/amd/renoir.c b/sound/soc/sof/amd/renoir.c index 6ea8727f977e..adade2e3d3be 100644 --- a/sound/soc/sof/amd/renoir.c +++ b/sound/soc/sof/amd/renoir.c @@ -22,6 +22,7 @@ #define I2S_BT_INSTANCE 0 #define I2S_SP_INSTANCE 1 #define PDM_DMIC_INSTANCE 2 +#define I2S_SP_VIRTUAL_INSTANCE 3 static struct snd_soc_dai_driver renoir_sof_dai[] = { [I2S_BT_INSTANCE] = { @@ -86,6 +87,21 @@ static struct snd_soc_dai_driver renoir_sof_dai[] = { .rate_max = 48000, }, }, + + [I2S_SP_VIRTUAL_INSTANCE] = { + .id = I2S_SP_VIRTUAL_INSTANCE, + .name = "acp-sof-sp-virtual", + .playback = { + .rates = SNDRV_PCM_RATE_8000_96000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8 | + SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S32_LE, + .channels_min = 2, + .channels_max = 8, + .rate_min = 8000, + .rate_max = 96000, + }, + .probe = &acp_dai_probe, + }, }; /* Renoir ops */ From patchwork Tue Nov 15 07:19:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: V sujith kumar Reddy X-Patchwork-Id: 13043288 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6593FC433FE for ; Tue, 15 Nov 2022 07:21:46 +0000 (UTC) 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 8A2301671; Tue, 15 Nov 2022 08:20:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8A2301671 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1668496904; bh=8MVwJq2ub1xD1yFZWs2ki3R3z6KSIjItzv5RbULtfxI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=RVRJ9j798AlqSMnj932BExGFEipufqxgloaLBFG9NR4sQmQtviRnQ4coChBXBMKCt 2boaZczBrOJubeRp20VDI0WUgCBCJZi4sa0HP5N6+sOQKGEGW/9eqfsYGErpIAXGdM lcErlYYzx5VwyScSp3zdP6CmZ6iS728YGZjWVmUU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3FC6DF804C2; Tue, 15 Nov 2022 08:20:54 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CF0AEF80542; Tue, 15 Nov 2022 08:20:52 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on20629.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8a::629]) (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 BABADF80171; Tue, 15 Nov 2022 08:20:45 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BABADF80171 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="wNYtARA8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EiAK1ks0o7jzKEM9e6g/Cu8tA4akdl31xWmn2cZRamJ2TA6PU9ZEtVnvIbt/GavAC8eHy0E01Ku9IVaRCyon3/rXXw4OhUZdRyE/5hxr3Xg4+h9tDpVr8jIy5TQsDXsVbZGzXuLsf/NVnMv49CDoUKD4J7P3uVK1k7SrDrTZ715dCVAXLCXQ9YQFv+GkS4YQ49faCSTo77nStppi7D/SI9q1/A/z2g4vb/5KtfVHiM4DfvFZZhPhHbiCHPRpnhfxfwIQ5hpgB19WnEfk+YhvlC0B/2McJh4Mn9jzDpAp/RM44CklEv+dFK7YXTmXcS/85IhGqtyAq0M5USDQutez0g== 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=sktex+Cr+nJJveF0gSzefdLFbimCxVcsgk2n1cK2lWM=; b=EHqI+OmeOY35rx4m5SPpyb8Nn97qU+LOVT2R0zFH6ZIHlEuhY692WekRTrE/FcxYIC9MwhCVBtdm/4qPLXdQxeTDp8agZPIWeyFi43lpF1McAuiawnqo0nupO+apJqdnwMMUGeanFgNhpC/746GLWJXRXPlrM8bqLDnaAnyH+NMvIqbce89YQsv9h9fFZyKasHyLkHx40tbmMc6Qvq/3891qL2H9f77jSnh/HDbnok+odOZFOVyH0aThIBn4Se3A89EloSr/BqUCwRrJT26wevNJbvdxlVIzDyHuNo9zzATTTuuD6WRAQaSWW2FxqvEnRMFfOrsgb+cUq9eXO/6vYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sktex+Cr+nJJveF0gSzefdLFbimCxVcsgk2n1cK2lWM=; b=wNYtARA8l8/G1dpEJvI/2LpDp32ryaeV6Nhrbg5p5TRLyUnvWQM2c+OlrnguuaMnolQPTMwFIlF9gTHvwU1D5DK8TorexmVjFEoEhUCMjKjD8apI2IkA7Okxds6ZBJAQzUR6XxWcpnxARo1Alx0qP9FOCL/qgQ49fvdIU0HBu3M= Received: from BL1PR13CA0387.namprd13.prod.outlook.com (2603:10b6:208:2c0::32) by DM6PR12MB4878.namprd12.prod.outlook.com (2603:10b6:5:1b8::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.17; Tue, 15 Nov 2022 07:20:41 +0000 Received: from BL02EPF0000EE3F.namprd05.prod.outlook.com (2603:10b6:208:2c0:cafe::41) by BL1PR13CA0387.outlook.office365.com (2603:10b6:208:2c0::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.17 via Frontend Transport; Tue, 15 Nov 2022 07:20:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF0000EE3F.mail.protection.outlook.com (10.167.241.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5813.11 via Frontend Transport; Tue, 15 Nov 2022 07:20:40 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 15 Nov 2022 01:20:35 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 14 Nov 2022 23:20:17 -0800 Received: from sof-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 15 Nov 2022 01:20:11 -0600 From: V sujith kumar Reddy To: , Subject: [PATCH 4/4] ASoC: SOF: Add DAI configuration support for AMD platforms. Date: Tue, 15 Nov 2022 12:49:56 +0530 Message-ID: <20221115072001.1931617-4-Vsujithkumar.Reddy@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221115072001.1931617-1-Vsujithkumar.Reddy@amd.com> References: <20221115072001.1931617-1-Vsujithkumar.Reddy@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000EE3F:EE_|DM6PR12MB4878:EE_ X-MS-Office365-Filtering-Correlation-Id: b0841cfc-46ba-4da1-3acb-08dac6d9e6ad X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dilc/juPZxeTHsVFiL/TYAvUCm4YtzkU0cthr2H9FyqbhcNHwsuH/BAYj+lmgZHN49uWNcgDh8yStploN8n/TsPKd0ZzdIF/45PN7Iqhr+kE/iF8yhd7j5HFYBxXdEJc4PB4huO8xQTrXa+oElg8v2ON7DNlaj1JzAncajN3CmUL6BZJ6ytMrxz8+xVO0jO0faN13lvCzRd26iXzrbikKK8eKorknnr2sQLVOHcsePIV8OaYNSDKtH7LX/xUtPlNWLyBpAv8v5qo9FQcopO8NThQ1c18DM86iG1dI2VWKzTqy6hDMWpdblpLVrACGRgkojaYcTMwD1ztLK9qCr/t8+Kj8C372nbtjPG9C3G+kfrWRYAsyFCSDQRxMDE4ZgDJawGZlbxpFa0nAN4adEhoSkpistNaMwc/PsHivdEvqpW7IIg6x54r9ZuLKXlZ8DVtD4ZWpZmqT3Wq+EuejpRXAC1ry699df8ShK4RI8lqfnZgu+zfHLIbCx2ulVO0ZvTZZa+iYMHJqT/rENLQQ6a3akekqH39z9iOtAjXXBxG4/07VnqDTaOqvxfFYMD0Arsisr4PFYPEWxFlwtNN3UOu+xOWzmS2MuIqwBwNmkj+EmmzZPkwOG4IX//JycBQ3hF3EUGklyfa8Hv6N992qdX8v7qVaobzfGQ+0wfYSKv4OOJJDvq1uRtpFWIqKXySymYG67vLfMMeICrEfueOrVrhFAsriMwq6rdJxB0lwJM0oDrT9Bl/5WH9Uv4g2+T5uAJVxjhgisv1JfXQV7RNFVJyyyWO9QbL2AVbAAWoHaABqIM= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(396003)(346002)(136003)(376002)(39860400002)(451199015)(46966006)(36840700001)(40470700004)(6666004)(54906003)(7696005)(110136005)(478600001)(70206006)(8936002)(26005)(36756003)(4326008)(8676002)(70586007)(336012)(2616005)(7416002)(41300700001)(1076003)(5660300002)(186003)(83380400001)(82310400005)(40460700003)(81166007)(356005)(47076005)(426003)(36860700001)(2906002)(316002)(82740400003)(40480700001)(86362001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2022 07:20:40.6193 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b0841cfc-46ba-4da1-3acb-08dac6d9e6ad X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0000EE3F.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4878 Cc: Daniel Baluta , Sunil-kumar.Dommati@amd.com, ssabakar@amd.com, Kai Vehmanen , venkataprasad.potturu@amd.com, Bard Liao , Basavaraj.Hiregoudar@amd.com, Takashi Iwai , Pierre-Louis Bossart , Liam Girdwood , Ranjani Sridharan , Vijendar.Mukunda@amd.com, V sujith kumar Reddy , Peter Ujfalusi , open list , "moderated list:SOUND - SOUND OPEN FIRMWARE \(SOF\) DRIVERS" 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" Add support for configuring sp and hs DAI from topology. Signed-off-by: V sujith kumar Reddy --- sound/soc/sof/ipc3-pcm.c | 2 ++ sound/soc/sof/ipc3-topology.c | 36 +++++++++++++++++++++++++++-------- sound/soc/sof/sof-audio.h | 1 + sound/soc/sof/topology.c | 10 ++++++++++ 4 files changed, 41 insertions(+), 8 deletions(-) diff --git a/sound/soc/sof/ipc3-pcm.c b/sound/soc/sof/ipc3-pcm.c index dad57bef38f6..f10bfc9bd5cb 100644 --- a/sound/soc/sof/ipc3-pcm.c +++ b/sound/soc/sof/ipc3-pcm.c @@ -336,6 +336,7 @@ static int sof_ipc3_pcm_dai_link_fixup(struct snd_soc_pcm_runtime *rtd, channels->min, channels->max); break; case SOF_DAI_AMD_SP: + case SOF_DAI_AMD_SP_VIRTUAL: rate->min = private->dai_config->acpsp.fsync_rate; rate->max = private->dai_config->acpsp.fsync_rate; channels->min = private->dai_config->acpsp.tdm_slots; @@ -347,6 +348,7 @@ static int sof_ipc3_pcm_dai_link_fixup(struct snd_soc_pcm_runtime *rtd, channels->min, channels->max); break; case SOF_DAI_AMD_HS: + case SOF_DAI_AMD_HS_VIRTUAL: rate->min = private->dai_config->acphs.fsync_rate; rate->max = private->dai_config->acphs.fsync_rate; channels->min = private->dai_config->acphs.tdm_slots; diff --git a/sound/soc/sof/ipc3-topology.c b/sound/soc/sof/ipc3-topology.c index 0720e1eae084..b94cc40485ed 100644 --- a/sound/soc/sof/ipc3-topology.c +++ b/sound/soc/sof/ipc3-topology.c @@ -276,6 +276,16 @@ static const struct sof_topology_token acpdmic_tokens[] = { offsetof(struct sof_ipc_dai_acpdmic_params, pdm_ch)}, }; +/* ACPI2S */ +static const struct sof_topology_token acpi2s_tokens[] = { + {SOF_TKN_AMD_ACPI2S_RATE, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, + offsetof(struct sof_ipc_dai_acp_params, fsync_rate)}, + {SOF_TKN_AMD_ACPI2S_CH, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, + offsetof(struct sof_ipc_dai_acp_params, tdm_slots)}, + {SOF_TKN_AMD_ACPI2S_TDM_MODE, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, + offsetof(struct sof_ipc_dai_acp_params, tdm_mode)}, +}; + /* Core tokens */ static const struct sof_topology_token core_tokens[] = { {SOF_TKN_COMP_CORE_ID, SND_SOC_TPLG_TUPLE_TYPE_WORD, get_token_u32, @@ -311,6 +321,7 @@ static const struct sof_token_info ipc3_token_list[SOF_TOKEN_COUNT] = { [SOF_SAI_TOKENS] = {"SAI tokens", sai_tokens, ARRAY_SIZE(sai_tokens)}, [SOF_AFE_TOKENS] = {"AFE tokens", afe_tokens, ARRAY_SIZE(afe_tokens)}, [SOF_ACPDMIC_TOKENS] = {"ACPDMIC tokens", acpdmic_tokens, ARRAY_SIZE(acpdmic_tokens)}, + [SOF_ACPI2S_TOKENS] = {"ACPI2S tokens", acpi2s_tokens, ARRAY_SIZE(acpi2s_tokens)}, }; /** @@ -1193,6 +1204,7 @@ static int sof_link_acp_sp_load(struct snd_soc_component *scomp, struct snd_sof_ struct snd_soc_tplg_hw_config *hw_config = slink->hw_configs; struct sof_dai_private_data *private = dai->private; u32 size = sizeof(*config); + int ret; /* handle master/slave and inverted clocks */ sof_dai_set_format(hw_config, config); @@ -1201,12 +1213,15 @@ static int sof_link_acp_sp_load(struct snd_soc_component *scomp, struct snd_sof_ memset(&config->acpsp, 0, sizeof(config->acpsp)); config->hdr.size = size; - config->acpsp.fsync_rate = le32_to_cpu(hw_config->fsync_rate); - config->acpsp.tdm_slots = le32_to_cpu(hw_config->tdm_slots); + ret = sof_update_ipc_object(scomp, &config->acpsp, SOF_ACPI2S_TOKENS, slink->tuples, + slink->num_tuples, size, slink->num_hw_configs); + if (ret < 0) + return ret; - dev_info(scomp->dev, "ACP_SP config ACP%d channel %d rate %d\n", + + dev_info(scomp->dev, "ACP_SP config ACP%d channel %d rate %d tdm_mode %d\n", config->dai_index, config->acpsp.tdm_slots, - config->acpsp.fsync_rate); + config->acpsp.fsync_rate, config->acpsp.tdm_mode); dai->number_configs = 1; dai->current_config = 0; @@ -1223,6 +1238,7 @@ static int sof_link_acp_hs_load(struct snd_soc_component *scomp, struct snd_sof_ struct snd_soc_tplg_hw_config *hw_config = slink->hw_configs; struct sof_dai_private_data *private = dai->private; u32 size = sizeof(*config); + int ret; /* Configures the DAI hardware format and inverted clocks */ sof_dai_set_format(hw_config, config); @@ -1231,12 +1247,14 @@ static int sof_link_acp_hs_load(struct snd_soc_component *scomp, struct snd_sof_ memset(&config->acphs, 0, sizeof(config->acphs)); config->hdr.size = size; - config->acphs.fsync_rate = le32_to_cpu(hw_config->fsync_rate); - config->acphs.tdm_slots = le32_to_cpu(hw_config->tdm_slots); + ret = sof_update_ipc_object(scomp, &config->acphs, SOF_ACPI2S_TOKENS, slink->tuples, + slink->num_tuples, size, slink->num_hw_configs); + if (ret < 0) + return ret; - dev_info(scomp->dev, "ACP_HS config ACP%d channel %d rate %d\n", + dev_info(scomp->dev, "ACP_HS config ACP%d channel %d rate %d tdm_mode %d\n", config->dai_index, config->acphs.tdm_slots, - config->acphs.fsync_rate); + config->acphs.fsync_rate, config->acphs.tdm_mode); dai->number_configs = 1; dai->current_config = 0; @@ -1545,9 +1563,11 @@ static int sof_ipc3_widget_setup_comp_dai(struct snd_sof_widget *swidget) ret = sof_link_acp_bt_load(scomp, slink, config, dai); break; case SOF_DAI_AMD_SP: + case SOF_DAI_AMD_SP_VIRTUAL: ret = sof_link_acp_sp_load(scomp, slink, config, dai); break; case SOF_DAI_AMD_HS: + case SOF_DAI_AMD_HS_VIRTUAL: ret = sof_link_acp_hs_load(scomp, slink, config, dai); break; case SOF_DAI_AMD_DMIC: diff --git a/sound/soc/sof/sof-audio.h b/sound/soc/sof/sof-audio.h index 1b5b3ea53a6e..29cf951e3526 100644 --- a/sound/soc/sof/sof-audio.h +++ b/sound/soc/sof/sof-audio.h @@ -248,6 +248,7 @@ enum sof_tokens { SOF_COPIER_FORMAT_TOKENS, SOF_GAIN_TOKENS, SOF_ACPDMIC_TOKENS, + SOF_ACPI2S_TOKENS, /* this should be the last */ SOF_TOKEN_COUNT, diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index 9d9fcaa2a948..c668bd9d21ec 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -289,6 +289,9 @@ static const struct sof_dai_types sof_dais[] = { {"ACPDMIC", SOF_DAI_AMD_DMIC}, {"ACPHS", SOF_DAI_AMD_HS}, {"AFE", SOF_DAI_MEDIATEK_AFE}, + {"ACPSP_VIRTUAL", SOF_DAI_AMD_SP_VIRTUAL}, + {"ACPHS_VIRTUAL", SOF_DAI_AMD_HS_VIRTUAL}, + }; static enum sof_ipc_dai_type find_dai(const char *name) @@ -1895,6 +1898,13 @@ static int sof_link_load(struct snd_soc_component *scomp, int index, struct snd_ token_id = SOF_ACPDMIC_TOKENS; num_tuples += token_list[SOF_ACPDMIC_TOKENS].count; break; + case SOF_DAI_AMD_SP: + case SOF_DAI_AMD_HS: + case SOF_DAI_AMD_SP_VIRTUAL: + case SOF_DAI_AMD_HS_VIRTUAL: + token_id = SOF_ACPI2S_TOKENS; + num_tuples += token_list[SOF_ACPI2S_TOKENS].count; + break; default: break; }