From patchwork Wed Nov 13 11:52:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 13873480 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2070.outbound.protection.outlook.com [40.107.92.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECDD5200C82; Wed, 13 Nov 2024 11:52:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731498771; cv=fail; b=bI7YDBVLmRsC9TXgFcNZocoVk5NdXWhooVhu4FrVIEHLH4MGubq2O/pIL4NfCWOEqlYqXdaT9uv8kvyD0Q9RUqzy8JeHN+/t5gBevzwK4BNyHg5njo3s+kLQuconEfpvGrtT0Wd9l68UzzvD3XnBNSQwpfckSXtr1Gmqg1LiT50= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731498771; c=relaxed/simple; bh=GYFtDNGqs6HV6H7H2fvPBz1mmyMOikx1gETrcYw7CiY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MyH35NxUjzZAlAaM5kY8azpJyEwNBKLR4T1Y6FrkvRy6/qvv7Q1egWl6PGzQEbKS1bAnHjwRsgfV55dJDiGFMz6RVcN3TqXZI1XXklKjJK1MrDqZmajIAtrWY0a0Kt10hwJrJ8DCuPA1heJh9i7aSgGdv7JVkkyoLkgPcj/iQto= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=1bwYiq0m; arc=fail smtp.client-ip=40.107.92.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="1bwYiq0m" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DuV2qFnHkKrkYZKNWaJYTb9eHoLZH7niHSBXkBlbVHv7S9t4pb4rwJoN1YkhP7O3gSvkidwE7wTIiXSTwUPbrelRWISJ2h5RQjYLmvK/od3ZM9+vK9qRev7QN2TYX7HSF/eKMVycAvffMNrJXc/G20faWQeEk8E6Z53/Bnn1nK5TLtxSnvaAgYnVChXCbnbrrXg9d963Q+5Q53k6QVAdnhvsglQtqLD7D6Hndxf83WzTIU7Zxw6F+GSD1x2zPZc7kJ4CHeH/klDSUS1KYjbp1u7yVyraKt2GGtPsSHHJsg1D5yq2Mh68b5gS3NuKKGfKYDmIjyPyHW+MM99ExEHK9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=1cRH4+LUrbB0cbs1aqxQ6NPTJTHF1oY+1b7Gj5fssjM=; b=GSzFSU2gJgrdyucvOBa9s/yn5LfjaLgD7c/vXvP2/XxncWRa3fhUhFGkxjvRmSQLhq7xPyfrMJemu7teDX9tDyjEdQTMmekvsuezEoqQgP7UcLGagMTtr5ZO7/jJUd10Jsfog9niNZm4sCm9ZaftX680eyH8hmccevxvOywHXmWE0ab0ZZ+SsHr1AMF8HfvOlEVRa/yOQPcp1eP67/cPC57bra2/WsSvt4UmjPyi3qkqZmLaGVcw7UkwUc712yGja/N2bSAjGfXSN5C0ybJ7RcN+fx3PHCdvF+80t6KTk5StGzatfa8KME7bo4Hl/FCLhDDII1PN6xMscxOhmBdxDQ== 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 (0) 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=1cRH4+LUrbB0cbs1aqxQ6NPTJTHF1oY+1b7Gj5fssjM=; b=1bwYiq0mm1P1emDX5wzi5GItJJ3JqGq2YDlm/5zg7sO3jg5FFEe6Jq5nYV2MEyi68jexPjZy6WEmgJbpUlm6C81hB1kFxAH9/EjdAD+odpHKgRE8zpNjBFZ6p4g3+cwjXBKIVgf9VAKApdVL7zdoz9te33CnuGUClMDUAhKUZZk= Received: from BY5PR13CA0005.namprd13.prod.outlook.com (2603:10b6:a03:180::18) by MN6PR12MB8492.namprd12.prod.outlook.com (2603:10b6:208:472::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17; Wed, 13 Nov 2024 11:52:46 +0000 Received: from MWH0EPF000989EC.namprd02.prod.outlook.com (2603:10b6:a03:180:cafe::bd) by BY5PR13CA0005.outlook.office365.com (2603:10b6:a03:180::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.15 via Frontend Transport; Wed, 13 Nov 2024 11:52:45 +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 MWH0EPF000989EC.mail.protection.outlook.com (10.167.241.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.14 via Frontend Transport; Wed, 13 Nov 2024 11:52:45 +0000 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) 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.2507.39; Wed, 13 Nov 2024 05:52:41 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , , , Vijendar Mukunda Subject: [PATCH 1/6] ASoC: amd: acp: add rt722 based soundwire machines Date: Wed, 13 Nov 2024 17:22:18 +0530 Message-ID: <20241113115223.3274868-2-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241113115223.3274868-1-Vijendar.Mukunda@amd.com> References: <20241113115223.3274868-1-Vijendar.Mukunda@amd.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989EC:EE_|MN6PR12MB8492:EE_ X-MS-Office365-Filtering-Correlation-Id: 632addcb-5ed1-417f-5c17-08dd03d9b05a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: yuYcDKyN4ug/PdptctuEbjyAEDFCWZSKau0JJQ/ICTFjqXl1DjmIPVnioR4oGPjFRwKsOFJ6tplx0sKy2+OtMbB/DqUpHuLEhNFSP0Akm+vDlStGnMKBEbYGx8Lo7WVM2lpdPjvhm6kq1JSyVo5yiDFQx3mKrUjPEpooMiMsqMRwL5n0ya1XqbrVue4JrVdUkXiXIdPj6bqsW5V/x6Rtfu4kc22XgBkRjk2VMKW3WSxi3vyTrQh6iVaNc0dle8tqgn0RJUhS09go+KGNpFPaR7omvT5qKeJy0cthi1zud2SaMNroVVkJqELdQIEpFuxOcfsBwRIXj6QMfuBlxBctaUNyYHvBggN4IC/71r4+nVr++BxZoJa9TfWAYPmJ8BLu8rOjcBxTOW3n1ybLtin+XsGQVEfyGa76TQ1vq/Tal01KzSz8f37vCZqb5noapmWy9usKMiDfmAXp/Mm1dtuYXn5NDeELjTcfJ37zAu95rPrUsKRv2DIErn6fR4c5iZ1dadlKf5j5+NRiUHV+d+c0SqorDZMaPdtjK/QQPOmpktOh1BLiCYj8JHWlrLJwN0Cnur0vigss0nHwoQsEKSz4VtH83MqVmErt/l3PB5kDbNF975HQWKCsXpLVFvCFsZdFQl4gn2V4NZjK7HLY8Q5VNO/L6U0kFW42yqf1eFZCA3z1ZF/OIA1EtEEhNnHN2ElF1xcTwXYSCB8VGjfEBR+wTqMSbECtNzlung5Fc2w5ezgFvFdd+XtLdYjL/oj6MvS34NQTDU3BSk8FAn4C8noQHb+NnGkocIUyBPkt+X3Mm9zK9MstpGgfP7f/6AKV5fcqX816STxrSq7K1iUXcqwnKSkE4UBgbXHl/XWSoIM4YAXPIxeInIYbhXHvIGVBoC4RG+yRmeYsp8niG2m2lfIp+NXvoiRzxnhGeNOJ67gCnLW/oodH6YkjsTAZ3Gf3xn7w1zTTLjHIsvPF6tyJa7h3+fFkGon3gRNrXZyu82K4jmLkHMy7IcCje64NVmQvWwqqE5la7+gUuZbRlmFNSlwAqgeZ15LCKuI8lnw2luVyauxa1AiAhhmjqDerX5AkImG+HNvPnHpBhMWYLpo8hyWQROvs4I9PWX9VEnOZuQIoGxXVWDmqML1b0xkXh3A++7dxt4RbmStaGyFos4Iv3qkVMmaz3xuO/xOs2YRvcca0dvKKSmIGhgh8W3iB37T67M+uOHeWqlG5a/NOLBEcL5QaxdbM+HS8/BPPIqorVDb110KmutOMQO0BAMlOEUGpcCmPqFOE7yOvv9nakwJXs/l3es+xjJ0SsbVF4LJXN2hWw1JzDFXWdjM2/6+f2JMZ9e3oDp/nGuIZgeq+1NJPbW2LqiyWHj3yKeumvNbsHaMcXJvUOxmOmoMVVZQXRP4gFEX1Gf9OgkdNmG3Tksy15bMhxA== 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:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2024 11:52:45.6258 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 632addcb-5ed1-417f-5c17-08dd03d9b05a 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: MWH0EPF000989EC.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR12MB8492 Add RT722 based soundwire machines for legacy(NO DSP) stack for acp 6.3 platform. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/acp/amd-acp63-acpi-match.c | 49 ++++++++++++++++++++++++ sound/soc/amd/mach-config.h | 1 + 2 files changed, 50 insertions(+) diff --git a/sound/soc/amd/acp/amd-acp63-acpi-match.c b/sound/soc/amd/acp/amd-acp63-acpi-match.c index be9367913073..5e506c9e3da6 100644 --- a/sound/soc/amd/acp/amd-acp63-acpi-match.c +++ b/sound/soc/amd/acp/amd-acp63-acpi-match.c @@ -73,6 +73,45 @@ static const struct snd_soc_acpi_link_adr acp63_4_in_1_sdca[] = { {} }; +static const struct snd_soc_acpi_endpoint rt722_endpoints[] = { + { + .num = 0, + .aggregated = 0, + .group_position = 0, + .group_id = 0, + }, + { + .num = 1, + .aggregated = 0, + .group_position = 0, + .group_id = 0, + }, + { + .num = 2, + .aggregated = 0, + .group_position = 0, + .group_id = 0, + }, +}; + +static const struct snd_soc_acpi_adr_device rt722_0_single_adr[] = { + { + .adr = 0x000030025d072201ull, + .num_endpoints = ARRAY_SIZE(rt722_endpoints), + .endpoints = rt722_endpoints, + .name_prefix = "rt722" + } +}; + +static const struct snd_soc_acpi_link_adr acp63_rt722_only[] = { + { + .mask = BIT(0), + .num_adr = ARRAY_SIZE(rt722_0_single_adr), + .adr_d = rt722_0_single_adr, + }, + {} +}; + struct snd_soc_acpi_mach snd_soc_acpi_amd_acp63_sof_sdw_machines[] = { { .link_mask = BIT(0) | BIT(1), @@ -85,6 +124,16 @@ struct snd_soc_acpi_mach snd_soc_acpi_amd_acp63_sof_sdw_machines[] = { }; EXPORT_SYMBOL(snd_soc_acpi_amd_acp63_sof_sdw_machines); +struct snd_soc_acpi_mach snd_soc_acpi_amd_acp63_sdw_machines[] = { + { + .link_mask = BIT(0), + .links = acp63_rt722_only, + .drv_name = "amd_sdw", + }, + {}, +}; +EXPORT_SYMBOL(snd_soc_acpi_amd_acp63_sdw_machines); + MODULE_DESCRIPTION("AMD ACP6.3 tables and support for ACPI enumeration"); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Vijendar.Mukunda@amd.com"); diff --git a/sound/soc/amd/mach-config.h b/sound/soc/amd/mach-config.h index 1a967da35a0f..a86c76f781f9 100644 --- a/sound/soc/amd/mach-config.h +++ b/sound/soc/amd/mach-config.h @@ -23,6 +23,7 @@ extern struct snd_soc_acpi_mach snd_soc_acpi_amd_sof_machines[]; extern struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_sof_machines[]; extern struct snd_soc_acpi_mach snd_soc_acpi_amd_vangogh_sof_machines[]; extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp63_sof_machines[]; +extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp63_sdw_machines[]; extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp63_sof_sdw_machines[]; extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp70_sof_machines[]; From patchwork Wed Nov 13 11:52:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 13873481 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2072.outbound.protection.outlook.com [40.107.94.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F3B5201011; Wed, 13 Nov 2024 11:52:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.72 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731498778; cv=fail; b=kSjybz5K/Tdl8cN79WDjLF/HoCP4eWKK2o7f1ERER39hZTac/xBFKnKnM4i0lcGFBdLlUNDXdKas11gNViyUUTM2TJNKhOyVMEwuILKJ+ZVBeSwi/dtClwLQsuEJ7ASYiDVsVwXugmmHug/I0lpNIECd9htiOXYYMx3TtSyaR0c= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731498778; c=relaxed/simple; bh=0S+ZRHiGH6w3wz7JpNhUIspIr3uNOjYyJRXQjRXoa7A=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BrDfGKd+7b7LwidSqqborfHo4ypeYnBkWolQpGuMUMgqQleMPOlSxXCi6aVnzeWeeHUhRa512rGcBfwxZhX14qXxHRjKVvSAQow+1z6FOCT6FilYS3KJDnLNXKHVEk62N7exAyYEfBq2vS3MItVy8SxN8y5LL8ZdfEG5my6WGEM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=KqCcQzwE; arc=fail smtp.client-ip=40.107.94.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="KqCcQzwE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HPpEMtnc7f971tTrfA1bNddqzxkIguZWv6o8yjccQ3NAqfj7ykZHql/wuNTCbUkizq4AQ5hjIbluDyc56VH8xaS4gBqc7pvsVlxgqOrl2P83BLOXia6dtyh6+VqHosjxaQNboUHlTLBW8DeYK7xP11M7Ec5A+pY7T6B4LsDAN5ZHw+SXWGh7HCRM9EClKK630rE4QeM4iyEZIroN5Af7PpTqwA0uTjHOZHAwM6utykPQS1uLvkawcQrO69vFX+Iwyjj4cyeoIYZZ8fLJrVFD7eLhc2gJM7ld3IzglF802XO/VbBZwZEZfT0lK2JajTDJci6SLUgT+czXD/stOZcgEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=5HVZq+tLgFHS6AuABgRzstlxDW5DDNtpFwHBZZ42JGo=; b=qJNbVqtt+P5+brgP870x/+RuVNdOJd/uWd6B/DXf0v3utG7pa67KRlkd2gC0n/h2DZRPuiZsc4+ApZNzSpqwo2wcjfdr+f7EqYeozgk2Xil4yX8PWxerkWD5/H6JqbpSRyB03OUni2SmGJaCkDNoEwjqNwILdkgDbUZ89ClMkk/3uBMN8JQ3s8hZXnp0MQCEcG+VEMbr92I3swiwUOXsF0minXXh1NmA6eqEqQRsY0Q2bVgLp6nmlZGeQKI7KgDv5SopjYYS89mLwh/KW+4LY3hH5F0SwNu7fW08E+J5EjZPO5EMVX8dBWnjGcCKRPfq/rjsSnzoPmE7PM9aYx4pbQ== 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 (0) 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=5HVZq+tLgFHS6AuABgRzstlxDW5DDNtpFwHBZZ42JGo=; b=KqCcQzwEFXDa8gKVs5QzYQwDrItQuen9m3z2m+uU4zdAvwn55FY7kbRrNUcSWoRkkKCc84mPxm4Jtexw9W9p5eWGKXVtCtuRHxngzwDNC3QYgtB3xiF05F5zWezA0veL44DrB/2P78IEVS7aOqpFdJgW7uEmoCau6294FLJzXxM= Received: from BYAPR06CA0019.namprd06.prod.outlook.com (2603:10b6:a03:d4::32) by SA1PR12MB6896.namprd12.prod.outlook.com (2603:10b6:806:24f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.26; Wed, 13 Nov 2024 11:52:52 +0000 Received: from MWH0EPF000989E8.namprd02.prod.outlook.com (2603:10b6:a03:d4:cafe::d8) by BYAPR06CA0019.outlook.office365.com (2603:10b6:a03:d4::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.16 via Frontend Transport; Wed, 13 Nov 2024 11:52:50 +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 MWH0EPF000989E8.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.8158.14 via Frontend Transport; Wed, 13 Nov 2024 11:52:49 +0000 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) 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.2507.39; Wed, 13 Nov 2024 05:52:45 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , , , Vijendar Mukunda Subject: [PATCH 2/6] ASoC: amd: acp: add RT711, RT714 & RT1316 support for acp 6.3 platform Date: Wed, 13 Nov 2024 17:22:19 +0530 Message-ID: <20241113115223.3274868-3-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241113115223.3274868-1-Vijendar.Mukunda@amd.com> References: <20241113115223.3274868-1-Vijendar.Mukunda@amd.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E8:EE_|SA1PR12MB6896:EE_ X-MS-Office365-Filtering-Correlation-Id: f35e49ed-9a2c-4a22-23e5-08dd03d9b2e5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: N1tIvncG3Aok6khfvA2H1151DUx3VLYu8odCy9eMqpkndrN4RqyffOQA9B9UTHWlf70YE85T7HwoD/ClD0wFxnDNCb7T0be5aAMEGvEPQkKvhtuY6J/78AGB1Un0m+x3lhpnz82FK+HOQxB/syjrKbHVF7q0fPf0mUN5dw0Ra2EUdV5xsRjW2KzL7soM+AVCXvpCBlL8IxXdo7W5l4NTqpvnsZOXpRpL8iSVRJ6x0lDH3uo0dXJ6Lfs33tYxc+eN/ZMonX5+NJD7QqlIepAgFIY8+0s7J3QnkaHDH8SDc2DFu4G8dZqtiKlZ85KZTRcAAK9ChRA8bwnu8oBByn1SiuOIIk6jXQcgGziOjUP3DmJql4ooZOb3Wcw2XObPyqrHdLQjoCGgFaoIT47ALMBrjGj8RNrIJxtXPOMTKALkkWPU5pd2mpkvGsFIdMwIMOr0LQ9VgVGEKy+uLIT4O2GFqPk9UYNZIUwOoE4sBJHgMPCZMAs/Oqsggr4dvm/b3SmMs4dCXtpitFsAMM0iC/47oA1cOApTLBJ6m8xHtmahzPcEuXDYStW1+KlSlGHQdQ2jDEpGxOZDUM2wDrGulX47lHzpT0Y7x6RPMTZBXPla2MkvnxbWDuAKTNIy8GRTkB6+aQF74GQixXVULQZkB4t5XmBvcmpSRD8uMCIGAfgbhb57awUGGL07WZ8pAWC7j/8U0oSVfwLsauQkJWvF7qiFBBSbhtWvA1hGDN2D5rWttIP0WwIiK/un3J8r7L3T/CVlEY00ZtA/MANSl6QuOYQ4fZRgG7VuQm85WuzcaJkZBQLe0KwEN06CK4m3tufxLzlrtZ1LxzyZuTTXWd9DAPOPBetsQSJWcqjIE9TuUCG4ksm/INv6M+P3NsYZPu6OGD2shMQPsn+2G57nAN2WBrxx9XgTCUu9SPeBFnkCKPT3jP1ODJLzcN99C2Xnln1C8HsJV+FC+T+gkNMDDiSb0aNHKJZSK5cSmGj3aSCWyzFaJ1h++0spMtSWshWJfMnjHL4i0DNOAVR4uxnbDvkPTh9zoRefQ4JxsHgLULoWfgeeujXvBxIXIVm4xERzvs+xuVUpJu+s5eEN1NzzvWe+uVGXR6dRzDWk7mfKu3FD/A8LP3dhoxMJzXBBRlsLGxyA3JfHOshXWr7Qvby2b5jarAqlKbkNRcUAc4ZJM7/mV9AtOOhu8JJDPbzHxHbj+KWkhEFC5OxU25VVB/6gXm13NhYIlUXGChbU9A21jPJuOo3j0ALwuzRqC9YPSH3OjFpRpLASWG6a6lG8BZSbj4BeZYHI29pHtlPvhBoyuIMYDN4gQxFCI/cIu8/Tpn8YoHgviG/SNIFdfqMFMcN7x8yMlcOXwdJt9RXtRRZO+9tpTxKv9VSqLKqvxFhE85RAWwkTHSH4p1yMn3r0U1RSjQomAaPbjA== 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:(13230040)(376014)(36860700013)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2024 11:52:49.8282 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f35e49ed-9a2c-4a22-23e5-08dd03d9b2e5 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: MWH0EPF000989E8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6896 This patch add supports for corresponding codecs on acp6.3 platform hardware configuration. SDW0: RT711 Jack SDW0: RT1316 Left Speaker SDW0: RT1316 Right Speaker SDW1: RT714 DMIC Signed-off-by: Vijendar Mukunda --- sound/soc/amd/acp/amd-acp63-acpi-match.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/amd/acp/amd-acp63-acpi-match.c b/sound/soc/amd/acp/amd-acp63-acpi-match.c index 5e506c9e3da6..9b6a49c051cd 100644 --- a/sound/soc/amd/acp/amd-acp63-acpi-match.c +++ b/sound/soc/amd/acp/amd-acp63-acpi-match.c @@ -130,6 +130,11 @@ struct snd_soc_acpi_mach snd_soc_acpi_amd_acp63_sdw_machines[] = { .links = acp63_rt722_only, .drv_name = "amd_sdw", }, + { + .link_mask = BIT(0) | BIT(1), + .links = acp63_4_in_1_sdca, + .drv_name = "amd_sdw", + }, {}, }; EXPORT_SYMBOL(snd_soc_acpi_amd_acp63_sdw_machines); From patchwork Wed Nov 13 11:52:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 13873482 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2049.outbound.protection.outlook.com [40.107.243.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4EAE2003CC; Wed, 13 Nov 2024 11:52:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.49 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731498779; cv=fail; b=Cx+YPf0QUdvIMEg08d4KMQd7WM0UEGYpZhjGkvrUgJTVjjHK5Eu27aefM6t3GIJiZ1ADcvXaAoJ/Gs1oIPge3WH6vqFeGvV8hMK+GkuzxCHKmbqiTcfiapgJIpohUVeotI/mu5MZoLqO+/WusKphcIxUa6dw+67HCX/ffSK8+JE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731498779; c=relaxed/simple; bh=UCiXsXvW+4wFXi37PcpEqtEtWafu07eWSuEbxmEcPSQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LjBu4ncB5dYZRjham7jAIgCJEBPHM+OoqK2z+qaYgfMvGglggLyKwGQZenqpdqr4Fvy4rtg0iS1NETzojvgcyLFX3Z6bg5tJUqN1DFO6Er4LryfsryUOkRd1K/mdoVj5lxispDFRrDdp9nqgaQCrAKeTh1Cn3snvANbRp+vhZeg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=WHls3LHt; arc=fail smtp.client-ip=40.107.243.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="WHls3LHt" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hfat5eY5VYelA+KZgVTTU7nD3nPh+f1nOpv56etgmwkfSpG/UB2lR8MtNxDgwh5oMnW+WRiUnJAItoc/gvu/HgvClP4HIYmtXwng1bMPa/EBrSeLxl0AAhbHkGo9WMenNwAEEGPhCej8WwHywCoK7QhOoWNzV7aCtr/uOkYWmvy7EeycBlzilnyW1fnsGrrCF4unZdlxsm5blnojLAXBBdYLfWu80HsOU55uU4FP38rmJhNspQcL8BvcP+XmSSIcEmccGfEyz0W2BOIcpahXDL0Re7BFbYfMDa7jl0UTOdGWjSM65SLmw1nCoY1YqT9qfdrZKXQPa+9RKOtCz69n0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=dZbyXS8g1vxaU/IBT2PE/QFCSozcpKS5slo1uqhzppw=; b=sboyOy95OWoXlvw1HZqI1V1cDsJoyqjcMUgSpMEdO/9vRQPb0FxddXiW66s3hnnH2PrArYswWMS9EMfvFCxqHM7/8PaH33eagoOxgaoyoENoo/ec0Ic6rOFfJVcSv3Wii8tjNuVHJeRn7uZNcPZ+SZ+GzFtekHXaQ+uKTLZJm0aMapsdn6i/T/7inuui5Tjspn3eMWF65t7pky4RfcAo/b0Ceujm4p5PUvC8sR2urT+p18ItTPMCBbhqxYqklcnneUBGu9QaerHfa0dSVG2PYIhFNSOUn2UggGFvuY32mzLLWgqt05C+kwbu96wFpUoEKjAC39dM/kSe5kNVZQQIxw== 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 (0) 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=dZbyXS8g1vxaU/IBT2PE/QFCSozcpKS5slo1uqhzppw=; b=WHls3LHtXAxADXBOTglwD2PC32d1kRvMaUUXXjpdZqvD+Dnz7dUjvmgn4v2ZyGGusEgzz/jQpYGPzptEZJybAbKlROrmEYSJLmF57ghCD47h5tf/qLGPjwQzZ8F2wkLPtQgYylSx5Jsi7querkRN2TpvVs6zYWOLB44Qqn2PBLk= Received: from SJ2PR07CA0009.namprd07.prod.outlook.com (2603:10b6:a03:505::6) by SJ2PR12MB8808.namprd12.prod.outlook.com (2603:10b6:a03:4d0::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Wed, 13 Nov 2024 11:52:54 +0000 Received: from MWH0EPF000989EB.namprd02.prod.outlook.com (2603:10b6:a03:505:cafe::5f) by SJ2PR07CA0009.outlook.office365.com (2603:10b6:a03:505::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28 via Frontend Transport; Wed, 13 Nov 2024 11:52:54 +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 MWH0EPF000989EB.mail.protection.outlook.com (10.167.241.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.14 via Frontend Transport; Wed, 13 Nov 2024 11:52:53 +0000 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) 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.2507.39; Wed, 13 Nov 2024 05:52:49 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , , , Vijendar Mukunda Subject: [PATCH 3/6] ASoC: amd: ps: add soundwire machines for acp6.3 platform Date: Wed, 13 Nov 2024 17:22:20 +0530 Message-ID: <20241113115223.3274868-4-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241113115223.3274868-1-Vijendar.Mukunda@amd.com> References: <20241113115223.3274868-1-Vijendar.Mukunda@amd.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989EB:EE_|SJ2PR12MB8808:EE_ X-MS-Office365-Filtering-Correlation-Id: 608f27af-b8df-4800-acf2-08dd03d9b511 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: wLQTaegggFrzOjugLxmJP5MTn31X7dnsZWdPS+pavxrUTvirs7/iY8ysAjwgCkAAm41dgTuZFPuLRxPFRsLAIdIQBV/l73HMuUUWeQ1CzjuLrx7xjvM4mzmEaC2dVFTZW/2+6ahZr3e3pQjX7NrVVH1sfXPaRd56qOflIKu2wqJqL+cyePoX34oxkSO2tXuq8+dstshJgk4RmrM6fdHTnLGWkUnidkNRXSbm5zU65u5svB6H4pBEBnXKY5txVjB+rPk8o1LvTbIgFw9ugKPhjXBQiRoEl32gCyxo5ofFs3t//8eW/4h4lakyjmPvP+hmUxDlaAVQgNk99NrbXrj8T60n1TJBs99V0fgxSlEDCec99RPa/SHw1iEfGabPNU1QzLgW3iRy/snQ6yVmdm6UlbHSrduokqO35HBMvkrNT1mFb0cgs7IG7pF3EGe9Jco4PnD/B1qoyZXaD4NKR+CJ7pX/qQzZ1Ir6dO09+Pu5ze5lwYgZoT36v5BpYaWV9lNtuqvGU+cnsw1tXHf7mfCiYwk3ydh71eXiNgGMRQu47qT//dICet8t4nnSCPMuZKCDmCZWgAU+dQ5AHIdjvkHoBxuezSkUtv8jBukj5B8t8A6L+DVVruAcwyFlp+iLll28Wj4kfDJKyvdN8t4Z/Yiz0d5qvJfKbN3w1T9Vv83fSDkPGzcxM8UjiNUqjZR2gtn6RYW5QSGB2OXFKKS17TUZ5xOJy9d/hMaSASfReBpQujG5pSpcWRSKF3kbY9yBWFba287luIaZpjkO03pzOJMtwLnqUe6vQQaGi+AVPWiblIgtnvH7kod6tfDCPxp1lSuIwb0TX+Pr4vTHwG2wU8ViQSlPhdUsjCr2ePcT9Lqbw114F/kniTLU5pwCXtpj6QveK+qbkTScNHO8ZQC05rzdEcud5C+ZiXVDCtbwI4cJN4T9RYcIMJCicSoIwpRZCp+asEMwGTUeWt02WrhjX9DSHRkTN/L14raTXIUzHFbYERQHtOnr/ugRj35NjhOHOzum5oKZzz320JAd5num42klfF5PWCrZLS4z63kZSuj4Wp4MJLPM7LlMriggNGEyG/2yKHK+c73PAu6cadJA+H3YVKHit/tSjqjUxjIO51ocuQMOK0dWfh1L3mPcIfIhp6AaUwtwJqFZtlGiuxshXdwXZAlaVqZ701v5WEXz2ekagjeQQ3K4eloMcCtpOCWWUczRyYF7hFN2x5KhGmssOy4NLO5RUdrSzBZm64MK+Qji0BJ2L6J9O0fsXGzt+MbZUL30E0W8dfK4K7uks0Uol02nBYVIH+VTJwiN9yFlyJoxjDzxhiGDERpxGRE8JURZPimOuyVt47jDvz18qtk1h4QW3WT+8bhN9Kd7aOa7uIQr5MOaEkRdRWL7OA7G/srLldfl5O9k0c8Bt6mJDYgcGbcOJQ== 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:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2024 11:52:53.5380 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 608f27af-b8df-4800-acf2-08dd03d9b511 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: MWH0EPF000989EB.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8808 Add SoundWire machines for acp 6.3 platform for legacy(No DSP) stack. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/ps/pci-ps.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index 4365499c8f82..a7583844f5b4 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -598,6 +598,7 @@ static int snd_acp63_probe(struct pci_dev *pci, dev_err(&pci->dev, "ACP platform devices creation failed\n"); goto de_init; } + adata->machines = snd_soc_acpi_amd_acp63_sdw_machines; ret = acp63_machine_register(&pci->dev); if (ret) { dev_err(&pci->dev, "ACP machine register failed\n"); From patchwork Wed Nov 13 11:52:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 13873483 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2083.outbound.protection.outlook.com [40.107.94.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7068320127F; Wed, 13 Nov 2024 11:53:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731498783; cv=fail; b=GSCu/icni9Mr9QXjo3kU1hQi2pyrWgXCKF38gAwgAeOCdIt8ADtMwRTun7RwynFT1X/hRHNCGdAy1UmGVvpJFkTgLPAYz/vHHjJoXABkMOqOTAakizQAVrKeg/MAgxEg5C8YtdD1dw1COtAWUhsyv3XnYRRU/oBNoQ9lZvqN8Uw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731498783; c=relaxed/simple; bh=baO/Jyx2PEQT/zbHVAZKCewu+Snhh4LkEhDZxtBpbWY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kqIRJGW5XWYy3rRRZ5I9/xC4efk6/WlsDUv+OHdSgXMT8ARZZqHq5gaFns5GmhrqPM/YT04YoB7x52jIjEle4fw97SUtuitx9WbJ+EyA8vKVSxwhXMmfMoL4nwMUuTihml1qcFtn8ib4PGlVRovm7FYPkOVVc2FIk1ygqQ0hKrw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=s1xxKJ9L; arc=fail smtp.client-ip=40.107.94.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="s1xxKJ9L" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RZiuGlAIxl4hskKX3XTNoNh2nfYqcKGte/J0gJPI26lNtSt1+bN4tTWE/8BDBY0EN9MlfhYbE8qK3uaJThO2yKThcTlQoFjJ/Oi+n+ucOlCCgNdnQDT2oE3nRlKj+Mfoa3kHPI+KWslr0hzT4OXtJygS2Zk9O8eGvzz5soLbCRaANJaQjawPIMIqMRVE7b01iAghe+HYpzbTEcA7XIlmzrZhmmVWFq7pM0+S0AFu2bTGbAZVjR8IpAO/3aUbMuhPMTZkgypzZUv47kOzyXFxZWljB94hy4V0KYbTBlHG1TTeju/AYY0ZHwNaAVr4eNGsIkpkDokWNUFXFTR1a1h+7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=p0jKxVnJ8L/+NhJd9LuQSDeXcLIk0CkNk7yi4xX6TbU=; b=OfZoAQpNeaX7UrZHx1ydc7zrZXmKm5+60uHQQlmKmLv7JZGDT6IjWk7eeNJwm1NeFi1sVUvzIIb+L5KbJIO9H6iyebNfK82Wxo8eQHrHFktmBGysqdaFk4aqj0PbCWUOD9WXhgvEx+D0PWNXUNfitwx9IV8wb4tjOkDEQ85qAc//Qs8ygcuMf/ANRPztE5cpORuF9JXuoqA7JhGg+ywJ1QDODvyzMrY3L5yunuOUAIV4RmNSPTxzqn7MAGv3kQLzoj2UMhqyTay4wsB5ghpui90+PbXJHQz8NR0f/man3MlNYEKMs647mAnJ4FKT0q7JKAIM/XtlN/akiMuH2i/X3w== 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 (0) 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=p0jKxVnJ8L/+NhJd9LuQSDeXcLIk0CkNk7yi4xX6TbU=; b=s1xxKJ9LET129Zz9fBnHKh3cqLl2mzPjZHRKenv7SQnEdm6+HNaYiLS6gPlJJmxqbPvW7RZ4QjQBua8la/jJgT1h6tKgCCWGwCwdud5upg2Pvc4TAQeIfXdRVrADdqq24vPdp8oJpVeecUmwW0ALwLRUriQ9aI6M7Qn0Mq8oMTo= Received: from SJ0PR03CA0268.namprd03.prod.outlook.com (2603:10b6:a03:3a0::33) by SJ1PR12MB6169.namprd12.prod.outlook.com (2603:10b6:a03:45c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17; Wed, 13 Nov 2024 11:52:57 +0000 Received: from MWH0EPF000989E5.namprd02.prod.outlook.com (2603:10b6:a03:3a0:cafe::f6) by SJ0PR03CA0268.outlook.office365.com (2603:10b6:a03:3a0::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.29 via Frontend Transport; Wed, 13 Nov 2024 11:52:57 +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 MWH0EPF000989E5.mail.protection.outlook.com (10.167.241.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.14 via Frontend Transport; Wed, 13 Nov 2024 11:52:57 +0000 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) 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.2507.39; Wed, 13 Nov 2024 05:52:53 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , , , Vijendar Mukunda Subject: [PATCH 4/6] ASoC: amd: acp: move get_acp63_cpu_pin_id() to common file Date: Wed, 13 Nov 2024 17:22:21 +0530 Message-ID: <20241113115223.3274868-5-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241113115223.3274868-1-Vijendar.Mukunda@amd.com> References: <20241113115223.3274868-1-Vijendar.Mukunda@amd.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E5:EE_|SJ1PR12MB6169:EE_ X-MS-Office365-Filtering-Correlation-Id: 63b5c104-f051-4c00-9c38-08dd03d9b77c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: Eec6gU+32nLMXyDmNYzSmEcVS3cBolQ1wpnDWo9rKAf9cvzswobByK40I1zXQjVMBJ7w8GJPm1OJ9wZDbeC0tYyTv17tBsnVXieDWc///77OPtcoWBQNdk/uqfWe+YbRGCWZ0NzXZPN5TkBAonL2H92MPIEd81FPUnsa5GD9uCas9lwHVOQ6e3Tso4KW3MlK2ROtISoetsCZWEL8jKeWi66ZGphXRZ0rHHrdzSAqfDBXJJk+iZaG1txuV0PhC5qDvy5OoIEcdas3DmKA/S/WrNQGArkty8xVv6xoinB9chETFUs94DS2qK6z3z4jbjQXrZNQ9YqyASw+mjZ8ra3d+AFs/Vi76b4buNNlJorYwRYeM+KdOYRwzLOwFeeuvaqctNvDhL7TXNbZSyWUfa2/G6Klxn2tbJPXGRvAH+Yrx5lwi9KtSu/FFlJ990PE9TvbacQRLMC/Rkk3e0bs8Qr6pNAdeED53P3gV+JByirCq2IksAmw2Grc6s+Azs0ooL6xyehWHKNJADSULpsWmRq37R2M9FzWHqnWK61vsITvw8N5oXnJFT/FlU5MlLQl+FsUOO1faAUbJL/Slztetjh3bkYA0UOudWNSpSd6h+ULhYgD3yx8PpH8+HuDkbzHRQEsf1T7q54x8GBrS7RrLrYTnHcB01AdvCT/FTezkAOl2VtascsF80DPP60hk3fL/a+jw7zR26MQulRXrafZwcZPIuQptC1TAwrxg0tmvU6e7IiOVijxp8OIQbEw9fu+L7zse9p80QXmmKfwohDKHov6EXc0jkU8heFtzZeaMmB16YTPL6tukhtNTRlOEiouvL67VxsyJHdCAgkJnF+xYG9PNzN11AhfapwWS3i+/+6rXF9Mmgup6xGoDVJYTZ2X3khp34gAYEpdkZOq3QZSJMam+njqOTnGbusUY89DZrhPctLmH8Vb1glQukP6wREFTj33Vk6LVvnPcA81vkbUVA1MnGJ0Milwv+rt/XYSfVPaGuGvA6ZKEBv7jz5mrNBvC2sFA1xhlF0mEIsAOIrAlH2o/TwTSc70Na/00Tlp6rXs1ux0B0AKAcdq+x96quyM1MoBYG2OOPbKB1fy5wpXxXCw0HSZJRu8lt2WdBjQmJ4NY5sTBGJHJkguteqCKru1zmEil8Zvhd+0HKDpHxub2gSboUXGtaq2NlIyomQOCG4X/HgDsEO0DVCCgiLYphQnt+J4WMMnxTMjdtB8V2XOzKJ+zWPVOdNz2348CkL79rWkv5dKwLh0pS4BblivrWtYeQNzQDn24S/zKZbtAgtb+pYxkqXYwykx3xiIQxl3s1XM+SMT3Np19pDvyn6gQfaz2G8XDnwkwNjRIZdy4v3DzIkmyWGHbR+doQCNP54Hst7cY+vrmdyJ9wOKgU/ULqaJK7CAmRbTZOjO8mvI/iAtTV9grw== 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:(13230040)(36860700013)(376014)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2024 11:52:57.5943 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 63b5c104-f051-4c00-9c38-08dd03d9b77c 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: MWH0EPF000989E5.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6169 get_acp63_cpu_pin_id() is the common SoundWire machine driver helper function will be used for AMD Legacy(No DSP) generic SoundWire machine driver as well. Move get_acp63_cpu_pin_id() function to common place holder. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/acp/Kconfig | 7 +++ sound/soc/amd/acp/Makefile | 2 + sound/soc/amd/acp/acp-sdw-mach-common.c | 64 +++++++++++++++++++++++++ sound/soc/amd/acp/acp-sdw-sof-mach.c | 49 +------------------ sound/soc/amd/acp/soc_amd_sdw_common.h | 2 + 5 files changed, 76 insertions(+), 48 deletions(-) create mode 100644 sound/soc/amd/acp/acp-sdw-mach-common.c diff --git a/sound/soc/amd/acp/Kconfig b/sound/soc/amd/acp/Kconfig index 88391e4c17e3..acd047d558bd 100644 --- a/sound/soc/amd/acp/Kconfig +++ b/sound/soc/amd/acp/Kconfig @@ -119,10 +119,17 @@ config SND_SOC_AMD_SOF_MACH help This option enables SOF sound card support for ACP audio. +config SND_SOC_AMD_SDW_MACH_COMMON + tristate + help + This option enables common SoundWire Machine driver module for + AMD platforms. + config SND_SOC_AMD_SOF_SDW_MACH tristate "AMD SOF Soundwire Machine Driver Support" depends on X86 && PCI && ACPI depends on SOUNDWIRE + select SND_SOC_AMD_SDW_MACH_COMMON select SND_SOC_SDW_UTILS select SND_SOC_DMIC select SND_SOC_RT711_SDW diff --git a/sound/soc/amd/acp/Makefile b/sound/soc/amd/acp/Makefile index 82cf5d180b3a..0e6c4022e7a2 100644 --- a/sound/soc/amd/acp/Makefile +++ b/sound/soc/amd/acp/Makefile @@ -23,6 +23,7 @@ snd-acp-mach-y := acp-mach-common.o snd-acp-legacy-mach-y := acp-legacy-mach.o acp3x-es83xx/acp3x-es83xx.o snd-acp-sof-mach-y := acp-sof-mach.o snd-soc-acpi-amd-match-y := amd-acp63-acpi-match.o +snd-acp-sdw-mach-y := acp-sdw-mach-common.o snd-acp-sdw-sof-mach-y += acp-sdw-sof-mach.o obj-$(CONFIG_SND_SOC_AMD_ACP_PCM) += snd-acp-pcm.o @@ -41,4 +42,5 @@ obj-$(CONFIG_SND_SOC_AMD_MACH_COMMON) += snd-acp-mach.o obj-$(CONFIG_SND_SOC_AMD_LEGACY_MACH) += snd-acp-legacy-mach.o obj-$(CONFIG_SND_SOC_AMD_SOF_MACH) += snd-acp-sof-mach.o obj-$(CONFIG_SND_SOC_ACPI_AMD_MATCH) += snd-soc-acpi-amd-match.o +obj-$(CONFIG_SND_SOC_AMD_SDW_MACH_COMMON) += snd-acp-sdw-mach.o obj-$(CONFIG_SND_SOC_AMD_SOF_SDW_MACH) += snd-acp-sdw-sof-mach.o diff --git a/sound/soc/amd/acp/acp-sdw-mach-common.c b/sound/soc/amd/acp/acp-sdw-mach-common.c new file mode 100644 index 000000000000..d9393cc4a302 --- /dev/null +++ b/sound/soc/amd/acp/acp-sdw-mach-common.c @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright(c) 2024 Advanced Micro Devices, Inc. + +/* + * acp-sdw-mach-common - Common machine driver helper functions for + * legacy(No DSP) stack and SOF stack. + */ + +#include +#include +#include "soc_amd_sdw_common.h" + +int get_acp63_cpu_pin_id(u32 sdw_link_id, int be_id, int *cpu_pin_id, struct device *dev) +{ + switch (sdw_link_id) { + case AMD_SDW0: + switch (be_id) { + case SOC_SDW_JACK_OUT_DAI_ID: + *cpu_pin_id = ACP63_SW0_AUDIO0_TX; + break; + case SOC_SDW_JACK_IN_DAI_ID: + *cpu_pin_id = ACP63_SW0_AUDIO0_RX; + break; + case SOC_SDW_AMP_OUT_DAI_ID: + *cpu_pin_id = ACP63_SW0_AUDIO1_TX; + break; + case SOC_SDW_AMP_IN_DAI_ID: + *cpu_pin_id = ACP63_SW0_AUDIO1_RX; + break; + case SOC_SDW_DMIC_DAI_ID: + *cpu_pin_id = ACP63_SW0_AUDIO2_RX; + break; + default: + dev_err(dev, "Invalid be id:%d\n", be_id); + return -EINVAL; + } + break; + case AMD_SDW1: + switch (be_id) { + case SOC_SDW_JACK_OUT_DAI_ID: + case SOC_SDW_AMP_OUT_DAI_ID: + *cpu_pin_id = ACP63_SW1_AUDIO0_TX; + break; + case SOC_SDW_JACK_IN_DAI_ID: + case SOC_SDW_AMP_IN_DAI_ID: + case SOC_SDW_DMIC_DAI_ID: + *cpu_pin_id = ACP63_SW1_AUDIO0_RX; + break; + default: + dev_err(dev, "invalid be_id:%d\n", be_id); + return -EINVAL; + } + break; + default: + dev_err(dev, "Invalid link id:%d\n", sdw_link_id); + return -EINVAL; + } + return 0; +} +EXPORT_SYMBOL_NS_GPL(get_acp63_cpu_pin_id, SND_SOC_AMD_SDW_MACH); + +MODULE_DESCRIPTION("AMD SoundWire Common Machine driver"); +MODULE_AUTHOR("Vijendar Mukunda "); +MODULE_LICENSE("GPL"); diff --git a/sound/soc/amd/acp/acp-sdw-sof-mach.c b/sound/soc/amd/acp/acp-sdw-sof-mach.c index 8fce8cb957c9..0d256c0749c9 100644 --- a/sound/soc/amd/acp/acp-sdw-sof-mach.c +++ b/sound/soc/amd/acp/acp-sdw-sof-mach.c @@ -64,54 +64,6 @@ static const struct snd_soc_ops sdw_ops = { .shutdown = asoc_sdw_shutdown, }; -static int get_acp63_cpu_pin_id(u32 sdw_link_id, int be_id, int *cpu_pin_id, struct device *dev) -{ - switch (sdw_link_id) { - case AMD_SDW0: - switch (be_id) { - case SOC_SDW_JACK_OUT_DAI_ID: - *cpu_pin_id = ACP63_SW0_AUDIO0_TX; - break; - case SOC_SDW_JACK_IN_DAI_ID: - *cpu_pin_id = ACP63_SW0_AUDIO0_RX; - break; - case SOC_SDW_AMP_OUT_DAI_ID: - *cpu_pin_id = ACP63_SW0_AUDIO1_TX; - break; - case SOC_SDW_AMP_IN_DAI_ID: - *cpu_pin_id = ACP63_SW0_AUDIO1_RX; - break; - case SOC_SDW_DMIC_DAI_ID: - *cpu_pin_id = ACP63_SW0_AUDIO2_RX; - break; - default: - dev_err(dev, "Invalid be id:%d\n", be_id); - return -EINVAL; - } - break; - case AMD_SDW1: - switch (be_id) { - case SOC_SDW_JACK_OUT_DAI_ID: - case SOC_SDW_AMP_OUT_DAI_ID: - *cpu_pin_id = ACP63_SW1_AUDIO0_TX; - break; - case SOC_SDW_JACK_IN_DAI_ID: - case SOC_SDW_AMP_IN_DAI_ID: - case SOC_SDW_DMIC_DAI_ID: - *cpu_pin_id = ACP63_SW1_AUDIO0_RX; - break; - default: - dev_err(dev, "invalid be_id:%d\n", be_id); - return -EINVAL; - } - break; - default: - dev_err(dev, "Invalid link id:%d\n", sdw_link_id); - return -EINVAL; - } - return 0; -} - static const char * const type_strings[] = {"SimpleJack", "SmartAmp", "SmartMic"}; static int create_sdw_dailink(struct snd_soc_card *card, @@ -491,3 +443,4 @@ MODULE_DESCRIPTION("ASoC AMD SoundWire Generic Machine driver"); MODULE_AUTHOR("Vijendar Mukunda X-Patchwork-Id: 13873485 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2063.outbound.protection.outlook.com [40.107.101.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 571D420127F; Wed, 13 Nov 2024 11:53:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731498792; cv=fail; b=WL50l1tI0jRvsHWU3MiMur9m0n0RJ19qLAIwYwNLbVvk04VT3zm75gmdPfA5+wHHDEBtfnnbT/n3aVQc6+PPJGzVpcTXG94xg0p8PJd5FjKZT6nWii3gEPXlLmfFMyWHAZZ4KDaRFqmbHtSnpc4sUTqejr4Bi9zncrHWrb1YIF4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731498792; c=relaxed/simple; bh=DCxGkbcYVhKBbQOy4O61+Y+euI+S15gtPI3YDPumR88=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KOdixRq96L57h6wDIqqzTCmY3pDOhOwMsm3Jz6RwwjEJn3hRmYBBLh9MxiIi5ChzGJ3+RZN5crVzP6ST8zqsGZzIVL7OMxtkldC77SDMBarJBAQpvK6WSONFwPpFcsctr6hPDvwUANUX1ZYm6znZSYjeH8ZF3R8MEQjpAiY7ocg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=jWQSS4Es; arc=fail smtp.client-ip=40.107.101.63 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="jWQSS4Es" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pOnI7daDiug0CAaYNFtPmk9Xjfagors1CJTIxL7pRQ5CmuXTN6HwlH6t/cLiRKIPgrWPtJ5f23owicskY3vY/lDlvlgdW8iEHnsa5NGP7i3EetkW9rg0qd3QBe0AGFqWilBN2Vn3E47BmxbiEP5wjVjt3nJvvrLnfyIOR+7Fwicus7TWtO6A+guS4oarTd1/8rbzbYoatxddJyqZ7fKih01HnVDQA2kv74sjjkWDtOqEMp9ruXnrRoTK1AoNuc8uiEefwYEgbhAoYvA01tTmOQtqwzw/5xesxwhNKqAyqxiDulyzPZc8VeN1oK4vvRQG30RazVmZBfqfj4WV7XbJnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=gMhPOkm6RKYClPiuU6VT8v06xrmjOgqRPIumGqMfk4Y=; b=PuwN23RQDY3Q55S35ZgCpKI5x4P9QnfbmmAaR7AVJpN2UOsH/BhQeOs8lKQFz6TpnXrmtSF6mpPd8pjWC4/mLD6Y5ClDslh+keQ+uULuBWIqnpsies94DXhdYm3DLhQ1d3SPlikJrClEDoHWje5+VpwPIJcctFcAacTXHwy6oXjdlRAIPUpsAyXBnUkcyf8hNjvSl1jzHZ8YBL24Gtimy9oAA50EwCCzsezflV7dB0KDybOKECDAKaZZ8sCCEASyXL282UsQuJXJd3nP6b+x5sqm/dyRifmFXJ9JvG2S816a9wc4Lptkoo/b/aIWx8Tqq010AbwaoJrZuOCajcqSbw== 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 (0) 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=gMhPOkm6RKYClPiuU6VT8v06xrmjOgqRPIumGqMfk4Y=; b=jWQSS4Es38eIFXalz/GsGXsXSqWh+EpHQ2OESk8xlmZOvytK5v/mbF90IjhdQeAGbHjCrMwf7eh935ZB48VM/4chF/QD9BTru7ziVpk/PhXQ4QiQi3jWIFthXLE29RSKAA+WcksQl8njEZvE2+cDlDO/fk1rcTZSVEF6oW3C970= Received: from BY5PR13CA0029.namprd13.prod.outlook.com (2603:10b6:a03:180::42) by CYXPR12MB9277.namprd12.prod.outlook.com (2603:10b6:930:d8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17; Wed, 13 Nov 2024 11:53:03 +0000 Received: from MWH0EPF000989EC.namprd02.prod.outlook.com (2603:10b6:a03:180:cafe::9b) by BY5PR13CA0029.outlook.office365.com (2603:10b6:a03:180::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.16 via Frontend Transport; Wed, 13 Nov 2024 11:53:03 +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 MWH0EPF000989EC.mail.protection.outlook.com (10.167.241.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.14 via Frontend Transport; Wed, 13 Nov 2024 11:53:03 +0000 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) 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.2507.39; Wed, 13 Nov 2024 05:52:57 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , , , Vijendar Mukunda Subject: [PATCH 5/6] ASoC: amd: acp: add soundwire machine driver for legacy stack Date: Wed, 13 Nov 2024 17:22:22 +0530 Message-ID: <20241113115223.3274868-6-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241113115223.3274868-1-Vijendar.Mukunda@amd.com> References: <20241113115223.3274868-1-Vijendar.Mukunda@amd.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989EC:EE_|CYXPR12MB9277:EE_ X-MS-Office365-Filtering-Correlation-Id: f82380ce-e09a-4b09-cce1-08dd03d9bacf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: nJZ4qX35r91oOQP7H5NGnBqKFWa5Wa7mkHeqrdn2tqI8NCAhJntnfcTc45KEOuku1TnwFPGBdjTqt6+PxAvFLlNOP/F/PlMD1xtYz+KwXjn22v1PkHTAS9TqAZarSTBtSSp4aOoN52b4jiuK0HgtHWnlVWgz2EmjwrM+AGUYMX8WBgMBtMjdXHod/R7Xcf+VzRawkYwrYihSN3r1SVwjY7Kf0Cu6fYqzq19AFHb4/Jw8Prwh2N5PUi1zvIPNbU9M7i6ocrfrWxva9n1syrOlpTa6Jn4MMMWdUVctO7rutxdpyTyyPHGmNcPZRedWnPK09iglzfh4Yc/UWMfEQRgZVvDth3PC7X+Ih3umHLuoSSCnBgdt0tL9wKL0/DZHkrNs28nlWu5eULAK36L81zLDtr4g9ovBYikQoODiJAXLH5NhP9c2FZERHR2RFAANsZ/I4ISzJPVDqyk1o4Vg7J5OJt7Y6cegaT6JrBHMGjwMsI8JhR26YiTwwbAcL8nzAyoV7lJqQqo8J2gMhn1c97cAkt2yrGn41oYZMwA/wXydz6GZSyPCimKXMdv2jTpIEReZ+O2jm6OVm8HZ956ZrmmAeYdFvoseN0K+wObz/lz/sCP7tuA9u7S9CZJPv6/e3dhEZd11PmF5iE88AqZUKTT1C0/Iwos8xxjT4TgCUaqdYX00dWf6553xlL9UZpZLDiIzls35TrKuHuf96CvdjfnmN9ijkgvH62zmBZjwN0THabvzHh5S6Sx/v03RePV1bAgR9aCteazhmvBGrH9rbnIjVR6FsrRbxQtvEe3sMyIJbjSB0igSdOvPKmpYU5N/eDVOFbmlKjGRyGlwJ8EqLgaHDx1aXCeliCtcEc0+vNsJlMbink4UlMkEvYBIn0/26n93t/UmfceSb0DT8682MJJwaXgmreAp7SVjRB20iD06JUCmeSzu3DH8nrc++tBUGv0/e5PaPHjVMKAcQl6/OJlalLbuwx+N69sUB3nbaSX3DRXU6CwbqnMbiRIgadcsA//bfs8WNdArO04eXABPonFjZu1dr7CN+UekZ70uhKmQd7w/9wZVPwWh5A9sfblCDb0fWAPQqyWvqJK6VOrotm/AyAPsoWT8JhLymky6zXHvprsZX2oyPDurdw6urrVs+Y1IZtlvIKDb10xr7NQLsRsrmniipz6tRp8wdQ7Bt2gLUtA8YIbuAD9M6Bf6ONsF9xQAGwGINFCrevrf3e7c5f6a58IrQrGwX4mb2+LTrrlP/tIjIhQ20LK2Mlsq2A4QOAAPzKgE516iDGak1rvHxLY9Kowsg6Y8jMLNpuqQ1FQQcmE0JoKZKGH2QjwnnjNOYpxlWR1qXUM1XHpbz8MJ76UYpiqdT3AMrnGgcq5vV6C7BlLKG2Z3OG4/UYjdkvEFBfpjX1x7/0VXe0WMCk+03zvmjQ== 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:(13230040)(1800799024)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2024 11:53:03.1258 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f82380ce-e09a-4b09-cce1-08dd03d9bacf 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: MWH0EPF000989EC.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYXPR12MB9277 Add SoundWire machine driver for legacy(No DSP) stack for ACP6.3 platform. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/acp/Kconfig | 22 ++ sound/soc/amd/acp/Makefile | 2 + sound/soc/amd/acp/acp-sdw-legacy-mach.c | 486 ++++++++++++++++++++++++ sound/soc/amd/acp/soc_amd_sdw_common.h | 2 + 4 files changed, 512 insertions(+) create mode 100644 sound/soc/amd/acp/acp-sdw-legacy-mach.c diff --git a/sound/soc/amd/acp/Kconfig b/sound/soc/amd/acp/Kconfig index acd047d558bd..03f3fcbba5af 100644 --- a/sound/soc/amd/acp/Kconfig +++ b/sound/soc/amd/acp/Kconfig @@ -144,6 +144,28 @@ config SND_SOC_AMD_SOF_SDW_MACH on AMD platform. If unsure select "N". +config SND_SOC_AMD_LEGACY_SDW_MACH + tristate "AMD Legacy(No DSP) Soundwire Machine Driver Support" + depends on X86 && PCI && ACPI + depends on SOUNDWIRE + select SND_SOC_AMD_SDW_MACH_COMMON + select SND_SOC_SDW_UTILS + select SND_SOC_DMIC + select SND_SOC_RT711_SDW + select SND_SOC_RT711_SDCA_SDW + select SND_SOC_RT712_SDCA_SDW + select SND_SOC_RT712_SDCA_DMIC_SDW + select SND_SOC_RT1316_SDW + select SND_SOC_RT715_SDW + select SND_SOC_RT715_SDCA_SDW + select SND_SOC_RT722_SDCA_SDW + help + This option enables Legacy(No DSP) sound card support for SoundWire + enabled AMD platforms along with ACP PDM controller. + Say Y if you want to enable SoundWire based machine driver support + on AMD platform. + If unsure select "N". + endif # SND_SOC_AMD_ACP_COMMON config SND_AMD_SOUNDWIRE_ACPI diff --git a/sound/soc/amd/acp/Makefile b/sound/soc/amd/acp/Makefile index 0e6c4022e7a2..bb2702036338 100644 --- a/sound/soc/amd/acp/Makefile +++ b/sound/soc/amd/acp/Makefile @@ -25,6 +25,7 @@ snd-acp-sof-mach-y := acp-sof-mach.o snd-soc-acpi-amd-match-y := amd-acp63-acpi-match.o snd-acp-sdw-mach-y := acp-sdw-mach-common.o snd-acp-sdw-sof-mach-y += acp-sdw-sof-mach.o +snd-acp-sdw-legacy-mach-y += acp-sdw-legacy-mach.o obj-$(CONFIG_SND_SOC_AMD_ACP_PCM) += snd-acp-pcm.o obj-$(CONFIG_SND_SOC_AMD_ACP_I2S) += snd-acp-i2s.o @@ -44,3 +45,4 @@ obj-$(CONFIG_SND_SOC_AMD_SOF_MACH) += snd-acp-sof-mach.o obj-$(CONFIG_SND_SOC_ACPI_AMD_MATCH) += snd-soc-acpi-amd-match.o obj-$(CONFIG_SND_SOC_AMD_SDW_MACH_COMMON) += snd-acp-sdw-mach.o obj-$(CONFIG_SND_SOC_AMD_SOF_SDW_MACH) += snd-acp-sdw-sof-mach.o +obj-$(CONFIG_SND_SOC_AMD_LEGACY_SDW_MACH) += snd-acp-sdw-legacy-mach.o diff --git a/sound/soc/amd/acp/acp-sdw-legacy-mach.c b/sound/soc/amd/acp/acp-sdw-legacy-mach.c new file mode 100644 index 000000000000..48952a238946 --- /dev/null +++ b/sound/soc/amd/acp/acp-sdw-legacy-mach.c @@ -0,0 +1,486 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright(c) 2024 Advanced Micro Devices, Inc. + +/* + * acp-sdw-legacy-mach - ASoC legacy Machine driver for AMD SoundWire platforms + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "soc_amd_sdw_common.h" +#include "../../codecs/rt711.h" + +static unsigned long soc_sdw_quirk = RT711_JD1; +static int quirk_override = -1; +module_param_named(quirk, quirk_override, int, 0444); +MODULE_PARM_DESC(quirk, "Board-specific quirk override"); + +static void log_quirks(struct device *dev) +{ + if (SOC_JACK_JDSRC(soc_sdw_quirk)) + dev_dbg(dev, "quirk realtek,jack-detect-source %ld\n", + SOC_JACK_JDSRC(soc_sdw_quirk)); + if (soc_sdw_quirk & ASOC_SDW_ACP_DMIC) + dev_dbg(dev, "quirk SOC_SDW_ACP_DMIC enabled\n"); +} + +static int soc_sdw_quirk_cb(const struct dmi_system_id *id) +{ + soc_sdw_quirk = (unsigned long)id->driver_data; + return 1; +} + +static const struct dmi_system_id soc_sdw_quirk_table[] = { + { + .callback = soc_sdw_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "AMD"), + DMI_MATCH(DMI_PRODUCT_NAME, "Birman-PHX"), + }, + .driver_data = (void *)RT711_JD2, + }, + {} +}; + +static const struct snd_soc_ops sdw_ops = { + .startup = asoc_sdw_startup, + .prepare = asoc_sdw_prepare, + .trigger = asoc_sdw_trigger, + .hw_params = asoc_sdw_hw_params, + .hw_free = asoc_sdw_hw_free, + .shutdown = asoc_sdw_shutdown, +}; + +static const char * const type_strings[] = {"SimpleJack", "SmartAmp", "SmartMic"}; + +static int create_sdw_dailink(struct snd_soc_card *card, + struct asoc_sdw_dailink *soc_dai, + struct snd_soc_dai_link **dai_links, + int *be_id, struct snd_soc_codec_conf **codec_conf, + struct snd_soc_dai_link_component *sdw_platform_component) +{ + struct device *dev = card->dev; + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); + struct amd_mc_ctx *amd_ctx = (struct amd_mc_ctx *)ctx->private; + struct asoc_sdw_endpoint *soc_end; + int cpu_pin_id; + int stream; + int ret; + + list_for_each_entry(soc_end, &soc_dai->endpoints, list) { + if (soc_end->name_prefix) { + (*codec_conf)->dlc.name = soc_end->codec_name; + (*codec_conf)->name_prefix = soc_end->name_prefix; + (*codec_conf)++; + } + + if (soc_end->include_sidecar) { + ret = soc_end->codec_info->add_sidecar(card, dai_links, codec_conf); + if (ret) + return ret; + } + } + + for_each_pcm_streams(stream) { + static const char * const sdw_stream_name[] = { + "SDW%d-PIN%d-PLAYBACK", + "SDW%d-PIN%d-CAPTURE", + "SDW%d-PIN%d-PLAYBACK-%s", + "SDW%d-PIN%d-CAPTURE-%s", + }; + struct snd_soc_dai_link_ch_map *codec_maps; + struct snd_soc_dai_link_component *codecs; + struct snd_soc_dai_link_component *cpus; + int num_cpus = hweight32(soc_dai->link_mask[stream]); + int num_codecs = soc_dai->num_devs[stream]; + int playback, capture; + int j = 0; + char *name; + + if (!soc_dai->num_devs[stream]) + continue; + + soc_end = list_first_entry(&soc_dai->endpoints, + struct asoc_sdw_endpoint, list); + + *be_id = soc_end->dai_info->dailink[stream]; + if (*be_id < 0) { + dev_err(dev, "Invalid dailink id %d\n", *be_id); + return -EINVAL; + } + + switch (amd_ctx->acp_rev) { + case ACP63_PCI_REV: + ret = get_acp63_cpu_pin_id(ffs(soc_end->link_mask - 1), + *be_id, &cpu_pin_id, dev); + if (ret) + return ret; + break; + default: + return -EINVAL; + } + /* create stream name according to first link id */ + if (ctx->append_dai_type) { + name = devm_kasprintf(dev, GFP_KERNEL, + sdw_stream_name[stream + 2], + ffs(soc_end->link_mask) - 1, + cpu_pin_id, + type_strings[soc_end->dai_info->dai_type]); + } else { + name = devm_kasprintf(dev, GFP_KERNEL, + sdw_stream_name[stream], + ffs(soc_end->link_mask) - 1, + cpu_pin_id); + } + if (!name) + return -ENOMEM; + + cpus = devm_kcalloc(dev, num_cpus, sizeof(*cpus), GFP_KERNEL); + if (!cpus) + return -ENOMEM; + + codecs = devm_kcalloc(dev, num_codecs, sizeof(*codecs), GFP_KERNEL); + if (!codecs) + return -ENOMEM; + + codec_maps = devm_kcalloc(dev, num_codecs, sizeof(*codec_maps), GFP_KERNEL); + if (!codec_maps) + return -ENOMEM; + + list_for_each_entry(soc_end, &soc_dai->endpoints, list) { + if (!soc_end->dai_info->direction[stream]) + continue; + + int link_num = ffs(soc_end->link_mask) - 1; + + cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, + "SDW%d Pin%d", + link_num, cpu_pin_id); + dev_dbg(dev, "cpu->dai_name:%s\n", cpus->dai_name); + if (!cpus->dai_name) + return -ENOMEM; + + codec_maps[j].cpu = 0; + codec_maps[j].codec = j; + + codecs[j].name = soc_end->codec_name; + codecs[j].dai_name = soc_end->dai_info->dai_name; + j++; + } + + WARN_ON(j != num_codecs); + + playback = (stream == SNDRV_PCM_STREAM_PLAYBACK); + capture = (stream == SNDRV_PCM_STREAM_CAPTURE); + + asoc_sdw_init_dai_link(dev, *dai_links, be_id, name, playback, capture, + cpus, num_cpus, sdw_platform_component, + 1, codecs, num_codecs, + 0, asoc_sdw_rtd_init, &sdw_ops); + /* + * SoundWire DAILINKs use 'stream' functions and Bank Switch operations + * based on wait_for_completion(), tag them as 'nonatomic'. + */ + (*dai_links)->nonatomic = true; + (*dai_links)->ch_maps = codec_maps; + + list_for_each_entry(soc_end, &soc_dai->endpoints, list) { + if (soc_end->dai_info->init) + soc_end->dai_info->init(card, *dai_links, + soc_end->codec_info, + playback); + } + + (*dai_links)++; + } + + return 0; +} + +static int create_sdw_dailinks(struct snd_soc_card *card, + struct snd_soc_dai_link **dai_links, int *be_id, + struct asoc_sdw_dailink *soc_dais, + struct snd_soc_codec_conf **codec_conf) +{ + struct device *dev = card->dev; + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); + struct amd_mc_ctx *amd_ctx = (struct amd_mc_ctx *)ctx->private; + struct snd_soc_dai_link_component *sdw_platform_component; + int ret; + + sdw_platform_component = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link_component), + GFP_KERNEL); + if (!sdw_platform_component) + return -ENOMEM; + + switch (amd_ctx->acp_rev) { + case ACP63_PCI_REV: + sdw_platform_component->name = "amd_ps_sdw_dma.0"; + break; + default: + return -EINVAL; + } + + /* generate DAI links by each sdw link */ + while (soc_dais->initialised) { + int current_be_id; + + ret = create_sdw_dailink(card, soc_dais, dai_links, + ¤t_be_id, codec_conf, sdw_platform_component); + if (ret) + return ret; + + /* Update the be_id to match the highest ID used for SDW link */ + if (*be_id < current_be_id) + *be_id = current_be_id; + + soc_dais++; + } + + return 0; +} + +static int create_dmic_dailinks(struct snd_soc_card *card, + struct snd_soc_dai_link **dai_links, int *be_id, int no_pcm) +{ + struct device *dev = card->dev; + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); + struct amd_mc_ctx *amd_ctx = (struct amd_mc_ctx *)ctx->private; + struct snd_soc_dai_link_component *pdm_cpu; + struct snd_soc_dai_link_component *pdm_platform; + int ret; + + pdm_cpu = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link_component), GFP_KERNEL); + if (!pdm_cpu) + return -ENOMEM; + + pdm_platform = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link_component), GFP_KERNEL); + if (!pdm_platform) + return -ENOMEM; + + switch (amd_ctx->acp_rev) { + case ACP63_PCI_REV: + pdm_cpu->name = "acp_ps_pdm_dma.0"; + pdm_platform->name = "acp_ps_pdm_dma.0"; + break; + default: + return -EINVAL; + } + + *be_id = ACP_DMIC_BE_ID; + ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, "acp-dmic-codec", + 0, 1, // DMIC only supports capture + pdm_cpu->name, pdm_platform->name, 1, + "dmic-codec.0", "dmic-hifi", no_pcm, + asoc_sdw_dmic_init, NULL); + if (ret) + return ret; + + (*dai_links)++; + + return 0; +} + +static int soc_card_dai_links_create(struct snd_soc_card *card) +{ + struct device *dev = card->dev; + struct snd_soc_acpi_mach *mach = dev_get_platdata(card->dev); + int sdw_be_num = 0, dmic_num = 0; + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); + struct snd_soc_acpi_mach_params *mach_params = &mach->mach_params; + struct asoc_sdw_endpoint *soc_ends __free(kfree) = NULL; + struct asoc_sdw_dailink *soc_dais __free(kfree) = NULL; + struct snd_soc_codec_conf *codec_conf; + struct snd_soc_dai_link *dai_links; + int num_devs = 0; + int num_ends = 0; + int num_links; + int be_id = 0; + int ret; + + ret = asoc_sdw_count_sdw_endpoints(card, &num_devs, &num_ends); + if (ret < 0) { + dev_err(dev, "failed to count devices/endpoints: %d\n", ret); + return ret; + } + + /* One per DAI link, worst case is a DAI link for every endpoint */ + soc_dais = kcalloc(num_ends, sizeof(*soc_dais), GFP_KERNEL); + if (!soc_dais) + return -ENOMEM; + + /* One per endpoint, ie. each DAI on each codec/amp */ + soc_ends = kcalloc(num_ends, sizeof(*soc_ends), GFP_KERNEL); + if (!soc_ends) + return -ENOMEM; + + ret = asoc_sdw_parse_sdw_endpoints(card, soc_dais, soc_ends, &num_devs); + if (ret < 0) + return ret; + + sdw_be_num = ret; + + /* enable dmic */ + if (soc_sdw_quirk & ASOC_SDW_ACP_DMIC || mach_params->dmic_num) + dmic_num = 1; + + dev_dbg(dev, "sdw %d, dmic %d", sdw_be_num, dmic_num); + + codec_conf = devm_kcalloc(dev, num_devs, sizeof(*codec_conf), GFP_KERNEL); + if (!codec_conf) + return -ENOMEM; + + /* allocate BE dailinks */ + num_links = sdw_be_num + dmic_num; + dai_links = devm_kcalloc(dev, num_links, sizeof(*dai_links), GFP_KERNEL); + if (!dai_links) + return -ENOMEM; + + card->codec_conf = codec_conf; + card->num_configs = num_devs; + card->dai_link = dai_links; + card->num_links = num_links; + + /* SDW */ + if (sdw_be_num) { + ret = create_sdw_dailinks(card, &dai_links, &be_id, + soc_dais, &codec_conf); + if (ret) + return ret; + } + + /* dmic */ + if (dmic_num > 0) { + if (ctx->ignore_internal_dmic) { + dev_warn(dev, "Ignoring ACP DMIC\n"); + } else { + ret = create_dmic_dailinks(card, &dai_links, &be_id, 0); + if (ret) + return ret; + } + } + + WARN_ON(codec_conf != card->codec_conf + card->num_configs); + WARN_ON(dai_links != card->dai_link + card->num_links); + + return ret; +} + +static int mc_probe(struct platform_device *pdev) +{ + struct snd_soc_acpi_mach *mach = dev_get_platdata(&pdev->dev); + struct snd_soc_card *card; + struct amd_mc_ctx *amd_ctx; + struct asoc_sdw_mc_private *ctx; + int amp_num = 0, i; + int ret; + + amd_ctx = devm_kzalloc(&pdev->dev, sizeof(*amd_ctx), GFP_KERNEL); + if (!amd_ctx) + return -ENOMEM; + + amd_ctx->acp_rev = mach->mach_params.subsystem_rev; + amd_ctx->max_sdw_links = ACP63_SDW_MAX_LINKS; + ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); + if (!ctx) + return -ENOMEM; + ctx->codec_info_list_count = asoc_sdw_get_codec_info_list_count(); + ctx->private = amd_ctx; + card = &ctx->card; + card->dev = &pdev->dev; + card->name = "amd-soundwire"; + card->owner = THIS_MODULE; + card->late_probe = asoc_sdw_card_late_probe; + + snd_soc_card_set_drvdata(card, ctx); + + dmi_check_system(soc_sdw_quirk_table); + + if (quirk_override != -1) { + dev_info(card->dev, "Overriding quirk 0x%lx => 0x%x\n", + soc_sdw_quirk, quirk_override); + soc_sdw_quirk = quirk_override; + } + + log_quirks(card->dev); + + ctx->mc_quirk = soc_sdw_quirk; + dev_dbg(card->dev, "legacy quirk 0x%lx\n", ctx->mc_quirk); + /* reset amp_num to ensure amp_num++ starts from 0 in each probe */ + for (i = 0; i < ctx->codec_info_list_count; i++) + codec_info_list[i].amp_num = 0; + + ret = soc_card_dai_links_create(card); + if (ret < 0) + return ret; + + /* + * the default amp_num is zero for each codec and + * amp_num will only be increased for active amp + * codecs on used platform + */ + for (i = 0; i < ctx->codec_info_list_count; i++) + amp_num += codec_info_list[i].amp_num; + + card->components = devm_kasprintf(card->dev, GFP_KERNEL, + " cfg-amp:%d", amp_num); + if (!card->components) + return -ENOMEM; + if (mach->mach_params.dmic_num) { + card->components = devm_kasprintf(card->dev, GFP_KERNEL, + "%s mic:dmic cfg-mics:%d", + card->components, + mach->mach_params.dmic_num); + if (!card->components) + return -ENOMEM; + } + + /* Register the card */ + ret = devm_snd_soc_register_card(card->dev, card); + if (ret) { + dev_err_probe(card->dev, ret, "snd_soc_register_card failed %d\n", ret); + asoc_sdw_mc_dailink_exit_loop(card); + return ret; + } + + platform_set_drvdata(pdev, card); + + return ret; +} + +static void mc_remove(struct platform_device *pdev) +{ + struct snd_soc_card *card = platform_get_drvdata(pdev); + + asoc_sdw_mc_dailink_exit_loop(card); +} + +static const struct platform_device_id mc_id_table[] = { + { "amd_sdw", }, + {} +}; +MODULE_DEVICE_TABLE(platform, mc_id_table); + +static struct platform_driver soc_sdw_driver = { + .driver = { + .name = "amd_sdw", + .pm = &snd_soc_pm_ops, + }, + .probe = mc_probe, + .remove = mc_remove, + .id_table = mc_id_table, +}; + +module_platform_driver(soc_sdw_driver); + +MODULE_DESCRIPTION("ASoC AMD SoundWire Legacy Generic Machine driver"); +MODULE_AUTHOR("Vijendar Mukunda "); +MODULE_LICENSE("GPL"); +MODULE_IMPORT_NS(SND_SOC_SDW_UTILS); +MODULE_IMPORT_NS(SND_SOC_AMD_SDW_MACH); diff --git a/sound/soc/amd/acp/soc_amd_sdw_common.h b/sound/soc/amd/acp/soc_amd_sdw_common.h index eba92cd004d4..b7bae107c13e 100644 --- a/sound/soc/amd/acp/soc_amd_sdw_common.h +++ b/sound/soc/amd/acp/soc_amd_sdw_common.h @@ -36,6 +36,8 @@ #define ACP63_SW1_AUDIO0_TX 0 #define ACP63_SW1_AUDIO0_RX 1 +#define ACP_DMIC_BE_ID 4 + struct amd_mc_ctx { unsigned int acp_rev; unsigned int max_sdw_links; From patchwork Wed Nov 13 11:52:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 13873484 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2086.outbound.protection.outlook.com [40.107.220.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D11420263C; Wed, 13 Nov 2024 11:53:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.86 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731498789; cv=fail; b=HTpxGtp4hfWL+GXqN0xakPt17pHAZN6nvlel2V7TSow5PivrqNKzSTWCam0u/7r9qE3NO6c6FR7TJHU3ON3LmlRRxhkP3RSR9IkIlOMa5CqaoOzhJfBPqR8cPDsJOL4JU7eNQa+qDzzElDDjhZgcCD8wGp1Gs86191gUwa5DjPw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731498789; c=relaxed/simple; bh=E0iB/Y7A8bBtGh9STxLDrCQ9i8JJno7/0PgSloXlh50=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YiT9w1PTjL3nYDqljoy7+srP4eeeGXN20VyZzvaYkiFABj2IzmoJ8G/DjMJtRJXx38I2I6KBQU71KCucDUWXhLhTTRiJavImwQGbPRF/Cg05nfBwnglFMGVjk9xSMgzj6R2whNEj8vhYVaLabExFQSDOxbTUlux9l1o0t8PCl00= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=SpcU5HS3; arc=fail smtp.client-ip=40.107.220.86 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="SpcU5HS3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rd0vI9BJqPKuHuFLmp+ISxBVkNugUdFerVp9DTalXhDWW5nscaaxkdkTBzCy3EdpQt08T3JLOE5ZOH6chAwq/s4OQMI4khSwHKvaq/IfAfFU+WO395D4BrwbBY4AERXH5rnQMieLch5JlJeydjZdqazZxwILnHFMEEZSwUk9MwTKk4j/feYSNAcuaTubh2h5SDGuGINsgsjoBMBvxNsKMn1n2uN4TrkkApyksKJbWpwalrnBu3JYKhYNRy7A3tqQ2JWx+SjMS2fkIBaKvDYJXHst6QBuk+h5f/cOIXdg1hsXq54+rThvFkQYli5CVg8sX4CVX7uJMwzisbHUEj5g7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=LP9yTetBwovcFli0rlNhn/0czsgrjnQoS3v5xWEfxcY=; b=hA3dGN2ldIqU/FdJP0BolqvIFjRBwfg4PRzlH6QS2yI0vMJNdMrTSKTUZO7+M/k0yc8QZwf1qLh49+GtTB+hJaxEd6eruI0qtfFZGHcnk48cWF0far7Al5oaMZZdzTPvdTlJ9zf8rNLW0RTiD2hreoB0+s/og5HmzDkl8l6vfEn5qTel0KjFc4g3KWRUhVXT8dJ2Kxs7YHxpXl7Gi9/+ARpiwHECcU1W1pEHDORNTOkkS9aOcwfZn3ay864c91Impt3fMbv0ro3XTbKLcaFoysrTokQbazob9pyBSfWBcX+10E8W2Ottj98V5bhsti/RcJbYy+WNt0ttez6YKywekg== 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 (0) 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=LP9yTetBwovcFli0rlNhn/0czsgrjnQoS3v5xWEfxcY=; b=SpcU5HS3ADq9VOXjz5Bd1EebZgI8d/DqnlaUE9XMeMpgsyGSdQ4+L/nPszrbVaI3vuo2v/xlexPHTzjhrZf1oI/Ne3nqUm21ygKAaxF9jODJ2jTLOrNAFCriTGM59CCHFDdDWb4be53Zj2jbE7E9e6GZWnlshxQpt0EK3XmO5Gw= Received: from BY5PR13CA0022.namprd13.prod.outlook.com (2603:10b6:a03:180::35) by MW4PR12MB8610.namprd12.prod.outlook.com (2603:10b6:303:1ef::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.27; Wed, 13 Nov 2024 11:53:06 +0000 Received: from MWH0EPF000989EC.namprd02.prod.outlook.com (2603:10b6:a03:180:cafe::12) by BY5PR13CA0022.outlook.office365.com (2603:10b6:a03:180::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.14 via Frontend Transport; Wed, 13 Nov 2024 11:53:05 +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 MWH0EPF000989EC.mail.protection.outlook.com (10.167.241.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.14 via Frontend Transport; Wed, 13 Nov 2024 11:53:05 +0000 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) 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.2507.39; Wed, 13 Nov 2024 05:53:01 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , , , , Vijendar Mukunda Subject: [PATCH 6/6] ASoC: amd: ps: fix the pcm device numbering for acp 6.3 platform Date: Wed, 13 Nov 2024 17:22:23 +0530 Message-ID: <20241113115223.3274868-7-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241113115223.3274868-1-Vijendar.Mukunda@amd.com> References: <20241113115223.3274868-1-Vijendar.Mukunda@amd.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989EC:EE_|MW4PR12MB8610:EE_ X-MS-Office365-Filtering-Correlation-Id: 294eafc2-c332-480d-bd7f-08dd03d9bc24 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: BHNvFqS98cDDfLtQn3nLvsAvxm3gmYwnbGzb7rAkKT5PLXDL+ELct1XR+Ut9bo+MUdMNdim/cq1Nfn8AhtgMCXKuLv9OfTISN+r6Iktxkw6jMfAehM8D3JcJ9j1vzpg+x9fO+AVLXq38qSyAoMzqAgt2liHa6fwBVx5sHKFJqi+x9vGVjp/zr6avUThyz6OIist741XzoQDQYGVvBk8q1LbGTjVxcRj2PrVDoglsihA3i2dstRBgAaQhjwPP0C+LG/iH5j9YhJ/D+SOsPI/t6Bt6+5WIXxx4UA2yIZAl/NyDryzDOBHnWjVSkayfSE4K+Q03Y59De2XgK8mlvj99CsqnYHwJ2+ltCPXm3EUrU26h/ro7ocHiiU8/M+mk4yJh1K3inprG6HU1ei1G4IEa/4gzEU1fO+LKu86dI/0PVmuUQuEht2chc98LI+guIbp19pcb2vgAv3iyZ1B5KZSeKFoB62bF3dLdssTs84BZdQO0qek7Ac0VMYhUtJrUoI3UBny5VbPx/btdnoTp1nl8MnvZYpp8tqd413/QMnB2uYncQK7gAgwqBj/+/CdHmpiJQScc+r0S+8dBMCRmMz8KnkgRMCLl8/Sq5YjYoBX/b5TEdEQSsz5rLLWZwTUcKL/10rpWeRUt+6olgVRSfXWVz8NY256x08/iUroR+oX0u9MR9EibM1HLRXg1mAGiJAMw9I9Q1fbYc7hs70hkQompxqCa3Z5VNzUSBaE0ZNIq1n2sBvnCQ15rYH7iSrmxwqYy8AQ2n2Vmy44w4agLhC5mmL9OeD7qEVBshS0KjxEmPbor1ILkRV+VAOB/8IH71Ea84biZYYDePw8f1NJuZFGfA989ctDjk2nua23mQ9YBqxvljcKkVdhjVkCPFfON9N0o1EHL4nZ8EwpAEJg2EF+/CYAY/BoClpr/PiC2FHOSXMyh2teHeLPZO9INo5IZmNqaMcDiKagUDAjcOgtzfpknx9kvuX6qbFPq69VyRJjIalw9UEe7Kxm1jTd/lDeAvJXYaOFsFiMNUtHCJKmKcArgmX0X2V/hPacFow3tiNuKxjFT0mbfNWPRgcx2HcphXaZP6fuac3ggIaCFAeYS9Mbmfkq4tpdrcZcA7zT6Wv0zvuZPjDQvtVrS2aJi5p7wbY5djeaEoPOwNbJ5YHYCglf+2Z8GHI97VP49gAeootx65i10L0I/0ohTO56EbgUdofxDf8RjJbh14GYypi2Z9W7eUMIOI3FvBitqx6zJRsp8lv4kXemyqFEu3eF4dvC2mRB+wupuwDhSDzZyrMqKZLuRRzMYYq0mvdNDf/R6f0GYhNzoMpPbKbrl2w9suCIZKmU6FZFPGudNLx9YgZ/UfR//nXyB5+OhZmbWrbVMtovq+BOQdM47fzlVirdBzddchCrCE5X+0QexfqM1t8tUCmVJQw== 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:(13230040)(36860700013)(376014)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2024 11:53:05.3601 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 294eafc2-c332-480d-bd7f-08dd03d9bc24 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: MWH0EPF000989EC.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB8610 Fixed PCM device numbering is required for defining common alsa ucm changes for generic soundwire machine driver for legacy(No DSP) stack. Ex: For Headphone playback use case, use PCM device number as 0. For Headset mic Capture use case, PCM device number as 1. Set the 'use_dai_pcm_id' flag true in soundwire dma driver for acp 6.3 platform. This will fix the pcm device numbering based on dai_link->id. Signed-off-by: Vijendar Mukunda --- sound/soc/amd/ps/ps-sdw-dma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/amd/ps/ps-sdw-dma.c b/sound/soc/amd/ps/ps-sdw-dma.c index 3b4b9c6b3171..b602cca92b8b 100644 --- a/sound/soc/amd/ps/ps-sdw-dma.c +++ b/sound/soc/amd/ps/ps-sdw-dma.c @@ -445,6 +445,8 @@ static const struct snd_soc_component_driver acp63_sdw_component = { .trigger = acp63_sdw_dma_trigger, .pointer = acp63_sdw_dma_pointer, .pcm_construct = acp63_sdw_dma_new, + .use_dai_pcm_id = true, + }; static int acp63_sdw_platform_probe(struct platform_device *pdev)