From patchwork Thu Aug 1 09:14:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816078 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 (unknown [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 6E8EAC3DA64 for ; Thu, 1 Aug 2024 09:16:29 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 61F25397C; Thu, 1 Aug 2024 11:16:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 61F25397C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722503781; bh=DEyriH/vPZc9JnNMAOgPz51EJsfR+N8BIQziaDRC/is=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ol1kI+0yVoIQG8FoNBhBxeZaKn9C5ZxnA9pNtwGz6z3b98ookk49t5Rztqec1/7J6 6H3DNIPlVgGEz/GEZqakRnyQ61zbl0tWrQN2lefkuh8cnOL65joIaooL1yQS02k8BG Ojd1124HY+KPWvAfCiAP1L7qJXxwct0DJXPHDQqo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 62047F805C3; Thu, 1 Aug 2024 11:16:01 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id B2075F805A9; Thu, 1 Aug 2024 11:16:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 41BD3F8026A; Thu, 1 Aug 2024 11:15:53 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on20619.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e88::619]) (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 2A159F8019B for ; Thu, 1 Aug 2024 11:15:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2A159F8019B Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=ICVstOlH ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=W/E2nverHfgXjUktT1DIBVcn2G96JdphA35S/02HK4T4GDo+g27waJ7dUHbtT2VoCCraIdZmSgrDRETjCufL3HcW5TL7Qgjwc0CuG771IxjTjYpZekVRq+pop38TpFvoC0Xa7r9+AMEPVh54KTFdprFWwFtH7E3rSKVCRkV/5zFqAYbm4ENJonT4hvS7DrOsu9nkt9tqOHnG1YbeWd8mHvgsflH4ggfpX3R+h0/hCmRWxIPu0r9OLetMSyp/3rU2q+ygDtrRJB2GdQBdtx4n6fjeWQvjzL6EincIPsQBVeQIZ+ErJ5QKzT0J0Aw5E0yiQCZBfJHgl5bwR70XbLeS9Q== 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=nh6/9O6N5hkFvqNYO32bq/fMSHVHNmmNJeYjTlzMNZ4=; b=sbD0oQbvifeAUiwGEmus4DDylNA9N5p/UAGk+4XbW7DSPv9ZcP54oZHi2LldznQ9ngBApjwxSPmharlivBlOYxeUcQm2PS5qEyWG7Tv9cECJh/Bfkmvad7z5i1In71WyK9YgCTtPvkYjz81fmpx3V6wLnU3yqOAtdoGwKp+Fr2izre2RMVs/UR2ETZPpmhx5YZwZeKjP3uZ9tQEhpKjnNb0Te1PefxJHSIGBgCMzgKfaa5AQPNqNmwFcFB0lGvbQY8WhY/BzDlC2PPP/kHZ9+AJYKYQwJjtNmTAkUjPqQS1sTADtc7Yd84stiU/wtZIqrdk0mxGwWHa5FYy+70KxKg== 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=nh6/9O6N5hkFvqNYO32bq/fMSHVHNmmNJeYjTlzMNZ4=; b=ICVstOlH2R50dc1ketzZ9y+iXeID5J9/+VXMmVbETL0L9oIUe4rEVMf4J0bvCm61RIrhFhNs3vrrlt041iFS1Xse5zWSIwdFwFWuKHck6yA9FCyaBui8lurWkdq67m8JixoSxqMOvUaMPU74DiylYhW9hUDcrbUG3Trw0OOnprg= Received: from BN9PR03CA0429.namprd03.prod.outlook.com (2603:10b6:408:113::14) by SN7PR12MB6765.namprd12.prod.outlook.com (2603:10b6:806:26b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Thu, 1 Aug 2024 09:15:42 +0000 Received: from BN3PEPF0000B36F.namprd21.prod.outlook.com (2603:10b6:408:113:cafe::f6) by BN9PR03CA0429.outlook.office365.com (2603:10b6:408:113::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22 via Frontend Transport; Thu, 1 Aug 2024 09:15:42 +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 BN3PEPF0000B36F.mail.protection.outlook.com (10.167.243.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.11 via Frontend Transport; Thu, 1 Aug 2024 09:15:42 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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; Thu, 1 Aug 2024 04:15:42 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 1 Aug 2024 04:15:41 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:15:32 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Cezary Rojewski , Liam Girdwood , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Jaroslav Kysela , "Takashi Iwai" , Charles Keepax , Maciej Strozek , Chao Song , Kuninori Morimoto , Richard Fitzgerald , Brent Lu , Christophe JAILLET , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH RESEND 01/31] ASoC: intel: rename codec_info and dai_info structures names Date: Thu, 1 Aug 2024 14:44:16 +0530 Message-ID: <20240801091446.10457-2-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B36F:EE_|SN7PR12MB6765:EE_ X-MS-Office365-Filtering-Correlation-Id: 3605b40d-30fb-43db-c188-08dcb20a84d9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|82310400026|376014|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: LvUIlBtTXVS5eN6361MdOpo83UulYB9/WBY/72YKeR+oxNBdiUAkii79LUQyYLphUHS4IfiOJA9w8LaR0c5YEylkcDpuO16E48H2forlfjqW3/4ZbdQKXzXxIwSg5jZ2oiN6VGBMF6F+rnGFhfeVSMIFK5Qd4Te+VDo1F3cPhNK30NS7AkWU93LrdPxGNeMHO6bYWXrIW9e9FkxJDEYOk4qCXQ3J2VfSlF8r488xt8L/nygD21qxLIK+Hu7SQ3W259rUwTtWSY/BvliZStQfEJxPp0UneknSwSDcDGaeOYL+QcblIWtzu1QIGlmMYKhaVai9C30pMOQLlfOIuQHfyAR6N0co5wCmBG+rGe/yW+L5gdFJYU/NOT5b4w0BRFKHyzKPbR81Qk0dndjeNphbYuw5QrJypv/FAVej6fsjwCrqzqUg9sWqwE6xQ+U0P6EbtOrul36e9DeYg611FvZ0oNhJ9XcG/UkOA3vNp2f/k01dXuDsF7I3azItFMYoTECslXY+XGoFpaL2thnfdP2xkLuQnW1p3wdb8Gx8XU+H0giT6y82X6iED1gfvkxq0WDYfbOLw3kYHtSTyzDtSdPVkz1+kP4pSc+DykJYhvFNDJAy9xuNk5XG9Hvr3orqejk4hjIB9mry0lezb83mGQCzHwL2mlvQlH2CDETGlDug4ICXdJ3+iutnkMiDG2wPnOtWhWpklZXwyf1FJpuCQ8E1njJYe/Ta7iBNLsKbcXKsRqVd2zVPo5P0/bNJ0Hg8QmASeA4lbBDFU747XTCL1nFWaVaTJzB2Zgu1623vMRFroppKsWRqiVs85h/wUpPzHoHXnbZlgDsh6s+2+Cnmvn8QpI9aVVBnH5DYcto5sbSaBkYxzkmEJYRw0wtnK2gqF7C/n6AoPMh/E9OHKrFjZ5tvOPXoAvotj56HpCouoNxGCVMdu+l6ny8D4taAo8k4P9aT+97qqifhGj6F3PW6P90pPFehvJuB0CcFa9cyXv2PgtwC7jNi+Q6lJErI7UNBzKzNwII+J+aXVIKR/dNAhNReoGYMJV5C3/RXoxrgmocQyUD08tX9NFVnG+XeVhkXz+/qBMNsTw3DxudwhzJZTh53x9RlmcuSawGtS62vQZ0Kp73p91yFhjJuIbM2pflqH/cQuQw1PUgJAy01aFCJt9Ug3hmQsKaJk4FFh8X6yMGLF5af4lYEi4PT2EIwxPzU56qdvgEsHMDcLov5PWdP4zGf0+zWemBJyBSP/iQc3Uo6v7TkQx/awxcndf5MVzVj37yzC2AM22PrizIztiU/pGARUrp5kY6twCtX0neTPMl1DLIxhOz0Yqs6Mg3vFAjq0kDw0MEN7CUiQlqMoQukzI0GSgvyqbpn8pTqO3wyhhaN4LXBjpZom05v5AAaobwxPQDgQV2Tvjb3CrXx5/+Hb+pExQ== 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)(7416014)(82310400026)(376014)(36860700013)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:15:42.7266 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3605b40d-30fb-43db-c188-08dcb20a84d9 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: BN3PEPF0000B36F.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6765 Message-ID-Hash: NH6OOFWA2CQJV7XWTEZ5JSXG7TKWJOJ5 X-Message-ID-Hash: NH6OOFWA2CQJV7XWTEZ5JSXG7TKWJOJ5 X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: To make it generic, rename structure 'sof_sdw_codec_info' as 'asoc_sdw_codec_info' and 'sof_sdw_dai_info' as 'asoc_sdw_dai_info'. These structures will be moved to common header file so that it can be used by other platform machine driver. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- sound/soc/intel/boards/bridge_cs35l56.c | 2 +- sound/soc/intel/boards/sof_sdw.c | 26 +++++++++---------- sound/soc/intel/boards/sof_sdw_common.h | 24 ++++++++--------- sound/soc/intel/boards/sof_sdw_cs42l43.c | 2 +- sound/soc/intel/boards/sof_sdw_cs_amp.c | 2 +- sound/soc/intel/boards/sof_sdw_maxim.c | 2 +- sound/soc/intel/boards/sof_sdw_rt711.c | 2 +- sound/soc/intel/boards/sof_sdw_rt_amp.c | 2 +- .../boards/sof_sdw_rt_sdca_jack_common.c | 2 +- 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/sound/soc/intel/boards/bridge_cs35l56.c b/sound/soc/intel/boards/bridge_cs35l56.c index c3995e724aed..b289bcb3847a 100644 --- a/sound/soc/intel/boards/bridge_cs35l56.c +++ b/sound/soc/intel/boards/bridge_cs35l56.c @@ -127,7 +127,7 @@ int bridge_cs35l56_add_sidecar(struct snd_soc_card *card, int bridge_cs35l56_spk_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, - struct sof_sdw_codec_info *info, + struct asoc_sdw_codec_info *info, bool playback) { if (sof_sdw_quirk & SOF_SIDECAR_AMPS) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index e5feaef669d1..26c467bb81a3 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -731,7 +731,7 @@ static const struct snd_soc_ops sdw_ops = { .shutdown = sdw_shutdown, }; -static struct sof_sdw_codec_info codec_info_list[] = { +static struct asoc_sdw_codec_info codec_info_list[] = { { .part_id = 0x700, .dais = { @@ -1220,7 +1220,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { }, }; -static struct sof_sdw_codec_info *find_codec_info_part(const u64 adr) +static struct asoc_sdw_codec_info *find_codec_info_part(const u64 adr) { unsigned int part_id, sdw_version; int i; @@ -1241,7 +1241,7 @@ static struct sof_sdw_codec_info *find_codec_info_part(const u64 adr) } -static struct sof_sdw_codec_info *find_codec_info_acpi(const u8 *acpi_id) +static struct asoc_sdw_codec_info *find_codec_info_acpi(const u8 *acpi_id) { int i; @@ -1255,8 +1255,8 @@ static struct sof_sdw_codec_info *find_codec_info_acpi(const u8 *acpi_id) return NULL; } -static struct sof_sdw_codec_info *find_codec_info_dai(const char *dai_name, - int *dai_index) +static struct asoc_sdw_codec_info *find_codec_info_dai(const char *dai_name, + int *dai_index) { int i, j; @@ -1355,7 +1355,7 @@ static bool is_unique_device(const struct snd_soc_acpi_link_adr *adr_link, } static const char *get_codec_name(struct device *dev, - const struct sof_sdw_codec_info *codec_info, + const struct asoc_sdw_codec_info *codec_info, const struct snd_soc_acpi_link_adr *adr_link, int adr_index) { @@ -1383,7 +1383,7 @@ static const char *get_codec_name(struct device *dev, static int sof_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; - struct sof_sdw_codec_info *codec_info; + struct asoc_sdw_codec_info *codec_info; struct snd_soc_dai *dai; int dai_index; int ret; @@ -1451,8 +1451,8 @@ struct sof_sdw_endpoint { const char *name_prefix; bool include_sidecar; - struct sof_sdw_codec_info *codec_info; - const struct sof_sdw_dai_info *dai_info; + struct asoc_sdw_codec_info *codec_info; + const struct asoc_sdw_dai_info *dai_info; }; struct sof_sdw_dailink { @@ -1529,7 +1529,7 @@ static int parse_sdw_endpoints(struct snd_soc_card *card, for (i = 0; i < adr_link->num_adr; i++) { const struct snd_soc_acpi_adr_device *adr_dev = &adr_link->adr_d[i]; - struct sof_sdw_codec_info *codec_info; + struct asoc_sdw_codec_info *codec_info; const char *codec_name; if (!adr_dev->name_prefix) { @@ -1563,7 +1563,7 @@ static int parse_sdw_endpoints(struct snd_soc_card *card, for (j = 0; j < adr_dev->num_endpoints; j++) { const struct snd_soc_acpi_endpoint *adr_end; - const struct sof_sdw_dai_info *dai_info; + const struct asoc_sdw_dai_info *dai_info; struct sof_sdw_dailink *sof_dai; int stream; @@ -1790,7 +1790,7 @@ static int create_sdw_dailinks(struct snd_soc_card *card, static int create_ssp_dailinks(struct snd_soc_card *card, struct snd_soc_dai_link **dai_links, int *be_id, - struct sof_sdw_codec_info *ssp_info, + struct asoc_sdw_codec_info *ssp_info, unsigned long ssp_mask) { struct device *dev = card->dev; @@ -1914,7 +1914,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) struct mc_private *ctx = snd_soc_card_get_drvdata(card); struct snd_soc_acpi_mach_params *mach_params = &mach->mach_params; struct snd_soc_codec_conf *codec_conf; - struct sof_sdw_codec_info *ssp_info; + struct asoc_sdw_codec_info *ssp_info; struct sof_sdw_endpoint *sof_ends; struct sof_sdw_dailink *sof_dais; int num_devs = 0; diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index 2a3145d1feb6..ebacb55de318 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -79,9 +79,9 @@ enum { #define SOF_SDW_MAX_DAI_NUM 8 -struct sof_sdw_codec_info; +struct asoc_sdw_codec_info; -struct sof_sdw_dai_info { +struct asoc_sdw_dai_info { const bool direction[2]; /* playback & capture support */ const char *dai_name; const int dai_type; @@ -92,7 +92,7 @@ struct sof_sdw_dai_info { const int num_widgets; int (*init)(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, - struct sof_sdw_codec_info *info, + struct asoc_sdw_codec_info *info, bool playback); int (*exit)(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); int (*rtd_init)(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); @@ -100,7 +100,7 @@ struct sof_sdw_dai_info { unsigned long quirk; }; -struct sof_sdw_codec_info { +struct asoc_sdw_codec_info { const int part_id; const int version_id; const char *codec_name; @@ -108,7 +108,7 @@ struct sof_sdw_codec_info { const u8 acpi_id[ACPI_ID_LEN]; const bool ignore_pch_dmic; const struct snd_soc_ops *ops; - struct sof_sdw_dai_info dais[SOF_SDW_MAX_DAI_NUM]; + struct asoc_sdw_dai_info dais[SOF_SDW_MAX_DAI_NUM]; const int dai_num; int (*codec_card_late_probe)(struct snd_soc_card *card); @@ -153,14 +153,14 @@ int sof_sdw_dmic_init(struct snd_soc_pcm_runtime *rtd); /* RT711 support */ int sof_sdw_rt711_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, - struct sof_sdw_codec_info *info, + struct asoc_sdw_codec_info *info, bool playback); int sof_sdw_rt711_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); /* RT711-SDCA support */ int sof_sdw_rt_sdca_jack_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, - struct sof_sdw_codec_info *info, + struct asoc_sdw_codec_info *info, bool playback); int sof_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); @@ -170,20 +170,20 @@ extern const struct snd_soc_ops sof_sdw_rt1308_i2s_ops; /* generic amp support */ int sof_sdw_rt_amp_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, - struct sof_sdw_codec_info *info, + struct asoc_sdw_codec_info *info, bool playback); int sof_sdw_rt_amp_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); /* MAXIM codec support */ int sof_sdw_maxim_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, - struct sof_sdw_codec_info *info, + struct asoc_sdw_codec_info *info, bool playback); /* CS42L43 support */ int sof_sdw_cs42l43_spk_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, - struct sof_sdw_codec_info *info, + struct asoc_sdw_codec_info *info, bool playback); /* CS AMP support */ @@ -194,12 +194,12 @@ int bridge_cs35l56_add_sidecar(struct snd_soc_card *card, struct snd_soc_codec_conf **codec_conf); int bridge_cs35l56_spk_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, - struct sof_sdw_codec_info *info, + struct asoc_sdw_codec_info *info, bool playback); int sof_sdw_cs_amp_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, - struct sof_sdw_codec_info *info, + struct asoc_sdw_codec_info *info, bool playback); /* dai_link init callbacks */ diff --git a/sound/soc/intel/boards/sof_sdw_cs42l43.c b/sound/soc/intel/boards/sof_sdw_cs42l43.c index b7e2750c1074..e8370c3c96fd 100644 --- a/sound/soc/intel/boards/sof_sdw_cs42l43.c +++ b/sound/soc/intel/boards/sof_sdw_cs42l43.c @@ -123,7 +123,7 @@ int cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *da int sof_sdw_cs42l43_spk_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, - struct sof_sdw_codec_info *info, + struct asoc_sdw_codec_info *info, bool playback) { /* Do init on playback link only. */ diff --git a/sound/soc/intel/boards/sof_sdw_cs_amp.c b/sound/soc/intel/boards/sof_sdw_cs_amp.c index 10e08207619a..206fe7610a56 100644 --- a/sound/soc/intel/boards/sof_sdw_cs_amp.c +++ b/sound/soc/intel/boards/sof_sdw_cs_amp.c @@ -47,7 +47,7 @@ int cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) int sof_sdw_cs_amp_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, - struct sof_sdw_codec_info *info, + struct asoc_sdw_codec_info *info, bool playback) { /* Do init on playback link only. */ diff --git a/sound/soc/intel/boards/sof_sdw_maxim.c b/sound/soc/intel/boards/sof_sdw_maxim.c index b7f73177867f..8faa06824869 100644 --- a/sound/soc/intel/boards/sof_sdw_maxim.c +++ b/sound/soc/intel/boards/sof_sdw_maxim.c @@ -120,7 +120,7 @@ static int mx8373_sdw_late_probe(struct snd_soc_card *card) int sof_sdw_maxim_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, - struct sof_sdw_codec_info *info, + struct asoc_sdw_codec_info *info, bool playback) { info->amp_num++; diff --git a/sound/soc/intel/boards/sof_sdw_rt711.c b/sound/soc/intel/boards/sof_sdw_rt711.c index 60ff4d88e2dc..9ea8de609669 100644 --- a/sound/soc/intel/boards/sof_sdw_rt711.c +++ b/sound/soc/intel/boards/sof_sdw_rt711.c @@ -126,7 +126,7 @@ int sof_sdw_rt711_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_l int sof_sdw_rt711_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, - struct sof_sdw_codec_info *info, + struct asoc_sdw_codec_info *info, bool playback) { struct mc_private *ctx = snd_soc_card_get_drvdata(card); diff --git a/sound/soc/intel/boards/sof_sdw_rt_amp.c b/sound/soc/intel/boards/sof_sdw_rt_amp.c index d1c0f91ce589..da1a8cc1c63d 100644 --- a/sound/soc/intel/boards/sof_sdw_rt_amp.c +++ b/sound/soc/intel/boards/sof_sdw_rt_amp.c @@ -256,7 +256,7 @@ int sof_sdw_rt_amp_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_ int sof_sdw_rt_amp_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, - struct sof_sdw_codec_info *info, + struct asoc_sdw_codec_info *info, bool playback) { struct mc_private *ctx = snd_soc_card_get_drvdata(card); diff --git a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c b/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c index 4254e30ee4c3..b63f4952e7d1 100644 --- a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c +++ b/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c @@ -180,7 +180,7 @@ int sof_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_link int sof_sdw_rt_sdca_jack_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, - struct sof_sdw_codec_info *info, + struct asoc_sdw_codec_info *info, bool playback) { struct mc_private *ctx = snd_soc_card_get_drvdata(card); From patchwork Thu Aug 1 09:14:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816077 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 (unknown [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 6B1A9C49EA1 for ; Thu, 1 Aug 2024 09:31:23 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E1E2E3998; Thu, 1 Aug 2024 11:30:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E1E2E3998 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722504668; bh=SC8XXaYdHrqKX305sqiPjndkCoUs8X1omIPvwLm2EY8=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=RTsqSQxd589U4bKaE4/rexPyBvYzE7rjuoV2WB3lTqzU8HH2P/dcKt/bdHnW12tt6 6dbTzcKkyw/Qlq8M5j4tM+R+V0kE2PL4As3mTdVUsBNlv63KI8m4b/W7I2dRzOfYJp SIQ/UY21S7yPP/SC9iWnK3FvkwOXe4cf1+wQU3lU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 32A45F805FD; Thu, 1 Aug 2024 11:30:13 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 04702F80600; Thu, 1 Aug 2024 11:30:13 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A2DAAF8026A; Thu, 1 Aug 2024 11:16:27 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2062b.outbound.protection.outlook.com [IPv6:2a01:111:f403:2418::62b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4CE97F8007E for ; Thu, 1 Aug 2024 11:16:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4CE97F8007E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=oxrRF1+2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KAq6U0lA1tqV4xwzSv5yiC+ALveD5HbVZVWgcN5aLaYC3nzoxEzqg8IxLzJ9ItXb6u1WwuE2/R7uAKc2jD7xqH2sANtRRkJGTt6d5ExPVPGVDiNO/FMmdIqyn95pOY1JUBJZVED+oenkH0WdLs5IOSSoYNuc2rSNm29Q3H4/hHPRR8tpEMdz62vlBRBXjGfgDBaMl6zB607Lynd5mVZvdGcBuIGLy87wlHdYthUbufPX3qvGRQrWofTXmlEqnHKpMl1l0e3XxD3USREO0oG9cGxR5EZH7o2ng1d1A7zd5yl2WHFd1sQbMeHcGQwgts8P8Qo9+b4vpdPhnmsGQyS9Jg== 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=pb/kCjdaY9LTHpq/7zeLBfpDJbotmGDtNOiv6yPhE9E=; b=UAXirRZI0wnA+nUPVtJdppDhuCxsIvxO6SmFUWja8ppy9hAfVuytr6vlT9XCk2g+ruQiJNc9VOLf6gEyI/ac1G/Zv/rsnI5cT6AfdaCjxH4TTlY7nng0JjJf5ESg/pavHPP8lN08dpt3tGukbTSPYzbtS/mMQjdlKk+Uza/PSI5Ts5g+bOUHgEUtB1aYrmN4XSjepm72TachJZW/3gLmcRiK4iUXcFtOSyLm/i+uIodGe1H/t/MSDejWJdXLKfbKrtOMKIGgwJAHInzV3z2r2j2GGVMNnzhmFCkmKS8DwSr/SLVZq6B8PtteUgha6CtDb6t5NFHpujM6lI4l7wdPRQ== 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=pb/kCjdaY9LTHpq/7zeLBfpDJbotmGDtNOiv6yPhE9E=; b=oxrRF1+2NdYEc1Heqo4lW3w5nyPud5BJwFfMgxIctOfSuP7Hd3ubZaH8ctRiwE7tZWV8eT+iKJPryMQtw7zKP2m3B4kfpw/RI6MwHviRREtXX1XNkyVTSoTQwzs9skoIYAk7Nn0A8OGDLNeHLebrODXYhcHjCbbXakybhFau8Pg= Received: from CH2PR08CA0010.namprd08.prod.outlook.com (2603:10b6:610:5a::20) by LV8PR12MB9336.namprd12.prod.outlook.com (2603:10b6:408:208::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Thu, 1 Aug 2024 09:16:15 +0000 Received: from CH2PEPF0000013F.namprd02.prod.outlook.com (2603:10b6:610:5a:cafe::8) by CH2PR08CA0010.outlook.office365.com (2603:10b6:610:5a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.35 via Frontend Transport; Thu, 1 Aug 2024 09:16:15 +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 CH2PEPF0000013F.mail.protection.outlook.com (10.167.244.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:16:14 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) 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.2507.39; Thu, 1 Aug 2024 04:16:13 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 1 Aug 2024 04:16:11 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:16:04 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Cezary Rojewski , Liam Girdwood , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Jaroslav Kysela , "Takashi Iwai" , Maciej Strozek , Charles Keepax , Chao Song , Kuninori Morimoto , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH RESEND 02/31] ASoC: intel: rename soundwire common header macros Date: Thu, 1 Aug 2024 14:44:17 +0530 Message-ID: <20240801091446.10457-3-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB05.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000013F:EE_|LV8PR12MB9336:EE_ X-MS-Office365-Filtering-Correlation-Id: f5afe7d8-0eb1-4546-9319-08dcb20a9806 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|82310400026|376014|7416014; X-Microsoft-Antispam-Message-Info: 6BymWJNOBam272jHfptgxBtMJdjsfFGhOIXy71PpsdizT4Ck96bcNCIRrmVMad/fqt0VoK7HLg0lF1Oamg3sSaFapDvaWteUnRf2yu2qyGBG5RevWjej68ne4OAWBaa+0R0H7NqU44bbnTXdTJhnVPGsXnzeqXZYVaXOrcxE/BgrO1uDnRwcQdLW3+pSJHBdz77rzEQtHSMGmGOIgZQLLo83PW9th/FjkwrncAUDdJFx+xJoaVkQdU9yIY4hNkvTfKx1mxn0yfV9p+nQDK3Wwwfl7tt8HdjQW+I5yGfLRnO7NKqYXuKHE0FXyZ9dN/Xy9+sX03BWrpBpuxpAcgoPJPe6sbtKUUD8nQ5cqY3diiIe3KXkEdyZARLKG7qtJHXRF4k8C+EH6bzloOMAjTpoOOfNZWVUiapzKGTlkNZcsdYAe4k9G9tGP62/R5GiTnvCeUlEy0VrMSrs6z0Ua4ZypsEW/FOiMkGJsDnulgFQtpyc5gS50H1SC9XWLlb3v9lEeakhClrCioAfd6p8AE3FAij+wfM6iEw3Onf53ZlicxFXwbl+BFnRtZnuqfhVp5svxCltWWvC6xcR0GK7oSywzQdm8bS/R6BRIufEYWDRQxZES5kutTv3oYhDXv1+I8UHVnvwe+siyDhvlULF7v75fsLihL5lDSYojJ9zvShTDmte+JOBFkrUmCTZdtEyDKITw9Nf8Q+0A5Dr0WM2XZVApI8aTEX5d7moYUUKBsSZVhpmc3syCo+XCCvE+yQJsQOguTOAMd0EiI6XtRg7GkzkG3HLGEXdDviEKwNJ6SI/jeh3h1nfkQFa0bopDtTIcs6yrY69LB/uTG6TLnA5EL7RV5dhIZOBOmp8Zn4X93tNO3fhMiCc0WHCr8byJPhCgPFdjeZaewxtw+anQMEHadGlbCgWnBbygim1avhXuvm5OGJAg5+WBH+sPILTIscqVlGJsKn3qYTP2wvHX2lXNwmtZKQp18tASpvd6EHQcmP+AuUcX2TZsqMTtm4Fit5eCvUsl+eiuh6W8p7KK0Ge4KVjO7rYSzqha1qF6cuExtbe/jUZlBmel4oK0NMU6IHw+zKm6p+A0rCy67yuLRqTblI5tnmPI778QOorfbEPfToUdGqmp1WNEnPq9Y9TN+8Bbu9RE5AikFZohBUMRbKAm/otXUiudOr+Nl1qs9+XzPyquJ9fef4P0hFuK0KTstQUCyrvuPWD36P6kwkvpx3bIH7wBaqrdWLBnRVUnJgNbcrsFj5JqpTpXbfOSFkRjrXtYbLd7dNF7aQhvT1Va42lUj9h5nvWngAVjdwzkYTd4nHpzjzP9e7+Vs0yOALAEara/f5bEpI4L9ptjRcT8+OPBlQVYjWMpaxeiKwS2VtFAYLpherLlN8k+AyBPFb6PFYi1qeT4twH3arb2/gbooFYhctnqA== 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:(13230040)(1800799024)(36860700013)(82310400026)(376014)(7416014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:16:14.8971 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f5afe7d8-0eb1-4546-9319-08dcb20a9806 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: CH2PEPF0000013F.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9336 Message-ID-Hash: XGFUEILA6PACNUDU7TIWDYTAA56H573X X-Message-ID-Hash: XGFUEILA6PACNUDU7TIWDYTAA56H573X X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Rename sof quirk macros, dai type and dai link macros with "SOC_SDW" tag. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- sound/soc/intel/boards/bridge_cs35l56.c | 6 +- sound/soc/intel/boards/sof_sdw.c | 184 +++++++++--------- sound/soc/intel/boards/sof_sdw_common.h | 46 ++--- sound/soc/intel/boards/sof_sdw_cs42l43.c | 2 +- sound/soc/intel/boards/sof_sdw_rt711.c | 6 +- .../boards/sof_sdw_rt_sdca_jack_common.c | 8 +- 6 files changed, 126 insertions(+), 126 deletions(-) diff --git a/sound/soc/intel/boards/bridge_cs35l56.c b/sound/soc/intel/boards/bridge_cs35l56.c index b289bcb3847a..6b2526c781e5 100644 --- a/sound/soc/intel/boards/bridge_cs35l56.c +++ b/sound/soc/intel/boards/bridge_cs35l56.c @@ -98,7 +98,7 @@ static const struct snd_soc_dai_link bridge_dai_template = { int bridge_cs35l56_count_sidecar(struct snd_soc_card *card, int *num_dais, int *num_devs) { - if (sof_sdw_quirk & SOF_SIDECAR_AMPS) { + if (sof_sdw_quirk & SOC_SDW_SIDECAR_AMPS) { (*num_dais)++; (*num_devs) += ARRAY_SIZE(bridge_cs35l56_name_prefixes); } @@ -110,7 +110,7 @@ int bridge_cs35l56_add_sidecar(struct snd_soc_card *card, struct snd_soc_dai_link **dai_links, struct snd_soc_codec_conf **codec_conf) { - if (sof_sdw_quirk & SOF_SIDECAR_AMPS) { + if (sof_sdw_quirk & SOC_SDW_SIDECAR_AMPS) { **dai_links = bridge_dai_template; for (int i = 0; i < ARRAY_SIZE(bridge_cs35l56_name_prefixes); i++) { @@ -130,7 +130,7 @@ int bridge_cs35l56_spk_init(struct snd_soc_card *card, struct asoc_sdw_codec_info *info, bool playback) { - if (sof_sdw_quirk & SOF_SIDECAR_AMPS) + if (sof_sdw_quirk & SOC_SDW_SIDECAR_AMPS) info->amp_num += ARRAY_SIZE(bridge_cs35l56_name_prefixes); return 0; diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 26c467bb81a3..64fb53772c04 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -23,24 +23,24 @@ MODULE_PARM_DESC(quirk, "Board-specific quirk override"); static void log_quirks(struct device *dev) { - if (SOF_JACK_JDSRC(sof_sdw_quirk)) + if (SOC_SDW_JACK_JDSRC(sof_sdw_quirk)) dev_dbg(dev, "quirk realtek,jack-detect-source %ld\n", - SOF_JACK_JDSRC(sof_sdw_quirk)); - if (sof_sdw_quirk & SOF_SDW_FOUR_SPK) - dev_err(dev, "quirk SOF_SDW_FOUR_SPK enabled but no longer supported\n"); + SOC_SDW_JACK_JDSRC(sof_sdw_quirk)); + if (sof_sdw_quirk & SOC_SDW_FOUR_SPK) + dev_err(dev, "quirk SOC_SDW_FOUR_SPK enabled but no longer supported\n"); if (sof_sdw_quirk & SOF_SDW_TGL_HDMI) dev_dbg(dev, "quirk SOF_SDW_TGL_HDMI enabled\n"); - if (sof_sdw_quirk & SOF_SDW_PCH_DMIC) - dev_dbg(dev, "quirk SOF_SDW_PCH_DMIC enabled\n"); + if (sof_sdw_quirk & SOC_SDW_PCH_DMIC) + dev_dbg(dev, "quirk SOC_SDW_PCH_DMIC enabled\n"); if (SOF_SSP_GET_PORT(sof_sdw_quirk)) dev_dbg(dev, "SSP port %ld\n", SOF_SSP_GET_PORT(sof_sdw_quirk)); - if (sof_sdw_quirk & SOF_SDW_NO_AGGREGATION) - dev_err(dev, "quirk SOF_SDW_NO_AGGREGATION enabled but no longer supported\n"); - if (sof_sdw_quirk & SOF_CODEC_SPKR) - dev_dbg(dev, "quirk SOF_CODEC_SPKR enabled\n"); - if (sof_sdw_quirk & SOF_SIDECAR_AMPS) - dev_dbg(dev, "quirk SOF_SIDECAR_AMPS enabled\n"); + if (sof_sdw_quirk & SOC_SDW_NO_AGGREGATION) + dev_err(dev, "quirk SOC_SDW_NO_AGGREGATION enabled but no longer supported\n"); + if (sof_sdw_quirk & SOC_SDW_CODEC_SPKR) + dev_dbg(dev, "quirk SOC_SDW_CODEC_SPKR enabled\n"); + if (sof_sdw_quirk & SOC_SDW_SIDECAR_AMPS) + dev_dbg(dev, "quirk SOC_SDW_SIDECAR_AMPS enabled\n"); } static int sof_sdw_quirk_cb(const struct dmi_system_id *id) @@ -57,7 +57,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), DMI_MATCH(DMI_PRODUCT_NAME, "CometLake Client"), }, - .driver_data = (void *)SOF_SDW_PCH_DMIC, + .driver_data = (void *)SOC_SDW_PCH_DMIC, }, { .callback = sof_sdw_quirk_cb, @@ -99,7 +99,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), DMI_MATCH(DMI_PRODUCT_NAME, "Ice Lake Client"), }, - .driver_data = (void *)SOF_SDW_PCH_DMIC, + .driver_data = (void *)SOC_SDW_PCH_DMIC, }, /* TigerLake devices */ { @@ -111,7 +111,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { }, .driver_data = (void *)(SOF_SDW_TGL_HDMI | RT711_JD1 | - SOF_SDW_PCH_DMIC | + SOC_SDW_PCH_DMIC | SOF_SSP_PORT(SOF_I2S_SSP2)), }, { @@ -159,7 +159,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Volteer"), }, .driver_data = (void *)(SOF_SDW_TGL_HDMI | - SOF_SDW_PCH_DMIC | + SOC_SDW_PCH_DMIC | SOF_BT_OFFLOAD_SSP(2) | SOF_SSP_BT_OFFLOAD_PRESENT), }, @@ -170,7 +170,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Ripto"), }, .driver_data = (void *)(SOF_SDW_TGL_HDMI | - SOF_SDW_PCH_DMIC), + SOC_SDW_PCH_DMIC), }, { /* @@ -185,7 +185,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "HP Spectre x360 Conv"), }, .driver_data = (void *)(SOF_SDW_TGL_HDMI | - SOF_SDW_PCH_DMIC | + SOC_SDW_PCH_DMIC | RT711_JD1), }, { @@ -199,7 +199,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { DMI_MATCH(DMI_BOARD_NAME, "8709"), }, .driver_data = (void *)(SOF_SDW_TGL_HDMI | - SOF_SDW_PCH_DMIC | + SOC_SDW_PCH_DMIC | RT711_JD1), }, { @@ -210,7 +210,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "LAPBC"), }, .driver_data = (void *)(SOF_SDW_TGL_HDMI | - SOF_SDW_PCH_DMIC | + SOC_SDW_PCH_DMIC | RT711_JD1), }, { @@ -221,7 +221,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { DMI_MATCH(DMI_BOARD_NAME, "LAPBC710"), }, .driver_data = (void *)(SOF_SDW_TGL_HDMI | - SOF_SDW_PCH_DMIC | + SOC_SDW_PCH_DMIC | RT711_JD1), }, { @@ -232,7 +232,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "LAPRC"), }, .driver_data = (void *)(SOF_SDW_TGL_HDMI | - SOF_SDW_PCH_DMIC | + SOC_SDW_PCH_DMIC | RT711_JD2_100K), }, { @@ -243,7 +243,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { DMI_MATCH(DMI_BOARD_NAME, "LAPRC710"), }, .driver_data = (void *)(SOF_SDW_TGL_HDMI | - SOF_SDW_PCH_DMIC | + SOC_SDW_PCH_DMIC | RT711_JD2_100K), }, /* TigerLake-SDCA devices */ @@ -293,7 +293,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Brya"), }, .driver_data = (void *)(SOF_SDW_TGL_HDMI | - SOF_SDW_PCH_DMIC | + SOC_SDW_PCH_DMIC | SOF_BT_OFFLOAD_SSP(2) | SOF_SSP_BT_OFFLOAD_PRESENT), }, @@ -501,7 +501,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { DMI_MATCH(DMI_SYS_VENDOR, "Google"), DMI_MATCH(DMI_PRODUCT_NAME, "Rex"), }, - .driver_data = (void *)(SOF_SDW_PCH_DMIC | + .driver_data = (void *)(SOC_SDW_PCH_DMIC | SOF_BT_OFFLOAD_SSP(1) | SOF_SSP_BT_OFFLOAD_PRESENT), }, @@ -529,7 +529,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0CE3") }, - .driver_data = (void *)(SOF_SIDECAR_AMPS), + .driver_data = (void *)(SOC_SDW_SIDECAR_AMPS), }, { .callback = sof_sdw_quirk_cb, @@ -537,7 +537,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0CE4") }, - .driver_data = (void *)(SOF_SIDECAR_AMPS), + .driver_data = (void *)(SOC_SDW_SIDECAR_AMPS), }, {} }; @@ -738,8 +738,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, true}, .dai_name = "rt700-aif1", - .dai_type = SOF_SDW_DAI_TYPE_JACK, - .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, .rtd_init = rt700_rtd_init, .controls = rt700_controls, .num_controls = ARRAY_SIZE(rt700_controls), @@ -756,8 +756,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, true}, .dai_name = "rt711-sdca-aif1", - .dai_type = SOF_SDW_DAI_TYPE_JACK, - .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, .init = sof_sdw_rt_sdca_jack_init, .exit = sof_sdw_rt_sdca_jack_exit, .rtd_init = rt_sdca_jack_rtd_init, @@ -776,8 +776,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, true}, .dai_name = "rt711-aif1", - .dai_type = SOF_SDW_DAI_TYPE_JACK, - .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, .init = sof_sdw_rt711_init, .exit = sof_sdw_rt711_exit, .rtd_init = rt711_rtd_init, @@ -796,8 +796,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, true}, .dai_name = "rt712-sdca-aif1", - .dai_type = SOF_SDW_DAI_TYPE_JACK, - .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, .init = sof_sdw_rt_sdca_jack_init, .exit = sof_sdw_rt_sdca_jack_exit, .rtd_init = rt_sdca_jack_rtd_init, @@ -809,8 +809,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, false}, .dai_name = "rt712-sdca-aif2", - .dai_type = SOF_SDW_DAI_TYPE_AMP, - .dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, .init = sof_sdw_rt_amp_init, .exit = sof_sdw_rt_amp_exit, .rtd_init = rt712_spk_rtd_init, @@ -829,8 +829,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {false, true}, .dai_name = "rt712-sdca-dmic-aif1", - .dai_type = SOF_SDW_DAI_TYPE_MIC, - .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_MIC, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, .rtd_init = rt_dmic_rtd_init, }, }, @@ -843,8 +843,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, true}, .dai_name = "rt712-sdca-aif1", - .dai_type = SOF_SDW_DAI_TYPE_JACK, - .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, .init = sof_sdw_rt_sdca_jack_init, .exit = sof_sdw_rt_sdca_jack_exit, .rtd_init = rt_sdca_jack_rtd_init, @@ -863,8 +863,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {false, true}, .dai_name = "rt712-sdca-dmic-aif1", - .dai_type = SOF_SDW_DAI_TYPE_MIC, - .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_MIC, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, .rtd_init = rt_dmic_rtd_init, }, }, @@ -877,8 +877,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, false}, .dai_name = "rt1308-aif", - .dai_type = SOF_SDW_DAI_TYPE_AMP, - .dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, .init = sof_sdw_rt_amp_init, .exit = sof_sdw_rt_amp_exit, .rtd_init = rt_amp_spk_rtd_init, @@ -897,8 +897,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, true}, .dai_name = "rt1316-aif", - .dai_type = SOF_SDW_DAI_TYPE_AMP, - .dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, .init = sof_sdw_rt_amp_init, .exit = sof_sdw_rt_amp_exit, .rtd_init = rt_amp_spk_rtd_init, @@ -916,8 +916,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, true}, .dai_name = "rt1318-aif", - .dai_type = SOF_SDW_DAI_TYPE_AMP, - .dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, .init = sof_sdw_rt_amp_init, .exit = sof_sdw_rt_amp_exit, .rtd_init = rt_amp_spk_rtd_init, @@ -937,8 +937,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {false, true}, .dai_name = "rt715-sdca-aif2", - .dai_type = SOF_SDW_DAI_TYPE_MIC, - .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_MIC, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, .rtd_init = rt_dmic_rtd_init, }, }, @@ -952,8 +952,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {false, true}, .dai_name = "rt715-sdca-aif2", - .dai_type = SOF_SDW_DAI_TYPE_MIC, - .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_MIC, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, .rtd_init = rt_dmic_rtd_init, }, }, @@ -967,8 +967,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {false, true}, .dai_name = "rt715-aif2", - .dai_type = SOF_SDW_DAI_TYPE_MIC, - .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_MIC, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, .rtd_init = rt_dmic_rtd_init, }, }, @@ -982,8 +982,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {false, true}, .dai_name = "rt715-aif2", - .dai_type = SOF_SDW_DAI_TYPE_MIC, - .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_MIC, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, .rtd_init = rt_dmic_rtd_init, }, }, @@ -996,8 +996,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, true}, .dai_name = "rt722-sdca-aif1", - .dai_type = SOF_SDW_DAI_TYPE_JACK, - .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, .init = sof_sdw_rt_sdca_jack_init, .exit = sof_sdw_rt_sdca_jack_exit, .rtd_init = rt_sdca_jack_rtd_init, @@ -1009,9 +1009,9 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, false}, .dai_name = "rt722-sdca-aif2", - .dai_type = SOF_SDW_DAI_TYPE_AMP, + .dai_type = SOC_SDW_DAI_TYPE_AMP, /* No feedback capability is provided by rt722-sdca codec driver*/ - .dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID}, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, .init = sof_sdw_rt_amp_init, .exit = sof_sdw_rt_amp_exit, .rtd_init = rt722_spk_rtd_init, @@ -1023,8 +1023,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {false, true}, .dai_name = "rt722-sdca-aif3", - .dai_type = SOF_SDW_DAI_TYPE_MIC, - .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_MIC, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, .rtd_init = rt_dmic_rtd_init, }, }, @@ -1036,8 +1036,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, true}, .dai_name = "max98373-aif1", - .dai_type = SOF_SDW_DAI_TYPE_AMP, - .dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, .init = sof_sdw_maxim_init, .rtd_init = maxim_spk_rtd_init, .controls = maxim_controls, @@ -1054,8 +1054,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, false}, .dai_name = "max98363-aif1", - .dai_type = SOF_SDW_DAI_TYPE_AMP, - .dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, .init = sof_sdw_maxim_init, .rtd_init = maxim_spk_rtd_init, .controls = maxim_controls, @@ -1072,8 +1072,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, true}, .dai_name = "rt5682-sdw", - .dai_type = SOF_SDW_DAI_TYPE_JACK, - .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, .rtd_init = rt5682_rtd_init, .controls = generic_jack_controls, .num_controls = ARRAY_SIZE(generic_jack_controls), @@ -1089,8 +1089,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, true}, .dai_name = "cs35l56-sdw1", - .dai_type = SOF_SDW_DAI_TYPE_AMP, - .dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, .init = sof_sdw_cs_amp_init, .rtd_init = cs_spk_rtd_init, .controls = generic_spk_controls, @@ -1107,8 +1107,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, true}, .dai_name = "cs42l42-sdw", - .dai_type = SOF_SDW_DAI_TYPE_JACK, - .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, .rtd_init = cs42l42_rtd_init, .controls = generic_jack_controls, .num_controls = ARRAY_SIZE(generic_jack_controls), @@ -1127,8 +1127,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, false}, .dai_name = "cs42l43-dp5", - .dai_type = SOF_SDW_DAI_TYPE_JACK, - .dailink = {SDW_JACK_OUT_DAI_ID, SDW_UNUSED_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, .rtd_init = cs42l43_hs_rtd_init, .controls = generic_jack_controls, .num_controls = ARRAY_SIZE(generic_jack_controls), @@ -1138,8 +1138,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {false, true}, .dai_name = "cs42l43-dp1", - .dai_type = SOF_SDW_DAI_TYPE_MIC, - .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_MIC, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, .rtd_init = cs42l43_dmic_rtd_init, .widgets = generic_dmic_widgets, .num_widgets = ARRAY_SIZE(generic_dmic_widgets), @@ -1147,21 +1147,21 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {false, true}, .dai_name = "cs42l43-dp2", - .dai_type = SOF_SDW_DAI_TYPE_JACK, - .dailink = {SDW_UNUSED_DAI_ID, SDW_JACK_IN_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, }, { .direction = {true, false}, .dai_name = "cs42l43-dp6", - .dai_type = SOF_SDW_DAI_TYPE_AMP, - .dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, .init = sof_sdw_cs42l43_spk_init, .rtd_init = cs42l43_spk_rtd_init, .controls = generic_spk_controls, .num_controls = ARRAY_SIZE(generic_spk_controls), .widgets = generic_spk_widgets, .num_widgets = ARRAY_SIZE(generic_spk_widgets), - .quirk = SOF_CODEC_SPKR | SOF_SIDECAR_AMPS, + .quirk = SOC_SDW_CODEC_SPKR | SOC_SDW_SIDECAR_AMPS, }, }, .dai_num = 4, @@ -1173,8 +1173,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, true}, .dai_name = "sdw-mockup-aif1", - .dai_type = SOF_SDW_DAI_TYPE_JACK, - .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, }, }, .dai_num = 1, @@ -1186,8 +1186,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, true}, .dai_name = "sdw-mockup-aif1", - .dai_type = SOF_SDW_DAI_TYPE_JACK, - .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, }, }, .dai_num = 1, @@ -1199,8 +1199,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .direction = {true, true}, .dai_name = "sdw-mockup-aif1", - .dai_type = SOF_SDW_DAI_TYPE_AMP, - .dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, }, }, .dai_num = 1, @@ -1212,8 +1212,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .dai_name = "sdw-mockup-aif1", .direction = {false, true}, - .dai_type = SOF_SDW_DAI_TYPE_MIC, - .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, + .dai_type = SOC_SDW_DAI_TYPE_MIC, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, }, }, .dai_num = 1, @@ -1767,7 +1767,7 @@ static int create_sdw_dailinks(struct snd_soc_card *card, int ret, i; for (i = 0; i < SDW_MAX_LINKS; i++) - ctx->sdw_pin_index[i] = SDW_INTEL_BIDIR_PDI_BASE; + ctx->sdw_pin_index[i] = SOC_SDW_INTEL_BIDIR_PDI_BASE; /* generate DAI links by each sdw link */ while (sof_dais->initialised) { @@ -1971,7 +1971,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) hdmi_num = SOF_PRE_TGL_HDMI_COUNT; /* enable dmic01 & dmic16k */ - if (sof_sdw_quirk & SOF_SDW_PCH_DMIC || mach_params->dmic_num) + if (sof_sdw_quirk & SOC_SDW_PCH_DMIC || mach_params->dmic_num) dmic_num = 2; if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT) diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index ebacb55de318..6ddfb1f9639a 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -14,16 +14,16 @@ #include #include "sof_hdmi_common.h" -#define MAX_NO_PROPS 2 +#define SOC_SDW_MAX_NO_PROPS 2 #define MAX_HDMI_NUM 4 -#define SDW_UNUSED_DAI_ID -1 -#define SDW_JACK_OUT_DAI_ID 0 -#define SDW_JACK_IN_DAI_ID 1 -#define SDW_AMP_OUT_DAI_ID 2 -#define SDW_AMP_IN_DAI_ID 3 -#define SDW_DMIC_DAI_ID 4 -#define SDW_MAX_CPU_DAIS 16 -#define SDW_INTEL_BIDIR_PDI_BASE 2 +#define SOC_SDW_UNUSED_DAI_ID -1 +#define SOC_SDW_JACK_OUT_DAI_ID 0 +#define SOC_SDW_JACK_IN_DAI_ID 1 +#define SOC_SDW_AMP_OUT_DAI_ID 2 +#define SOC_SDW_AMP_IN_DAI_ID 3 +#define SOC_SDW_DMIC_DAI_ID 4 +#define SOC_SDW_MAX_CPU_DAIS 16 +#define SOC_SDW_INTEL_BIDIR_PDI_BASE 2 #define SDW_MAX_LINKS 4 @@ -44,27 +44,27 @@ enum { SOF_I2S_SSP5 = BIT(5), }; -#define SOF_JACK_JDSRC(quirk) ((quirk) & GENMASK(3, 0)) +#define SOC_SDW_JACK_JDSRC(quirk) ((quirk) & GENMASK(3, 0)) /* Deprecated and no longer supported by the code */ -#define SOF_SDW_FOUR_SPK BIT(4) +#define SOC_SDW_FOUR_SPK BIT(4) #define SOF_SDW_TGL_HDMI BIT(5) -#define SOF_SDW_PCH_DMIC BIT(6) +#define SOC_SDW_PCH_DMIC BIT(6) #define SOF_SSP_PORT(x) (((x) & GENMASK(5, 0)) << 7) #define SOF_SSP_GET_PORT(quirk) (((quirk) >> 7) & GENMASK(5, 0)) /* Deprecated and no longer supported by the code */ -#define SOF_SDW_NO_AGGREGATION BIT(14) +#define SOC_SDW_NO_AGGREGATION BIT(14) /* If a CODEC has an optional speaker output, this quirk will enable it */ -#define SOF_CODEC_SPKR BIT(15) +#define SOC_SDW_CODEC_SPKR BIT(15) /* * If the CODEC has additional devices attached directly to it. * * For the cs42l43: * - 0 - No speaker output - * - SOF_CODEC_SPKR - CODEC internal speaker - * - SOF_SIDECAR_AMPS - 2x Sidecar amplifiers + CODEC internal speaker - * - SOF_CODEC_SPKR | SOF_SIDECAR_AMPS - Not currently supported + * - SOC_SDW_CODEC_SPKR - CODEC internal speaker + * - SOC_SDW_SIDECAR_AMPS - 2x Sidecar amplifiers + CODEC internal speaker + * - SOC_SDW_CODEC_SPKR | SOC_SDW_SIDECAR_AMPS - Not currently supported */ -#define SOF_SIDECAR_AMPS BIT(16) +#define SOC_SDW_SIDECAR_AMPS BIT(16) /* BT audio offload: reserve 3 bits for future */ #define SOF_BT_OFFLOAD_SSP_SHIFT 15 @@ -73,11 +73,11 @@ enum { (((quirk) << SOF_BT_OFFLOAD_SSP_SHIFT) & SOF_BT_OFFLOAD_SSP_MASK) #define SOF_SSP_BT_OFFLOAD_PRESENT BIT(18) -#define SOF_SDW_DAI_TYPE_JACK 0 -#define SOF_SDW_DAI_TYPE_AMP 1 -#define SOF_SDW_DAI_TYPE_MIC 2 +#define SOC_SDW_DAI_TYPE_JACK 0 +#define SOC_SDW_DAI_TYPE_AMP 1 +#define SOC_SDW_DAI_TYPE_MIC 2 -#define SOF_SDW_MAX_DAI_NUM 8 +#define SOC_SDW_MAX_DAI_NUM 8 struct asoc_sdw_codec_info; @@ -108,7 +108,7 @@ struct asoc_sdw_codec_info { const u8 acpi_id[ACPI_ID_LEN]; const bool ignore_pch_dmic; const struct snd_soc_ops *ops; - struct asoc_sdw_dai_info dais[SOF_SDW_MAX_DAI_NUM]; + struct asoc_sdw_dai_info dais[SOC_SDW_MAX_DAI_NUM]; const int dai_num; int (*codec_card_late_probe)(struct snd_soc_card *card); diff --git a/sound/soc/intel/boards/sof_sdw_cs42l43.c b/sound/soc/intel/boards/sof_sdw_cs42l43.c index e8370c3c96fd..1688f29a977a 100644 --- a/sound/soc/intel/boards/sof_sdw_cs42l43.c +++ b/sound/soc/intel/boards/sof_sdw_cs42l43.c @@ -104,7 +104,7 @@ int cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *da struct snd_soc_card *card = rtd->card; int ret; - if (!(sof_sdw_quirk & SOF_SIDECAR_AMPS)) { + if (!(sof_sdw_quirk & SOC_SDW_SIDECAR_AMPS)) { /* Will be set by the bridge code in this case */ card->components = devm_kasprintf(card->dev, GFP_KERNEL, "%s spk:cs42l43-spk", diff --git a/sound/soc/intel/boards/sof_sdw_rt711.c b/sound/soc/intel/boards/sof_sdw_rt711.c index 9ea8de609669..fff76291fca2 100644 --- a/sound/soc/intel/boards/sof_sdw_rt711.c +++ b/sound/soc/intel/boards/sof_sdw_rt711.c @@ -23,13 +23,13 @@ */ static int rt711_add_codec_device_props(struct device *sdw_dev) { - struct property_entry props[MAX_NO_PROPS] = {}; + struct property_entry props[SOC_SDW_MAX_NO_PROPS] = {}; struct fwnode_handle *fwnode; int ret; - if (!SOF_JACK_JDSRC(sof_sdw_quirk)) + if (!SOC_SDW_JACK_JDSRC(sof_sdw_quirk)) return 0; - props[0] = PROPERTY_ENTRY_U32("realtek,jd-src", SOF_JACK_JDSRC(sof_sdw_quirk)); + props[0] = PROPERTY_ENTRY_U32("realtek,jd-src", SOC_SDW_JACK_JDSRC(sof_sdw_quirk)); fwnode = fwnode_create_software_node(props, NULL); if (IS_ERR(fwnode)) diff --git a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c b/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c index b63f4952e7d1..9c3b93f808a2 100644 --- a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c +++ b/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c @@ -23,14 +23,14 @@ */ static int rt_sdca_jack_add_codec_device_props(struct device *sdw_dev) { - struct property_entry props[MAX_NO_PROPS] = {}; + struct property_entry props[SOC_SDW_MAX_NO_PROPS] = {}; struct fwnode_handle *fwnode; int ret; - if (!SOF_JACK_JDSRC(sof_sdw_quirk)) + if (!SOC_SDW_JACK_JDSRC(sof_sdw_quirk)) return 0; - props[0] = PROPERTY_ENTRY_U32("realtek,jd-src", SOF_JACK_JDSRC(sof_sdw_quirk)); + props[0] = PROPERTY_ENTRY_U32("realtek,jd-src", SOC_SDW_JACK_JDSRC(sof_sdw_quirk)); fwnode = fwnode_create_software_node(props, NULL); if (IS_ERR(fwnode)) @@ -168,7 +168,7 @@ int sof_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_link if (!ctx->headset_codec_dev) return 0; - if (!SOF_JACK_JDSRC(sof_sdw_quirk)) + if (!SOC_SDW_JACK_JDSRC(sof_sdw_quirk)) return 0; device_remove_software_node(ctx->headset_codec_dev); From patchwork Thu Aug 1 09:14: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: 816302 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 (unknown [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 CE868C3DA64 for ; Thu, 1 Aug 2024 09:32:19 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7BCF23A4B; Thu, 1 Aug 2024 11:31:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7BCF23A4B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722504688; bh=RDO+vloBM2GX4x3HsozmjsErgtAplHVdtbM9kcsLnNk=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Rf6x/cVq07pugyyFlPkLWKbTJrBTpua8bcJSzhwUSyvL+sbTJ/0TWms+58OmbSFcW cZEqPJ+uDUjEO8svcIWAsOlXJceWqXdE3bmtKN0bsnLjrICWXT4Texzfwtn+hck7uM Oljz8hwfp2EIKQMo/WPc0LZY3EMKGUJaiiAXi4ys= Received: by alsa1.perex.cz (Postfix, from userid 50401) id C7B6CF80632; Thu, 1 Aug 2024 11:30:19 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 2D69CF8060A; Thu, 1 Aug 2024 11:30:19 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 87206F80269; Thu, 1 Aug 2024 11:16:46 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2415::601]) (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 864CBF8007E for ; Thu, 1 Aug 2024 11:16:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 864CBF8007E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=RF3oOxRz ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kA8H/GafgEZOBj9qP4VShpi8BKr9Pbfy3ur8Ju8w+r+1JkkbFHt1mYf4MUTFsakQ+JIFx7Clf8AHqxKhdQ1ohUR5yIzVzng/zugLlTsEY137H6gVVLMlxiWfzMH/kpS4usGS3NVKki7Qa6t67J6DdxmuPPtG7D8CKWI5XlmItwr2lpLJqOVJOkM+5XMsUkjIuXsl+/eqU9MExZ/MBIv8ZCU1rySdXVf5z1u5FMknm2YiBabN1zMsPDVv8xo1nTLYw6sQomyVktfpe499E/1tGbFLIuQsM6OHyHOce5xoulZxReuQPK9Ly8sNSh8BLDFXKRLBhhx0D0F3z/eVMIFf2g== 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=8PN6D6XRbeecwMVkpspR8HoNG+SKkdTm3cCEgvNTAC0=; b=eNTfujUiBe4JGuCaUkWnrggPg4bNMJaXWQr/E6RZ9TrV5vrPVQ0A663bzE9a/hSfiaR2NwSV7gNb9DfrE5ZbFqT/Y8yocfCxMFbq5fhKMCYWNuwX0HrAXU1+w8omAgGh1pJbV6KczbRF9ElsC48/J9jonPCWfS3AQWg9HT5v4WtKNSB4JIWVm76875BJdsCeuoTV2eoMWpjUSqVUJprsEBLVyTSROpeyzZVo5jDUPi7XZ+wR6WF+HCKqE3lXd2sMaztqoXR4/ynZcTNCdP/EvTKEx+Hh6sLW3jmA1ow0+J7SMhovtR4XUUl/9fNWDTldlGUgAC6NUcjB3SauNFiung== 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=8PN6D6XRbeecwMVkpspR8HoNG+SKkdTm3cCEgvNTAC0=; b=RF3oOxRzBLzpGUwhTZTrZuENKNHyzFTiKnFhiw8u4gPv1HxuGjGkdRzdCWx4XtNYYtZUkAHE0f3rUbhz43Wm+ae/WdpLOru+ebfhXXKj4Ra0BKCWDupX2wTh+C7ZLHjSBvheN6V4ny3P0T0+fZHg2EEhPXMbNEX5/1sN1niioVo= Received: from CH0PR03CA0185.namprd03.prod.outlook.com (2603:10b6:610:e4::10) by CY5PR12MB6528.namprd12.prod.outlook.com (2603:10b6:930:43::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Thu, 1 Aug 2024 09:16:33 +0000 Received: from CH2PEPF00000140.namprd02.prod.outlook.com (2603:10b6:610:e4:cafe::24) by CH0PR03CA0185.outlook.office365.com (2603:10b6:610:e4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.34 via Frontend Transport; Thu, 1 Aug 2024 09:16:33 +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 CH2PEPF00000140.mail.protection.outlook.com (10.167.244.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:16:32 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) 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.2507.39; Thu, 1 Aug 2024 04:16:32 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 1 Aug 2024 04:16:31 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:16:23 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Cezary Rojewski , Liam Girdwood , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Jaroslav Kysela , "Takashi Iwai" , Charles Keepax , Maciej Strozek , Chao Song , Kuninori Morimoto , Brent Lu , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH RESEND 03/31] ASoC: intel: rename soundwire machine driver soc ops Date: Thu, 1 Aug 2024 14:44:18 +0530 Message-ID: <20240801091446.10457-4-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB05.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF00000140:EE_|CY5PR12MB6528:EE_ X-MS-Office365-Filtering-Correlation-Id: bc71860c-b9cc-438f-99ed-08dcb20aa2ce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: otIMqNHicGNQez6F1O6kZ1h411q0aR/MCjAqkvF26WWgVPGtHB7rKE5FArhXCNp10Ot1AZgm6f7Lhx2T0hkaiYqbezYuPaSTyZLfDwSwz3S1dIzCCC8cFogiOr67h3UWTw3wABwR9ELht7Xrk5YOcw+JQ7fjySzh4uXMDAREsNmGnxlP4DkY9CCDDR9BqWF8V3gBYbwShQRYqRucLkUAQ5bF1r27Nk4a6L07+Ut0y1dfgSb9MSAlKTTeis+vPNkOGeWQ5PvpoM6i9tQY+2x8Fq/Qu+QLANmlfblfWe2IXd/ITaoLbCT1IXcxwfjggC9U6c3NnuM3otoFRkr80AE+eVq2q9/mPcURGf703AkOJuB2nQnAU7e57nBCJLGsyFIbx4QJ3/Y0ZmupN335CTA2dMJkIIZujwAqjaL81gHJ1F5jDxzcDHvKpEeGTKK7HoCNpOjuwyURtc3dXtg4z3I08s6Uvfbz93xENC9wRhIcZ1IGiD2Du8Pn0etalsSWPx1y9iNOmG7AfBp7En47mYhVc9Aif/o82jvuSGKDbIs1pdT3Aj7WGDVEHOmgIRQASWfucRjQFVf7gmPUyS56r4QS9CH4I+p3Nf2rhNYWR7qNKmjVg2znrADzRUgcwDj17DHwhvnQxTiA3ds8zfEHmxfCi1XsQJ7lA0sqqtrTrb7/6uA1CyBNP3NUbW9eHsvEmECNIef/39blCKXVVeM99qdN4NNpbdx7GkdbW7cA+hgfi94dmfwoXCvZzU3vMYiPTqV9BWgr5BYx9PGHVIjWULCnsDDLJPfOsh5F32Oj6b+zingCUCuPhpmQ6maH24tg3AcmMXAWcNn017WFXx/yDBRYWTXlr0SZzHv6Lyrihn9IuKTYxPTH9OrwGGTa9gPeD9Bpp43yjJNAZTG5qY6hvGdnnRLFlOO14eTvJRC1zkebMWtnyc+avPH4dIBl8kFzNjJOdyxqzTx6VUUhPOKXJxFxiWlElRwEAqZwWvEFZRk5OTA6G/rnbqf0rIEk9dZhXu2F0lRX2WKAqrkoIT/8+esS0mnGi+8jmtDcEBz3J+ZniV8S8mDH2xiLjjkN+2ZnRqlOSHY8LFVYJo8o870gw07oHxhcZ882RQJM4UyKqvLOM/y38lWgQElrqpVnYHvM0rBDOZXuaAOdo2BZltyClCgzz1GOitKjwS96PB7j3nu+QzP395rxqqiVW00EOj43RwRaiv3f/ROIatx8mJQED9AZPtTOunZ31XMcsgW02EwA0mH90V2ZgA17+yTxllYrDu9dSvkhE4/jexldqxgaGqcYJc7dyk9iHTC7kmP9hwBDBGnVGoPdLZQNhY1UqVg0+WLOL68Wc/bhMU91ku+LyF8enybYzyf9z/pq2oSPRwQrdNfwCPMEhJEwn7OrGExaT2ZfYD84KtXTonnKgiOZufKjIA== 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:(13230040)(7416014)(1800799024)(376014)(82310400026)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:16:32.9696 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bc71860c-b9cc-438f-99ed-08dcb20aa2ce 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: CH2PEPF00000140.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6528 Message-ID-Hash: FOGOL5TRSZJ2VXH7EXJF7U7M6QANVH2M X-Message-ID-Hash: FOGOL5TRSZJ2VXH7EXJF7U7M6QANVH2M X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Rename Soundwire generic machine driver soc ops with tag "asoc". Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 26 ++++++++++++------------- sound/soc/intel/boards/sof_sdw_common.h | 14 ++++++------- sound/soc/intel/boards/sof_sdw_maxim.c | 12 ++++++------ 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 64fb53772c04..9395daf220e9 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -594,12 +594,12 @@ static const struct snd_kcontrol_new rt700_controls[] = { }; /* these wrappers are only needed to avoid typecast compilation errors */ -int sdw_startup(struct snd_pcm_substream *substream) +int asoc_sdw_startup(struct snd_pcm_substream *substream) { return sdw_startup_stream(substream); } -int sdw_prepare(struct snd_pcm_substream *substream) +int asoc_sdw_prepare(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct sdw_stream_runtime *sdw_stream; @@ -617,7 +617,7 @@ int sdw_prepare(struct snd_pcm_substream *substream) return sdw_prepare_stream(sdw_stream); } -int sdw_trigger(struct snd_pcm_substream *substream, int cmd) +int asoc_sdw_trigger(struct snd_pcm_substream *substream, int cmd) { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct sdw_stream_runtime *sdw_stream; @@ -656,8 +656,8 @@ int sdw_trigger(struct snd_pcm_substream *substream, int cmd) return ret; } -int sdw_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params) +int asoc_sdw_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct snd_soc_dai_link_ch_map *ch_maps; @@ -699,7 +699,7 @@ int sdw_hw_params(struct snd_pcm_substream *substream, return 0; } -int sdw_hw_free(struct snd_pcm_substream *substream) +int asoc_sdw_hw_free(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct sdw_stream_runtime *sdw_stream; @@ -717,18 +717,18 @@ int sdw_hw_free(struct snd_pcm_substream *substream) return sdw_deprepare_stream(sdw_stream); } -void sdw_shutdown(struct snd_pcm_substream *substream) +void asoc_sdw_shutdown(struct snd_pcm_substream *substream) { sdw_shutdown_stream(substream); } static const struct snd_soc_ops sdw_ops = { - .startup = sdw_startup, - .prepare = sdw_prepare, - .trigger = sdw_trigger, - .hw_params = sdw_hw_params, - .hw_free = sdw_hw_free, - .shutdown = sdw_shutdown, + .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 struct asoc_sdw_codec_info codec_info_list[] = { diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index 6ddfb1f9639a..e88b5627560b 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -134,13 +134,13 @@ struct mc_private { extern unsigned long sof_sdw_quirk; -int sdw_startup(struct snd_pcm_substream *substream); -int sdw_prepare(struct snd_pcm_substream *substream); -int sdw_trigger(struct snd_pcm_substream *substream, int cmd); -int sdw_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params); -int sdw_hw_free(struct snd_pcm_substream *substream); -void sdw_shutdown(struct snd_pcm_substream *substream); +int asoc_sdw_startup(struct snd_pcm_substream *substream); +int asoc_sdw_prepare(struct snd_pcm_substream *substream); +int asoc_sdw_trigger(struct snd_pcm_substream *substream, int cmd); +int asoc_sdw_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params); +int asoc_sdw_hw_free(struct snd_pcm_substream *substream); +void asoc_sdw_shutdown(struct snd_pcm_substream *substream); /* generic HDMI support */ int sof_sdw_hdmi_init(struct snd_soc_pcm_runtime *rtd); diff --git a/sound/soc/intel/boards/sof_sdw_maxim.c b/sound/soc/intel/boards/sof_sdw_maxim.c index 8faa06824869..f689dc29c493 100644 --- a/sound/soc/intel/boards/sof_sdw_maxim.c +++ b/sound/soc/intel/boards/sof_sdw_maxim.c @@ -80,7 +80,7 @@ static int mx8373_sdw_prepare(struct snd_pcm_substream *substream) int ret; /* according to soc_pcm_prepare dai link prepare is called first */ - ret = sdw_prepare(substream); + ret = asoc_sdw_prepare(substream); if (ret < 0) return ret; @@ -92,7 +92,7 @@ static int mx8373_sdw_hw_free(struct snd_pcm_substream *substream) int ret; /* according to soc_pcm_hw_free dai link free is called first */ - ret = sdw_hw_free(substream); + ret = asoc_sdw_hw_free(substream); if (ret < 0) return ret; @@ -100,12 +100,12 @@ static int mx8373_sdw_hw_free(struct snd_pcm_substream *substream) } static const struct snd_soc_ops max_98373_sdw_ops = { - .startup = sdw_startup, + .startup = asoc_sdw_startup, .prepare = mx8373_sdw_prepare, - .trigger = sdw_trigger, - .hw_params = sdw_hw_params, + .trigger = asoc_sdw_trigger, + .hw_params = asoc_sdw_hw_params, .hw_free = mx8373_sdw_hw_free, - .shutdown = sdw_shutdown, + .shutdown = asoc_sdw_shutdown, }; static int mx8373_sdw_late_probe(struct snd_soc_card *card) From patchwork Thu Aug 1 09:14: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: 816076 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 (unknown [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 5FB6DC3DA4A for ; Thu, 1 Aug 2024 09:32:37 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 51A622EB4; Thu, 1 Aug 2024 11:31:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 51A622EB4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722504704; bh=OOfg8tkbJLzoJgO5JTTXrI0kZwxWgXWhiT0Ax3KckYI=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=CcIy9lBcf2BIevHIRTyyrVdwwg+CHbPvQmr4S2y9LfLnbuE9hLD31gY3bC73B3z+X aVQz30rATJ5PIfPQUe25B9UuHP332Lj4jiEFpTpRW2M5G6/7g8MSmpCvqPk2XkC6cF dYj7s/vBZq+FarYcTTnGfehIbH4RC2PWYfMj8ISo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 794F4F8057A; Thu, 1 Aug 2024 11:30:25 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id C8DAFF80654; Thu, 1 Aug 2024 11:30:24 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 66B55F8026A; Thu, 1 Aug 2024 11:17:52 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20618.outbound.protection.outlook.com [IPv6:2a01:111:f403:2418::618]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9D7D7F8019B for ; Thu, 1 Aug 2024 11:17:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9D7D7F8019B Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=h/uBE+Ln ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=h8WqA+b5vBXukXTIbRBrk0TCXc4nacRivUy8Qro9SjpAC65KGITdzfr3nc3dTy8D0uha3ChoiyBQ5u3nj5D1O6x9rmsQaQjNW4YToFpenq6us/nT98vvcCAzM1tLG0PlPYc/Q+dOFt8pWE3MwIO7dMZ+iBxk7Yo74rZOIlle4dSnG5PCbpzBB4E6mfKIYBSOTp0f2+B+J7gSWPopFZ5OI3XSNXSx6RsRRTbd8L14kr2GJBQdjkUmmoNn3gKCuM5yKevUPtKWY1bs8uk5EiVvj1cbmUEsTfZjGNTUTzGLN0khRMmCdQw2woBYwCeKFFF1l2QyuJylcjkpNYrHLuwPQA== 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=gFa3Pog6ZiXET4635aNpUlAaMrc7TXECglk3ZuIN4/I=; b=TON1JTpDQKcKUOkK0TCNCWBMHJD3dKJK2GN8dFQJ9t5VW6BoK0zprjmwVwvsbWmv4Sq0xx98/2L0XAmPHtwJhOmQ7wUPIcU+NpoQfwVQUdyQ3eNlyKNcalGLQ4m5WMks8yFBLoT5Gd6xltRDM7ja+88LWV/DGA6mWgNOknThTXJgj30ighhQKLelGt1IwRN+1STmQaJZN0eq0fDh/Iu5Kp8UGeJcymmM1HMwBSLq2Zo7JdfmpUtMb47wfcR2NEGaLtnOKFJb+zd4W91e3QXYJ04xGspCYBpPyqZHWAprNo2xyuWUJXXlPw4kNhXaK90BMJbrp+2SpHnqnUYXym4TtA== 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=gFa3Pog6ZiXET4635aNpUlAaMrc7TXECglk3ZuIN4/I=; b=h/uBE+LnDGgOxVMoOa6unqRDNJrL8W9yfGZw9q3Usj7cBG4AlQClNMTgc/T5F+yZOdyhybtL3PRWeBxqmXVvyASFR4jWvWt3kgzrX9ZiNea80y2Rg0hVdxKbC7LpV0yjzmZekESmFb+S096TH2dKQrg48zIEKXz0XkAF9z/D9T0= Received: from DM6PR02CA0156.namprd02.prod.outlook.com (2603:10b6:5:332::23) by LV2PR12MB5941.namprd12.prod.outlook.com (2603:10b6:408:172::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Thu, 1 Aug 2024 09:17:41 +0000 Received: from DS2PEPF00003445.namprd04.prod.outlook.com (2603:10b6:5:332:cafe::30) by DM6PR02CA0156.outlook.office365.com (2603:10b6:5:332::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21 via Frontend Transport; Thu, 1 Aug 2024 09:17:41 +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 DS2PEPF00003445.mail.protection.outlook.com (10.167.17.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:17:41 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Thu, 1 Aug 2024 04:17:38 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:17:29 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Cezary Rojewski , Liam Girdwood , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Jaroslav Kysela , "Takashi Iwai" , Charles Keepax , "Maciej Strozek" , Chao Song , jairaj-arava , "Kuninori Morimoto" , Richard Fitzgerald , Brent Lu , Rander Wang , Christophe JAILLET , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH RESEND 04/31] ASoC: intel: rename soundwire codec helper functions Date: Thu, 1 Aug 2024 14:44:19 +0530 Message-ID: <20240801091446.10457-5-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003445:EE_|LV2PR12MB5941:EE_ X-MS-Office365-Filtering-Correlation-Id: 9c4ce275-aafd-42aa-f4c3-08dcb20acb96 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: MGB1jwGkrj0pUT852trwN7wxrYPWQf7e80hHP1gT0hUR6j76agrULcX/7h+wIJ2yAVJ6N73l0Yc676eCYFBqqbaKHWIWYLoJUCkm/4h6vskb/JqRC3Du9s624uVgPG6RBaxog1M9TsOI2Ps2fdrrQSvEFW4u19vhV9HK5QfWHPCqH/3dG26OyGyeQHQt0WtTHdU+kbgXgpS4zyWoSe+w/2VCme0qp2PqMCoxbHXuZ9sjuS+zO/EkQDeUNIDpiuMPG5qthbOlJDlbHmWOy3qRrQQ8mL85bxLEBMfdPRJf7iY3F4AlE5UajSZnJiPkVC/K0Am0kApLi+OYQ9UCr0uwb8M+wyK+TYgFVOocGsbrMk9jLuiUFYskqhRQUEZEgA4mPLoMPxuI6Jxyqs28Jpz9mR51qdnKo2ehpngdNKQzfjNeYCbh9CQTRXmkvLsU0sh62xtsC/KkHPtuBCsJhMqnGqgAApIgQrHz7KzFG3GzADlCTl9QQGj7qY3LCwzEgom3SOIsYQMkZah5MXhfTE/m6Vqo+tpK0ILbq9QvpyvUuBfBXrcthkxaeoeJJHCdo3Ot3PGnmcNlwrvomXWtEgZ8D26AxHHhx5WbPViIJ05PmYALOnkXQ/m+YNt/gSAZPHzsLXwjik2PrWyRXfyVQuWlfBAvMCPGHDSW4eAczfnujxy6tS1bEQUmld57ArjZEvVb2cLiya8SI1Mc8ao17T1Ln9MSbjKZsPcc863IRB182Kk7jSrL/AfY77RUveULEBk7TNKQEkjtnnF7g+gSVVy+u2kzEU4MRjALRwrPRgLIQfZ7cYWlOXeedYGwmntE4ybQGwLVIWv5nkC2OU24xj1Cm9hBYAHdN5sFHI2Kcz7Qw6tPURg6r10djwSZyFYjqMKuwj77N5NWNFRXa5um82obAd/4N4gzOcAiuSvLtrDNnj8DUnhU19Z7TrI1tcyBBxk+U6NhP49TPOzap95FRku25zZ5U7ZL4dOOrIJe4MmJDczwKWMtdfWz7whWM0uNp81cVr2nQmIfif7Bx+3oNQqW8f5Cf/GUBd7ZeV6xYKSy9vbGW0WPHxuk1q2UcdJCNfmltpOdLsqKdMzoOn3kGcu9q19ptuI0+54V0DJmkejjRQeKyKOhOHVjream2lTDHIx1YLzBEXDtPbv89OQACIRkJuuGOBCU3/wYnVtWCPLC0L6DYsoOxvoyXVFyhPPD6c0lfAqdNQJw/0c5qMsv+2XaTuQICGHExyJGmHrfwhIeB3dleRYA9q5obG8lJ22goTh9APlT4wyk6doecGIaXocFAaoqSQ1AI/mqSnrIIG6eo3a/UsxJO5rLFTAE1eQzlc+YiqS21xUuguDxBtcorQ0Z6a74Asg7cQupOyhHwgl08Gad059Pn/7oUylFQjirxT2APDszAtKhfgF97IsVgIKyYg== 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)(7416014)(1800799024)(376014)(82310400026)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:17:41.3759 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c4ce275-aafd-42aa-f4c3-08dcb20acb96 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: DS2PEPF00003445.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5941 Message-ID-Hash: TZZA7DAK7KRIUMM4ATOCPQWR7YZFPOXT X-Message-ID-Hash: TZZA7DAK7KRIUMM4ATOCPQWR7YZFPOXT X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Rename SoundWire codec helper functions with "asoc_sdw" tag. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- sound/soc/intel/boards/bridge_cs35l56.c | 18 +- sound/soc/intel/boards/sof_sdw.c | 154 +++++++++--------- sound/soc/intel/boards/sof_sdw_common.h | 104 ++++++------ sound/soc/intel/boards/sof_sdw_cs42l42.c | 2 +- sound/soc/intel/boards/sof_sdw_cs42l43.c | 16 +- sound/soc/intel/boards/sof_sdw_cs_amp.c | 10 +- sound/soc/intel/boards/sof_sdw_dmic.c | 2 +- sound/soc/intel/boards/sof_sdw_maxim.c | 22 +-- sound/soc/intel/boards/sof_sdw_rt5682.c | 2 +- sound/soc/intel/boards/sof_sdw_rt700.c | 2 +- sound/soc/intel/boards/sof_sdw_rt711.c | 12 +- sound/soc/intel/boards/sof_sdw_rt712_sdca.c | 2 +- sound/soc/intel/boards/sof_sdw_rt722_sdca.c | 2 +- sound/soc/intel/boards/sof_sdw_rt_amp.c | 14 +- sound/soc/intel/boards/sof_sdw_rt_dmic.c | 2 +- .../boards/sof_sdw_rt_sdca_jack_common.c | 12 +- 16 files changed, 188 insertions(+), 188 deletions(-) diff --git a/sound/soc/intel/boards/bridge_cs35l56.c b/sound/soc/intel/boards/bridge_cs35l56.c index 6b2526c781e5..55e5cfbb2f14 100644 --- a/sound/soc/intel/boards/bridge_cs35l56.c +++ b/sound/soc/intel/boards/bridge_cs35l56.c @@ -95,8 +95,8 @@ static const struct snd_soc_dai_link bridge_dai_template = { SND_SOC_DAILINK_REG(bridge_dai), }; -int bridge_cs35l56_count_sidecar(struct snd_soc_card *card, - int *num_dais, int *num_devs) +int asoc_sdw_bridge_cs35l56_count_sidecar(struct snd_soc_card *card, + int *num_dais, int *num_devs) { if (sof_sdw_quirk & SOC_SDW_SIDECAR_AMPS) { (*num_dais)++; @@ -106,9 +106,9 @@ int bridge_cs35l56_count_sidecar(struct snd_soc_card *card, return 0; } -int bridge_cs35l56_add_sidecar(struct snd_soc_card *card, - struct snd_soc_dai_link **dai_links, - struct snd_soc_codec_conf **codec_conf) +int asoc_sdw_bridge_cs35l56_add_sidecar(struct snd_soc_card *card, + struct snd_soc_dai_link **dai_links, + struct snd_soc_codec_conf **codec_conf) { if (sof_sdw_quirk & SOC_SDW_SIDECAR_AMPS) { **dai_links = bridge_dai_template; @@ -125,10 +125,10 @@ int bridge_cs35l56_add_sidecar(struct snd_soc_card *card, return 0; } -int bridge_cs35l56_spk_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback) +int asoc_sdw_bridge_cs35l56_spk_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback) { if (sof_sdw_quirk & SOC_SDW_SIDECAR_AMPS) info->amp_num += ARRAY_SIZE(bridge_cs35l56_name_prefixes); diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 9395daf220e9..64418976aba4 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -740,7 +740,7 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "rt700-aif1", .dai_type = SOC_SDW_DAI_TYPE_JACK, .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - .rtd_init = rt700_rtd_init, + .rtd_init = asoc_sdw_rt700_rtd_init, .controls = rt700_controls, .num_controls = ARRAY_SIZE(rt700_controls), .widgets = rt700_widgets, @@ -758,9 +758,9 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "rt711-sdca-aif1", .dai_type = SOC_SDW_DAI_TYPE_JACK, .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - .init = sof_sdw_rt_sdca_jack_init, - .exit = sof_sdw_rt_sdca_jack_exit, - .rtd_init = rt_sdca_jack_rtd_init, + .init = asoc_sdw_rt_sdca_jack_init, + .exit = asoc_sdw_rt_sdca_jack_exit, + .rtd_init = asoc_sdw_rt_sdca_jack_rtd_init, .controls = generic_jack_controls, .num_controls = ARRAY_SIZE(generic_jack_controls), .widgets = generic_jack_widgets, @@ -778,9 +778,9 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "rt711-aif1", .dai_type = SOC_SDW_DAI_TYPE_JACK, .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - .init = sof_sdw_rt711_init, - .exit = sof_sdw_rt711_exit, - .rtd_init = rt711_rtd_init, + .init = asoc_sdw_rt711_init, + .exit = asoc_sdw_rt711_exit, + .rtd_init = asoc_sdw_rt711_rtd_init, .controls = generic_jack_controls, .num_controls = ARRAY_SIZE(generic_jack_controls), .widgets = generic_jack_widgets, @@ -798,9 +798,9 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "rt712-sdca-aif1", .dai_type = SOC_SDW_DAI_TYPE_JACK, .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - .init = sof_sdw_rt_sdca_jack_init, - .exit = sof_sdw_rt_sdca_jack_exit, - .rtd_init = rt_sdca_jack_rtd_init, + .init = asoc_sdw_rt_sdca_jack_init, + .exit = asoc_sdw_rt_sdca_jack_exit, + .rtd_init = asoc_sdw_rt_sdca_jack_rtd_init, .controls = generic_jack_controls, .num_controls = ARRAY_SIZE(generic_jack_controls), .widgets = generic_jack_widgets, @@ -811,9 +811,9 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "rt712-sdca-aif2", .dai_type = SOC_SDW_DAI_TYPE_AMP, .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, - .init = sof_sdw_rt_amp_init, - .exit = sof_sdw_rt_amp_exit, - .rtd_init = rt712_spk_rtd_init, + .init = asoc_sdw_rt_amp_init, + .exit = asoc_sdw_rt_amp_exit, + .rtd_init = asoc_sdw_rt712_spk_rtd_init, .controls = generic_spk_controls, .num_controls = ARRAY_SIZE(generic_spk_controls), .widgets = generic_spk_widgets, @@ -831,7 +831,7 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "rt712-sdca-dmic-aif1", .dai_type = SOC_SDW_DAI_TYPE_MIC, .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, - .rtd_init = rt_dmic_rtd_init, + .rtd_init = asoc_sdw_rt_dmic_rtd_init, }, }, .dai_num = 1, @@ -845,9 +845,9 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "rt712-sdca-aif1", .dai_type = SOC_SDW_DAI_TYPE_JACK, .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - .init = sof_sdw_rt_sdca_jack_init, - .exit = sof_sdw_rt_sdca_jack_exit, - .rtd_init = rt_sdca_jack_rtd_init, + .init = asoc_sdw_rt_sdca_jack_init, + .exit = asoc_sdw_rt_sdca_jack_exit, + .rtd_init = asoc_sdw_rt_sdca_jack_rtd_init, .controls = generic_jack_controls, .num_controls = ARRAY_SIZE(generic_jack_controls), .widgets = generic_jack_widgets, @@ -865,7 +865,7 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "rt712-sdca-dmic-aif1", .dai_type = SOC_SDW_DAI_TYPE_MIC, .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, - .rtd_init = rt_dmic_rtd_init, + .rtd_init = asoc_sdw_rt_dmic_rtd_init, }, }, .dai_num = 1, @@ -879,9 +879,9 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "rt1308-aif", .dai_type = SOC_SDW_DAI_TYPE_AMP, .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, - .init = sof_sdw_rt_amp_init, - .exit = sof_sdw_rt_amp_exit, - .rtd_init = rt_amp_spk_rtd_init, + .init = asoc_sdw_rt_amp_init, + .exit = asoc_sdw_rt_amp_exit, + .rtd_init = asoc_sdw_rt_amp_spk_rtd_init, .controls = generic_spk_controls, .num_controls = ARRAY_SIZE(generic_spk_controls), .widgets = generic_spk_widgets, @@ -889,7 +889,7 @@ static struct asoc_sdw_codec_info codec_info_list[] = { }, }, .dai_num = 1, - .ops = &sof_sdw_rt1308_i2s_ops, + .ops = &soc_sdw_rt1308_i2s_ops, }, { .part_id = 0x1316, @@ -899,9 +899,9 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "rt1316-aif", .dai_type = SOC_SDW_DAI_TYPE_AMP, .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, - .init = sof_sdw_rt_amp_init, - .exit = sof_sdw_rt_amp_exit, - .rtd_init = rt_amp_spk_rtd_init, + .init = asoc_sdw_rt_amp_init, + .exit = asoc_sdw_rt_amp_exit, + .rtd_init = asoc_sdw_rt_amp_spk_rtd_init, .controls = generic_spk_controls, .num_controls = ARRAY_SIZE(generic_spk_controls), .widgets = generic_spk_widgets, @@ -918,9 +918,9 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "rt1318-aif", .dai_type = SOC_SDW_DAI_TYPE_AMP, .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, - .init = sof_sdw_rt_amp_init, - .exit = sof_sdw_rt_amp_exit, - .rtd_init = rt_amp_spk_rtd_init, + .init = asoc_sdw_rt_amp_init, + .exit = asoc_sdw_rt_amp_exit, + .rtd_init = asoc_sdw_rt_amp_spk_rtd_init, .controls = generic_spk_controls, .num_controls = ARRAY_SIZE(generic_spk_controls), .widgets = generic_spk_widgets, @@ -939,7 +939,7 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "rt715-sdca-aif2", .dai_type = SOC_SDW_DAI_TYPE_MIC, .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, - .rtd_init = rt_dmic_rtd_init, + .rtd_init = asoc_sdw_rt_dmic_rtd_init, }, }, .dai_num = 1, @@ -954,7 +954,7 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "rt715-sdca-aif2", .dai_type = SOC_SDW_DAI_TYPE_MIC, .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, - .rtd_init = rt_dmic_rtd_init, + .rtd_init = asoc_sdw_rt_dmic_rtd_init, }, }, .dai_num = 1, @@ -969,7 +969,7 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "rt715-aif2", .dai_type = SOC_SDW_DAI_TYPE_MIC, .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, - .rtd_init = rt_dmic_rtd_init, + .rtd_init = asoc_sdw_rt_dmic_rtd_init, }, }, .dai_num = 1, @@ -984,7 +984,7 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "rt715-aif2", .dai_type = SOC_SDW_DAI_TYPE_MIC, .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, - .rtd_init = rt_dmic_rtd_init, + .rtd_init = asoc_sdw_rt_dmic_rtd_init, }, }, .dai_num = 1, @@ -998,9 +998,9 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "rt722-sdca-aif1", .dai_type = SOC_SDW_DAI_TYPE_JACK, .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - .init = sof_sdw_rt_sdca_jack_init, - .exit = sof_sdw_rt_sdca_jack_exit, - .rtd_init = rt_sdca_jack_rtd_init, + .init = asoc_sdw_rt_sdca_jack_init, + .exit = asoc_sdw_rt_sdca_jack_exit, + .rtd_init = asoc_sdw_rt_sdca_jack_rtd_init, .controls = generic_jack_controls, .num_controls = ARRAY_SIZE(generic_jack_controls), .widgets = generic_jack_widgets, @@ -1012,9 +1012,9 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_type = SOC_SDW_DAI_TYPE_AMP, /* No feedback capability is provided by rt722-sdca codec driver*/ .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, - .init = sof_sdw_rt_amp_init, - .exit = sof_sdw_rt_amp_exit, - .rtd_init = rt722_spk_rtd_init, + .init = asoc_sdw_rt_amp_init, + .exit = asoc_sdw_rt_amp_exit, + .rtd_init = asoc_sdw_rt722_spk_rtd_init, .controls = generic_spk_controls, .num_controls = ARRAY_SIZE(generic_spk_controls), .widgets = generic_spk_widgets, @@ -1025,7 +1025,7 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "rt722-sdca-aif3", .dai_type = SOC_SDW_DAI_TYPE_MIC, .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, - .rtd_init = rt_dmic_rtd_init, + .rtd_init = asoc_sdw_rt_dmic_rtd_init, }, }, .dai_num = 3, @@ -1038,8 +1038,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "max98373-aif1", .dai_type = SOC_SDW_DAI_TYPE_AMP, .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, - .init = sof_sdw_maxim_init, - .rtd_init = maxim_spk_rtd_init, + .init = asoc_sdw_maxim_init, + .rtd_init = asoc_sdw_maxim_spk_rtd_init, .controls = maxim_controls, .num_controls = ARRAY_SIZE(maxim_controls), .widgets = maxim_widgets, @@ -1056,8 +1056,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "max98363-aif1", .dai_type = SOC_SDW_DAI_TYPE_AMP, .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, - .init = sof_sdw_maxim_init, - .rtd_init = maxim_spk_rtd_init, + .init = asoc_sdw_maxim_init, + .rtd_init = asoc_sdw_maxim_spk_rtd_init, .controls = maxim_controls, .num_controls = ARRAY_SIZE(maxim_controls), .widgets = maxim_widgets, @@ -1074,7 +1074,7 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "rt5682-sdw", .dai_type = SOC_SDW_DAI_TYPE_JACK, .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - .rtd_init = rt5682_rtd_init, + .rtd_init = asoc_sdw_rt5682_rtd_init, .controls = generic_jack_controls, .num_controls = ARRAY_SIZE(generic_jack_controls), .widgets = generic_jack_widgets, @@ -1091,8 +1091,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "cs35l56-sdw1", .dai_type = SOC_SDW_DAI_TYPE_AMP, .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, - .init = sof_sdw_cs_amp_init, - .rtd_init = cs_spk_rtd_init, + .init = asoc_sdw_cs_amp_init, + .rtd_init = asoc_sdw_cs_spk_rtd_init, .controls = generic_spk_controls, .num_controls = ARRAY_SIZE(generic_spk_controls), .widgets = generic_spk_widgets, @@ -1109,7 +1109,7 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "cs42l42-sdw", .dai_type = SOC_SDW_DAI_TYPE_JACK, .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - .rtd_init = cs42l42_rtd_init, + .rtd_init = asoc_sdw_cs42l42_rtd_init, .controls = generic_jack_controls, .num_controls = ARRAY_SIZE(generic_jack_controls), .widgets = generic_jack_widgets, @@ -1121,15 +1121,15 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .part_id = 0x4243, .codec_name = "cs42l43-codec", - .count_sidecar = bridge_cs35l56_count_sidecar, - .add_sidecar = bridge_cs35l56_add_sidecar, + .count_sidecar = asoc_sdw_bridge_cs35l56_count_sidecar, + .add_sidecar = asoc_sdw_bridge_cs35l56_add_sidecar, .dais = { { .direction = {true, false}, .dai_name = "cs42l43-dp5", .dai_type = SOC_SDW_DAI_TYPE_JACK, .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, - .rtd_init = cs42l43_hs_rtd_init, + .rtd_init = asoc_sdw_cs42l43_hs_rtd_init, .controls = generic_jack_controls, .num_controls = ARRAY_SIZE(generic_jack_controls), .widgets = generic_jack_widgets, @@ -1140,7 +1140,7 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "cs42l43-dp1", .dai_type = SOC_SDW_DAI_TYPE_MIC, .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, - .rtd_init = cs42l43_dmic_rtd_init, + .rtd_init = asoc_sdw_cs42l43_dmic_rtd_init, .widgets = generic_dmic_widgets, .num_widgets = ARRAY_SIZE(generic_dmic_widgets), }, @@ -1155,8 +1155,8 @@ static struct asoc_sdw_codec_info codec_info_list[] = { .dai_name = "cs42l43-dp6", .dai_type = SOC_SDW_DAI_TYPE_AMP, .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, - .init = sof_sdw_cs42l43_spk_init, - .rtd_init = cs42l43_spk_rtd_init, + .init = asoc_sdw_cs42l43_spk_init, + .rtd_init = asoc_sdw_cs42l43_spk_rtd_init, .controls = generic_spk_controls, .num_controls = ARRAY_SIZE(generic_spk_controls), .widgets = generic_spk_widgets, @@ -1220,7 +1220,7 @@ static struct asoc_sdw_codec_info codec_info_list[] = { }, }; -static struct asoc_sdw_codec_info *find_codec_info_part(const u64 adr) +static struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_part(const u64 adr) { unsigned int part_id, sdw_version; int i; @@ -1241,7 +1241,7 @@ static struct asoc_sdw_codec_info *find_codec_info_part(const u64 adr) } -static struct asoc_sdw_codec_info *find_codec_info_acpi(const u8 *acpi_id) +static struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_acpi(const u8 *acpi_id) { int i; @@ -1255,8 +1255,8 @@ static struct asoc_sdw_codec_info *find_codec_info_acpi(const u8 *acpi_id) return NULL; } -static struct asoc_sdw_codec_info *find_codec_info_dai(const char *dai_name, - int *dai_index) +static struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_dai(const char *dai_name, + int *dai_index) { int i, j; @@ -1320,12 +1320,12 @@ static int init_simple_dai_link(struct device *dev, struct snd_soc_dai_link *dai return 0; } -static bool is_unique_device(const struct snd_soc_acpi_link_adr *adr_link, - unsigned int sdw_version, - unsigned int mfg_id, - unsigned int part_id, - unsigned int class_id, - int index_in_link) +static bool asoc_sdw_is_unique_device(const struct snd_soc_acpi_link_adr *adr_link, + unsigned int sdw_version, + unsigned int mfg_id, + unsigned int part_id, + unsigned int class_id, + int index_in_link) { int i; @@ -1354,10 +1354,10 @@ static bool is_unique_device(const struct snd_soc_acpi_link_adr *adr_link, return true; } -static const char *get_codec_name(struct device *dev, - const struct asoc_sdw_codec_info *codec_info, - const struct snd_soc_acpi_link_adr *adr_link, - int adr_index) +static const char *asoc_sdw_get_codec_name(struct device *dev, + const struct asoc_sdw_codec_info *codec_info, + const struct snd_soc_acpi_link_adr *adr_link, + int adr_index) { u64 adr = adr_link->adr_d[adr_index].adr; unsigned int sdw_version = SDW_VERSION(adr); @@ -1369,8 +1369,8 @@ static const char *get_codec_name(struct device *dev, if (codec_info->codec_name) return devm_kstrdup(dev, codec_info->codec_name, GFP_KERNEL); - else if (is_unique_device(adr_link, sdw_version, mfg_id, part_id, - class_id, adr_index)) + else if (asoc_sdw_is_unique_device(adr_link, sdw_version, mfg_id, part_id, + class_id, adr_index)) return devm_kasprintf(dev, GFP_KERNEL, "sdw:0:%01x:%04x:%04x:%02x", link_id, mfg_id, part_id, class_id); else @@ -1380,7 +1380,7 @@ static const char *get_codec_name(struct device *dev, return NULL; } -static int sof_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd) +static int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; struct asoc_sdw_codec_info *codec_info; @@ -1390,7 +1390,7 @@ static int sof_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd) int i; for_each_rtd_codec_dais(rtd, i, dai) { - codec_info = find_codec_info_dai(dai->name, &dai_index); + codec_info = asoc_sdw_find_codec_info_dai(dai->name, &dai_index); if (!codec_info) return -EINVAL; @@ -1538,13 +1538,13 @@ static int parse_sdw_endpoints(struct snd_soc_card *card, return -EINVAL; } - codec_info = find_codec_info_part(adr_dev->adr); + codec_info = asoc_sdw_find_codec_info_part(adr_dev->adr); if (!codec_info) return -EINVAL; ctx->ignore_pch_dmic |= codec_info->ignore_pch_dmic; - codec_name = get_codec_name(dev, codec_info, adr_link, i); + codec_name = asoc_sdw_get_codec_name(dev, codec_info, adr_link, i); if (!codec_name) return -ENOMEM; @@ -1736,7 +1736,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, init_dai_link(dev, *dai_links, be_id, name, playback, capture, cpus, num_cpus, codecs, num_codecs, - sof_sdw_rtd_init, &sdw_ops); + asoc_sdw_rtd_init, &sdw_ops); /* * SoundWire DAILINKs use 'stream' functions and Bank Switch operations @@ -1831,7 +1831,7 @@ static int create_dmic_dailinks(struct snd_soc_card *card, ret = init_simple_dai_link(dev, *dai_links, be_id, "dmic01", 0, 1, // DMIC only supports capture "DMIC01 Pin", "dmic-codec", "dmic-hifi", - sof_sdw_dmic_init, NULL); + asoc_sdw_dmic_init, NULL); if (ret) return ret; @@ -1840,7 +1840,7 @@ static int create_dmic_dailinks(struct snd_soc_card *card, ret = init_simple_dai_link(dev, *dai_links, be_id, "dmic16k", 0, 1, // DMIC only supports capture "DMIC16k Pin", "dmic-codec", "dmic-hifi", - /* don't call sof_sdw_dmic_init() twice */ + /* don't call asoc_sdw_dmic_init() twice */ NULL, NULL); if (ret) return ret; @@ -1956,7 +1956,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) * system only when I2S mode is supported, not sdw mode. * Here check ACPI ID to confirm I2S is supported. */ - ssp_info = find_codec_info_acpi(mach->id); + ssp_info = asoc_sdw_find_codec_info_acpi(mach->id); if (ssp_info) { ssp_mask = SOF_SSP_GET_PORT(sof_sdw_quirk); ssp_num = hweight_long(ssp_mask); diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index e88b5627560b..28db2f1c6dae 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -148,75 +148,75 @@ int sof_sdw_hdmi_init(struct snd_soc_pcm_runtime *rtd); int sof_sdw_hdmi_card_late_probe(struct snd_soc_card *card); /* DMIC support */ -int sof_sdw_dmic_init(struct snd_soc_pcm_runtime *rtd); +int asoc_sdw_dmic_init(struct snd_soc_pcm_runtime *rtd); /* RT711 support */ -int sof_sdw_rt711_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback); -int sof_sdw_rt711_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); +int asoc_sdw_rt711_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback); +int asoc_sdw_rt711_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); /* RT711-SDCA support */ -int sof_sdw_rt_sdca_jack_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback); -int sof_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); +int asoc_sdw_rt_sdca_jack_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback); +int asoc_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); /* RT1308 I2S support */ -extern const struct snd_soc_ops sof_sdw_rt1308_i2s_ops; +extern const struct snd_soc_ops soc_sdw_rt1308_i2s_ops; /* generic amp support */ -int sof_sdw_rt_amp_init(struct snd_soc_card *card, +int asoc_sdw_rt_amp_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback); +int asoc_sdw_rt_amp_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); + +/* MAXIM codec support */ +int asoc_sdw_maxim_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, struct asoc_sdw_codec_info *info, bool playback); -int sof_sdw_rt_amp_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); - -/* MAXIM codec support */ -int sof_sdw_maxim_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback); /* CS42L43 support */ -int sof_sdw_cs42l43_spk_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback); +int asoc_sdw_cs42l43_spk_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback); /* CS AMP support */ -int bridge_cs35l56_count_sidecar(struct snd_soc_card *card, - int *num_dais, int *num_devs); -int bridge_cs35l56_add_sidecar(struct snd_soc_card *card, - struct snd_soc_dai_link **dai_links, - struct snd_soc_codec_conf **codec_conf); -int bridge_cs35l56_spk_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback); - -int sof_sdw_cs_amp_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback); +int asoc_sdw_bridge_cs35l56_count_sidecar(struct snd_soc_card *card, + int *num_dais, int *num_devs); +int asoc_sdw_bridge_cs35l56_add_sidecar(struct snd_soc_card *card, + struct snd_soc_dai_link **dai_links, + struct snd_soc_codec_conf **codec_conf); +int asoc_sdw_bridge_cs35l56_spk_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback); + +int asoc_sdw_cs_amp_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback); /* dai_link init callbacks */ -int cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int rt700_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_rt700_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); #endif diff --git a/sound/soc/intel/boards/sof_sdw_cs42l42.c b/sound/soc/intel/boards/sof_sdw_cs42l42.c index fc18e4aa3dbe..d28477c50469 100644 --- a/sound/soc/intel/boards/sof_sdw_cs42l42.c +++ b/sound/soc/intel/boards/sof_sdw_cs42l42.c @@ -36,7 +36,7 @@ static struct snd_soc_jack_pin cs42l42_jack_pins[] = { }, }; -int cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) +int asoc_sdw_cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_card *card = rtd->card; struct mc_private *ctx = snd_soc_card_get_drvdata(card); diff --git a/sound/soc/intel/boards/sof_sdw_cs42l43.c b/sound/soc/intel/boards/sof_sdw_cs42l43.c index 1688f29a977a..bb371b2649cf 100644 --- a/sound/soc/intel/boards/sof_sdw_cs42l43.c +++ b/sound/soc/intel/boards/sof_sdw_cs42l43.c @@ -48,7 +48,7 @@ static struct snd_soc_jack_pin sof_jack_pins[] = { }, }; -int cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) +int asoc_sdw_cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; struct mc_private *ctx = snd_soc_card_get_drvdata(rtd->card); @@ -99,7 +99,7 @@ int cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai return ret; } -int cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) +int asoc_sdw_cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_card *card = rtd->card; int ret; @@ -121,10 +121,10 @@ int cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *da return ret; } -int sof_sdw_cs42l43_spk_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback) +int asoc_sdw_cs42l43_spk_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback) { /* Do init on playback link only. */ if (!playback) @@ -132,10 +132,10 @@ int sof_sdw_cs42l43_spk_init(struct snd_soc_card *card, info->amp_num++; - return bridge_cs35l56_spk_init(card, dai_links, info, playback); + return asoc_sdw_bridge_cs35l56_spk_init(card, dai_links, info, playback); } -int cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) +int asoc_sdw_cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_card *card = rtd->card; int ret; diff --git a/sound/soc/intel/boards/sof_sdw_cs_amp.c b/sound/soc/intel/boards/sof_sdw_cs_amp.c index 206fe7610a56..6479974bd2c3 100644 --- a/sound/soc/intel/boards/sof_sdw_cs_amp.c +++ b/sound/soc/intel/boards/sof_sdw_cs_amp.c @@ -14,7 +14,7 @@ #define CODEC_NAME_SIZE 8 -int cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) +int asoc_sdw_cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { const char *dai_name = rtd->dai_link->codecs->dai_name; struct snd_soc_card *card = rtd->card; @@ -45,10 +45,10 @@ int cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) return 0; } -int sof_sdw_cs_amp_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback) +int asoc_sdw_cs_amp_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback) { /* Do init on playback link only. */ if (!playback) diff --git a/sound/soc/intel/boards/sof_sdw_dmic.c b/sound/soc/intel/boards/sof_sdw_dmic.c index 19df0f7a1d85..d9f2e072f401 100644 --- a/sound/soc/intel/boards/sof_sdw_dmic.c +++ b/sound/soc/intel/boards/sof_sdw_dmic.c @@ -19,7 +19,7 @@ static const struct snd_soc_dapm_route dmic_map[] = { {"DMic", NULL, "SoC DMIC"}, }; -int sof_sdw_dmic_init(struct snd_soc_pcm_runtime *rtd) +int asoc_sdw_dmic_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; int ret; diff --git a/sound/soc/intel/boards/sof_sdw_maxim.c b/sound/soc/intel/boards/sof_sdw_maxim.c index f689dc29c493..fd8347e28849 100644 --- a/sound/soc/intel/boards/sof_sdw_maxim.c +++ b/sound/soc/intel/boards/sof_sdw_maxim.c @@ -21,7 +21,7 @@ static const struct snd_soc_dapm_route max_98373_dapm_routes[] = { { "Right Spk", NULL, "Right BE_OUT" }, }; -int maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) +int asoc_sdw_maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_card *card = rtd->card; int ret; @@ -75,7 +75,7 @@ static int mx8373_enable_spk_pin(struct snd_pcm_substream *substream, bool enabl return 0; } -static int mx8373_sdw_prepare(struct snd_pcm_substream *substream) +static int asoc_sdw_mx8373_prepare(struct snd_pcm_substream *substream) { int ret; @@ -87,7 +87,7 @@ static int mx8373_sdw_prepare(struct snd_pcm_substream *substream) return mx8373_enable_spk_pin(substream, true); } -static int mx8373_sdw_hw_free(struct snd_pcm_substream *substream) +static int asoc_sdw_mx8373_hw_free(struct snd_pcm_substream *substream) { int ret; @@ -101,14 +101,14 @@ static int mx8373_sdw_hw_free(struct snd_pcm_substream *substream) static const struct snd_soc_ops max_98373_sdw_ops = { .startup = asoc_sdw_startup, - .prepare = mx8373_sdw_prepare, + .prepare = asoc_sdw_mx8373_prepare, .trigger = asoc_sdw_trigger, .hw_params = asoc_sdw_hw_params, - .hw_free = mx8373_sdw_hw_free, + .hw_free = asoc_sdw_mx8373_hw_free, .shutdown = asoc_sdw_shutdown, }; -static int mx8373_sdw_late_probe(struct snd_soc_card *card) +static int asoc_sdw_mx8373_sdw_late_probe(struct snd_soc_card *card) { struct snd_soc_dapm_context *dapm = &card->dapm; @@ -118,10 +118,10 @@ static int mx8373_sdw_late_probe(struct snd_soc_card *card) return snd_soc_dapm_sync(dapm); } -int sof_sdw_maxim_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback) +int asoc_sdw_maxim_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback) { info->amp_num++; @@ -133,7 +133,7 @@ int sof_sdw_maxim_init(struct snd_soc_card *card, */ break; case SOF_SDW_PART_ID_MAX98373: - info->codec_card_late_probe = mx8373_sdw_late_probe; + info->codec_card_late_probe = asoc_sdw_mx8373_sdw_late_probe; dai_links->ops = &max_98373_sdw_ops; break; default: diff --git a/sound/soc/intel/boards/sof_sdw_rt5682.c b/sound/soc/intel/boards/sof_sdw_rt5682.c index 67737815d016..3584638e2192 100644 --- a/sound/soc/intel/boards/sof_sdw_rt5682.c +++ b/sound/soc/intel/boards/sof_sdw_rt5682.c @@ -35,7 +35,7 @@ static struct snd_soc_jack_pin rt5682_jack_pins[] = { }, }; -int rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) +int asoc_sdw_rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_card *card = rtd->card; struct mc_private *ctx = snd_soc_card_get_drvdata(card); diff --git a/sound/soc/intel/boards/sof_sdw_rt700.c b/sound/soc/intel/boards/sof_sdw_rt700.c index 0db730071be2..a90d69573736 100644 --- a/sound/soc/intel/boards/sof_sdw_rt700.c +++ b/sound/soc/intel/boards/sof_sdw_rt700.c @@ -33,7 +33,7 @@ static struct snd_soc_jack_pin rt700_jack_pins[] = { }, }; -int rt700_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) +int asoc_sdw_rt700_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_card *card = rtd->card; struct mc_private *ctx = snd_soc_card_get_drvdata(card); diff --git a/sound/soc/intel/boards/sof_sdw_rt711.c b/sound/soc/intel/boards/sof_sdw_rt711.c index fff76291fca2..e4d300d7d5ef 100644 --- a/sound/soc/intel/boards/sof_sdw_rt711.c +++ b/sound/soc/intel/boards/sof_sdw_rt711.c @@ -59,7 +59,7 @@ static struct snd_soc_jack_pin rt711_jack_pins[] = { }, }; -int rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) +int asoc_sdw_rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_card *card = rtd->card; struct mc_private *ctx = snd_soc_card_get_drvdata(card); @@ -111,7 +111,7 @@ int rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) return ret; } -int sof_sdw_rt711_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) +int asoc_sdw_rt711_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) { struct mc_private *ctx = snd_soc_card_get_drvdata(card); @@ -124,10 +124,10 @@ int sof_sdw_rt711_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_l return 0; } -int sof_sdw_rt711_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback) +int asoc_sdw_rt711_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback) { struct mc_private *ctx = snd_soc_card_get_drvdata(card); struct device *sdw_dev; diff --git a/sound/soc/intel/boards/sof_sdw_rt712_sdca.c b/sound/soc/intel/boards/sof_sdw_rt712_sdca.c index 788796461885..bb09d1ddafd2 100644 --- a/sound/soc/intel/boards/sof_sdw_rt712_sdca.c +++ b/sound/soc/intel/boards/sof_sdw_rt712_sdca.c @@ -26,7 +26,7 @@ static const struct snd_soc_dapm_route rt712_spk_map[] = { { "Speaker", NULL, "rt712 SPOR" }, }; -int rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) +int asoc_sdw_rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_card *card = rtd->card; int ret; diff --git a/sound/soc/intel/boards/sof_sdw_rt722_sdca.c b/sound/soc/intel/boards/sof_sdw_rt722_sdca.c index 083d281bd052..2da9134ad1a3 100644 --- a/sound/soc/intel/boards/sof_sdw_rt722_sdca.c +++ b/sound/soc/intel/boards/sof_sdw_rt722_sdca.c @@ -19,7 +19,7 @@ static const struct snd_soc_dapm_route rt722_spk_map[] = { { "Speaker", NULL, "rt722 SPK" }, }; -int rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) +int asoc_sdw_rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_card *card = rtd->card; int ret; diff --git a/sound/soc/intel/boards/sof_sdw_rt_amp.c b/sound/soc/intel/boards/sof_sdw_rt_amp.c index da1a8cc1c63d..4cf392c84cc7 100644 --- a/sound/soc/intel/boards/sof_sdw_rt_amp.c +++ b/sound/soc/intel/boards/sof_sdw_rt_amp.c @@ -173,7 +173,7 @@ static const struct snd_soc_dapm_route *get_codec_name_and_route(struct snd_soc_ return rt1318_map; } -int rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) +int asoc_sdw_rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_card *card = rtd->card; const struct snd_soc_dapm_route *rt_amp_map; @@ -233,11 +233,11 @@ static int rt1308_i2s_hw_params(struct snd_pcm_substream *substream, } /* machine stream operations */ -const struct snd_soc_ops sof_sdw_rt1308_i2s_ops = { +const struct snd_soc_ops soc_sdw_rt1308_i2s_ops = { .hw_params = rt1308_i2s_hw_params, }; -int sof_sdw_rt_amp_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) +int asoc_sdw_rt_amp_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) { struct mc_private *ctx = snd_soc_card_get_drvdata(card); @@ -254,10 +254,10 @@ int sof_sdw_rt_amp_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_ return 0; } -int sof_sdw_rt_amp_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback) +int asoc_sdw_rt_amp_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback) { struct mc_private *ctx = snd_soc_card_get_drvdata(card); struct device *sdw_dev1, *sdw_dev2; diff --git a/sound/soc/intel/boards/sof_sdw_rt_dmic.c b/sound/soc/intel/boards/sof_sdw_rt_dmic.c index ea7c1a4bc566..64960b059834 100644 --- a/sound/soc/intel/boards/sof_sdw_rt_dmic.c +++ b/sound/soc/intel/boards/sof_sdw_rt_dmic.c @@ -12,7 +12,7 @@ #include "sof_board_helpers.h" #include "sof_sdw_common.h" -int rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) +int asoc_sdw_rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_card *card = rtd->card; struct snd_soc_component *component; diff --git a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c b/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c index 9c3b93f808a2..d84aec2b4c78 100644 --- a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c +++ b/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c @@ -83,7 +83,7 @@ static const char * const need_sdca_suffix[] = { "rt711", "rt713" }; -int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) +int asoc_sdw_rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_card *card = rtd->card; struct mc_private *ctx = snd_soc_card_get_drvdata(card); @@ -161,7 +161,7 @@ int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *d return ret; } -int sof_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) +int asoc_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) { struct mc_private *ctx = snd_soc_card_get_drvdata(card); @@ -178,10 +178,10 @@ int sof_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_link return 0; } -int sof_sdw_rt_sdca_jack_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback) +int asoc_sdw_rt_sdca_jack_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback) { struct mc_private *ctx = snd_soc_card_get_drvdata(card); struct device *sdw_dev; From patchwork Thu Aug 1 09:14: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: 816301 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 (unknown [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 721A3C3DA4A for ; Thu, 1 Aug 2024 09:32:59 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 980503785; Thu, 1 Aug 2024 11:31:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 980503785 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722504722; bh=RRWOhkNxk8bwcefOMdSEvxndn4+nmJJpgvQfwB5G1AA=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=HGFMTH2YVcnNOg7eIz4VXu/RQENfKRU+7IripUOLGU7XNLXCsiVxGmyFsYSV+JUlT A49hdaW4QZ+1Tc+hzyGx/i8CAnsdZFCSPCSgL6fV7QEvbFvBwMu82Wro9VXUJh5X6p 1REXKnSERtOvEq84s/Y0ZfqBuaJ8gR6WtRwtSzmw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1D84AF80677; Thu, 1 Aug 2024 11:30:35 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 6B61AF80677; Thu, 1 Aug 2024 11:30:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 93CBDF8026A; Thu, 1 Aug 2024 11:18:03 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2405::601]) (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 0C02DF8007E for ; Thu, 1 Aug 2024 11:18:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0C02DF8007E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=P7FCZfwc ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uViDMPkwqJjnyNLWOZmXTzxKz6E9KQdgQercZ+7v7j49GFxjjV9TtwJq14p6R9URBSGxdlN3q3haQRWy4WErnVB83eICZ3qwVFNcBKJP96yBJMIhLPuN/rgakm+jdyTJ9HPVzMM7CyTdEbidufzegpHlL1B/fefo3QNizOzIaDfEcxsPoJNtl7t6JysfbZYYNC+VACLory3LxKpY1Zit7oK3vnvSjaRvXsGhAnuSw/0V+NK0OSQH8TCzos6AMjx6kGKQFytzHwpBEXXSuuwulU4lWXlmfJ5UZgqPRR5s3J+9Sqj8NXA1+jRlCrnTKBFX1zk8hgsfM/XH4lK5KIXk5Q== 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=hHxi7ctKGh80fVvl+RED+g1Xyt1hr9XfoIzAwJv4+84=; b=mVv5aHKy7diD+ij+Lw/95BNHwbzhZHwGpjzgzeMF8tz+N/oYDdQ1E/7bVqGvVTaKVxCnjrjse9M+T1lHLcKPV99sKQR0BeK/7hlK1wbbXOgCxKxePtbb8+zZjHxSlUBW2sMSJFMjpJZ2Ghlhi4GoHyHVQSi//AfBpp2Bf0iFBJOmzfWkkKjbGSo2koggZTMVNWA9jBstVPY9y0lTrrgre7agNBA227oWh0dpXtPV8JOfMs+6k75c5I3PJ15YvQJvgM2bY8YfgYfvs0pzEYjxsAfHzeWnAZMxNKeYu+/2UvBOEghSnk6gYOmo0ajSA/IDC1G4bpNMeCfiB+4jmKC5ww== 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=hHxi7ctKGh80fVvl+RED+g1Xyt1hr9XfoIzAwJv4+84=; b=P7FCZfwciFtuzJs6/CYUAfaL6BMD4SXSqb2feia3NKk1lHeD2ZBxOsuveoJpgj9Zb3ji1017q15jE+3Kr7xxKAwpW2cKwtcITg6qpVFqQTgZDkhVVJGM5TrUlV8kEUIbMu1WX9JMDh4u2Y52BjWwhyD8VVpy582uPcdM5MHF8Ho= Received: from CH0P221CA0009.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:11c::11) by SJ0PR12MB5676.namprd12.prod.outlook.com (2603:10b6:a03:42e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21; Thu, 1 Aug 2024 09:17:56 +0000 Received: from DS2PEPF00003446.namprd04.prod.outlook.com (2603:10b6:610:11c:cafe::eb) by CH0P221CA0009.outlook.office365.com (2603:10b6:610:11c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend Transport; Thu, 1 Aug 2024 09:17:55 +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 DS2PEPF00003446.mail.protection.outlook.com (10.167.17.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:17:53 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Thu, 1 Aug 2024 04:17:50 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:17:44 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Cezary Rojewski , Liam Girdwood , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Jaroslav Kysela , "Takashi Iwai" , Kuninori Morimoto , Charles Keepax , Brent Lu , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH RESEND 05/31] ASoC: intel: rename maxim codec macros Date: Thu, 1 Aug 2024 14:44:20 +0530 Message-ID: <20240801091446.10457-6-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003446:EE_|SJ0PR12MB5676:EE_ X-MS-Office365-Filtering-Correlation-Id: 18f4e0e5-44e4-4800-0cc4-08dcb20ad30c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026|7416014; X-Microsoft-Antispam-Message-Info: 69w/AftyS2MDs9ci4ArjEVsoTmT6vWjXvaqwv/HDg41exFmdVxtBixuMs7YyaZnfkov+mu5c/B6CuHJF69GcGx0KLMj2v6/unubp5b3AYCO1HXKbivZERPC+qbT/V20H5vLFReooA7Y+jzF67VGDaAw9cFKtoheWfLchoDry+dhQISX5ob0j88K6aZt80ZdaCyjdV9+WgyBG7FP9xB6q4C3Y99kMG6HkVXcBcQ1bketPIIL8+FTTuh0XKtL4JtFkJjzDSEhO+ijj7W0qT9mdsrIKek/CQY3yq8/Lf/HcL9U/Lc3Y+ciWqxmeRH9R2I3EtRToKzsKjQIPzYl0PPd+WAb+oSBsSzb60jOjP3sx9mdOm93ygDT9HrvIjx51iZEz2BiadFzim9bgNDrk5gOGWVq0by5Za9fcdh+/f8DjNJRe82C0y599m98snDUCCThubhzVDGw52jSmjcD8yxFw8q7Unl0lBLCowufoWT0jyJLYhpLucRg4SU8MhvYQnP/E/XzUwmDdgmlVMy/tW/MWPQmys8syJ23oqDB3pZWgKKCKeG8ZD6qv2MdA5s6tuk6/X8BOKCt7x32b+NuBw46UgYZgt+gZ6IcplBNGz0xiR+F9vv624WECbSr4aNeJe7UEMW7VpHMDJlLZhzF21O5oJFuP2EDIKws18LqmEP7SzkW9OlexGhVs3bf07e3c5YFFtfpDYgz5qMBorTBqJMlduZVCgNxE4Mfi2J8hCbEChZX1p4CpjrhG8h+RhPDJBueaTHt0gdjqr7fZQcqVQRRVyavSMn9yYov+D5TXZ97qH6iMn6tUHZyaEsE+RDGMRniIPAVPn0X0U9xOAos4HdHi1qQiQSOH3zZRQfukaRZBAkshEP9g1AeP9u//LbFcVsndaPJYuOb3KlVInSc1x5TyNEXoV7f/F7A7Hi0xrjtgL+vmASs6kt12EhvqDlQ4pyU96Dm3e5IYzDI5UOo4EoOfsRoS0d6vrx9amzCwyiAZLR4smawozzk6fPiuMa9fpx82ms+OwbDncpQjpcAPS2yC5gJbZOBDPWmC+WmIqJns/kRXcwXs4mx9DcSF+ufpQ2G/7bBgK65OYQFQMtCe5q+E1x1Mmgjs+64AQMR9F8rmGwr8Syxr7VU7KDh1ziHVlulfTonDzuqHpXebFhKruH4DKD9SsDXWDe3LiMz7YNY5R8c/VD+XNSIjpQQJVlnHfj7Qk0v45n8D8l/YEmEwib3VG3LuB1Mb6nUxlKTEqRZFLm49xUa+WFkq1w6rZ7pPT3Q+/F3cKLNal6noIlr/IeJd64q9a0qoFW/sUYOL5MEb53dr+LC4XY8DrLviXKexQEaTPiiUTSeLOopppK8318mCgsA0MJGWoHr4THMna2g4WHNVUHw5bNpucT/rsVzbHnmAobaRtDqua464vqMzkzjiNA== 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)(7416014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:17:53.8873 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 18f4e0e5-44e4-4800-0cc4-08dcb20ad30c 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: DS2PEPF00003446.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5676 Message-ID-Hash: Z7HSZTWZRT2LXNDXGFR4BZ5YLN2O5Y2R X-Message-ID-Hash: Z7HSZTWZRT2LXNDXGFR4BZ5YLN2O5Y2R X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Rename maxim codec part id macros. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw_maxim.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw_maxim.c b/sound/soc/intel/boards/sof_sdw_maxim.c index fd8347e28849..9933224fcf68 100644 --- a/sound/soc/intel/boards/sof_sdw_maxim.c +++ b/sound/soc/intel/boards/sof_sdw_maxim.c @@ -13,8 +13,8 @@ #include "sof_sdw_common.h" static int maxim_part_id; -#define SOF_SDW_PART_ID_MAX98363 0x8363 -#define SOF_SDW_PART_ID_MAX98373 0x8373 +#define SOC_SDW_PART_ID_MAX98363 0x8363 +#define SOC_SDW_PART_ID_MAX98373 0x8373 static const struct snd_soc_dapm_route max_98373_dapm_routes[] = { { "Left Spk", NULL, "Left BE_OUT" }, @@ -127,12 +127,12 @@ int asoc_sdw_maxim_init(struct snd_soc_card *card, maxim_part_id = info->part_id; switch (maxim_part_id) { - case SOF_SDW_PART_ID_MAX98363: + case SOC_SDW_PART_ID_MAX98363: /* Default ops are set in function init_dai_link. * called as part of function create_sdw_dailink */ break; - case SOF_SDW_PART_ID_MAX98373: + case SOC_SDW_PART_ID_MAX98373: info->codec_card_late_probe = asoc_sdw_mx8373_sdw_late_probe; dai_links->ops = &max_98373_sdw_ops; break; From patchwork Thu Aug 1 09:14: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: 816075 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 (unknown [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 609D8C3DA4A for ; Thu, 1 Aug 2024 09:33:18 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CEBD8376D; Thu, 1 Aug 2024 11:32:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CEBD8376D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722504738; bh=929Cw9r+c2BL0Vnc8cCXwQGvRi8hiyBrAUflFaXiA7Y=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=k76zj19HzjaCgyys3ikgs3KWn7bOCPwsUJ+vLTabGU8eV8PLTGm3ADVY9Q2f+8cNq RiFb2+ZL/11xAjnerctJDyfq+xJpg3KaMbvikAc80f0jjjC07NMtbquOOo2+7BGdXh YIkMatXaDu9Pa01ts25rSeOhDrHxRmav1JQIJM7E= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3073FF80687; Thu, 1 Aug 2024 11:30:47 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 54751F805DA; Thu, 1 Aug 2024 11:30:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 49006F8026A; Thu, 1 Aug 2024 11:18:11 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2415::601]) (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 3E79DF8007E for ; Thu, 1 Aug 2024 11:18:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3E79DF8007E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=5CKx8qgl ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TyLxjc/3/HByzR9FMw5BNIBvyX9stJ4Jsk4UJeiMrnPO9Jz+JpB3Y61B92yyw0SSuxapLPUVEbIEHGvs2qNMKy9TbfAdoziMcF9/gnDbJplYBEUJcfnIFosinTzviWg8VLR8hmon77V9G/7K18hIXdz7gD2Zc3Bl4Cfnm5x8LaR7xKkI12anMKtyJfO7XJmOeIhNWEdqvJsGTeXa0JXKINHWzJ7W6SRzxxeD+2WPtwue/UH7buhlJVCSpGoUQ7q7W0AUuIaj4KBEFaTRaPOm1FN0Rs2frKV9neZZSl069B2UawUBT8m76CUdjVTALiTtJa9dskWpzqaU2GYudoGebA== 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=eNOtexsJH/a9wEuZJl1vRdbZkCUD0L0ijL6tYqKYwS4=; b=wjYFz2rnpl7YBo9BW6aiqsoXyyAVYW2cSA1hjdgZ6y97rYvxqWuZ0n69aRlv4npn8FV518AkFpzzBVaqt5q0Jyiy4sXgU39fZHKjtQjkGPTf8zv70NGNIe3KhOuzMoX/i5PICaKyx1114oP9WpOoCT8Y1fq7rOoEQFbfZdXpc9REdrzR3f4LSTIRXa2IeUYDESysvL44AIsxPjmh5vKd5JohVBcnUbEAKRwvbF+M8KLTLB3Jc0hK1CE3k/dRM5x9EauG8xmLeqg+vkIISpQ0miiBJP0QE4zqLXAevHLrZ9BH0xVaJExgR6gMHRPkHwy+5kDnqsXi2djfpeoY2da3kg== 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=eNOtexsJH/a9wEuZJl1vRdbZkCUD0L0ijL6tYqKYwS4=; b=5CKx8qglGsKLxB7M9SB0IJO/nkyCRgliQrJWqDjeVgjzhBLI7yTAYvXl4eAY3IvbuNFiVPYy9BOaw098clPrdEdSnMzjFalMsEddg4r9Y5fJkhGQf6wlFXVVN/cxCSZj8MBhosvwwGbiHo8DGOjrUqcaWUg434Oif2FOOP9sdrA= Received: from CH2PR08CA0030.namprd08.prod.outlook.com (2603:10b6:610:5a::40) by SA3PR12MB7805.namprd12.prod.outlook.com (2603:10b6:806:319::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21; Thu, 1 Aug 2024 09:18:04 +0000 Received: from CH2PEPF0000013F.namprd02.prod.outlook.com (2603:10b6:610:5a:cafe::5e) by CH2PR08CA0030.outlook.office365.com (2603:10b6:610:5a::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22 via Frontend Transport; Thu, 1 Aug 2024 09:18:04 +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 CH2PEPF0000013F.mail.protection.outlook.com (10.167.244.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:18:04 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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.2507.39; Thu, 1 Aug 2024 04:18:03 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:17:57 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Cezary Rojewski , Liam Girdwood , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Jaroslav Kysela , "Takashi Iwai" , Charles Keepax , "Maciej Strozek" , Chao Song , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH RESEND 06/31] ASoC: intel: rename ignore_pch_dmic variable name Date: Thu, 1 Aug 2024 14:44:21 +0530 Message-ID: <20240801091446.10457-7-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000013F:EE_|SA3PR12MB7805:EE_ X-MS-Office365-Filtering-Correlation-Id: 468de2f9-6946-4ea6-f3e6-08dcb20ad969 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|376014|7416014|1800799024; X-Microsoft-Antispam-Message-Info: H5OXihLx+1tcUNfibgHxzJJxx1xW9HsBAwXRWzBlzpgF/rUUgkIj7mlMfJ1YMGUqmnl/YIKn1BGXMqMZn+sY061+0iNj/6fEKXhvWUL5ZHw+e5SjXtxnw5ZSsH5MB7YVtvciZwF5sE3s9j9YJ4iV7Kd3YEbgC8knjM97+STJRimrouVS3yCL2EE40DPhAtZLdmL9MlgBC+N5IOJoax442f21OiA2Q5bmlgh/mSHWib/JyoYzNrE41z5c/wZHTSvUPXPF0ZBtan7HNpGv3Y8iUTN+XI5kpbq6yuRitKryyF9CJLSaWMZuyDYTf0UrxHJByo+Am2snvmh5ZAdcWsSa9lPq1LmtaqRL40y6WUCYCgBI1NizaWPUMrtD5Jw7knoIGhy/3vh8yJcDpfruCuqZtaAlC3jqQc0rGmeTD+ujXnYWS8x7/ye4HtNvHAeK0KCc0RlcaOg/nMfgHsMxksohsUtEDB4iCnbjrShwEp4g+7cAmKmfCH5WlMF266ni0ZFEPp/qE53n76U4o2l64kw63JJ4NHbv6Fl813Jye6NO1NwzcJQxf9NgFkWKucVLZ6T+S1iM9nIncVxaXeQ6Kbkn9PynM2Lc0R6yX7Y6OLe/nK01NmX3bcjSaGn8PlginfY8JWeVBo0srroB1SGiBQNb4zHRxVpYhpDf4y8UVNuKlo/m5+ZrErSrSiWQ6fFtQcrwUjsI/sh/PT49t9yShIMTzgaTHCcQGl/0HTGp734Gst3A8ZO1Dl5MgJe/cBSJQb1iPyLpkzqTmsP7jS1LjPcuZMoCQg8UsixxMmEwss1IsrU8ooD2cWgbBQFaXI4XlJMUAorbNbSAgc9L5WDhFi8zp7RhwkAoqoxkzCR5hvqA6v+dCFR+28i+G37r+2rQxvOqjGGc37443mUmjiMeN6sX18gu5xY/dQcFXt8r9bJBBr2nLMo0qZdzx6IyxrJO/WAAPrwQfNp5ipmt8dfzGBCgSzGX2WTnmzye6YXZOsudLtkcBm3vo44uxS5sf00HVrPb2HpSHtbE4+N01PtSvIv4EaljrZ7mPA+UOSSkplhXb5s0uKoJXNFPIXf/4xl7NEAwXtEYde1+5fdQTLFaJ+1/FHOfJ08fhHmbSf4J2AwEad3HKagWfG0+gvJ52lrqh4mNB30b/bxMAd5nxyPmEdjj5ZuL218uE5TTGwFvu58y/62/iWHXQhXkxGNuuVPVOwof8F1QQ9omFKO/0cpB+YaRi8+4R0IvUuxlqAEmqbQrGiEvPt6z0Mx/erkvKHIPSaAUuoIiSrMKAecR/l4QuPXTanWTnIpsPc+ybdxiKMtVTCVIfvB9Z+224Zw2xilWanBMpZWTZ8nfiKQScX5hfZ9Q57a0J8m16Xz07s2vdAZZq1wN1cB4oj48y+bRfmtC/VDZ5DnUwulQXCS+u4T0QlRXTw== 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:(13230040)(82310400026)(36860700013)(376014)(7416014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:18:04.5378 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 468de2f9-6946-4ea6-f3e6-08dcb20ad969 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: CH2PEPF0000013F.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7805 Message-ID-Hash: NMUUMXWPEMB4EKW6JGBNVQB3IU7KIEYT X-Message-ID-Hash: NMUUMXWPEMB4EKW6JGBNVQB3IU7KIEYT X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Rename 'ignore_pch_dmic' variable name as 'ignore_internal_dmic'. This variable will be moved to common header file and will be used by other platform machine driver code. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 12 ++++++------ sound/soc/intel/boards/sof_sdw_common.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 64418976aba4..28021d33fd2d 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -932,7 +932,7 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .part_id = 0x714, .version_id = 3, - .ignore_pch_dmic = true, + .ignore_internal_dmic = true, .dais = { { .direction = {false, true}, @@ -947,7 +947,7 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .part_id = 0x715, .version_id = 3, - .ignore_pch_dmic = true, + .ignore_internal_dmic = true, .dais = { { .direction = {false, true}, @@ -962,7 +962,7 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .part_id = 0x714, .version_id = 2, - .ignore_pch_dmic = true, + .ignore_internal_dmic = true, .dais = { { .direction = {false, true}, @@ -977,7 +977,7 @@ static struct asoc_sdw_codec_info codec_info_list[] = { { .part_id = 0x715, .version_id = 2, - .ignore_pch_dmic = true, + .ignore_internal_dmic = true, .dais = { { .direction = {false, true}, @@ -1542,7 +1542,7 @@ static int parse_sdw_endpoints(struct snd_soc_card *card, if (!codec_info) return -EINVAL; - ctx->ignore_pch_dmic |= codec_info->ignore_pch_dmic; + ctx->ignore_internal_dmic |= codec_info->ignore_internal_dmic; codec_name = asoc_sdw_get_codec_name(dev, codec_info, adr_link, i); if (!codec_name) @@ -2018,7 +2018,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) /* dmic */ if (dmic_num > 0) { - if (ctx->ignore_pch_dmic) { + if (ctx->ignore_internal_dmic) { dev_warn(dev, "Ignoring PCH DMIC\n"); } else { ret = create_dmic_dailinks(card, &dai_links, &be_id); diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index 28db2f1c6dae..c1b58180efe5 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -106,7 +106,7 @@ struct asoc_sdw_codec_info { const char *codec_name; int amp_num; const u8 acpi_id[ACPI_ID_LEN]; - const bool ignore_pch_dmic; + const bool ignore_internal_dmic; const struct snd_soc_ops *ops; struct asoc_sdw_dai_info dais[SOC_SDW_MAX_DAI_NUM]; const int dai_num; @@ -129,7 +129,7 @@ struct mc_private { /* To store SDW Pin index for each SoundWire link */ unsigned int sdw_pin_index[SDW_MAX_LINKS]; bool append_dai_type; - bool ignore_pch_dmic; + bool ignore_internal_dmic; }; extern unsigned long sof_sdw_quirk; From patchwork Thu Aug 1 09:14:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816300 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 (unknown [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 D7772C3DA64 for ; Thu, 1 Aug 2024 09:33:34 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A4AD43AA5; Thu, 1 Aug 2024 11:32:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A4AD43AA5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722504751; bh=pGvmqBUW3OmH5h1zfuCPKubfFRHxZaRwEtYaBWodBCY=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bAKwZOMqLMsOGcn4TFT8MkHbVi4yzGNnJVeIg9OaQBeYD+TIZg+agI9TC8Cvdr6xL wejEnfEm0LjanF0U8m3kmby0NYkHagtAmocipIHgdOMTyoLMb41h0nlg6b/qMiRuWV XY7XbpO1EdChN5ixEWeWYl8GgpRPax2quEiD+6f0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id EC245F805BB; Thu, 1 Aug 2024 11:30:53 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 8886FF806A0; Thu, 1 Aug 2024 11:30:52 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 436ACF802DB; Thu, 1 Aug 2024 11:19:06 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on20600.outbound.protection.outlook.com [IPv6:2a01:111:f403:2405::600]) (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 27368F8019B for ; Thu, 1 Aug 2024 11:18:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 27368F8019B Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=xCvY4WMd ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CfMFVUURzxOzMuybR1POsrlSjG3KDCNyGebfg2wRh2G54Hb2jbJUmSV6bKn4FZA7Sjb4nxkUslC8IwJ6enuBl3x5qMPDoqZOb0bXr/pekkaocYthii/jyHETKOo85ep2x62VzGVMoB9Q8saNVzbh08ZJKIE1rWVeuWlFhLY+FuDbyY50hO9Bk24uACskdXRLHQOUFRosMUMGbe4NFDnLIDd5yn7INq+UYjdQGAG0mJahdBJ8Jp0wUAC7LkFXhjHAFM4oypo/f09t4riPr8K0D+KRCTk+6IwU0CoEdclBPbrP4ApJBnNPLSxQk6ouxxYSVsUcoXUeSDQJeEi+XHG5pA== 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=Y/2fLUxBp7tyZAIixcn0vslXHejd8+OfNGTCTx6ZR04=; b=gYL84bDH6JN+hGOG7yCbmJ4Jh0H/dRZsNFJ75JIRfWYgn3LqcdRjpaj1ipYaXFpjMGDippGdJuKseqaVRPhzxe5LQ9fXAzMM0zSOVdFTCznvC51m/eIf7KY0RTobBmMCnHS8ht0UJHQLQbvdOcuMJ32spQCXEKPZ3t5AxGKNlHgafvLmqmR++DNy2PiN9AcrLR0bI29ic6ph+XZgdDPPluWgmgRXZuA8ipu3E//tMP8WmzczCfkLBWRzJ/AVAd5ZdgdibI1Qkr1P8hqHU3xJmKSD1EQ+oeGrBjxXwXPC6+SIEQ1W6kM3HhEHx77uZVqh+b9XzGJpekF6RrGHd/ytmw== 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=Y/2fLUxBp7tyZAIixcn0vslXHejd8+OfNGTCTx6ZR04=; b=xCvY4WMdRaPsVZSy01qLuc8Mym0psaJaAI1Vrf0wY0MxlQsQMhGEpXFEQ43ux2fsDxpMRxe96bb9+SZfTOv00+L3mwBydgoWkeL4ridktSg47x0N6uNV5H/SEStWPb+3woz9tsS5NJbwOFd3pKs4bkQ9YZ32l7as6YEx7Zn3E90= Received: from CH5P221CA0018.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:1f2::13) by SA1PR12MB6948.namprd12.prod.outlook.com (2603:10b6:806:24f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21; Thu, 1 Aug 2024 09:18:37 +0000 Received: from CH2PEPF0000013E.namprd02.prod.outlook.com (2603:10b6:610:1f2:cafe::e9) by CH5P221CA0018.outlook.office365.com (2603:10b6:610:1f2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22 via Frontend Transport; Thu, 1 Aug 2024 09:18:36 +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 CH2PEPF0000013E.mail.protection.outlook.com (10.167.244.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:18:36 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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.2507.39; Thu, 1 Aug 2024 04:18:35 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:18:29 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Brent Lu , Rander Wang , Charles Keepax , Maciej Strozek , Chao Song , open list , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." Subject: [PATCH RESEND 07/31] ASoC: intel/sdw-utils: move soundwire machine driver soc ops Date: Thu, 1 Aug 2024 14:44:22 +0530 Message-ID: <20240801091446.10457-8-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000013E:EE_|SA1PR12MB6948:EE_ X-MS-Office365-Filtering-Correlation-Id: 679743dd-f99f-4e26-4c64-08dcb20aec86 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|7416014|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: ZjAKzBZJAN2r2Ze3NtO/tooYridBLjtVNMTF5GJHvCQ4CzJAUAXy5GkQZrvRY40IgZCkmxnlT1taixi9zNakKDPlxJjMC28GNi/koHVfkbgg/PnyefEMAamHlhMB6bUNCp6aeERYIzbwwQMv6jxnamctFHH6LG64YhdhgxSF357rUFgQIhijseBHt3Jt8wWaf2mX5VkIclQwc15tnYS/yhaaNx2SrvR5esizdDcQDaivZruYDw/6Hn1lW+MoFnzSzTKyLc9eQcnRdCp6fXvkA81TbeH1C1OHfKgqDmBM19c6202b5L2RTtaFxZUfSHDI162y8jBL/VNttzHy/+rnIQwJ8u68zfv47/yhyXO9BgMFaL7cUnj6bnsim0q3Z0xu4K/omNNMsXBYm5G45qgXkL01f9zX5yqFYvP9XF/PF2CNa45iiA8czzxwbF8C6B5c6h9jOHLCspHKpcsgEuTtja1cWDvPJsTCpc10BModhnh7RunGnmoLst3cV0srUYYvReqfYtUldtS7sxDfreLV55atANRR/DOmIy/8FQDLbpuqBD7i7zYOzW+XqMQ2pk3C36nqxnEZwqkZ+drQxrrM6wcbxik/vII0TNF+5zdvGYPmw4y7fRiu7FDPEkV5VQsdnogFhmQ0BnavelgR2SMpj+X1/L2vIN2zh/mhuEKcryBLrQLt/1mI1+ndJXyUY395qnulCFaS1k2s/bpnhSIvOS1tyEa4rdkjirXC43PxDSX19jyL9XsP+OUSC9c0SJyzLsEb+gcPaNd2cH3fvOJcxGTTZONTMh9sEQ6gOOrUGEhZmlysEenzY5ONIrMvrsf9NTPgDDUV9hlwNKu2VEDX3Snbyg2OCN3wjRGNRgQtwli4lAY8iqDS0ex3mMObOwnTGKNZrzQa25E5XdcleRO49+Hom951jlc+nxYDi0TG2AvVLV/NY+HqVtWskMNT51zR7WNszd+FVk1Y3cMFVmcTGApirVBxoZn8YrA37q5zFc0yv0qrZSgCv3Bf/U/UNhSc+ULLKdib0DhX6N8ICxLbdc4xzL+VTAbrkj0emX6HUTN6SF8uM6g82ANGzjwM//WegW75YUt3HTqkeoeklBcTQ2aZRiUFbbHqyyNWbiWvyRtnoAD6bRSh/LXRL4Lq9StOt9ze2nRnbABS1GUvxiJO72vI60fM7yefZFPKRgLktHlyK+JSL/upwzK0jqkjWCngVHdt1kRFqWegD5m+q2QuYd/Zy64gxGv+niLoOJJSi+/wDBDq32rB0xLLYPK4K49IOtusR7hVzVgodw7X0tBFVJ6op8RGrZE1pmh1eLxkocpYY4u4JBC83yeGem8FRSxxhw26bkMmym/3CdHCpF7mqjrpbVHWqMmOfKpVB8/ihXTJJz28AiL06jvq1fioBJ21QQTgGVgWTQTmHzCC60JNig== 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:(13230040)(82310400026)(7416014)(376014)(1800799024)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:18:36.6471 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 679743dd-f99f-4e26-4c64-08dcb20aec86 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: CH2PEPF0000013E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6948 Message-ID-Hash: F3V2BBXSWNLJUHPQ2RO2QZLKSXHH26II X-Message-ID-Hash: F3V2BBXSWNLJUHPQ2RO2QZLKSXHH26II X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Move Intel SoundWire generic machine driver soc ops to common place so that it can be used by other platform machine driver. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 23 ++++ sound/soc/Kconfig | 2 + sound/soc/Makefile | 1 + sound/soc/intel/boards/Kconfig | 1 + sound/soc/intel/boards/sof_sdw.c | 131 +-------------------- sound/soc/intel/boards/sof_sdw_common.h | 9 +- sound/soc/sdw_utils/Kconfig | 6 + sound/soc/sdw_utils/Makefile | 3 + sound/soc/sdw_utils/soc_sdw_utils.c | 150 ++++++++++++++++++++++++ 9 files changed, 188 insertions(+), 138 deletions(-) create mode 100644 include/sound/soc_sdw_utils.h create mode 100644 sound/soc/sdw_utils/Kconfig create mode 100644 sound/soc/sdw_utils/Makefile create mode 100644 sound/soc/sdw_utils/soc_sdw_utils.c diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h new file mode 100644 index 000000000000..cf4cdb66b2de --- /dev/null +++ b/include/sound/soc_sdw_utils.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * This file incorporates work covered by the following copyright notice: + * Copyright (c) 2020 Intel Corporation + * Copyright(c) 2024 Advanced Micro Devices, Inc. + * + */ + +#ifndef SOC_SDW_UTILS_H +#define SOC_SDW_UTILS_H + +#include + +int asoc_sdw_startup(struct snd_pcm_substream *substream); +int asoc_sdw_prepare(struct snd_pcm_substream *substream); +int asoc_sdw_prepare(struct snd_pcm_substream *substream); +int asoc_sdw_trigger(struct snd_pcm_substream *substream, int cmd); +int asoc_sdw_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params); +int asoc_sdw_hw_free(struct snd_pcm_substream *substream); +void asoc_sdw_shutdown(struct snd_pcm_substream *substream); + +#endif diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig index a52afb423b46..e87bd15a8b43 100644 --- a/sound/soc/Kconfig +++ b/sound/soc/Kconfig @@ -126,6 +126,8 @@ source "sound/soc/xtensa/Kconfig" # Supported codecs source "sound/soc/codecs/Kconfig" +source "sound/soc/sdw_utils/Kconfig" + # generic frame-work source "sound/soc/generic/Kconfig" diff --git a/sound/soc/Makefile b/sound/soc/Makefile index fd61847dd1eb..775bb38c2ed4 100644 --- a/sound/soc/Makefile +++ b/sound/soc/Makefile @@ -75,3 +75,4 @@ obj-$(CONFIG_SND_SOC) += uniphier/ obj-$(CONFIG_SND_SOC) += ux500/ obj-$(CONFIG_SND_SOC) += xilinx/ obj-$(CONFIG_SND_SOC) += xtensa/ +obj-$(CONFIG_SND_SOC) += sdw_utils/ diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig index f1faa5dd2a4f..3d59d6982763 100644 --- a/sound/soc/intel/boards/Kconfig +++ b/sound/soc/intel/boards/Kconfig @@ -656,6 +656,7 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH depends on MFD_INTEL_LPSS || COMPILE_TEST depends on SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES || COMPILE_TEST depends on SOUNDWIRE + select SND_SOC_SDW_UTILS select SND_SOC_MAX98363 select SND_SOC_MAX98373_I2C select SND_SOC_MAX98373_SDW diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 28021d33fd2d..fc73db4af186 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include "sof_sdw_common.h" #include "../../codecs/rt711.h" @@ -593,135 +592,6 @@ static const struct snd_kcontrol_new rt700_controls[] = { SOC_DAPM_PIN_SWITCH("Speaker"), }; -/* these wrappers are only needed to avoid typecast compilation errors */ -int asoc_sdw_startup(struct snd_pcm_substream *substream) -{ - return sdw_startup_stream(substream); -} - -int asoc_sdw_prepare(struct snd_pcm_substream *substream) -{ - struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); - struct sdw_stream_runtime *sdw_stream; - struct snd_soc_dai *dai; - - /* Find stream from first CPU DAI */ - dai = snd_soc_rtd_to_cpu(rtd, 0); - - sdw_stream = snd_soc_dai_get_stream(dai, substream->stream); - if (IS_ERR(sdw_stream)) { - dev_err(rtd->dev, "no stream found for DAI %s\n", dai->name); - return PTR_ERR(sdw_stream); - } - - return sdw_prepare_stream(sdw_stream); -} - -int asoc_sdw_trigger(struct snd_pcm_substream *substream, int cmd) -{ - struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); - struct sdw_stream_runtime *sdw_stream; - struct snd_soc_dai *dai; - int ret; - - /* Find stream from first CPU DAI */ - dai = snd_soc_rtd_to_cpu(rtd, 0); - - sdw_stream = snd_soc_dai_get_stream(dai, substream->stream); - if (IS_ERR(sdw_stream)) { - dev_err(rtd->dev, "no stream found for DAI %s\n", dai->name); - return PTR_ERR(sdw_stream); - } - - switch (cmd) { - case SNDRV_PCM_TRIGGER_START: - case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - case SNDRV_PCM_TRIGGER_RESUME: - ret = sdw_enable_stream(sdw_stream); - break; - - case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - case SNDRV_PCM_TRIGGER_SUSPEND: - case SNDRV_PCM_TRIGGER_STOP: - ret = sdw_disable_stream(sdw_stream); - break; - default: - ret = -EINVAL; - break; - } - - if (ret) - dev_err(rtd->dev, "%s trigger %d failed: %d\n", __func__, cmd, ret); - - return ret; -} - -int asoc_sdw_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params) -{ - struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); - struct snd_soc_dai_link_ch_map *ch_maps; - int ch = params_channels(params); - unsigned int ch_mask; - int num_codecs; - int step; - int i; - - if (!rtd->dai_link->ch_maps) - return 0; - - /* Identical data will be sent to all codecs in playback */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { - ch_mask = GENMASK(ch - 1, 0); - step = 0; - } else { - num_codecs = rtd->dai_link->num_codecs; - - if (ch < num_codecs || ch % num_codecs != 0) { - dev_err(rtd->dev, "Channels number %d is invalid when codec number = %d\n", - ch, num_codecs); - return -EINVAL; - } - - ch_mask = GENMASK(ch / num_codecs - 1, 0); - step = hweight_long(ch_mask); - - } - - /* - * The captured data will be combined from each cpu DAI if the dai - * link has more than one codec DAIs. Set codec channel mask and - * ASoC will set the corresponding channel numbers for each cpu dai. - */ - for_each_link_ch_maps(rtd->dai_link, i, ch_maps) - ch_maps->ch_mask = ch_mask << (i * step); - - return 0; -} - -int asoc_sdw_hw_free(struct snd_pcm_substream *substream) -{ - struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); - struct sdw_stream_runtime *sdw_stream; - struct snd_soc_dai *dai; - - /* Find stream from first CPU DAI */ - dai = snd_soc_rtd_to_cpu(rtd, 0); - - sdw_stream = snd_soc_dai_get_stream(dai, substream->stream); - if (IS_ERR(sdw_stream)) { - dev_err(rtd->dev, "no stream found for DAI %s\n", dai->name); - return PTR_ERR(sdw_stream); - } - - return sdw_deprepare_stream(sdw_stream); -} - -void asoc_sdw_shutdown(struct snd_pcm_substream *substream) -{ - sdw_shutdown_stream(substream); -} - static const struct snd_soc_ops sdw_ops = { .startup = asoc_sdw_startup, .prepare = asoc_sdw_prepare, @@ -2232,3 +2102,4 @@ MODULE_AUTHOR("Rander Wang "); MODULE_AUTHOR("Pierre-Louis Bossart "); MODULE_LICENSE("GPL v2"); MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON); +MODULE_IMPORT_NS(SND_SOC_SDW_UTILS); diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index c1b58180efe5..d97aedeef9e8 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -12,6 +12,7 @@ #include #include #include +#include #include "sof_hdmi_common.h" #define SOC_SDW_MAX_NO_PROPS 2 @@ -134,14 +135,6 @@ struct mc_private { extern unsigned long sof_sdw_quirk; -int asoc_sdw_startup(struct snd_pcm_substream *substream); -int asoc_sdw_prepare(struct snd_pcm_substream *substream); -int asoc_sdw_trigger(struct snd_pcm_substream *substream, int cmd); -int asoc_sdw_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params); -int asoc_sdw_hw_free(struct snd_pcm_substream *substream); -void asoc_sdw_shutdown(struct snd_pcm_substream *substream); - /* generic HDMI support */ int sof_sdw_hdmi_init(struct snd_soc_pcm_runtime *rtd); diff --git a/sound/soc/sdw_utils/Kconfig b/sound/soc/sdw_utils/Kconfig new file mode 100644 index 000000000000..d915083c3889 --- /dev/null +++ b/sound/soc/sdw_utils/Kconfig @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0-only +config SND_SOC_SDW_UTILS + tristate + help + This option enables to use SoundWire common helper functions and + SoundWire codec helper functions in machine driver. diff --git a/sound/soc/sdw_utils/Makefile b/sound/soc/sdw_utils/Makefile new file mode 100644 index 000000000000..29b2852be287 --- /dev/null +++ b/sound/soc/sdw_utils/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0-only +snd-soc-sdw-utils-y := soc_sdw_utils.o +obj-$(CONFIG_SND_SOC_SDW_UTILS) += snd-soc-sdw-utils.o diff --git a/sound/soc/sdw_utils/soc_sdw_utils.c b/sound/soc/sdw_utils/soc_sdw_utils.c new file mode 100644 index 000000000000..cccab173fd17 --- /dev/null +++ b/sound/soc/sdw_utils/soc_sdw_utils.c @@ -0,0 +1,150 @@ +// SPDX-License-Identifier: GPL-2.0-only +// This file incorporates work covered by the following copyright notice: +// Copyright (c) 2020 Intel Corporation +// Copyright(c) 2024 Advanced Micro Devices, Inc. +/* + * soc-sdw-utils.c - common SoundWire machine driver helper functions + */ + +#include +#include +#include +#include +#include + +/* these wrappers are only needed to avoid typecast compilation errors */ +int asoc_sdw_startup(struct snd_pcm_substream *substream) +{ + return sdw_startup_stream(substream); +} +EXPORT_SYMBOL_NS(asoc_sdw_startup, SND_SOC_SDW_UTILS); + +int asoc_sdw_prepare(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); + struct sdw_stream_runtime *sdw_stream; + struct snd_soc_dai *dai; + + /* Find stream from first CPU DAI */ + dai = snd_soc_rtd_to_cpu(rtd, 0); + + sdw_stream = snd_soc_dai_get_stream(dai, substream->stream); + if (IS_ERR(sdw_stream)) { + dev_err(rtd->dev, "no stream found for DAI %s\n", dai->name); + return PTR_ERR(sdw_stream); + } + + return sdw_prepare_stream(sdw_stream); +} +EXPORT_SYMBOL_NS(asoc_sdw_prepare, SND_SOC_SDW_UTILS); + +int asoc_sdw_trigger(struct snd_pcm_substream *substream, int cmd) +{ + struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); + struct sdw_stream_runtime *sdw_stream; + struct snd_soc_dai *dai; + int ret; + + /* Find stream from first CPU DAI */ + dai = snd_soc_rtd_to_cpu(rtd, 0); + + sdw_stream = snd_soc_dai_get_stream(dai, substream->stream); + if (IS_ERR(sdw_stream)) { + dev_err(rtd->dev, "no stream found for DAI %s\n", dai->name); + return PTR_ERR(sdw_stream); + } + + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + case SNDRV_PCM_TRIGGER_RESUME: + ret = sdw_enable_stream(sdw_stream); + break; + + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + case SNDRV_PCM_TRIGGER_SUSPEND: + case SNDRV_PCM_TRIGGER_STOP: + ret = sdw_disable_stream(sdw_stream); + break; + default: + ret = -EINVAL; + break; + } + + if (ret) + dev_err(rtd->dev, "%s trigger %d failed: %d\n", __func__, cmd, ret); + + return ret; +} +EXPORT_SYMBOL_NS(asoc_sdw_trigger, SND_SOC_SDW_UTILS); + +int asoc_sdw_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); + struct snd_soc_dai_link_ch_map *ch_maps; + int ch = params_channels(params); + unsigned int ch_mask; + int num_codecs; + int step; + int i; + + if (!rtd->dai_link->ch_maps) + return 0; + + /* Identical data will be sent to all codecs in playback */ + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + ch_mask = GENMASK(ch - 1, 0); + step = 0; + } else { + num_codecs = rtd->dai_link->num_codecs; + + if (ch < num_codecs || ch % num_codecs != 0) { + dev_err(rtd->dev, "Channels number %d is invalid when codec number = %d\n", + ch, num_codecs); + return -EINVAL; + } + + ch_mask = GENMASK(ch / num_codecs - 1, 0); + step = hweight_long(ch_mask); + } + + /* + * The captured data will be combined from each cpu DAI if the dai + * link has more than one codec DAIs. Set codec channel mask and + * ASoC will set the corresponding channel numbers for each cpu dai. + */ + for_each_link_ch_maps(rtd->dai_link, i, ch_maps) + ch_maps->ch_mask = ch_mask << (i * step); + + return 0; +} +EXPORT_SYMBOL_NS(asoc_sdw_hw_params, SND_SOC_SDW_UTILS); + +int asoc_sdw_hw_free(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); + struct sdw_stream_runtime *sdw_stream; + struct snd_soc_dai *dai; + + /* Find stream from first CPU DAI */ + dai = snd_soc_rtd_to_cpu(rtd, 0); + + sdw_stream = snd_soc_dai_get_stream(dai, substream->stream); + if (IS_ERR(sdw_stream)) { + dev_err(rtd->dev, "no stream found for DAI %s\n", dai->name); + return PTR_ERR(sdw_stream); + } + + return sdw_deprepare_stream(sdw_stream); +} +EXPORT_SYMBOL_NS(asoc_sdw_hw_free, SND_SOC_SDW_UTILS); + +void asoc_sdw_shutdown(struct snd_pcm_substream *substream) +{ + sdw_shutdown_stream(substream); +} +EXPORT_SYMBOL_NS(asoc_sdw_shutdown, SND_SOC_SDW_UTILS); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("SoundWire ASoC helpers"); From patchwork Thu Aug 1 09:14: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: 816074 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 (unknown [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 426ABC3DA64 for ; Thu, 1 Aug 2024 09:33:49 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 100ED3ADB; Thu, 1 Aug 2024 11:32:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 100ED3ADB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722504765; bh=KSTYiI0dytWJe6hGgmOuCegbFF0+e1QlYZSeZPMFj+g=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=PzEW0nnWuZQB0Ufgw9bHwpclquuqmaCGjZ9cMcp4nRv2sA1SrM583BpN85X4LhpUD ipnScxHloBfDE+TSJLyRN9ER8cdeZ3q8YxomjWspNdxnIIBzYKhhV8iNQxodE9NedA 6AmHyfE72Fpuxv42IiqU8nSprNKAwOTr3CVWk4cY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9BE35F805E9; Thu, 1 Aug 2024 11:32:03 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id DA365F805E9; Thu, 1 Aug 2024 11:32:02 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 94F69F8026A; Thu, 1 Aug 2024 11:19:07 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20620.outbound.protection.outlook.com [IPv6:2a01:111:f403:2418::620]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0A93CF8007E for ; Thu, 1 Aug 2024 11:18:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0A93CF8007E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=zKUKTsTE ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tXPEVQxrWtK+63qSi58cqvB/hAgRaQ6B51Kvx9iV4eThmRRLfTnSxIXvCD7hzuWPYmhu9SLtpVl3C/kw/tMfsvAtEoLyTvFgXtF4hzEgTYhPwmhfrvAdoPiW6SenXnVAUW0tYxUJ+YIusrW759zeL+jXHM7Banux+p8Z+K8mTQmxgXMkJjQHKllQ5yIqoUPTwmJbJw50RHfTNj+uv0sSxyCTs3QNaY7uZRemlwnEsGU82aEp6UQtCXjuKYLM2+hXFp6QhaQYlvsUBAGXkspZddMYUPtz3QKvGJh/r14zLzJV/0yh3uKV/rPUiGNuAVWffwOwpM9l+GqDvspxKkBT/g== 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=cK5UcSHp7ey5i2K2Zi6QMQt6zdza61rvrmkQU0evU54=; b=SVyW8UqlFjHN3q78I07sG3YkfRi8PrBESTz9Brjgcv/Tb8/l8RHawgOK7g7MsNuzPy7voPKm2PWHp3LmjRr74x4oJ6AVbvzm1Wagk9OAlB67OG7eHDwXmOPH4xT59Kv0vNRP4xyWWtVlQcpjw8hrUIeMSC8mr2DzwSHv0UJqJGiO8Wu1w9AZuTmWCyboG7QvUq8B0WVBbhN3LQTISawTFH6lhtuRuYmk+NmP2R/lPmfOtlYNP9PrF39Hbpp3jy9EcXbSG9B8KhiqexT8tR5ScpIbmlFdbAiVNyZwk9GLamhsUeiFz43sHx7tm+xSLpjGXza8VWWKtdOQqYCDxwjLrA== 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=cK5UcSHp7ey5i2K2Zi6QMQt6zdza61rvrmkQU0evU54=; b=zKUKTsTE8DJcW14qRSR2zGZ4MTVC0O1PDj6QE/WKcDSICO6SlSXF0q72GsnTOXhdtejwNrfEp8G/pe2Mqa5vWPSgdsWy/vHMR+XnoiEP+FfOolSHMV5i95tQ9b0GNLIfr0hvTUPQ+bElOpvb1SGLLNHM7PK/YELVyy8Riu9XfaQ= Received: from DS7PR03CA0243.namprd03.prod.outlook.com (2603:10b6:5:3b3::8) by DM6PR12MB4436.namprd12.prod.outlook.com (2603:10b6:5:2a3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Thu, 1 Aug 2024 09:18:46 +0000 Received: from DS2PEPF00003441.namprd04.prod.outlook.com (2603:10b6:5:3b3:cafe::f) by DS7PR03CA0243.outlook.office365.com (2603:10b6:5:3b3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.34 via Frontend Transport; Thu, 1 Aug 2024 09:18:46 +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 DS2PEPF00003441.mail.protection.outlook.com (10.167.17.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:18:46 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Thu, 1 Aug 2024 04:18:45 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:18:39 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Charles Keepax , Maciej Strozek , Chao Song , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH RESEND 08/31] ASoC: intel: move soundwire machine driver common structures Date: Thu, 1 Aug 2024 14:44:23 +0530 Message-ID: <20240801091446.10457-9-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003441:EE_|DM6PR12MB4436:EE_ X-MS-Office365-Filtering-Correlation-Id: 0601411a-4c1f-45d5-54a4-08dcb20af278 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: dLBXfkNs40cZVwq17o17XXHyi2tt0vXAYQWkJxnJv8+W2JrmRSIso6K4LXter0mYdgFoL7mU5yrzogE1XuI+jjiRAG1vbfDquOzw8a9bDVbIkHdPNdr08I5Yd29K8Fj9HJ6ndQadpwbtn8v+dxisXhHhNHv/Vtw0ir2zaXW45uedxusyFRRxLEiykzOXu6eAUnwHqQtVl1hQWhKC5TUsWhvABHdV8qMPADzC/GGa6CqXZYyyecloWrp9G6fVTP/06ek7j6m9rxYu4o2KiqKEQenMACDKyrTdsRb4iccWCpaSFoTLwxkEvm4s6cffsAzvxUTCw8UNINsOQ/Eyvkz5zpkDmlnxhm394nbQg/IcAV7epj71+2Vff12E49W7znOSSMWDth4bXPnefrAtoYIcdzZi6HausObg9kuGzwLC2pWQthjzhzOYGpJimtDH8ykholtSdoISx9W7Oh23PusYv4wp9CdFU4shs+81yoqFYyYR1RV0P1iAi5d6F/aB035rxVJla8Slg0APoGGiNV+ySyhgLWtNT8NTXcpYMjW45oHhl1GgggkXCf66vrM268QxGaM+gVB30z5Dw2j98SjSLZWLw9kqefq1EiwB2d8dT36OSjHFAnCwbJggsISzwEaDSJD1AYlNfvOBscGJuZT55wcCNyS/UjBU8ZduFw7TVdLSkrgPPxumNEESfgkie2YF5lCBrv2dvx5l1YnQzmulr1iaxaodXBP2BcRC2Ct/pqksgxbjCh0qtdVGMKp0etQMwOfOSsAe0Crx5E1EoX/FpgLZ1g+CFkl46TNZCLaV4/NlI6TZomWwX7fZtgK4soZ/ddav/cdXdKrSb+lyr3cBDlwwvbWBvehWWvrgOOrgxzJiiLiIqiIwDi5TpUxt7PeccT5AZ3S0xTBemaOOLiHmCfrLo6bCpHwSmbevY9h4gRzxJbJrLMm6pDPi6NnVdPKXdTb4xyrPs67AfxUrp8vV4Tb7mjiMn09Mby1/YP/O68B6v8vy74tQ3QoLM2JrWAC15oxqURLpOqJBx3u/Hvh/IDov/3/pgGthS0i46IGxI7HpB+5ePKy8GnF3i0zfHYHLLRUFHlYxzcIJhKJMRxHPViTdWWAVvyP4MKv5QATDIPHxUPxtH+rkLMoHNq1A4KDnVb8/9UsTQIR9z4AxQwqVDAsApOxdYpsD4LzF5YKkuEzPbGmhmC0P5b/i6Z7DDM6LCkvvT5sZB0KQh+XJLQS7A/M8nJfOXAJthPsVLpmHDvWh5C9rcSwuDhGdosGsfn4CyGFuN/nj4JMSIDGfDDsanZezWdSshf12CseyBsqtq3PRODfjo56NCelabRuEP4zrP9jrrDOpHWjLj2aJUlzZVAFqpchQdVjrMPuQNMrv+8BME5qU8xa0lNaxnjVD/mtN 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)(7416014)(1800799024)(376014)(82310400026)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:18:46.6063 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0601411a-4c1f-45d5-54a4-08dcb20af278 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: DS2PEPF00003441.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4436 Message-ID-Hash: OXASWGFIV5TODC4UFSI7Q3EHHGENF55M X-Message-ID-Hash: OXASWGFIV5TODC4UFSI7Q3EHHGENF55M X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Move intel generic SoundWire machine driver common structures to soc_sdw_utils.h file. These structures will be used in other platform SoundWire machine driver code. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 43 +++++++++++++++++++++++++ sound/soc/intel/boards/sof_sdw_common.h | 43 ------------------------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index cf4cdb66b2de..1ae5523bbcf8 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -11,6 +11,49 @@ #include +#define SOC_SDW_MAX_DAI_NUM 8 + +struct asoc_sdw_codec_info; + +struct asoc_sdw_dai_info { + const bool direction[2]; /* playback & capture support */ + const char *dai_name; + const int dai_type; + const int dailink[2]; /* dailink id for each direction */ + const struct snd_kcontrol_new *controls; + const int num_controls; + const struct snd_soc_dapm_widget *widgets; + const int num_widgets; + int (*init)(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback); + int (*exit)(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); + int (*rtd_init)(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); + bool rtd_init_done; /* Indicate that the rtd_init callback is done */ + unsigned long quirk; +}; + +struct asoc_sdw_codec_info { + const int part_id; + const int version_id; + const char *codec_name; + int amp_num; + const u8 acpi_id[ACPI_ID_LEN]; + const bool ignore_internal_dmic; + const struct snd_soc_ops *ops; + struct asoc_sdw_dai_info dais[SOC_SDW_MAX_DAI_NUM]; + const int dai_num; + + int (*codec_card_late_probe)(struct snd_soc_card *card); + + int (*count_sidecar)(struct snd_soc_card *card, + int *num_dais, int *num_devs); + int (*add_sidecar)(struct snd_soc_card *card, + struct snd_soc_dai_link **dai_links, + struct snd_soc_codec_conf **codec_conf); +}; + int asoc_sdw_startup(struct snd_pcm_substream *substream); int asoc_sdw_prepare(struct snd_pcm_substream *substream); int asoc_sdw_prepare(struct snd_pcm_substream *substream); diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index d97aedeef9e8..688cbc3afb29 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -78,49 +78,6 @@ enum { #define SOC_SDW_DAI_TYPE_AMP 1 #define SOC_SDW_DAI_TYPE_MIC 2 -#define SOC_SDW_MAX_DAI_NUM 8 - -struct asoc_sdw_codec_info; - -struct asoc_sdw_dai_info { - const bool direction[2]; /* playback & capture support */ - const char *dai_name; - const int dai_type; - const int dailink[2]; /* dailink id for each direction */ - const struct snd_kcontrol_new *controls; - const int num_controls; - const struct snd_soc_dapm_widget *widgets; - const int num_widgets; - int (*init)(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback); - int (*exit)(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); - int (*rtd_init)(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); - bool rtd_init_done; /* Indicate that the rtd_init callback is done */ - unsigned long quirk; -}; - -struct asoc_sdw_codec_info { - const int part_id; - const int version_id; - const char *codec_name; - int amp_num; - const u8 acpi_id[ACPI_ID_LEN]; - const bool ignore_internal_dmic; - const struct snd_soc_ops *ops; - struct asoc_sdw_dai_info dais[SOC_SDW_MAX_DAI_NUM]; - const int dai_num; - - int (*codec_card_late_probe)(struct snd_soc_card *card); - - int (*count_sidecar)(struct snd_soc_card *card, - int *num_dais, int *num_devs); - int (*add_sidecar)(struct snd_soc_card *card, - struct snd_soc_dai_link **dai_links, - struct snd_soc_codec_conf **codec_conf); -}; - struct mc_private { struct snd_soc_card card; struct snd_soc_jack sdw_headset; From patchwork Thu Aug 1 09:14:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816299 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 (unknown [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 8E6C0C3DA4A for ; Thu, 1 Aug 2024 09:34:13 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1A53E3B23; Thu, 1 Aug 2024 11:33:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1A53E3B23 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722504790; bh=eGgwrcdu1pwB6BfUTjhL8YT/g4FVNfycDOP8imUnFzg=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=i1UVhszaumYhlvxhhuOn7+qwy3+NUV0/vbiVRE74KQKTxt5JlYos7v4ArmAJkLOJd AjOxfX7ibOSWgSr0qOHqbhKyjfJ+bUHuX+7r9kUULn1esguX/5pe1UCZPuAKIHnpTz n5tvI8C+MPphadut3K0+Qsl1ettbnG+OZSt4hxms= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 80396F805C2; Thu, 1 Aug 2024 11:32:10 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id B114FF805D4; Thu, 1 Aug 2024 11:32:09 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9A397F8026A; Thu, 1 Aug 2024 11:19:14 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2416::601]) (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 18B7CF8019B for ; Thu, 1 Aug 2024 11:19:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 18B7CF8019B Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=etFGNNNx ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ng2nRqvysMWk6lcW2wT8LhamJLfV9H2/Gj5TRPvNn+9Ia2WolH6p2hkX8wrYrsHF46D2HHC2VmehMSNynDvte9Jj/xEhPxLAWo+aUYg9ho8c1p/crG+tOvoX4LUtyqbIw9EYAHRgsgcz9raMO0XPVZBU6wxA/St303mTAiT3wfFH51GAcsDKe/cTgqpCBEWTlP5Ia3brPIAfSW5I/loxOQZbYVGABj1xhqjOqutF9JiPakua/vyXOrJkFx4PSwff2O4mxtkQ2osLqapdzCyHZ8zqhqM+2PdW99smklCv/LMO/MIFB5eVesEHJ/ZSIJ+UHMEIur5/Z4RpYa5HSTPVcw== 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=n5PhBdhWSJKgEbj7Xmz6uau3/rcfvUoIsh4OCENhd4E=; b=vmKFeumua+MjyIqiF1NPVM9YV+u8aUH5Ket9HUiNE4X2gp9+TBBWc4+Gjv3WXDq18oUuAFdwWPEPbbSvX1ZF6rJDpYMYXbA0W8NfZrvgwQjVw57l0+0PJTXLTGF04ZFZPcqS5fkNjRV1wQGcQxtKC3LDOontROBwyZ5i2tibQ7J9tiQfWSf2PjbukN4uD1bImPW3BNzZwCRSQgdvuEl3JMLyKlANefMjbIJ2JJw+g2spuuWciN3SaGc/lb/rzUK1lpYkb84jLMlBpiZLkVZ5G7Y16SP7ywSsCKQo5oAEMXTajJh9Sa3MFV87l3XJY1TrWihe1lNOLDDs6IGicGOEmw== 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=n5PhBdhWSJKgEbj7Xmz6uau3/rcfvUoIsh4OCENhd4E=; b=etFGNNNxse8Swc/dyttkilA2d2IUPNXnyu600wz1OepYVUVoka6EPFFG15OX41fprSTJKnoxGZmK/fA1Ep6RROqVkO/MmIJJ03PT7b6W7a/Q/ja+HI0tG8quWI9h8aoqt4fmL0r+6+7nHixGp/KCxlTaVc31kBv31M4EPNigRww= Received: from DM6PR05CA0037.namprd05.prod.outlook.com (2603:10b6:5:335::6) by DM6PR12MB4388.namprd12.prod.outlook.com (2603:10b6:5:2a9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Thu, 1 Aug 2024 09:19:04 +0000 Received: from DS2PEPF00003443.namprd04.prod.outlook.com (2603:10b6:5:335:cafe::7f) by DM6PR05CA0037.outlook.office365.com (2603:10b6:5:335::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.6 via Frontend Transport; Thu, 1 Aug 2024 09:19:04 +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 DS2PEPF00003443.mail.protection.outlook.com (10.167.17.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:19:04 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Thu, 1 Aug 2024 04:18:59 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:18:54 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Charles Keepax , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH RESEND 09/31] ASoC: intel/sdw_utils: move soundwire machine driver helper functions Date: Thu, 1 Aug 2024 14:44:24 +0530 Message-ID: <20240801091446.10457-10-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003443:EE_|DM6PR12MB4388:EE_ X-MS-Office365-Filtering-Correlation-Id: 1ce44733-98fe-43b1-9718-08dcb20afd1d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: sTKCRLNw/j1MSDAyDuGtqqUmVUje2+E6wk8GoyJn73hqyk0Z1AiCiV+jM/G4i9PiyJlQiJytJ6qocmmnTFE5yDTIauSU1ebQHgR94gPGqH8Sgfsn79z6rrmKnSGRrR0G4nzOWlB58YzpWbjYmDwEcsvA7vuvS26XZ0tr25lTWI/xG3S3tJTv/UATMiYd5cVycm3Y5KzOdnYXV3iQ2LQjFkgmDVgv9jwOTS8bIMwUb4MEzanyvGp5sSSYZ121c1t/BY+sgcrrCK+8yBzBjv92HWieU7+AjmPh+nFpBVX4EE/MqzgGWb45eR1C/6Icm5LPnGbGO+YMR5nQ6tg/zwriKq9jodYik/2Yu+UtmQN+Yz2zLl/wDQ64bJqTJ2UGZyQpW5FC1vJKYOhhfWdJcR6btKjr6InDF7rEnxEQRlA56He/xrMTVfn/vjLDUYiZ37CfbbRrHWcdxo9dS2F6Js3KQaGw0PUcdMV3LAwkNBpTy4uZO3DOWRvu3+HkPfPs2TnNXJtt0pwHBnW0oMlfPir5yvzzyjizUkw+FUI8P03tcDB5IEFN2r6oum7FDSLQiqT1794ql2vZ8MSevbjUHtyw/aULUQyACnzGUQHi6J4MCrG+CesKshEoGly2a50z2kb66UqXprJ54pSgnW+QRnr+mK6ir0NIU7crJZNu12hmcxGNuhJfxPRe9yjUvcZdGpjsMGyqPnOZz3ENhOSI/M0KRAuO0jyaGS0KltO4anF2fOPbCWZZPROvhh5z5f9YHMDHrs0jqyyhtv+PgYzvpxeQwb0/gJQ9k37aBPfOZYBSWHuhlnM4Yc7Pfuit5OE90wQRENKRu3KiLwFN41gdWsXg4GNKv1qzGBgUuXKvsRtc5UQrzSKuihEn2nMYLX9HG6BYT7rVIlQ1z7ZiuoxE9hVU6lnmuzDLP4mNjKOlAaADsM+iAkslh62j19X4GfBhQaDMvwnRVajJzKS+b/33131qISNOTN8vYvMPeSRMkYL45SGo360UUc0stjaMDNeN4r/MoVN9Fi39ArDeN+6KLO4wWzBKXJxy937dnrdwUHfyJT1Kgyhr9zwccqaBCrk+b81tEPAZlij6F9o+Un4AcqCiGEI59BHfp+B1eBBZneE01i/ieaVilwPUKfRQTsMEAuyEhuYOm6wSWgTrypPmTRBKQQozleqV8Yq/Vy4AveviM/zjL/QiVnYhNZG7UxHPhvQv2U47GaLyQfcrmh5ae4421hoH6yu6Ph9VzRXpN09ie/9IDRwIvHP25gPVZvdtViDWuOhjv6NoJnHBtYmMiBWByZoCPWAziDBTlVTKTnTpJDOsntqBsROo4MiDPmbk1/1Uwd1/0MMx3nYzDkHvw31CdwpF3P45nU3IK3Yi1YlzhsblReUsPu7s7esbTxKbaCfR0dscTYUT5XMjDF9xcwPArw== 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)(7416014)(1800799024)(376014)(82310400026)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:19:04.4666 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1ce44733-98fe-43b1-9718-08dcb20afd1d 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: DS2PEPF00003443.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4388 Message-ID-Hash: PBKBH5OMVLAO7QWIEDLEWZFXJZKKTITW X-Message-ID-Hash: PBKBH5OMVLAO7QWIEDLEWZFXJZKKTITW X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Move below Intel SoundWire machine driver helper functions to soc_sdw_utils.c file so that it can be used by other platform machine driver. - asoc_sdw_is_unique_device() - asoc_sdw_get_codec_name() Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 5 +++ sound/soc/intel/boards/sof_sdw.c | 60 ---------------------------- sound/soc/sdw_utils/soc_sdw_utils.c | 61 +++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 60 deletions(-) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index 1ae5523bbcf8..7ca3a6afdfb1 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -10,6 +10,7 @@ #define SOC_SDW_UTILS_H #include +#include #define SOC_SDW_MAX_DAI_NUM 8 @@ -63,4 +64,8 @@ int asoc_sdw_hw_params(struct snd_pcm_substream *substream, int asoc_sdw_hw_free(struct snd_pcm_substream *substream); void asoc_sdw_shutdown(struct snd_pcm_substream *substream); +const char *asoc_sdw_get_codec_name(struct device *dev, + const struct asoc_sdw_codec_info *codec_info, + const struct snd_soc_acpi_link_adr *adr_link, + int adr_index); #endif diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index fc73db4af186..e1d2b744987f 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1190,66 +1190,6 @@ static int init_simple_dai_link(struct device *dev, struct snd_soc_dai_link *dai return 0; } -static bool asoc_sdw_is_unique_device(const struct snd_soc_acpi_link_adr *adr_link, - unsigned int sdw_version, - unsigned int mfg_id, - unsigned int part_id, - unsigned int class_id, - int index_in_link) -{ - int i; - - for (i = 0; i < adr_link->num_adr; i++) { - unsigned int sdw1_version, mfg1_id, part1_id, class1_id; - u64 adr; - - /* skip itself */ - if (i == index_in_link) - continue; - - adr = adr_link->adr_d[i].adr; - - sdw1_version = SDW_VERSION(adr); - mfg1_id = SDW_MFG_ID(adr); - part1_id = SDW_PART_ID(adr); - class1_id = SDW_CLASS_ID(adr); - - if (sdw_version == sdw1_version && - mfg_id == mfg1_id && - part_id == part1_id && - class_id == class1_id) - return false; - } - - return true; -} - -static const char *asoc_sdw_get_codec_name(struct device *dev, - const struct asoc_sdw_codec_info *codec_info, - const struct snd_soc_acpi_link_adr *adr_link, - int adr_index) -{ - u64 adr = adr_link->adr_d[adr_index].adr; - unsigned int sdw_version = SDW_VERSION(adr); - unsigned int link_id = SDW_DISCO_LINK_ID(adr); - unsigned int unique_id = SDW_UNIQUE_ID(adr); - unsigned int mfg_id = SDW_MFG_ID(adr); - unsigned int part_id = SDW_PART_ID(adr); - unsigned int class_id = SDW_CLASS_ID(adr); - - if (codec_info->codec_name) - return devm_kstrdup(dev, codec_info->codec_name, GFP_KERNEL); - else if (asoc_sdw_is_unique_device(adr_link, sdw_version, mfg_id, part_id, - class_id, adr_index)) - return devm_kasprintf(dev, GFP_KERNEL, "sdw:0:%01x:%04x:%04x:%02x", - link_id, mfg_id, part_id, class_id); - else - return devm_kasprintf(dev, GFP_KERNEL, "sdw:0:%01x:%04x:%04x:%02x:%01x", - link_id, mfg_id, part_id, class_id, unique_id); - - return NULL; -} - static int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; diff --git a/sound/soc/sdw_utils/soc_sdw_utils.c b/sound/soc/sdw_utils/soc_sdw_utils.c index cccab173fd17..2b59ddc61078 100644 --- a/sound/soc/sdw_utils/soc_sdw_utils.c +++ b/sound/soc/sdw_utils/soc_sdw_utils.c @@ -146,5 +146,66 @@ void asoc_sdw_shutdown(struct snd_pcm_substream *substream) } EXPORT_SYMBOL_NS(asoc_sdw_shutdown, SND_SOC_SDW_UTILS); +static bool asoc_sdw_is_unique_device(const struct snd_soc_acpi_link_adr *adr_link, + unsigned int sdw_version, + unsigned int mfg_id, + unsigned int part_id, + unsigned int class_id, + int index_in_link) +{ + int i; + + for (i = 0; i < adr_link->num_adr; i++) { + unsigned int sdw1_version, mfg1_id, part1_id, class1_id; + u64 adr; + + /* skip itself */ + if (i == index_in_link) + continue; + + adr = adr_link->adr_d[i].adr; + + sdw1_version = SDW_VERSION(adr); + mfg1_id = SDW_MFG_ID(adr); + part1_id = SDW_PART_ID(adr); + class1_id = SDW_CLASS_ID(adr); + + if (sdw_version == sdw1_version && + mfg_id == mfg1_id && + part_id == part1_id && + class_id == class1_id) + return false; + } + + return true; +} + +const char *asoc_sdw_get_codec_name(struct device *dev, + const struct asoc_sdw_codec_info *codec_info, + const struct snd_soc_acpi_link_adr *adr_link, + int adr_index) +{ + u64 adr = adr_link->adr_d[adr_index].adr; + unsigned int sdw_version = SDW_VERSION(adr); + unsigned int link_id = SDW_DISCO_LINK_ID(adr); + unsigned int unique_id = SDW_UNIQUE_ID(adr); + unsigned int mfg_id = SDW_MFG_ID(adr); + unsigned int part_id = SDW_PART_ID(adr); + unsigned int class_id = SDW_CLASS_ID(adr); + + if (codec_info->codec_name) + return devm_kstrdup(dev, codec_info->codec_name, GFP_KERNEL); + else if (asoc_sdw_is_unique_device(adr_link, sdw_version, mfg_id, part_id, + class_id, adr_index)) + return devm_kasprintf(dev, GFP_KERNEL, "sdw:0:%01x:%04x:%04x:%02x", + link_id, mfg_id, part_id, class_id); + else + return devm_kasprintf(dev, GFP_KERNEL, "sdw:0:%01x:%04x:%04x:%02x:%01x", + link_id, mfg_id, part_id, class_id, unique_id); + + return NULL; +} +EXPORT_SYMBOL_NS(asoc_sdw_get_codec_name, SND_SOC_SDW_UTILS); + MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("SoundWire ASoC helpers"); From patchwork Thu Aug 1 09:14:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816073 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 (unknown [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 6D1B8C3DA4A for ; Thu, 1 Aug 2024 09:34:21 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BF7783B74; Thu, 1 Aug 2024 11:33:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BF7783B74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722504828; bh=wn3Jq4xtXK/6EdLFmKyHGMbG0b6DR9OJpXRhch1t0b8=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=FIsGNw8KDKh7msKss0v7pUl2+0p88cwXG8yMZg97qnqOUvUUgW/g3fN6l3+Z4qtwm L0hB/WeHfYn97KIvVRoXtGHdPIcGTrHl4EswRT3pvsCglt2DTjxaiNnJdSVqwm7QGx qTNW4cuS5EqxIGuSa/Aa9HyIi0EkaQ3MBOnS5FCE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 86BDFF805AC; Thu, 1 Aug 2024 11:33:18 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 32589F805AA; Thu, 1 Aug 2024 11:33:18 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9304CF8026A; Thu, 1 Aug 2024 11:19:55 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on20624.outbound.protection.outlook.com [IPv6:2a01:111:f403:240a::624]) (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 81A49F8019B for ; Thu, 1 Aug 2024 11:19:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 81A49F8019B Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=SfEBiPyP ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CrToDbGfLpXEnd5ggDpzcXQkjdXCV5EQ1haffADpZ9zgi4ZJ8HJhihtplVfWV1i+TAPf2M08ROZ7lZ98efWfTQ2u32u3Et580BpMsFPfXPJot0wJe6BoXUK0G8fPmgwmgSIhSoYXQDj1DyYAA6/YNxh7Lz5MMpfF+tERMR4aaCHYV+6xWpbLMHcPAn2G27GGi5QdQkJZfgYxXvdyLRQX16w4zgfmfzBYmq2YnefxpmpTVcUwhrASaOMy80UABEO89LIiAk+K8/SrHbAej83H4IzuxhwjFozpei31TQCQ4ooOCfjdMZtpcHwnpi4ClmhGCtubT8Fq+92YQbYt6XYS0A== 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=n32lpJGaVISCUycsy6PmNSawqp2e9DMRtw/J5CxqmaM=; b=ZA5q0jningCRVGmgOFfpIYR+gYSRbx1eiwx11nW1aYTXKbUA8iurUOxOioaXnNeRIYZ1EBUBjiqWaVzYnlbUlbUiV+e3Hm3NephmmmTn5DDWYFCzV2cNiTPClLY3oV9biJZbqb4THQF0FtPduKmqfb7bSOHerhE0gwfp56qbe4bzc03tAf+9RGxWcnmXngpIcbke6Ble7NnTzWVRLYnqNa6lunlOBuN0NiOlSMj4qektcKiV3NxtNzW2shTBYcJdi2Wpob06JlcUr2o/j1kSP29LdPm30DhTGYPK91b+m44BXk516eJYzMAivEZnxPdNT1Vd3BzuCo7SOUzSiKxmSQ== 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=n32lpJGaVISCUycsy6PmNSawqp2e9DMRtw/J5CxqmaM=; b=SfEBiPyPsYoARrvuKG7E78Fa7lZswa7++hu9mO5bfjiW/r9kdr7pvAXC/KsEXmUFIH5Q9zj2FkYtSntDK8+JP45+dpHn8FrG8N0P5UyAotDazuyc4ZnZcjODlVev1JlsgpDBvB7OmNdPb5PlQsWEKyOxhEE7TI9nd7kyrElrohQ= Received: from MN0PR02CA0004.namprd02.prod.outlook.com (2603:10b6:208:530::11) by MN2PR12MB4143.namprd12.prod.outlook.com (2603:10b6:208:1d0::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23; Thu, 1 Aug 2024 09:19:26 +0000 Received: from BL02EPF0001A0FE.namprd03.prod.outlook.com (2603:10b6:208:530:cafe::59) by MN0PR02CA0004.outlook.office365.com (2603:10b6:208:530::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend Transport; Thu, 1 Aug 2024 09:19:26 +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 BL02EPF0001A0FE.mail.protection.outlook.com (10.167.242.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:19:26 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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.2507.39; Thu, 1 Aug 2024 04:19:25 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 1 Aug 2024 04:19:25 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:19:18 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Brent Lu , Charles Keepax , Maciej Strozek , Chao Song , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH RESEND 10/31] ASoC: intel/sdw_utils: move dmic codec helper function Date: Thu, 1 Aug 2024 14:44:25 +0530 Message-ID: <20240801091446.10457-11-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A0FE:EE_|MN2PR12MB4143:EE_ X-MS-Office365-Filtering-Correlation-Id: 0fa7d8ae-a113-441e-0ff1-08dcb20b09f2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|376014|36860700013|7416014|1800799024; X-Microsoft-Antispam-Message-Info: pKwr6Ja+EY3SIOUSS4r4f6iRNKQolIRG1+M/XXPP411e1KPsmwugxi0/GNlMQa8TZkM6bQmHshA6JywewB/kM7AsrMBWSeYv4XvoOIg+TzD1u4WDv6ivyg2MhgZmCFh5Ni0TdjzWA6KajH35dv9ssGS4qrPq2UC3cZJtEV/0nte8ohlkEUclLWt/hFjZtqIEkaDFbNeZFetXjVPBu9DZvw8lY7zU7DZMWi7m0tucDrpmm1hMB1o0Idb22h37I6lT45w/RZTdEjXhefFZuOeov6QvJynBgyi45YaSuvMUocZ9FEdbwaeWmMTmBI7KIbpFgAR1Laufe6DJ/VONvVh1JXUU1CM0rYyxfu9J2J4694ArTUO+s9Ztx9CmKLQBuUxjqtzwzTRbdHQK3CmAt1H9SMbamgtS06G5E37KWBqW+xkyaJTULwewfeVrNGYr/0m/LAZFkjZAkdnFYP6Zfq6M5qGRubdbaf8MRpVF8Hnan9z+eJx4PPnHwbaeIoJRwafeUlN5r93y4cGG38+JTh5SVYrb3aduSUuDRj9EBfRIGBqzIsaTp99r9N62O7Dlvix5jRG5bIDFnZrltMVm3Ds5DNEH959f6cF4B6vPH565yzB8oQbwVwYRDBhA1awDZuYMjiGftcNmeJ9mIQ0+ADazQgFU36McPOvlsQE4I5rQYhMIMIGLHRwT8DVBd+gKcIJAhB5jFdGB46IDXVUemLNINXH8b957dg54Wgzx8hVKCpv6uPI5rzt4+y/2eu6t5AQtZeeNMQPxegyHd2lxqNkJ/2UUkjpNTNVefzo3pj/CePDGCCW5gZH5SA1uQmJPGIlC/h+ikQxnsnt+AbXVfbtVWf+9tqZj2gYIK10XHaCk8n9/hcyntx8HmtpJZL1YGtzqqTrcj3tWpoIYw1qBma9l0+3F3q5zuD3JKYlo5J7p68FBEaR0WH45KJg9tw011MeZns+G8Q7d8YluE3ZZHscop+5+5n8gtn3fYb9xoXZ5c7VQW5F9dVXa48/gYtkRigZ1bcPdkQBQAmDoEYSdg4AiyaLRDKGltCKdapRY7IxiR1jpXyUc39Xua8ta8S1BSPOUT3ITtOF+9bJxMQxNbYv7JYsgUgZoMY3HQSr6lbRx5DcgDwAXOhgLO7xlkJ+QVhTq0aifLfOiT5e3s63nnxwOGNGYchwoeQu05XGEiTkbw4ts9wzJdw2EPqFQ71MeAVBsrUougBJhb5xcaex2atRSsPI5Nt/4d3DTuK9fNPvPwz5oko1GlJFvojFcqBdJ+eFeXFflXXk9/752Tu5suYiU/Ymnqip1JBGjSxYfIlGo2Ms7UTY+t6CsM2B0H52X3YT7wd3lW5wCtCAYZLr4efYcu77BsGLy3aBtlt8BkIdetgzEMU6TxUTugpJfYdaZveSpCQmc0T8MQR1EoX5x+L1AXw== 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:(13230040)(82310400026)(376014)(36860700013)(7416014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:19:26.0385 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0fa7d8ae-a113-441e-0ff1-08dcb20b09f2 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: BL02EPF0001A0FE.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4143 Message-ID-Hash: WPGZE65LNBWTHYCIV6E6MXGOYNX52PLD X-Message-ID-Hash: WPGZE65LNBWTHYCIV6E6MXGOYNX52PLD X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Move generic dmic codec helper function implementation to sdw_utils folder so that this function can be used by other platform machine drivers. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 4 ++++ sound/soc/intel/boards/Makefile | 1 - sound/soc/intel/boards/sof_sdw_common.h | 3 --- sound/soc/sdw_utils/Makefile | 2 +- .../boards/sof_sdw_dmic.c => sdw_utils/soc_sdw_dmic.c} | 8 +++++--- 5 files changed, 10 insertions(+), 8 deletions(-) rename sound/soc/{intel/boards/sof_sdw_dmic.c => sdw_utils/soc_sdw_dmic.c} (76%) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index 7ca3a6afdfb1..0ffbd9847532 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -68,4 +68,8 @@ const char *asoc_sdw_get_codec_name(struct device *dev, const struct asoc_sdw_codec_info *codec_info, const struct snd_soc_acpi_link_adr *adr_link, int adr_index); + +/* DMIC support */ +int asoc_sdw_dmic_init(struct snd_soc_pcm_runtime *rtd); + #endif diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile index dc6fe110f279..8ac6f7b5fbee 100644 --- a/sound/soc/intel/boards/Makefile +++ b/sound/soc/intel/boards/Makefile @@ -43,7 +43,6 @@ snd-soc-sof-sdw-y += sof_sdw.o \ sof_sdw_rt_dmic.o \ sof_sdw_cs42l42.o sof_sdw_cs42l43.o \ sof_sdw_cs_amp.o \ - sof_sdw_dmic.o \ sof_sdw_hdmi.o obj-$(CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH) += snd-soc-sof_rt5682.o obj-$(CONFIG_SND_SOC_INTEL_SOF_CS42L42_MACH) += snd-soc-sof_cs42l42.o diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index 688cbc3afb29..81b654407651 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -97,9 +97,6 @@ int sof_sdw_hdmi_init(struct snd_soc_pcm_runtime *rtd); int sof_sdw_hdmi_card_late_probe(struct snd_soc_card *card); -/* DMIC support */ -int asoc_sdw_dmic_init(struct snd_soc_pcm_runtime *rtd); - /* RT711 support */ int asoc_sdw_rt711_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, diff --git a/sound/soc/sdw_utils/Makefile b/sound/soc/sdw_utils/Makefile index 29b2852be287..de8aff8744d8 100644 --- a/sound/soc/sdw_utils/Makefile +++ b/sound/soc/sdw_utils/Makefile @@ -1,3 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only -snd-soc-sdw-utils-y := soc_sdw_utils.o +snd-soc-sdw-utils-y := soc_sdw_utils.o soc_sdw_dmic.o obj-$(CONFIG_SND_SOC_SDW_UTILS) += snd-soc-sdw-utils.o diff --git a/sound/soc/intel/boards/sof_sdw_dmic.c b/sound/soc/sdw_utils/soc_sdw_dmic.c similarity index 76% rename from sound/soc/intel/boards/sof_sdw_dmic.c rename to sound/soc/sdw_utils/soc_sdw_dmic.c index d9f2e072f401..fc2aae985084 100644 --- a/sound/soc/intel/boards/sof_sdw_dmic.c +++ b/sound/soc/sdw_utils/soc_sdw_dmic.c @@ -1,14 +1,16 @@ // SPDX-License-Identifier: GPL-2.0-only +// This file incorporates work covered by the following copyright notice: // Copyright (c) 2020 Intel Corporation +// Copyright (c) 2024 Advanced Micro Devices, Inc. /* - * sof_sdw_dmic - Helpers to handle dmic from generic machine driver + * soc_sdw_dmic - Helpers to handle dmic from generic machine driver */ #include #include #include -#include "sof_sdw_common.h" +#include static const struct snd_soc_dapm_widget dmic_widgets[] = { SND_SOC_DAPM_MIC("SoC DMIC", NULL), @@ -40,4 +42,4 @@ int asoc_sdw_dmic_init(struct snd_soc_pcm_runtime *rtd) return ret; } - +EXPORT_SYMBOL_NS(asoc_sdw_dmic_init, SND_SOC_SDW_UTILS); From patchwork Thu Aug 1 09:14:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816298 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 (unknown [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 3C75DC3DA4A for ; Thu, 1 Aug 2024 09:34:49 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 24C573BB4; Thu, 1 Aug 2024 11:34:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 24C573BB4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722504876; bh=nelUTE3UCSrTjZfAXz+ulsgjGceDQrtX87jFBIIf/U4=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=cnd35ULUjAgQokLRSAQvjwiAu9g5Xa8Jc5V02xcZafqxrdrIMLhp8VF8vrcqNjRQQ G7LXQA/LLmnbpahtlcTEpfGwLp9uD2Vr4P1jksv7ybuw58hdHeE1LbpAlKN9BjzpjM hOtvyzlEkcR74uqgG/piuA3HlDVipv+VvF2+MhJc= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 106C1F805CA; Thu, 1 Aug 2024 11:34:07 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id CA28AF802DB; Thu, 1 Aug 2024 11:34:06 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 969ADF8026A; Thu, 1 Aug 2024 11:20:17 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2060e.outbound.protection.outlook.com [IPv6:2a01:111:f403:2407::60e]) (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 CFE6DF8007E for ; Thu, 1 Aug 2024 11:19:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CFE6DF8007E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=J5Qf5RM1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=K1twrXD5AUM/HCvb8DA4n698SGJPAlq/rESN9fmmqDQ06l2SBoL2RgbUUyraFXQh2+NahaJkEdFQUCOg819ta0GGalsapajjB9G9X/OvB2dPotQrgaJWDRxGl54yXTAPgFXYLaStg8GRKvWjTQKP4viDgwWkJg0jwKBMM52qWJwYJ40Mw27UQ4rFoWUYNgu2oD69ZyXgBJ9aQ1gb/rHdPlzjReohTXhkfWk5OZ2zI+kEWba6yHqME/kQk/mx0g3zoP76bgWHibbMW2XAj4lfzNkiPslLjcbGUmrB5jvgzpZBzqnRIOe2ZiQZelvVbyg2OPhjBzlBRLZD2P1wp/XxBw== 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=3h/1p+WbV/j7E5Ukqg9CVqE+GidDOg+hifcmtgW1fCc=; b=j1Q6kW1ixeA85kmOGhb9PYlxJ6E1YazCGxXrbwKKFalrVH5/FgeEIuAZujL9ljqg4yc5GED+o+pMr+HumjAABhK5eZEcGrz0ImNtdSN0iqwfwzo6TIdz7j3fOZD4SqSO8kInyF4QYcOJBtx+RDgHUWGq3cZ015xMCDjzufr2Nmtmnb/dv1jndu0jTbcoPLXWKl/u6fvHytz3IqDcLTkeldL+2RPk33SEWGa9/moGeCyiWDIAgE0g7LTH6BQf3Wy9+iOqrtFeTwF/q3V39zsH18BLf8WudNuIUjRkxWPcur6BaEeHuQVTi/ethS48FhY5Sn3JBM7eNlXM8iK/wNqg6A== 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=3h/1p+WbV/j7E5Ukqg9CVqE+GidDOg+hifcmtgW1fCc=; b=J5Qf5RM1LcdJlC5Ar1Yu6WmsxClWfLb5n+rELTaMW+4p8/Sdn/XphPBJX7m7gNYadqKd9YuMJOhUWxOEbJ60SPjsEmJjuCRW61QoTcl579I33hx1vWcWJkEmR/ecg3SuSbhrdat7nufL4X2RtcFWJ/Gy3Kty2caDYNUdnneTkos= Received: from DS7PR03CA0248.namprd03.prod.outlook.com (2603:10b6:5:3b3::13) by IA0PR12MB8226.namprd12.prod.outlook.com (2603:10b6:208:403::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Thu, 1 Aug 2024 09:19:52 +0000 Received: from DS2PEPF00003441.namprd04.prod.outlook.com (2603:10b6:5:3b3:cafe::5a) by DS7PR03CA0248.outlook.office365.com (2603:10b6:5:3b3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.34 via Frontend Transport; Thu, 1 Aug 2024 09:19:52 +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 DS2PEPF00003441.mail.protection.outlook.com (10.167.17.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:19:52 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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; Thu, 1 Aug 2024 04:19:51 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 1 Aug 2024 04:19:50 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:19:44 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Brent Lu , Charles Keepax , Maciej Strozek , Chao Song , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH RESEND 11/31] ASoC: intel/sdw_utils: move rtk dmic helper functions Date: Thu, 1 Aug 2024 14:44:26 +0530 Message-ID: <20240801091446.10457-12-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003441:EE_|IA0PR12MB8226:EE_ X-MS-Office365-Filtering-Correlation-Id: 23a101d6-99f4-4f9d-17a3-08dcb20b1991 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|7416014|82310400026|376014; X-Microsoft-Antispam-Message-Info: 74ZgPy2m+rzM25UdoOtGEgfynJSZKiuOIo8ylbDbhHJuhALU+u0uT+JppVKlKXPHR6oiWfFHy+5jU3OfL/ug5P2hmfQTlAKQIlsFAv3RGFw/8x4KdzeH2ahgo6qEz+tL2qxgUzMxeMq3eBMMPwlsl2jtSyP1Cv6o+mXvfqAWpaNp1FYt8w5skbIkzZFOLQMi2v/tLxyP8kzcFaA8abIg0Xkw+4DQH5g59YmDHgpwLTw53zwjx8cFbilV7LxNMTowLW7rdtJGBPeiOVT5Z+Rjd5QRiSAw/RGjc3r//QziqWuSWQ68f3ZeTH2AIMDXC7ElH9aUtP3M1u9lv5KYldFQNcbptjfmWqOkax5Bd9ZQ9knlMXekdEtsGbPJ8oTbjVvKy+Y/l98rhtOy9m0J3eVFT5ZtEGALjMnf9zXzTq/nZKnhQOanRthQbuBG5BG9tWXNo5QcCbdBMTTPgbHx6nxWzvjn/2TVHGQ3Uj7uZty6NUDtNTKJ8i1n9NkcB5z5O/rmvm29YUX0vwS3KOWSv9hOiWgpX4JV6KQ8OI4btK+deSEBBvkXmLh59grKD48i1fguWBZbPrwWmlt4jQTE8QU2VrdUxDmzwBjX5bPmNhPy3nPdu52Ld4kv6KIamXZb1CrBhUOrzBF4DcLirl+3qcDjkKRGL9v8iNbJBtJ67kOohTYZSEjh+TdISSqaVV/f2rJVBWgomre8qxHjSKJ6n+2RDe39hFCmbd8D3s8pwyL/9XwxjM5KY4ps4A3SWWK94/NkDUSCXfnTnhdXdCEAmOvkoZdnYWI2waJ2i8CGSYMWll6V7jxGXO9zWorgO6Bdvtzxndwu7fkkUrgidSawECrglrDhW747X2pul2wpgCWmiAVmGqpDhuIA5O57G1r52bm77+kswGJATiZ/rSyBzcX8kY0rHo7xSNMVuRf0YXyqJXJJLRTBuCt5jsN5DvCGBBBe8M0rsqOT2ZjH22Sb4kRQtQws9H9ad12VcFj7YXUm4e+xF6Y0zNho3JQMzAMEVzdIT/RhVElhArcRS3cT1VYBj3clz27PQsKVisjFtGEqZhDBzqEqaeukR0sS+CQbZuGgyLtizkRdaDmO5kPozcknv8RloRS3BcAk4fe9MOxmjvXkjr7oVgvNH3aYWPwCh272roxLMWjTmX8hNoGl+EjOeMUCgsllbmshUySYScRrckYLMv6VXf6G8rS0qlN0C7YnU2zsi7dLvMRPXSWAl7rE/aw/7xI4Dx65Cmf4Bsmqh8JkNciP2qqEYMQOnPdvshCYqkIQQqaBIhqrtXxQtu9LeBQ6gQDUQywnuo8OINbVzOMdb2HWnBhz0q4EnndOLQhB3YILdXa6wiu0g9QP7NpYROeokkQA+Eyu6l2BKDfeZF6Uf+PEfZc7rQ01LD2da3gint/BR3wNup8rPTfKNfrnyg== 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)(7416014)(82310400026)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:19:52.1528 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 23a101d6-99f4-4f9d-17a3-08dcb20b1991 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: DS2PEPF00003441.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8226 Message-ID-Hash: Q5TZMK363CAWTSDTBSQUFVHQMW3HNMRU X-Message-ID-Hash: Q5TZMK363CAWTSDTBSQUFVHQMW3HNMRU X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Move rtk SoundWire dmic helper functions implementation to sdw_utils folder to make it generic. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 3 +++ sound/soc/intel/boards/Makefile | 1 - sound/soc/intel/boards/sof_sdw_common.h | 1 - sound/soc/sdw_utils/Makefile | 2 +- .../sof_sdw_rt_dmic.c => sdw_utils/soc_sdw_rt_dmic.c} | 9 +++++---- 5 files changed, 9 insertions(+), 7 deletions(-) rename sound/soc/{intel/boards/sof_sdw_rt_dmic.c => sdw_utils/soc_sdw_rt_dmic.c} (77%) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index 0ffbd9847532..9fa102fc03c3 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -72,4 +72,7 @@ const char *asoc_sdw_get_codec_name(struct device *dev, /* DMIC support */ int asoc_sdw_dmic_init(struct snd_soc_pcm_runtime *rtd); +/* dai_link init callbacks */ +int asoc_sdw_rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); + #endif diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile index 8ac6f7b5fbee..dca8eecfa820 100644 --- a/sound/soc/intel/boards/Makefile +++ b/sound/soc/intel/boards/Makefile @@ -40,7 +40,6 @@ snd-soc-sof-sdw-y += sof_sdw.o \ sof_sdw_rt5682.o sof_sdw_rt700.o \ sof_sdw_rt711.o sof_sdw_rt_sdca_jack_common.o \ sof_sdw_rt712_sdca.o sof_sdw_rt722_sdca.o \ - sof_sdw_rt_dmic.o \ sof_sdw_cs42l42.o sof_sdw_cs42l43.o \ sof_sdw_cs_amp.o \ sof_sdw_hdmi.o diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index 81b654407651..73227ebf8e7b 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -162,7 +162,6 @@ int asoc_sdw_rt700_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai int asoc_sdw_rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int asoc_sdw_rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); diff --git a/sound/soc/sdw_utils/Makefile b/sound/soc/sdw_utils/Makefile index de8aff8744d8..2c8f70465a12 100644 --- a/sound/soc/sdw_utils/Makefile +++ b/sound/soc/sdw_utils/Makefile @@ -1,3 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only -snd-soc-sdw-utils-y := soc_sdw_utils.o soc_sdw_dmic.o +snd-soc-sdw-utils-y := soc_sdw_utils.o soc_sdw_dmic.o soc_sdw_rt_dmic.o obj-$(CONFIG_SND_SOC_SDW_UTILS) += snd-soc-sdw-utils.o diff --git a/sound/soc/intel/boards/sof_sdw_rt_dmic.c b/sound/soc/sdw_utils/soc_sdw_rt_dmic.c similarity index 77% rename from sound/soc/intel/boards/sof_sdw_rt_dmic.c rename to sound/soc/sdw_utils/soc_sdw_rt_dmic.c index 64960b059834..7f24806d809d 100644 --- a/sound/soc/intel/boards/sof_sdw_rt_dmic.c +++ b/sound/soc/sdw_utils/soc_sdw_rt_dmic.c @@ -1,16 +1,17 @@ // SPDX-License-Identifier: GPL-2.0-only +// This file incorporates work covered by the following copyright notice: // Copyright (c) 2024 Intel Corporation +// Copyright (c) 2024 Advanced Micro Devices, Inc. /* - * sof_sdw_rt_dmic - Helpers to handle Realtek SDW DMIC from generic machine driver + * soc_sdw_rt_dmic - Helpers to handle Realtek SDW DMIC from generic machine driver */ #include #include #include #include -#include "sof_board_helpers.h" -#include "sof_sdw_common.h" +#include int asoc_sdw_rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { @@ -39,4 +40,4 @@ int asoc_sdw_rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_da return 0; } -MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); +EXPORT_SYMBOL_NS(asoc_sdw_rt_dmic_rtd_init, SND_SOC_SDW_UTILS); From patchwork Thu Aug 1 09:14:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816072 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 (unknown [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 095EDC3DA4A for ; Thu, 1 Aug 2024 09:34:59 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 021363BD8; Thu, 1 Aug 2024 11:34:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 021363BD8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722504889; bh=S2ST/oiY44ugBEXzrBU0fyAlgGAV1t9LSEzykBOMz4c=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=WrsmwIG9zlC/8zTXzg6iS6eIwvlyK2Y3qFLBEG6Nyfj+JoJ49t/qCvy+ZxNRkkurN Q0Mjk/+u3UbVPwdAi0rKRGWFnlymsF5KgCjNmz1uhVi1amN8nfLPzVGL2+rp4c+6Nv 1HCGV2zgVamQDtKw4K01BAnxF1ukPOw99vl59kdA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 66395F805D7; Thu, 1 Aug 2024 11:34:11 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 038AEF805D8; Thu, 1 Aug 2024 11:34:11 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 35DB1F8026A; Thu, 1 Aug 2024 11:20:30 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2061c.outbound.protection.outlook.com [IPv6:2a01:111:f400:7ea9::61c]) (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 36EA8F8007E for ; Thu, 1 Aug 2024 11:20:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 36EA8F8007E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=B99rXr9l ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ED6rtxiAlySqvIvY8BZxl1+NPCHZ9YscRqj2RPhLsufFz2A0eNMMJrtWnh8siQeKLePk2bfjf2X7agjs0F18/35BK+NcHXYEGg9AiFeOeF+jBBm+uC+Wme8OO4UUSr6rKEpNE3kQ2LTsbrcQY+UbDoKrF4onws8LgpqgM34ArwCpSkIeY6MAd3clFJ99uUdRcdM52XsUow6zFXQyyDC3J3gMFInibkg8RQovi2MFqQkWplICaZlHmkyPCmwZ5Mi0fvalMGb9XiJ+wDPESV9hjRYv29EueKtK876oa+O0lo568nzbrbHaelzSno7Ejac9dCD/zv8r5WRXM7LUmv2B3Q== 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=J1hnEfkIC+ghzF+oVLNepXM9R2KLwrnFBZkn4np8uO0=; b=aBdiZBB6icBZkiP/7dy59xc9n5zJrz2P1S9Ij8qbc/xLxnKejgnQRpHj1cGcu9s6hADGy2avN4VkZdJ6Njb6rEVZrruOBz0YGd4DAQ892fmNGqtsp23uT8RjdtrKm7j16CUiN16ab8UoJ0jJEZXRaJ1Eve7QLAOpVJtHRtfnnzOVct4KMzXaL/Qud6GakSUDYyml0M9TTPbcfE9kw8OH5NTn22cfC9HFAgC86o3uo84jIkp2jBZafNJ6aiB2/82/6KBYVBbRpv/X2AYkLbQ5JyKJVikGWqYHdX5sCGcfNvARvLzkDTS9HMs5h9j81Umqh506+izyTenAQCE13KiDfQ== 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=J1hnEfkIC+ghzF+oVLNepXM9R2KLwrnFBZkn4np8uO0=; b=B99rXr9lROcfaHS0Xf43dkoDuyFc5xnIX8rksnjzgWzKO6Ru1plO1ex14MoK2FHH4/UsB0Klofh/DxL4/iyuwpB6PmUcXV/qWJeCDtf2oKIT5CG/1DgiwXkrsfd60qKZFSoT1gSeE/TfFQtdqNjHkPDjomPJejzblia6H9FZnuI= Received: from BL1P222CA0006.NAMP222.PROD.OUTLOOK.COM (2603:10b6:208:2c7::11) by LV8PR12MB9205.namprd12.prod.outlook.com (2603:10b6:408:191::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Thu, 1 Aug 2024 09:20:18 +0000 Received: from BL02EPF0001A0FA.namprd03.prod.outlook.com (2603:10b6:208:2c7:cafe::36) by BL1P222CA0006.outlook.office365.com (2603:10b6:208:2c7::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22 via Frontend Transport; Thu, 1 Aug 2024 09:20:18 +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 BL02EPF0001A0FA.mail.protection.outlook.com (10.167.242.101) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:20:18 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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.2507.39; Thu, 1 Aug 2024 04:20:17 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 1 Aug 2024 04:20:17 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:20:08 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Brent Lu , Charles Keepax , Maciej Strozek , Chao Song , Rander Wang , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH RESEND 12/31] ASoC: intel/sdw_utils: move rt712 sdca helper functions Date: Thu, 1 Aug 2024 14:44:27 +0530 Message-ID: <20240801091446.10457-13-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A0FA:EE_|LV8PR12MB9205:EE_ X-MS-Office365-Filtering-Correlation-Id: c954f652-6237-42d8-a314-08dcb20b28f1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|7416014|1800799024|376014; X-Microsoft-Antispam-Message-Info: BchwCXWxpFc4hPW/Kd6gP3kH2hYvPAwoH/jizPxv7LCl3pT9AE0ruyGDUME5TUp+sFBMu3t3ykDnCo92PLV1mDtmf3VUkmJyWJmnGI84IXLSjm4evdluK0m1dFI6sTaOAkcDjhslFOXAe4BCwYmMtPDsrq9KhdrJI8itChHQZNGcserWBoW79lBXqM+6eD1ry59lGTXJy6iMRMi1nuZFBcO8G63uaQpqWGuWCeMMIxgcRW4eILgN70Bq5M9NJKILyRw4cL/HxBuG/XJqjOm7wl7GxNKode/2GfYbnuqKadFW6nX4ZCjbGmPWtn2050wJguGF2x4vuxrXaRNuBX2IZ+klPehfkVtEQZY1KYD86f4Zcx8o0mh2RpheH1t+MoCOj2q7pOlfURkYzoNKeBm+Sd7iumI2jMW/p5QwRLkxRXz/WHAVpexL0QAHYi1a7Tq3PSLVJGYmczz4xhnjdbNHB7w+ACSQXnfp4oZe08ikp3JIxO6DawFAOx+7h3E4BEfxePrOSDSPa5uOCH9oXbTBbCd3J9D3kWq8hjaVhurUX3n6PxclQGHG/OPJfGf8NzCByTd1jS2VqxtH7RoghMl0XqZe5E+XcOVVJMkpGd/nKuXF49FOsADmI+lfYkvIYXTev/E8k4vbaEyHe3jT0uaANhJjLIo6mOllu07JRicCLhWnLnPPntBL8HqBlB/yUYzc7raLHDNXitIBvZrInmflhtsMBTGHVL0j7sFKG82rqIEPoKVFdGVOiQjbMzA1Qyi13iQhQVCZMqYqiBqAkcd11NNNh/9NdIAgx2rRV4vXTbCezo/Ul3qL92opZjlj6NIGVxeAq0vzUuAgKgoD1D0gPhHhdS073iyg8UEYCJ0UfSBJel9jONeJoxz2fxSs1kvy1ioh+LLLY1yLAzgDadMEmPWaghVQ5JqDV35IiAnZOx5aPRpxJk6xTDB/XarOhra/4vjM93qTOMCLRt+jLit7Ty7kRRYmgYDXwAaRrUBlO4HKuFNURZMEo2rK9ML1i++VZO+ZBdx+iPAxy5v5telu11gsohPi7Y2ZDtAhOsptfDaZxyPybTHSXKgvdaR1UXWrsvwgiyjbdZpVoinJqFmYQPvHSIpdqpdZ3iCfiQ+5njrNc1VmGba6klsNEeiwnN0vhL2eK95cb1/WZVqnaBLHpGjWi96CLBkMRp7R4mDDCmqzNkH2x808jJduZKSr8MTTLrsq0Rq6n9vY+n8j+Vf5anmoHryYOZHER+V2BmSqrqrXKrzRzcEySMZ6CA4lZX47V2e7OSu4vx619cNc7mGvTER5u1//+4iEJ2f5V258ZlOfTkGbi1U3ii0onJLRJNTeNhRuKo1+vX6c4YX6sBp5SfjfD321qvp0qwmAUsW3mmEB124pUw7/xnOnmalYBwwWK+suVoq82ffCBRORhUoCSw== 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:(13230040)(82310400026)(36860700013)(7416014)(1800799024)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:20:18.0451 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c954f652-6237-42d8-a314-08dcb20b28f1 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: BL02EPF0001A0FA.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9205 Message-ID-Hash: 3MRES275ELJZSG4YAZ7ZXK267MRZQJY6 X-Message-ID-Hash: 3MRES275ELJZSG4YAZ7ZXK267MRZQJY6 X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Move RT712 SDCA codec helper file to sdw_utils folder so that these helper functions can be used by other platform machine drivers. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 1 + sound/soc/intel/boards/Makefile | 2 +- sound/soc/intel/boards/sof_sdw_common.h | 1 - sound/soc/sdw_utils/Makefile | 3 ++- .../soc_sdw_rt712_sdca.c} | 8 +++++--- 5 files changed, 9 insertions(+), 6 deletions(-) rename sound/soc/{intel/boards/sof_sdw_rt712_sdca.c => sdw_utils/soc_sdw_rt712_sdca.c} (80%) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index 9fa102fc03c3..6fd305253e2a 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -74,5 +74,6 @@ int asoc_sdw_dmic_init(struct snd_soc_pcm_runtime *rtd); /* dai_link init callbacks */ int asoc_sdw_rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); #endif diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile index dca8eecfa820..3bc9d25fc9bb 100644 --- a/sound/soc/intel/boards/Makefile +++ b/sound/soc/intel/boards/Makefile @@ -39,7 +39,7 @@ snd-soc-sof-sdw-y += sof_sdw.o \ bridge_cs35l56.o \ sof_sdw_rt5682.o sof_sdw_rt700.o \ sof_sdw_rt711.o sof_sdw_rt_sdca_jack_common.o \ - sof_sdw_rt712_sdca.o sof_sdw_rt722_sdca.o \ + sof_sdw_rt722_sdca.o \ sof_sdw_cs42l42.o sof_sdw_cs42l43.o \ sof_sdw_cs_amp.o \ sof_sdw_hdmi.o diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index 73227ebf8e7b..b190aae1e093 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -160,7 +160,6 @@ int asoc_sdw_maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_ int asoc_sdw_rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt700_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int asoc_sdw_rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); diff --git a/sound/soc/sdw_utils/Makefile b/sound/soc/sdw_utils/Makefile index 2c8f70465a12..f9a2baa49617 100644 --- a/sound/soc/sdw_utils/Makefile +++ b/sound/soc/sdw_utils/Makefile @@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only -snd-soc-sdw-utils-y := soc_sdw_utils.o soc_sdw_dmic.o soc_sdw_rt_dmic.o +snd-soc-sdw-utils-y := soc_sdw_utils.o soc_sdw_dmic.o soc_sdw_rt_dmic.o \ + soc_sdw_rt712_sdca.o obj-$(CONFIG_SND_SOC_SDW_UTILS) += snd-soc-sdw-utils.o diff --git a/sound/soc/intel/boards/sof_sdw_rt712_sdca.c b/sound/soc/sdw_utils/soc_sdw_rt712_sdca.c similarity index 80% rename from sound/soc/intel/boards/sof_sdw_rt712_sdca.c rename to sound/soc/sdw_utils/soc_sdw_rt712_sdca.c index bb09d1ddafd2..5127210b9a03 100644 --- a/sound/soc/intel/boards/sof_sdw_rt712_sdca.c +++ b/sound/soc/sdw_utils/soc_sdw_rt712_sdca.c @@ -1,8 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-only +// This file incorporates work covered by the following copyright notice: // Copyright (c) 2023 Intel Corporation +// Copyright (c) 2024 Advanced Micro Devices, Inc. /* - * sof_sdw_rt712_sdca - Helpers to handle RT712-SDCA from generic machine driver + * soc_sdw_rt712_sdca - Helpers to handle RT712-SDCA from generic machine driver */ #include @@ -13,7 +15,7 @@ #include #include #include -#include "sof_sdw_common.h" +#include /* * dapm routes for rt712 spk will be registered dynamically according @@ -43,4 +45,4 @@ int asoc_sdw_rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_ return ret; } - +EXPORT_SYMBOL_NS(asoc_sdw_rt712_spk_rtd_init, SND_SOC_SDW_UTILS); From patchwork Thu Aug 1 09:14:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816297 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 (unknown [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 29710C3DA4A for ; Thu, 1 Aug 2024 09:35:17 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D125B3BE2; Thu, 1 Aug 2024 11:34:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D125B3BE2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722504907; bh=rx6H9awCtEys0PBAaSFFEHLXcC46ONFHPeHOOordOes=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=j/xxXsIwdHt+kwjZhm/bEpGmAOi5EsHbqFDq84X6VuDMwN5hRlY6pUM3XNo20Vh2R hnmCMhRmrN3xvhYm50bcC/K28aAxkt6ykKqYnfkqgC11mDjhVFOzqRrFnLA1VlOOGd IvRdaXOkHTUP8qIJ0TovoWCX+HqyWqrs04XoAWSk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id EAF75F805FC; Thu, 1 Aug 2024 11:34:22 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 57913F805F3; Thu, 1 Aug 2024 11:34:21 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7D640F80269; Thu, 1 Aug 2024 11:20:57 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on20600.outbound.protection.outlook.com [IPv6:2a01:111:f403:200a::600]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BB2BFF8007E for ; Thu, 1 Aug 2024 11:20:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BB2BFF8007E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=mPIwdLFE ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yIYj9fHR/rf6CynpSpzKfrYTd+3BVyoidiomfvv2ElFCAf+b/Fy+e2nQ+VV6pXB6L/6Jc9rB2vvc1dfv7WG+l2OOn807QUAGT7Qva5zzEBinH/sN84CXtjJ/6HbUN7Wa/QO7UrGRWpA+qt5mOObo2JsDOLAIfBjGu3uiweHFUDJhiAB9jf0Rpt7EZsdqqzcNuXp2fuKF4s9ICLjtwUc6B/mEJ9/Gi0dVgbZJEIow0BJyMGb0AJ54k/tsRdA8tOY+Qg4wPD2MKf/Org+vhjLwXE4lorbsPFfqK0U8okwp4CsGkNnQNuerOkWIj5FH7iyMZdAxoOtV/4FknyTKmIauig== 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=aUL0WKFSAgQUSTbpbD6fIs0hWRhgtQ0XCpq5Iu9xYc4=; b=joW8KS8PAxT7U5bFQ5l1YKKFILGX2kZ5F8EGFf5py9YJFe/8wNQ1YqzemBrVdHsgKlav2a37Hxq4XIy/rfMZje9XDRfVTgEkoxF/4ky1OqYwOhy39eQ806py2dxF31I3LmS23mj8l8N9dmo1huN5kfVIRF8YGWmdlVbnQc6Q2Pyo7H47dNIIn2vZL05nv0qPBOKNhz5E+W2slqUWW7X72aJJfsXWZifEhwSrnBc5XrEKJG0XZK9lnvmaP4SAgP3RqTIjzTGJxHvJQX3qdlp7fCtEyhJwXV4HPsg3iBKlWnpiFm8JBw36Q8oWwnl3T05tgENUpViVpLWsutKxCvoZYA== 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=aUL0WKFSAgQUSTbpbD6fIs0hWRhgtQ0XCpq5Iu9xYc4=; b=mPIwdLFEPYeV7dxf9bgibQl2goVTL8TsdXZ/nmqufCi8RmfVLlWwh7VK3w5s7EqxgMS5uVl58OVIc0dsuS1OYVPELjUz5oA1GEee8e4L+DspLCvyIZyXNtFlY8TMsDLD2yGapusPSwuAa5RNtEokMb4Z9G7x1GTa2hXp2iHB2gA= Received: from BL0PR05CA0018.namprd05.prod.outlook.com (2603:10b6:208:91::28) by PH7PR12MB6978.namprd12.prod.outlook.com (2603:10b6:510:1b8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Thu, 1 Aug 2024 09:20:44 +0000 Received: from BL02EPF0001A0FD.namprd03.prod.outlook.com (2603:10b6:208:91:cafe::63) by BL0PR05CA0018.outlook.office365.com (2603:10b6:208:91::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21 via Frontend Transport; Thu, 1 Aug 2024 09:20:44 +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 BL02EPF0001A0FD.mail.protection.outlook.com (10.167.242.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:20:44 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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.2507.39; Thu, 1 Aug 2024 04:20:43 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:20:37 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Brent Lu , Charles Keepax , Maciej Strozek , Chao Song , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH RESEND 13/31] ASoC: intel/sdw_utils: move rt722 sdca helper functions Date: Thu, 1 Aug 2024 14:44:28 +0530 Message-ID: <20240801091446.10457-14-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A0FD:EE_|PH7PR12MB6978:EE_ X-MS-Office365-Filtering-Correlation-Id: ba93e6c3-81a6-4f67-34a6-08dcb20b38bb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|7416014|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: nEnSjaAdZUibwpr6o1+9vi47J0Xs6QFACAgDxm/3fbZVGqxhLNcGVmG+Tf3gZAIkFANnA867cHxY+lcZKu41hirOOAWzGFnqcLdQoq/8TJV5r/otxMCbbDNTo0Ym8vvg5Fq6BinjIQQi7X+pA9WWZCIQMwg0EnfEfXgJ727YZkCUyL9vGxh+Jqq7rNk2mVqjU5s1YrkzA8wAkpVz5jk/kKmnAd9SwP5hZ9KLx1R/wZYKGmSG9lsQWfClgE8I5YtKcoFJ2WGVC4qWaNKM0EVbp73QEA+r4yCIvFaUzNKxP0QCY+U7vxsfczvG/2r1tjW302z1fJSlce5TXbPHT4Qk5nHI997sBq7y7tsyyJxH9jP/ufj2Hkr1PVe+sScLGaoDxxcoF/J2Y7JGQF0QyCpwoQ5EvX3i0vSk6R261sPIociyOl0DXT8Ggw1GOQ9ejqTV/llprXt/SA0dteZ3Q0/RxlU87LVlT2Rp+OWksM4NFEBU6rqV68FAAuihU7hwHw9xeCMhq8j3EsVkSCTn2/Izh91W22+gSgK/Ui2ZnXqW3Ka8979tX+m7Egt+eGHYWjp9aEM494TnySJRMNT9y/NsdZOOav29xIlMwcqJsDavhGezyJfpWSlu9U3yDjNWtjeM1tBZeJOwztm0oaiW1x1VyxkXKfL/9TXcTzxEfI6TXaCeAZlaWYx/eUkJkWA7IExDwUKXe6j4ZlxAH5i3r0uZBYGVPeU5510FnsMYwFxHXZK/4j75liVHL1XBl6XxTxEKx6mBC31vrF9Ic7US6F9aiZnPTTfGhnj+QE1zUGdHtgNIf9uWkWaLsfBkP0EHGKQe+5iPLGAytzWsdlZc20AXkXCXj99EYb7OqSIFMi/9FP/YX4Q0AhN1NxGEFUsVIum/fPdc8hsSHo9qUI78jpgt1dZm/LTj5ECCSgbJs1HpJ+/N8mRfv8ZKZYfS26eAyiKO2osTFvYF9HfJaRGQVx44xy5IDf+BRWj+ujtX6gwmP8QACgJWBi9T/vPkmNDtZ9uqzHRMGKKsZ7PxNxx/QnfF9k8jjeesuW1UcMlO8+BTJyae/JXJeyHNJ9gsFZhYWdlMluEb8aAPpQnjFr5mF/hSRkBn2Bv4NNjT2G1Oe4RHvRkfvJzNPBCA0boVRBE4PK7eyoMu7Q7qbWlwg/4WNNj0K+QnNxIqdJ40YJFBgmmLpDdf1YjwHI98qwfZWHRqOL6y6B79Du+YC4WeVF/cW8nROGdVcqg+z5xa3kEl1psdCVt86Ef8BlDwAFqiIp1Ym8a640KykRpE14ateSYhBNgbYr5tVlWAIGNVl8bNb13udJFYshk7UTncP45wpNGc7CFEOg/IDx9lxtwo+KEpF63x5Ezsqx70OHvXBDyViEgqwZfiRqda8McgvTiDob/Pxq1wPGofU2Y6xIIHuS7G/0uaJA== 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:(13230040)(82310400026)(7416014)(36860700013)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:20:44.5163 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ba93e6c3-81a6-4f67-34a6-08dcb20b38bb 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: BL02EPF0001A0FD.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6978 Message-ID-Hash: IY5A2VABBS5QEHA63WUC7BPPNR32DCIY X-Message-ID-Hash: IY5A2VABBS5QEHA63WUC7BPPNR32DCIY X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Move RT722 SDCA codec helper file to sdw_utils folder to make it generic. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 1 + sound/soc/intel/boards/Makefile | 1 - sound/soc/intel/boards/sof_sdw_common.h | 1 - sound/soc/sdw_utils/Makefile | 2 +- .../soc_sdw_rt722_sdca.c} | 8 +++++--- 5 files changed, 7 insertions(+), 6 deletions(-) rename sound/soc/{intel/boards/sof_sdw_rt722_sdca.c => sdw_utils/soc_sdw_rt722_sdca.c} (75%) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index 6fd305253e2a..5bc2a89bced4 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -75,5 +75,6 @@ int asoc_sdw_dmic_init(struct snd_soc_pcm_runtime *rtd); /* dai_link init callbacks */ int asoc_sdw_rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); #endif diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile index 3bc9d25fc9bb..f3baf9ecfbb7 100644 --- a/sound/soc/intel/boards/Makefile +++ b/sound/soc/intel/boards/Makefile @@ -39,7 +39,6 @@ snd-soc-sof-sdw-y += sof_sdw.o \ bridge_cs35l56.o \ sof_sdw_rt5682.o sof_sdw_rt700.o \ sof_sdw_rt711.o sof_sdw_rt_sdca_jack_common.o \ - sof_sdw_rt722_sdca.o \ sof_sdw_cs42l42.o sof_sdw_cs42l43.o \ sof_sdw_cs_amp.o \ sof_sdw_hdmi.o diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index b190aae1e093..c7672dc1320c 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -160,7 +160,6 @@ int asoc_sdw_maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_ int asoc_sdw_rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt700_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int asoc_sdw_rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); diff --git a/sound/soc/sdw_utils/Makefile b/sound/soc/sdw_utils/Makefile index f9a2baa49617..261c60098e88 100644 --- a/sound/soc/sdw_utils/Makefile +++ b/sound/soc/sdw_utils/Makefile @@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only snd-soc-sdw-utils-y := soc_sdw_utils.o soc_sdw_dmic.o soc_sdw_rt_dmic.o \ - soc_sdw_rt712_sdca.o + soc_sdw_rt712_sdca.o soc_sdw_rt722_sdca.o obj-$(CONFIG_SND_SOC_SDW_UTILS) += snd-soc-sdw-utils.o diff --git a/sound/soc/intel/boards/sof_sdw_rt722_sdca.c b/sound/soc/sdw_utils/soc_sdw_rt722_sdca.c similarity index 75% rename from sound/soc/intel/boards/sof_sdw_rt722_sdca.c rename to sound/soc/sdw_utils/soc_sdw_rt722_sdca.c index 2da9134ad1a3..6a402172289f 100644 --- a/sound/soc/intel/boards/sof_sdw_rt722_sdca.c +++ b/sound/soc/sdw_utils/soc_sdw_rt722_sdca.c @@ -1,8 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-only +// This file incorporates work covered by the following copyright notice: // Copyright (c) 2023 Intel Corporation +// Copyright (c) 2024 Advanced Micro Devices, Inc. /* - * sof_sdw_rt722_sdca - Helpers to handle RT722-SDCA from generic machine driver + * soc_sdw_rt722_sdca - Helpers to handle RT722-SDCA from generic machine driver */ #include @@ -13,7 +15,7 @@ #include #include #include -#include "sof_sdw_common.h" +#include static const struct snd_soc_dapm_route rt722_spk_map[] = { { "Speaker", NULL, "rt722 SPK" }, @@ -36,4 +38,4 @@ int asoc_sdw_rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_ return ret; } - +EXPORT_SYMBOL_NS(asoc_sdw_rt722_spk_rtd_init, SND_SOC_SDW_UTILS); From patchwork Thu Aug 1 09:14:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816071 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 (unknown [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 731E7C3DA64 for ; Thu, 1 Aug 2024 09:35:30 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 022D43C33; Thu, 1 Aug 2024 11:35:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 022D43C33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722504921; bh=xij3naBl87+OREF9dc9kTrO34TLDnQQpaz8qw7uMZ1s=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=iPUu5qxAeMrA5th0u9RKTjGCqkq3Q7Uv3E21+t3JD/YSj8hry5fNOfwOJQ4d0dDDK xPBw3nz3E+M4I6p+9F7qL0aOxitdjGbbvg71eIlk0zU4o/POsp3IgjIvEtZdU2BLjR oEozwm1oNgeqr8LWXsxhxVgBSc1Lz8Uz65o4PW0g= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4AF48F80603; Thu, 1 Aug 2024 11:34:30 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 3B309F80616; Thu, 1 Aug 2024 11:34:30 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 91ED2F8026A; Thu, 1 Aug 2024 11:21:44 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2409::601]) (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 E25C8F8019B for ; Thu, 1 Aug 2024 11:21:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E25C8F8019B Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=Oh4aPrxs ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eJNWv2o/8iAU8LWduqvGbZ3l0593+PrChianjuIB5rA++zp4aNH2FHi7Hs83o+e5MuSugi1bkbGD7+cEKCP61K6HnrN7SaI7bGUibQkCL87TBBCTUJUsRj3LIXG9PgbR+pV+XAGSnpiPfE7rc6kpHc0UZbAxTnbnNV8jwaUXXvCp/L9pMF0UOZPTEiEBLEkZ/44bpAKX2/nWErzbS484C7cfah38X/gYZIaLFBJ7xZBDgrHK7LPrwOSPSJ4qb3oecBmY+pMxw5zJWSiyS6s+X+mL7eFf9zpwwIt36A7Iu8GuaU4hrk1FFTQCDjQsZTj/N2AT+hGZgRgr+k58CV0dBA== 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=R4NJX/xVdvB3sXXMqg8vz7h4Q1OLf3RVEKnXa41Cz+c=; b=RhA/QzgtdHmBvmAj8WZeBXSlcct/LIwsfR7yyBfh7xECszauGlfQ+lR5+1Co5qtPPCHbq0LO3RKpBbc4xdyknjs9oLe6BRlpfQcVhWWwAy6hRTgqbzdioW4QpGwQG96M+PsQ1yxH3lP3+DBIswAAp8G6bZSyoPCOl1VZRcDXRxfP0Y1613XB53C5Ipb1RiQwiIC/dyXnj1y21wVIl3VT3s2uPsg71e4bmk78nXwi/2O95JxOO6uytH7GGMos3sSDH63HHbsYou0mnZ1cSAZtcmFStvd3Sh4BPRYqhYzKWsqucBxqO0s0D429N6lZlNI6xVSMC4pS9izQIDJNEezwhw== 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=R4NJX/xVdvB3sXXMqg8vz7h4Q1OLf3RVEKnXa41Cz+c=; b=Oh4aPrxsFhC0/hqjxkCFu/Jx79YmEEm0PuzW5NoLgMwcRHaKZnsAN87uBM82sWGR4vv0IIYbWbRJK+hnxXMQvkaCReeiuxv1BhbuPSkcgYhkxclB/END0h0Emaux0NVX++YsZkYgG3ueX5v9nv/fxTKA86C2c+/JdCpnU/Wnh7U= Received: from CY8PR12CA0011.namprd12.prod.outlook.com (2603:10b6:930:4e::14) by IA0PR12MB8908.namprd12.prod.outlook.com (2603:10b6:208:48a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23; Thu, 1 Aug 2024 09:21:27 +0000 Received: from DS2PEPF00003445.namprd04.prod.outlook.com (2603:10b6:930:4e:cafe::28) by CY8PR12CA0011.outlook.office365.com (2603:10b6:930:4e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22 via Frontend Transport; Thu, 1 Aug 2024 09:21:27 +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 DS2PEPF00003445.mail.protection.outlook.com (10.167.17.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:21:27 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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; Thu, 1 Aug 2024 04:21:26 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 1 Aug 2024 04:21:25 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:21:18 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Charles Keepax , Maciej Strozek , Chao Song , Rander Wang , jairaj-arava , Kuninori Morimoto , Brent Lu , Christophe JAILLET , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH RESEND 14/31] ASoC: intel: split soundwire machine driver private data Date: Thu, 1 Aug 2024 14:44:29 +0530 Message-ID: <20240801091446.10457-15-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003445:EE_|IA0PR12MB8908:EE_ X-MS-Office365-Filtering-Correlation-Id: 77e5dea1-d918-418d-8dca-08dcb20b523d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: kc8j6xu+la4G3jfPDzSZ0q3n0NOHATTGZsTuF1cgEwx5A0aReE64y51nMmvGVg/Y9ITai2gDR1sqB1VW5EQ2OunTBUwTc8KzbKmkv67I7+j5B1G5sQLaSQhA0tMhsZZi8ppv0/k3w7QzTq4hJL8mE9eUgL+5jHlyaSYgEG44M7ZssDY4ImOjRlmjQObiKnYO6XvoYe2Plz4453OjH3HDU4/AQV4MZjtOlsRTcJy4NYD7rnvrpA6cE6DtrigiqheZOxcVn9F+febghryXcznjSyOuJ/sHXWlNMh8W/Gw9oFS5thBBwJHVfjvLnBQk25FMrn54lr40XmKucdnUm9hTh4CRCmQ9ELrvJXhWN89HGnz51Hwl1dlX/ebHl6NCYl1ZDAjaWo2SgCSvloSvm5DbhXqvnRy5nNRGHhiKXvs+SBKT92KE+SMUE6yZqcbA+32mXyX8OQRrRr9aEb2WrIYEx2SU+Uw6IjbDlh9zvcjv/ZcKpDn+DYLoSLEnfnWWDVguneQl/mXZZY/ta7MrBOT/H+QEddJzs7hPdz++a7a1D1R/1plu1sF6oIViKPsWZEohI89xIki6+tTNI6pdvrISzSfrPJ5a0riF3jN55ou7M8vazbmylcyqWuFf0ypoiUSdN/KjPjvCf7etPOVSnnc5v4xMCB4Epsr4SjqaQsq8TuC7kc5hsCBOj2fHzuH9unn2PxRAKO5TqMqNTMPJmYWPW3D2cMTVCl+Flj5qDKvb+msk0ahQmQxKUecrwil5kKXxRDRcBHD3UabSWRvKf/S6lnPkbawbfU+uIwfKEL9PoDgr7WZSRsmAgRrrBA9gr0xP/7SabrAYs5X9L13ZfczzhHpEHGIAItY0IqAPa26g3xS4IKnamX9tq214miyDzbTWXFlHvMf1dnAfpNtzHRCrgAxDuL/v9H7kXybHS5/STLMqVS3RH1sXJgAQY4W9BIErQ0NBdDmJKfH5J6go9v5bDqcCuKnfZrtqelc2ebL3hS6h8zO+g+mzUGnKp4JG2YS8oPr5d7ZG8Qh5iEGs+5fSrVn78tRzjwvcbX2tprMalAMVE1cQQgwoUKxJs7WObcTPIpd4vrAMWbJj/JW/v1ZBtney39TyVz69lhkpyWN77xs8MGsFuUNfnq01Rbj2TcjeSwbCy+JYmXTkBC6aQIHGwkM+q/TO1zpRGtw06kGCfy/B8CoLN0M38C5RuWVGktmrWQ+sXHVN1gJNh8GiGwZ9kDTSu4C4ocnV+fQfjCKboYKOA50YatZuCHABOT9ass2W5X2fxSFkZ3CL96I6vPIZ+ku9wul+oKL1WoX0+T0MtTmr1OQUHSURtnW1plM07KyzzABbt1PNdeaEmiwMA//34UAtrojUb8ACat+SOeiHjpukuSV9igh/BDmLlkoII3cLi11iNSiRV91vHhydoje6Yg== 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)(7416014)(1800799024)(376014)(82310400026)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:21:27.1886 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 77e5dea1-d918-418d-8dca-08dcb20b523d 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: DS2PEPF00003445.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8908 Message-ID-Hash: OCSN2QJSBRYCB5XDYM5DPAG2WWPUWH7Z X-Message-ID-Hash: OCSN2QJSBRYCB5XDYM5DPAG2WWPUWH7Z X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Split intel generic SoundWire machine driver private data into two structures. One structure is generic one which can be used by other platform machine driver and the other one is intel specific one. Move generic machine driver private data to soc_sdw_utils.h. Define a void pointer in generic machine driver private data structure and assign the vendor specific structure in mc_probe() call. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 10 +++++ sound/soc/intel/boards/sof_sdw.c | 37 ++++++++++++------- sound/soc/intel/boards/sof_sdw_common.h | 8 +--- sound/soc/intel/boards/sof_sdw_cs42l42.c | 2 +- sound/soc/intel/boards/sof_sdw_cs42l43.c | 2 +- sound/soc/intel/boards/sof_sdw_hdmi.c | 14 ++++--- sound/soc/intel/boards/sof_sdw_rt5682.c | 2 +- sound/soc/intel/boards/sof_sdw_rt700.c | 2 +- sound/soc/intel/boards/sof_sdw_rt711.c | 6 +-- sound/soc/intel/boards/sof_sdw_rt_amp.c | 4 +- .../boards/sof_sdw_rt_sdca_jack_common.c | 6 +-- 11 files changed, 55 insertions(+), 38 deletions(-) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index 5bc2a89bced4..eb713cdf4079 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -55,6 +55,16 @@ struct asoc_sdw_codec_info { struct snd_soc_codec_conf **codec_conf); }; +struct asoc_sdw_mc_private { + struct snd_soc_card card; + struct snd_soc_jack sdw_headset; + struct device *headset_codec_dev; /* only one headset per card */ + struct device *amp_dev1, *amp_dev2; + bool append_dai_type; + bool ignore_internal_dmic; + void *private; +}; + int asoc_sdw_startup(struct snd_pcm_substream *substream); int asoc_sdw_prepare(struct snd_pcm_substream *substream); int asoc_sdw_prepare(struct snd_pcm_substream *substream); diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index e1d2b744987f..236e3fab66b9 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1319,7 +1319,7 @@ static int parse_sdw_endpoints(struct snd_soc_card *card, int *num_devs) { struct device *dev = card->dev; - struct mc_private *ctx = snd_soc_card_get_drvdata(card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); struct snd_soc_acpi_mach *mach = dev_get_platdata(dev); struct snd_soc_acpi_mach_params *mach_params = &mach->mach_params; const struct snd_soc_acpi_link_adr *adr_link; @@ -1440,7 +1440,8 @@ static int create_sdw_dailink(struct snd_soc_card *card, int *be_id, struct snd_soc_codec_conf **codec_conf) { struct device *dev = card->dev; - struct mc_private *ctx = snd_soc_card_get_drvdata(card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); + struct intel_mc_ctx *intel_ctx = (struct intel_mc_ctx *)ctx->private; struct sof_sdw_endpoint *sof_end; int stream; int ret; @@ -1519,7 +1520,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, if (cur_link != sof_end->link_mask) { int link_num = ffs(sof_end->link_mask) - 1; - int pin_num = ctx->sdw_pin_index[link_num]++; + int pin_num = intel_ctx->sdw_pin_index[link_num]++; cur_link = sof_end->link_mask; @@ -1573,11 +1574,12 @@ static int create_sdw_dailinks(struct snd_soc_card *card, struct sof_sdw_dailink *sof_dais, struct snd_soc_codec_conf **codec_conf) { - struct mc_private *ctx = snd_soc_card_get_drvdata(card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); + struct intel_mc_ctx *intel_ctx = (struct intel_mc_ctx *)ctx->private; int ret, i; for (i = 0; i < SDW_MAX_LINKS; i++) - ctx->sdw_pin_index[i] = SOC_SDW_INTEL_BIDIR_PDI_BASE; + intel_ctx->sdw_pin_index[i] = SOC_SDW_INTEL_BIDIR_PDI_BASE; /* generate DAI links by each sdw link */ while (sof_dais->initialised) { @@ -1665,7 +1667,8 @@ static int create_hdmi_dailinks(struct snd_soc_card *card, int hdmi_num) { struct device *dev = card->dev; - struct mc_private *ctx = snd_soc_card_get_drvdata(card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); + struct intel_mc_ctx *intel_ctx = (struct intel_mc_ctx *)ctx->private; int i, ret; for (i = 0; i < hdmi_num; i++) { @@ -1673,7 +1676,7 @@ static int create_hdmi_dailinks(struct snd_soc_card *card, char *cpu_dai_name = devm_kasprintf(dev, GFP_KERNEL, "iDisp%d Pin", i + 1); char *codec_name, *codec_dai_name; - if (ctx->hdmi.idisp_codec) { + if (intel_ctx->hdmi.idisp_codec) { codec_name = "ehdaudio0D2"; codec_dai_name = devm_kasprintf(dev, GFP_KERNEL, "intel-hdmi-hifi%d", i + 1); @@ -1721,7 +1724,8 @@ static int sof_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, ssp_num = 0, dmic_num = 0, bt_num = 0; - struct mc_private *ctx = snd_soc_card_get_drvdata(card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); + struct intel_mc_ctx *intel_ctx = (struct intel_mc_ctx *)ctx->private; struct snd_soc_acpi_mach_params *mach_params = &mach->mach_params; struct snd_soc_codec_conf *codec_conf; struct asoc_sdw_codec_info *ssp_info; @@ -1773,7 +1777,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) } if (mach_params->codec_mask & IDISP_CODEC_MASK) - ctx->hdmi.idisp_codec = true; + intel_ctx->hdmi.idisp_codec = true; if (sof_sdw_quirk & SOF_SDW_TGL_HDMI) hdmi_num = SOF_TGL_HDMI_COUNT; @@ -1789,7 +1793,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) dev_dbg(dev, "sdw %d, ssp %d, dmic %d, hdmi %d, bt: %d\n", sdw_be_num, ssp_num, dmic_num, - ctx->hdmi.idisp_codec ? hdmi_num : 0, bt_num); + intel_ctx->hdmi.idisp_codec ? hdmi_num : 0, bt_num); codec_conf = devm_kcalloc(dev, num_devs, sizeof(*codec_conf), GFP_KERNEL); if (!codec_conf) { @@ -1862,7 +1866,8 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) static int sof_sdw_card_late_probe(struct snd_soc_card *card) { - struct mc_private *ctx = snd_soc_card_get_drvdata(card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); + struct intel_mc_ctx *intel_ctx = (struct intel_mc_ctx *)ctx->private; int ret = 0; int i; @@ -1875,7 +1880,7 @@ static int sof_sdw_card_late_probe(struct snd_soc_card *card) } } - if (ctx->hdmi.idisp_codec) + if (intel_ctx->hdmi.idisp_codec) ret = sof_sdw_hdmi_card_late_probe(card); return ret; @@ -1934,16 +1939,22 @@ 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 mc_private *ctx; + struct asoc_sdw_mc_private *ctx; + struct intel_mc_ctx *intel_ctx; int amp_num = 0, i; int ret; dev_dbg(&pdev->dev, "Entry\n"); + intel_ctx = devm_kzalloc(&pdev->dev, sizeof(*intel_ctx), GFP_KERNEL); + if (!intel_ctx) + return -ENOMEM; + ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) return -ENOMEM; + ctx->private = intel_ctx; card = &ctx->card; card->dev = &pdev->dev; card->name = "soundwire"; diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index c7672dc1320c..7954472c11bb 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -78,16 +78,10 @@ enum { #define SOC_SDW_DAI_TYPE_AMP 1 #define SOC_SDW_DAI_TYPE_MIC 2 -struct mc_private { - struct snd_soc_card card; - struct snd_soc_jack sdw_headset; +struct intel_mc_ctx { struct sof_hdmi_private hdmi; - struct device *headset_codec_dev; /* only one headset per card */ - struct device *amp_dev1, *amp_dev2; /* To store SDW Pin index for each SoundWire link */ unsigned int sdw_pin_index[SDW_MAX_LINKS]; - bool append_dai_type; - bool ignore_internal_dmic; }; extern unsigned long sof_sdw_quirk; diff --git a/sound/soc/intel/boards/sof_sdw_cs42l42.c b/sound/soc/intel/boards/sof_sdw_cs42l42.c index d28477c50469..3ce2f65f994a 100644 --- a/sound/soc/intel/boards/sof_sdw_cs42l42.c +++ b/sound/soc/intel/boards/sof_sdw_cs42l42.c @@ -39,7 +39,7 @@ static struct snd_soc_jack_pin cs42l42_jack_pins[] = { int asoc_sdw_cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_card *card = rtd->card; - struct mc_private *ctx = snd_soc_card_get_drvdata(card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); struct snd_soc_component *component; struct snd_soc_jack *jack; int ret; diff --git a/sound/soc/intel/boards/sof_sdw_cs42l43.c b/sound/soc/intel/boards/sof_sdw_cs42l43.c index bb371b2649cf..47d05fe7de53 100644 --- a/sound/soc/intel/boards/sof_sdw_cs42l43.c +++ b/sound/soc/intel/boards/sof_sdw_cs42l43.c @@ -51,7 +51,7 @@ static struct snd_soc_jack_pin sof_jack_pins[] = { int asoc_sdw_cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; - struct mc_private *ctx = snd_soc_card_get_drvdata(rtd->card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(rtd->card); struct snd_soc_jack *jack = &ctx->sdw_headset; struct snd_soc_card *card = rtd->card; int ret; diff --git a/sound/soc/intel/boards/sof_sdw_hdmi.c b/sound/soc/intel/boards/sof_sdw_hdmi.c index f34fabdf9d93..4084119a9a5f 100644 --- a/sound/soc/intel/boards/sof_sdw_hdmi.c +++ b/sound/soc/intel/boards/sof_sdw_hdmi.c @@ -17,23 +17,25 @@ int sof_sdw_hdmi_init(struct snd_soc_pcm_runtime *rtd) { - struct mc_private *ctx = snd_soc_card_get_drvdata(rtd->card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(rtd->card); + struct intel_mc_ctx *intel_ctx = (struct intel_mc_ctx *)ctx->private; struct snd_soc_dai *dai = snd_soc_rtd_to_codec(rtd, 0); - ctx->hdmi.hdmi_comp = dai->component; + intel_ctx->hdmi.hdmi_comp = dai->component; return 0; } int sof_sdw_hdmi_card_late_probe(struct snd_soc_card *card) { - struct mc_private *ctx = snd_soc_card_get_drvdata(card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); + struct intel_mc_ctx *intel_ctx = (struct intel_mc_ctx *)ctx->private; - if (!ctx->hdmi.idisp_codec) + if (!intel_ctx->hdmi.idisp_codec) return 0; - if (!ctx->hdmi.hdmi_comp) + if (!intel_ctx->hdmi.hdmi_comp) return -EINVAL; - return hda_dsp_hdmi_build_controls(card, ctx->hdmi.hdmi_comp); + return hda_dsp_hdmi_build_controls(card, intel_ctx->hdmi.hdmi_comp); } diff --git a/sound/soc/intel/boards/sof_sdw_rt5682.c b/sound/soc/intel/boards/sof_sdw_rt5682.c index 3584638e2192..7e52720e0195 100644 --- a/sound/soc/intel/boards/sof_sdw_rt5682.c +++ b/sound/soc/intel/boards/sof_sdw_rt5682.c @@ -38,7 +38,7 @@ static struct snd_soc_jack_pin rt5682_jack_pins[] = { int asoc_sdw_rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_card *card = rtd->card; - struct mc_private *ctx = snd_soc_card_get_drvdata(card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); struct snd_soc_component *component; struct snd_soc_jack *jack; int ret; diff --git a/sound/soc/intel/boards/sof_sdw_rt700.c b/sound/soc/intel/boards/sof_sdw_rt700.c index a90d69573736..0abaaeacfd90 100644 --- a/sound/soc/intel/boards/sof_sdw_rt700.c +++ b/sound/soc/intel/boards/sof_sdw_rt700.c @@ -36,7 +36,7 @@ static struct snd_soc_jack_pin rt700_jack_pins[] = { int asoc_sdw_rt700_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_card *card = rtd->card; - struct mc_private *ctx = snd_soc_card_get_drvdata(card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); struct snd_soc_component *component; struct snd_soc_jack *jack; int ret; diff --git a/sound/soc/intel/boards/sof_sdw_rt711.c b/sound/soc/intel/boards/sof_sdw_rt711.c index e4d300d7d5ef..fb5bc611b5e7 100644 --- a/sound/soc/intel/boards/sof_sdw_rt711.c +++ b/sound/soc/intel/boards/sof_sdw_rt711.c @@ -62,7 +62,7 @@ static struct snd_soc_jack_pin rt711_jack_pins[] = { int asoc_sdw_rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_card *card = rtd->card; - struct mc_private *ctx = snd_soc_card_get_drvdata(card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); struct snd_soc_component *component; struct snd_soc_jack *jack; int ret; @@ -113,7 +113,7 @@ int asoc_sdw_rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai int asoc_sdw_rt711_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) { - struct mc_private *ctx = snd_soc_card_get_drvdata(card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); if (!ctx->headset_codec_dev) return 0; @@ -129,7 +129,7 @@ int asoc_sdw_rt711_init(struct snd_soc_card *card, struct asoc_sdw_codec_info *info, bool playback) { - struct mc_private *ctx = snd_soc_card_get_drvdata(card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); struct device *sdw_dev; int ret; diff --git a/sound/soc/intel/boards/sof_sdw_rt_amp.c b/sound/soc/intel/boards/sof_sdw_rt_amp.c index 4cf392c84cc7..fff746671c1d 100644 --- a/sound/soc/intel/boards/sof_sdw_rt_amp.c +++ b/sound/soc/intel/boards/sof_sdw_rt_amp.c @@ -239,7 +239,7 @@ const struct snd_soc_ops soc_sdw_rt1308_i2s_ops = { int asoc_sdw_rt_amp_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) { - struct mc_private *ctx = snd_soc_card_get_drvdata(card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); if (ctx->amp_dev1) { device_remove_software_node(ctx->amp_dev1); @@ -259,7 +259,7 @@ int asoc_sdw_rt_amp_init(struct snd_soc_card *card, struct asoc_sdw_codec_info *info, bool playback) { - struct mc_private *ctx = snd_soc_card_get_drvdata(card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); struct device *sdw_dev1, *sdw_dev2; int ret; diff --git a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c b/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c index d84aec2b4c78..8059e483835d 100644 --- a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c +++ b/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c @@ -86,7 +86,7 @@ static const char * const need_sdca_suffix[] = { int asoc_sdw_rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_card *card = rtd->card; - struct mc_private *ctx = snd_soc_card_get_drvdata(card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); struct snd_soc_component *component; struct snd_soc_jack *jack; int ret; @@ -163,7 +163,7 @@ int asoc_sdw_rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_s int asoc_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) { - struct mc_private *ctx = snd_soc_card_get_drvdata(card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); if (!ctx->headset_codec_dev) return 0; @@ -183,7 +183,7 @@ int asoc_sdw_rt_sdca_jack_init(struct snd_soc_card *card, struct asoc_sdw_codec_info *info, bool playback) { - struct mc_private *ctx = snd_soc_card_get_drvdata(card); + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); struct device *sdw_dev; int ret; From patchwork Thu Aug 1 09:14:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816296 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 (unknown [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 ABFDCC3DA4A for ; Thu, 1 Aug 2024 09:35:48 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 616AA3C63; Thu, 1 Aug 2024 11:35:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 616AA3C63 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722504940; bh=Yzz8WOg43WeIoUjtkJVapYM27Be74R5TXQtiY0PKNKk=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=oLbb1DS5cgfP1xXHxOHKuFnVNJobJbvMr4xUb1/YHWesGPqdyNXsxTHGsWtScHv4l VGjtwquuR0QYMPKgmhB5UXXz/SPu11OMAYbRuQsbUFxagStG2//aWYHPxdmnl7mXiR 2H6MN57Nrxqa/wW8IVJrSxYbTa99fvHr5TTQqySs= Received: by alsa1.perex.cz (Postfix, from userid 50401) id BB4AEF805A9; Thu, 1 Aug 2024 11:34:58 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 6F0CBF805C3; Thu, 1 Aug 2024 11:34:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DFF96F8026A; Thu, 1 Aug 2024 11:21:59 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on20600.outbound.protection.outlook.com [IPv6:2a01:111:f403:2405::600]) (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 98CADF8007E for ; Thu, 1 Aug 2024 11:21:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 98CADF8007E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=lV8Ztiwt ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PaPgqe+sUDsduTJl/lEP6BjL9nJzzHFL9GeQpuvDKSk6aRoRbUMelx4PzUyiW+RSz5L1h5Bp+X5p15V7qUcMYx3WjE0kRiOaqtPkyezuVma8vvQywpuWpWHA6iogSnMt73CpkFqid1MGZd4GBgYxlc5jKjUcAgynHjwHPrVhS2GUuQBqSSsg9fQ7zN3bHDY8zkP4mCaokUYMvu71zpsxyKWwEeoeTBQ9pcT9b7Na/2He81CLjmu3upMWJMNOgBQTwDXGN8x8KihahFuN5ql901fr0ZGdKXYe/BY8x41IMIg4aHIboOR3PY5A6/XEk5Z7lq2a2adOfbjD1WQDEzZK8w== 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=Z6mKQYLX0Q5OVdsXYYGk5DZZpfqfgmCoNaifWSLyRIk=; b=jqNgv5M+2Yk/C53vUiEp7Ij+M8ouRxH/uayfTkN2uethvLJIVnzWA+pCBGf93y1O2B52mGOG6RWJLHqW4PpTnEmSyoBS/vy5LMURxLy5AyIgkzNwLf2xZSgvjDRDgL4NVkYHY7Bedekpib7r4u1T0+mN7VHv6El6F1EXdd9WN2OTPALz2L94ldGfs0BI5ChHsAYi4uCbc548muUikAImNeJaxPDyT0bCq45+5extcn2SYxJtT4FaareWAMc6qmgPG1lViTOWSVPiWBOsaM4usMZMfogRKZ0/4J46jeLlbADsr90geFyW70Jtu2j8zUtBKNBjy7zXxkRKrinQ70yP7w== 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=Z6mKQYLX0Q5OVdsXYYGk5DZZpfqfgmCoNaifWSLyRIk=; b=lV8ZtiwtiaMn5LDJ0Un68NeY8/sOSklz6HcM9cC5hZF+HzeL8RhsPavOdW5edC5XDjAb1DkgCVL8f7EB93+kVmTuqpRNn1ETllD34XvWTIvVR3aCygvKWioZ1Jn9padJ/83qcEdz4iba2a08/ZZWEC5KUW7DVF6fnepvHcsx5wk= Received: from MN2PR05CA0014.namprd05.prod.outlook.com (2603:10b6:208:c0::27) by CY5PR12MB6035.namprd12.prod.outlook.com (2603:10b6:930:2d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Thu, 1 Aug 2024 09:21:52 +0000 Received: from BL02EPF0001A0FD.namprd03.prod.outlook.com (2603:10b6:208:c0:cafe::97) by MN2PR05CA0014.outlook.office365.com (2603:10b6:208:c0::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21 via Frontend Transport; Thu, 1 Aug 2024 09:21:52 +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 BL02EPF0001A0FD.mail.protection.outlook.com (10.167.242.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:21:52 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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.2507.39; Thu, 1 Aug 2024 04:21:51 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:21:44 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Brent Lu , Charles Keepax , Maciej Strozek , Chao Song , Rander Wang , Kuninori Morimoto , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH RESEND 15/31] ASoC: intel/sdw_utils: move rt5682 codec helper function Date: Thu, 1 Aug 2024 14:44:30 +0530 Message-ID: <20240801091446.10457-16-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A0FD:EE_|CY5PR12MB6035:EE_ X-MS-Office365-Filtering-Correlation-Id: a7d8c33a-dcfb-4031-bc07-08dcb20b60fb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: FTylGS+XhOummUlTgVdfrcdV2P6ywhwoSM+iiu+qk/5+9Gj6YTG++XbKewm7uI5SDBh4IJ+ZJqPd0QK5Jzl3VIYfEToNlPk8o/2C+GLg6bE0d31aClidseWz7tS+BzyXokk1f1v6+Km8o5XKJnQ6N7rnnStn83SoZDauSUGSs41zTj+6pR8r0VFmtAtHYIn0PvxjEcqCZ+OXf+SCPpNhJeLcAj42b+YzOzEC/lJy+v2HKBEA5u5MMoyPYSCiaa4z4sRFWqpVjO7YjNnBUD1NRkkXt8gjNmDN/5tTyPvR8n7g48LX7wnsrMmCz9k3xcWj8UjarGCY2a9LgxIfwA9lZh4tUvSV0lSXmfYXuw7XDVGKEgpKxB7LFn0HgpNmosSGToyGHh0P9MCP+I6Qd38djg0ansO23mBYxfk8NtYS8OirTR6VEifh4QejOliRCsEi587orvgft6MQFwpJvzf7mdq55REdlKZgtQf1MQTQdOAVm0Aq/aWID6yeHOojNkhTlS0Yemsp2zwHoij1L0oJHcjLshNWBYqwlQPeT/xAvyiMycR5Yz2VeeYUuhUSl8ip1v5A/BZtovzDQSE2Vv44Q7HaOyhQbHg2qMs78ZIo1LNFWLTDyR/XS7znUU8PKq/G51GzLdiMRquJ7GrnqFg23dy48J57CMa62jyyV7H748DH1/eweiiTk/lIIy4TPni2NCjSQ5NrTVLrlEyi3pvxSBRrP7dCESz0f1LCpEBXon80p2MXySy7tpzgwiPJpsfE3IwRxlm04yjsjHIIH5CdMZMFbAOLgi8Eti51Vz2Q+YRkWXapsUvVyx+IPUF7u8JppLo+WTFYoT25DI8Fa5bZoJ8EviaUmEb+UtVzzsR2wEPsj0NOEATLHVry5j9XPQY4lXErpJrwdiVz3qMu3xU+6P+HzpKX3JQCIoZB9FZBtwdRE5HalHZtncGrlrs5Z7xMnrUfwzVJMAAX1j1FHEZY3BrWgt1fWSZfAof92Kdp4bvlX6pB+xI6PZD902+34GJzlf5SuNnHTKjF5RCKey3tNq4Qw4D7Kh0O0PUzmw4GfWkAZ5k/jBkv8MLm9dA0wglGO86MXnLEOSSdu2usoysrD9l1hXO+BRf7NsirL458shVwNFMy5fcONOLGSZ+8aO+eiyvmRr1cvYN4cSgPrwf3bPTf8LBL08GFdVdPnCY3D8Wrx5E9rg2dwQsPRNBjQQ53AAXJAdptVnFrcwwwVSpp9BETjqVL4E2lE2AxywvrKmJYEwuOBHB8AXnEhQeTvNrqZL2n96VHHWOr4FQCuZOAL8jAzonM9039I2rFzNS2U6GXc4j0Q7v4KQ368LG5Y//Z4/23iHtYGNZdXBpvenKsHid++6rsDhiMO9Zyqap96RVE8TWwAyirS+/BNOLPuU+l 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:(13230040)(7416014)(376014)(1800799024)(82310400026)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:21:52.0481 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a7d8c33a-dcfb-4031-bc07-08dcb20b60fb 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: BL02EPF0001A0FD.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6035 Message-ID-Hash: WTJ5UPP4B5PVOML7DZRSNUU4YNWPFFRO X-Message-ID-Hash: WTJ5UPP4B5PVOML7DZRSNUU4YNWPFFRO X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Move rt5682 sdw codec helper function to common place holder to make it generic. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 1 + sound/soc/intel/boards/Makefile | 4 ++-- sound/soc/intel/boards/sof_sdw_common.h | 1 - sound/soc/sdw_utils/Makefile | 3 ++- .../sof_sdw_rt5682.c => sdw_utils/soc_sdw_rt5682.c} | 8 +++++--- 5 files changed, 10 insertions(+), 7 deletions(-) rename sound/soc/{intel/boards/sof_sdw_rt5682.c => sdw_utils/soc_sdw_rt5682.c} (88%) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index eb713cdf4079..ed97d78336da 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -86,5 +86,6 @@ int asoc_sdw_dmic_init(struct snd_soc_pcm_runtime *rtd); int asoc_sdw_rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); #endif diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile index f3baf9ecfbb7..80c33e4b4cfe 100644 --- a/sound/soc/intel/boards/Makefile +++ b/sound/soc/intel/boards/Makefile @@ -37,8 +37,8 @@ snd-soc-sof-ssp-amp-y := sof_ssp_amp.o snd-soc-sof-sdw-y += sof_sdw.o \ sof_sdw_maxim.o sof_sdw_rt_amp.o \ bridge_cs35l56.o \ - sof_sdw_rt5682.o sof_sdw_rt700.o \ - sof_sdw_rt711.o sof_sdw_rt_sdca_jack_common.o \ + sof_sdw_rt700.o sof_sdw_rt711.o \ + sof_sdw_rt_sdca_jack_common.o \ sof_sdw_cs42l42.o sof_sdw_cs42l43.o \ sof_sdw_cs_amp.o \ sof_sdw_hdmi.o diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index 7954472c11bb..bbd09698c69d 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -151,7 +151,6 @@ int asoc_sdw_cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_so int asoc_sdw_cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int asoc_sdw_rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt700_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); diff --git a/sound/soc/sdw_utils/Makefile b/sound/soc/sdw_utils/Makefile index 261c60098e88..fea2b6ae6975 100644 --- a/sound/soc/sdw_utils/Makefile +++ b/sound/soc/sdw_utils/Makefile @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only snd-soc-sdw-utils-y := soc_sdw_utils.o soc_sdw_dmic.o soc_sdw_rt_dmic.o \ - soc_sdw_rt712_sdca.o soc_sdw_rt722_sdca.o + soc_sdw_rt712_sdca.o soc_sdw_rt722_sdca.o \ + soc_sdw_rt5682.o obj-$(CONFIG_SND_SOC_SDW_UTILS) += snd-soc-sdw-utils.o diff --git a/sound/soc/intel/boards/sof_sdw_rt5682.c b/sound/soc/sdw_utils/soc_sdw_rt5682.c similarity index 88% rename from sound/soc/intel/boards/sof_sdw_rt5682.c rename to sound/soc/sdw_utils/soc_sdw_rt5682.c index 7e52720e0195..80b4caa92667 100644 --- a/sound/soc/intel/boards/sof_sdw_rt5682.c +++ b/sound/soc/sdw_utils/soc_sdw_rt5682.c @@ -1,8 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-only +// This file incorporates work covered by the following copyright notice: // Copyright (c) 2020 Intel Corporation +// Copyright (c) 2024 Advanced Micro Devices, Inc. /* - * sof_sdw_rt5682 - Helpers to handle RT5682 from generic machine driver + * soc_sdw_rt5682 - Helpers to handle RT5682 from generic machine driver */ #include @@ -15,7 +17,7 @@ #include #include #include -#include "sof_sdw_common.h" +#include static const struct snd_soc_dapm_route rt5682_map[] = { /*Headphones*/ @@ -86,4 +88,4 @@ int asoc_sdw_rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai return ret; } -MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); +EXPORT_SYMBOL_NS(asoc_sdw_rt5682_rtd_init, SND_SOC_SDW_UTILS); From patchwork Thu Aug 1 09:14:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816070 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 (unknown [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 589BAC3DA64 for ; Thu, 1 Aug 2024 09:36:08 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 814263CA5; Thu, 1 Aug 2024 11:35:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 814263CA5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722504960; bh=BIFI18q4ByQH2ewrJK/kJ4FJ3bbVKAwu989UsVKHreg=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=D12exFdauBiLfL+rgh5GKY0iLy+QK6Re9NR4p1lcpg3MLk5GnGCg+82B/WMhAPAXP cpFdzcKc+fdqcGUz9pPv13LGUGKLiEp7M7a2K7ueoHsQimZvSYo886rOb0znDUxb1B pW7iYN3FdSWgc3IXtphIPpIsZzZb7UKbKfXmUEws= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1DC66F805DA; Thu, 1 Aug 2024 11:35:03 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id EC433F805EF; Thu, 1 Aug 2024 11:35:02 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0A525F8026A; Thu, 1 Aug 2024 11:22:29 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2416::601]) (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 E977AF8007E for ; Thu, 1 Aug 2024 11:22:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E977AF8007E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=lTyJp3II ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GOMnrc2LnMsnMIWYw76AgwgF9l23cfHjbePk/N7DP81uaVEYhSz4SBzi62PqwA28MJVktEyEBE1RPTaEpw9IjiQMHA1hZmtAtIIR0ibD6rX6ccTTgn0oC6VGiigjurDAv7t65d2j2DF7zL8gPQ/yaG8X8nfGy4NZ0vGzrxR5aZASSl7OP34XNd31DOgL9z/zwryWvAWeX8z1lura58fk/c6NDkEO/DJbyWnLq5s5Q1lSZO2YajQlNwhsKizAN7Ds3z9fb+BXYtIMscLpDi0QTy5Zmw/3E/IPyg8Ziuv3f0ndYo2Lfp/O7z49WldY90ig07dsyAS1hIWp0yDwAiAQ+w== 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=o8eb6F6KXiovGQZ5qK0hVz3A8v39vgjsYiTEqUy9guY=; b=EFhQGZQ6XdWhQTbDgp14G1sOw2OhqlOgAPGMCDkMdC79tSR+L2oSK78vRIpC7o7iN0ljv8VNWNwCsdN1QBVQdDQLEaGJM4iVSLtp88W6IGAl9tTKTgBwXiixg/+LZ9FB00V7SuYDtcnHvICnOaTCzPIzgvu55nRjs6fgNYatOBRfSqkwqmMg8OYyYfHQlyBZkeVFy5jt50oOwIQnOgV1kRz5VWquTN1qOLXl68hOJsbNBboWJypUdRtZYV+L3BASa+Z0NaeoO7wHrGblN7Ug1T1UgDURyGLegGl5nDUjSPGkOqEVZrRuLjvK+XU/tvRSiSMtSEE5zRBPJF/tDNQn2w== 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=o8eb6F6KXiovGQZ5qK0hVz3A8v39vgjsYiTEqUy9guY=; b=lTyJp3II4KB+pYRdCxzSqW6KDXvjfwq8UhPnn0o4zn2ou2vztrM4o15FCl5SCoSQFu2jyS53KEgqD1vIJsVLVt4CJ5CHWm1FQZiQaicFmJaTHsT9egclk5GyOLDnNRiKYM8QmCx/7023XEC42kia/7bwcQjTh91eWWFd1KH0AfM= Received: from DM6PR03CA0045.namprd03.prod.outlook.com (2603:10b6:5:100::22) by SA1PR12MB7038.namprd12.prod.outlook.com (2603:10b6:806:24d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.20; Thu, 1 Aug 2024 09:22:22 +0000 Received: from DS1PEPF00017095.namprd03.prod.outlook.com (2603:10b6:5:100:cafe::cc) by DM6PR03CA0045.outlook.office365.com (2603:10b6:5:100::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22 via Frontend Transport; Thu, 1 Aug 2024 09:22:22 +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 DS1PEPF00017095.mail.protection.outlook.com (10.167.17.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:22:21 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Thu, 1 Aug 2024 04:22:20 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:22:13 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Brent Lu , Charles Keepax , Maciej Strozek , Chao Song , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH RESEND 16/31] ASoC: intel/sdw_utils: move rtk jack common helper functions Date: Thu, 1 Aug 2024 14:44:31 +0530 Message-ID: <20240801091446.10457-17-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017095:EE_|SA1PR12MB7038:EE_ X-MS-Office365-Filtering-Correlation-Id: 13613b73-407e-4a18-11e0-08dcb20b72bd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|376014|1800799024|7416014|82310400026; X-Microsoft-Antispam-Message-Info: ahAh9Wj7K52yJ+/rizkjzP19NItue8CAMF8ybRU3AczuTsgxnR4GP/ke6qRiOG5uKYrgnjdDq65UDSEDTQmc2c2fuNWOTCmtyLH6PO6tHENHks1aukYKT79NjjXSI7q7pP1w74G5Lc7SjxAanC9CmJgTQNB3xYPzvuHyyQeCAi7jJGq9mnvQ1Wbn/7OS8t5hGq0h4weaVTXSJrvE2F+teF8jivOjIo7nlxwzHuj1Cn65vMwA2J7bNElIIDRReeSwmuiI8B2m0NdPixUqHw1OMBe1BUczkc1JjzAGkJrZMEyL1gpOCgagN8c3rJO/YK6LkNmo48a8jIQD+ci7OQ7V07IbyTpeaKmu+jXqyqJ9qYn9I7F0oKaoM215s4vh3kUDkOykEXza5lWt76iN8/rTRb8GO6vUJjZeP6qoRJA8qlJs+A+oDBTot/1/6rlQGt1evqEM59SXgHMyZjRI6SufPGkmW+/TJ/Y0d1fGxZ0e8DYTKoobvlOf2hhSYOFTwwfsIdCNu3nXqdiQMb4IJaWI/urxORzD8qhn69Q/RVIDcV7iT2qOYFYSqNFjQG6jys7FHI4BXHJHKaex/kChrLQkbmh/cwDHlWQSeSqjGxY7HC1mBsJJRWUU3S0AJUkv1RwoRCga/d70syUz1YOlJ+GEdNmVZ/roTh8PgaJNPNGB9qmwAeEAVT+MiuLHxvTPiG0qVYRpV9zrzXICSwnwndZF3lNu0VnKJ2jlxQ2NEjwY3pv6mFGSV/f5yfM7ihZqAq57aVySWH7eQcv0bNoVrQpr/5ikkcNINSlrlmdLwIJnUdWzC/0AZ4dJP2/5+jN/27Y/waPRVnPgz+aX1USx93jnjbwaouVVHwsb553wDNexKpq795hflJqcqPRG/5cLVm4AbiNymgpRexWhRjnDJLhow6Q9RJLp07nCpu3j5aIpZRSNX8ES1/ZDCjSywn42XRxEyYT0p1VvZIAPi1QXxdJeP7vcWa1Yr8mljKZPHiJ2nm48OhHFFqshs23zAH2awN1WU34KyOcmBsdsDdXY6pxVbgxXfk8adh6bYaHl6Fg8ZPhGfmvnCdGvMNzgjkS5SwkMax18/QJgAqDGFBB7R7NvXFc2OVB3ecUSL65rssXsCjMYw26kqQCPCkGvzIQpUhruL/YzLORyGcrHvfMdYUk8Gg8pSOfmmpRRzNOJfSmOTMOZsr5w84bxFOlEP+SO8LoO5nAVJ1F0Dlk433B9jqxIZQbHktea0Oq5CGuibEwBIThf+QEMKLoSmQoRGthjqnm6Dv7p13jwa4uZ4wJgeW06kF02Nh+gddQVAJyRraLuFzEih/RvlNTZh82OBIeJm7+lAorjaLJvOuSuTIqg0wgAjRuMAtY9A2zJvnZeT0zfkUO71KJg3bdTzm/+l22FXBqkuWJ8KdXsWNfhylNiIh9Vjw== 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)(1800799024)(7416014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:22:21.8051 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 13613b73-407e-4a18-11e0-08dcb20b72bd 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: DS1PEPF00017095.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7038 Message-ID-Hash: ND7CJ6RCD3565K3ZX3ZZLGZW5MJ75LFS X-Message-ID-Hash: ND7CJ6RCD3565K3ZX3ZZLGZW5MJ75LFS X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Move RTK codec jack common helper functions to common place holder (sdw_utils folder) to make it generic so that it will be used by other platform machine driver code. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 11 ++++++++++ sound/soc/intel/boards/Makefile | 1 - sound/soc/intel/boards/sof_sdw.c | 1 + sound/soc/intel/boards/sof_sdw_common.h | 10 ---------- sound/soc/sdw_utils/Makefile | 2 +- .../soc_sdw_rt_sdca_jack_common.c} | 20 +++++++++++-------- 6 files changed, 25 insertions(+), 20 deletions(-) rename sound/soc/{intel/boards/sof_sdw_rt_sdca_jack_common.c => sdw_utils/soc_sdw_rt_sdca_jack_common.c} (90%) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index ed97d78336da..6b6bab8d3310 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -13,6 +13,8 @@ #include #define SOC_SDW_MAX_DAI_NUM 8 +#define SOC_SDW_MAX_NO_PROPS 2 +#define SOC_SDW_JACK_JDSRC(quirk) ((quirk) & GENMASK(3, 0)) struct asoc_sdw_codec_info; @@ -63,6 +65,7 @@ struct asoc_sdw_mc_private { bool append_dai_type; bool ignore_internal_dmic; void *private; + unsigned long mc_quirk; }; int asoc_sdw_startup(struct snd_pcm_substream *substream); @@ -82,8 +85,16 @@ const char *asoc_sdw_get_codec_name(struct device *dev, /* DMIC support */ int asoc_sdw_dmic_init(struct snd_soc_pcm_runtime *rtd); +/* RT711-SDCA support */ +int asoc_sdw_rt_sdca_jack_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback); +int asoc_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); + /* dai_link init callbacks */ int asoc_sdw_rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile index 80c33e4b4cfe..0f1b2c288162 100644 --- a/sound/soc/intel/boards/Makefile +++ b/sound/soc/intel/boards/Makefile @@ -38,7 +38,6 @@ snd-soc-sof-sdw-y += sof_sdw.o \ sof_sdw_maxim.o sof_sdw_rt_amp.o \ bridge_cs35l56.o \ sof_sdw_rt700.o sof_sdw_rt711.o \ - sof_sdw_rt_sdca_jack_common.o \ sof_sdw_cs42l42.o sof_sdw_cs42l43.o \ sof_sdw_cs_amp.o \ sof_sdw_hdmi.o diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 236e3fab66b9..e310843974a7 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1973,6 +1973,7 @@ static int mc_probe(struct platform_device *pdev) log_quirks(card->dev); + ctx->mc_quirk = sof_sdw_quirk; /* reset amp_num to ensure amp_num++ starts from 0 in each probe */ for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) codec_info_list[i].amp_num = 0; diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index bbd09698c69d..af656716c9d2 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -15,7 +15,6 @@ #include #include "sof_hdmi_common.h" -#define SOC_SDW_MAX_NO_PROPS 2 #define MAX_HDMI_NUM 4 #define SOC_SDW_UNUSED_DAI_ID -1 #define SOC_SDW_JACK_OUT_DAI_ID 0 @@ -45,7 +44,6 @@ enum { SOF_I2S_SSP5 = BIT(5), }; -#define SOC_SDW_JACK_JDSRC(quirk) ((quirk) & GENMASK(3, 0)) /* Deprecated and no longer supported by the code */ #define SOC_SDW_FOUR_SPK BIT(4) #define SOF_SDW_TGL_HDMI BIT(5) @@ -98,13 +96,6 @@ int asoc_sdw_rt711_init(struct snd_soc_card *card, bool playback); int asoc_sdw_rt711_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); -/* RT711-SDCA support */ -int asoc_sdw_rt_sdca_jack_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback); -int asoc_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); - /* RT1308 I2S support */ extern const struct snd_soc_ops soc_sdw_rt1308_i2s_ops; @@ -154,6 +145,5 @@ int asoc_sdw_maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_ int asoc_sdw_rt700_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int asoc_sdw_rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); #endif diff --git a/sound/soc/sdw_utils/Makefile b/sound/soc/sdw_utils/Makefile index fea2b6ae6975..68b8fddeb77e 100644 --- a/sound/soc/sdw_utils/Makefile +++ b/sound/soc/sdw_utils/Makefile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only snd-soc-sdw-utils-y := soc_sdw_utils.o soc_sdw_dmic.o soc_sdw_rt_dmic.o \ soc_sdw_rt712_sdca.o soc_sdw_rt722_sdca.o \ - soc_sdw_rt5682.o + soc_sdw_rt5682.o soc_sdw_rt_sdca_jack_common.o obj-$(CONFIG_SND_SOC_SDW_UTILS) += snd-soc-sdw-utils.o diff --git a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c b/sound/soc/sdw_utils/soc_sdw_rt_sdca_jack_common.c similarity index 90% rename from sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c rename to sound/soc/sdw_utils/soc_sdw_rt_sdca_jack_common.c index 8059e483835d..3e6211dc1599 100644 --- a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c +++ b/sound/soc/sdw_utils/soc_sdw_rt_sdca_jack_common.c @@ -1,8 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-only +// This file incorporates work covered by the following copyright notice: // Copyright (c) 2020 Intel Corporation +// Copyright (c) 2024 Advanced Micro Devices, Inc. /* - * sof_sdw_rt711_sdca - Helpers to handle RT711-SDCA from generic machine driver + * soc_sdw_rt711_sdca - Helpers to handle RT711-SDCA from generic machine driver */ #include @@ -15,22 +17,22 @@ #include #include #include -#include "sof_sdw_common.h" +#include /* * Note this MUST be called before snd_soc_register_card(), so that the props * are in place before the codec component driver's probe function parses them. */ -static int rt_sdca_jack_add_codec_device_props(struct device *sdw_dev) +static int rt_sdca_jack_add_codec_device_props(struct device *sdw_dev, unsigned long quirk) { struct property_entry props[SOC_SDW_MAX_NO_PROPS] = {}; struct fwnode_handle *fwnode; int ret; - if (!SOC_SDW_JACK_JDSRC(sof_sdw_quirk)) + if (!SOC_SDW_JACK_JDSRC(quirk)) return 0; - props[0] = PROPERTY_ENTRY_U32("realtek,jd-src", SOC_SDW_JACK_JDSRC(sof_sdw_quirk)); + props[0] = PROPERTY_ENTRY_U32("realtek,jd-src", SOC_SDW_JACK_JDSRC(quirk)); fwnode = fwnode_create_software_node(props, NULL); if (IS_ERR(fwnode)) @@ -160,6 +162,7 @@ int asoc_sdw_rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_s return ret; } +EXPORT_SYMBOL_NS(asoc_sdw_rt_sdca_jack_rtd_init, SND_SOC_SDW_UTILS); int asoc_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) { @@ -168,7 +171,7 @@ int asoc_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_lin if (!ctx->headset_codec_dev) return 0; - if (!SOC_SDW_JACK_JDSRC(sof_sdw_quirk)) + if (!SOC_SDW_JACK_JDSRC(ctx->mc_quirk)) return 0; device_remove_software_node(ctx->headset_codec_dev); @@ -177,6 +180,7 @@ int asoc_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_lin return 0; } +EXPORT_SYMBOL_NS(asoc_sdw_rt_sdca_jack_exit, SND_SOC_SDW_UTILS); int asoc_sdw_rt_sdca_jack_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, @@ -198,7 +202,7 @@ int asoc_sdw_rt_sdca_jack_init(struct snd_soc_card *card, if (!sdw_dev) return -EPROBE_DEFER; - ret = rt_sdca_jack_add_codec_device_props(sdw_dev); + ret = rt_sdca_jack_add_codec_device_props(sdw_dev, ctx->mc_quirk); if (ret < 0) { put_device(sdw_dev); return ret; @@ -207,4 +211,4 @@ int asoc_sdw_rt_sdca_jack_init(struct snd_soc_card *card, return 0; } -MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); +EXPORT_SYMBOL_NS(asoc_sdw_rt_sdca_jack_init, SND_SOC_SDW_UTILS); From patchwork Thu Aug 1 09:14:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816295 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 (unknown [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 D3FF6C3DA4A for ; Thu, 1 Aug 2024 09:36:21 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 36FBD3CC8; Thu, 1 Aug 2024 11:36:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 36FBD3CC8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722504974; bh=ouY1nxnfjw9PexoiCybB7uIlzM1I8yJ48mTNr9sxP/s=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=GTKOeGa1YlmwCSrc9ITLd3Mc9jXU61ymNUaliClNo+xymgwf9beqxlD/fU8PLEAi/ 7daKsntJ77PI3QJFpl5kfLuE2n8JlsmNHvnJDIBt2EnYii9xTFAqJD/lH+1TguN7Ey JeOB4vjenwvM+FUBAhYF5CJ29GIWFf/Taep4tO9Q= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9CD62F805C8; Thu, 1 Aug 2024 11:35:43 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 933E5F805C2; Thu, 1 Aug 2024 11:35:42 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D469DF8026A; Thu, 1 Aug 2024 11:23:01 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2415::601]) (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 B6D83F8007E for ; Thu, 1 Aug 2024 11:22:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B6D83F8007E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=m4zcQ1k8 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Lkxo0Pu0XwTXfzAQhCFp6D3+LGCj8dp9g2WVULC4QgdwXROe90Li4fWPenweOQIWQbJy1JczqEyb62rksz/Lt+NHVbEBKwPBvXNAOKXnW2LgIAq7SgTx9gm7vQDi/09hPMjsZ8vlq+MF4Z5+jpSpTd1dJBYlWBjzZ8JlCEnpIQx0/i0Sn3s9xSZ76CqCQtETz+vMYDrjFRDWtQ4XZ2KEcD+uPvQjhZh4TsRafPHaUwqXbJVjhNaHtvrOaoy8GRp/xr857hQtc1F+iAWAFZPhFe9xtcccz3ssZBWRTPcZHUZpYsZX++l2OazwzGFRlYBFqixWHTSYLAYlJ8dKzNOf9A== 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=m1oVuq3hwPFTWMdqa0cdEAyN9Tqh9cP8L5UQI44VQus=; b=ZVnwj10Gs2aHJ3OpYxhx88VYbYoAFu50Qol++bkhWOW3moSn/BpVMvXOe4Dp8wA9bbBbtzJ16CrXaSPLPMno0uCDpKNSsn8yuokKwkOWmFDLiHqWORqrZPDRAfyQ8jxZLMgNvEwIL1qPCzz5onGR8exiA2Ywd+Yk4i+kIdsMYAUybQPMPv6hz2W5JF2ubhw8jmm+Z2ywvnioqoV2Ag+qNYhZkzsrweSRYAyDpf1LNqYa6fdNBW+vZEYs4tgWVrrxrCCSaYDbhL8l0xZf3N+5t+Z93WyMLdGH1Q/NelPlSGhyimma2ATBTdtMswQlLlj+g4XGRSCmZmHmUNJSIMefBQ== 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=m1oVuq3hwPFTWMdqa0cdEAyN9Tqh9cP8L5UQI44VQus=; b=m4zcQ1k82VNDUitBAXXzMZU7ZrCYXuhCyC6xMVhz4TiE4iz46zN4p5+ZPx7+ViTANKUlgW/hk7F4DT3gcgu+0BANB4QxmmEIEkH0N4XYhdrVf6USYXAokp9gx/csZM9Pc//gdjGuOix0XM4ywbraxxrggFq0tYMadgAwsYDuAWg= Received: from BLAPR05CA0009.namprd05.prod.outlook.com (2603:10b6:208:36e::16) by SA3PR12MB9160.namprd12.prod.outlook.com (2603:10b6:806:399::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Thu, 1 Aug 2024 09:22:54 +0000 Received: from BL02EPF0001A0FB.namprd03.prod.outlook.com (2603:10b6:208:36e:cafe::74) by BLAPR05CA0009.outlook.office365.com (2603:10b6:208:36e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21 via Frontend Transport; Thu, 1 Aug 2024 09:22: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=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by BL02EPF0001A0FB.mail.protection.outlook.com (10.167.242.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:22:54 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) 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.2507.39; Thu, 1 Aug 2024 04:22:53 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 1 Aug 2024 04:22:52 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:22:47 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Brent Lu , Charles Keepax , Maciej Strozek , Chao Song , Rander Wang , Kuninori Morimoto , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH RESEND 17/31] ASoC: intel/sdw_utils: move rt700 and rt711 codec helper functions Date: Thu, 1 Aug 2024 14:44:32 +0530 Message-ID: <20240801091446.10457-18-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB05.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A0FB:EE_|SA3PR12MB9160:EE_ X-MS-Office365-Filtering-Correlation-Id: 468fefcf-72a9-4e76-a75a-08dcb20b85ed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|7416014|376014|1800799024; X-Microsoft-Antispam-Message-Info: 7E6h8Ao9baRCZbdcbWwyT+dMSxbt4a+VBibIvoIbyIO82qkLvtziOnW98AQ0du62dDqMLdvVG/1yd9XXpREIt5nAuIrf7Ej1JHJQPFeZi/XAw7bUWelXHrLrz+E1VkHjHfDAeBH8SiMxhBQnHwZ8VNLBZVY4A05fqOGq7lxfEMJ/vl2mWAaW7oFmvac9+Sg+kjeSXppaOcMamW8PYRVO1p2+Pz+eNvxtq00MgIMspJ09A1EA2FfFcene/lEEUJhQXatzvNfkBI+kOdvinl9C8E2+4eATSXK5La6luNY/JhmqX3rqBurlrMcUBIWlxxVDRcl0c7k3kFIPhsbb/II3X/Bvt35r7JwWwzoXrrzQ2OCcdjwabCr+tM9mGIrmgCKtSu1CAuOR4/9D1qkgkso4d31ANw3zwYWf82K38sq45uwsKb6qyvgj1/2i7JkbfMnrqxdsbRwAEtCBj8DNeRAxuOQLnnpXRDdosAj8teaq0XSV6uYBFgp96JZHHa5hiC46ViEsbuG4uQTUVeOMzodJVqsUBsm8En3epmP8r8Ajz3GkkHu/llq3iRjld2kFV0ghrGNLiJM11FZoMAcjBjkZzHtsMbP6XpgXh1uJizP8qkGaORRRjXwBx3tMZs11pYdVvSZzhWvwQwXMgXyB0PjwVhYIKXUCZAxWuwNEEIwPZx7d4QaRQ7eK0BB4UhjLYVfGDmtVDxWWk1cFgas+Qm/M8z+9U5KmE8DZ6AEBArPdF/cjsk/NYLpBeWuM7ExkGDkOYOh9XSQMfONN5fmGKXMx4y++pvH5mCYtmJeu+OOWVsrvBZmPRwJwGCW5KpyAKSaTQy/xDiKZ9dEP+u9B4dTO7ZjU5NZJiQQdTbHz6Xq6bZsh5Jn4VAyJ5qxmjhoMjMArmRez01Et6VVwPsjADogSCUHCjF2ssJXH96rT0mT3woILAlxperTLE84/jZ1AAT7ax4QdTbn34ppetH8HwvzNCojIQGAb5kdbm4B9MkXJO9/k62Mv2F1fMshvht3lLdwn5hS+/rT2acWrSoEZXlWXIrjxsKdtdZT4HcT+Cdd9Mp2fA7GRrvqUlfwC15FRixZyGNS9UnU0e0iLyj79SqbnZ+ei1WF6LDL2GOJYKYyW8N16pngjzxMtKuQVCCF2leLS1K6FSkuHVVf3jVTAiAJQ3IKeFUQaAvzkKZE55Su7VYB/wHklbp0aj6ldhQXtXA1QNh3kNdY53ZCJZVILIe4S8CEx6YHqe3SHV3XrWs2n/gzyRLqpmWT+feYyKWkoiCMJm9QcVxTjPqPgdtWSb6PZMkGPlz7VEfFGE1s8zUs62ztQucLYktf8jtUVTvOQL5SwRCrj/BjooAf2cDqbMLQI8wJaMhZW2nwrl1XayGlWa+e4zfMOcttKKx7BnjuWEm4w 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:(13230040)(82310400026)(36860700013)(7416014)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:22:54.0471 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 468fefcf-72a9-4e76-a75a-08dcb20b85ed 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: BL02EPF0001A0FB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB9160 Message-ID-Hash: RCQDTAPUIAUPWPOYRTCMXTJYZQTZD6KT X-Message-ID-Hash: RCQDTAPUIAUPWPOYRTCMXTJYZQTZD6KT X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Move RT700 and RT711 Soundwire codec helper functions to common place holder so that it can be used by other platform machine driver. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 9 +++++++++ sound/soc/intel/boards/Makefile | 1 - sound/soc/intel/boards/sof_sdw_common.h | 9 --------- sound/soc/sdw_utils/Makefile | 1 + .../soc_sdw_rt700.c} | 8 +++++--- .../soc_sdw_rt711.c} | 18 +++++++++++------- 6 files changed, 26 insertions(+), 20 deletions(-) rename sound/soc/{intel/boards/sof_sdw_rt700.c => sdw_utils/soc_sdw_rt700.c} (88%) rename sound/soc/{intel/boards/sof_sdw_rt711.c => sdw_utils/soc_sdw_rt711.c} (85%) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index 6b6bab8d3310..3e55cac33176 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -85,6 +85,13 @@ const char *asoc_sdw_get_codec_name(struct device *dev, /* DMIC support */ int asoc_sdw_dmic_init(struct snd_soc_pcm_runtime *rtd); +/* RT711 support */ +int asoc_sdw_rt711_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback); +int asoc_sdw_rt711_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); + /* RT711-SDCA support */ int asoc_sdw_rt_sdca_jack_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, @@ -95,6 +102,8 @@ int asoc_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_lin /* dai_link init callbacks */ int asoc_sdw_rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_rt700_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile index 0f1b2c288162..9f92f49cc517 100644 --- a/sound/soc/intel/boards/Makefile +++ b/sound/soc/intel/boards/Makefile @@ -37,7 +37,6 @@ snd-soc-sof-ssp-amp-y := sof_ssp_amp.o snd-soc-sof-sdw-y += sof_sdw.o \ sof_sdw_maxim.o sof_sdw_rt_amp.o \ bridge_cs35l56.o \ - sof_sdw_rt700.o sof_sdw_rt711.o \ sof_sdw_cs42l42.o sof_sdw_cs42l43.o \ sof_sdw_cs_amp.o \ sof_sdw_hdmi.o diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index af656716c9d2..1d7e6df02247 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -89,13 +89,6 @@ int sof_sdw_hdmi_init(struct snd_soc_pcm_runtime *rtd); int sof_sdw_hdmi_card_late_probe(struct snd_soc_card *card); -/* RT711 support */ -int asoc_sdw_rt711_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback); -int asoc_sdw_rt711_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); - /* RT1308 I2S support */ extern const struct snd_soc_ops soc_sdw_rt1308_i2s_ops; @@ -142,8 +135,6 @@ int asoc_sdw_cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_so int asoc_sdw_cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int asoc_sdw_rt700_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int asoc_sdw_rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); #endif diff --git a/sound/soc/sdw_utils/Makefile b/sound/soc/sdw_utils/Makefile index 68b8fddeb77e..20516094f453 100644 --- a/sound/soc/sdw_utils/Makefile +++ b/sound/soc/sdw_utils/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only snd-soc-sdw-utils-y := soc_sdw_utils.o soc_sdw_dmic.o soc_sdw_rt_dmic.o \ + soc_sdw_rt700.o soc_sdw_rt711.o \ soc_sdw_rt712_sdca.o soc_sdw_rt722_sdca.o \ soc_sdw_rt5682.o soc_sdw_rt_sdca_jack_common.o obj-$(CONFIG_SND_SOC_SDW_UTILS) += snd-soc-sdw-utils.o diff --git a/sound/soc/intel/boards/sof_sdw_rt700.c b/sound/soc/sdw_utils/soc_sdw_rt700.c similarity index 88% rename from sound/soc/intel/boards/sof_sdw_rt700.c rename to sound/soc/sdw_utils/soc_sdw_rt700.c index 0abaaeacfd90..4dbeeeca3434 100644 --- a/sound/soc/intel/boards/sof_sdw_rt700.c +++ b/sound/soc/sdw_utils/soc_sdw_rt700.c @@ -1,8 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-only +// This file incorporates work covered by the following copyright notice: // Copyright (c) 2020 Intel Corporation +// Copyright (c) 2024 Advanced Micro Devices, Inc. /* - * sof_sdw_rt700 - Helpers to handle RT700 from generic machine driver + * soc_sdw_rt700 - Helpers to handle RT700 from generic machine driver */ #include @@ -13,7 +15,7 @@ #include #include #include -#include "sof_sdw_common.h" +#include static const struct snd_soc_dapm_route rt700_map[] = { /* Headphones */ @@ -83,4 +85,4 @@ int asoc_sdw_rt700_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai return ret; } -MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); +EXPORT_SYMBOL_NS(asoc_sdw_rt700_rtd_init, SND_SOC_SDW_UTILS); diff --git a/sound/soc/intel/boards/sof_sdw_rt711.c b/sound/soc/sdw_utils/soc_sdw_rt711.c similarity index 85% rename from sound/soc/intel/boards/sof_sdw_rt711.c rename to sound/soc/sdw_utils/soc_sdw_rt711.c index fb5bc611b5e7..38b4126dd45f 100644 --- a/sound/soc/intel/boards/sof_sdw_rt711.c +++ b/sound/soc/sdw_utils/soc_sdw_rt711.c @@ -1,8 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-only +// This file incorporates work covered by the following copyright notice: // Copyright (c) 2020 Intel Corporation +// Copyright (c) 2024 Advanced Micro Devices, Inc. /* - * sof_sdw_rt711 - Helpers to handle RT711 from generic machine driver + * soc_sdw_rt711 - Helpers to handle RT711 from generic machine driver */ #include @@ -15,21 +17,21 @@ #include #include #include -#include "sof_sdw_common.h" +#include /* * Note this MUST be called before snd_soc_register_card(), so that the props * are in place before the codec component driver's probe function parses them. */ -static int rt711_add_codec_device_props(struct device *sdw_dev) +static int rt711_add_codec_device_props(struct device *sdw_dev, unsigned long quirk) { struct property_entry props[SOC_SDW_MAX_NO_PROPS] = {}; struct fwnode_handle *fwnode; int ret; - if (!SOC_SDW_JACK_JDSRC(sof_sdw_quirk)) + if (!SOC_SDW_JACK_JDSRC(quirk)) return 0; - props[0] = PROPERTY_ENTRY_U32("realtek,jd-src", SOC_SDW_JACK_JDSRC(sof_sdw_quirk)); + props[0] = PROPERTY_ENTRY_U32("realtek,jd-src", SOC_SDW_JACK_JDSRC(quirk)); fwnode = fwnode_create_software_node(props, NULL); if (IS_ERR(fwnode)) @@ -110,6 +112,7 @@ int asoc_sdw_rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai return ret; } +EXPORT_SYMBOL_NS(asoc_sdw_rt711_rtd_init, SND_SOC_SDW_UTILS); int asoc_sdw_rt711_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) { @@ -123,6 +126,7 @@ int asoc_sdw_rt711_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_ return 0; } +EXPORT_SYMBOL_NS(asoc_sdw_rt711_exit, SND_SOC_SDW_UTILS); int asoc_sdw_rt711_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, @@ -144,7 +148,7 @@ int asoc_sdw_rt711_init(struct snd_soc_card *card, if (!sdw_dev) return -EPROBE_DEFER; - ret = rt711_add_codec_device_props(sdw_dev); + ret = rt711_add_codec_device_props(sdw_dev, ctx->mc_quirk); if (ret < 0) { put_device(sdw_dev); return ret; @@ -153,4 +157,4 @@ int asoc_sdw_rt711_init(struct snd_soc_card *card, return 0; } -MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); +EXPORT_SYMBOL_NS(asoc_sdw_rt711_init, SND_SOC_SDW_UTILS); From patchwork Thu Aug 1 09:14:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816069 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 (unknown [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 788D3C3DA7F for ; Thu, 1 Aug 2024 09:37:07 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 35A993D29; Thu, 1 Aug 2024 11:36:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 35A993D29 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722504995; bh=mO7YQ+kpTp1+yWnA682z7NdxMzu/Rh2XK0nHxXaUbVI=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=mqNSY5d9VC72YqizOtlBfdgsGjB/+XwwWrEDwmSaTlr9FnG+aof3UV6qrd2nkXNFx 1+SFB5Fme/27ebb5tAHvQNMhhI+81JkVuZ+eGY6yb2gZRcXE0ylkNzIB4SfMxhQSYT ViRPyJdh6uV7xwPUVezqPd9dkJ3agvhcU7dakYtg= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5135BF805D4; Thu, 1 Aug 2024 11:35:48 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id CE023F80605; Thu, 1 Aug 2024 11:35:47 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BDC32F8019B; Thu, 1 Aug 2024 11:23:38 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on20608.outbound.protection.outlook.com [IPv6:2a01:111:f400:7ea9::608]) (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 A843AF8019B for ; Thu, 1 Aug 2024 11:23:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A843AF8019B Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=1ssoJ5Qa ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=c96n+RTVu5JEXP85QD3XogJRnNNHynrHCZy/U/pxFnl8sEDIoBjJxmo6OiiN5UJAdVYVHzfmxEn1qKLilt//G4ZPjcuHzlM0Q4l9hckUajEOi/+LDAiSCdI+zZBvB3nWi+m85VQGUELcMtApv7uUu3kpE2cqO0PPM4pW+1cNx+s/8wdQLNDQv/Z9qrtfoxyI8P2lM5aUHldRcKwVL6JS57uuF0j29lYYNZ3JYDNGMzlyw1yL6NceQBidQmYuX+xjDiv10D7PdR4CfAFOiZDw1lWSj7iKe8/H4FxeSungD5d2nTR/gT3yxjwegt51r/Psifa8cM5zeyPBFX/IlJpDQQ== 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=qbozI4ddjgSv9+7bNOMeGoYJHbEvkkiHespHtCIOw/0=; b=d4ym223ie8YPnsJYhwzXmtkNUQmZwyiE+iDurUHMrVMEFCF3X2DmTrXTSF5auGuSrxWHTUPv2ZhljAAJ2eXzaY80+HSMBWhuES7bPWcuEKSY6xNbR0a2d2XjkOH1A/L1evHMcfouohNz9XUmMHzv9IZyyssBg23ZPUGOpvXzJ1NbEaaCongHN7RU0ngyYRPzJEzFEFXfysBV2OJeoJHKQvc/CrhO3QlBcorTlUQLx0XxaX0lhv1P/mQzzNsRkxohOCjMvewzP3giaIGB0eLIlhoDhtA6J2n3E0cJKdYDg8i1Kq5JOwNp46avb9/gnP1cbR8M/SAB3C+fYEmxHO0+WA== 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=qbozI4ddjgSv9+7bNOMeGoYJHbEvkkiHespHtCIOw/0=; b=1ssoJ5QapYkewENGexsp/kP1eYmQdXtE+7FpsQpnLKIAF4d6BF4tAPk0EpdS8EnGsty/g35jnoH9YVzapSU9E3vZJ/MQN85i+c8Ay56DM2l+KryLrH7q/+nI7KPQrR9pqGMDpxvGgtpz0Ocv1q41L4oYZLJq5D3ZuWhYk+/3sSA= Received: from BL0PR1501CA0024.namprd15.prod.outlook.com (2603:10b6:207:17::37) by BY5PR12MB4097.namprd12.prod.outlook.com (2603:10b6:a03:213::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Thu, 1 Aug 2024 09:23:29 +0000 Received: from BL02EPF0001A0FE.namprd03.prod.outlook.com (2603:10b6:207:17:cafe::bf) by BL0PR1501CA0024.outlook.office365.com (2603:10b6:207:17::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.28 via Frontend Transport; Thu, 1 Aug 2024 09:23:29 +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 BL02EPF0001A0FE.mail.protection.outlook.com (10.167.242.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:23:29 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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.2507.39; Thu, 1 Aug 2024 04:23:28 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:23:20 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Brent Lu , Charles Keepax , Maciej Strozek , Chao Song , Christophe JAILLET , Kuninori Morimoto , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH RESEND 18/31] ASoC: intel/sdw_utils: move rtk amp codec helper functions Date: Thu, 1 Aug 2024 14:44:33 +0530 Message-ID: <20240801091446.10457-19-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A0FE:EE_|BY5PR12MB4097:EE_ X-MS-Office365-Filtering-Correlation-Id: f313ab96-ea8e-4e5e-5da4-08dcb20b9ae8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|1800799024|36860700013|82310400026|376014; X-Microsoft-Antispam-Message-Info: iTUiVwy1PhJQyHrJd8eZaHnYycOEci4Xo6vk/rLhZfgDKn0YHuggy0KZfhv3vDc4bCkubXArmlE4nOo+SlxOWJyNz3q04i0VBpvyUq1X302xSXsDqDCPyhebkR1x/K4uPr5PwdXXtPnXlcdHwPnEE+FAvQdxP3UTa+vt5dh5ZSTarXDcsycsrkDgN+SU7NX+J9gbGalxlKQZbdcWKkCMlLeWrjlkpPeMUKrzQ4YrhtzWCLa3Dd2KlVDK4D+PU2ErDjst5R6UaFLNvlRr92Y166BrIUaug1aypk6pqm4by9frdcuotcn8EBCpjs2IFMddavbcEaQ8Snvpg97uu3GZh+Oq/A5wmpeT5d2p8gLlH4Af1KZbdpeXeGSGg7jdVTOLlnYpr9hRxWZ4cWDEu2voJuPyiXQQOOWYMtxs0SYK7e/lEcLjdS5e9vSNkEb+FSh8MSA6eXI0LkhsVyl/7sfYvYVolynD0tnb0s6LMCnKXaZhDtNDLrsRfMs1XJoHQmETC2zSeQKUVhBFzHFfctd3rOII8BkM6q3nBAe7t0T+wcyI4pb5PkXjfjxUwlMC51/SiSU7iHyJKdZEbh9ymgANvJlnYrfLDtbVdnf9ejnE+UZP++QUiMkTTeCP3rci9P8NwB4YuWQy187GswUOyidXAWdFGBdiQdE5s3pe9g9cVCv9T6W7hUEaSMUPenHfnjLJxnyev/URyz1WSMbEXluNCX4wRwFZluZkmzOxv6q0jZt5PpHyDCdkFqyTXx2Aju4BgJ05uxawizntAWCiLDSsW3Mqv3mUBKUnS1d2Sow2M5pLh1sOtEQhAci79xqNagKJmkKcdN6QDC1YdEp73NC7JOdOKsl8aa6Zu5TCeTKV4EoQJ+/QYfaTrFccRR7dKMF+zlS3bngx+N12K4h6EsWikSm89qvdcf4zR6gJnAJ/V4ZFlUu5Qx3TnkzN3bO1cmX8MI4dtXgqgT47B/yiHEgIrNBSdLiO2Ryvi1uaT6svi1M5KlZ+/dCUqU3s+Iaj8/SpoR470OsmCd5rvu73wmQ0U5nK5CgewgfaufuZve9hkJaWmmHW4xuJCemENS2FxGP7g9iqDN7RiQTNHplap0W9IX5j0i0tFCzDJJwuCWxep5GhLlneNJAPBLcFpfAp2ujFnwuOhtTV1TPtFFuHJpQuxhUUuRMQtne7I97T8hf/BunuDA51t846akyHmnxnVwNjdXSmHvH7g6Sm41Hwfcm1O7UMg8YZzmT/k0XyCsBOse+1twYtWURqf5SP1JjzMSD/eC/Bf77yPXGMwtIBgMs0TDfUfUXv92MOqz+rk+Fc+MJuy8GAkKSgivvQGh/QgKVf9bTzm4wOHelsk65vb2nvFLAxvwmZ9YNz6lEQRQ0yrwZZKhqgGg5nw7AsdCAcNwWu 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:(13230040)(7416014)(1800799024)(36860700013)(82310400026)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:23:29.2446 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f313ab96-ea8e-4e5e-5da4-08dcb20b9ae8 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: BL02EPF0001A0FE.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4097 Message-ID-Hash: 6SGMQFD7SFVYS2YCAI7C6JRCA2MUMC4S X-Message-ID-Hash: 6SGMQFD7SFVYS2YCAI7C6JRCA2MUMC4S X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Move RTK amp codec helper functions related implementation to common place holder to make it generic so that these helper functions will be used by other platform machine driver modules. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 11 +++++++++++ sound/soc/intel/boards/Makefile | 2 +- sound/soc/intel/boards/sof_sdw_common.h | 11 ----------- sound/soc/sdw_utils/Makefile | 3 ++- .../soc_sdw_rt_amp.c} | 14 ++++++++++---- .../soc_sdw_rt_amp_coeff_tables.h} | 6 +++--- 6 files changed, 27 insertions(+), 20 deletions(-) rename sound/soc/{intel/boards/sof_sdw_rt_amp.c => sdw_utils/soc_sdw_rt_amp.c} (93%) rename sound/soc/{intel/boards/sof_sdw_amp_coeff_tables.h => sdw_utils/soc_sdw_rt_amp_coeff_tables.h} (97%) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index 3e55cac33176..450542eb3ea0 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -99,9 +99,20 @@ int asoc_sdw_rt_sdca_jack_init(struct snd_soc_card *card, bool playback); int asoc_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); +/* RT1308 I2S support */ +extern const struct snd_soc_ops soc_sdw_rt1308_i2s_ops; + +/* generic amp support */ +int asoc_sdw_rt_amp_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback); +int asoc_sdw_rt_amp_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); + /* dai_link init callbacks */ int asoc_sdw_rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt700_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile index 9f92f49cc517..70c56bdc180c 100644 --- a/sound/soc/intel/boards/Makefile +++ b/sound/soc/intel/boards/Makefile @@ -35,7 +35,7 @@ snd-soc-skl_nau88l25_ssm4567-y := skl_nau88l25_ssm4567.o snd-soc-ehl-rt5660-y := ehl_rt5660.o snd-soc-sof-ssp-amp-y := sof_ssp_amp.o snd-soc-sof-sdw-y += sof_sdw.o \ - sof_sdw_maxim.o sof_sdw_rt_amp.o \ + sof_sdw_maxim.o \ bridge_cs35l56.o \ sof_sdw_cs42l42.o sof_sdw_cs42l43.o \ sof_sdw_cs_amp.o \ diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index 1d7e6df02247..7f856c6018aa 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -89,16 +89,6 @@ int sof_sdw_hdmi_init(struct snd_soc_pcm_runtime *rtd); int sof_sdw_hdmi_card_late_probe(struct snd_soc_card *card); -/* RT1308 I2S support */ -extern const struct snd_soc_ops soc_sdw_rt1308_i2s_ops; - -/* generic amp support */ -int asoc_sdw_rt_amp_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback); -int asoc_sdw_rt_amp_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); - /* MAXIM codec support */ int asoc_sdw_maxim_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, @@ -135,6 +125,5 @@ int asoc_sdw_cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_so int asoc_sdw_cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int asoc_sdw_rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); #endif diff --git a/sound/soc/sdw_utils/Makefile b/sound/soc/sdw_utils/Makefile index 20516094f453..7851af9b8593 100644 --- a/sound/soc/sdw_utils/Makefile +++ b/sound/soc/sdw_utils/Makefile @@ -2,5 +2,6 @@ snd-soc-sdw-utils-y := soc_sdw_utils.o soc_sdw_dmic.o soc_sdw_rt_dmic.o \ soc_sdw_rt700.o soc_sdw_rt711.o \ soc_sdw_rt712_sdca.o soc_sdw_rt722_sdca.o \ - soc_sdw_rt5682.o soc_sdw_rt_sdca_jack_common.o + soc_sdw_rt5682.o soc_sdw_rt_sdca_jack_common.o \ + soc_sdw_rt_amp.o obj-$(CONFIG_SND_SOC_SDW_UTILS) += snd-soc-sdw-utils.o diff --git a/sound/soc/intel/boards/sof_sdw_rt_amp.c b/sound/soc/sdw_utils/soc_sdw_rt_amp.c similarity index 93% rename from sound/soc/intel/boards/sof_sdw_rt_amp.c rename to sound/soc/sdw_utils/soc_sdw_rt_amp.c index fff746671c1d..42be01405ab4 100644 --- a/sound/soc/intel/boards/sof_sdw_rt_amp.c +++ b/sound/soc/sdw_utils/soc_sdw_rt_amp.c @@ -1,8 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-only +// This file incorporates work covered by the following copyright notice: // Copyright (c) 2022 Intel Corporation +// Copyright (c) 2024 Advanced Micro Devices, Inc. /* - * sof_sdw_rt_amp - Helpers to handle RT1308/RT1316/RT1318 from generic machine driver + * soc_sdw_rt_amp - Helpers to handle RT1308/RT1316/RT1318 from generic machine driver */ #include @@ -14,9 +16,9 @@ #include #include #include -#include "sof_sdw_common.h" -#include "sof_sdw_amp_coeff_tables.h" -#include "../../codecs/rt1308.h" +#include +#include "soc_sdw_rt_amp_coeff_tables.h" +#include "../codecs/rt1308.h" #define CODEC_NAME_SIZE 7 @@ -199,6 +201,7 @@ int asoc_sdw_rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc return ret; } +EXPORT_SYMBOL_NS(asoc_sdw_rt_amp_spk_rtd_init, SND_SOC_SDW_UTILS); static int rt1308_i2s_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) @@ -236,6 +239,7 @@ static int rt1308_i2s_hw_params(struct snd_pcm_substream *substream, const struct snd_soc_ops soc_sdw_rt1308_i2s_ops = { .hw_params = rt1308_i2s_hw_params, }; +EXPORT_SYMBOL_NS(soc_sdw_rt1308_i2s_ops, SND_SOC_SDW_UTILS); int asoc_sdw_rt_amp_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) { @@ -253,6 +257,7 @@ int asoc_sdw_rt_amp_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai return 0; } +EXPORT_SYMBOL_NS(asoc_sdw_rt_amp_exit, SND_SOC_SDW_UTILS); int asoc_sdw_rt_amp_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, @@ -295,3 +300,4 @@ int asoc_sdw_rt_amp_init(struct snd_soc_card *card, return 0; } +EXPORT_SYMBOL_NS(asoc_sdw_rt_amp_init, SND_SOC_SDW_UTILS); diff --git a/sound/soc/intel/boards/sof_sdw_amp_coeff_tables.h b/sound/soc/sdw_utils/soc_sdw_rt_amp_coeff_tables.h similarity index 97% rename from sound/soc/intel/boards/sof_sdw_amp_coeff_tables.h rename to sound/soc/sdw_utils/soc_sdw_rt_amp_coeff_tables.h index 4a3e6fdbd623..4803d134d071 100644 --- a/sound/soc/intel/boards/sof_sdw_amp_coeff_tables.h +++ b/sound/soc/sdw_utils/soc_sdw_rt_amp_coeff_tables.h @@ -2,11 +2,11 @@ */ /* - * sof_sdw_amp_coeff_tables.h - related coefficients for amplifier parameters + * soc_sdw_rt_amp_coeff_tables.h - related coefficients for RTK amplifier parameters */ -#ifndef SND_SOC_SOF_SDW_AMP_COEFF_H -#define SND_SOC_SOF_SDW_AMP_COEFF_H +#ifndef SND_SOC_SDW_RT_SDW_AMP_COEFF_H +#define SND_SOC_SDW_RT_SDW_AMP_COEFF_H #define RT1308_MAX_BQ_REG 480 #define RT1316_MAX_BQ_REG 580 From patchwork Thu Aug 1 09:14:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816294 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 (unknown [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 16F94C3DA4A for ; Thu, 1 Aug 2024 09:37:25 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0E9F63958; Thu, 1 Aug 2024 11:36:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0E9F63958 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722505015; bh=99tx3e05MDyfL4o7hhPthNzNR7WFUko4pk2+NFAhRmc=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bMFAe99/iG1OhJctFJl0RZyJ+szxkNpUHti1cBi0Yfr94wjIqrUSi8a6foFE1NRMa N/bezs/ZkRyKNapQNqRfWCVSZSRPzaedX89YhmppcEUFJXQpOWdp/2I2qpyFsc93qQ Q5mmhMmPfeFYkwQ+VY8UyZEFzIsilKKDq8kOWCIQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 36018F80615; Thu, 1 Aug 2024 11:36:00 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 45E7DF805C7; Thu, 1 Aug 2024 11:35:59 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 15771F8026A; Thu, 1 Aug 2024 11:24:35 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on20625.outbound.protection.outlook.com [IPv6:2a01:111:f403:2407::625]) (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 3E5C9F8007E for ; Thu, 1 Aug 2024 11:24:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3E5C9F8007E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=W0y8WmOP ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OHEnjYTNcCZDTrodUVAHPNmarlXVViMU1pRwlk0RyLC1dUr/ht+qrnVlJZOwmuziypPzZfl+8T0e5pcMcQxB/8faZMvaw8gveJc2bz2xJWyuW49X48RDEEnXww8/ZfCPvoid/2P1UWg8mWTc3DCyNvmTVQIRDmmy/3mjqJPLOkhkvqUfz6eU7JyO1WpjIxFkXsAiXOlRwTQGcRbG487PvSfddFuhR5eSqdx0A1jO7XVlSY+16gx1UMInSPlCNEYbvZcdyYu6U6DNkMbForl0p0AhIfjy0CIqRMjXrCy3tVg2oqJuCZg0ihJyvY1Xz8x4heXPVQeUeRWl7bMk8Kg1qg== 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=we75CDPL7ANvzTnjyftxd/aOT+5qqjwvgSAZNMOidSo=; b=GT6lSe381cLvKm9P6/7qa8OgpXK240IdxjCy17W7l/LcUsopBi9cKL6qVEyEWRw6M+1vk2xf0tVL7mzxSIRmI7gHOWcvYXE5PHKv2XJNAY4wkk0pvdcVK1c95YF4y9oaPMfUer8M9419bq1+a8i+4LezUr2ZkJGeP2cxaVJ4FULpm3m/oT0GydDgi9eOcUaGwYdIU3/UmCqgDI1/Wck8nuGG+rlgE+kJPa7odsYUJvyg67eeSyEuoWdOQeIGYQIlyMaZp78Q6I8WR85uhTISBApkfGU/Llcn/FC8uRr6tJACBZIkEqlSW6orffMsAh8AFDNY5luBqIzdCLFnKuQhnQ== 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=we75CDPL7ANvzTnjyftxd/aOT+5qqjwvgSAZNMOidSo=; b=W0y8WmOPT5g5+3LwrLoL4xgb1hqehEz2Ehke51fKKoGh+ilyN4BEyMObnWzqjaaw10cxGoEw9OqP8C/C+WcU0VbBMbLaU44hXHErhuq+BCoGJOfdYFPR56gGIvmPqCqme9KtzjEefO2nsksVrbQq4iOSPT65ORcJhhVg50Mswdc= Received: from DM6PR14CA0041.namprd14.prod.outlook.com (2603:10b6:5:18f::18) by MW4PR12MB6952.namprd12.prod.outlook.com (2603:10b6:303:207::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Thu, 1 Aug 2024 09:24:25 +0000 Received: from DS1PEPF00017091.namprd03.prod.outlook.com (2603:10b6:5:18f:cafe::38) by DM6PR14CA0041.outlook.office365.com (2603:10b6:5:18f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29 via Frontend Transport; Thu, 1 Aug 2024 09:24:25 +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 DS1PEPF00017091.mail.protection.outlook.com (10.167.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:24:25 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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; Thu, 1 Aug 2024 04:24:24 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 1 Aug 2024 04:24:23 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:24:16 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Brent Lu , Charles Keepax , Maciej Strozek , Chao Song , Rander Wang , jairaj-arava , Kuninori Morimoto , Richard Fitzgerald , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH RESEND 19/31] ASoC: intel/sdw_utils: move cirrus soundwire codec helper functions Date: Thu, 1 Aug 2024 14:44:34 +0530 Message-ID: <20240801091446.10457-20-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017091:EE_|MW4PR12MB6952:EE_ X-MS-Office365-Filtering-Correlation-Id: fd0312fa-fcbc-45f8-af2c-08dcb20bbc2c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|376014|82310400026|1800799024|7416014; X-Microsoft-Antispam-Message-Info: Z5xyOjRQoD8R9EASiXehDYhmMoYdGjyQs3Mf7MCQlXETLdfxuKFeVdF0HKmhPX+/OEz5h/PN/AY8mg+BDZ7JUHmTvV5kg21WYGuKQxFtXfrwR5B3bUqbvRRlJEDXLtiN+rs+NCXQYjb2CwSR6GpoVjWld3Ja7Bbt7gsIYt8QyOFLnx6D2dN9aDbObmnEn2GuX8r31sI41ByFTAB1Wn/x3Me2ejjVl/cS6apnYOK9MtICE4f155Pnh7PLrT3sHUWExPAZSmBxnjU4fCu/8WJ7t7I+iYpRCtvSbLYS/rMHcBNdfQrImwoQm8dDVe1TBnlB4Viw+MKxMm1SLP/neUSd5GnqQrk5KB7ml2EYmEdM3or8vR0H5Z8faoiirJRtU8ryBwEDIJgbXg+9/CKJwL7W9kj+D0iX1Wot171pB749nBtR1mTcsJcskS1Im2OLDyN/79xAWLNy9FKF0yM1hmtY46L2oc9Z6ZmB3snJ3zOe6SCxNMS0U/x/DXquH/uZjqO6o/7IcHMq5iaqml+Ij37S6diHhCX5B8c9L8FLSG2Ou8wE0dfIcz+RlkXkoep627s3KfTVrBSQy5kyQnsxB4e9oIqFbJWbWVl3Brw1lWe6wY1CSlObgy2I1KNgK7Zsclvkhm08X48km7p0jGGv1BCIZGoycVInTSz7fyYddbhow7iL1wp1GXQRfKjq3gmx4+T/9socWfm6b782ybptd5kAX2s3WTnzBpkA0GmIVy1sIRhCK6TWSeRYBYZSo01wpWXVDjW+u2INorFbvi5RqAUEAPs6vuNdJdxR6aUkFNSyrj2YpBh7HY4nBnl4Y3NgPG3gZR/YKrhfgHDsgBL0uF50vE8Rkz0imRgBZFBVLnlPNM3fYuYT/eNJcyqXpzFXNrwd/hbtQtWoHSyPwXxILAZcyLUxixBvGhUw3ISjcNE+ElRWeqVcPFxmTU4/BE4Iyd7K4xAFzlpd/Ayy8tm1LXVoA6GATKS5b7im9AaHOMIye92Zga3YSGrN9UlUUbCXn/bXHv5or+hFsMAnNWXcZi3fVasb5h2dEq5HSZmX7WGZg8dpAOq3CJInfWE543QJ2BiaDGb6lE0mG41U2EInXa1HatweUil9OqBFUs0rJ/1aLutDuWGKoYoxCJ0a3EHc3ol64zGnOM16ZXVpJVLcq8BXNHek5APGYSuFpjMR+Y7xHUallSkCJCdOCrBTq1SfDDTB13nXJEJ2C00UxLte+dv2iNrtDr+ASSMYjzmrV8thDtPc01hOF82OXHSUQuJVdIHASjLY4tzc7OHPQVOIHME385JluEE5JxZi7ZIBnHEMRbT8CASmI/eC2p0OZz6iyojKcyoKanGQTlSG3nY44m72/4O+RD6yP6EcJ0piTfLBIK30G3rK0d3wD2s5bhQX5n/kVE2air+xLOZjXEGrNVXmCA== 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)(7416014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:24:25.0103 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fd0312fa-fcbc-45f8-af2c-08dcb20bbc2c 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: DS1PEPF00017091.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6952 Message-ID-Hash: ZDLAFEWNFRFYJSIECH42TL4LLTBKAB6M X-Message-ID-Hash: ZDLAFEWNFRFYJSIECH42TL4LLTBKAB6M X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: To make it generic, move Cirrus Soundwire codec helper functions to common place holder so that it can be used by other platform machine driver. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 40 +++++++++++++++++++ sound/soc/intel/boards/Makefile | 3 -- sound/soc/intel/boards/sof_sdw_common.h | 39 ------------------ sound/soc/sdw_utils/Makefile | 5 ++- .../soc_sdw_bridge_cs35l56.c} | 38 ++++++++++++------ .../soc_sdw_cs42l42.c} | 9 +++-- .../soc_sdw_cs42l43.c} | 20 ++++++---- .../soc_sdw_cs_amp.c} | 8 +++- 8 files changed, 94 insertions(+), 68 deletions(-) rename sound/soc/{intel/boards/bridge_cs35l56.c => sdw_utils/soc_sdw_bridge_cs35l56.c} (73%) rename sound/soc/{intel/boards/sof_sdw_cs42l42.c => sdw_utils/soc_sdw_cs42l42.c} (88%) rename sound/soc/{intel/boards/sof_sdw_cs42l43.c => sdw_utils/soc_sdw_cs42l43.c} (85%) rename sound/soc/{intel/boards/sof_sdw_cs_amp.c => sdw_utils/soc_sdw_cs_amp.c} (80%) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index 450542eb3ea0..d5dd887b9d15 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -16,6 +16,19 @@ #define SOC_SDW_MAX_NO_PROPS 2 #define SOC_SDW_JACK_JDSRC(quirk) ((quirk) & GENMASK(3, 0)) +/* If a CODEC has an optional speaker output, this quirk will enable it */ +#define SOC_SDW_CODEC_SPKR BIT(15) +/* + * If the CODEC has additional devices attached directly to it. + * + * For the cs42l43: + * - 0 - No speaker output + * - SOC_SDW_CODEC_SPKR - CODEC internal speaker + * - SOC_SDW_SIDECAR_AMPS - 2x Sidecar amplifiers + CODEC internal speaker + * - SOC_SDW_CODEC_SPKR | SOF_SIDECAR_AMPS - Not currently supported + */ +#define SOC_SDW_SIDECAR_AMPS BIT(16) + struct asoc_sdw_codec_info; struct asoc_sdw_dai_info { @@ -109,6 +122,28 @@ int asoc_sdw_rt_amp_init(struct snd_soc_card *card, bool playback); int asoc_sdw_rt_amp_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); +/* CS42L43 support */ +int asoc_sdw_cs42l43_spk_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback); + +/* CS AMP support */ +int asoc_sdw_bridge_cs35l56_count_sidecar(struct snd_soc_card *card, + int *num_dais, int *num_devs); +int asoc_sdw_bridge_cs35l56_add_sidecar(struct snd_soc_card *card, + struct snd_soc_dai_link **dai_links, + struct snd_soc_codec_conf **codec_conf); +int asoc_sdw_bridge_cs35l56_spk_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback); + +int asoc_sdw_cs_amp_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback); + /* dai_link init callbacks */ int asoc_sdw_rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); @@ -118,5 +153,10 @@ int asoc_sdw_rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai int asoc_sdw_rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); #endif diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile index 70c56bdc180c..1ee903e12249 100644 --- a/sound/soc/intel/boards/Makefile +++ b/sound/soc/intel/boards/Makefile @@ -36,9 +36,6 @@ snd-soc-ehl-rt5660-y := ehl_rt5660.o snd-soc-sof-ssp-amp-y := sof_ssp_amp.o snd-soc-sof-sdw-y += sof_sdw.o \ sof_sdw_maxim.o \ - bridge_cs35l56.o \ - sof_sdw_cs42l42.o sof_sdw_cs42l43.o \ - sof_sdw_cs_amp.o \ sof_sdw_hdmi.o obj-$(CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH) += snd-soc-sof_rt5682.o obj-$(CONFIG_SND_SOC_INTEL_SOF_CS42L42_MACH) += snd-soc-sof_cs42l42.o diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index 7f856c6018aa..b95daa32e343 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -52,18 +52,6 @@ enum { #define SOF_SSP_GET_PORT(quirk) (((quirk) >> 7) & GENMASK(5, 0)) /* Deprecated and no longer supported by the code */ #define SOC_SDW_NO_AGGREGATION BIT(14) -/* If a CODEC has an optional speaker output, this quirk will enable it */ -#define SOC_SDW_CODEC_SPKR BIT(15) -/* - * If the CODEC has additional devices attached directly to it. - * - * For the cs42l43: - * - 0 - No speaker output - * - SOC_SDW_CODEC_SPKR - CODEC internal speaker - * - SOC_SDW_SIDECAR_AMPS - 2x Sidecar amplifiers + CODEC internal speaker - * - SOC_SDW_CODEC_SPKR | SOC_SDW_SIDECAR_AMPS - Not currently supported - */ -#define SOC_SDW_SIDECAR_AMPS BIT(16) /* BT audio offload: reserve 3 bits for future */ #define SOF_BT_OFFLOAD_SSP_SHIFT 15 @@ -95,35 +83,8 @@ int asoc_sdw_maxim_init(struct snd_soc_card *card, struct asoc_sdw_codec_info *info, bool playback); -/* CS42L43 support */ -int asoc_sdw_cs42l43_spk_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback); - -/* CS AMP support */ -int asoc_sdw_bridge_cs35l56_count_sidecar(struct snd_soc_card *card, - int *num_dais, int *num_devs); -int asoc_sdw_bridge_cs35l56_add_sidecar(struct snd_soc_card *card, - struct snd_soc_dai_link **dai_links, - struct snd_soc_codec_conf **codec_conf); -int asoc_sdw_bridge_cs35l56_spk_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback); - -int asoc_sdw_cs_amp_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback); - /* dai_link init callbacks */ -int asoc_sdw_cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int asoc_sdw_cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int asoc_sdw_cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int asoc_sdw_cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); -int asoc_sdw_cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); #endif diff --git a/sound/soc/sdw_utils/Makefile b/sound/soc/sdw_utils/Makefile index 7851af9b8593..c15b08f3ab0b 100644 --- a/sound/soc/sdw_utils/Makefile +++ b/sound/soc/sdw_utils/Makefile @@ -3,5 +3,8 @@ snd-soc-sdw-utils-y := soc_sdw_utils.o soc_sdw_dmic.o soc_sdw_rt_dmic.o \ soc_sdw_rt700.o soc_sdw_rt711.o \ soc_sdw_rt712_sdca.o soc_sdw_rt722_sdca.o \ soc_sdw_rt5682.o soc_sdw_rt_sdca_jack_common.o \ - soc_sdw_rt_amp.o + soc_sdw_rt_amp.o \ + soc_sdw_bridge_cs35l56.o \ + soc_sdw_cs42l42.o soc_sdw_cs42l43.o \ + soc_sdw_cs_amp.o obj-$(CONFIG_SND_SOC_SDW_UTILS) += snd-soc-sdw-utils.o diff --git a/sound/soc/intel/boards/bridge_cs35l56.c b/sound/soc/sdw_utils/soc_sdw_bridge_cs35l56.c similarity index 73% rename from sound/soc/intel/boards/bridge_cs35l56.c rename to sound/soc/sdw_utils/soc_sdw_bridge_cs35l56.c index 55e5cfbb2f14..fcc3ef685af7 100644 --- a/sound/soc/intel/boards/bridge_cs35l56.c +++ b/sound/soc/sdw_utils/soc_sdw_bridge_cs35l56.c @@ -1,6 +1,11 @@ // SPDX-License-Identifier: GPL-2.0-only -// -// Intel SOF Machine Driver with Cirrus Logic CS35L56 Smart Amp +// This file incorporates work covered by the following copyright notice: +// Copyright (c) 2024 Intel Corporation +// Copyright (c) 2024 Advanced Micro Devices, Inc. + +/* + * soc_sdw_bridge_cs35l56 - codec helper functions for handling CS35L56 Smart AMP + */ #include #include @@ -9,7 +14,7 @@ #include #include #include -#include "sof_sdw_common.h" +#include static const struct snd_soc_dapm_widget bridge_widgets[] = { SND_SOC_DAPM_SPK("Bridge Speaker", NULL), @@ -25,7 +30,7 @@ static const char * const bridge_cs35l56_name_prefixes[] = { "AMPR", }; -static int bridge_cs35l56_asp_init(struct snd_soc_pcm_runtime *rtd) +static int asoc_sdw_bridge_cs35l56_asp_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; int i, ret; @@ -73,7 +78,7 @@ static int bridge_cs35l56_asp_init(struct snd_soc_pcm_runtime *rtd) return 0; } -static const struct snd_soc_pcm_stream bridge_params = { +static const struct snd_soc_pcm_stream asoc_sdw_bridge_params = { .formats = SNDRV_PCM_FMTBIT_S16_LE, .rate_min = 48000, .rate_max = 48000, @@ -81,7 +86,7 @@ static const struct snd_soc_pcm_stream bridge_params = { .channels_max = 2, }; -SND_SOC_DAILINK_DEFS(bridge_dai, +SND_SOC_DAILINK_DEFS(asoc_sdw_bridge_dai, DAILINK_COMP_ARRAY(COMP_CODEC("cs42l43-codec", "cs42l43-asp")), DAILINK_COMP_ARRAY(COMP_CODEC("spi-cs35l56-left", "cs35l56-asp1"), COMP_CODEC("spi-cs35l56-right", "cs35l56-asp1")), @@ -89,28 +94,33 @@ SND_SOC_DAILINK_DEFS(bridge_dai, static const struct snd_soc_dai_link bridge_dai_template = { .name = "cs42l43-cs35l56", - .init = bridge_cs35l56_asp_init, - .c2c_params = &bridge_params, + .init = asoc_sdw_bridge_cs35l56_asp_init, + .c2c_params = &asoc_sdw_bridge_params, .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_CBC_CFC, - SND_SOC_DAILINK_REG(bridge_dai), + SND_SOC_DAILINK_REG(asoc_sdw_bridge_dai), }; int asoc_sdw_bridge_cs35l56_count_sidecar(struct snd_soc_card *card, int *num_dais, int *num_devs) { - if (sof_sdw_quirk & SOC_SDW_SIDECAR_AMPS) { + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); + + if (ctx->mc_quirk & SOC_SDW_SIDECAR_AMPS) { (*num_dais)++; (*num_devs) += ARRAY_SIZE(bridge_cs35l56_name_prefixes); } return 0; } +EXPORT_SYMBOL_NS(asoc_sdw_bridge_cs35l56_count_sidecar, SND_SOC_SDW_UTILS); int asoc_sdw_bridge_cs35l56_add_sidecar(struct snd_soc_card *card, struct snd_soc_dai_link **dai_links, struct snd_soc_codec_conf **codec_conf) { - if (sof_sdw_quirk & SOC_SDW_SIDECAR_AMPS) { + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); + + if (ctx->mc_quirk & SOC_SDW_SIDECAR_AMPS) { **dai_links = bridge_dai_template; for (int i = 0; i < ARRAY_SIZE(bridge_cs35l56_name_prefixes); i++) { @@ -124,14 +134,18 @@ int asoc_sdw_bridge_cs35l56_add_sidecar(struct snd_soc_card *card, return 0; } +EXPORT_SYMBOL_NS(asoc_sdw_bridge_cs35l56_add_sidecar, SND_SOC_SDW_UTILS); int asoc_sdw_bridge_cs35l56_spk_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, struct asoc_sdw_codec_info *info, bool playback) { - if (sof_sdw_quirk & SOC_SDW_SIDECAR_AMPS) + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); + + if (ctx->mc_quirk & SOC_SDW_SIDECAR_AMPS) info->amp_num += ARRAY_SIZE(bridge_cs35l56_name_prefixes); return 0; } +EXPORT_SYMBOL_NS(asoc_sdw_bridge_cs35l56_spk_init, SND_SOC_SDW_UTILS); diff --git a/sound/soc/intel/boards/sof_sdw_cs42l42.c b/sound/soc/sdw_utils/soc_sdw_cs42l42.c similarity index 88% rename from sound/soc/intel/boards/sof_sdw_cs42l42.c rename to sound/soc/sdw_utils/soc_sdw_cs42l42.c index 3ce2f65f994a..78a6cb059ac0 100644 --- a/sound/soc/intel/boards/sof_sdw_cs42l42.c +++ b/sound/soc/sdw_utils/soc_sdw_cs42l42.c @@ -1,8 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-only +// This file incorporates work covered by the following copyright notice: // Copyright (c) 2023 Intel Corporation - +// Copyright (c) 2024 Advanced Micro Devices, Inc. /* - * sof_sdw_cs42l42 - Helpers to handle CS42L42 from generic machine driver + * soc_sdw_cs42l42 - Helpers to handle CS42L42 from generic machine driver */ #include @@ -15,7 +16,7 @@ #include #include #include -#include "sof_sdw_common.h" +#include static const struct snd_soc_dapm_route cs42l42_map[] = { /* HP jack connectors - unknown if we have jack detection */ @@ -87,4 +88,4 @@ int asoc_sdw_cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_da return ret; } -MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); +EXPORT_SYMBOL_NS(asoc_sdw_cs42l42_rtd_init, SND_SOC_SDW_UTILS); diff --git a/sound/soc/intel/boards/sof_sdw_cs42l43.c b/sound/soc/sdw_utils/soc_sdw_cs42l43.c similarity index 85% rename from sound/soc/intel/boards/sof_sdw_cs42l43.c rename to sound/soc/sdw_utils/soc_sdw_cs42l43.c index 47d05fe7de53..adb1c008e871 100644 --- a/sound/soc/intel/boards/sof_sdw_cs42l43.c +++ b/sound/soc/sdw_utils/soc_sdw_cs42l43.c @@ -1,9 +1,11 @@ // SPDX-License-Identifier: GPL-2.0-only // Based on sof_sdw_rt5682.c +// This file incorporates work covered by the following copyright notice: // Copyright (c) 2023 Intel Corporation +// Copyright (c) 2024 Advanced Micro Devices, Inc. /* - * sof_sdw_cs42l43 - Helpers to handle CS42L43 from generic machine driver + * soc_sdw_cs42l43 - Helpers to handle CS42L43 from generic machine driver */ #include #include @@ -16,7 +18,7 @@ #include #include #include -#include "sof_sdw_common.h" +#include static const struct snd_soc_dapm_route cs42l43_hs_map[] = { { "Headphone", NULL, "cs42l43 AMP3_OUT" }, @@ -37,7 +39,7 @@ static const struct snd_soc_dapm_route cs42l43_dmic_map[] = { { "cs42l43 PDM2_DIN", NULL, "DMIC" }, }; -static struct snd_soc_jack_pin sof_jack_pins[] = { +static struct snd_soc_jack_pin soc_jack_pins[] = { { .pin = "Headphone", .mask = SND_JACK_HEADPHONE, @@ -73,8 +75,8 @@ int asoc_sdw_cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc SND_JACK_HEADSET | SND_JACK_LINEOUT | SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2 | SND_JACK_BTN_3, - jack, sof_jack_pins, - ARRAY_SIZE(sof_jack_pins)); + jack, soc_jack_pins, + ARRAY_SIZE(soc_jack_pins)); if (ret) { dev_err(card->dev, "Failed to create jack: %d\n", ret); return ret; @@ -98,13 +100,15 @@ int asoc_sdw_cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc return ret; } +EXPORT_SYMBOL_NS(asoc_sdw_cs42l43_hs_rtd_init, SND_SOC_SDW_UTILS); int asoc_sdw_cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_soc_card *card = rtd->card; + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); int ret; - if (!(sof_sdw_quirk & SOC_SDW_SIDECAR_AMPS)) { + if (!(ctx->mc_quirk & SOC_SDW_SIDECAR_AMPS)) { /* Will be set by the bridge code in this case */ card->components = devm_kasprintf(card->dev, GFP_KERNEL, "%s spk:cs42l43-spk", @@ -120,6 +124,7 @@ int asoc_sdw_cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_so return ret; } +EXPORT_SYMBOL_NS(asoc_sdw_cs42l43_spk_rtd_init, SND_SOC_SDW_UTILS); int asoc_sdw_cs42l43_spk_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, @@ -134,6 +139,7 @@ int asoc_sdw_cs42l43_spk_init(struct snd_soc_card *card, return asoc_sdw_bridge_cs35l56_spk_init(card, dai_links, info, playback); } +EXPORT_SYMBOL_NS(asoc_sdw_cs42l43_spk_init, SND_SOC_SDW_UTILS); int asoc_sdw_cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { @@ -152,4 +158,4 @@ int asoc_sdw_cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_s return ret; } - +EXPORT_SYMBOL_NS(asoc_sdw_cs42l43_dmic_rtd_init, SND_SOC_SDW_UTILS); diff --git a/sound/soc/intel/boards/sof_sdw_cs_amp.c b/sound/soc/sdw_utils/soc_sdw_cs_amp.c similarity index 80% rename from sound/soc/intel/boards/sof_sdw_cs_amp.c rename to sound/soc/sdw_utils/soc_sdw_cs_amp.c index 6479974bd2c3..58b059b68016 100644 --- a/sound/soc/intel/boards/sof_sdw_cs_amp.c +++ b/sound/soc/sdw_utils/soc_sdw_cs_amp.c @@ -1,8 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-only +// This file incorporates work covered by the following copyright notice: // Copyright (c) 2023 Intel Corporation +// Copyright (c) 2024 Advanced Micro Devices, Inc. /* - * sof_sdw_cs_amp - Helpers to handle CS35L56 from generic machine driver + * soc_sdw_cs_amp - Helpers to handle CS35L56 from generic machine driver */ #include @@ -10,7 +12,7 @@ #include #include #include -#include "sof_sdw_common.h" +#include #define CODEC_NAME_SIZE 8 @@ -44,6 +46,7 @@ int asoc_sdw_cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai return 0; } +EXPORT_SYMBOL_NS(asoc_sdw_cs_spk_rtd_init, SND_SOC_SDW_UTILS); int asoc_sdw_cs_amp_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, @@ -58,3 +61,4 @@ int asoc_sdw_cs_amp_init(struct snd_soc_card *card, return 0; } +EXPORT_SYMBOL_NS(asoc_sdw_cs_amp_init, SND_SOC_SDW_UTILS); From patchwork Thu Aug 1 09:14:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816068 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 (unknown [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 3F99CC3DA64 for ; Thu, 1 Aug 2024 09:37:39 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 63CDC3D4A; Thu, 1 Aug 2024 11:36:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 63CDC3D4A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722505029; bh=wZF5msvkReMqOaD9lENyucelsey8O5TFWxvA5TTaEio=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=l/9GqyfaTMLpI9dhXVW1FIfa/zaRzFWg8XLClWTPCuH0BC4gX10yws5SB9KZmIsOt 6J9C1d8qUrGbfd7NA34ae6RdLgbLJkRb7LLUl5ztWTi240MjiHJD/kk4+yG0TLMUK2 2eB3UaH558V4xDuM/XzsAVnTczuzQqB1bOV/tpU4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 00FF6F80620; Thu, 1 Aug 2024 11:36:13 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 98339F8061F; Thu, 1 Aug 2024 11:36:12 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7EFAEF8026A; Thu, 1 Aug 2024 11:24:56 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on20600.outbound.protection.outlook.com [IPv6:2a01:111:f403:2405::600]) (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 26864F8019B for ; Thu, 1 Aug 2024 11:24:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 26864F8019B Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=zmZpvqe2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dzaZeGsZYKvm4GJ8WhcqkO85d2l2Vg82k+S/WSbHr0JYaz7KTLDjf7nnl0C8aCBlg6eLyR+p5n/C35pK8rTL78ttrON+dhIWN4goVst8b8FRoU8r50TbUGOtXDcSSVXOp6i2lgeXRagWz5nurP6ff88s8W45fEklskXi7ag//C+jA/GHrp9aCP8yayBdmGBCW2aLRRxHNVcAmdMXiayxDLeVZmW/qAXM3jeipYVSL2uJ7BEOKBHB8L7h45B2tN7RwnS3vejhMC1LhIqrAIr7N7rE0B3sChAX+AzokkWlTKvaO+L2q3O//iEfJQ97hZAD2N2CbJ3W3XzDYml5zPRV9g== 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=rRwr1M8HYTTJ9pQI1KdXfbC6gSD4Lv3+HS0qRoT2L1s=; b=JwPEoWIlpHMOAerYLRUhlYClDBI4bB0pmDJK/3nfCxMd9AGMPerwR6GnHyFLfEvzWtEPwfxb3J4igRtF9DspasYDZHUdkwQ1aQIm3ar905O0w42c1alHfypaI/2zPJeIRBekBDPvL7+4pN6p3xKmiV1H1JU7FlLWVFqycm24COto7act2dvUDHGV1hQjoi1c059So88ECek5YwzbeMp1KIO/OA1FOgjxFnq+9hVg8z2MvL1Jn9QUAWe23GIS7UJ8bzXn7+3UNlmr4zJ4bMSXsey7TGtJmjIVDTyCiaT0sQhEPYJIU4HY7oF0ZacYylaM9GFWxZ4oyXgW0eoPGbU0Tw== 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=rRwr1M8HYTTJ9pQI1KdXfbC6gSD4Lv3+HS0qRoT2L1s=; b=zmZpvqe2Yb3o1RWmorwif9C9eMWMmLsIf7DZ/6y7jhOrASySQuCrG4BOCrdaqVaDV1Q18aGI2qMttUQOCZGtw7MPRtVucvH0THt2kLoTfIk8s1pw5NKFV+FvUQ9vF2a1525c57V3yhebZZamgQ0IgNR1DaNeXjsHfQYnc5ZYYZs= Received: from DS7P222CA0030.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::10) by SA3PR12MB7781.namprd12.prod.outlook.com (2603:10b6:806:31a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Thu, 1 Aug 2024 09:24:49 +0000 Received: from DS1PEPF0001708E.namprd03.prod.outlook.com (2603:10b6:8:2e:cafe::5b) by DS7P222CA0030.outlook.office365.com (2603:10b6:8:2e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend Transport; Thu, 1 Aug 2024 09:24:49 +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 DS1PEPF0001708E.mail.protection.outlook.com (10.167.17.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:24:49 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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; Thu, 1 Aug 2024 04:24:48 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 1 Aug 2024 04:24:48 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 04:24:42 -0500 From: Vijendar Mukunda To: CC: , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Brent Lu , Charles Keepax , Maciej Strozek , Chao Song , Kuninori Morimoto , "open list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , "open list" Subject: [PATCH RESEND 20/31] ASoC: intel/sdw_utils: move maxim codec helper functions Date: Thu, 1 Aug 2024 14:44:35 +0530 Message-ID: <20240801091446.10457-21-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001708E:EE_|SA3PR12MB7781:EE_ X-MS-Office365-Filtering-Correlation-Id: b290afdc-f814-4ccc-d011-08dcb20bcaab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700013|82310400026|1800799024|7416014; X-Microsoft-Antispam-Message-Info: o+PsNO+MAFSnzIXXEfL9EaJwrJL1GWa/Xz+EUy2N1OAuVJqOfjpkipuZSeAzOCPOUHl7VuRSEtuRPVJrhWa9AKwa2HWdoAkN/Bx0J5pyoG7LKAnkkRwvwEnGRWinBBsJx212v62H17FsWkwTNfwErpPafCu1Yx2ZlOunrGFn1OjmG1FIZeQfNXIsPGB94XsvEnK9mGBxB6nC7C+V0Kir1taWgHHNXSNClUKmUJLxj1Pxc5zlYKkcG3twSNMJx54uQVKr74Ct0/P2/gUVEkJoiSXFrKXU1UU7m7ckTCY7qISvAuCpC/wcz1GgjAbuaGxMO5y4yW3QO1BXmHWMVXXIMYNr6aW1jx9PQL3IOr+20d1cK//Vg6pWAnfMiKkz1zdT8V5eJOgipsZTT0zcRhdXTVmIL/xYoQOxTtisUsuy0kFOmxAYWjdX3YBBtdNTk8LO4tcOvTlDBUPDC2kmels+j/f7vj32ATQgeXKZMUQpwwSRrBk1RWrslYNAMKvE+x3vs5+f8K6WhvXLovTWBhC8ktXgI4cFwZcS3m1o/kvCBgj3Q7GypotJxwRbPWaQkJirl0kyLoaGYT5gW9WNfUD+WFbtLi0nlwldkUnojS6m97QtVsZcKDp/21SmGnLIr7YvOExuFJiVE6FBFBe9VcZe3RD5IqZ8UCmlYob2A6/p8Xd6wrTfPqqd56E2PNwA/7fOrGt1szADCPKZmciSHcV3bqmyb9mzdGJZRslG3ormPVzLXgc9wXQccf31p0BfOKGikSUF1nSn9jlpXU9PnRj1Wem2npVIe5LGtMb7g/HBG37T8PD2Qg2YS/Pk1VOIRVOtqxcgave0OX27nLolR7sFG3e/liDGeHTPxIORZQToSVK260scZm3lpvLgD3ERHdxx968Wauvlg8cZyqM1BE5WBHIdVkzQkkuy5aNS8jTNi6Nz/e4RPHO5j5uZU1LjW7bQ7m8Svzg+Qg75ab+W2JqugGEtjFbrm1zlwE2xw+0hHkLajFNJpiQrY/H7v0wv8Ksswwmd4a2cDqCqn+5JdJl4e2XwlBmyURC17sC06waOG8fAeqCVPyM3XlZvv+fuunQ6C/fxYx8iekwZ+PaMqm8S+y5DOg+Cl3dWDmD2meH58E0rex68aXSo0H2nbpFlT0sMMQCeeo9rJ4Uo1rUtuR03cBvNzrUjBUSkV87/T1QYadtacdlbWnQIOWT1Z7POvbcpprliwbzGaYcw2gZhHthwYroJEyBITX4j2B6VLYY3iICHKkrem1ThF+qOo7XyJFwb3/nnOHZzqLNiWpT5kAAYNqijrAhLFlxSXkSMA2IktXbM4Sr/SBcaKIPXfTcw+kT+m0x35F9Er5beIJ3BGamdSC3vl/y0oPTM7laMniTOmsXE0502Nbah4iK/qzb5AblTIBriMTsaPq/sLpcI7PiTHg== 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)(7416014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:24:49.3315 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b290afdc-f814-4ccc-d011-08dcb20bcaab 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: DS1PEPF0001708E.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7781 Message-ID-Hash: HPPI7NPIOV52OLFTV7EYL6R5NW4OJXPE X-Message-ID-Hash: HPPI7NPIOV52OLFTV7EYL6R5NW4OJXPE X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Move maxim codec helper functions to common place holder so that it can be used by other platform machine driver. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 7 +++++++ sound/soc/intel/boards/Makefile | 1 - sound/soc/intel/boards/sof_sdw_common.h | 10 ---------- sound/soc/sdw_utils/Makefile | 3 ++- .../sof_sdw_maxim.c => sdw_utils/soc_sdw_maxim.c} | 14 +++++++++----- 5 files changed, 18 insertions(+), 17 deletions(-) rename sound/soc/{intel/boards/sof_sdw_maxim.c => sdw_utils/soc_sdw_maxim.c} (86%) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index d5dd887b9d15..9e84d1ab6cd0 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -144,6 +144,12 @@ int asoc_sdw_cs_amp_init(struct snd_soc_card *card, struct asoc_sdw_codec_info *info, bool playback); +/* MAXIM codec support */ +int asoc_sdw_maxim_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct asoc_sdw_codec_info *info, + bool playback); + /* dai_link init callbacks */ int asoc_sdw_rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); @@ -158,5 +164,6 @@ int asoc_sdw_cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc int asoc_sdw_cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); int asoc_sdw_cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); +int asoc_sdw_maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); #endif diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile index 1ee903e12249..5bd8dc2d166a 100644 --- a/sound/soc/intel/boards/Makefile +++ b/sound/soc/intel/boards/Makefile @@ -35,7 +35,6 @@ snd-soc-skl_nau88l25_ssm4567-y := skl_nau88l25_ssm4567.o snd-soc-ehl-rt5660-y := ehl_rt5660.o snd-soc-sof-ssp-amp-y := sof_ssp_amp.o snd-soc-sof-sdw-y += sof_sdw.o \ - sof_sdw_maxim.o \ sof_sdw_hdmi.o obj-$(CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH) += snd-soc-sof_rt5682.o obj-$(CONFIG_SND_SOC_INTEL_SOF_CS42L42_MACH) += snd-soc-sof_cs42l42.o diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index b95daa32e343..664c3404eb81 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -77,14 +77,4 @@ int sof_sdw_hdmi_init(struct snd_soc_pcm_runtime *rtd); int sof_sdw_hdmi_card_late_probe(struct snd_soc_card *card); -/* MAXIM codec support */ -int asoc_sdw_maxim_init(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_links, - struct asoc_sdw_codec_info *info, - bool playback); - -/* dai_link init callbacks */ - -int asoc_sdw_maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); - #endif diff --git a/sound/soc/sdw_utils/Makefile b/sound/soc/sdw_utils/Makefile index c15b08f3ab0b..28229ed96ffb 100644 --- a/sound/soc/sdw_utils/Makefile +++ b/sound/soc/sdw_utils/Makefile @@ -6,5 +6,6 @@ snd-soc-sdw-utils-y := soc_sdw_utils.o soc_sdw_dmic.o soc_sdw_rt_dmic.o \ soc_sdw_rt_amp.o \ soc_sdw_bridge_cs35l56.o \ soc_sdw_cs42l42.o soc_sdw_cs42l43.o \ - soc_sdw_cs_amp.o + soc_sdw_cs_amp.o \ + soc_sdw_maxim.o obj-$(CONFIG_SND_SOC_SDW_UTILS) += snd-soc-sdw-utils.o diff --git a/sound/soc/intel/boards/sof_sdw_maxim.c b/sound/soc/sdw_utils/soc_sdw_maxim.c similarity index 86% rename from sound/soc/intel/boards/sof_sdw_maxim.c rename to sound/soc/sdw_utils/soc_sdw_maxim.c index 9933224fcf68..cdcd8df37e1d 100644 --- a/sound/soc/intel/boards/sof_sdw_maxim.c +++ b/sound/soc/sdw_utils/soc_sdw_maxim.c @@ -1,7 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-only +// This file incorporates work covered by the following copyright notice: // Copyright (c) 2020 Intel Corporation +// Copyright (c) 2024 Advanced Micro Devices, Inc. // -// sof_sdw_maxim - Helpers to handle maxim codecs +// soc_sdw_maxim - Helpers to handle maxim codecs // codec devices from generic machine driver #include @@ -10,7 +12,7 @@ #include #include #include -#include "sof_sdw_common.h" +#include static int maxim_part_id; #define SOC_SDW_PART_ID_MAX98363 0x8363 @@ -41,8 +43,9 @@ int asoc_sdw_maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_ return ret; } +EXPORT_SYMBOL_NS(asoc_sdw_maxim_spk_rtd_init, SND_SOC_SDW_UTILS); -static int mx8373_enable_spk_pin(struct snd_pcm_substream *substream, bool enable) +static int asoc_sdw_mx8373_enable_spk_pin(struct snd_pcm_substream *substream, bool enable) { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct snd_soc_dai *codec_dai; @@ -84,7 +87,7 @@ static int asoc_sdw_mx8373_prepare(struct snd_pcm_substream *substream) if (ret < 0) return ret; - return mx8373_enable_spk_pin(substream, true); + return asoc_sdw_mx8373_enable_spk_pin(substream, true); } static int asoc_sdw_mx8373_hw_free(struct snd_pcm_substream *substream) @@ -96,7 +99,7 @@ static int asoc_sdw_mx8373_hw_free(struct snd_pcm_substream *substream) if (ret < 0) return ret; - return mx8373_enable_spk_pin(substream, false); + return asoc_sdw_mx8373_enable_spk_pin(substream, false); } static const struct snd_soc_ops max_98373_sdw_ops = { @@ -142,3 +145,4 @@ int asoc_sdw_maxim_init(struct snd_soc_card *card, } return 0; } +EXPORT_SYMBOL_NS(asoc_sdw_maxim_init, SND_SOC_SDW_UTILS); From patchwork Thu Aug 1 11:18:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816067 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 (unknown [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 6D91BC3DA64 for ; Thu, 1 Aug 2024 11:19:43 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 410133CD6; Thu, 1 Aug 2024 13:19:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 410133CD6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722511174; bh=MPZvZJr2dKgEyoC5PT2bfOAWgLLDd/Ys8BCPH9ABZM8=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=WER6d/EPKjuLJOFQlNh/pX6jnQbFWRa60NyhYy6zRc5yxiAjM4CksmGE/fCZw9hCC 86rarudzC8TLKwOZvSVHEkd8xIBq6sLeEHnr48J+sbrZ7q6VCXiXSKZLMJ0BTv+yal ddabkJUXm3isiBcrBGzfWB5eLviyBnsS+9piFWTw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 70DCFF805AB; Thu, 1 Aug 2024 13:19:03 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id F3E3EF805B1; Thu, 1 Aug 2024 13:19:02 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4B7AAF8026A; Thu, 1 Aug 2024 13:18:54 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2415::601]) (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 CF2F5F8007E for ; Thu, 1 Aug 2024 13:18:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CF2F5F8007E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=4jSVGk+L ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IG8lZQySTN6mi29yFHzB33btK6I+TM828CUL82L4kWOkTLU/pacIIlH7mcJDEJfFIN0DamGq4yyeLXfUN6NurJ2nzyJZfuYB+JQ4IYsRzmquckw+ZwiXqzxL92CDr3RliTG3DqRtjkMEeUoYY+e1uU7kJAp/UdAJl1sTZs13DmNvSzXd5Ez5dX6WFGdSSd8K3tQA8Pvm7rQqMrUTnhlVebT49uEKrM1lcxNdyOHsVD6gZLPwx7aYcKuiNhubdrV79s55opr66dogqfe/ClCbRQqJysa5waqt/6wcjNNZvlFCei5tj9kKVjOIDXsZyg3LSr8Lf9iXCGEN2QBZpfdMBw== 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=CDKExy/DCIR6/246/oZSdxS0in9FcMvHavGaSS7dzj4=; b=lP4+xax7j4yPWA1xZwGabOGs838rSvLgZGiDJQc86eAqMhlLNQtw6AU+lB8TAYlUkV3ygRuW5s4CISAoTXC+DtEmc8ymhMS5h7LCpwscsEVSkAtrPQTJinPL+yHqLn7vaC9DWFhI3en71Qfvkq0gr2BxESOBwVD7Oaz+735g/UQ0WFBQz4FSwPEJvQxCIH2dHUFWxJosMcdyDyY3jQOjjST1Rw4bh++QZqaFDKA1eYJ23V/6j25uMUd4hctmeFPiI8239D4sPzjHsWsHMpTrVwMEu9tdehNsFJhTM1ZnAE9lhEZRmQX/PKjCCsV9mcutLtKBe67QE11rUBjO212LgA== 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=CDKExy/DCIR6/246/oZSdxS0in9FcMvHavGaSS7dzj4=; b=4jSVGk+L+UGtWdHX4BDiRDfKaJUlwT5RQaWPo4IcVTXO3Rw1Fv7L2LQJbB2lr5QFyBSW7BnUU+mojjbrpPSbKF+TwpFLXp9bbuoPEl1yK+ht0PqFP69iZ+2n7MGlALXF7uiTgOIxgQhu95mxuJbB3/eO0nWPclDQOgCOAdhZ1iQ= Received: from MN2PR20CA0066.namprd20.prod.outlook.com (2603:10b6:208:235::35) by CH3PR12MB9077.namprd12.prod.outlook.com (2603:10b6:610:1a2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Thu, 1 Aug 2024 11:18:33 +0000 Received: from BL6PEPF00022571.namprd02.prod.outlook.com (2603:10b6:208:235:cafe::cd) by MN2PR20CA0066.outlook.office365.com (2603:10b6:208:235::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22 via Frontend Transport; Thu, 1 Aug 2024 11:18:33 +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 BL6PEPF00022571.mail.protection.outlook.com (10.167.249.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 11:18:33 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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; Thu, 1 Aug 2024 06:18:32 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 1 Aug 2024 06:18:32 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 06:18:22 -0500 From: Vijendar Mukunda To: CC: , , , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Charles Keepax , Maciej Strozek , Chao Song , open list Subject: [PATCH RESEND 21/31] ASoC: intel/sdw_utils: move dai id common macros Date: Thu, 1 Aug 2024 16:48:07 +0530 Message-ID: <20240801111821.18076-1-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00022571:EE_|CH3PR12MB9077:EE_ X-MS-Office365-Filtering-Correlation-Id: 0fe03777-542e-4b27-ea6a-08dcb21bae01 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: 3VCAdaSk/WIAEXzSG/8pF6GIjsJ6mrMlnf9DRHQs5d1sXGjD3BTcD34nDoBOn5lRLpm+Ok2D1iDVrMfiQCulpeod5OQhn49Cgjb/Ur/EWImEIcmN+jsORsoNP4HpLmdNNNtwl3ChYKzR3ZwVJRrRTG9/wVxI3sRYNunJRoJirVC8hwyzjjk+kbPh4jU5eUWkFjSOJAaFc7F5Qd6U4YampAflDWa7Kvy5Z7qUBvs05Z9WDDeDwav/USq7dwhuHaSx/Rib4SknywUKdNhb+DYJAJKmGWk3XWKqQC7jET0vdx39tOfU+fTWww92/YkepsF4Cp998Fc97dzbdJOqPu6Jm3OxJu/DbXux8XwBxZK51Zn4XDmchjKXGkdftyCDaqsO6IBuIF3aOamb9HW02rqf/91IsNp/lKSPtv6ykx9nU/Y27SPfVo5SH0mROlBmjDrFCqJwTUnayxc7ShEy0kjk4Nap5SyM2GB4bxeFUZAupA5DxHyeMgc0h3Y3O9N3e7zcOIXQEgS2otyXtqaJxtVS3yU41LMgZ4bExMgH+kbS0NXIknaQIlqEDwUQz363n9FraDZjZAf2FTi73Uv+/0CNJ6fH1vO6ldMNTE785Y5L4FoNz1Xrmu+ey1619jIBUD50+CE66XKV4J+j3FdEDrqNdYRg5iHYL9TFaKhk2y0Ujrxn/rtEXv1knTF9Tc1+rwpbWeN403rL/a3+3lviXN1TLqfgoNJRW+91ftNVV+w0tIXMeFXWmbMX9wfrFLcOkUNU0QOVxloPH4glec/9eZdwXeAI+OmUvGsyNa+LjV4EeOEpRC0KDi8e46MF4y1CTHd/VoP5WaBkIOKo8TIbIKAd4Vp7dRLZVnwj8LnWZkO9uFYaznw9I9qn6Q+laV6mDJNxV/u34xn81vqbjjm4EvEbw4k97cuggn+K6hPaRwrUykYZt76k5yLEd9hNSQux8+Q4PF22elRwcjkYv9JP23NG3WtPxOd+FA2Y51NLgjTXE3/aUNisU/QnvQd+KSl1khk4ivVTC1Ai9rOjCTZ9juPaJPTsdqH/Mik8jpT0XoHD9yBVirtuxKS0YBfPDv45apI4ZvJER1lx/Nf3fkkOUqN6YIg2K5gF6gaI0krs8ayt/s39aQppPCazgpH31P9rHv3OwwFG3HXoLMNuPdpo8exmd6eQXqB66Boa/W8POeWg0zmg+0iKfAk9VtHxSs8IldrH8AlIZebzqSubvV0b50wuvX7kCYP6dyky2fSaAHgLkFOvahSr2ckrPAQrcBZuR6PbvR/7c1/aVNrqpHrcZs3HY/SFY7SOcY+QlxsdKjRaHRsZqYIZuMADXntUTBFG+8sSlN3is+fcMye/m/hy1LBYePhyOEbQFnwdvgKzdKjwtpu4rRD/5DRaByZif6HSGE3EncvbDKtMuPgymdHmH7ed0A== 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)(7416014)(376014)(82310400026)(1800799024)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 11:18:33.2208 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0fe03777-542e-4b27-ea6a-08dcb21bae01 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: BL6PEPF00022571.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9077 Message-ID-Hash: UJIKECONNTDJXHFZUZK3HM22YNLSMZTW X-Message-ID-Hash: UJIKECONNTDJXHFZUZK3HM22YNLSMZTW X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Move dai id common macros from intel SoundWire generic driver to soc_sdw_utils.h file so that it can be used by other platform machine driver. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 7 +++++++ sound/soc/intel/boards/sof_sdw_common.h | 6 ------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index 9e84d1ab6cd0..13941ddd24c8 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -29,6 +29,13 @@ */ #define SOC_SDW_SIDECAR_AMPS BIT(16) +#define SOC_SDW_UNUSED_DAI_ID -1 +#define SOC_SDW_JACK_OUT_DAI_ID 0 +#define SOC_SDW_JACK_IN_DAI_ID 1 +#define SOC_SDW_AMP_OUT_DAI_ID 2 +#define SOC_SDW_AMP_IN_DAI_ID 3 +#define SOC_SDW_DMIC_DAI_ID 4 + struct asoc_sdw_codec_info; struct asoc_sdw_dai_info { diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index 664c3404eb81..8bfdffde16a3 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -16,12 +16,6 @@ #include "sof_hdmi_common.h" #define MAX_HDMI_NUM 4 -#define SOC_SDW_UNUSED_DAI_ID -1 -#define SOC_SDW_JACK_OUT_DAI_ID 0 -#define SOC_SDW_JACK_IN_DAI_ID 1 -#define SOC_SDW_AMP_OUT_DAI_ID 2 -#define SOC_SDW_AMP_IN_DAI_ID 3 -#define SOC_SDW_DMIC_DAI_ID 4 #define SOC_SDW_MAX_CPU_DAIS 16 #define SOC_SDW_INTEL_BIDIR_PDI_BASE 2 From patchwork Thu Aug 1 11:18:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816293 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 (unknown [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 7C3C8C3DA4A for ; Thu, 1 Aug 2024 11:20:06 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E460D3D2D; Thu, 1 Aug 2024 13:19:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E460D3D2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722511196; bh=ejSREmtKpPlCZKf7CubmMFc5YO60GeQkUhyI5h1+gts=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bUI2MqgFB3mBEOhE/i9TC0NNPwERsklNrlJVDfis+xWUQ3BFziDKzVtzfwSMDg0Gc Bbi1jk+iLYw6zo03e6AoEefejFkyDRjR9AEQXlIj/bgqSf4tfN9qW5nziaCe20kZwQ p2ui0z31Qx80UOSTFut+j30hhg+Gc9T8PvUiAk1w= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 64F65F805E2; Thu, 1 Aug 2024 13:19:06 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 4A222F805D8; Thu, 1 Aug 2024 13:19:05 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B4503F8026A; Thu, 1 Aug 2024 13:18:57 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on20607.outbound.protection.outlook.com [IPv6:2a01:111:f403:2009::607]) (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 AB139F8007E for ; Thu, 1 Aug 2024 13:18:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AB139F8007E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=vo8OClad ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UPw9dnLttljYBFCGpHDINA3OxNRpmPAuhk61imWDF4mU7a5ppE4s4HjGqyOm1v1BELRaORzrwavZIqB+GsVs0tHeNqMWzZvb2ZPMJrc4wmfruduf5uaG3zL8rEjzz+RaexJvFy3U6XnP1G+vp87ojMUCj9hdL8nn2tsz7qv12GUsZynaM3uLIkZmutL0ityIe13DvguJLe1xBfWb01ZzCwiv0jMyD6955NIs8jLOxsT2hg46S8Cl08Wgq45Fsb7m/FiK//m/XU1ZLGHquiiSLgaPMr4MoJYJT7sTAyo3MNgnMJO5EHxZ1fv4zLmNKY611fQz24HW6KZxLVRhp6gu7Q== 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=EbMz4R/5/iajlF1Nq6AdxmjB/86P3UNZcteCeMvd0o8=; b=BTJt+hqM8PBM/1Y7fw4gSwSLYlsFiUpd2+TSqp4jCVGClo7D2wWZbHaklbg5i1GShdNCWtjV3DlRYpJWtYaFIBbwoUbMgLBLoFfRP0bPj84xnwG6omqBHxAuKWpMqAtRC6KKVADZee3ulR5SiQ5NlqPvieYgsdUNZ66scxQx+Hh1dqGD8fqn4KC15rYVSmRhNinDEpFoNlmnZtrU6PvmuE5/4eIlmS0bejmhRciDSUowdATl8rof5j67iMZ2iZjY+Hnp/Xtd4KJf5NTVQiWGGNtBSooxFEAKMge5K0pol/d1rB0gIJ7v0ms566PU80nKQ+m+YcAIp0cENdEeHLY6PQ== 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=EbMz4R/5/iajlF1Nq6AdxmjB/86P3UNZcteCeMvd0o8=; b=vo8OClade3mI5xFQQdToUiqGLgxyWK/hTQobGzJ8OUOcJi8EVamc+iEqsVq5qS9bGhlpwE4RpnJTgIKDmTusTY1aNCs48w7HwIJ7YcaQUWkv6bTLgWv2Pf6EB4n10LcwSmkjhdb8ipQBe6w8bG33jU+NapROs9HrMpj89lduPiE= Received: from MN2PR15CA0030.namprd15.prod.outlook.com (2603:10b6:208:1b4::43) by SN7PR12MB6766.namprd12.prod.outlook.com (2603:10b6:806:26a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Thu, 1 Aug 2024 11:18:47 +0000 Received: from BL6PEPF00022570.namprd02.prod.outlook.com (2603:10b6:208:1b4:cafe::e4) by MN2PR15CA0030.outlook.office365.com (2603:10b6:208:1b4::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29 via Frontend Transport; Thu, 1 Aug 2024 11:18:47 +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 BL6PEPF00022570.mail.protection.outlook.com (10.167.249.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 11:18:47 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) 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; Thu, 1 Aug 2024 06:18:46 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 1 Aug 2024 06:18:46 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 06:18:36 -0500 From: Vijendar Mukunda To: CC: , , , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Charles Keepax , Maciej Strozek , Chao Song , open list Subject: [PATCH RESEND 22/31] ASoC: intel/sdw_utils: move soundwire dai type macros Date: Thu, 1 Aug 2024 16:48:08 +0530 Message-ID: <20240801111821.18076-2-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801111821.18076-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> <20240801111821.18076-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB05.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00022570:EE_|SN7PR12MB6766:EE_ X-MS-Office365-Filtering-Correlation-Id: 67387462-b36e-40a6-13ac-08dcb21bb659 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700013|82310400026|7416014|1800799024; X-Microsoft-Antispam-Message-Info: lcdp5SBWg0j5b5Pe2kgVBrCx/OyK1wX5Am0UshZd1A1n03yCByfwO+jjHJbwPnSqYPScIv9JwvnWFzbF38nBGz89NF5t0euzolrux7Y8DTiUpvz8EuOO2+l1jnnfkaE+mwxqENVBHLzU8Vuz/nsmoxpPNf9fJggkOltvN1+kCUREtVoPAdQOVLzjWjDs1kDCiIDPySYZ8kcfyCqjBdow3DLt3MbuqkpkvV6hWdHXBBpGNLfbiecWoktBZxP/E/XBsEpgdwgItrF2+I4V/bxriCyd8a/Fa375ZyNViloNR+G1dilzvcn84pOkCXSt0tBxlSTR9OAUbx2B9JQVTLVe2JVmNN/fzZmwoAuPXj3BPUU4FY4aZ/xwKF8xl5xQHTBg+/4Fqaani91vce2slN0ZlD1m2an5voJsydEcyLM6E9xr7OvfY/53UnCyWbggL/0ofeEC114f23JyB5hkKoDz5gF5tA5xx4eTSFbmfij4vMuqZPvyQgxRIRMacgMcOIbU0df9sLgnrRLEqcQEevHF3ZF0O2Q4fxGIcXi03LB+OB8H4TI4GOTstRI1iyfgZHa7RG0m68uNE/wKZ75VppoCJfDLcXzcKLvXVqEbDL/b7IZU82IyRE6BL9i4JKkJ6plki8gyfKWbFMIpyc/7NkMMbIZg+lldDXfdEN8LosXL6RWc/daaSG3N4pdqTLwFZ0B+vCwBiWxvRVDvCS264lh5iIPd7ZYTFLbZXOxKfnvkSENE5/CiNXuhSfpY4lLLNfVZEi/lTNXttlJpTYaxUKuNbhblIaMJAVU7XFB1jk6vEYKJjPMtVQ3OXdGCGzc2mMifPLPehhd4YxrbiIzfIhrgdJ6CH8jxjAhDeJZ3P3UYXfwPAWFi3MtY9KYHAV689beb+is2bu1NR0Je6VUgVuT0N1gdNUQcarxPFPCjoBx/eboJB4/HXeyKAK5OlZrgRgZh6ieceUbGFC3GDeg7BQf+G4EBYyVurqTVl6bzWCvBP7qhwoWjOw+LfvbOuMVb6Ao+eNJyGu2X63y0vzYkkW8Bh0qaFXLJ9nz9dCKB2gPWP9sSRZMwW80Jpo+egfSentccJxpMm9koyBVIMXS9kUlWl1h1gYkqP0tgV0NbEomi+fu3zj1ueLSWYr3s14AaV05GcPol9fayg7MdVQBZygfAZYW3Z+zYZPas/wniIiBLv0uxeetRt1zdlJht4b+DFXWx6zblI9FONs2ujZSYH/i+XdFwSagb5oEluRsQA32BeikGfzI2sL3oRgCXGbjAbeOIo3YTYbX+IxuJMG9F+uDxCnXS6l2Yu6cHW9ANl/9H4IbsAexKHVNdxTE/GYOrGmMMhD3enPlRBLvyX1PU4GYnLWF3d0GZWXcd/Q4bOSJf8A3tFwNAg0ti8gGDuytRFYJx3y7laOE497D6FUIw3rTjSg== 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)(7416014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 11:18:47.2294 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 67387462-b36e-40a6-13ac-08dcb21bb659 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: BL6PEPF00022570.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6766 Message-ID-Hash: SJPIB3RASA4XQADNCMNIIPQ2KH5PFMNZ X-Message-ID-Hash: SJPIB3RASA4XQADNCMNIIPQ2KH5PFMNZ X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Move SoundWire dai type macros to common header file(soc_sdw_util.h). So that these macros will be used by other platform machine driver. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 4 ++++ sound/soc/intel/boards/sof_sdw_common.h | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index 13941ddd24c8..7912ff7d2bb9 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -36,6 +36,10 @@ #define SOC_SDW_AMP_IN_DAI_ID 3 #define SOC_SDW_DMIC_DAI_ID 4 +#define SOC_SDW_DAI_TYPE_JACK 0 +#define SOC_SDW_DAI_TYPE_AMP 1 +#define SOC_SDW_DAI_TYPE_MIC 2 + struct asoc_sdw_codec_info; struct asoc_sdw_dai_info { diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index 8bfdffde16a3..02f3eebd019d 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -54,10 +54,6 @@ enum { (((quirk) << SOF_BT_OFFLOAD_SSP_SHIFT) & SOF_BT_OFFLOAD_SSP_MASK) #define SOF_SSP_BT_OFFLOAD_PRESENT BIT(18) -#define SOC_SDW_DAI_TYPE_JACK 0 -#define SOC_SDW_DAI_TYPE_AMP 1 -#define SOC_SDW_DAI_TYPE_MIC 2 - struct intel_mc_ctx { struct sof_hdmi_private hdmi; /* To store SDW Pin index for each SoundWire link */ From patchwork Thu Aug 1 11:18:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816066 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 (unknown [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 4705AC3DA4A for ; Thu, 1 Aug 2024 11:25:21 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1B6173D6E; Thu, 1 Aug 2024 13:25:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1B6173D6E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722511514; bh=n1G6gUesQG1dvcESNYMfRmNBdz7RcgT8+ICnelzaOvM=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=XdXuXt/wENuQewSueDp1VKmSapExYKoAauQUZ+u0xEebKQrHNl5rCil3DO1mMO7sq LJS/qxSpFCNWZNLxf/vOqYPhkvNm/vrjcye+d19AySwCt4mTf939kbfI+s0YqEtOFG 8/uM7eZ0HaqOI0YE1+PzPI75VvuSL4gYxkjR6zP0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id C63B6F805C0; Thu, 1 Aug 2024 13:24:34 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id EC06BF805AC; Thu, 1 Aug 2024 13:24:33 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 739ACF8026A; Thu, 1 Aug 2024 13:19:32 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on20600.outbound.protection.outlook.com [IPv6:2a01:111:f403:2405::600]) (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 1BC04F8057A for ; Thu, 1 Aug 2024 13:19:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1BC04F8057A Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=eUflpqa+ ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RY3hNgm4KNM2IW+0/laLsXRsLNDoA5G1tfN15+0SCJ/7nPcJCw0LtNf6XEiOfKEcwL6h57i4FLcJbyJMo7oul+oFIbcSIsm5Fhr7BwvRZVLEccfaVrwzXErPuctHgajbbuWrDJfsPgMzYmjL5WDfWHgn0brleI5URMI7Wli7s4aZ35LskJVI4cB6FPlli30uNEc2DSBxLG4rIvCTUln1qxWR0YQkic6UlheZLV2NGAFl3p30HPnvBYQKSQAIpSr1ldaxu84BQgH8ty6QkDJ1mIStdMIHMB5DRf4gmNluy8R52mv51cQe2p/rogFUaQXS1s6JiR4VR52+7mNcvXy3VQ== 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=mqsZlHdsWDbIqdDv4tVmZaPMeiJkSbsfPbnrxJaTCFE=; b=uKuZE8L/HOs4o2Sa3xDFAdzDQXLkQUGPqPyYSBTwuVGe+BuR1m0GKgs7AUr35nmnPl6bCR1794Gv8S+1W69qF0erdHqY+SGZmMV8Wob47B0WW+xYhRgy9voCKUw1N+wBR7PCMaJPwZEvxJJrgdSEZyVVvkIxGHJThVsq86f6sorNrwFXKUYC4GAK8lb4kTLB36SuPhwI0nOXhGto9EyC5HIF0Z1z/BqXgKgbaicCrRz4n98LVlyW3VGYIETzpOMc2P1NRpxpbhV2wTeRA5tEQVKeBn+9LIVAPfDwxxXISuXvTlfLYggBCrvqXdQ9MMXqKyNSl0NUfUEoopV05d3baQ== 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=mqsZlHdsWDbIqdDv4tVmZaPMeiJkSbsfPbnrxJaTCFE=; b=eUflpqa+zcTBqcLy1OnzscRnUug32tjb4g9QSaX37bioe7TY7aTMYS6tQXdyppHfBf9enLN2OG4kKeEZwaTC6i/RTd1rFYC0cL4ygEavB7ue33gCtNcVx7F2hArddFWoWwMktccNLawZW46GDs7Ro+qi78fetZIPFKfwKX7yZuI= Received: from BN9PR03CA0324.namprd03.prod.outlook.com (2603:10b6:408:112::29) by DS0PR12MB9347.namprd12.prod.outlook.com (2603:10b6:8:193::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23; Thu, 1 Aug 2024 11:19:06 +0000 Received: from BN3PEPF0000B074.namprd04.prod.outlook.com (2603:10b6:408:112:cafe::d7) by BN9PR03CA0324.outlook.office365.com (2603:10b6:408:112::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.34 via Frontend Transport; Thu, 1 Aug 2024 11:19:06 +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 BN3PEPF0000B074.mail.protection.outlook.com (10.167.243.119) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 11:19:05 +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.2507.39; Thu, 1 Aug 2024 06:19:04 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 06:18:55 -0500 From: Vijendar Mukunda To: CC: , , , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Charles Keepax , open list Subject: [PATCH RESEND 23/31] ASoC: intel/sdw_utils: move soundwire codec_info_list structure Date: Thu, 1 Aug 2024 16:48:09 +0530 Message-ID: <20240801111821.18076-3-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801111821.18076-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> <20240801111821.18076-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B074:EE_|DS0PR12MB9347:EE_ X-MS-Office365-Filtering-Correlation-Id: 89833c42-6461-4d41-2cde-08dcb21bc17a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|7416014|82310400026; X-Microsoft-Antispam-Message-Info: Cd4fk6F7dkd8Krw1I1F04LoITJruj6JiLGn5ZV9W9qs//4PwlKK8e7KnfN1dLWwqI53wXVT0mWBQSB8USFh4DBYXp3lBmUPZnn+OjLxp2zVuQ0w0X6L/rAipi8luUBUPn9vadhLsNJc8WvIuOFBCnpS89r8VI/Fohyzg5Zgh0FYVRNB3qd0XZCJMf20RDeTeVZaG0uU9lqRmZb3MlgyguNINS4tGCU3xjQl9axgefvhl1onDl23Y4aznkA6pLseIEdv0o0vn+lx6W/0ql7G9VptEzzQqVrqsV/7Sssiyti93lBgj64m0v7n7ohnuyKkpD4KsRUVTE7t+iHri5LdjhAOkcLB8iXSItNqv0Z3h90lssLozFKrnWikm5149pArzvU0D8LmgFoTUruzYY+zqIZFhK5glQlbvFw9UacaEjAReTolGMul4eFMR81m1YXpXCHBy5283i+3vy9XFseuLh5Ad/kfWcFk7xrGj2YsdvvdR0IrkizoLui9+sTgZ1rNy4v3MDQNfVdchXr3bfDvpsnQVYL3YOkM52i/TvbMAdA+YghpbCiCodt6Kk0hyQz1KuEJ/r43r9QsK+1Ad4PUv8dlXDj4pYlK+nMNqWhgHEEGkKDaZHBsjpSl2QKwP5ULSaQObgrPHCYXSXoWMdA6lPdtqbG8KbQVxUQJvZyqJRaSyAocNrULbePHM0xG7dfM79FA+9KsRkXLC/OTMVfPGlDu6IFpEciVk38wb/BI9jO0e107rnI7s60o7wRYlTTTo0Vag+Hf94R/ba7FxyGK/lO+5QM/1yHvUcpyPOkHwHI1/YiGZuhgm2kJNyqCYvas9YaC8CXkzKpfZ/F671D+a8oFvISny98v/S443gcizDx6GVNtFpJcfB48YRQK9M+uzjSGQ2wCPZciNGLVrPXm0vUkLUcChlzuaFe5T3yVyOMfxpx6rx+dIFWN3LYTlLI8Z4tNLXdljb1HlL3MEZSqStCGAUFhvSOpfCwGzxW/VWD3mi34dptbT5mqHHLZoV6liELKtet3qSm14tTYZefAdTI/NZtn/Hys8fHkdqS/w6SCQw50EK8r+ICzKAampUHEHx4M9rl7GUurO+lALfpaGAHYMRH/CcLB//H+t65txhHdczN8KaudPbK1OxV/TJYhipnftmcQu0bxuCccyp/vgQy7AqceaEM5RFIgm+uYHD/rreRYYInIsYrJKMO1BOQSZiIFAoI6wiFYjGsLg4DMjZQCns+rU0fz4SzgGYMHYNXrS5wjBrKdQTN1G+AM+dxBBPoEEITpXrQMf9E2XcD+NH28gICbS7FqFlYxMBqMOdHdR2AlOp90K9pqPbRAco5I1THe+F9Z/osaFU0ZCkFDyDrHeCkaepvRI2AHF3CQUWq51xw5gBTFwAwx1jnM+l9T+CA55hweba2E9Xm+GRqAWbw== 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:(13230040)(1800799024)(36860700013)(376014)(7416014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 11:19:05.8857 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 89833c42-6461-4d41-2cde-08dcb21bc17a 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: BN3PEPF0000B074.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9347 Message-ID-Hash: DI34PLG6KMHGPK64GMEL6SFPOFD4I6YR X-Message-ID-Hash: DI34PLG6KMHGPK64GMEL6SFPOFD4I6YR X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: SoundWire 'codec_info_list' structure is not a platform specific one. Move codec_info_list structure to common file soc_sdw_utils.c. Move codec helper functions which uses codec_info_list structure to common place holder and rename the function by adding _sdw tag. This will allow to use 'codec_info_list' structure and it's helper functions in other platform machine driver. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 13 + sound/soc/intel/boards/sof_sdw.c | 658 +--------------------------- sound/soc/sdw_utils/soc_sdw_utils.c | 657 +++++++++++++++++++++++++++ 3 files changed, 676 insertions(+), 652 deletions(-) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index 7912ff7d2bb9..9d99a460ba27 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -90,8 +90,12 @@ struct asoc_sdw_mc_private { bool ignore_internal_dmic; void *private; unsigned long mc_quirk; + int codec_info_list_count; }; +extern struct asoc_sdw_codec_info codec_info_list[]; +int asoc_sdw_get_codec_info_list_count(void); + int asoc_sdw_startup(struct snd_pcm_substream *substream); int asoc_sdw_prepare(struct snd_pcm_substream *substream); int asoc_sdw_prepare(struct snd_pcm_substream *substream); @@ -106,6 +110,15 @@ const char *asoc_sdw_get_codec_name(struct device *dev, const struct snd_soc_acpi_link_adr *adr_link, int adr_index); +struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_part(const u64 adr); + +struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_acpi(const u8 *acpi_id); + +struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_dai(const char *dai_name, + int *dai_index); + +int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd); + /* DMIC support */ int asoc_sdw_dmic_init(struct snd_soc_pcm_runtime *rtd); diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index e310843974a7..87f3e5aa1477 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -548,50 +548,6 @@ static struct snd_soc_dai_link_component platform_component[] = { } }; -static const struct snd_soc_dapm_widget generic_dmic_widgets[] = { - SND_SOC_DAPM_MIC("DMIC", NULL), -}; - -static const struct snd_soc_dapm_widget generic_jack_widgets[] = { - SND_SOC_DAPM_HP("Headphone", NULL), - SND_SOC_DAPM_MIC("Headset Mic", NULL), -}; - -static const struct snd_kcontrol_new generic_jack_controls[] = { - SOC_DAPM_PIN_SWITCH("Headphone"), - SOC_DAPM_PIN_SWITCH("Headset Mic"), -}; - -static const struct snd_soc_dapm_widget generic_spk_widgets[] = { - SND_SOC_DAPM_SPK("Speaker", NULL), -}; - -static const struct snd_kcontrol_new generic_spk_controls[] = { - SOC_DAPM_PIN_SWITCH("Speaker"), -}; - -static const struct snd_soc_dapm_widget maxim_widgets[] = { - SND_SOC_DAPM_SPK("Left Spk", NULL), - SND_SOC_DAPM_SPK("Right Spk", NULL), -}; - -static const struct snd_kcontrol_new maxim_controls[] = { - SOC_DAPM_PIN_SWITCH("Left Spk"), - SOC_DAPM_PIN_SWITCH("Right Spk"), -}; - -static const struct snd_soc_dapm_widget rt700_widgets[] = { - SND_SOC_DAPM_HP("Headphones", NULL), - SND_SOC_DAPM_MIC("AMIC", NULL), - SND_SOC_DAPM_SPK("Speaker", NULL), -}; - -static const struct snd_kcontrol_new rt700_controls[] = { - SOC_DAPM_PIN_SWITCH("Headphones"), - SOC_DAPM_PIN_SWITCH("AMIC"), - SOC_DAPM_PIN_SWITCH("Speaker"), -}; - static const struct snd_soc_ops sdw_ops = { .startup = asoc_sdw_startup, .prepare = asoc_sdw_prepare, @@ -601,547 +557,6 @@ static const struct snd_soc_ops sdw_ops = { .shutdown = asoc_sdw_shutdown, }; -static struct asoc_sdw_codec_info codec_info_list[] = { - { - .part_id = 0x700, - .dais = { - { - .direction = {true, true}, - .dai_name = "rt700-aif1", - .dai_type = SOC_SDW_DAI_TYPE_JACK, - .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - .rtd_init = asoc_sdw_rt700_rtd_init, - .controls = rt700_controls, - .num_controls = ARRAY_SIZE(rt700_controls), - .widgets = rt700_widgets, - .num_widgets = ARRAY_SIZE(rt700_widgets), - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x711, - .version_id = 3, - .dais = { - { - .direction = {true, true}, - .dai_name = "rt711-sdca-aif1", - .dai_type = SOC_SDW_DAI_TYPE_JACK, - .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - .init = asoc_sdw_rt_sdca_jack_init, - .exit = asoc_sdw_rt_sdca_jack_exit, - .rtd_init = asoc_sdw_rt_sdca_jack_rtd_init, - .controls = generic_jack_controls, - .num_controls = ARRAY_SIZE(generic_jack_controls), - .widgets = generic_jack_widgets, - .num_widgets = ARRAY_SIZE(generic_jack_widgets), - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x711, - .version_id = 2, - .dais = { - { - .direction = {true, true}, - .dai_name = "rt711-aif1", - .dai_type = SOC_SDW_DAI_TYPE_JACK, - .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - .init = asoc_sdw_rt711_init, - .exit = asoc_sdw_rt711_exit, - .rtd_init = asoc_sdw_rt711_rtd_init, - .controls = generic_jack_controls, - .num_controls = ARRAY_SIZE(generic_jack_controls), - .widgets = generic_jack_widgets, - .num_widgets = ARRAY_SIZE(generic_jack_widgets), - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x712, - .version_id = 3, - .dais = { - { - .direction = {true, true}, - .dai_name = "rt712-sdca-aif1", - .dai_type = SOC_SDW_DAI_TYPE_JACK, - .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - .init = asoc_sdw_rt_sdca_jack_init, - .exit = asoc_sdw_rt_sdca_jack_exit, - .rtd_init = asoc_sdw_rt_sdca_jack_rtd_init, - .controls = generic_jack_controls, - .num_controls = ARRAY_SIZE(generic_jack_controls), - .widgets = generic_jack_widgets, - .num_widgets = ARRAY_SIZE(generic_jack_widgets), - }, - { - .direction = {true, false}, - .dai_name = "rt712-sdca-aif2", - .dai_type = SOC_SDW_DAI_TYPE_AMP, - .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, - .init = asoc_sdw_rt_amp_init, - .exit = asoc_sdw_rt_amp_exit, - .rtd_init = asoc_sdw_rt712_spk_rtd_init, - .controls = generic_spk_controls, - .num_controls = ARRAY_SIZE(generic_spk_controls), - .widgets = generic_spk_widgets, - .num_widgets = ARRAY_SIZE(generic_spk_widgets), - }, - }, - .dai_num = 2, - }, - { - .part_id = 0x1712, - .version_id = 3, - .dais = { - { - .direction = {false, true}, - .dai_name = "rt712-sdca-dmic-aif1", - .dai_type = SOC_SDW_DAI_TYPE_MIC, - .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, - .rtd_init = asoc_sdw_rt_dmic_rtd_init, - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x713, - .version_id = 3, - .dais = { - { - .direction = {true, true}, - .dai_name = "rt712-sdca-aif1", - .dai_type = SOC_SDW_DAI_TYPE_JACK, - .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - .init = asoc_sdw_rt_sdca_jack_init, - .exit = asoc_sdw_rt_sdca_jack_exit, - .rtd_init = asoc_sdw_rt_sdca_jack_rtd_init, - .controls = generic_jack_controls, - .num_controls = ARRAY_SIZE(generic_jack_controls), - .widgets = generic_jack_widgets, - .num_widgets = ARRAY_SIZE(generic_jack_widgets), - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x1713, - .version_id = 3, - .dais = { - { - .direction = {false, true}, - .dai_name = "rt712-sdca-dmic-aif1", - .dai_type = SOC_SDW_DAI_TYPE_MIC, - .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, - .rtd_init = asoc_sdw_rt_dmic_rtd_init, - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x1308, - .acpi_id = "10EC1308", - .dais = { - { - .direction = {true, false}, - .dai_name = "rt1308-aif", - .dai_type = SOC_SDW_DAI_TYPE_AMP, - .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, - .init = asoc_sdw_rt_amp_init, - .exit = asoc_sdw_rt_amp_exit, - .rtd_init = asoc_sdw_rt_amp_spk_rtd_init, - .controls = generic_spk_controls, - .num_controls = ARRAY_SIZE(generic_spk_controls), - .widgets = generic_spk_widgets, - .num_widgets = ARRAY_SIZE(generic_spk_widgets), - }, - }, - .dai_num = 1, - .ops = &soc_sdw_rt1308_i2s_ops, - }, - { - .part_id = 0x1316, - .dais = { - { - .direction = {true, true}, - .dai_name = "rt1316-aif", - .dai_type = SOC_SDW_DAI_TYPE_AMP, - .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, - .init = asoc_sdw_rt_amp_init, - .exit = asoc_sdw_rt_amp_exit, - .rtd_init = asoc_sdw_rt_amp_spk_rtd_init, - .controls = generic_spk_controls, - .num_controls = ARRAY_SIZE(generic_spk_controls), - .widgets = generic_spk_widgets, - .num_widgets = ARRAY_SIZE(generic_spk_widgets), - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x1318, - .dais = { - { - .direction = {true, true}, - .dai_name = "rt1318-aif", - .dai_type = SOC_SDW_DAI_TYPE_AMP, - .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, - .init = asoc_sdw_rt_amp_init, - .exit = asoc_sdw_rt_amp_exit, - .rtd_init = asoc_sdw_rt_amp_spk_rtd_init, - .controls = generic_spk_controls, - .num_controls = ARRAY_SIZE(generic_spk_controls), - .widgets = generic_spk_widgets, - .num_widgets = ARRAY_SIZE(generic_spk_widgets), - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x714, - .version_id = 3, - .ignore_internal_dmic = true, - .dais = { - { - .direction = {false, true}, - .dai_name = "rt715-sdca-aif2", - .dai_type = SOC_SDW_DAI_TYPE_MIC, - .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, - .rtd_init = asoc_sdw_rt_dmic_rtd_init, - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x715, - .version_id = 3, - .ignore_internal_dmic = true, - .dais = { - { - .direction = {false, true}, - .dai_name = "rt715-sdca-aif2", - .dai_type = SOC_SDW_DAI_TYPE_MIC, - .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, - .rtd_init = asoc_sdw_rt_dmic_rtd_init, - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x714, - .version_id = 2, - .ignore_internal_dmic = true, - .dais = { - { - .direction = {false, true}, - .dai_name = "rt715-aif2", - .dai_type = SOC_SDW_DAI_TYPE_MIC, - .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, - .rtd_init = asoc_sdw_rt_dmic_rtd_init, - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x715, - .version_id = 2, - .ignore_internal_dmic = true, - .dais = { - { - .direction = {false, true}, - .dai_name = "rt715-aif2", - .dai_type = SOC_SDW_DAI_TYPE_MIC, - .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, - .rtd_init = asoc_sdw_rt_dmic_rtd_init, - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x722, - .version_id = 3, - .dais = { - { - .direction = {true, true}, - .dai_name = "rt722-sdca-aif1", - .dai_type = SOC_SDW_DAI_TYPE_JACK, - .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - .init = asoc_sdw_rt_sdca_jack_init, - .exit = asoc_sdw_rt_sdca_jack_exit, - .rtd_init = asoc_sdw_rt_sdca_jack_rtd_init, - .controls = generic_jack_controls, - .num_controls = ARRAY_SIZE(generic_jack_controls), - .widgets = generic_jack_widgets, - .num_widgets = ARRAY_SIZE(generic_jack_widgets), - }, - { - .direction = {true, false}, - .dai_name = "rt722-sdca-aif2", - .dai_type = SOC_SDW_DAI_TYPE_AMP, - /* No feedback capability is provided by rt722-sdca codec driver*/ - .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, - .init = asoc_sdw_rt_amp_init, - .exit = asoc_sdw_rt_amp_exit, - .rtd_init = asoc_sdw_rt722_spk_rtd_init, - .controls = generic_spk_controls, - .num_controls = ARRAY_SIZE(generic_spk_controls), - .widgets = generic_spk_widgets, - .num_widgets = ARRAY_SIZE(generic_spk_widgets), - }, - { - .direction = {false, true}, - .dai_name = "rt722-sdca-aif3", - .dai_type = SOC_SDW_DAI_TYPE_MIC, - .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, - .rtd_init = asoc_sdw_rt_dmic_rtd_init, - }, - }, - .dai_num = 3, - }, - { - .part_id = 0x8373, - .dais = { - { - .direction = {true, true}, - .dai_name = "max98373-aif1", - .dai_type = SOC_SDW_DAI_TYPE_AMP, - .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, - .init = asoc_sdw_maxim_init, - .rtd_init = asoc_sdw_maxim_spk_rtd_init, - .controls = maxim_controls, - .num_controls = ARRAY_SIZE(maxim_controls), - .widgets = maxim_widgets, - .num_widgets = ARRAY_SIZE(maxim_widgets), - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x8363, - .dais = { - { - .direction = {true, false}, - .dai_name = "max98363-aif1", - .dai_type = SOC_SDW_DAI_TYPE_AMP, - .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, - .init = asoc_sdw_maxim_init, - .rtd_init = asoc_sdw_maxim_spk_rtd_init, - .controls = maxim_controls, - .num_controls = ARRAY_SIZE(maxim_controls), - .widgets = maxim_widgets, - .num_widgets = ARRAY_SIZE(maxim_widgets), - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x5682, - .dais = { - { - .direction = {true, true}, - .dai_name = "rt5682-sdw", - .dai_type = SOC_SDW_DAI_TYPE_JACK, - .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - .rtd_init = asoc_sdw_rt5682_rtd_init, - .controls = generic_jack_controls, - .num_controls = ARRAY_SIZE(generic_jack_controls), - .widgets = generic_jack_widgets, - .num_widgets = ARRAY_SIZE(generic_jack_widgets), - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x3556, - .dais = { - { - .direction = {true, true}, - .dai_name = "cs35l56-sdw1", - .dai_type = SOC_SDW_DAI_TYPE_AMP, - .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, - .init = asoc_sdw_cs_amp_init, - .rtd_init = asoc_sdw_cs_spk_rtd_init, - .controls = generic_spk_controls, - .num_controls = ARRAY_SIZE(generic_spk_controls), - .widgets = generic_spk_widgets, - .num_widgets = ARRAY_SIZE(generic_spk_widgets), - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x4242, - .dais = { - { - .direction = {true, true}, - .dai_name = "cs42l42-sdw", - .dai_type = SOC_SDW_DAI_TYPE_JACK, - .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - .rtd_init = asoc_sdw_cs42l42_rtd_init, - .controls = generic_jack_controls, - .num_controls = ARRAY_SIZE(generic_jack_controls), - .widgets = generic_jack_widgets, - .num_widgets = ARRAY_SIZE(generic_jack_widgets), - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x4243, - .codec_name = "cs42l43-codec", - .count_sidecar = asoc_sdw_bridge_cs35l56_count_sidecar, - .add_sidecar = asoc_sdw_bridge_cs35l56_add_sidecar, - .dais = { - { - .direction = {true, false}, - .dai_name = "cs42l43-dp5", - .dai_type = SOC_SDW_DAI_TYPE_JACK, - .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, - .rtd_init = asoc_sdw_cs42l43_hs_rtd_init, - .controls = generic_jack_controls, - .num_controls = ARRAY_SIZE(generic_jack_controls), - .widgets = generic_jack_widgets, - .num_widgets = ARRAY_SIZE(generic_jack_widgets), - }, - { - .direction = {false, true}, - .dai_name = "cs42l43-dp1", - .dai_type = SOC_SDW_DAI_TYPE_MIC, - .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, - .rtd_init = asoc_sdw_cs42l43_dmic_rtd_init, - .widgets = generic_dmic_widgets, - .num_widgets = ARRAY_SIZE(generic_dmic_widgets), - }, - { - .direction = {false, true}, - .dai_name = "cs42l43-dp2", - .dai_type = SOC_SDW_DAI_TYPE_JACK, - .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - }, - { - .direction = {true, false}, - .dai_name = "cs42l43-dp6", - .dai_type = SOC_SDW_DAI_TYPE_AMP, - .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, - .init = asoc_sdw_cs42l43_spk_init, - .rtd_init = asoc_sdw_cs42l43_spk_rtd_init, - .controls = generic_spk_controls, - .num_controls = ARRAY_SIZE(generic_spk_controls), - .widgets = generic_spk_widgets, - .num_widgets = ARRAY_SIZE(generic_spk_widgets), - .quirk = SOC_SDW_CODEC_SPKR | SOC_SDW_SIDECAR_AMPS, - }, - }, - .dai_num = 4, - }, - { - .part_id = 0xaaaa, /* generic codec mockup */ - .version_id = 0, - .dais = { - { - .direction = {true, true}, - .dai_name = "sdw-mockup-aif1", - .dai_type = SOC_SDW_DAI_TYPE_JACK, - .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - }, - }, - .dai_num = 1, - }, - { - .part_id = 0xaa55, /* headset codec mockup */ - .version_id = 0, - .dais = { - { - .direction = {true, true}, - .dai_name = "sdw-mockup-aif1", - .dai_type = SOC_SDW_DAI_TYPE_JACK, - .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x55aa, /* amplifier mockup */ - .version_id = 0, - .dais = { - { - .direction = {true, true}, - .dai_name = "sdw-mockup-aif1", - .dai_type = SOC_SDW_DAI_TYPE_AMP, - .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, - }, - }, - .dai_num = 1, - }, - { - .part_id = 0x5555, - .version_id = 0, - .dais = { - { - .dai_name = "sdw-mockup-aif1", - .direction = {false, true}, - .dai_type = SOC_SDW_DAI_TYPE_MIC, - .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, - }, - }, - .dai_num = 1, - }, -}; - -static struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_part(const u64 adr) -{ - unsigned int part_id, sdw_version; - int i; - - part_id = SDW_PART_ID(adr); - sdw_version = SDW_VERSION(adr); - for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) - /* - * A codec info is for all sdw version with the part id if - * version_id is not specified in the codec info. - */ - if (part_id == codec_info_list[i].part_id && - (!codec_info_list[i].version_id || - sdw_version == codec_info_list[i].version_id)) - return &codec_info_list[i]; - - return NULL; - -} - -static struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_acpi(const u8 *acpi_id) -{ - int i; - - if (!acpi_id[0]) - return NULL; - - for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) - if (!memcmp(codec_info_list[i].acpi_id, acpi_id, ACPI_ID_LEN)) - return &codec_info_list[i]; - - return NULL; -} - -static struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_dai(const char *dai_name, - int *dai_index) -{ - int i, j; - - for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) { - for (j = 0; j < codec_info_list[i].dai_num; j++) { - if (!strcmp(codec_info_list[i].dais[j].dai_name, dai_name)) { - *dai_index = j; - return &codec_info_list[i]; - } - } - } - - return NULL; -} - static void init_dai_link(struct device *dev, struct snd_soc_dai_link *dai_links, int *be_id, char *name, int playback, int capture, struct snd_soc_dai_link_component *cpus, int cpus_num, @@ -1190,69 +605,6 @@ static int init_simple_dai_link(struct device *dev, struct snd_soc_dai_link *dai return 0; } -static int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd) -{ - struct snd_soc_card *card = rtd->card; - struct asoc_sdw_codec_info *codec_info; - struct snd_soc_dai *dai; - int dai_index; - int ret; - int i; - - for_each_rtd_codec_dais(rtd, i, dai) { - codec_info = asoc_sdw_find_codec_info_dai(dai->name, &dai_index); - if (!codec_info) - return -EINVAL; - - /* - * A codec dai can be connected to different dai links for capture and playback, - * but we only need to call the rtd_init function once. - * The rtd_init for each codec dai is independent. So, the order of rtd_init - * doesn't matter. - */ - if (codec_info->dais[dai_index].rtd_init_done) - continue; - - /* - * Add card controls and dapm widgets for the first codec dai. - * The controls and widgets will be used for all codec dais. - */ - - if (i > 0) - goto skip_add_controls_widgets; - - if (codec_info->dais[dai_index].controls) { - ret = snd_soc_add_card_controls(card, codec_info->dais[dai_index].controls, - codec_info->dais[dai_index].num_controls); - if (ret) { - dev_err(card->dev, "%#x controls addition failed: %d\n", - codec_info->part_id, ret); - return ret; - } - } - if (codec_info->dais[dai_index].widgets) { - ret = snd_soc_dapm_new_controls(&card->dapm, - codec_info->dais[dai_index].widgets, - codec_info->dais[dai_index].num_widgets); - if (ret) { - dev_err(card->dev, "%#x widgets addition failed: %d\n", - codec_info->part_id, ret); - return ret; - } - } - -skip_add_controls_widgets: - if (codec_info->dais[dai_index].rtd_init) { - ret = codec_info->dais[dai_index].rtd_init(rtd, dai); - if (ret) - return ret; - } - codec_info->dais[dai_index].rtd_init_done = true; - } - - return 0; -} - struct sof_sdw_endpoint { struct list_head list; @@ -1871,7 +1223,7 @@ static int sof_sdw_card_late_probe(struct snd_soc_card *card) int ret = 0; int i; - for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) { + for (i = 0; i < ctx->codec_info_list_count; i++) { if (codec_info_list[i].codec_card_late_probe) { ret = codec_info_list[i].codec_card_late_probe(card); @@ -1907,10 +1259,11 @@ static struct snd_soc_dai_link *mc_find_codec_dai_used(struct snd_soc_card *card static void mc_dailink_exit_loop(struct snd_soc_card *card) { struct snd_soc_dai_link *dai_link; + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); int ret; int i, j; - for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) { + for (i = 0; i < ctx->codec_info_list_count; i++) { for (j = 0; j < codec_info_list[i].dai_num; j++) { codec_info_list[i].dais[j].rtd_init_done = false; /* Check each dai in codec_info_lis to see if it is used in the link */ @@ -1955,6 +1308,7 @@ static int mc_probe(struct platform_device *pdev) return -ENOMEM; ctx->private = intel_ctx; + ctx->codec_info_list_count = asoc_sdw_get_codec_info_list_count(); card = &ctx->card; card->dev = &pdev->dev; card->name = "soundwire"; @@ -1975,7 +1329,7 @@ static int mc_probe(struct platform_device *pdev) ctx->mc_quirk = sof_sdw_quirk; /* reset amp_num to ensure amp_num++ starts from 0 in each probe */ - for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) + for (i = 0; i < ctx->codec_info_list_count; i++) codec_info_list[i].amp_num = 0; if (mach->mach_params.subsystem_id_set) { @@ -1993,7 +1347,7 @@ static int mc_probe(struct platform_device *pdev) * amp_num will only be increased for active amp * codecs on used platform */ - for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) + 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, diff --git a/sound/soc/sdw_utils/soc_sdw_utils.c b/sound/soc/sdw_utils/soc_sdw_utils.c index 2b59ddc61078..a496b4eff6e3 100644 --- a/sound/soc/sdw_utils/soc_sdw_utils.c +++ b/sound/soc/sdw_utils/soc_sdw_utils.c @@ -12,6 +12,663 @@ #include #include +static const struct snd_soc_dapm_widget generic_dmic_widgets[] = { + SND_SOC_DAPM_MIC("DMIC", NULL), +}; + +static const struct snd_soc_dapm_widget generic_jack_widgets[] = { + SND_SOC_DAPM_HP("Headphone", NULL), + SND_SOC_DAPM_MIC("Headset Mic", NULL), +}; + +static const struct snd_kcontrol_new generic_jack_controls[] = { + SOC_DAPM_PIN_SWITCH("Headphone"), + SOC_DAPM_PIN_SWITCH("Headset Mic"), +}; + +static const struct snd_soc_dapm_widget generic_spk_widgets[] = { + SND_SOC_DAPM_SPK("Speaker", NULL), +}; + +static const struct snd_kcontrol_new generic_spk_controls[] = { + SOC_DAPM_PIN_SWITCH("Speaker"), +}; + +static const struct snd_soc_dapm_widget maxim_widgets[] = { + SND_SOC_DAPM_SPK("Left Spk", NULL), + SND_SOC_DAPM_SPK("Right Spk", NULL), +}; + +static const struct snd_kcontrol_new maxim_controls[] = { + SOC_DAPM_PIN_SWITCH("Left Spk"), + SOC_DAPM_PIN_SWITCH("Right Spk"), +}; + +static const struct snd_soc_dapm_widget rt700_widgets[] = { + SND_SOC_DAPM_HP("Headphones", NULL), + SND_SOC_DAPM_MIC("AMIC", NULL), + SND_SOC_DAPM_SPK("Speaker", NULL), +}; + +static const struct snd_kcontrol_new rt700_controls[] = { + SOC_DAPM_PIN_SWITCH("Headphones"), + SOC_DAPM_PIN_SWITCH("AMIC"), + SOC_DAPM_PIN_SWITCH("Speaker"), +}; + +struct asoc_sdw_codec_info codec_info_list[] = { + { + .part_id = 0x700, + .dais = { + { + .direction = {true, true}, + .dai_name = "rt700-aif1", + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, + .rtd_init = asoc_sdw_rt700_rtd_init, + .controls = rt700_controls, + .num_controls = ARRAY_SIZE(rt700_controls), + .widgets = rt700_widgets, + .num_widgets = ARRAY_SIZE(rt700_widgets), + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x711, + .version_id = 3, + .dais = { + { + .direction = {true, true}, + .dai_name = "rt711-sdca-aif1", + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, + .init = asoc_sdw_rt_sdca_jack_init, + .exit = asoc_sdw_rt_sdca_jack_exit, + .rtd_init = asoc_sdw_rt_sdca_jack_rtd_init, + .controls = generic_jack_controls, + .num_controls = ARRAY_SIZE(generic_jack_controls), + .widgets = generic_jack_widgets, + .num_widgets = ARRAY_SIZE(generic_jack_widgets), + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x711, + .version_id = 2, + .dais = { + { + .direction = {true, true}, + .dai_name = "rt711-aif1", + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, + .init = asoc_sdw_rt711_init, + .exit = asoc_sdw_rt711_exit, + .rtd_init = asoc_sdw_rt711_rtd_init, + .controls = generic_jack_controls, + .num_controls = ARRAY_SIZE(generic_jack_controls), + .widgets = generic_jack_widgets, + .num_widgets = ARRAY_SIZE(generic_jack_widgets), + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x712, + .version_id = 3, + .dais = { + { + .direction = {true, true}, + .dai_name = "rt712-sdca-aif1", + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, + .init = asoc_sdw_rt_sdca_jack_init, + .exit = asoc_sdw_rt_sdca_jack_exit, + .rtd_init = asoc_sdw_rt_sdca_jack_rtd_init, + .controls = generic_jack_controls, + .num_controls = ARRAY_SIZE(generic_jack_controls), + .widgets = generic_jack_widgets, + .num_widgets = ARRAY_SIZE(generic_jack_widgets), + }, + { + .direction = {true, false}, + .dai_name = "rt712-sdca-aif2", + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, + .init = asoc_sdw_rt_amp_init, + .exit = asoc_sdw_rt_amp_exit, + .rtd_init = asoc_sdw_rt712_spk_rtd_init, + .controls = generic_spk_controls, + .num_controls = ARRAY_SIZE(generic_spk_controls), + .widgets = generic_spk_widgets, + .num_widgets = ARRAY_SIZE(generic_spk_widgets), + }, + }, + .dai_num = 2, + }, + { + .part_id = 0x1712, + .version_id = 3, + .dais = { + { + .direction = {false, true}, + .dai_name = "rt712-sdca-dmic-aif1", + .dai_type = SOC_SDW_DAI_TYPE_MIC, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, + .rtd_init = asoc_sdw_rt_dmic_rtd_init, + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x713, + .version_id = 3, + .dais = { + { + .direction = {true, true}, + .dai_name = "rt712-sdca-aif1", + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, + .init = asoc_sdw_rt_sdca_jack_init, + .exit = asoc_sdw_rt_sdca_jack_exit, + .rtd_init = asoc_sdw_rt_sdca_jack_rtd_init, + .controls = generic_jack_controls, + .num_controls = ARRAY_SIZE(generic_jack_controls), + .widgets = generic_jack_widgets, + .num_widgets = ARRAY_SIZE(generic_jack_widgets), + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x1713, + .version_id = 3, + .dais = { + { + .direction = {false, true}, + .dai_name = "rt712-sdca-dmic-aif1", + .dai_type = SOC_SDW_DAI_TYPE_MIC, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, + .rtd_init = asoc_sdw_rt_dmic_rtd_init, + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x1308, + .acpi_id = "10EC1308", + .dais = { + { + .direction = {true, false}, + .dai_name = "rt1308-aif", + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, + .init = asoc_sdw_rt_amp_init, + .exit = asoc_sdw_rt_amp_exit, + .rtd_init = asoc_sdw_rt_amp_spk_rtd_init, + .controls = generic_spk_controls, + .num_controls = ARRAY_SIZE(generic_spk_controls), + .widgets = generic_spk_widgets, + .num_widgets = ARRAY_SIZE(generic_spk_widgets), + }, + }, + .dai_num = 1, + .ops = &soc_sdw_rt1308_i2s_ops, + }, + { + .part_id = 0x1316, + .dais = { + { + .direction = {true, true}, + .dai_name = "rt1316-aif", + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, + .init = asoc_sdw_rt_amp_init, + .exit = asoc_sdw_rt_amp_exit, + .rtd_init = asoc_sdw_rt_amp_spk_rtd_init, + .controls = generic_spk_controls, + .num_controls = ARRAY_SIZE(generic_spk_controls), + .widgets = generic_spk_widgets, + .num_widgets = ARRAY_SIZE(generic_spk_widgets), + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x1318, + .dais = { + { + .direction = {true, true}, + .dai_name = "rt1318-aif", + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, + .init = asoc_sdw_rt_amp_init, + .exit = asoc_sdw_rt_amp_exit, + .rtd_init = asoc_sdw_rt_amp_spk_rtd_init, + .controls = generic_spk_controls, + .num_controls = ARRAY_SIZE(generic_spk_controls), + .widgets = generic_spk_widgets, + .num_widgets = ARRAY_SIZE(generic_spk_widgets), + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x714, + .version_id = 3, + .ignore_internal_dmic = true, + .dais = { + { + .direction = {false, true}, + .dai_name = "rt715-sdca-aif2", + .dai_type = SOC_SDW_DAI_TYPE_MIC, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, + .rtd_init = asoc_sdw_rt_dmic_rtd_init, + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x715, + .version_id = 3, + .ignore_internal_dmic = true, + .dais = { + { + .direction = {false, true}, + .dai_name = "rt715-sdca-aif2", + .dai_type = SOC_SDW_DAI_TYPE_MIC, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, + .rtd_init = asoc_sdw_rt_dmic_rtd_init, + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x714, + .version_id = 2, + .ignore_internal_dmic = true, + .dais = { + { + .direction = {false, true}, + .dai_name = "rt715-aif2", + .dai_type = SOC_SDW_DAI_TYPE_MIC, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, + .rtd_init = asoc_sdw_rt_dmic_rtd_init, + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x715, + .version_id = 2, + .ignore_internal_dmic = true, + .dais = { + { + .direction = {false, true}, + .dai_name = "rt715-aif2", + .dai_type = SOC_SDW_DAI_TYPE_MIC, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, + .rtd_init = asoc_sdw_rt_dmic_rtd_init, + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x722, + .version_id = 3, + .dais = { + { + .direction = {true, true}, + .dai_name = "rt722-sdca-aif1", + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, + .init = asoc_sdw_rt_sdca_jack_init, + .exit = asoc_sdw_rt_sdca_jack_exit, + .rtd_init = asoc_sdw_rt_sdca_jack_rtd_init, + .controls = generic_jack_controls, + .num_controls = ARRAY_SIZE(generic_jack_controls), + .widgets = generic_jack_widgets, + .num_widgets = ARRAY_SIZE(generic_jack_widgets), + }, + { + .direction = {true, false}, + .dai_name = "rt722-sdca-aif2", + .dai_type = SOC_SDW_DAI_TYPE_AMP, + /* No feedback capability is provided by rt722-sdca codec driver*/ + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, + .init = asoc_sdw_rt_amp_init, + .exit = asoc_sdw_rt_amp_exit, + .rtd_init = asoc_sdw_rt722_spk_rtd_init, + .controls = generic_spk_controls, + .num_controls = ARRAY_SIZE(generic_spk_controls), + .widgets = generic_spk_widgets, + .num_widgets = ARRAY_SIZE(generic_spk_widgets), + }, + { + .direction = {false, true}, + .dai_name = "rt722-sdca-aif3", + .dai_type = SOC_SDW_DAI_TYPE_MIC, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, + .rtd_init = asoc_sdw_rt_dmic_rtd_init, + }, + }, + .dai_num = 3, + }, + { + .part_id = 0x8373, + .dais = { + { + .direction = {true, true}, + .dai_name = "max98373-aif1", + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, + .init = asoc_sdw_maxim_init, + .rtd_init = asoc_sdw_maxim_spk_rtd_init, + .controls = maxim_controls, + .num_controls = ARRAY_SIZE(maxim_controls), + .widgets = maxim_widgets, + .num_widgets = ARRAY_SIZE(maxim_widgets), + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x8363, + .dais = { + { + .direction = {true, false}, + .dai_name = "max98363-aif1", + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, + .init = asoc_sdw_maxim_init, + .rtd_init = asoc_sdw_maxim_spk_rtd_init, + .controls = maxim_controls, + .num_controls = ARRAY_SIZE(maxim_controls), + .widgets = maxim_widgets, + .num_widgets = ARRAY_SIZE(maxim_widgets), + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x5682, + .dais = { + { + .direction = {true, true}, + .dai_name = "rt5682-sdw", + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, + .rtd_init = asoc_sdw_rt5682_rtd_init, + .controls = generic_jack_controls, + .num_controls = ARRAY_SIZE(generic_jack_controls), + .widgets = generic_jack_widgets, + .num_widgets = ARRAY_SIZE(generic_jack_widgets), + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x3556, + .dais = { + { + .direction = {true, true}, + .dai_name = "cs35l56-sdw1", + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, + .init = asoc_sdw_cs_amp_init, + .rtd_init = asoc_sdw_cs_spk_rtd_init, + .controls = generic_spk_controls, + .num_controls = ARRAY_SIZE(generic_spk_controls), + .widgets = generic_spk_widgets, + .num_widgets = ARRAY_SIZE(generic_spk_widgets), + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x4242, + .dais = { + { + .direction = {true, true}, + .dai_name = "cs42l42-sdw", + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, + .rtd_init = asoc_sdw_cs42l42_rtd_init, + .controls = generic_jack_controls, + .num_controls = ARRAY_SIZE(generic_jack_controls), + .widgets = generic_jack_widgets, + .num_widgets = ARRAY_SIZE(generic_jack_widgets), + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x4243, + .codec_name = "cs42l43-codec", + .count_sidecar = asoc_sdw_bridge_cs35l56_count_sidecar, + .add_sidecar = asoc_sdw_bridge_cs35l56_add_sidecar, + .dais = { + { + .direction = {true, false}, + .dai_name = "cs42l43-dp5", + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, + .rtd_init = asoc_sdw_cs42l43_hs_rtd_init, + .controls = generic_jack_controls, + .num_controls = ARRAY_SIZE(generic_jack_controls), + .widgets = generic_jack_widgets, + .num_widgets = ARRAY_SIZE(generic_jack_widgets), + }, + { + .direction = {false, true}, + .dai_name = "cs42l43-dp1", + .dai_type = SOC_SDW_DAI_TYPE_MIC, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, + .rtd_init = asoc_sdw_cs42l43_dmic_rtd_init, + .widgets = generic_dmic_widgets, + .num_widgets = ARRAY_SIZE(generic_dmic_widgets), + }, + { + .direction = {false, true}, + .dai_name = "cs42l43-dp2", + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, + }, + { + .direction = {true, false}, + .dai_name = "cs42l43-dp6", + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, + .init = asoc_sdw_cs42l43_spk_init, + .rtd_init = asoc_sdw_cs42l43_spk_rtd_init, + .controls = generic_spk_controls, + .num_controls = ARRAY_SIZE(generic_spk_controls), + .widgets = generic_spk_widgets, + .num_widgets = ARRAY_SIZE(generic_spk_widgets), + .quirk = SOC_SDW_CODEC_SPKR | SOC_SDW_SIDECAR_AMPS, + }, + }, + .dai_num = 4, + }, + { + .part_id = 0xaaaa, /* generic codec mockup */ + .version_id = 0, + .dais = { + { + .direction = {true, true}, + .dai_name = "sdw-mockup-aif1", + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, + }, + }, + .dai_num = 1, + }, + { + .part_id = 0xaa55, /* headset codec mockup */ + .version_id = 0, + .dais = { + { + .direction = {true, true}, + .dai_name = "sdw-mockup-aif1", + .dai_type = SOC_SDW_DAI_TYPE_JACK, + .dailink = {SOC_SDW_JACK_OUT_DAI_ID, SOC_SDW_JACK_IN_DAI_ID}, + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x55aa, /* amplifier mockup */ + .version_id = 0, + .dais = { + { + .direction = {true, true}, + .dai_name = "sdw-mockup-aif1", + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID}, + }, + }, + .dai_num = 1, + }, + { + .part_id = 0x5555, + .version_id = 0, + .dais = { + { + .dai_name = "sdw-mockup-aif1", + .direction = {false, true}, + .dai_type = SOC_SDW_DAI_TYPE_MIC, + .dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_DMIC_DAI_ID}, + }, + }, + .dai_num = 1, + }, +}; +EXPORT_SYMBOL_NS(codec_info_list, SND_SOC_SDW_UTILS); + +int asoc_sdw_get_codec_info_list_count(void) +{ + return ARRAY_SIZE(codec_info_list); +}; +EXPORT_SYMBOL_NS(asoc_sdw_get_codec_info_list_count, SND_SOC_SDW_UTILS); + +struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_part(const u64 adr) +{ + unsigned int part_id, sdw_version; + int i; + + part_id = SDW_PART_ID(adr); + sdw_version = SDW_VERSION(adr); + for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) + /* + * A codec info is for all sdw version with the part id if + * version_id is not specified in the codec info. + */ + if (part_id == codec_info_list[i].part_id && + (!codec_info_list[i].version_id || + sdw_version == codec_info_list[i].version_id)) + return &codec_info_list[i]; + + return NULL; +} +EXPORT_SYMBOL_NS(asoc_sdw_find_codec_info_part, SND_SOC_SDW_UTILS); + +struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_acpi(const u8 *acpi_id) +{ + int i; + + if (!acpi_id[0]) + return NULL; + + for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) + if (!memcmp(codec_info_list[i].acpi_id, acpi_id, ACPI_ID_LEN)) + return &codec_info_list[i]; + + return NULL; +} +EXPORT_SYMBOL_NS(asoc_sdw_find_codec_info_acpi, SND_SOC_SDW_UTILS); + +struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_dai(const char *dai_name, int *dai_index) +{ + int i, j; + + for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) { + for (j = 0; j < codec_info_list[i].dai_num; j++) { + if (!strcmp(codec_info_list[i].dais[j].dai_name, dai_name)) { + *dai_index = j; + return &codec_info_list[i]; + } + } + } + + return NULL; +} +EXPORT_SYMBOL_NS(asoc_sdw_find_codec_info_dai, SND_SOC_SDW_UTILS); + +int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_card *card = rtd->card; + struct asoc_sdw_codec_info *codec_info; + struct snd_soc_dai *dai; + int dai_index; + int ret; + int i; + + for_each_rtd_codec_dais(rtd, i, dai) { + codec_info = asoc_sdw_find_codec_info_dai(dai->name, &dai_index); + if (!codec_info) + return -EINVAL; + + /* + * A codec dai can be connected to different dai links for capture and playback, + * but we only need to call the rtd_init function once. + * The rtd_init for each codec dai is independent. So, the order of rtd_init + * doesn't matter. + */ + if (codec_info->dais[dai_index].rtd_init_done) + continue; + + /* + * Add card controls and dapm widgets for the first codec dai. + * The controls and widgets will be used for all codec dais. + */ + + if (i > 0) + goto skip_add_controls_widgets; + + if (codec_info->dais[dai_index].controls) { + ret = snd_soc_add_card_controls(card, codec_info->dais[dai_index].controls, + codec_info->dais[dai_index].num_controls); + if (ret) { + dev_err(card->dev, "%#x controls addition failed: %d\n", + codec_info->part_id, ret); + return ret; + } + } + if (codec_info->dais[dai_index].widgets) { + ret = snd_soc_dapm_new_controls(&card->dapm, + codec_info->dais[dai_index].widgets, + codec_info->dais[dai_index].num_widgets); + if (ret) { + dev_err(card->dev, "%#x widgets addition failed: %d\n", + codec_info->part_id, ret); + return ret; + } + } + +skip_add_controls_widgets: + if (codec_info->dais[dai_index].rtd_init) { + ret = codec_info->dais[dai_index].rtd_init(rtd, dai); + if (ret) + return ret; + } + codec_info->dais[dai_index].rtd_init_done = true; + } + + return 0; +} +EXPORT_SYMBOL_NS(asoc_sdw_rtd_init, SND_SOC_SDW_UTILS); + /* these wrappers are only needed to avoid typecast compilation errors */ int asoc_sdw_startup(struct snd_pcm_substream *substream) { From patchwork Thu Aug 1 11:18:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816292 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 (unknown [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 242B6C3DA4A for ; Thu, 1 Aug 2024 11:25:40 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 274CB3D9D; Thu, 1 Aug 2024 13:25:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 274CB3D9D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722511527; bh=7lJm62gGZaCzzSe8SzfIekE5+wsRSGOc+zr+ncqda3M=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=KoT05k7py2ekH2dUW4TjfUgcPYN3she1IBCFSIYOBFvLJCFCZ4h5f/T8Z4aMTIQSW cyYHygvpixiHRjzpdMv8nZBr6LpBHh0tBurgkV0ShPEB5H09JgOJagkMqo2hhoSfJV yasBEQF5+FLqqGioAfJg3UTbAdH8vzLgqyzexfqA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3D012F805BD; Thu, 1 Aug 2024 13:24:36 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 105CDF805E3; Thu, 1 Aug 2024 13:24:36 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 991E9F8026A; Thu, 1 Aug 2024 13:19:38 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on20612.outbound.protection.outlook.com [IPv6:2a01:111:f403:2408::612]) (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 B5CD3F8019B for ; Thu, 1 Aug 2024 13:19:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B5CD3F8019B Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=T7PDa/Zm ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Fr+ssI6eth9E/dAE8KfUwaaWESw9v7O49beFfUTxRQ3Xh/PTWV3hfmO4IEJnGx2MnVUtcpNGR5yO824CT12nRzEOr3vKnRglxNzzSr/K3ZN1pSazDVIui7picSTbZ00diNRZ2XaVym0Z397QTAYvWIcY1zv6f4Lk8fqQL3OTO96AQSArOjEfaZ9YMAWw6llay8GijGgE/mZE5D1xqshfFEWroUKgj8/uyKFjFri41tUflmLrU6gthjXKTD8LkPvWJli4gRkDCbYRN5eHjLKaJRgdMBjBf0ahdZMU5UsnkSHEXYfp1Fc922j8QXP0gEX+3kDIm2NlyJGb+0+PKwa7og== 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=umBKBFd3O3E9jBAAyGqscWbcRWLwPoR5N1kTEzkf11w=; b=ddfKRJyVMcy5AwmbPLBb+5Gu0T4TDIkfUCNX/MXmruqizD807U/oVl3Q5jLeqmrtXEyiYGvYozzTSGIpGM/CW/JDQx0p7NQQCBP+8ZaHMBzxBs/ZmH2xljMdNKTfE3v4ydg4OPBPqaLCfxCe/dHx0TG0zlitBHgXFh6tYrgr3UAe9IX7b7K4fIdbdIPq22Xad7aG7YEqP6zFPKg/1x/3WGiWygkISpsE67ZipTXCDHTCiC2XrFJi1u+u+oMkNzTDLpE6eEzeKIQo44MONiXRRGQ2Ho7WN1FsK2bVf++DEDtZ1FUYdAV4hdzjcua2TkKcPh3Bmy/+tbeRw7xYtI6p8g== 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=umBKBFd3O3E9jBAAyGqscWbcRWLwPoR5N1kTEzkf11w=; b=T7PDa/ZmCs9+swh03tyJoHzXKqmCNcZ+rf3HYu6fAYEfDKDmCZSqagUr8NHw0ggp/7tt2NY3SQGtnWVo2B1M9ptp1yQtQlDdUHf9mivWTA0r9WWe7dven9a4RsUQfxpQnZhXoeb9OJTeHfMK/oZt6GiAQ8sHCDKsZbAcC4vMzkU= Received: from MN2PR15CA0031.namprd15.prod.outlook.com (2603:10b6:208:1b4::44) by SJ2PR12MB8160.namprd12.prod.outlook.com (2603:10b6:a03:4af::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Thu, 1 Aug 2024 11:19:25 +0000 Received: from BL6PEPF00022570.namprd02.prod.outlook.com (2603:10b6:208:1b4:cafe::35) by MN2PR15CA0031.outlook.office365.com (2603:10b6:208:1b4::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend Transport; Thu, 1 Aug 2024 11:19:24 +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 BL6PEPF00022570.mail.protection.outlook.com (10.167.249.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 11:19:24 +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.2507.39; Thu, 1 Aug 2024 06:19:23 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 06:19:13 -0500 From: Vijendar Mukunda To: CC: , , , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Charles Keepax , open list Subject: [PATCH RESEND 24/31] ASoC: intel/sdw_utils: move machine driver dai link helper functions Date: Thu, 1 Aug 2024 16:48:10 +0530 Message-ID: <20240801111821.18076-4-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801111821.18076-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> <20240801111821.18076-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00022570:EE_|SJ2PR12MB8160:EE_ X-MS-Office365-Filtering-Correlation-Id: a10b7f81-0281-4743-e104-08dcb21bcc79 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|36860700013|7416014|376014; X-Microsoft-Antispam-Message-Info: nEj0iyPAeTHFkuhDNHyNvvRq6P6p2p/egrsX7NKSYo3HQCYBxCRILaoVxTokj+F/dLGFcgzzXMnHCwDJ5LubfsjTYBQW2pFBFqBaUbkigUui05zBKlkHk+MyNn2JtKbU/7VxinYYn94HkfE9of3LiupTv6bbqJPmkaBXCZfMu3fPDmWuy6S9ykIV2SxCgi2LQ3SV6Yu29yMyAoWmJYf5v30qWySFBYUScT9vue2YY9THyaZmH4qAdQHSqK07kNvHDojZWJYGtYo3CEwkufatWLl8un/Tx/pe5+wVTfJB11L3Hu+YyIbpjhrc/7f3mfFS8pMJzHgJBxXXT4CEism4C0WGmsUSdm1GV5e+Gex5TLrdD3qo3Dx3iFP/9RbEb9/hHlC+uAmZK/mx0eBY0YZGwnJMOLrwiOyBL2nT00SPhibS9MdILPSfpqkiymK1MxM2K0Fx9VKDpjMQWLtEkBJnfEj7CrIzktT7wF51CNh3YwFxNQfdSh/c5owfbxQyVxS8dc2Ic6PLZC0JgmcdXHhZxgFvtEZa3iubMv6+g+celKI9biTpKjC481yt/9PuZ56Co0N030KXDt0k0dQJL1xF6yj1ImDfCpMeQbF49iE0Kfx+WKnkLsWUikA7wdiT+OFAQaLYIFtmfOHCEJ+JTvaMNrQmCAO5VFcceoDe1P82eZ5DCcl30ApOiFdn98zTEfR2tT2tCev2BL9LF41jvRLJ9RSrd+1cQdw5FLeMiwKj4M9woM3aFO9LH9AcSIEgyr9j7CwsbCDYiVJw5f2xt4NzNeMavFs2SGY1NWtJhsJ1LHlqPLVI3r08p970uOBbA1bZ+dJi9fs6iI7qT9OZLqK+2ZOsyM5uD9pqh0sYEBL8iGpviTB+9cImwzJX1j+JCIVDYCou56MZD2VZK7Xmy5PixeHo90Q1exaDN6EI4KY8qegOjBr9Nm1SQkUpDY5xVEz1rO94qR1MbSl1wedpH0c11LEi7xFCnnoDAJRH+nvwwmSgs1r7O0C3aVr6SDlQXGB8+yQv0CFMYegueFhFvsNHFUZtNfJPODrUaGmmJ/ijV4cK09KicJ4UEYa3s71V/TU5ESPqzxSsISI9Wg8k7mvViLWyh2B7BMbUyfoYD8ZJy3P2f/ZMOlMdB0pOdVkzGN2cpifxcC5Ysd070hmI7rOl85UWmnzNH4cpntMjm9jpD5UhTbBbmt59B4r0E3x6EN9mnRkxDleSXmdE2llcfHIR9AjPm4zehKhy5RojssYRevCL+IjZeUcg21W1cai3/IDewodvdN6yVqQA9U+HWGxAPefQ+68gV3BtmVi4P86AdK5LWbT5m+trIkkhkRUKEfBAuEsmjKnM6LLwyqX0TslUMeG/mAMTDfKeeYO0h/nAimSYzV04dJX8zTZAcgKR4U+VEfSOegbOAce4bGhxqk+5NA== 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)(82310400026)(1800799024)(36860700013)(7416014)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 11:19:24.3543 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a10b7f81-0281-4743-e104-08dcb21bcc79 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: BL6PEPF00022570.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8160 Message-ID-Hash: FZQMCZP6AUIAJXCTZ27JDKFV6SQMDEWT X-Message-ID-Hash: FZQMCZP6AUIAJXCTZ27JDKFV6SQMDEWT X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Move machine driver dai link helper functions to common place holder, So that it can be used by other platform machine driver. Rename these functions with "asoc_sdw" tag as a prefix. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 5 +++ sound/soc/intel/boards/sof_sdw.c | 54 ++--------------------------- sound/soc/sdw_utils/soc_sdw_utils.c | 52 +++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 52 deletions(-) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index 9d99a460ba27..b3b6d6b7ce2f 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -117,6 +117,11 @@ struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_acpi(const u8 *acpi_id); struct asoc_sdw_codec_info *asoc_sdw_find_codec_info_dai(const char *dai_name, int *dai_index); +struct snd_soc_dai_link *asoc_sdw_mc_find_codec_dai_used(struct snd_soc_card *card, + const char *dai_name); + +void asoc_sdw_mc_dailink_exit_loop(struct snd_soc_card *card); + int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd); /* DMIC support */ diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 87f3e5aa1477..07b1d6994304 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1238,56 +1238,6 @@ static int sof_sdw_card_late_probe(struct snd_soc_card *card) return ret; } -/* helper to get the link that the codec DAI is used */ -static struct snd_soc_dai_link *mc_find_codec_dai_used(struct snd_soc_card *card, - const char *dai_name) -{ - struct snd_soc_dai_link *dai_link; - int i; - int j; - - for_each_card_prelinks(card, i, dai_link) { - for (j = 0; j < dai_link->num_codecs; j++) { - /* Check each codec in a link */ - if (!strcmp(dai_link->codecs[j].dai_name, dai_name)) - return dai_link; - } - } - return NULL; -} - -static void mc_dailink_exit_loop(struct snd_soc_card *card) -{ - struct snd_soc_dai_link *dai_link; - struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); - int ret; - int i, j; - - for (i = 0; i < ctx->codec_info_list_count; i++) { - for (j = 0; j < codec_info_list[i].dai_num; j++) { - codec_info_list[i].dais[j].rtd_init_done = false; - /* Check each dai in codec_info_lis to see if it is used in the link */ - if (!codec_info_list[i].dais[j].exit) - continue; - /* - * We don't need to call .exit function if there is no matched - * dai link found. - */ - dai_link = mc_find_codec_dai_used(card, - codec_info_list[i].dais[j].dai_name); - if (dai_link) { - /* Do the .exit function if the codec dai is used in the link */ - ret = codec_info_list[i].dais[j].exit(card, dai_link); - if (ret) - dev_warn(card->dev, - "codec exit failed %d\n", - ret); - break; - } - } - } -} - static int mc_probe(struct platform_device *pdev) { struct snd_soc_acpi_mach *mach = dev_get_platdata(&pdev->dev); @@ -1368,7 +1318,7 @@ static int mc_probe(struct platform_device *pdev) 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); - mc_dailink_exit_loop(card); + asoc_sdw_mc_dailink_exit_loop(card); return ret; } @@ -1381,7 +1331,7 @@ static void mc_remove(struct platform_device *pdev) { struct snd_soc_card *card = platform_get_drvdata(pdev); - mc_dailink_exit_loop(card); + asoc_sdw_mc_dailink_exit_loop(card); } static const struct platform_device_id mc_id_table[] = { diff --git a/sound/soc/sdw_utils/soc_sdw_utils.c b/sound/soc/sdw_utils/soc_sdw_utils.c index a496b4eff6e3..409a50147349 100644 --- a/sound/soc/sdw_utils/soc_sdw_utils.c +++ b/sound/soc/sdw_utils/soc_sdw_utils.c @@ -864,5 +864,57 @@ const char *asoc_sdw_get_codec_name(struct device *dev, } EXPORT_SYMBOL_NS(asoc_sdw_get_codec_name, SND_SOC_SDW_UTILS); +/* helper to get the link that the codec DAI is used */ +struct snd_soc_dai_link *asoc_sdw_mc_find_codec_dai_used(struct snd_soc_card *card, + const char *dai_name) +{ + struct snd_soc_dai_link *dai_link; + int i; + int j; + + for_each_card_prelinks(card, i, dai_link) { + for (j = 0; j < dai_link->num_codecs; j++) { + /* Check each codec in a link */ + if (!strcmp(dai_link->codecs[j].dai_name, dai_name)) + return dai_link; + } + } + return NULL; +} +EXPORT_SYMBOL_NS(asoc_sdw_mc_find_codec_dai_used, SND_SOC_SDW_UTILS); + +void asoc_sdw_mc_dailink_exit_loop(struct snd_soc_card *card) +{ + struct snd_soc_dai_link *dai_link; + struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); + int ret; + int i, j; + + for (i = 0; i < ctx->codec_info_list_count; i++) { + for (j = 0; j < codec_info_list[i].dai_num; j++) { + codec_info_list[i].dais[j].rtd_init_done = false; + /* Check each dai in codec_info_lis to see if it is used in the link */ + if (!codec_info_list[i].dais[j].exit) + continue; + /* + * We don't need to call .exit function if there is no matched + * dai link found. + */ + dai_link = asoc_sdw_mc_find_codec_dai_used(card, + codec_info_list[i].dais[j].dai_name); + if (dai_link) { + /* Do the .exit function if the codec dai is used in the link */ + ret = codec_info_list[i].dais[j].exit(card, dai_link); + if (ret) + dev_warn(card->dev, + "codec exit failed %d\n", + ret); + break; + } + } + } +} +EXPORT_SYMBOL_NS(asoc_sdw_mc_dailink_exit_loop, SND_SOC_SDW_UTILS); + MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("SoundWire ASoC helpers"); From patchwork Thu Aug 1 11:18:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816065 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 (unknown [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 1121FC3DA64 for ; Thu, 1 Aug 2024 11:25:54 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E4F5B3D6C; Thu, 1 Aug 2024 13:25:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E4F5B3D6C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722511544; bh=mJMiRgC/EE0St9/5OFuSm9BnXXR+Ye5BLGAcPnl1QCw=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=OHC1H3YbBuUdCMgD9eJPK2DBynSFmeNRzn6pr3F6e2FLGY/e5S5TlX26cp8hz9n9z T8htZTAtiaUlNiEzdZ22BoIBiczbVCGJ3UyrEkZ3h5LQF5jNEQmM+LkTvwjmP51FAs BZW97xdw3ty7Hp6eQzavEOB/+TepGKANkc8uU5BE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 337C0F8060C; Thu, 1 Aug 2024 13:24:39 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id A089AF805F6; Thu, 1 Aug 2024 13:24:39 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 246ABF802DB; Thu, 1 Aug 2024 13:20:04 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2061a.outbound.protection.outlook.com [IPv6:2a01:111:f403:2009::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 31CC5F8007E for ; Thu, 1 Aug 2024 13:19:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 31CC5F8007E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=UrOx9D4r ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aNmPSavdvvB5aF5hMlLWY5xiKiflN4Gf2Gi4GhZbVGu+afpQUopK+DhI1YKHwGks/VtDFxqUuyvuRtp+J2koeGnIO5JwKKtEkpw6NHxzo+7RMvci8Ipgc285bz190kclapTN5lguWrVLFkLSMPZium4rukMNuK4PLVMWHGd7o9IOWZQPvzxdIB1IhYE/AzyWndvse8xFEwIWa4oqzsJLKgItcPXdmPLYlUr/ub5RDsIR2ZrC9Af4y5PCTBx02vL5HgeCc2Nt7rEZMDdHzsV5Aj1PsY7/fpV+1ewFt5X6nKke2Pyk03mDS+MRZHx2jlmkFBzTnSzmh9n67I8KqpR28A== 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=Gr7TtzcY/Q5vCZ1FmuPCuTPDvg8NAO9FoJlDcy6q1Ao=; b=dsJKJxaZ/o8z/md18z8Sl5BGFC1xoOXHD+SHRm/DnuS1kiFmTM+oecU8ztmsSKQ+IgnV2yo21ZT12CCislVZZs+5rI/xeeR1jhMEHLwutdRNPYn3FL0uPP3+6U5p2iB8gde9KfNRhkQ6QzTSkQ4nX9GlElr+w5iQzzcDFR6skTktiC7lF9qV0jgnMPFzGpo4XmnFKVQdNScTw5gaXwMrLXBB3G0XJyUWqj+Pm+gsFfYuBTUY9lpsoP+9cJYpsqhhvHC4Wczcf0rfUG3BytjNl6O/pqavQ8IAbEJWZU85Vj7uwPUlhcMbs5xYoMpJdILDA2yZaXb5i9iIq5Ck8h/KJg== 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=Gr7TtzcY/Q5vCZ1FmuPCuTPDvg8NAO9FoJlDcy6q1Ao=; b=UrOx9D4r7go7vC8NyBXk3ymo6SZ7j5XMDxvicvAJrZFFtyndHpawFTN7ikO6bhyTglon1z83QHPiBaio5jxr9gDQiLdmrR9HFXNKNKDNy0jFOjCD0PwHssONKhd4X6B5bQNgZp4aZDuHKaf/GjVi8+lO0bPJ2NkDvg090lZMcmo= Received: from PH7PR03CA0028.namprd03.prod.outlook.com (2603:10b6:510:339::18) by SA3PR12MB9180.namprd12.prod.outlook.com (2603:10b6:806:39b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Thu, 1 Aug 2024 11:19:44 +0000 Received: from MWH0EPF000A6731.namprd04.prod.outlook.com (2603:10b6:510:339:cafe::c3) by PH7PR03CA0028.outlook.office365.com (2603:10b6:510:339::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend Transport; Thu, 1 Aug 2024 11:19:43 +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 MWH0EPF000A6731.mail.protection.outlook.com (10.167.249.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 11:19:43 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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.2507.39; Thu, 1 Aug 2024 06:19:42 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 1 Aug 2024 06:19:42 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 06:19:32 -0500 From: Vijendar Mukunda To: CC: , , , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Charles Keepax , open list Subject: [PATCH RESEND 25/31] ASoC: sdw_utils: refactor sof_sdw_card_late_probe function Date: Thu, 1 Aug 2024 16:48:11 +0530 Message-ID: <20240801111821.18076-5-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801111821.18076-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> <20240801111821.18076-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000A6731:EE_|SA3PR12MB9180:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f9173fe-35d5-4815-5745-08dcb21bd7f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|7416014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: +dg2S+CFNLAsMekq9J8lHwkRk0NgG/2qWBbp6IeASAlz1YouIqmZlvTY28STd8vCW47NYSMi7ApXR87nadS6f6dB4o5W6clVvTXbpsXIbC572NbOFIEyhJdTka5tNZbXb+XlTjGfA2lIkD9KB6m7Yomz6+PgCxGsd0uRuDJmKq+eOuxLFVxxG/tYYGlJ6lY6YJGwXjy10Caw9SzcG5SZZvdX4rHHBpFMGs3fCQPxoi0K/SfW/7WBwD7LagIH+SJ6kuI0x4Ex+nDXEmzh66doiEC9vAIksxrZfUUiP8W+hIXr/wZeL4uAvXdXmVTHFfDgaShonidYxzGLm7B62VtnbjEIwOASOh/HtQrvzfZBBsuqH0uKMVjM3XwgcH5zcDPn5Pd6Lj6wDzJuuGCNh1MIhh2lU+OCSTBsYhZe49i5xha51Z+H0iZlCacUfthRpZH4D38/AbX5mfXoTG8Szzjd+T3fGxVF9vWH2ks5y4Z1UFWPyUVoqyPU6Zk0SSsARHdOVMjqw+yRrj0PUWZ83zEsnC+ftDnsA0eZJfZGTJA9lLKcRPGLVEUROO2D3jlS2XWT5fYSxNWouUqED1IKIw5Sx3bgFOOa+XkCqCWyDWJpS2XhWss/G+O3gxBdRD2wJAzMh4yK5zl5H8P8p4BcCgs+uTv9Dd683yi3fW7o5Re36LO7wflUrYzgQF5u5lQXI07gvblMJzTarxpxuhuwRzIsH4mnAU10e+f+WTNWjQJ8hlo8Sm+wzgng9+wNVUu0z2ABq7pH15kRRUNSyULM71bWgklrreNs9cfSDIvLI9Hrmg7vyDHn53CfvibndkogfsZ+/F34wxzX6zXKjQ5LmMZOHiW2cRZzNhSKs9l3Dw02NGhxTlVhri1d3XtTPYasmHiB6klPE6HvbrwbzLS0eV6EpDidlKHi6HCMonJF4Zjym/FvmObDprAwp07H6f1ZBfEVjUc7b/D1F4ebJQcxtBA7omW6mbvCVTS/exmIuKb9HDIsJv6UIZ6TMrkZ6CfVLzj+wlJOoqZ6xHaJ4jln0uOnO8j/oaF0DPXshVoL54EEXzO0uplWf71X5Q/1lyFnfFoVudOSrGM39yy2Xfs659qN03Re7GaoPKnkbEUFmSWU1TFfkYewab3AqPy7b5USz/lieFjctHNHwzNkOXdmdzMI2ncHg7TO7gKn7RUPjiAu0AaQSLwO78h5+d0S/bW5YJZPBx2bbZEPMzjsod6/9l5jycmXLoaOXluR036zJ+UnxSFiR5Lkq2Bfd019VvFvO0pdEP3/J7uhij3PaG7vZq48y6bzwjmk0VZ3V38nHttUpNNQ80bKW/+/zsY3ndFbbhBc/TgzShvlsm13MIYbg1UbEKBogf42CmgAH4RsnkrZTxSXXlM8WW1nuLX/LD3GwmHXKLXJmDfkvdjIBfhzGf6L5Q== 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:(13230040)(376014)(7416014)(82310400026)(1800799024)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 11:19:43.4934 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0f9173fe-35d5-4815-5745-08dcb21bd7f5 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: MWH0EPF000A6731.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB9180 Message-ID-Hash: 3J4E3XYFHVXWU7WK26Z63Q36SIRVMAIQ X-Message-ID-Hash: 3J4E3XYFHVXWU7WK26Z63Q36SIRVMAIQ X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Refactor sof_sdw_card_late_probe() function and derive a generic function soc_sdw_card_late_probe() function which can be used by SoundWire generic machine driver. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 2 ++ sound/soc/intel/boards/sof_sdw.c | 12 +++--------- sound/soc/sdw_utils/soc_sdw_utils.c | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index b3b6d6b7ce2f..14e21a992f56 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -122,6 +122,8 @@ struct snd_soc_dai_link *asoc_sdw_mc_find_codec_dai_used(struct snd_soc_card *ca void asoc_sdw_mc_dailink_exit_loop(struct snd_soc_card *card); +int asoc_sdw_card_late_probe(struct snd_soc_card *card); + int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd); /* DMIC support */ diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 07b1d6994304..65b15f594aed 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1221,16 +1221,10 @@ static int sof_sdw_card_late_probe(struct snd_soc_card *card) struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card); struct intel_mc_ctx *intel_ctx = (struct intel_mc_ctx *)ctx->private; int ret = 0; - int i; - - for (i = 0; i < ctx->codec_info_list_count; i++) { - if (codec_info_list[i].codec_card_late_probe) { - ret = codec_info_list[i].codec_card_late_probe(card); - if (ret < 0) - return ret; - } - } + ret = asoc_sdw_card_late_probe(card); + if (ret < 0) + return ret; if (intel_ctx->hdmi.idisp_codec) ret = sof_sdw_hdmi_card_late_probe(card); diff --git a/sound/soc/sdw_utils/soc_sdw_utils.c b/sound/soc/sdw_utils/soc_sdw_utils.c index 409a50147349..613ecc3bed92 100644 --- a/sound/soc/sdw_utils/soc_sdw_utils.c +++ b/sound/soc/sdw_utils/soc_sdw_utils.c @@ -916,5 +916,21 @@ void asoc_sdw_mc_dailink_exit_loop(struct snd_soc_card *card) } EXPORT_SYMBOL_NS(asoc_sdw_mc_dailink_exit_loop, SND_SOC_SDW_UTILS); +int asoc_sdw_card_late_probe(struct snd_soc_card *card) +{ + int ret = 0; + int i; + + for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) { + if (codec_info_list[i].codec_card_late_probe) { + ret = codec_info_list[i].codec_card_late_probe(card); + if (ret < 0) + return ret; + } + } + return ret; +} +EXPORT_SYMBOL_NS(asoc_sdw_card_late_probe, SND_SOC_SDW_UTILS); + MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("SoundWire ASoC helpers"); From patchwork Thu Aug 1 11:18:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816291 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 (unknown [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 272E4C3DA64 for ; Thu, 1 Aug 2024 11:26:17 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5193C3DE1; Thu, 1 Aug 2024 13:25:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5193C3DE1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722511559; bh=QMNEOoGzo3XzF+++wuTEgJWGz08Or/NtiJu9tpYijdo=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=o2OPOEfbatkKbwowZBKhLa215cwfSJFSNOGyQME40a4a7GQm45Tqfkk063FriRixy tW1vauCGQ1lqFNa8x0t0kXJHfP7FrgRkqGEDWDQMb3w2mT5caUD9ReOe2CEGAHhv4Y /xtFH6SBxKQK8ENlb+Ar5ANdsu47+JxHCij9pGp0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8E448F80636; Thu, 1 Aug 2024 13:24:42 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 49C0DF80611; Thu, 1 Aug 2024 13:24:42 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DF85EF802DB; Thu, 1 Aug 2024 13:20:13 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2409::601]) (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 235A1F80269 for ; Thu, 1 Aug 2024 13:20:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 235A1F80269 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=j2jKUd9w ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BsDuAzDtvVx6aFU1n1hcNpwENhwFc6seqv5QvIFc/4sXpxW27leJbMGKukp5N5bgjKIVleO94jh7RDRs7ulTi+LhtBLt6lBbkGD2jYHMuqnGf3dRGddgGpZYcEaq/HIXqFqocAta/WINji6O6ZP1bbqjvqnI9zwnBiiiNFthrLiz8vBBctJn+fxRrRTzDtbzNeiNUVY2pRPgcx3ZlEy412GusaY6grHavZz8eQwlSqE3z5MgWuJtm1FE2ishcJ7w20fTWMX5O018j6wsAGGM8H+radrG9FnUPzcVh8nxHtMg9pYmA8Ac5FpCBJ/zTz3jCTzf/SeOp4bq4ckbsIYG0A== 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=mjtQQClIt6U9a31QsowB1Jj/TP8RmNVNK0FwQHtf2CY=; b=etpmB4RJdc26g/bjQyo/xw5MJbaGQ4rKWICaT8iFr9Zj0c0lonOa23f3uW+vtqd7GEaogQF73IsT3lwUeWrIO80nBL21nyQ9osNhSmENTWETiu7+fA9T5CwjF6sldvdAIujNs0BTQIGGYJo0XeEZxVmxtuJPxE9kiBYYYs/4UkVVq9Zm9ggPr4ltqXvQc9/4h8mbnzd5NmYBE8tZdRDgAf8RKh1vUwQydERLwN3GBXyNZrUdkHqiQIK2nwAKNw03jE5OnY5+xGn3J9lVLI93g1k5m+JoNkcdU+qVdYxSE9yWXOFCGbTuSlWly0VT2X1scNsbKzrcpmribaTTsCqorw== 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=mjtQQClIt6U9a31QsowB1Jj/TP8RmNVNK0FwQHtf2CY=; b=j2jKUd9w++D+N1jINYY7IU2aHX1dDZ72vkrxOrzGXLBkTiLleMWQuuvduFN4hoi8kVu/fsPxKqlfBXnmHY3G9R7o0Fp6n45/pLlYNEKxi43r5KBt7bazR9/ZR7paXbEeRCfzL9p+Q17rlMZX5xvCiiikmg0nJYAP8+Kqczc6+fE= Received: from BYAPR07CA0027.namprd07.prod.outlook.com (2603:10b6:a02:bc::40) by PH7PR12MB7914.namprd12.prod.outlook.com (2603:10b6:510:27d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Thu, 1 Aug 2024 11:20:03 +0000 Received: from MWH0EPF000A6733.namprd04.prod.outlook.com (2603:10b6:a02:bc:cafe::9a) by BYAPR07CA0027.outlook.office365.com (2603:10b6:a02:bc::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.32 via Frontend Transport; Thu, 1 Aug 2024 11:20: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=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by MWH0EPF000A6733.mail.protection.outlook.com (10.167.249.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 11:20:02 +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.2507.39; Thu, 1 Aug 2024 06:20:00 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 06:19:51 -0500 From: Vijendar Mukunda To: CC: , , , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Cezary Rojewski" , Peter Ujfalusi , Ranjani Sridharan , Kai Vehmanen , Charles Keepax , open list Subject: [PATCH RESEND 26/31] ASoC: intel/sdw_utils: refactor init_dai_link() and init_simple_dai_link() Date: Thu, 1 Aug 2024 16:48:12 +0530 Message-ID: <20240801111821.18076-6-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801111821.18076-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> <20240801111821.18076-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000A6733:EE_|PH7PR12MB7914:EE_ X-MS-Office365-Filtering-Correlation-Id: c3378900-cb52-43ca-ea21-08dcb21be38b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: MwilPzXWOd55obUMLhUkXD04uCmN4sHqImQa6WhSUenhhQGN85I0ZQfJrO2ByaThqaQkeje80ukGndomn7oeLxXReaH424urh/vJO6lAlkELL/KUoWVv/ssbWGRA7lnnrQWOWTJCfJzmk64rA9fR0fqNK/EnEeMqpTo4gIXoQrLJC+Hk0DAg0KXimylj74LGibQ9c6rVATxGLAN5obVczxsBroR5jjupdxL5H3n+SaweuamQ0fqyx6PUQXOk+2pIBH1yFEhEZfJgqElyRlsJYArD7H+4Cygc9Kvj5itrTdDnxuGexJ681hWMUs3qDERRd8QERcdsuVao1PmaocXfQdQDQVtp9iPaG5iampK+wpCvNWrXcYtWyh8V7gsSFzs5ZQBomnmg0cZCwdkm/EDxGGPSk3U5xhwNjyyYE8pOaduNk7hxPsmSjfHG0Bevfz2W+A4egLiMt5/zB1EPdT7NUKq9GL9VTrYUOoGInWhjlsMg2DDAv61ypuvSjUOxNZo9Ewjb3xoLDGYc3jV3xV/eYAGWDjNyB6iY6FcNXj6tXZ478MVD1D65wwMow1OcNS8zCgTUwVvDvaYkKqzEV0Ds0vKA1KikBbTrmH4vMum2cMG8xUCjvW6J/IXPdCMq2veZVVpA82fvQmV4lUfXoQCxF+SiFrQYM7IoF9rdtFh+bHxF8UxG9kG8JvY8HcD9oePAPawkUaq1zS5RnzuJIOlCMPeSelEHTgB3F3OlIkQrS4Eek4M6CZkIX2rGl45aCpFGnLyj3R13ZyseMl9jv3f1chIf5jRIO/CBkimG3v4NHQgPeqbs2l020HEyBxbHu4g8daOpBuN/XLl1F6yGSD9pDExCQABeiUHDvfs3/fBFagaHZufr/dEd/Qh4o7KX0VvPS0jWi0weTSz9iGjeaa7BC6iA3nyz9Bh4JOm+GozJ/8ojyc8pzofS2MOr9M+2ampPIu2WseWer6Q6eYLeF+N3P6IRevoFRDuYpxINTcXUA73Z7m1k4pE575YVwo4mPdx8Zqh5wnOzWFaH4rk/sSmRPB6xUuZ/U2wtQRiVd+p3QvzVPLttIGmLCvWZ5I40zBFC967VbBxqTftSaMRB4aDj/u6aGnXevqfl5hPE4b1SvBd/40s33Jr6DSq/Z6VLnN9PxrqZrXZsPyqh+YtvZgnyHkx68hmUGxqI/hNfiGzj0DMv3nLNp0jKxPyx7wS/hzfwdb3GWziQvBr4BpZXBpX/5AGfqoLsxrRMhdGRaZzRN14Rh6LtTht46yp4XHep+ObkrSzddVg/4IwgqySQFuDpu6nrZNUlVMTiAZL65kHDGJWA6n0z/6XeH16YkrAYLSHjQSlb2ZA7D3dU5suHRWmG8bpluTngI2XFSNCDu6Xa4DamzRxJXPi13kx5NtchnNbZNrMRCG37kMdsJuxZtr9pIw== 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:(13230040)(7416014)(376014)(1800799024)(82310400026)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 11:20:02.9351 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c3378900-cb52-43ca-ea21-08dcb21be38b 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: MWH0EPF000A6733.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7914 Message-ID-Hash: K6PO652Q76FIOZ7ZPYQNHZHBEULYRM35 X-Message-ID-Hash: K6PO652Q76FIOZ7ZPYQNHZHBEULYRM35 X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: To make it generic, refactor existing implementation for init_dai_link() and init_simple_dai_link() as mentioned below. - Move init_dai_link() and init_simple_dai_link() to common place holder - Rename the functions with "asoc_sdw" as prefix. - Pass the platform specific 'platform_component' structure and its size as arguments for init_simple_dai_link() function and allocate one more extra dlc for platform component. - Pass the 'platform_component' and 'num_platforms' as arguments for init_dai_link(). Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc_sdw_utils.h | 16 +++++ sound/soc/intel/boards/sof_sdw.c | 105 +++++++++------------------- sound/soc/sdw_utils/soc_sdw_utils.c | 54 ++++++++++++++ 3 files changed, 104 insertions(+), 71 deletions(-) diff --git a/include/sound/soc_sdw_utils.h b/include/sound/soc_sdw_utils.h index 14e21a992f56..e366b7968c2d 100644 --- a/include/sound/soc_sdw_utils.h +++ b/include/sound/soc_sdw_utils.h @@ -124,6 +124,22 @@ void asoc_sdw_mc_dailink_exit_loop(struct snd_soc_card *card); int asoc_sdw_card_late_probe(struct snd_soc_card *card); +void asoc_sdw_init_dai_link(struct device *dev, struct snd_soc_dai_link *dai_links, + int *be_id, char *name, int playback, int capture, + struct snd_soc_dai_link_component *cpus, int cpus_num, + struct snd_soc_dai_link_component *platform_component, + int num_platforms, struct snd_soc_dai_link_component *codecs, + int codecs_num, int (*init)(struct snd_soc_pcm_runtime *rtd), + const struct snd_soc_ops *ops); + +int asoc_sdw_init_simple_dai_link(struct device *dev, struct snd_soc_dai_link *dai_links, + int *be_id, char *name, int playback, int capture, + const char *cpu_dai_name, const char *platform_comp_name, + int num_platforms, const char *codec_name, + const char *codec_dai_name, + int (*init)(struct snd_soc_pcm_runtime *rtd), + const struct snd_soc_ops *ops); + int asoc_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd); /* DMIC support */ diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 65b15f594aed..d258728d64cf 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -557,54 +557,6 @@ static const struct snd_soc_ops sdw_ops = { .shutdown = asoc_sdw_shutdown, }; -static void init_dai_link(struct device *dev, struct snd_soc_dai_link *dai_links, - int *be_id, char *name, int playback, int capture, - struct snd_soc_dai_link_component *cpus, int cpus_num, - struct snd_soc_dai_link_component *codecs, int codecs_num, - int (*init)(struct snd_soc_pcm_runtime *rtd), - const struct snd_soc_ops *ops) -{ - dev_dbg(dev, "create dai link %s, id %d\n", name, *be_id); - dai_links->id = (*be_id)++; - dai_links->name = name; - dai_links->platforms = platform_component; - dai_links->num_platforms = ARRAY_SIZE(platform_component); - dai_links->no_pcm = 1; - dai_links->cpus = cpus; - dai_links->num_cpus = cpus_num; - dai_links->codecs = codecs; - dai_links->num_codecs = codecs_num; - dai_links->dpcm_playback = playback; - dai_links->dpcm_capture = capture; - dai_links->init = init; - dai_links->ops = ops; -} - -static int init_simple_dai_link(struct device *dev, struct snd_soc_dai_link *dai_links, - int *be_id, char *name, int playback, int capture, - const char *cpu_dai_name, - const char *codec_name, const char *codec_dai_name, - int (*init)(struct snd_soc_pcm_runtime *rtd), - const struct snd_soc_ops *ops) -{ - struct snd_soc_dai_link_component *dlc; - - /* Allocate two DLCs one for the CPU, one for the CODEC */ - dlc = devm_kcalloc(dev, 2, sizeof(*dlc), GFP_KERNEL); - if (!dlc || !name || !cpu_dai_name || !codec_name || !codec_dai_name) - return -ENOMEM; - - dlc[0].dai_name = cpu_dai_name; - - dlc[1].name = codec_name; - dlc[1].dai_name = codec_dai_name; - - init_dai_link(dev, dai_links, be_id, name, playback, capture, - &dlc[0], 1, &dlc[1], 1, init, ops); - - return 0; -} - struct sof_sdw_endpoint { struct list_head list; @@ -897,9 +849,10 @@ static int create_sdw_dailink(struct snd_soc_card *card, playback = (stream == SNDRV_PCM_STREAM_PLAYBACK); capture = (stream == SNDRV_PCM_STREAM_CAPTURE); - init_dai_link(dev, *dai_links, be_id, name, playback, capture, - cpus, num_cpus, codecs, num_codecs, - asoc_sdw_rtd_init, &sdw_ops); + asoc_sdw_init_dai_link(dev, *dai_links, be_id, name, playback, capture, + cpus, num_cpus, platform_component, + ARRAY_SIZE(platform_component), codecs, num_codecs, + asoc_sdw_rtd_init, &sdw_ops); /* * SoundWire DAILINKs use 'stream' functions and Bank Switch operations @@ -969,10 +922,12 @@ static int create_ssp_dailinks(struct snd_soc_card *card, int playback = ssp_info->dais[0].direction[SNDRV_PCM_STREAM_PLAYBACK]; int capture = ssp_info->dais[0].direction[SNDRV_PCM_STREAM_CAPTURE]; - ret = init_simple_dai_link(dev, *dai_links, be_id, name, - playback, capture, cpu_dai_name, - codec_name, ssp_info->dais[0].dai_name, - NULL, ssp_info->ops); + ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, name, + playback, capture, cpu_dai_name, + platform_component->name, + ARRAY_SIZE(platform_component), codec_name, + ssp_info->dais[0].dai_name, NULL, + ssp_info->ops); if (ret) return ret; @@ -992,20 +947,24 @@ static int create_dmic_dailinks(struct snd_soc_card *card, struct device *dev = card->dev; int ret; - ret = init_simple_dai_link(dev, *dai_links, be_id, "dmic01", - 0, 1, // DMIC only supports capture - "DMIC01 Pin", "dmic-codec", "dmic-hifi", - asoc_sdw_dmic_init, NULL); + ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, "dmic01", + 0, 1, // DMIC only supports capture + "DMIC01 Pin", platform_component->name, + ARRAY_SIZE(platform_component), + "dmic-codec", "dmic-hifi", + asoc_sdw_dmic_init, NULL); if (ret) return ret; (*dai_links)++; - ret = init_simple_dai_link(dev, *dai_links, be_id, "dmic16k", - 0, 1, // DMIC only supports capture - "DMIC16k Pin", "dmic-codec", "dmic-hifi", - /* don't call asoc_sdw_dmic_init() twice */ - NULL, NULL); + ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, "dmic16k", + 0, 1, // DMIC only supports capture + "DMIC16k Pin", platform_component->name, + ARRAY_SIZE(platform_component), + "dmic-codec", "dmic-hifi", + /* don't call asoc_sdw_dmic_init() twice */ + NULL, NULL); if (ret) return ret; @@ -1037,10 +996,12 @@ static int create_hdmi_dailinks(struct snd_soc_card *card, codec_dai_name = "snd-soc-dummy-dai"; } - ret = init_simple_dai_link(dev, *dai_links, be_id, name, - 1, 0, // HDMI only supports playback - cpu_dai_name, codec_name, codec_dai_name, - i == 0 ? sof_sdw_hdmi_init : NULL, NULL); + ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, name, + 1, 0, // HDMI only supports playback + cpu_dai_name, platform_component->name, + ARRAY_SIZE(platform_component), + codec_name, codec_dai_name, + i == 0 ? sof_sdw_hdmi_init : NULL, NULL); if (ret) return ret; @@ -1060,9 +1021,11 @@ static int create_bt_dailinks(struct snd_soc_card *card, char *cpu_dai_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", port); int ret; - ret = init_simple_dai_link(dev, *dai_links, be_id, name, - 1, 1, cpu_dai_name, snd_soc_dummy_dlc.name, - snd_soc_dummy_dlc.dai_name, NULL, NULL); + ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, name, + 1, 1, cpu_dai_name, platform_component->name, + ARRAY_SIZE(platform_component), + snd_soc_dummy_dlc.name, snd_soc_dummy_dlc.dai_name, + NULL, NULL); if (ret) return ret; diff --git a/sound/soc/sdw_utils/soc_sdw_utils.c b/sound/soc/sdw_utils/soc_sdw_utils.c index 613ecc3bed92..6183629d1754 100644 --- a/sound/soc/sdw_utils/soc_sdw_utils.c +++ b/sound/soc/sdw_utils/soc_sdw_utils.c @@ -932,5 +932,59 @@ int asoc_sdw_card_late_probe(struct snd_soc_card *card) } EXPORT_SYMBOL_NS(asoc_sdw_card_late_probe, SND_SOC_SDW_UTILS); +void asoc_sdw_init_dai_link(struct device *dev, struct snd_soc_dai_link *dai_links, + int *be_id, char *name, int playback, int capture, + struct snd_soc_dai_link_component *cpus, int cpus_num, + struct snd_soc_dai_link_component *platform_component, + int num_platforms, struct snd_soc_dai_link_component *codecs, + int codecs_num, int (*init)(struct snd_soc_pcm_runtime *rtd), + const struct snd_soc_ops *ops) +{ + dev_dbg(dev, "create dai link %s, id %d\n", name, *be_id); + dai_links->id = (*be_id)++; + dai_links->name = name; + dai_links->platforms = platform_component; + dai_links->num_platforms = num_platforms; + dai_links->no_pcm = 1; + dai_links->cpus = cpus; + dai_links->num_cpus = cpus_num; + dai_links->codecs = codecs; + dai_links->num_codecs = codecs_num; + dai_links->dpcm_playback = playback; + dai_links->dpcm_capture = capture; + dai_links->init = init; + dai_links->ops = ops; +} +EXPORT_SYMBOL_NS(asoc_sdw_init_dai_link, SND_SOC_SDW_UTILS); + +int asoc_sdw_init_simple_dai_link(struct device *dev, struct snd_soc_dai_link *dai_links, + int *be_id, char *name, int playback, int capture, + const char *cpu_dai_name, const char *platform_comp_name, + int num_platforms, const char *codec_name, + const char *codec_dai_name, + int (*init)(struct snd_soc_pcm_runtime *rtd), + const struct snd_soc_ops *ops) +{ + struct snd_soc_dai_link_component *dlc; + + /* Allocate three DLCs one for the CPU, one for platform and one for the CODEC */ + dlc = devm_kcalloc(dev, 3, sizeof(*dlc), GFP_KERNEL); + if (!dlc || !name || !cpu_dai_name || !platform_comp_name || !codec_name || !codec_dai_name) + return -ENOMEM; + + dlc[0].dai_name = cpu_dai_name; + dlc[1].name = platform_comp_name; + + dlc[2].name = codec_name; + dlc[2].dai_name = codec_dai_name; + + asoc_sdw_init_dai_link(dev, dai_links, be_id, name, playback, capture, + &dlc[0], 1, &dlc[1], num_platforms, + &dlc[2], 1, init, ops); + + return 0; +} +EXPORT_SYMBOL_NS(asoc_sdw_init_simple_dai_link, SND_SOC_SDW_UTILS); + MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("SoundWire ASoC helpers"); From patchwork Thu Aug 1 11:18:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816064 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 (unknown [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 90BADC3DA4A for ; Thu, 1 Aug 2024 11:26:31 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D9C293E03; Thu, 1 Aug 2024 13:26:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D9C293E03 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722511576; bh=S3n0J3owHJ+g3wrYyT2gKOndf+1ztgwZfxHeUsjXfu8=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=d0Iwe26Pp4pGY1q2FvIDYKq9bIX2Z0Gyi7b4YLOug72soN73RE07VhIPPh9SpePdh 93NT7XNm8Phx97Ewoj7u0tTHKUdkm0Pjl0XjsBWOwXd1BhS5s4Icj3M4B9ANNNtdrf rDLGwPblFDgFSJO9FfYwPwEvEI18Rwpfvd8R2TRs= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 60AA9F8065D; Thu, 1 Aug 2024 13:24:46 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id DD594F8065B; Thu, 1 Aug 2024 13:24:45 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7F1FFF80448; Thu, 1 Aug 2024 13:20:20 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2415::601]) (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 696A9F8026A for ; Thu, 1 Aug 2024 13:20:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 696A9F8026A Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=P60gXjuc ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Jv4FYud7OcyiiLk5DkD+O+GeL6faLiK19jLHiuzN7IEfvkpjcv2iBjsl6hHhsOXF/KRheY26eD/PF8jgQlKBx/8DrhP7bo9bPHAPBfNDguBR9g2pVh2BMNjQqB9ZTLb375gK2o1wJXotorGFR0ZqqniYKVyPvygmMSke4haTE8/anJx5HbDu1Y3gTIomSUj0KtA1NXa2ex4fWsQ7NhwJEWYH0t3DuVpVsrOQ98fqMWcMWW+JWVgNsfiDnwVcCfwtJxcUch/vTcTPncA73ohZww25VqGIT+Ah4/RdTjEQ0oI6A5BqmwbJyDo9ufmvl+ORe5a3y0NdmjpNji8LGfe/Yg== 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=k1d43oNOQj4hNey9pwcUOZAYE4Ujn1MA45S+NeAiJvg=; b=YyyNlyxCRkJ3YirX+zO3FT+wDkwiZuP8O4WdqV55ZocOk0DCywXv34/juQpdVGdsi58u/MyBKSpW6FqHE6xLidyVHJmsi9N13mO4/Eot7ZAwwn4vHFw/hWVaHzWyqV9sFOiw0p9s1xK96+UmNFSzJ4rPFXK+nu5lK6NQb0yqXBoL9iLdSoub2IehusweNONPcTHFxQqYPVbftaCI5z9jXfpfZGgCdiI/8HqskW/RVeawEZAQL9K2Bxw2c1GRo+D284lcvNWeobkt8GqxDOUAqtt2ta8tGIHAq/7UUOvfF2Fga95KZAbhVymw/Oc1XpV+2oismK8C4dtH1N93LzqKzA== 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=k1d43oNOQj4hNey9pwcUOZAYE4Ujn1MA45S+NeAiJvg=; b=P60gXjucs5py6HXNM/rjY4dzJGvRbZHelNnigj2t/+l6kinvRlC1rvWQ9pIf/R5jyn7Yt5a6PQDKQwy/3DzVwn+74IRpNhRfPxE+liR5iGBn0MzSTXQQqUEOGLtyC7V/SbPWwepkXO1o9X+XXxBICg/x4/6CZ8zTk7UMVj4XW7o= Received: from BL1PR13CA0330.namprd13.prod.outlook.com (2603:10b6:208:2c1::35) by CH3PR12MB9283.namprd12.prod.outlook.com (2603:10b6:610:1cd::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21; Thu, 1 Aug 2024 11:20:11 +0000 Received: from BL6PEPF00022572.namprd02.prod.outlook.com (2603:10b6:208:2c1:cafe::4c) by BL1PR13CA0330.outlook.office365.com (2603:10b6:208:2c1::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.14 via Frontend Transport; Thu, 1 Aug 2024 11: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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF00022572.mail.protection.outlook.com (10.167.249.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 11:20:10 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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; Thu, 1 Aug 2024 06:20:10 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 1 Aug 2024 06:20:10 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 06:20:01 -0500 From: Vijendar Mukunda To: CC: , , , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , open list Subject: [PATCH RESEND 27/31] ASoC: soc-acpi: add pci revision id field in mach params structure Date: Thu, 1 Aug 2024 16:48:13 +0530 Message-ID: <20240801111821.18076-7-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801111821.18076-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> <20240801111821.18076-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00022572:EE_|CH3PR12MB9283:EE_ X-MS-Office365-Filtering-Correlation-Id: 5a74b3db-931e-4b49-396d-08dcb21be842 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: 2U05r43wuv0ZMuNyi/SwobU0HOon7eZ4es44m1oj6QnfwLzjNfMmcffvDud5xuSFcSc2aUOrHWnzA7K2Jz91pO9RDvotL8eIJEPmu4HY7wu2BEtRaaWi3DUft0oTnVwqpBUxU6hld8LxCIHCNdMpo2AKPqs3dyEowhgLZKOPLS2aUuRpPVBJ3ZQl9AQSM8kbB5ZWRBWjVd8dIodfA1nC9kxSECU5hLoUBV8ptDGmxzK/kVLwv23U2ut3XSaeADFi+WaP1w+5GGqywMDJeWvnxbMKFRUklRF+EfDEZNBbFOlJ81GHlt6jhMnQQIW+JJM9CFmTp3i70hA+7B6xYeEzkEQpijB/dg4zkeIzsQZSEr7p1MHGFY1W/Ge3x9Gyw+DLOkopWqZIhdCHOp67ycHpCsqE2L0OtsfM+ZGC/RIa3rRSxLv8aKQr71Xe6nfRfhSxpFEzBxTBKy0Q6TYRxVmfoE4PiDuKWON9/+Yn+zqHeJShw2BJuFuAbiZKAwfu1x7uVd3RA78WJlwl06iwNnQZ+EiUCsL+kZhozRgyU56PX9Esy0W2id0Ov+1kWbQTxQgyrjpj+YrCOYp95CbUdiXCU9jUTjulpgkfuX3Zx8oYjztwVlaqrfWTzg8KZ4LzI82r4QHxW7UltWm57Cj6hE1jEFT1tsBD8C7awxJaXT9wbsmeH0KtnFjVIsV9E9DHG9Rl0cAlGPuvvgBNmy/eYpmmMLDaCyf+z2s0rljQjDhZRXxjmxG7jfpGElY5sGc7mb5EqXKYFnzZUVVNlyejksLnBYrtWX9f1W/+N+ynYZ30r24QAuQOtz7orZrkq57Fuf7WDQaq+3lwuS5TD7vOrpDTJ4xrAEiw6dIv25VOISfB4SSdHkrhNOqJOb1oLhgm8fXXHCgSkLg7fYlL4VTGehBozeu/GU0OVY1DO05pFcFNKZKxD1BH6vydnzSG+6azgOvOmsKgDFhkOGWPoGd+jm8xgg53J3zFdUagFLMvMQbOTncolpXL8swujsiz0ZcKHVB+thNSD6mu/f+6tRWF7jPKnE4bdYzyrTztGcay0HzHi1rGTBQA9JhSLrCeeeFusDWYLIa1oCTwjQIYEPoDN0Ql8+4jmWDI3qe/i4sQfPGFTaNmFoldjOvJZODTM1fylQovJhvKUnid1UDfmaglphB/8TLSfhxmxajIKdJkRFZtJt8z+OJIB3ua2o0XK1SH24t/Z3FVn7A9Ec37lo2dgZaA/bgeTPugijy9oAuwrmloQxvWFJJmQIGTj6k9tMNVmbSHUhaYaPcWwc4C6ik1B6Eie/AO++N0fZxR/NUmF8mIH2kZIqo3MZwzdBhD37Z4iQXRK4gZ19p0Qg56SZcESo+6nI6Wsgc+HM1nRgFAKUYwbF7G3bYTbIq0CnKNpjxXXhdWFpURtt+sEukkMuBwpJC0mg== 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)(1800799024)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 11:20:10.9658 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5a74b3db-931e-4b49-396d-08dcb21be842 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: BL6PEPF00022572.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9283 Message-ID-Hash: FXBPTPW4D7N7L7F66YYQADCH66SMVMH7 X-Message-ID-Hash: FXBPTPW4D7N7L7F66YYQADCH66SMVMH7 X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Few IP's may have same PCI vendor id and device id and different revision id. Add revision id field to the 'snd_soc_acpi_mach_params' so that using this field platform specific implementation can be added in machine driver. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- include/sound/soc-acpi.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h index 38ccec4e3fcd..b6d301946244 100644 --- a/include/sound/soc-acpi.h +++ b/include/sound/soc-acpi.h @@ -70,6 +70,7 @@ static inline struct snd_soc_acpi_mach *snd_soc_acpi_codec_list(void *arg) * @dai_drivers: pointer to dai_drivers, used e.g. in nocodec mode * @subsystem_vendor: optional PCI SSID vendor value * @subsystem_device: optional PCI SSID device value + * @subsystem_rev: optional PCI SSID revision value * @subsystem_id_set: true if a value has been written to * subsystem_vendor and subsystem_device. */ @@ -86,6 +87,7 @@ struct snd_soc_acpi_mach_params { struct snd_soc_dai_driver *dai_drivers; unsigned short subsystem_vendor; unsigned short subsystem_device; + unsigned short subsystem_rev; bool subsystem_id_set; }; From patchwork Thu Aug 1 11:18:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816290 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 (unknown [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 23C23C3DA64 for ; Thu, 1 Aug 2024 11:26:45 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 559263E20; Thu, 1 Aug 2024 13:26:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 559263E20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722511582; bh=+jN4DsfvQgeQPKEtYa748iZOohmyJb/7aSkaMJeXSgc=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=kIsKTAzW1suXeYd55XFk/Yo5XEZDp9vA+UaAD+DyGUrGGJjTiBfA3mmwIXeo6iaEJ i345RUex6IXsF1By/f1nnz5TOIUuKOzRP/lnggbON74jb451der/Khp9a3Ni++aU6X r290wDcPbwlMfBIQ6WI3JKO5zHJgSg8dX5KnQCtg= Received: by alsa1.perex.cz (Postfix, from userid 50401) id EE43EF80680; Thu, 1 Aug 2024 13:24:48 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 4D13AF80681; Thu, 1 Aug 2024 13:24:48 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F2CD9F802DB; Thu, 1 Aug 2024 13:20:57 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20606.outbound.protection.outlook.com [IPv6:2a01:111:f403:2412::606]) (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 7779EF80269; Thu, 1 Aug 2024 13:20:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7779EF80269 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=TQcwuLD+ ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cDD0f+t5kaHoXWIsYCsaWqlzQjIGzL62lVKxN3pHNT8D/j6zulmL69eTD0vo9nbE1dJimPW/VowzB3sNn3rNyN/GmhoiYbv5/wD/2S38oU/oKu/M2j3CsKjZ9DMvwfRoQcVmEMNCani6lW/P/TqnVoxoDB8GH0oM9RTDnXbBVw00/W8d7ro+kKW8zu2fqRkCNY//6KIyvKo0+dI4PBiFmLT2UxQL0tbAlIThUG6dd5cuUapVT7WPEHMGEvUQ/P+JtpLtVhSmPVIxg8OwmFXgFUqYW9f0LBTyqvVd9pgDe0vYaYc2HLiCewxxf365HMb0NgN6D4QUUM1SjvzPn8dh3A== 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=VrIta7C4C6avlHixZ0x4CVjBu2XXbz4hTDAbz6r/g9E=; b=ML2n8DadOiAsOmAHhliv7Bmk/0yyP6kU3K3518B7dO0hyrnKiT+3d2m8lqYDZK1SvoxV+Lx92e4iEkkduvb+yMT/62XZavCmLivr5TpZ7oO/jH1jxQfQqKR+hCqrCEQGpfKVYkNwt+VnrruYdaSsPCBKc7xOxIa5byDdG5IEZmgGYIvXEIxSPhJEATWJ/VpnIe4Bf5lYtOCjQsoQsf4z65xL3ygxAxY06tF2xcq+d8lQ/43zIJs4OIKm+FqNoqx3bQ3Y1JPLjGYrjyeM0iXERdO3Egly9R5OHNmaQvffWJ9ADRjDTuZCJtNn1QCf+TIAzFu8/qNbqdC8DhC/aWgLbg== 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=VrIta7C4C6avlHixZ0x4CVjBu2XXbz4hTDAbz6r/g9E=; b=TQcwuLD+2sNjP0qA34clr6ucf+TlGpk0N/SX/hUDSjtvozuw7hVhwhLaavZTTTLT6mb+E+0ysDxpp9A1PxfcnpnwBRxlmb9kvNUdOc8pzAJEjd4S+TOkTHRuoKwZhzWDy+J4IqxhOK//tJTgkZnjlyq7QGi/tw+uLxc2praMylU= Received: from MN2PR20CA0039.namprd20.prod.outlook.com (2603:10b6:208:235::8) by MW6PR12MB8867.namprd12.prod.outlook.com (2603:10b6:303:249::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.26; Thu, 1 Aug 2024 11:20:42 +0000 Received: from BL6PEPF00022571.namprd02.prod.outlook.com (2603:10b6:208:235:cafe::1e) by MN2PR20CA0039.outlook.office365.com (2603:10b6:208:235::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22 via Frontend Transport; Thu, 1 Aug 2024 11:20:41 +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 BL6PEPF00022571.mail.protection.outlook.com (10.167.249.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 11:20:41 +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.2507.39; Thu, 1 Aug 2024 06:20:41 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 06:20:30 -0500 From: Vijendar Mukunda To: CC: , , , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Peter Ujfalusi" , Ranjani Sridharan , Daniel Baluta , Kai Vehmanen , Syed Saba Kareem , Arnd Bergmann , Marian Postevca , open list , "moderated list:SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS" Subject: [PATCH RESEND 28/31] ASoC: amd: acp: add soundwire machines for acp6.3 based platform Date: Thu, 1 Aug 2024 16:48:14 +0530 Message-ID: <20240801111821.18076-8-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801111821.18076-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> <20240801111821.18076-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00022571:EE_|MW6PR12MB8867:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b7de8ea-fa0a-46a6-2fb0-08dcb21bfab1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|376014|7416014|36860700013; X-Microsoft-Antispam-Message-Info: q3whCjJRAZ6sSFdLp7mFhov1QPjPUGdqzUoxfzGyJ+bn6jN65CuLzMKZzxGFDmHpGb+r5b2/s9+kV259QYGa4oFUAAVKVYdbhFqHwp1KWdx0DbKxVseBc2ZzIAexak73oZZ1tCnE5FqZX7I+PGw1Eo1+WR1y6sH3Cr121VS2tQ381G+K6AKpIFJSM1Ph3HmP1Jld4LUL+O1l62ipfjZ8o0Mbg6fn+4vNo+jxAQPb7+3Kva8CVj5477fmRqL3PKlc1UVK+RKcj55rNnUweRvqYvg50DZE3hJBAmn+/QgHWJlpFpvqd6J4l+bz44mUg5Gd17Wcy3+eZjnt086F/6h2xn+M1O5FdP4epLRB7vURqZIlKvCArsgGOwMOWirGc9Ei0889MLbJ5YfA1gez4+tiGQ6KOdQoEniZQaICcpV3NE3c5/JPFq0RYLBnRZFg4MvHLxODpiFS7ynt6rckoiAOzclde2bmVnOaGDoybA9/pQCqQsZsGjTYDNClRj6XqsbXu2zLcA5vno2QujpIUE2sPV/snfVmYR9Ufh1FJ/3kYBEJe4u6wwbCe0Wmc5TszOgzJL3i3HCJfDsif92zRAq8xK6qAV3v1wOEm2EF3D7ZPY8mUIau9JYy3Dtgb8KD8xHczlPLKrnyCQhH8vJO9/QSQu8GS+vkzjfi48PUx9wnmwFbsRxHp+3ph+wmjVQmQsU7hZBqLJqz629lmMHRQe2CJ3+jdNxUJ2+aMLzQmZ6lOCEAGPkpYboTHvtyyGmyZdZxgJAtbTbhBU49JfifyLpsK/I8Bo23a9dry5bBbiajO+/Kb2MNlnfCgC0OmTeRsu3as5oF8ZoH+Tqmymg4U5bq8shpgYAnjmxxdau3UMhQNeRfyD5uquij4bE4UZouh7XpAihq9d/Hc5C+Od46QBA/VATOE2BBazoKRnJ4m17oX19MJssA3Zjpoon3QQ1j12T6+mdlv7WxVZHKA0BlAAqGJ+ubOBoad6AtJoh3HBTePH1gN/ZSGxb1SjPCptGAoleLtXaEWmL5X3SOFySM4LcMd85ElbHEd6SK4Tz7+G8KHBKvnay1y3OkW44vHZnNdMWlNjOr/YV/36z1oBL0Rhn90I/64p9xR5cUBKVKViqL+HczbXKDTtp0Hox1UGFnn7F4UrU84sk8VSqqKS1jEesoLaAXFToAyXQSLIzfD1D81x2SocFMIGIoM5e4S2ETWncVChKC75dBY98itYc+MVVI7el6qbdney5/HMZdvUgy5EAV5FjNcphp4hTITbA4jBC3sr7Zf/7iEbAG1imSnmA3OOyjeVWUJSS/5ZYZXDv70NViz5QhNMDH41bpDEjey5bYphubl46ercy0OEomdjIziv7yHDvQnk2lndR45O/2tmdtuYFn2ngi3/iu9TvqNPI37d00tg1M69eeQqizsfRaKQ== 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)(82310400026)(376014)(7416014)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 11:20:41.8763 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b7de8ea-fa0a-46a6-2fb0-08dcb21bfab1 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: BL6PEPF00022571.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8867 Message-ID-Hash: 6AZP7N3EO44VSI5L2OQK4N3SOKWOJLLV X-Message-ID-Hash: 6AZP7N3EO44VSI5L2OQK4N3SOKWOJLLV X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add Soundwire machines for acp6.3 based platform. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- sound/soc/amd/acp/Kconfig | 4 ++ sound/soc/amd/acp/Makefile | 2 + sound/soc/amd/acp/amd-acp63-acpi-match.c | 90 ++++++++++++++++++++++++ sound/soc/amd/mach-config.h | 1 + sound/soc/sof/amd/Kconfig | 1 + 5 files changed, 98 insertions(+) create mode 100644 sound/soc/amd/acp/amd-acp63-acpi-match.c diff --git a/sound/soc/amd/acp/Kconfig b/sound/soc/amd/acp/Kconfig index 30590a23ad63..19859b1b73c5 100644 --- a/sound/soc/amd/acp/Kconfig +++ b/sound/soc/amd/acp/Kconfig @@ -13,6 +13,10 @@ config SND_SOC_AMD_ACP_COMMON This option enables common modules for Audio-Coprocessor i.e. ACP IP block on AMD platforms. +config SND_SOC_ACPI_AMD_MATCH + tristate + select SND_SOC_ACPI if ACPI + if SND_SOC_AMD_ACP_COMMON config SND_SOC_AMD_ACP_PDM diff --git a/sound/soc/amd/acp/Makefile b/sound/soc/amd/acp/Makefile index b068bf1f920e..516a44f3ffb6 100644 --- a/sound/soc/amd/acp/Makefile +++ b/sound/soc/amd/acp/Makefile @@ -22,6 +22,7 @@ snd-acp70-y := acp70.o 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 obj-$(CONFIG_SND_SOC_AMD_ACP_PCM) += snd-acp-pcm.o obj-$(CONFIG_SND_SOC_AMD_ACP_I2S) += snd-acp-i2s.o @@ -38,3 +39,4 @@ obj-$(CONFIG_SND_AMD_SOUNDWIRE_ACPI) += snd-amd-sdw-acpi.o 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 diff --git a/sound/soc/amd/acp/amd-acp63-acpi-match.c b/sound/soc/amd/acp/amd-acp63-acpi-match.c new file mode 100644 index 000000000000..be9367913073 --- /dev/null +++ b/sound/soc/amd/acp/amd-acp63-acpi-match.c @@ -0,0 +1,90 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * amd-acp63-acpi-match.c - tables and support for ACP 6.3 platform + * ACPI enumeration. + * + * Copyright 2024 Advanced Micro Devices, Inc. + */ + +#include +#include "../mach-config.h" + +static const struct snd_soc_acpi_endpoint single_endpoint = { + .num = 0, + .aggregated = 0, + .group_position = 0, + .group_id = 0 +}; + +static const struct snd_soc_acpi_endpoint spk_l_endpoint = { + .num = 0, + .aggregated = 1, + .group_position = 0, + .group_id = 1 +}; + +static const struct snd_soc_acpi_endpoint spk_r_endpoint = { + .num = 0, + .aggregated = 1, + .group_position = 1, + .group_id = 1 +}; + +static const struct snd_soc_acpi_adr_device rt711_rt1316_group_adr[] = { + { + .adr = 0x000030025D071101ull, + .num_endpoints = 1, + .endpoints = &single_endpoint, + .name_prefix = "rt711" + }, + { + .adr = 0x000030025D131601ull, + .num_endpoints = 1, + .endpoints = &spk_l_endpoint, + .name_prefix = "rt1316-1" + }, + { + .adr = 0x000032025D131601ull, + .num_endpoints = 1, + .endpoints = &spk_r_endpoint, + .name_prefix = "rt1316-2" + }, +}; + +static const struct snd_soc_acpi_adr_device rt714_adr[] = { + { + .adr = 0x130025d071401ull, + .num_endpoints = 1, + .endpoints = &single_endpoint, + .name_prefix = "rt714" + } +}; + +static const struct snd_soc_acpi_link_adr acp63_4_in_1_sdca[] = { + { .mask = BIT(0), + .num_adr = ARRAY_SIZE(rt711_rt1316_group_adr), + .adr_d = rt711_rt1316_group_adr, + }, + { + .mask = BIT(1), + .num_adr = ARRAY_SIZE(rt714_adr), + .adr_d = rt714_adr, + }, + {} +}; + +struct snd_soc_acpi_mach snd_soc_acpi_amd_acp63_sof_sdw_machines[] = { + { + .link_mask = BIT(0) | BIT(1), + .links = acp63_4_in_1_sdca, + .drv_name = "amd_sof_sdw", + .sof_tplg_filename = "sof-acp_6_3-rt711-l0-rt1316-l0-rt714-l1.tplg", + .fw_filename = "sof-acp_6_3.ri", + }, + {}, +}; +EXPORT_SYMBOL(snd_soc_acpi_amd_acp63_sof_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 7af0f9cf3921..32aa8a6931f4 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_sof_sdw_machines[]; struct config_entry { u32 flags; diff --git a/sound/soc/sof/amd/Kconfig b/sound/soc/sof/amd/Kconfig index 2729c6eb3feb..848c031ed5fb 100644 --- a/sound/soc/sof/amd/Kconfig +++ b/sound/soc/sof/amd/Kconfig @@ -23,6 +23,7 @@ config SND_SOC_SOF_AMD_COMMON select SND_AMD_ACP_CONFIG select SND_SOC_SOF_XTENSA select SND_SOC_SOF_ACP_PROBES + select SND_SOC_ACPI_AMD_MATCH select SND_SOC_ACPI if ACPI help This option is not user-selectable but automatically handled by From patchwork Thu Aug 1 11:18:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816063 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 (unknown [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 50B85C3DA4A for ; Thu, 1 Aug 2024 11:27:45 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4C2C134B4; Thu, 1 Aug 2024 13:26:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4C2C134B4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722511613; bh=CbYImhZEIlZiKsrtnBHhWoYSCtRUOfibwlmFEjkc2eA=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=M9G3OlA3hoOFASkzoEoS5y4S6wR7OsMuYHAOpalIKs8kZipMnBZiDZaIf59TyU8X5 pW0DBc8vEcLbYUuOdlWWw8oeT1JKh4rDhAHORwlhJxkFWd24z2wv9EgKufrpBfYYIm l01WI0elIBteGHvPwdaEmD0YOESXaz7OxvxTLcx8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6DCC6F806B9; Thu, 1 Aug 2024 13:24:56 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id D2965F806B6; Thu, 1 Aug 2024 13:24:56 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 85FFCF802DB; Thu, 1 Aug 2024 13:21:07 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on20600.outbound.protection.outlook.com [IPv6:2a01:111:f403:2417::600]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 26203F80269; Thu, 1 Aug 2024 13:21:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 26203F80269 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=u3y8I57o ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HylcjWHw0koJjkY9Q06LfxOG+VR2rQ24R+XyW5lBC+g5qKJlXtGM3iwf2x5X0YyASOwKaT9Ony6R5B6WsiYAKHuqckxD/g52gf1zX19Llm8ct/biuu+sGQOSSp402F2UIZBoNWpGhySDl2IeVbMCGYCgRNBfSllIWfAziHUD7PxDcbMVdcEoVJ50Pos8fVKG6CFRjuEqoG+ZcXjbtYKhHOrrNg8nzRcVjU89YmOxRtm7ZRYLYYixd9Laq0pz/dmahi4151/LrUrQlROafnEV2xf3h19kxpG2eBnAql4ie9EKLp+em0Zl+JVpYqdx3BNq9mvQIa0CdF21IZ+9VZUjYA== 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=uUsplPx+YA0cFRGB2LqLmG8miLuC4SkwCzhd7b0Wktg=; b=ek7duwUiELTXLUUsM5Wccf6J/kAAVy3lwe29dGjDoZ8UdU0cWeNkpF5wAumAloLxWllCQ7eLdUaJVx69Q7V/KW8LY9YI/DJ0F6wrctDYnIolL8uuMRxBsLfzsNrW3pIcklFCz4+mR/clap3DiaVV8ryw5xHBiztkEnJcBcP7Gok8E/nTGAJwIBAzEW0/4GdEVBxVBMNbRf/jvPps2KyGIwq5M7FOM6zhrlN8+8ZADb8GrumVBGxyfB+x4qBHKVR/whQkf6THp+R5tHGhhMSSJifdM6PgEm7nBF/E7nVhINiOL5wuZkcgTlqAPeNyX0XA5OmjXIF+hew0wyC7gX/RdA== 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=uUsplPx+YA0cFRGB2LqLmG8miLuC4SkwCzhd7b0Wktg=; b=u3y8I57oEd15R+q6wmgGY4dfHgZH2G/UQjkeH3gv2GxkGoH0D8P0YKtimeadxHbtOIwJXx09JjW82acStuOxVjUqRRQaISMZN7KQzgIv/BDS5ew5r9R0xVEtGDwXtXvnIpbyukPYhlX07F2c03PYxEJmV64GwtFdxyQHf4g57/g= Received: from BL1PR13CA0329.namprd13.prod.outlook.com (2603:10b6:208:2c1::34) by PH7PR12MB8037.namprd12.prod.outlook.com (2603:10b6:510:27d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Thu, 1 Aug 2024 11:20:57 +0000 Received: from BL6PEPF00022572.namprd02.prod.outlook.com (2603:10b6:208:2c1:cafe::ba) by BL1PR13CA0329.outlook.office365.com (2603:10b6:208:2c1::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.6 via Frontend Transport; Thu, 1 Aug 2024 11:20: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 BL6PEPF00022572.mail.protection.outlook.com (10.167.249.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 11:20:56 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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; Thu, 1 Aug 2024 06:20:56 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 1 Aug 2024 06:20:56 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 06:20:46 -0500 From: Vijendar Mukunda To: CC: , , , , , , , , "Vijendar Mukunda" , Liam Girdwood , Peter Ujfalusi , Ranjani Sridharan , Daniel Baluta , Kai Vehmanen , Jaroslav Kysela , Takashi Iwai , "moderated list:SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS" , open list Subject: [PATCH RESEND 29/31] ASoC: SOF: amd: add alternate machines for acp6.3 based platform Date: Thu, 1 Aug 2024 16:48:15 +0530 Message-ID: <20240801111821.18076-9-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801111821.18076-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> <20240801111821.18076-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00022572:EE_|PH7PR12MB8037:EE_ X-MS-Office365-Filtering-Correlation-Id: ce8b3f57-c999-43b7-b9c3-08dcb21c03af X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|1800799024|376014|7416014; X-Microsoft-Antispam-Message-Info: KWKUfMh2avv5O2gajfYayy7nIx8r50hoFKPDSIxTmzMxQ9wCyq3ZNlzl2jOxZLEplKCdDmP+9eg706UvnsaY6jL6NzrgpEMFKWVxaKV0PysPoL1ctbCMvwYUiYHJhXdEQYKK4Ul8WTjGLXUQkYbMS+swae6BCRRXlVjhRMenTPqt+qaInyEYWvVM3b+MBJ+2lKv5FUL/C2ZXD/lfnO82+7Y+Ko5wnz+/OBSMGGF9+u55da8VfZgyxe/+0IgNyRj3eQ9uqjr9Qsy0FKk4C7HfLQYN0/07kPeRxC15rkoSle2JGp3MAe12NSeQTIWIR6fbXaeRIKwucCwLshlBKXDMhmGMFHZnvs6E5D2sinJuOdt147stGbcHR8neRE+YTbmsAC2MDMNy7ZUAOyExQImOP9ra9tITxtWemO2xSFe9k5WL/jne4U1dBrFMEQ1Qf8TVtuZtlslXN1KK4z5A9BN+UnTB0NuGe4ZJ8pZeGOvpzLQioZ2EPoM3LdCU5WX0Ue/hkLj39ggVhVEOkLc90FxSZLGtIK63YYkczPqrbpTBiTCictdN6KAskFhPtiLNPgIQ5jR7wCfY7kwUQq6UmZp0JuC0CtNE/2gmMzEPPz2YHRzGVulmHs8VjZbtWXfDG7dRIJiAcKHrnkSv0DHk4IXk644HtuuIwObwr8evnd+hdWU7NUcyuLFg0kYSbYDbP81ECqBfX3XfyDRW0eBLeUAFpG0i3eT/qLzInjQKayZ541oMdkfv9Nuq/cQH/yGQcn670+Fj0AgFXHwkhrbwjG6TObqtIcQJBKS6lIeXgQdE3iR6BYT7+nqvfTkXxZ8hSUii7z2pxKdTtTDpJnum3A/WDOJJS5Zp68lU0lOGgXgn0X+Z23JmSCp16INfvfZv9wqe5dBsX9+YS7f3X6YfnpnT4bTQDNC84cPejYxSgf9VtsNEuS2PjN10OIDco+MpMRBf+oKtg+u84w8sipYzK5/kWo0H7iADhdtkX+BwdP2tt9agQ9BHDlygVgDW1zqWa6ehCML/lbULt3BZSQ6ax/fcrgti+7Y6tMhFmV45Nvz8CPXqePJiiY+x82mFupS0bwSHxADqxHmsTnUk4pPUXIl0zNC9pSKamydBirBZl7aPNbfnVndk0Res8XKBQwZqZWuWMH9DCiqVWO/TmHucCk8OlJ1rWzCtcoFLMG5gh73hgUqUHaoBMU8ipfdLwZHTkF74QB+x8Ma3UdX0LL6KSdguldcueV7wupQIjiAf470RbxIG2MVcJpDuczC4tiVncVov81tgIa6XEEC53yPhwGjofQIzfoURK3SbC+hkwI+ufQZY8jEed2RY5HlhQcfScpEmZ3PAKlcnmvXlW9ar9Fr/jdAXZb1VzaAuNDLJingKdqO7Y/2XNi2mzqgl1CXGF0O8KAdPkQxblwwy3fK/Ki7AaA== 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)(82310400026)(36860700013)(1800799024)(376014)(7416014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 11:20:56.9662 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ce8b3f57-c999-43b7-b9c3-08dcb21c03af 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: BL6PEPF00022572.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8037 Message-ID-Hash: ALCFBKW4BD7AREMZBH3X2M6I2ZSBRLYM X-Message-ID-Hash: ALCFBKW4BD7AREMZBH3X2M6I2ZSBRLYM X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add SoundWire machines as alternate machines for acp6.3 based platform. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- sound/soc/sof/amd/pci-acp63.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/sof/amd/pci-acp63.c b/sound/soc/sof/amd/pci-acp63.c index fc8984447365..54d42f83ce9e 100644 --- a/sound/soc/sof/amd/pci-acp63.c +++ b/sound/soc/sof/amd/pci-acp63.c @@ -48,6 +48,7 @@ static const struct sof_amd_acp_desc acp63_chip_info = { static const struct sof_dev_desc acp63_desc = { .machines = snd_soc_acpi_amd_acp63_sof_machines, + .alt_machines = snd_soc_acpi_amd_acp63_sof_sdw_machines, .resindex_lpe_base = 0, .resindex_pcicfg_base = -1, .resindex_imr_base = -1, From patchwork Thu Aug 1 11:18:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816062 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 (unknown [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 C05BDC3DA64 for ; Thu, 1 Aug 2024 11:28:19 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 750803E9D; Thu, 1 Aug 2024 13:27:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 750803E9D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722511647; bh=BWY0HeMKX5j8MYwzt++fcvfMywe9slgt84bF/F1opb8=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=n4QFikG7/zHk1QPywAV24mgZHLP0UdJg3Ejq+5YIWNIbUyibsBLcDV+gSVw7Ac+G0 54EVRXiQTUXPyAX4brkr3FOSUikudrGIjM/mKmALdxLk3zVG7LQjVbfm0UtEZSKFvB An0Z0K/0dFy4C/wb8gilnMKzNHvzG8iaa6slhZ9g= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 42D7FF806E0; Thu, 1 Aug 2024 13:24:58 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id B9DA9F806DD; Thu, 1 Aug 2024 13:24:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8FE4AF802DB; Thu, 1 Aug 2024 13:21:31 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2060b.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e88::60b]) (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 12669F80269; Thu, 1 Aug 2024 13:21:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 12669F80269 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=ZTXKkDVX ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=k0F5TAnAlbUJrtFGjvMtSxU5661OcOtoxKgYvjAjITBMn9mD734Qm4+OIlGVxGt4KFS+5gGSGvpEeCl/nHuxeh//JvGIsrjuNNI8rWfQUi17QjUsfUXzn5qxp8QuOnamGPX4MSYWvyPicNiuU4Xb+WTv8CEWidkVMyTjQTahm88gWEf2LclC9gOoVazB4sNmw4EbKNJfmatOxEt8rPyGxXUKyaoRMFKPe6VG5hFoVy0vX6ZAWg5rygJ8+xlTUMTHZpVnJAJPPsya73Nu6J/h+vNYwE0ZIT9t31k3QubiHGMxKSChb13j00SiDSy9ttPq8DauRNfhhN1RIiBRjWD2tg== 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=IkZH9XUeUOi3DFK573qstKi2PUYImuCo1rsunQifSFk=; b=iF86hDG2ob0d6lmaWWS4l7gxnLps/kWL17vb8QIUfvuraCD9ygWwDy+wgqwD4KQiAzNlIdr0uzCsw1c9OlSid375+5qv0JVVRytElRvbLitxx7qIDcEjSOjUNCs8eYc8qbd9C4NJLrl3wM5zugB2x2YIT809n5zgkoLGoYoMF7HMMmrP4/AJhEO7WcOv1m20uNnzIk8sUpU9/MeYYc9+p3PlO5zSmtK2R4DBWAQCkqdnvMLzpJOVdJlxe2dOABxyrE/OrzyPHDmPe2LL4wTO7LBMqdgTpKPHNcovmTqRy0L4Xrm+oUcXZpeXEvarkwFvZVX9P7cEmL7WViF4eaRuPA== 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=IkZH9XUeUOi3DFK573qstKi2PUYImuCo1rsunQifSFk=; b=ZTXKkDVXsnOgmlzpU2/VvU1rpY9Q0wZEiSECmetTYnGCnEBdADzoRieIXmkTTQhN1mRykJqQk3omgou8SaLBIhafpJx9tKotOWYRo9uAbWG0UNpL7XtwyWlvho+U2kwOlwoh74Tovth6ALTGTTrMBqvaForH8LVKGM2Ds6rgcfM= Received: from MN2PR20CA0050.namprd20.prod.outlook.com (2603:10b6:208:235::19) by DM4PR12MB7550.namprd12.prod.outlook.com (2603:10b6:8:10e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Thu, 1 Aug 2024 11:21:17 +0000 Received: from BL6PEPF00022571.namprd02.prod.outlook.com (2603:10b6:208:235:cafe::ef) by MN2PR20CA0050.outlook.office365.com (2603:10b6:208:235::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22 via Frontend Transport; Thu, 1 Aug 2024 11:21:17 +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 BL6PEPF00022571.mail.protection.outlook.com (10.167.249.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 11:21:17 +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.2507.39; Thu, 1 Aug 2024 06:21:16 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 06:21:06 -0500 From: Vijendar Mukunda To: CC: , , , , , , , , "Vijendar Mukunda" , Liam Girdwood , Peter Ujfalusi , Ranjani Sridharan , Daniel Baluta , Kai Vehmanen , Jaroslav Kysela , Takashi Iwai , Krzysztof Kozlowski , Wang Jinchao , Cristian Ciocaltea , "moderated list:SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS" , open list Subject: [PATCH RESEND 30/31] ASoC: SOF: amd: update mach params subsystem_rev variable Date: Thu, 1 Aug 2024 16:48:16 +0530 Message-ID: <20240801111821.18076-10-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801111821.18076-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> <20240801111821.18076-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00022571:EE_|DM4PR12MB7550:EE_ X-MS-Office365-Filtering-Correlation-Id: 0c30efc9-460a-4c9c-6a3a-08dcb21c0fbd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|376014|1800799024|7416014; X-Microsoft-Antispam-Message-Info: x8Rm3qFF+/TIYMZJSjVLCMd9ybPXj1QcC4GYZWvmRtNrUWDuR3KkCwcrIlVUSJOsZEPGWkhTWdkNV77C+PQi0naULraODv72IE//zAzo1cP/24THNKutTM/IXr6znwAKtZwDlw1KbgKFYQ/V9uKujg49UrGz88JwKfyJy2FzIEY0HZFqPbINM0dniRKAUmOfYP6lDo6LdJ/Vvcz81D0+uyYIaryAp0whAGSwyX/q6zObcQNv6pd1g7paqx+fdj7V7TVPHeBley3EnkDV0//8pBvj3og224x9Q0IRAoTsEs87t29dfRHy/uFhqpWj7/MOKa7i7/YrfhBuoEKsVgkzWrLPzh6CbAnlLC5PwIJMnZHmLsE+gGqn8Z3AYXVa5OgSKp2PoQ+0M2cZ8csOBST+uAZY2GGzuo4IUFDBRs8czy/6CRlHbb68O5KbRpDw9uxVlz+56aNgGipWlyyOYdduLDtOg1r7Wbe6xnD81JvcufUAfeEsr9kDVoJXOupantnSvVgvC7L1uDQUCzNdh0ymz9SOY9pRgncWwik/owfFsmBRsu8CfP76/g+A6PXdHZ4EJCVqL/ujYKefitcdjMwEGjDhxaq2kcmK6uXi/qAsf20XJev3Ns+Um/vNeFH48mBzgW2PaTotb7Vh7ROwypw0x0XSdDG5mffpgrIfez5t6Q9lgsIGNm/V8BBxIhGjs2Qfek7Yc58FWanQvzFG8MR/jboSkA5ox3HHp8vNvalrqewMReChZjouzZQj7W1/yqz2G1mgZlkY3OqH3Y67NQ5Y1St7CuOBUZEUmjc5t9/C2LSAooiHa8fa3ehcp2bEFpMn6RxD2FsRLmCUi5QwhOta97WzDSE9cwLcF1keEPuFCeOkez/XMgzS1jML3rZDKHSLXyLQa8PNq8X2dDD1/eMY7YR1diWrrKwiRYHeY1IMw+Zq0w9HpilMcmaCVAgceJ4zlriH2Yz1dZITFJ4qaBTqbT0oZACfSjad3Ud2cdcUVh5zLo8lvut1Z4mFSmvGSjaNhL5VdRQdbZF9J3qY8Hf7pmkFvbLHvdsWZXZJJwsCbqvZVhh83MYVv4VfdtoDG+I9RyNpWzkUFSvUKD+BXehAZkqrPpP28RmxnESVM/LvJ/NvQvk4Fx7HtVoG52buWT3l2Ezp3acr9z9O2PohJ1D1Yhhe6UAwDTyFNtp4kB4Pa86kY2QBlAz3O/wXKsItsTs96dp8zpG/hXqLMYn4eREZjL0IznMi1J0R1akG7C3Pk2wXPHcnF9zqDwHMKir7uwGrlRZjp03CNevwL3oUkDtG0X4UoFrUzM58BEHQfwP5T+ohqlNIU0Wdj4OUBKrbM3bQubD4yBqDHLw7gzUyNbgAxvfEI6XL+se5KZVqSnRIHJZ+n1VLxc0ppnI3QeYH0P9Y 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)(82310400026)(376014)(1800799024)(7416014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 11:21:17.1886 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0c30efc9-460a-4c9c-6a3a-08dcb21c0fbd 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: BL6PEPF00022571.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7550 Message-ID-Hash: YBBVE4ZUCL6WARAONGMCVJZKUSUZIESE X-Message-ID-Hash: YBBVE4ZUCL6WARAONGMCVJZKUSUZIESE X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add pci_rev variable in acp sof driver private data structure and assign this value to mach_params structure subsystem_rev variable. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- sound/soc/sof/amd/acp-common.c | 3 +++ sound/soc/sof/amd/acp.c | 1 + sound/soc/sof/amd/acp.h | 1 + 3 files changed, 5 insertions(+) diff --git a/sound/soc/sof/amd/acp-common.c b/sound/soc/sof/amd/acp-common.c index 81bb93e98358..dbcaac84cb73 100644 --- a/sound/soc/sof/amd/acp-common.c +++ b/sound/soc/sof/amd/acp-common.c @@ -153,6 +153,7 @@ static struct snd_soc_acpi_mach *amd_sof_sdw_machine_select(struct snd_sof_dev * break; } if (mach && mach->link_mask) { + mach->mach_params.subsystem_rev = acp_data->pci_rev; mach->mach_params.links = mach->links; mach->mach_params.link_mask = mach->link_mask; mach->mach_params.platform = dev_name(sdev->dev); @@ -173,6 +174,7 @@ static struct snd_soc_acpi_mach *amd_sof_sdw_machine_select(struct snd_sof_dev * struct snd_soc_acpi_mach *amd_sof_machine_select(struct snd_sof_dev *sdev) { struct snd_sof_pdata *sof_pdata = sdev->pdata; + struct acp_dev_data *acp_data = sdev->pdata->hw_pdata; const struct sof_dev_desc *desc = sof_pdata->desc; struct snd_soc_acpi_mach *mach = NULL; @@ -186,6 +188,7 @@ struct snd_soc_acpi_mach *amd_sof_machine_select(struct snd_sof_dev *sdev) } } + mach->mach_params.subsystem_rev = acp_data->pci_rev; sof_pdata->tplg_filename = mach->sof_tplg_filename; sof_pdata->fw_filename = mach->fw_filename; diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c index 74fd5f2b148b..7b122656efd1 100644 --- a/sound/soc/sof/amd/acp.c +++ b/sound/soc/sof/amd/acp.c @@ -695,6 +695,7 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev) pci_set_master(pci); adata->addr = addr; adata->reg_range = chip->reg_end_addr - chip->reg_start_addr; + adata->pci_rev = pci->revision; mutex_init(&adata->acp_lock); sdev->pdata->hw_pdata = adata; adata->smn_dev = pci_get_device(PCI_VENDOR_ID_AMD, chip->host_bridge_id, NULL); diff --git a/sound/soc/sof/amd/acp.h b/sound/soc/sof/amd/acp.h index 87e79d500865..ec9170b3f068 100644 --- a/sound/soc/sof/amd/acp.h +++ b/sound/soc/sof/amd/acp.h @@ -251,6 +251,7 @@ struct acp_dev_data { bool is_dram_in_use; bool is_sram_in_use; bool sdw_en_stat; + unsigned int pci_rev; }; void memcpy_to_scratch(struct snd_sof_dev *sdev, u32 offset, unsigned int *src, size_t bytes); From patchwork Thu Aug 1 11:18:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 816289 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 (unknown [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 C7DB3C3DA64 for ; Thu, 1 Aug 2024 11:28:00 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1ACB13DCC; Thu, 1 Aug 2024 13:26:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1ACB13DCC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722511628; bh=gjVfaO7godzl4qc/FIQYwvRqdMT5PkQX2OQJc8nRRfs=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=DOyh6abYkwQGLlH1qIh8EmyVV9abYxZJhFECaajzmBLDs6RhYMIjQ84HOz8fuS2F5 depApMY9wgB8OIjW7PBe/g7R/Ig+oJzSn19DUkfKhDSWDduYjsRtlhdzZdg6sopinx xKZCIjhSPG9MyecWa7xc6BuYB+ENmLG5/qpRFyFU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id E4E5AF806AC; Thu, 1 Aug 2024 13:24:59 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 41213F8071F; Thu, 1 Aug 2024 13:24:59 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CA32FF8026A; Thu, 1 Aug 2024 13:22:07 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20600.outbound.protection.outlook.com [IPv6:2a01:111:f403:2416::600]) (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 3E2ACF80269 for ; Thu, 1 Aug 2024 13:21:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3E2ACF80269 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=XP9Ka1ik ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=keM5li6yXHTaeCMEEvXqn0L5BlIrgTRI7PPEzoAyqwN7oD88DaubbWdUIpFvrf/3IiSta9yhVV5NbfTkhgyvXpjMVsy2Dtag1vXYvQNiABTgqVHqpJ4s00tSYCMI17p+J5dutGTKG1nQ+qCxtBLGs9Vvq1g/q+gf9IqKSETgfh3i6oW0/RnOp+ix9frUnytcRKa233WVEI5JoYfFovsbYgWYlzhEc9Fs0P0qEHESi8qDWne8i39XYBWXRrO5IQmvDJs67RPMk+yz91pdM86lA7TpSrtl1JJYlhjxYXaKQ0Girm2nzpEeBt0x7J4Hp1zIAgTvTJoQMxjkYcHLtC3zEg== 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=Rlz4Sgo7zIx58RR6CkdBAmxgTcXU0KqACOvLkkyfF7k=; b=KnRgfuFMvUuhV3Vl4xqWP5vDmFMLN/fIIxn1P07vP5q8yTMYEZtkGK2OcmXG1eiE2VmirFTr6Oo8auaGokqGs2iuWZY5EKM3OBAQLZQa83n/KJVhexeoYFLV2/7NA703AcTBpy6+dZl6syDtCuLA9f4jNoZG/b6OPHkldglUIpssJOQ+zG8BXgwIYNmAsrBkKseuPeKaxHbp3du9UKkcOfBnIeRaoAIZNaUE6cBEsiZ3IkUNQS2jWWn8qGX8M62oQFhVG2kxjt6R5dIMgj2kHLlDv6YPlq2EwfvCG1iaPGdwCjwIhBx4z6rMMsI5BULWGWzfl/l9IE9CcjoaaMCehg== 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=Rlz4Sgo7zIx58RR6CkdBAmxgTcXU0KqACOvLkkyfF7k=; b=XP9Ka1ikIV3JGpY5vEbqIBXZtbbwC2n559Q3qbm4sMgtTAWggjQUTvjMbAlnXzUp3MC1d1Yc9vr43vdzsbUl0lOX1NjNhBeoJXpOAcRFy9vAny22ZOOX2nSM1Kmg2yahEOaJcQSnTOEe36cR4Xpvg0qEk0MOpP3iNLgqpq/MxSQ= Received: from BL0PR03CA0028.namprd03.prod.outlook.com (2603:10b6:208:2d::41) by SJ2PR12MB9139.namprd12.prod.outlook.com (2603:10b6:a03:564::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21; Thu, 1 Aug 2024 11:21:47 +0000 Received: from BL6PEPF00022570.namprd02.prod.outlook.com (2603:10b6:208:2d:cafe::cb) by BL0PR03CA0028.outlook.office365.com (2603:10b6:208:2d::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend Transport; Thu, 1 Aug 2024 11:21:47 +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 BL6PEPF00022570.mail.protection.outlook.com (10.167.249.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 11:21:47 +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.2507.39; Thu, 1 Aug 2024 06:21:46 -0500 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 06:21:36 -0500 From: Vijendar Mukunda To: CC: , , , , , , , , "Vijendar Mukunda" , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , "Syed Saba Kareem" , Arnd Bergmann , "Marian Postevca" , open list Subject: [PATCH RESEND 31/31] ASoC: amd/sdw_utils: add sof based soundwire generic machine driver Date: Thu, 1 Aug 2024 16:48:17 +0530 Message-ID: <20240801111821.18076-11-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240801111821.18076-1-Vijendar.Mukunda@amd.com> References: <20240801091446.10457-1-Vijendar.Mukunda@amd.com> <20240801111821.18076-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: Vijendar.Mukunda@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00022570:EE_|SJ2PR12MB9139:EE_ X-MS-Office365-Filtering-Correlation-Id: 3ab17601-793c-4632-c98e-08dcb21c21a2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|7416014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: aS79psivKrI2vxHlabMRJEkO/6LanAayRLk03gyWpdDWTCXaYQsAltq9H4F2IrfR+V2/LHwB/OldIL2kpVVLEwHusJaxAz3kMjLdCgsGAyB4EmhAiAPUVWTxvQwbMJl3qON9Yc5roygmIO48iPfQItMZRp6E3b2xfBib97GdfLKgg9VQHnYLj30GaHCMOF2J24DbT+XHNrSERoXdkhXppZlcn20cbx1xKRfFKYwfpFF5r048ZZJuyvScNbVoxtc2BMrtLe/4qU6Gbx8sG057XpmLhIhK5V/bQa+0dOqMNmDxJtwYW9Jxa43t6j9NNgnrFlicD2wNMRsNZ2ne1oqTO9ThTLCrCdcp6p4iOInYVGMpoPdRlgxIV7G0+76eN8vzirly0xIG6Wl8IQL4zoe/n8xogX+heG0Ev/89wOL09OBOsU7Zc9PGttb604O3VtQOqR9AzO+xznNfLiwGBex3vLwimlhgDHJ2iGVqfXoPpxCUil32GnsAaunBfeB8LNrA25gVC64mEf+28aSiYCyxDCV8t2ljaZU5f5m9+gj91iYzq2+W48Qt5ibcim7yp8Ne8pZ+PHdZEOP8zHWFpR65J09BF/41uCvk5KXxKCuI/f4jf22m53ClF0+kuB+Z6H5ARxi+8GYFOnAWdEj/QXkV0BdIYOBQSlpziKG4DNHjI3wLFRXCHDk8tfqHTOzR/kxvbcOwFLW1bq5F0/uHVnwaEfyFsVafl+J2tp3XE7TfQuXzARmq7LX0qQiBXe2G8a8dTHJsWksrWCWIgMEqL/bvoiF8SGavgT8KIcCQBbAucsdp6U7P3xlUYHIWHosAl3pWUr/W+4Dx2zfukNb0gNXqgpnx3ZUVV2yLrg4/oZMYz3KYq8h6Hfw9H+DiC0JETHjvbdWyRY5MpOm0qH+oevmup1SiutBONnsiwybj76tDZhqeu/aX9a1jR2kLjRms8l5joTM7C6495615lMCB39KMhtFSgA2ErMj0bHIEdqLkgNUak5M9Uz4MFReobJdMkiMu9yV/TroJyFAUmZMTMcJzrP2cMfhgJm2MuRUj+K8tiYx0GDRp6gZy3ASnfxgB7QM1GzjOuFREJ6Ft4mZrdtzyBTXnQHHgq1EbD/EcybgabDI4fsmIelv9ONRV93OJ8Uq0ceIt93Nv1Pqq8ZaFeRx/wDyCY0FpMUhNPefqvBCNSJHTuWX/CQXkQ8UZ1RRrTW4xXfoQ7Rclhq+AM74fdO4886ZjvMdUA6mvMID5IJH9XoOXP8tWsYJew75par9p+VKIepDRVRvSc14jwNSNdE2OXALEPakvIuD2SnkCZx3biXaUPHiilzD30mqwUmw4CPY/tcxJEKGXfEQeV4N/eZdLiATpa3ATGMW2ba8qJjow/8f8umpUAsiz7D7ZChHpY+39TO2BGz1ReTQAYzCkX851mw== 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)(7416014)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 11:21:47.2287 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ab17601-793c-4632-c98e-08dcb21c21a2 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: BL6PEPF00022570.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB9139 Message-ID-Hash: 4FYKSMPGE6LHIL4OGL3NMLNKSHW647HI X-Message-ID-Hash: 4FYKSMPGE6LHIL4OGL3NMLNKSHW647HI X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add sof based Soundwire generic driver for amd platforms. Currently support added for ACP6.3 based platforms. Link: https://github.com/thesofproject/linux/pull/5068 Signed-off-by: Vijendar Mukunda Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- sound/soc/amd/acp/Kconfig | 18 + sound/soc/amd/acp/Makefile | 2 + sound/soc/amd/acp/acp-sdw-sof-mach.c | 742 +++++++++++++++++++++++++ sound/soc/amd/acp/soc_amd_sdw_common.h | 44 ++ 4 files changed, 806 insertions(+) create mode 100644 sound/soc/amd/acp/acp-sdw-sof-mach.c create mode 100644 sound/soc/amd/acp/soc_amd_sdw_common.h diff --git a/sound/soc/amd/acp/Kconfig b/sound/soc/amd/acp/Kconfig index 19859b1b73c5..88391e4c17e3 100644 --- a/sound/soc/amd/acp/Kconfig +++ b/sound/soc/amd/acp/Kconfig @@ -119,6 +119,24 @@ config SND_SOC_AMD_SOF_MACH help This option enables SOF sound card support for ACP audio. +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_SDW_UTILS + select SND_SOC_DMIC + select SND_SOC_RT711_SDW + select SND_SOC_RT711_SDCA_SDW + select SND_SOC_RT1316_SDW + select SND_SOC_RT715_SDW + select SND_SOC_RT715_SDCA_SDW + help + This option enables SOF 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 516a44f3ffb6..82cf5d180b3a 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-sof-mach-y += acp-sdw-sof-mach.o obj-$(CONFIG_SND_SOC_AMD_ACP_PCM) += snd-acp-pcm.o obj-$(CONFIG_SND_SOC_AMD_ACP_I2S) += snd-acp-i2s.o @@ -40,3 +41,4 @@ 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_SOF_SDW_MACH) += snd-acp-sdw-sof-mach.o diff --git a/sound/soc/amd/acp/acp-sdw-sof-mach.c b/sound/soc/amd/acp/acp-sdw-sof-mach.c new file mode 100644 index 000000000000..3419675e45a9 --- /dev/null +++ b/sound/soc/amd/acp/acp-sdw-sof-mach.c @@ -0,0 +1,742 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright(c) 2024 Advanced Micro Devices, Inc. + +/* + * acp-sdw-sof-mach - ASoC 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 sof_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(sof_sdw_quirk)) + dev_dbg(dev, "quirk realtek,jack-detect-source %ld\n", + SOC_JACK_JDSRC(sof_sdw_quirk)); + if (sof_sdw_quirk & ASOC_SDW_ACP_DMIC) + dev_dbg(dev, "quirk SOC_SDW_ACP_DMIC enabled\n"); +} + +static int sof_sdw_quirk_cb(const struct dmi_system_id *id) +{ + sof_sdw_quirk = (unsigned long)id->driver_data; + return 1; +} + +static const struct dmi_system_id sof_sdw_quirk_table[] = { + { + .callback = sof_sdw_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "AMD"), + DMI_MATCH(DMI_PRODUCT_NAME, "Birman-PHX"), + }, + .driver_data = (void *)RT711_JD2, + }, + {} +}; + +static struct snd_soc_dai_link_component platform_component[] = { + { + /* name might be overridden during probe */ + .name = "0000:04:00.5", + } +}; + +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, +}; + +/* + * get BE dailink number and CPU DAI number based on sdw link adr. + * Since some sdw slaves may be aggregated, the CPU DAI number + * may be larger than the number of BE dailinks. + */ +static int get_dailink_info(struct device *dev, + const struct snd_soc_acpi_link_adr *adr_link, + int *sdw_be_num, int *codecs_num) +{ + bool group_visited[AMD_SDW_MAX_GROUPS]; + int i; + int j; + + *sdw_be_num = 0; + + if (!adr_link) + return -EINVAL; + + for (i = 0; i < AMD_SDW_MAX_GROUPS; i++) + group_visited[i] = false; + + for (; adr_link->num_adr; adr_link++) { + const struct snd_soc_acpi_endpoint *endpoint; + struct asoc_sdw_codec_info *codec_info; + int stream; + u64 adr; + + /* make sure the link mask has a single bit set */ + if (!is_power_of_2(adr_link->mask)) + return -EINVAL; + + for (i = 0; i < adr_link->num_adr; i++) { + adr = adr_link->adr_d[i].adr; + codec_info = asoc_sdw_find_codec_info_part(adr); + if (!codec_info) + return -EINVAL; + + *codecs_num += codec_info->dai_num; + + if (!adr_link->adr_d[i].name_prefix) { + dev_err(dev, "codec 0x%llx does not have a name prefix\n", + adr_link->adr_d[i].adr); + return -EINVAL; + } + + endpoint = adr_link->adr_d[i].endpoints; + if (endpoint->aggregated && !endpoint->group_id) { + dev_err(dev, "invalid group id on link %x\n", + adr_link->mask); + return -EINVAL; + } + + for (j = 0; j < codec_info->dai_num; j++) { + /* count DAI number for playback and capture */ + for_each_pcm_streams(stream) { + if (!codec_info->dais[j].direction[stream]) + continue; + + /* count BE for each non-aggregated slave or group */ + if (!endpoint->aggregated || + !group_visited[endpoint->group_id]) + (*sdw_be_num)++; + } + } + + if (endpoint->aggregated) + group_visited[endpoint->group_id] = true; + } + } + return 0; +} + +static int fill_sdw_codec_dlc(struct device *dev, + const struct snd_soc_acpi_link_adr *adr_link, + struct snd_soc_dai_link_component *codec, + int adr_index, int dai_index) +{ + u64 adr = adr_link->adr_d[adr_index].adr; + struct asoc_sdw_codec_info *codec_info; + + codec_info = asoc_sdw_find_codec_info_part(adr); + if (!codec_info) + return -EINVAL; + + codec->name = asoc_sdw_get_codec_name(dev, codec_info, adr_link, adr_index); + if (!codec->name) + return -ENOMEM; + + codec->dai_name = codec_info->dais[dai_index].dai_name; + dev_err(dev, "codec->dai_name:%s\n", codec->dai_name); + return 0; +} + +static int set_codec_init_func(struct snd_soc_card *card, + const struct snd_soc_acpi_link_adr *adr_link, + struct snd_soc_dai_link *dai_links, + bool playback, int group_id, int adr_index, int dai_index) +{ + int i = adr_index; + + do { + /* + * Initialize the codec. If codec is part of an aggregated + * group (group_id>0), initialize all codecs belonging to + * same group. + * The first link should start with adr_link->adr_d[adr_index] + * because that is the device that we want to initialize and + * we should end immediately if it is not aggregated (group_id=0) + */ + for ( ; i < adr_link->num_adr; i++) { + struct asoc_sdw_codec_info *codec_info; + + codec_info = asoc_sdw_find_codec_info_part(adr_link->adr_d[i].adr); + if (!codec_info) + return -EINVAL; + + /* The group_id is > 0 iff the codec is aggregated */ + if (adr_link->adr_d[i].endpoints->group_id != group_id) + continue; + if (codec_info->dais[dai_index].init) + codec_info->dais[dai_index].init(card, + dai_links, + codec_info, + playback); + + if (!group_id) + return 0; + } + + i = 0; + adr_link++; + } while (adr_link->mask); + + return 0; +} + +/* + * check endpoint status in slaves and gather link ID for all slaves in + * the same group to generate different CPU DAI. Now only support + * one sdw link with all slaves set with only single group id. + * + * one slave on one sdw link with aggregated = 0 + * one sdw BE DAI <---> one-cpu DAI <---> one-codec DAI + * + * two or more slaves on one sdw link with aggregated = 1 + * one sdw BE DAI <---> one-cpu DAI <---> multi-codec DAIs + */ +static int get_slave_info(const struct snd_soc_acpi_link_adr *adr_link, + struct device *dev, int *cpu_dai_id, int *cpu_dai_num, + int *codec_num, unsigned int *group_id, + int adr_index) +{ + int i; + + if (!adr_link->adr_d[adr_index].endpoints->aggregated) { + cpu_dai_id[0] = ffs(adr_link->mask) - 1; + *cpu_dai_num = 1; + *codec_num = 1; + *group_id = 0; + return 0; + } + + *codec_num = 0; + *cpu_dai_num = 0; + *group_id = adr_link->adr_d[adr_index].endpoints->group_id; + + /* Count endpoints with the same group_id in the adr_link */ + for (; adr_link && adr_link->num_adr; adr_link++) { + unsigned int link_codecs = 0; + + for (i = 0; i < adr_link->num_adr; i++) { + if (adr_link->adr_d[i].endpoints->aggregated && + adr_link->adr_d[i].endpoints->group_id == *group_id) + link_codecs++; + } + + if (link_codecs) { + *codec_num += link_codecs; + + if (*cpu_dai_num >= ACP63_SDW_MAX_CPU_DAIS) { + dev_err(dev, "cpu_dai_id array overflowed\n"); + return -EINVAL; + } + + cpu_dai_id[(*cpu_dai_num)++] = ffs(adr_link->mask) - 1; + } + } + + return 0; +} + +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, + struct snd_soc_dai_link **dai_links, + const struct snd_soc_acpi_link_adr *adr_link, + struct snd_soc_codec_conf **codec_conf, + int *be_id, int adr_index, int dai_index) +{ + 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 device *dev = card->dev; + const struct snd_soc_acpi_link_adr *adr_link_next; + struct snd_soc_dai_link_ch_map *sdw_codec_ch_maps; + struct snd_soc_dai_link_component *codecs; + struct snd_soc_dai_link_component *cpus; + struct asoc_sdw_codec_info *codec_info; + int cpu_dai_id[ACP63_SDW_MAX_CPU_DAIS]; + int cpu_dai_num; + unsigned int group_id; + unsigned int sdw_link_id; + int codec_dlc_index = 0; + int codec_num; + int stream; + int i = 0; + int j, k; + int ret; + int cpu_pin_id; + + ret = get_slave_info(adr_link, dev, cpu_dai_id, &cpu_dai_num, &codec_num, + &group_id, adr_index); + if (ret) + return ret; + codecs = devm_kcalloc(dev, codec_num, sizeof(*codecs), GFP_KERNEL); + if (!codecs) + return -ENOMEM; + + sdw_codec_ch_maps = devm_kcalloc(dev, codec_num, + sizeof(*sdw_codec_ch_maps), GFP_KERNEL); + if (!sdw_codec_ch_maps) + return -ENOMEM; + + /* generate codec name on different links in the same group */ + j = adr_index; + for (adr_link_next = adr_link; adr_link_next && adr_link_next->num_adr && + i < cpu_dai_num; adr_link_next++) { + /* skip the link excluded by this processed group */ + if (cpu_dai_id[i] != ffs(adr_link_next->mask) - 1) + continue; + + /* j reset after loop, adr_index only applies to first link */ + for (k = 0 ; (j < adr_link_next->num_adr) && (k < codec_num) ; j++, k++) { + const struct snd_soc_acpi_endpoint *endpoints; + + endpoints = adr_link_next->adr_d[j].endpoints; + if (group_id && (!endpoints->aggregated || + endpoints->group_id != group_id)) + continue; + + /* sanity check */ + if (*codec_conf >= card->codec_conf + card->num_configs) { + dev_err(dev, "codec_conf array overflowed\n"); + return -EINVAL; + } + + ret = fill_sdw_codec_dlc(dev, adr_link_next, + &codecs[codec_dlc_index], + j, dai_index); + if (ret) + return ret; + (*codec_conf)->dlc = codecs[codec_dlc_index]; + (*codec_conf)->name_prefix = adr_link_next->adr_d[j].name_prefix; + + sdw_codec_ch_maps[codec_dlc_index].cpu = i; + sdw_codec_ch_maps[codec_dlc_index].codec = codec_dlc_index; + + codec_dlc_index++; + (*codec_conf)++; + } + j = 0; + + /* check next link to create codec dai in the processed group */ + i++; + } + + /* find codec info to create BE DAI */ + codec_info = asoc_sdw_find_codec_info_part(adr_link->adr_d[adr_index].adr); + if (!codec_info) + return -EINVAL; + + ctx->ignore_internal_dmic |= codec_info->ignore_internal_dmic; + + sdw_link_id = (adr_link->adr_d[adr_index].adr) >> 48; + for_each_pcm_streams(stream) { + char *name, *cpu_name; + int playback, capture; + 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", + }; + + if (!codec_info->dais[dai_index].direction[stream]) + continue; + + *be_id = codec_info->dais[dai_index].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(sdw_link_id, *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], sdw_link_id, cpu_pin_id, + type_strings[codec_info->dais[dai_index].dai_type]); + } else { + name = devm_kasprintf(dev, GFP_KERNEL, + sdw_stream_name[stream], sdw_link_id, cpu_pin_id); + } + if (!name) + return -ENOMEM; + + cpus = devm_kcalloc(dev, cpu_dai_num, sizeof(*cpus), GFP_KERNEL); + if (!cpus) + return -ENOMEM; + /* + * generate CPU DAI name base on the sdw link ID and + * cpu pin id according to sdw dai driver. + */ + for (k = 0; k < cpu_dai_num; k++) { + cpu_name = devm_kasprintf(dev, GFP_KERNEL, + "SDW%d Pin%d", sdw_link_id, cpu_pin_id); + if (!cpu_name) + return -ENOMEM; + + cpus[k].dai_name = cpu_name; + } + + 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, cpu_dai_num, + platform_component, ARRAY_SIZE(platform_component), + codecs, codec_num, + 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 = sdw_codec_ch_maps; + + ret = set_codec_init_func(card, adr_link, *dai_links, + playback, group_id, adr_index, dai_index); + if (ret < 0) { + dev_err(dev, "failed to init codec 0x%x\n", codec_info->part_id); + return ret; + } + + (*dai_links)++; + } + return 0; +} + +static int create_dmic_dailinks(struct snd_soc_card *card, + struct snd_soc_dai_link **dai_links, int *be_id) +{ + struct device *dev = card->dev; + int ret; + + ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, "acp-dmic-codec", + 0, 1, // DMIC only supports capture + "acp-sof-dmic", platform_component->name, + ARRAY_SIZE(platform_component), + "dmic-codec", "dmic-hifi", + asoc_sdw_dmic_init, NULL); + if (ret) + return ret; + + (*dai_links)++; + + return 0; +} + +static int sof_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; + const struct snd_soc_acpi_link_adr *adr_link = mach_params->links; + struct snd_soc_codec_conf *codec_conf; + int codec_conf_num = 0; + bool group_generated[AMD_SDW_MAX_GROUPS] = { }; + struct snd_soc_dai_link *dai_links; + struct asoc_sdw_codec_info *codec_info; + int num_links; + int i, j, be_id = 0; + int ret; + + ret = get_dailink_info(dev, adr_link, &sdw_be_num, &codec_conf_num); + if (ret < 0) { + dev_err(dev, "failed to get sdw link info %d\n", ret); + return ret; + } + + /* enable dmic */ + if (sof_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); + + /* 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; + + /* allocate codec conf, will be populated when dailinks are created */ + codec_conf = devm_kcalloc(dev, codec_conf_num, sizeof(*codec_conf), + GFP_KERNEL); + if (!codec_conf) + return -ENOMEM; + + card->dai_link = dai_links; + card->num_links = num_links; + card->codec_conf = codec_conf; + card->num_configs = codec_conf_num; + + /* SDW */ + if (!sdw_be_num) + goto DMIC; + + for (; adr_link->num_adr; adr_link++) { + /* + * If there are two or more different devices on the same sdw link, we have to + * append the codec type to the dai link name to prevent duplicated dai link name. + * The same type devices on the same sdw link will be in the same + * snd_soc_acpi_adr_device array. They won't be described in different adr_links. + */ + for (i = 0; i < adr_link->num_adr; i++) { + /* find codec info to get dai_num */ + codec_info = asoc_sdw_find_codec_info_part(adr_link->adr_d[i].adr); + if (!codec_info) + return -EINVAL; + if (codec_info->dai_num > 1) { + ctx->append_dai_type = true; + goto out; + } + for (j = 0; j < i; j++) { + if ((SDW_PART_ID(adr_link->adr_d[i].adr) != + SDW_PART_ID(adr_link->adr_d[j].adr)) || + (SDW_MFG_ID(adr_link->adr_d[i].adr) != + SDW_MFG_ID(adr_link->adr_d[j].adr))) { + ctx->append_dai_type = true; + goto out; + } + } + } + } +out: + + /* generate DAI links by each sdw link */ + for (adr_link = mach_params->links ; adr_link->num_adr; adr_link++) { + for (i = 0; i < adr_link->num_adr; i++) { + const struct snd_soc_acpi_endpoint *endpoint; + + endpoint = adr_link->adr_d[i].endpoints; + + /* this group has been generated */ + if (endpoint->aggregated && + group_generated[endpoint->group_id]) + continue; + + /* find codec info to get dai_num */ + codec_info = asoc_sdw_find_codec_info_part(adr_link->adr_d[i].adr); + if (!codec_info) + return -EINVAL; + + for (j = 0; j < codec_info->dai_num ; j++) { + int current_be_id; + + ret = create_sdw_dailink(card, &dai_links, adr_link, + &codec_conf, ¤t_be_id, + i, j); + if (ret < 0) { + dev_err(dev, + "failed to create dai link %d on 0x%x\n", + j, codec_info->part_id); + 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; + } + + if (endpoint->aggregated) + group_generated[endpoint->group_id] = true; + } + } + +DMIC: + /* dmic */ + if (dmic_num > 0) { + if (ctx->ignore_internal_dmic) { + dev_warn(dev, "Ignoring ACP DMIC\n"); + } else { + be_id = SOC_SDW_DMIC_DAI_ID; + ret = create_dmic_dailinks(card, &dai_links, &be_id); + if (ret) + return ret; + } + } + + WARN_ON(dai_links != card->dai_link + card->num_links); + return 0; +} + +/* SoC card */ +static const char sdw_card_long_name[] = "AMD Soundwire SOF"; + +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(sof_sdw_quirk_table); + + if (quirk_override != -1) { + dev_info(card->dev, "Overriding quirk 0x%lx => 0x%x\n", + sof_sdw_quirk, quirk_override); + sof_sdw_quirk = quirk_override; + } + + log_quirks(card->dev); + + ctx->mc_quirk = sof_sdw_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 = sof_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; + + card->long_name = sdw_card_long_name; + + /* 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_sof_sdw", }, + {} +}; +MODULE_DEVICE_TABLE(platform, mc_id_table); + +static struct platform_driver sof_sdw_driver = { + .driver = { + .name = "amd_sof_sdw", + .pm = &snd_soc_pm_ops, + }, + .probe = mc_probe, + .remove_new = mc_remove, + .id_table = mc_id_table, +}; + +module_platform_driver(sof_sdw_driver); + +MODULE_DESCRIPTION("ASoC AMD SoundWire Generic Machine driver"); +MODULE_AUTHOR("Vijendar Mukunda +#include +#include +#include + +#define ACP63_SDW_MAX_CPU_DAIS 8 +#define ACP63_SDW_MAX_LINKS 2 + +#define AMD_SDW_MAX_GROUPS 9 +#define ACP63_PCI_REV 0x63 +#define SOC_JACK_JDSRC(quirk) ((quirk) & GENMASK(3, 0)) +#define ASOC_SDW_FOUR_SPK BIT(4) +#define ASOC_SDW_ACP_DMIC BIT(5) + +#define AMD_SDW0 0 +#define AMD_SDW1 1 +#define ACP63_SW0_AUDIO0_TX 0 +#define ACP63_SW0_AUDIO1_TX 1 +#define ACP63_SW0_AUDIO2_TX 2 + +#define ACP63_SW0_AUDIO0_RX 3 +#define ACP63_SW0_AUDIO1_RX 4 +#define ACP63_SW0_AUDIO2_RX 5 + +#define ACP63_SW1_AUDIO0_TX 0 +#define ACP63_SW1_AUDIO0_RX 1 + +struct amd_mc_ctx { + unsigned int acp_rev; + unsigned int max_sdw_links; +}; + +#endif