From patchwork Fri Apr 26 15:21:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 792411 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EF7FFC4345F for ; Fri, 26 Apr 2024 15:22:51 +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 3B03614DE; Fri, 26 Apr 2024 17:22:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3B03614DE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1714144970; bh=HubybkhRbfo/I4Z9f4ZL9Jl07Vz/hlhXaq7GSFqYs28=; 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=LrLlKZMA3mXiU6hq/6b1BcOZ+IpFI3xsqY0hy8UQTcASAHq/XNMMSE2WWs0Dpb6Qn tlXOEdFMfGTGHpSYePF8w2bB1OnhvJCgzNTfH+Z2QHm8yUwvBMGDOFjNLT56lGue84 LdpnLdno8eAdEktBoVR7Km28skxJ3EQ+inCqek64= Received: by alsa1.perex.cz (Postfix, from userid 50401) id DE2B6F805E3; Fri, 26 Apr 2024 17:22: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 F01C0F805D7; Fri, 26 Apr 2024 17:21:59 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A7E79F8057B; Fri, 26 Apr 2024 17:21:53 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 29BDEF800B5 for ; Fri, 26 Apr 2024 17:21:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 29BDEF800B5 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=AWyCoa6a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714144906; x=1745680906; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HubybkhRbfo/I4Z9f4ZL9Jl07Vz/hlhXaq7GSFqYs28=; b=AWyCoa6aqzIyQ8KhSRko8Nov3Cdv1PqrVdmsh7FhA4Bo9pI5SnJ4a9D7 cFWLNC1QCn+pKM8NIHBJBlpIgZ3dJYne4QcJLXYzDkIgf8Ms3NncONEtE /+2bB/cjaGb5gN8vBbWXtSSX7h/OoAVuTYgVKjclhEJu508grDhBbCpLb HKLfPPcVmbAq1uCeMJeppXVhFcLU7HqFFumpHuRWDsEBZU5DmV7PkFGIu AfCpknnf7YdOkRvtB8PpjlCjNsLmmboaQ3Uf4007A7q2Ixq4QsvQdOCIg 3bINpe00Kbbb8lQO8v0UeNvgw5sDi5a0v1Z964VPBpUdJvpkTaNO2YdAD w==; X-CSE-ConnectionGUID: x7L5Hw4PSbiXX/8BSRE61A== X-CSE-MsgGUID: j1WDN+3ATau85uZHZ7tMxg== X-IronPort-AV: E=McAfee;i="6600,9927,11056"; a="21290592" X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="21290592" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:39 -0700 X-CSE-ConnectionGUID: DLM2Grf3Rz68RvkKcQjYCw== X-CSE-MsgGUID: lp2Fd53FSIKI76PkW97tPw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="30259023" Received: from atarkhan-mobl2.amr.corp.intel.com (HELO pbossart-mobl6.intel.com) ([10.212.33.33]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:39 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Pierre-Louis Bossart Subject: [PATCH 01/12] ASoC: Intel: skl_hda_dsp_generic: Allocate snd_soc_card dynamically Date: Fri, 26 Apr 2024 10:21:12 -0500 Message-Id: <20240426152123.36284-2-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> References: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: BXCWG27BXKY4DJW6Z4WMLMR7JONLJMLA X-Message-ID-Hash: BXCWG27BXKY4DJW6Z4WMLMR7JONLJMLA X-MailFrom: pierre-louis.bossart@linux.intel.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: From: Peter Ujfalusi The static hda_soc_card might be modified during runtime which might cause issues on next time when the card is created. For example if the dmic_num was set with module parameter then removed for the next module loading then the card's components will still going to point to the previous boot's cfg-dmics:X string. There might be other places where devm allocated memory have been freed but the hda_soc_card still pointing to the now unallocated memory (the memory is freed when the platform device is removed). Fix this issue by moving the snd_soc_card into skl_hda_private and use it for the card registration to ensure that it is correctly initialized every time. Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/skl_hda_dsp_common.h | 1 + sound/soc/intel/boards/skl_hda_dsp_generic.c | 42 ++++++++++---------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/sound/soc/intel/boards/skl_hda_dsp_common.h b/sound/soc/intel/boards/skl_hda_dsp_common.h index 4b0b3959182e..19b814dee4ad 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_common.h +++ b/sound/soc/intel/boards/skl_hda_dsp_common.h @@ -28,6 +28,7 @@ struct skl_hda_hdmi_pcm { }; struct skl_hda_private { + struct snd_soc_card card; struct list_head hdmi_pcm_list; int pcm_count; int dai_index; diff --git a/sound/soc/intel/boards/skl_hda_dsp_generic.c b/sound/soc/intel/boards/skl_hda_dsp_generic.c index 4aa7fd2a05e4..208395872d8b 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_generic.c +++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c @@ -92,17 +92,6 @@ skl_hda_add_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *link) return ret; } -static struct snd_soc_card hda_soc_card = { - .name = "hda-dsp", - .owner = THIS_MODULE, - .dai_link = skl_hda_be_dai_links, - .dapm_widgets = skl_hda_widgets, - .dapm_routes = skl_hda_map, - .add_dai_link = skl_hda_add_dai_link, - .fully_routed = true, - .late_probe = skl_hda_card_late_probe, -}; - static char hda_soc_components[30]; #define IDISP_DAI_COUNT 3 @@ -115,9 +104,9 @@ static char hda_soc_components[30]; #define HDA_CODEC_AUTOSUSPEND_DELAY_MS 1000 -static int skl_hda_fill_card_info(struct snd_soc_acpi_mach_params *mach_params) +static int skl_hda_fill_card_info(struct snd_soc_card *card, + struct snd_soc_acpi_mach_params *mach_params) { - struct snd_soc_card *card = &hda_soc_card; struct skl_hda_private *ctx = snd_soc_card_get_drvdata(card); struct snd_soc_dai_link *dai_link; u32 codec_count, codec_mask; @@ -199,6 +188,7 @@ static int skl_hda_audio_probe(struct platform_device *pdev) { struct snd_soc_acpi_mach *mach; struct skl_hda_private *ctx; + struct snd_soc_card *card; int ret; dev_dbg(&pdev->dev, "entry\n"); @@ -213,32 +203,42 @@ static int skl_hda_audio_probe(struct platform_device *pdev) if (!mach) return -EINVAL; - snd_soc_card_set_drvdata(&hda_soc_card, ctx); + card = &ctx->card; + card->name = "hda-dsp", + card->owner = THIS_MODULE, + card->dai_link = skl_hda_be_dai_links, + card->dapm_widgets = skl_hda_widgets, + card->dapm_routes = skl_hda_map, + card->add_dai_link = skl_hda_add_dai_link, + card->fully_routed = true, + card->late_probe = skl_hda_card_late_probe, - ret = skl_hda_fill_card_info(&mach->mach_params); + snd_soc_card_set_drvdata(card, ctx); + + ret = skl_hda_fill_card_info(card, &mach->mach_params); if (ret < 0) { dev_err(&pdev->dev, "Unsupported HDAudio/iDisp configuration found\n"); return ret; } - ctx->pcm_count = hda_soc_card.num_links; + ctx->pcm_count = card->num_links; ctx->dai_index = 1; /* hdmi codec dai name starts from index 1 */ ctx->platform_name = mach->mach_params.platform; ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv; - hda_soc_card.dev = &pdev->dev; + card->dev = &pdev->dev; if (!snd_soc_acpi_sof_parent(&pdev->dev)) - hda_soc_card.disable_route_checks = true; + card->disable_route_checks = true; if (mach->mach_params.dmic_num > 0) { snprintf(hda_soc_components, sizeof(hda_soc_components), "cfg-dmics:%d", mach->mach_params.dmic_num); - hda_soc_card.components = hda_soc_components; + card->components = hda_soc_components; } - ret = devm_snd_soc_register_card(&pdev->dev, &hda_soc_card); + ret = devm_snd_soc_register_card(&pdev->dev, card); if (!ret) - skl_set_hda_codec_autosuspend_delay(&hda_soc_card); + skl_set_hda_codec_autosuspend_delay(card); return ret; } From patchwork Fri Apr 26 15:21:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 792410 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6E565C4345F for ; Fri, 26 Apr 2024 15:23:24 +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 BA70EE8E; Fri, 26 Apr 2024 17:23:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BA70EE8E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1714145002; bh=mkPPo4cmXEwCG5YJSWVnWIbjUUOV62VUhBtNpvDcliE=; 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=pi6gsFhc+eRHYDnR4pYTAXk0GoULsqxUEGQUUrXt+tg/ATpCLzflzJSI+q8FExirG h5hGNBJnVk/jKskCIS1cs9KtvfRQkv65In15zlzk0h2iz9klusAZAQbfjLw8wJQFA2 mFuzMjM7CKx13rbK+A+50oWUMNc4GKShh5/p2IQ8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 429FBF80616; Fri, 26 Apr 2024 17:22:09 +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 3EA7AF80610; Fri, 26 Apr 2024 17:22:09 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 26313F805BD; Fri, 26 Apr 2024 17:21:57 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 BD6E9F8003A for ; Fri, 26 Apr 2024 17:21:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BD6E9F8003A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=ZRMfmErC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714144906; x=1745680906; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mkPPo4cmXEwCG5YJSWVnWIbjUUOV62VUhBtNpvDcliE=; b=ZRMfmErC8SWnaL6d3VJb2GLKP40/LvXuTuqDS553DQWaGghR8qsKaK19 RxbLTJuMYogp8VZO/1+1MpSKhS4f0txW+o+Uhra4UCLZP2vKbTAJrhXhL gEbTzOJG+UbGVnA7Jmwj9EgXSpRGbkVPfgW2Z/eRuCGtC3JPthkobNQkq n62VJ1y6MDGSBuv/Xqpc7HVjbkNSpLXQ+yfrh4WApap81s6l1JgS7iW+i c8g2ydU2xbUFP//H2nVb2thqLLxOuzaZI6/1KQpV9GA1mDQxdw2O9tY6o owKtcsYaO67LKMwYa62Dq8yQirVkSS2gxXiS76LqYJ6DZ3teVLL5YiKGF Q==; X-CSE-ConnectionGUID: M26KGmQjTwC8E5Ne1mjhWA== X-CSE-MsgGUID: OQGovAIjRPyCtyFJntZIWA== X-IronPort-AV: E=McAfee;i="6600,9927,11056"; a="21290596" X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="21290596" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:40 -0700 X-CSE-ConnectionGUID: mI/xbSpZSAivebQ/hXRUEg== X-CSE-MsgGUID: lM7woBPGTi6TglTya21fBg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="30259024" Received: from atarkhan-mobl2.amr.corp.intel.com (HELO pbossart-mobl6.intel.com) ([10.212.33.33]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:39 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Pierre-Louis Bossart Subject: [PATCH 02/12] ASoC: Intel: skl_hda_dsp_generic: Use devm_kasprintf for the components string Date: Fri, 26 Apr 2024 10:21:13 -0500 Message-Id: <20240426152123.36284-3-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> References: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: 2QZN4V2G2IVKVQSGREQUXCHU2EVH3IPW X-Message-ID-Hash: 2QZN4V2G2IVKVQSGREQUXCHU2EVH3IPW X-MailFrom: pierre-louis.bossart@linux.intel.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: From: Peter Ujfalusi Instead of using a global char array, allocate the string with devm_kasprintf if needed. Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/skl_hda_dsp_generic.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/intel/boards/skl_hda_dsp_generic.c b/sound/soc/intel/boards/skl_hda_dsp_generic.c index 208395872d8b..88d91c0280bb 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_generic.c +++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c @@ -92,8 +92,6 @@ skl_hda_add_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *link) return ret; } -static char hda_soc_components[30]; - #define IDISP_DAI_COUNT 3 #define HDAC_DAI_COUNT 2 #define DMIC_DAI_COUNT 2 @@ -231,9 +229,11 @@ static int skl_hda_audio_probe(struct platform_device *pdev) card->disable_route_checks = true; if (mach->mach_params.dmic_num > 0) { - snprintf(hda_soc_components, sizeof(hda_soc_components), - "cfg-dmics:%d", mach->mach_params.dmic_num); - card->components = hda_soc_components; + card->components = devm_kasprintf(card->dev, GFP_KERNEL, + "cfg-dmics:%d", + mach->mach_params.dmic_num); + if (!card->components) + return -ENOMEM; } ret = devm_snd_soc_register_card(&pdev->dev, card); From patchwork Fri Apr 26 15:21:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 792704 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A5F01C4345F for ; Fri, 26 Apr 2024 15:24:15 +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 B514EDF6; Fri, 26 Apr 2024 17:24:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B514EDF6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1714145053; bh=uvsiV2YLLM+olUopeXgfESIJEeQMUUr6tjoE9Ugq0pw=; 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=k6z+v159vC2rwY3PebBM3ZKWx5Qyssbz1QbIDrzmRYIhMYevN4nvgmk4WR3pn5xsS 0OrCuxj1KN4sonsbYd/yZYdReCYdseU1eFR0BPZCa07Pj5exsST3SI4kOS911xMdtk omDqfiYIU40twfdymj4w/hOvZq9ayL7SL9mQTxSQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9ECD1F805BB; Fri, 26 Apr 2024 17:22:20 +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 526EEF8069F; Fri, 26 Apr 2024 17:22:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2ECCDF805BE; Fri, 26 Apr 2024 17:22:00 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 99C16F802E8 for ; Fri, 26 Apr 2024 17:21:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 99C16F802E8 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=aCZ88Qwh DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714144908; x=1745680908; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uvsiV2YLLM+olUopeXgfESIJEeQMUUr6tjoE9Ugq0pw=; b=aCZ88Qwhgl4mHMUwy6jyQ3FCP6vuKt+B2X8gL2l6BaEjc/luiGtz/Lmc Z3bfPjakQjN5qr2VHYAaFJeh70eTzgcj7P3ifevUaypYN1cnH8gILdtFD Z3jJTMSU16dBD5hpwS/aszlNVeFtpSoIjx/S5Vf/CiBfvkK3l4dXyYcbe Ens4Xvd3XIAouTtsHFeG1czBGwXneCr1EoMm0XuGU+8/XCCmHXC8jG8wm vb0gdOjte+8AdLXkVXz0FvpOFGB4LELfoDTz5U2GFw/hw2WYFtA+/tZcn fGqui6jyLnYJTZZcFNcRVig340hlSNrVAhIxjLAUs8IEj2vwexhso1mQF A==; X-CSE-ConnectionGUID: +lZob1MAQdiitwcvs/Mc/w== X-CSE-MsgGUID: brRE45dKTL20XfqGrBuHfw== X-IronPort-AV: E=McAfee;i="6600,9927,11056"; a="21290603" X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="21290603" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:40 -0700 X-CSE-ConnectionGUID: TZhS/xgITR+Umrtw3fsWHw== X-CSE-MsgGUID: cv0B5d47RWaFIROsWzdjPg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="30259025" Received: from atarkhan-mobl2.amr.corp.intel.com (HELO pbossart-mobl6.intel.com) ([10.212.33.33]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:40 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart , Bard Liao Subject: [PATCH 03/12] ASoC: Intel: soc-acpi: mtl: add Dell SKU 0C64 and 0CC6 Date: Fri, 26 Apr 2024 10:21:14 -0500 Message-Id: <20240426152123.36284-4-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> References: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: XVXDGOK54FKZAHR7ADJJ5ECGOSF34XYD X-Message-ID-Hash: XVXDGOK54FKZAHR7ADJJ5ECGOSF34XYD X-MailFrom: pierre-louis.bossart@linux.intel.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: SKU 0C64 relies on rt713 (jack codec) on link0, rt1318 (single amplifier) on link1 and rt1713 (dmic) on link3. SKU 0CC6 relies on rt713 (jack codec) on link0, rt1318 (two amplifiers) on link 1-2 and rt1713 (dmic) on link3. Reviewed-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- .../intel/common/soc-acpi-intel-mtl-match.c | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/sound/soc/intel/common/soc-acpi-intel-mtl-match.c b/sound/soc/intel/common/soc-acpi-intel-mtl-match.c index f95490a16b55..8c1c430f5482 100644 --- a/sound/soc/intel/common/soc-acpi-intel-mtl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-mtl-match.c @@ -312,6 +312,15 @@ static const struct snd_soc_acpi_adr_device rt1316_3_single_adr[] = { } }; +static const struct snd_soc_acpi_adr_device rt1318_1_single_adr[] = { + { + .adr = 0x000130025D131801, + .num_endpoints = 1, + .endpoints = &single_endpoint, + .name_prefix = "rt1318" + } +}; + static const struct snd_soc_acpi_adr_device rt1318_1_group1_adr[] = { { .adr = 0x000130025D131801ull, @@ -559,6 +568,49 @@ static const struct snd_soc_acpi_link_adr mtl_rt713_l0_rt1316_l12_rt1713_l3[] = {} }; +static const struct snd_soc_acpi_link_adr mtl_rt713_l0_rt1318_l1_rt1713_l3[] = { + { + .mask = BIT(0), + .num_adr = ARRAY_SIZE(rt713_0_single_adr), + .adr_d = rt713_0_single_adr, + }, + { + .mask = BIT(1), + .num_adr = ARRAY_SIZE(rt1318_1_single_adr), + .adr_d = rt1318_1_single_adr, + }, + { + .mask = BIT(3), + .num_adr = ARRAY_SIZE(rt1713_3_single_adr), + .adr_d = rt1713_3_single_adr, + }, + {} +}; + +static const struct snd_soc_acpi_link_adr mtl_rt713_l0_rt1318_l12_rt1713_l3[] = { + { + .mask = BIT(0), + .num_adr = ARRAY_SIZE(rt713_0_single_adr), + .adr_d = rt713_0_single_adr, + }, + { + .mask = BIT(1), + .num_adr = ARRAY_SIZE(rt1318_1_group1_adr), + .adr_d = rt1318_1_group1_adr, + }, + { + .mask = BIT(2), + .num_adr = ARRAY_SIZE(rt1318_2_group1_adr), + .adr_d = rt1318_2_group1_adr, + }, + { + .mask = BIT(3), + .num_adr = ARRAY_SIZE(rt1713_3_single_adr), + .adr_d = rt1713_3_single_adr, + }, + {} +}; + static const struct snd_soc_acpi_link_adr mtl_rt713_l0_rt1316_l12[] = { { .mask = BIT(0), @@ -697,6 +749,18 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_sdw_machines[] = { .drv_name = "sof_sdw", .sof_tplg_filename = "sof-mtl-rt713-l0-rt1316-l12-rt1713-l3.tplg", }, + { + .link_mask = GENMASK(3, 0), + .links = mtl_rt713_l0_rt1318_l12_rt1713_l3, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-mtl-rt713-l0-rt1318-l12-rt1713-l3.tplg", + }, + { + .link_mask = BIT(0) | BIT(1) | BIT(3), + .links = mtl_rt713_l0_rt1318_l1_rt1713_l3, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-mtl-rt713-l0-rt1318-l1-rt1713-l3.tplg", + }, { .link_mask = GENMASK(2, 0), .links = mtl_rt713_l0_rt1316_l12, From patchwork Fri Apr 26 15:21:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 792409 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 88373C4345F for ; Fri, 26 Apr 2024 15:23:58 +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 0409DDF6; Fri, 26 Apr 2024 17:23:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0409DDF6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1714145037; bh=WAkH3Y7OhBZNoUz6Z4EeiC+ZSwLVt3vDR6DBrDXdPXU=; 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=ZSnFNVox8/XbSarU27AbR1RlchQn9gspn5HH0SCxVBQb4ITi2oWMHnGY9fQQwbcVF WpHPg7AmkMTJHXbHmETxEMCLVDgkTvVux+Z0C4RlDs++ejJSdqbj6xvQhaUhGP0ed6 0TWERFE0D5vo9KpHncSQ6eRezNtf6nk4njw503S4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id E671DF80656; Fri, 26 Apr 2024 17:22:16 +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 74E35F80656; Fri, 26 Apr 2024 17:22:16 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 12E6EF805BE; Fri, 26 Apr 2024 17:22:00 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 E46AEF8045D for ; Fri, 26 Apr 2024 17:21:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E46AEF8045D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Uj1fpX5Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714144908; x=1745680908; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WAkH3Y7OhBZNoUz6Z4EeiC+ZSwLVt3vDR6DBrDXdPXU=; b=Uj1fpX5Z0nW8R9fAtCqFU1b6GiCWxLZTlJ1gZngVHfYjMsH4fPfUGr7o 0zEA0TZfyPciaJXa5cQ25pA0or0z6vmB7kD6UTVvCb9T4GVgpy9mb+cos KHdMq98szKMfNRhby4ZMS3PBP8kQEj83VEQFBLB0pfW/6pYzlXp7Rhc5t wDXqg7Kl5n/Z++sm+HZvhEWCmrZyo161MqQvzQ8APycUVUFgWtc79TAit 4CuaPIbA2IgPhfl6VZl0R3a+K3T/eS5a/uR1P4N3WwxjH5xX9ikkgGpaS FKksowRWLL3LyDzxKVxn6YxfAeXeBKtVI6t8imAxfsn3qxXu3fOwVU3AI g==; X-CSE-ConnectionGUID: O+aATNsmSnqDlEN7gPYngw== X-CSE-MsgGUID: CcTPUn6cQ9+6GigWR/iPHQ== X-IronPort-AV: E=McAfee;i="6600,9927,11056"; a="21290608" X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="21290608" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:41 -0700 X-CSE-ConnectionGUID: xWcTo9aQQEKG8IJruxCmow== X-CSE-MsgGUID: lMOG/s+wS8itmVGZTmk2bA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="30259026" Received: from atarkhan-mobl2.amr.corp.intel.com (HELO pbossart-mobl6.intel.com) ([10.212.33.33]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:41 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart , Bard Liao , =?utf-8?q?P=C3=A9ter_Ujfalusi?= Subject: [PATCH 04/12] ASoC: Intel: soc-acpi: mtl: add support for Acer Swift Go 14 Date: Fri, 26 Apr 2024 10:21:15 -0500 Message-Id: <20240426152123.36284-5-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> References: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: RUAQC2BLVS3VREEPMOBPAFDPP5TKHKVF X-Message-ID-Hash: RUAQC2BLVS3VREEPMOBPAFDPP5TKHKVF X-MailFrom: pierre-louis.bossart@linux.intel.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: This device has an RT712 on link0, but does not rely on RT1712 for the DMIC. PCH-attached DMICs are used instead. Closes: https://github.com/thesofproject/linux/issues/4923 Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Signed-off-by: Pierre-Louis Bossart --- .../intel/common/soc-acpi-intel-mtl-match.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/common/soc-acpi-intel-mtl-match.c b/sound/soc/intel/common/soc-acpi-intel-mtl-match.c index 8c1c430f5482..4eeec0bc92dc 100644 --- a/sound/soc/intel/common/soc-acpi-intel-mtl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-mtl-match.c @@ -357,7 +357,7 @@ static const struct snd_soc_acpi_adr_device rt714_1_adr[] = { } }; -static const struct snd_soc_acpi_link_adr mtl_712_only[] = { +static const struct snd_soc_acpi_link_adr mtl_712_l0_1712_l3[] = { { .mask = BIT(0), .num_adr = ARRAY_SIZE(rt712_0_single_adr), @@ -371,6 +371,15 @@ static const struct snd_soc_acpi_link_adr mtl_712_only[] = { {} }; +static const struct snd_soc_acpi_link_adr mtl_712_l0[] = { + { + .mask = BIT(0), + .num_adr = ARRAY_SIZE(rt712_0_single_adr), + .adr_d = rt712_0_single_adr, + }, + {} +}; + static const struct snd_soc_acpi_endpoint cs42l43_endpoints[] = { { /* Jack Playback Endpoint */ .num = 0, @@ -769,10 +778,16 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_sdw_machines[] = { }, { .link_mask = BIT(3) | BIT(0), - .links = mtl_712_only, + .links = mtl_712_l0_1712_l3, .drv_name = "sof_sdw", .sof_tplg_filename = "sof-mtl-rt712-l0-rt1712-l3.tplg", }, + { + .link_mask = BIT(0), + .links = mtl_712_l0, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-mtl-rt712-l0.tplg", + }, { .link_mask = GENMASK(2, 0), .links = mtl_sdw_rt1318_l12_rt714_l0, From patchwork Fri Apr 26 15:21:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 792706 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C181BC4345F for ; Fri, 26 Apr 2024 15:23:04 +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 24E3AB70; Fri, 26 Apr 2024 17:22:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 24E3AB70 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1714144983; bh=PuF4w6Ln2EhUy7cEQnbfcGAWOeZqMgiQxCSwhmlUlek=; 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=rXuLfhRGnv7hQdN5XQbmxfdUraJ8Z0cY9MfvdQ7npW8sMWA9sZUuNOUlWNHstGOLt /YJF860ZqvTw1ZqP7MVZ/+n8jXq38Ct+IaWZ+cYZ8NzPjk5ObTtQbKYqDgcMZsrZvr 2BNncGwcil+7srmOQYUxLWwYKfPhoOCtUQgK5CYo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id EBAC3F80548; Fri, 26 Apr 2024 17:22:04 +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 00137F805F5; Fri, 26 Apr 2024 17:22:03 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A769DF805BE; Fri, 26 Apr 2024 17:21:55 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 2486AF804B0 for ; Fri, 26 Apr 2024 17:21:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2486AF804B0 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=gjfwu4Ly DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714144908; x=1745680908; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PuF4w6Ln2EhUy7cEQnbfcGAWOeZqMgiQxCSwhmlUlek=; b=gjfwu4Lyi7Z63OEGVsnKy7/MBGm3swp3i482Hay/yy/UT2TkX7BFXL4z 9mPcV4n34LCpqfBiDloKOWPNhCDid5lit5ypjcSKHjpbO8wtUe89ZaRNp LK2S1fH9tMKmZ8vzb7RZEiDk0Hpmm4T1uITEX1khtdpennTKygw6P/+/+ Zwp1EtxZHv4U1/mpm8dxF0silR5ZKZyRWm+pWR3aJpjMDMyK6gLBcnfCq lrz2BPXAwXJFa2AN+35VB8nLD3RfdLH9vMnVkAAXHMNzraTMXsz2vyH7a 8ExK81+ZdEgAqGL92GRyxmHs0vUhd7/tvau/jV94RlWpyKytUp9F0/EJF g==; X-CSE-ConnectionGUID: Lxm7vLYnRd2M1Qf62cAbtw== X-CSE-MsgGUID: kJslez1dSpKt/TzDXIJOOQ== X-IronPort-AV: E=McAfee;i="6600,9927,11056"; a="21290614" X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="21290614" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:42 -0700 X-CSE-ConnectionGUID: o3pmswGHQIiEbQYdntSOJw== X-CSE-MsgGUID: 61DS1Hl5R2Ozpi/Y5mDOtg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="30259030" Received: from atarkhan-mobl2.amr.corp.intel.com (HELO pbossart-mobl6.intel.com) ([10.212.33.33]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:42 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Mac Chiang , Bard Liao , =?utf-8?q?P=C3=A9ter_Ujfalusi?= , Pierre-Louis Bossart Subject: [PATCH 05/12] ASoC: Intel: soc-acpi-intel-lnl-match: adds RT714 and RT1318 support Date: Fri, 26 Apr 2024 10:21:16 -0500 Message-Id: <20240426152123.36284-6-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> References: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: GCEOBX2UL6GQ3SJB3MHLMIXFYX5MD24T X-Message-ID-Hash: GCEOBX2UL6GQ3SJB3MHLMIXFYX5MD24T X-MailFrom: pierre-louis.bossart@linux.intel.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: From: Mac Chiang This patch adds support for corresponding codecs on LNL hardware configuration: SDW0: RT714 DMIC SDW1: RT1318 Left Speaker SDW2: RT1318 Right Speaker Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Signed-off-by: Mac Chiang Signed-off-by: Pierre-Louis Bossart --- .../intel/common/soc-acpi-intel-lnl-match.c | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/sound/soc/intel/common/soc-acpi-intel-lnl-match.c b/sound/soc/intel/common/soc-acpi-intel-lnl-match.c index 74d6dcd7471f..0318c1a46f3c 100644 --- a/sound/soc/intel/common/soc-acpi-intel-lnl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-lnl-match.c @@ -130,6 +130,33 @@ static const struct snd_soc_acpi_adr_device rt1316_3_group1_adr[] = { } }; +static const struct snd_soc_acpi_adr_device rt1318_1_group1_adr[] = { + { + .adr = 0x000130025D131801ull, + .num_endpoints = 1, + .endpoints = &spk_l_endpoint, + .name_prefix = "rt1318-1" + } +}; + +static const struct snd_soc_acpi_adr_device rt1318_2_group1_adr[] = { + { + .adr = 0x000232025D131801ull, + .num_endpoints = 1, + .endpoints = &spk_r_endpoint, + .name_prefix = "rt1318-2" + } +}; + +static const struct snd_soc_acpi_adr_device rt714_0_adr[] = { + { + .adr = 0x000030025D071401ull, + .num_endpoints = 1, + .endpoints = &single_endpoint, + .name_prefix = "rt714" + } +}; + static const struct snd_soc_acpi_adr_device rt714_1_adr[] = { { .adr = 0x000130025D071401ull, @@ -195,6 +222,25 @@ static const struct snd_soc_acpi_link_adr lnl_3_in_1_sdca[] = { {} }; +static const struct snd_soc_acpi_link_adr lnl_sdw_rt1318_l12_rt714_l0[] = { + { + .mask = BIT(1), + .num_adr = ARRAY_SIZE(rt1318_1_group1_adr), + .adr_d = rt1318_1_group1_adr, + }, + { + .mask = BIT(2), + .num_adr = ARRAY_SIZE(rt1318_2_group1_adr), + .adr_d = rt1318_2_group1_adr, + }, + { + .mask = BIT(0), + .num_adr = ARRAY_SIZE(rt714_0_adr), + .adr_d = rt714_0_adr, + }, + {} +}; + /* this table is used when there is no I2S codec present */ struct snd_soc_acpi_mach snd_soc_acpi_intel_lnl_sdw_machines[] = { /* mockup tests need to be first */ @@ -240,6 +286,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_lnl_sdw_machines[] = { .drv_name = "sof_sdw", .sof_tplg_filename = "sof-lnl-rt722-l0.tplg", }, + { + .link_mask = GENMASK(2, 0), + .links = lnl_sdw_rt1318_l12_rt714_l0, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-lnl-rt1318-l12-rt714-l0.tplg" + }, {}, }; EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_lnl_sdw_machines); From patchwork Fri Apr 26 15:21:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 792705 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 14C31C4345F for ; Fri, 26 Apr 2024 15:23: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 229AA14E7; Fri, 26 Apr 2024 17:23:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 229AA14E7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1714145016; bh=PEhn8HQcSVd6mSeWV30RYAJSQWq9dxPGiCp9O1JeE+o=; 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=tAuP5BbMr97sxU8CGZJ/PfnbzLmbbModxDprAjKvJYR3AzRMqUzDcmseUY0D8gUch zmcLP8eLMq70Q/vjeQdETk5/NwHx4mOSA2RJuiE7IVtSfUKhOM8w2VKwB94Cm49vMB t51dT2XJt70HnQXs99wI33AIs+6Kalx0iJJS2gOw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6D704F8063D; Fri, 26 Apr 2024 17:22: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 B8DE1F8063C; Fri, 26 Apr 2024 17:22:12 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9B7C4F80423; Fri, 26 Apr 2024 17:21:59 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 9B8CCF80423 for ; Fri, 26 Apr 2024 17:21:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9B8CCF80423 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=UA0KmZSm DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714144910; x=1745680910; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PEhn8HQcSVd6mSeWV30RYAJSQWq9dxPGiCp9O1JeE+o=; b=UA0KmZSm8Nniq4FlHxzFQcSqKHDpWK3iulIrB6r8ZtNX/1X8CH5POKEW XbbgbFmpriS0la7qTpCTHKdc8koNy0hmYSLAr11MCSbO5ti7E7wqOcabl ZlrlrSetTPiXQ67wkLyjU0YQJ5GAciEW9UI8YGcYRpuxXdRbpqngQzzYr b7EJTW/NdQmKTEDjMvVWI4b2itA9w65tzSz+WSTHsSKkgtAmCSRVORl3T 9PUZ8SYANfYjGR2GnvpAihI41ZwKb37D0PlcUnAKLn7IjvrYwfdAaWsJO o2WMz/LHxSW1v6jcNLlzGEJVkzVeYR5doBJB6bBkWIIGcir6faRjKwDgO g==; X-CSE-ConnectionGUID: I8HrgLTVTtGxna7L3enptQ== X-CSE-MsgGUID: lHfbwUIGTHu0Yi68Kghw9g== X-IronPort-AV: E=McAfee;i="6600,9927,11056"; a="21290621" X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="21290621" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:43 -0700 X-CSE-ConnectionGUID: 6HKKzj6bTdWsV+vqO8bB8Q== X-CSE-MsgGUID: zEUUyN3TTdKBKXE+HfltGQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="30259031" Received: from atarkhan-mobl2.amr.corp.intel.com (HELO pbossart-mobl6.intel.com) ([10.212.33.33]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:42 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Pierre-Louis Bossart Subject: [PATCH 06/12] ASoC: Intel: sof_sdw: Allocate snd_soc_card dynamically Date: Fri, 26 Apr 2024 10:21:17 -0500 Message-Id: <20240426152123.36284-7-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> References: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: 4DBX7XXRRE7SY2OQSGX24APDBB5CZVGU X-Message-ID-Hash: 4DBX7XXRRE7SY2OQSGX24APDBB5CZVGU X-MailFrom: pierre-louis.bossart@linux.intel.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: From: Peter Ujfalusi The static card_sof_sdw struct is modified during runtime and in case the module is not removed, but the card is, then the next time the card is created the card_sof_sdw will contain information from the previous card which might lead to hard to debug issues, side effects. Move the snd_soc_card into mc_private and use that to make sure that the card is initialized correctly. Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 20 +++++++++----------- sound/soc/intel/boards/sof_sdw_common.h | 1 + 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index d65c5da49000..384c3d41a9ad 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1882,12 +1882,6 @@ static int sof_sdw_card_late_probe(struct snd_soc_card *card) /* SoC card */ static const char sdw_card_long_name[] = "Intel Soundwire SOF"; -static struct snd_soc_card card_sof_sdw = { - .name = "soundwire", - .owner = THIS_MODULE, - .late_probe = sof_sdw_card_late_probe, -}; - /* 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) @@ -1939,20 +1933,24 @@ static void mc_dailink_exit_loop(struct snd_soc_card *card) static int mc_probe(struct platform_device *pdev) { - struct snd_soc_card *card = &card_sof_sdw; struct snd_soc_acpi_mach *mach = dev_get_platdata(&pdev->dev); + struct snd_soc_card *card; struct mc_private *ctx; int amp_num = 0, i; int ret; - card->dev = &pdev->dev; + dev_dbg(&pdev->dev, "Entry\n"); - dev_dbg(card->dev, "Entry\n"); - - ctx = devm_kzalloc(card->dev, sizeof(*ctx), GFP_KERNEL); + ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) return -ENOMEM; + card = &ctx->card; + card->dev = &pdev->dev; + card->name = "soundwire", + card->owner = THIS_MODULE, + card->late_probe = sof_sdw_card_late_probe, + snd_soc_card_set_drvdata(card, ctx); dmi_check_system(sof_sdw_quirk_table); diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index 89253938ebaa..853278c6e525 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -101,6 +101,7 @@ struct sof_sdw_codec_info { }; struct mc_private { + struct snd_soc_card card; struct snd_soc_jack sdw_headset; struct sof_hdmi_private hdmi; struct device *headset_codec_dev; /* only one headset per card */ From patchwork Fri Apr 26 15:21:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 792703 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48EAAC4345F for ; Fri, 26 Apr 2024 15:24: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 8F95CB70; Fri, 26 Apr 2024 17:24:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8F95CB70 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1714145081; bh=EN06Qbj+h6vmWB7m/IpZGvOt02dFoebcBQ4VHz/TBPQ=; 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=oio+/Tm2aeZRwQll/CyM/zI8jPVoptiLDlSWsmpdwUOp9J8mv4dlGRMJzGBuwSPk8 cukPJllovgRgjV+ZCGiiH/zjeGBcW9xGbwx0oXjPS6q7gv0sBiIYE+tVLDFHPp/Q6i W5rzjOU8lBfOvN0+SqqhovlsldQ31bL5FmH1UiwY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 11467F806D4; Fri, 26 Apr 2024 17:22: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 981C5F806CC; Fri, 26 Apr 2024 17:22:25 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 10749F805E5; Fri, 26 Apr 2024 17:22:01 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 DBAEFF80548 for ; Fri, 26 Apr 2024 17:21:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DBAEFF80548 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=dPoy/yyy DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714144910; x=1745680910; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EN06Qbj+h6vmWB7m/IpZGvOt02dFoebcBQ4VHz/TBPQ=; b=dPoy/yyytar3HnvQHULoIGEMh6+oujeoas1CACU+Ucj5vQhGfEvcsv/0 mtSMRZ589VXhr9GJhM34mI6zhfPZHeBVNZZFHxDRu5wkQ1lIMhPFxOltr aZ8psroKeCTn6hpMID6jSLGzGGnt+zc3r/pBARe/cT0dK42N3/86qs3OS peQK09EgQWhIzxgmYxKDIL0+AFeKJIuF8uprRiLGyljzLZq38KhIuiZLx nd+wyDT2EfTIwrKusrJuc1uxjJD6F1Ycr5PvepVO7WBlDG3f2vtREcuuN nGkd9rsdts8v07QAXDnEYGk3QwwxbbI+HNpB2C0+7pjP7EHyAWsmeLTce w==; X-CSE-ConnectionGUID: cuHEBxKNQdymEIWQ0ijHkw== X-CSE-MsgGUID: dsCV0J/MQbmZR+AAetjnUA== X-IronPort-AV: E=McAfee;i="6600,9927,11056"; a="21290626" X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="21290626" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:43 -0700 X-CSE-ConnectionGUID: vsV7XhHgRo25bOlE0XUwRw== X-CSE-MsgGUID: UB9LVCLCQZGb4I0qHSboiA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="30259032" Received: from atarkhan-mobl2.amr.corp.intel.com (HELO pbossart-mobl6.intel.com) ([10.212.33.33]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:43 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart , Ranjani Sridharan , =?utf-8?q?P=C3=A9ter?= =?utf-8?q?_Ujfalusi?= , Bard Liao Subject: [PATCH 07/12] ASoC: Intel: sof-sdw: don't set card long_name Date: Fri, 26 Apr 2024 10:21:18 -0500 Message-Id: <20240426152123.36284-8-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> References: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: XLD2REJ4HYLBRBCSIIXZKRM3FKQPOCXU X-Message-ID-Hash: XLD2REJ4HYLBRBCSIIXZKRM3FKQPOCXU X-MailFrom: pierre-louis.bossart@linux.intel.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: UCM can load a board-specific file based on the card long_name. Remove the constant "Intel Soundwire SOF" long_name so that the ASoC core can set the long_name based on DMI information. Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 384c3d41a9ad..b9a5fcb42847 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1879,9 +1879,6 @@ static int sof_sdw_card_late_probe(struct snd_soc_card *card) return ret; } -/* SoC card */ -static const char sdw_card_long_name[] = "Intel Soundwire SOF"; - /* 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) @@ -1999,8 +1996,6 @@ static int mc_probe(struct platform_device *pdev) return -ENOMEM; } - card->long_name = sdw_card_long_name; - /* Register the card */ ret = devm_snd_soc_register_card(card->dev, card); if (ret) { From patchwork Fri Apr 26 15:21:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 792408 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2FBC3C4345F for ; Fri, 26 Apr 2024 15:24: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 517B5EB6; Fri, 26 Apr 2024 17:24:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 517B5EB6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1714145068; bh=B+qnbfKGxF53UUuVHpaWIUfNY181CpLVuoKVGa7skpQ=; 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=QPETnsLl7WI5zJrkBrcSrwBxEgGucrwZj7LZ1fHjpUJPxV0MfIhW5aUVFzFiSbXKQ dLsMrsCOWGTR3Ic3SOxe1u8eXjJwQ3zWtiIRIo1rk6GuuZVnJ8a5ZsUd7gJ7L/yyJS nOl7wcpYmiTpyKEM/eaB441h0Mym7hCoXSawtkeU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id D8E63F806BB; Fri, 26 Apr 2024 17:22:23 +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 3BE1CF806AD; Fri, 26 Apr 2024 17:22:23 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4E173F805BE; Fri, 26 Apr 2024 17:22:00 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 1A947F80568 for ; Fri, 26 Apr 2024 17:21:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1A947F80568 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=YrrJFCfv DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714144910; x=1745680910; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=B+qnbfKGxF53UUuVHpaWIUfNY181CpLVuoKVGa7skpQ=; b=YrrJFCfvKHMtoGgrOnBjMlJdpRBg4VH7m+UzBRneOEE2IcE0gsqxlgy4 xFBWEnWipkIcZ2N11tTjrEg6fRE+Q17Xp1vx19BHMZ296VTPqwytvt6Lb yux6a2SdISe4rRcmmRF3hg8axVhMV6qMufuNCYHVBR15b4ICJiTLT5Y45 NqsXjiNY2sU4mT0BXWxfoVa0Kco3aXyDQEHx+vin8HNQvfmODj4KBIM8D wlcfgH4oMTwavFaJeRYmIKdsEAZlZSIRfzhdk80aHslHXOcKOWYgT2ZTA NFlgHbX7YVxSUoghz21AGQLw6xuycz+ouL3aBm+RDqDy2DQ8vFf4nIwYy Q==; X-CSE-ConnectionGUID: 2VIFY8DFTLylaWnwQGFIMQ== X-CSE-MsgGUID: NoNaLTcPTcqpsnyGsJjIYQ== X-IronPort-AV: E=McAfee;i="6600,9927,11056"; a="21290632" X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="21290632" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:44 -0700 X-CSE-ConnectionGUID: Qp10kG6pT8yVpCgnhl65ig== X-CSE-MsgGUID: U/5AsQU4SDu6nu5qMrIOmA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="30259033" Received: from atarkhan-mobl2.amr.corp.intel.com (HELO pbossart-mobl6.intel.com) ([10.212.33.33]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:44 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Bard Liao , Pierre-Louis Bossart Subject: [PATCH 08/12] ASoC: Intel: sof_sdw: add a space before cfg-amp in components Date: Fri, 26 Apr 2024 10:21:19 -0500 Message-Id: <20240426152123.36284-9-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> References: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: KLCLCYKTEJ6QDEZIAR5I723V3OKOBRH3 X-Message-ID-Hash: KLCLCYKTEJ6QDEZIAR5I723V3OKOBRH3 X-MailFrom: pierre-louis.bossart@linux.intel.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: From: Bard Liao UCM parse amp with Regex " cfg-amp:([0-9]+)". The "ASoC: Intel: sof_sdw: remove FOUR_SPEAKER quirks" patch removed "cfg-spk:%d " from components which removed the necessary space as well and cause UCM can't parse the amp number properly. Fixes: 744866d28fe6 ("ASoC: Intel: sof_sdw: remove FOUR_SPEAKER quirks") Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index b9a5fcb42847..f0622aa1b748 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1983,7 +1983,7 @@ static int mc_probe(struct platform_device *pdev) amp_num += codec_info_list[i].amp_num; card->components = devm_kasprintf(card->dev, GFP_KERNEL, - "cfg-amp:%d", amp_num); + " cfg-amp:%d", amp_num); if (!card->components) return -ENOMEM; From patchwork Fri Apr 26 15:21:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 792407 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 27106C4345F for ; Fri, 26 Apr 2024 15:25:02 +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 90B6DB60; Fri, 26 Apr 2024 17:24:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 90B6DB60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1714145100; bh=UJY7grWSVVzmt71CoQKUJ8Ty1qxgNvohbcE1hvLC7tk=; 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=srtJQNVWWXFQ1AHt7dIpcj2IN7LqxjvOT/3jWizIo/Ns+iPKIvJpBUJ+aIZqlaoaO P4SMunUdv54Ch+YJy63WtHlprtey29RMwUQr/aL+GgsjPK/KJYtkivLq9wcKgSyQt1 +TkK2excAR0ySy5oFmTb1vRQdQhbtHZx2mYbMiIU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 58CA3F806E3; Fri, 26 Apr 2024 17:22:29 +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 6FAECF806FA; Fri, 26 Apr 2024 17:22:28 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 58D0EF805FE; Fri, 26 Apr 2024 17:22:04 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 9BC4CF8056F for ; Fri, 26 Apr 2024 17:21:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9BC4CF8056F Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=cpKWxmhd DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714144912; x=1745680912; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UJY7grWSVVzmt71CoQKUJ8Ty1qxgNvohbcE1hvLC7tk=; b=cpKWxmhdf0SP+/xxtlcFWQjNB4nwcZacELQ8RQT/fSOF73eteBx/Te3u 9zhCaLYtt2szo78UtoI00XKakR9i14/WQCAYtzFMeq5CqKoSizXJbcxW1 p5aLyAMmWk/e7PGP8FHsTb2EhQ3NDvrho3EhphVKJAj6ZXwcEaXWWgF9m L485omQfH6MzxjE50kWy11wdwkEEReNvdVlZVuF2aerh9xFL3/zb6KviV DdTtbh1GG3E2ist5knn+CbYiCPmH3Q35CblgGhy0fcTusRm06l3AVrx0U TUQ2s93a3PIRUKRz1HJWCIsqB27LeqJ+Kw2iyhmlXyJs7ZKBSEAgXV530 g==; X-CSE-ConnectionGUID: hZ2c756oTVO5YflpCz+/WQ== X-CSE-MsgGUID: LOK0V5msRmOUdhmRhQFibg== X-IronPort-AV: E=McAfee;i="6600,9927,11056"; a="21290636" X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="21290636" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:44 -0700 X-CSE-ConnectionGUID: gt9LVAm6QmiwgOr3gOQCRw== X-CSE-MsgGUID: RwChO4oNRTmnwcKIe8RYNw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="30259034" Received: from atarkhan-mobl2.amr.corp.intel.com (HELO pbossart-mobl6.intel.com) ([10.212.33.33]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:44 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart , Bard Liao Subject: [PATCH 09/12] ASoC: Intel: sof-sdw: really remove FOUR_SPEAKER quirk Date: Fri, 26 Apr 2024 10:21:20 -0500 Message-Id: <20240426152123.36284-10-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> References: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: CF4MCYXZAUIUJI3DMNMKNZG7Y6VKED5B X-Message-ID-Hash: CF4MCYXZAUIUJI3DMNMKNZG7Y6VKED5B X-MailFrom: pierre-louis.bossart@linux.intel.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: Two independent GitHub PRs let to the addition of one quirk after it was removed.. Fixes: b10cb955c6c0 ("ASoC: Intel: sof_sdw: add quirk for Dell SKU 0C0F") Reviewed-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index f0622aa1b748..86bbf1c66ce8 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -421,8 +421,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0C0F") }, .driver_data = (void *)(SOF_SDW_TGL_HDMI | - RT711_JD2 | - SOF_SDW_FOUR_SPK), + RT711_JD2), }, { .callback = sof_sdw_quirk_cb, From patchwork Fri Apr 26 15:21:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 792701 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 61CBEC4345F for ; Fri, 26 Apr 2024 15:25: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 C7E6B14FD; Fri, 26 Apr 2024 17:25:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C7E6B14FD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1714145143; bh=/Q5k951MfI29ZAL5D5tRdzssa6I65w19r08aEgCu76Y=; 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=uo0Mv8AXSaBAfXrV9erUvFokkq0ucTB0BrJgiVu194J5uaTpysF5FnU072cUJJIbl 0ZxZ8rpmoaEdtZqYoFJyW314cY9McI2fthquSkdpppLpywV8xgHodCP6mel19tm0l0 nZkMnWEaiZrVvJgg1amDuezRYzzYumPT/ElnLOGo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6716DF805B1; Fri, 26 Apr 2024 17:22:38 +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 076BBF807D0; Fri, 26 Apr 2024 17:22:38 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7EA03F80685; Fri, 26 Apr 2024 17:22:18 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 D6BBDF80570 for ; Fri, 26 Apr 2024 17:21:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D6BBDF80570 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=joRblwcB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714144912; x=1745680912; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/Q5k951MfI29ZAL5D5tRdzssa6I65w19r08aEgCu76Y=; b=joRblwcBdkbs+1BEeKCKm3KHEavyNrrqbL0hjK6qxV4LF35P5fCJyuMo BQYsNGgevFJQQvF9W8ZIAGHGvGNTCPdSkvscHamMQhD84cSjI778uFxyQ r6OYMvyA1yDTtYToI8WVMCKFD2oqn+N+5MeYxVO9ASHkyEyDNFGiKqRDV 1QamKMxIkBPHpMokrHGUg+z2hfu60RGaeEhJ6cjVxFvXdKmT/7F+H9DhK GzNETotxhATYiGE/npHGnbLUEkdKCrTHj6zImh5cBlWdnNgy0Eq4WxUQE O4byMaq10rIvditlpDwqDgs3/+dmtlhOjSAgFL2hl1s/0BJRLt99+UNZK g==; X-CSE-ConnectionGUID: ry8pMEe2SkKYoMKX7dRpcg== X-CSE-MsgGUID: mVvX45kCQxWb1l961V5CZA== X-IronPort-AV: E=McAfee;i="6600,9927,11056"; a="21290641" X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="21290641" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:45 -0700 X-CSE-ConnectionGUID: RD49e2H4TWOHLoDjzogJVA== X-CSE-MsgGUID: PRT5lEO8TNSBWTG8n0TS7g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="30259035" Received: from atarkhan-mobl2.amr.corp.intel.com (HELO pbossart-mobl6.intel.com) ([10.212.33.33]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:45 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Charles Keepax , Bard Liao , Pierre-Louis Bossart Subject: [PATCH 10/12] ASoC: Intel: sof_sdw: Delay update of the codec_conf array Date: Fri, 26 Apr 2024 10:21:21 -0500 Message-Id: <20240426152123.36284-11-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> References: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: MK5YRFUN36BNMHOONEQ6DCO3CCMCAIDR X-Message-ID-Hash: MK5YRFUN36BNMHOONEQ6DCO3CCMCAIDR X-MailFrom: pierre-louis.bossart@linux.intel.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: From: Charles Keepax Move the population of the codec_conf array from endpoint parsing time to link creation time. This is slightly cleaner as the population is done whilst the DAI links are also being populated, putting all population together. However, primarily this facilitates allowing additional non-SoundWire devices to be easily added into the array in future feature additions. Reviewed-by: Bard Liao Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 48 ++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 86bbf1c66ce8..bf5f46a4c4aa 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1279,6 +1279,7 @@ struct sof_sdw_endpoint { u32 link_mask; const char *codec_name; + const char *name_prefix; struct sof_sdw_codec_info *codec_info; const struct sof_sdw_dai_info *dai_info; @@ -1340,7 +1341,6 @@ static int parse_sdw_endpoints(struct snd_soc_card *card, struct 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; - struct snd_soc_codec_conf *codec_conf = card->codec_conf; const struct snd_soc_acpi_link_adr *adr_link; struct sof_sdw_endpoint *sof_end = sof_ends; int num_dais = 0; @@ -1376,13 +1376,11 @@ static int parse_sdw_endpoints(struct snd_soc_card *card, if (!codec_name) return -ENOMEM; - codec_conf->dlc.name = codec_name; - codec_conf->name_prefix = adr_dev->name_prefix; - codec_conf++; - dev_dbg(dev, "Adding prefix %s for %s\n", adr_dev->name_prefix, codec_name); + sof_end->name_prefix = adr_dev->name_prefix; + 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; @@ -1443,21 +1441,27 @@ static int parse_sdw_endpoints(struct snd_soc_card *card, ctx->append_dai_type |= (num_link_dailinks > 1); } - WARN_ON(codec_conf != card->codec_conf + card->num_configs); - return num_dais; } static int create_sdw_dailink(struct snd_soc_card *card, struct sof_sdw_dailink *sof_dai, struct snd_soc_dai_link **dai_links, - int *be_id) + 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 sof_sdw_endpoint *sof_end; int stream; + list_for_each_entry(sof_end, &sof_dai->endpoints, list) { + if (sof_end->name_prefix) { + (*codec_conf)->dlc.name = sof_end->codec_name; + (*codec_conf)->name_prefix = sof_end->name_prefix; + (*codec_conf)++; + } + } + for_each_pcm_streams(stream) { static const char * const sdw_stream_name[] = { "SDW%d-Playback", @@ -1569,7 +1573,8 @@ static int create_sdw_dailink(struct snd_soc_card *card, static int create_sdw_dailinks(struct snd_soc_card *card, struct snd_soc_dai_link **dai_links, int *be_id, - struct sof_sdw_dailink *sof_dais) + struct sof_sdw_dailink *sof_dais, + struct snd_soc_codec_conf **codec_conf) { struct mc_private *ctx = snd_soc_card_get_drvdata(card); int ret, i; @@ -1581,7 +1586,8 @@ static int create_sdw_dailinks(struct snd_soc_card *card, while (sof_dais->initialised) { int current_be_id; - ret = create_sdw_dailink(card, sof_dais, dai_links, ¤t_be_id); + ret = create_sdw_dailink(card, sof_dais, dai_links, + ¤t_be_id, codec_conf); if (ret) return ret; @@ -1751,16 +1757,6 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) goto err_dai; } - /* will be populated when acpi endpoints are parsed */ - codec_conf = devm_kcalloc(dev, num_devs, sizeof(*codec_conf), GFP_KERNEL); - if (!codec_conf) { - ret = -ENOMEM; - goto err_end; - } - - card->codec_conf = codec_conf; - card->num_configs = num_devs; - ret = parse_sdw_endpoints(card, sof_dais, sof_ends); if (ret < 0) goto err_end; @@ -1798,6 +1794,12 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) sdw_be_num, ssp_num, dmic_num, ctx->hdmi.idisp_codec ? hdmi_num : 0, bt_num); + codec_conf = devm_kcalloc(dev, num_devs, sizeof(*codec_conf), GFP_KERNEL); + if (!codec_conf) { + ret = -ENOMEM; + goto err_end; + } + /* allocate BE dailinks */ num_links = sdw_be_num + ssp_num + dmic_num + hdmi_num + bt_num; dai_links = devm_kcalloc(dev, num_links, sizeof(*dai_links), GFP_KERNEL); @@ -1806,12 +1808,15 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) goto err_end; } + card->codec_conf = codec_conf; + card->num_configs = num_devs; card->dai_link = dai_links; card->num_links = num_links; /* SDW */ if (sdw_be_num) { - ret = create_sdw_dailinks(card, &dai_links, &be_id, sof_dais); + ret = create_sdw_dailinks(card, &dai_links, &be_id, + sof_dais, &codec_conf); if (ret) goto err_end; } @@ -1847,6 +1852,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) goto err_end; } + WARN_ON(codec_conf != card->codec_conf + card->num_configs); WARN_ON(dai_links != card->dai_link + card->num_links); err_end: From patchwork Fri Apr 26 15:21:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 792702 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6A85C4345F for ; Fri, 26 Apr 2024 15:25:14 +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 82C8414DE; Fri, 26 Apr 2024 17:25:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 82C8414DE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1714145112; bh=RZNfJj9F38dpuilu8NRrmzX3jZ+dUkuFYYD7MAVqxbc=; 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=DoPyEXDEWsOEj8aXMsEtPdvwVfrPM5lzZm1+IorbSXqYkBvUV7Im55ujpI6qsUJGg mUXtwF/kmXejYpbQxAtKlkFGzEZ3xj+1tgrXbpG6OJfU0tzCRPFDjU+q0bkaq5KXQY ZbewW0PhneKti1Fm9H9UVd42wRpqPn4AYUwlHLm4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 801E3F80724; Fri, 26 Apr 2024 17:22:33 +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 D7DDEF8070C; Fri, 26 Apr 2024 17:22:32 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 14F1BF8060E; Fri, 26 Apr 2024 17:22:08 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 0B4C0F80571 for ; Fri, 26 Apr 2024 17:21:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0B4C0F80571 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Vs9Nh7yq DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714144912; x=1745680912; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RZNfJj9F38dpuilu8NRrmzX3jZ+dUkuFYYD7MAVqxbc=; b=Vs9Nh7yqPs5P8AN1n6FVU9iBjSh0KDv+NFomjKyutVVX7smanHE5I6r6 Q6ecI2H1SQ1RfXH/qDU7yxvTzMQp56yIUfpYHKrfRr0NCDT73zJZJcGF6 558RHmQyvuefvTy6rKGyLIw21mEzcf46WkqFT1XtnIZPq/caHubWfNfi+ NvB9AZjm3BjUrKqflgsxWidUHofwE2yzvloewNWc/OjR393wJf76mNu2A 0rxtyVY65mZDCmk2UOoyq/NUQzhkBE03xxHceie46rYWdDMR2etYSUpek IcOlVy9FICUjdtoVkyZ9jhiJzmIGkcROGGhYbvCxGpCrZNXT/i5628iXl A==; X-CSE-ConnectionGUID: OqwZmJBsTSq5u7Bz3q8cRw== X-CSE-MsgGUID: UOkaT78nT3i642o+dthyzg== X-IronPort-AV: E=McAfee;i="6600,9927,11056"; a="21290647" X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="21290647" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:46 -0700 X-CSE-ConnectionGUID: 06E7xQTIQ5iaw7c1jIzf3A== X-CSE-MsgGUID: ObVN4uEdSZmAcHeOR4472w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="30259037" Received: from atarkhan-mobl2.amr.corp.intel.com (HELO pbossart-mobl6.intel.com) ([10.212.33.33]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:46 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Charles Keepax , Bard Liao , Pierre-Louis Bossart Subject: [PATCH 11/12] ASoC: Intel: sof_sdw: Add callbacks to register sidecar devices Date: Fri, 26 Apr 2024 10:21:22 -0500 Message-Id: <20240426152123.36284-12-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> References: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: E5HIIUSPMWKNG2BK4Y7EZVG7CDCEAK4P X-Message-ID-Hash: E5HIIUSPMWKNG2BK4Y7EZVG7CDCEAK4P X-MailFrom: pierre-louis.bossart@linux.intel.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: From: Charles Keepax Add support for systems that have additional non-SoundWire devices (sidecars) connected to one of the SoundWire devices in the system. This is done through the addition of two callbacks, one used at endpoint parsing time that will return the number of devices and DAI links to be added, and another called later as the DAI links are created that will populate those devices into the appropriate arrays. Reviewed-by: Bard Liao Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 22 ++++++++++++++++++++-- sound/soc/intel/boards/sof_sdw_common.h | 6 ++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index bf5f46a4c4aa..eaa79e29f5c2 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1280,6 +1280,7 @@ struct sof_sdw_endpoint { u32 link_mask; const char *codec_name; const char *name_prefix; + bool include_sidecar; struct sof_sdw_codec_info *codec_info; const struct sof_sdw_dai_info *dai_info; @@ -1335,7 +1336,8 @@ static struct sof_sdw_dailink *find_dailink(struct sof_sdw_dailink *dailinks, static int parse_sdw_endpoints(struct snd_soc_card *card, struct sof_sdw_dailink *sof_dais, - struct sof_sdw_endpoint *sof_ends) + struct sof_sdw_endpoint *sof_ends, + int *num_devs) { struct device *dev = card->dev; struct mc_private *ctx = snd_soc_card_get_drvdata(card); @@ -1345,6 +1347,7 @@ static int parse_sdw_endpoints(struct snd_soc_card *card, struct sof_sdw_endpoint *sof_end = sof_ends; int num_dais = 0; int i, j; + int ret; for (adr_link = mach_params->links; adr_link->num_adr; adr_link++) { int num_link_dailinks = 0; @@ -1381,6 +1384,14 @@ static int parse_sdw_endpoints(struct snd_soc_card *card, sof_end->name_prefix = adr_dev->name_prefix; + if (codec_info->count_sidecar && codec_info->add_sidecar) { + ret = codec_info->count_sidecar(card, &num_dais, num_devs); + if (ret) + return ret; + + sof_end->include_sidecar = true; + } + 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; @@ -1453,6 +1464,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, struct mc_private *ctx = snd_soc_card_get_drvdata(card); struct sof_sdw_endpoint *sof_end; int stream; + int ret; list_for_each_entry(sof_end, &sof_dai->endpoints, list) { if (sof_end->name_prefix) { @@ -1460,6 +1472,12 @@ static int create_sdw_dailink(struct snd_soc_card *card, (*codec_conf)->name_prefix = sof_end->name_prefix; (*codec_conf)++; } + + if (sof_end->include_sidecar) { + ret = sof_end->codec_info->add_sidecar(card, dai_links, codec_conf); + if (ret) + return ret; + } } for_each_pcm_streams(stream) { @@ -1757,7 +1775,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) goto err_dai; } - ret = parse_sdw_endpoints(card, sof_dais, sof_ends); + ret = parse_sdw_endpoints(card, sof_dais, sof_ends, &num_devs); if (ret < 0) goto err_end; diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index 853278c6e525..9dd42a8da8d7 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -98,6 +98,12 @@ struct sof_sdw_codec_info { 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 { From patchwork Fri Apr 26 15:21:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 792406 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BFE66C4345F for ; Fri, 26 Apr 2024 15:25: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 035B4A4A; Fri, 26 Apr 2024 17:25:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 035B4A4A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1714145136; bh=JiO2nqs/sWgSFc5uIdbhgYj17fRvGxX59e1sBqxBGAs=; 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=DSok1Dh2wSJ7PQxIBFq8cNMBhFJtlNqBfWAVU1rxnr3YJkz2zZSzjYHYdGeVyRhBQ nYESb7Vyzu1n2Qa/zEhSHomO7Cd9gFONe2KcuUjPXyk/HhPxAQt2ldcXYzN2bwCV7h fVxOVIxvi0bRrsSSnfB1Xu2jnYebk//Budf8WhE8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id D4F51F80797; Fri, 26 Apr 2024 17:22: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 31A14F8076C; Fri, 26 Apr 2024 17:22:35 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8E6DCF80649; Fri, 26 Apr 2024 17:22:14 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 99F4AF80578 for ; Fri, 26 Apr 2024 17:21:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 99F4AF80578 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=WRGYexqG DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714144914; x=1745680914; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JiO2nqs/sWgSFc5uIdbhgYj17fRvGxX59e1sBqxBGAs=; b=WRGYexqGH5CCVP5HfQ77MTMReRF+E8ycmxDJr5eUVdEJwzfJ2l95BS53 Zo6MlGpxmrBeNzFKoYAgGwWAmtV0eM5kRfngra9q0j/Cbc0OfEVsbKQ5z jjxcbiNHZNBF/b1+yFv8yqp2K24MGeG59TsAGR24iDF2Mz7u1K6hYLqkN RhapnpjMQIu4D4FaM1jyiR0e4lU8WN4agGK2mwBV0Xlx5vMB507nU/Ygu 54PSi1djLY7gLTBfc2eEvOuHNNJOubHxiDu4KZzTPM9r/48aAnuDNjzQD N/wFeOnZdwVSk9eMjL1KgqRDtBwnS6Cf7ycrAUxMpYO9TXdcPTfmmy0Ig g==; X-CSE-ConnectionGUID: gZjBeMDRQAKYu3PCTWjZbQ== X-CSE-MsgGUID: 5FggCMr9QE6ceOqRiTnnZQ== X-IronPort-AV: E=McAfee;i="6600,9927,11056"; a="21290652" X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="21290652" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:47 -0700 X-CSE-ConnectionGUID: RWEu+Ar7RF+2fJQTjo1PVQ== X-CSE-MsgGUID: Fg7PsVoWQV6lZyS1q1ZwCQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="30259038" Received: from atarkhan-mobl2.amr.corp.intel.com (HELO pbossart-mobl6.intel.com) ([10.212.33.33]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 08:21:46 -0700 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Maciej Strozek , Bard Liao , Charles Keepax , Pierre-Louis Bossart Subject: [PATCH 12/12] ASoC: intel: sof_sdw: Add support for cs42l43-cs35l56 sidecar amps Date: Fri, 26 Apr 2024 10:21:23 -0500 Message-Id: <20240426152123.36284-13-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> References: <20240426152123.36284-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: DQ5HGIJDYWAY4XIF3PLQODEMA3BW6SCX X-Message-ID-Hash: DQ5HGIJDYWAY4XIF3PLQODEMA3BW6SCX X-MailFrom: pierre-louis.bossart@linux.intel.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: From: Maciej Strozek The cs42l43 has both a SPI master and an I2S interface, these can be used to populate 2 cs35l56 amplifiers as sidecar devices along side the cs42l43. Giving a system that looks like: +-----+ +---------+ <- SPI -> +---------+ | CPU | <- SDW -> | CS42L43 | | CS35L56 | +-----+ +---------+ <- I2S -> +---------+ Add a quirk to specify this feature is present and use it to add codec to codec DAI link to connect the amplifiers into the sound card, add appropriate widgets, and setup clocking on the amplifiers. Reviewed-by: Bard Liao Signed-off-by: Maciej Strozek Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/Kconfig | 1 + sound/soc/intel/boards/Makefile | 1 + sound/soc/intel/boards/bridge_cs35l56.c | 137 +++++++++++++++++++++++ sound/soc/intel/boards/sof_sdw.c | 6 +- sound/soc/intel/boards/sof_sdw_common.h | 20 ++++ sound/soc/intel/boards/sof_sdw_cs42l43.c | 14 ++- 6 files changed, 173 insertions(+), 6 deletions(-) create mode 100644 sound/soc/intel/boards/bridge_cs35l56.c diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig index 0ad7b0a1e237..b122b8aedd9a 100644 --- a/sound/soc/intel/boards/Kconfig +++ b/sound/soc/intel/boards/Kconfig @@ -690,6 +690,7 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH select SND_SOC_CS42L43_SDW select MFD_CS42L43 select MFD_CS42L43_SDW + select SND_SOC_CS35L56_SPI select SND_SOC_CS35L56_SDW select SND_SOC_DMIC select SND_SOC_INTEL_HDA_DSP_COMMON diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile index 119413c262de..1c099e717eca 100644 --- a/sound/soc/intel/boards/Makefile +++ b/sound/soc/intel/boards/Makefile @@ -37,6 +37,7 @@ snd-soc-ehl-rt5660-objs := ehl_rt5660.o snd-soc-sof-ssp-amp-objs := sof_ssp_amp.o snd-soc-sof-sdw-objs += 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_rt712_sdca.o sof_sdw_rt722_sdca.o \ diff --git a/sound/soc/intel/boards/bridge_cs35l56.c b/sound/soc/intel/boards/bridge_cs35l56.c new file mode 100644 index 000000000000..c3995e724aed --- /dev/null +++ b/sound/soc/intel/boards/bridge_cs35l56.c @@ -0,0 +1,137 @@ +// SPDX-License-Identifier: GPL-2.0-only +// +// Intel SOF Machine Driver with Cirrus Logic CS35L56 Smart Amp + +#include +#include +#include +#include +#include +#include +#include +#include "sof_sdw_common.h" + +static const struct snd_soc_dapm_widget bridge_widgets[] = { + SND_SOC_DAPM_SPK("Bridge Speaker", NULL), +}; + +static const struct snd_soc_dapm_route bridge_map[] = { + {"Bridge Speaker", NULL, "AMPL SPK"}, + {"Bridge Speaker", NULL, "AMPR SPK"}, +}; + +static const char * const bridge_cs35l56_name_prefixes[] = { + "AMPL", + "AMPR", +}; + +static int bridge_cs35l56_asp_init(struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_card *card = rtd->card; + int i, ret; + unsigned int rx_mask = 3; // ASP RX1, RX2 + unsigned int tx_mask = 3; // ASP TX1, TX2 + struct snd_soc_dai *codec_dai; + struct snd_soc_dai *cpu_dai; + + card->components = devm_kasprintf(card->dev, GFP_KERNEL, + "%s spk:cs35l56-bridge", + card->components); + if (!card->components) + return -ENOMEM; + + ret = snd_soc_dapm_new_controls(&card->dapm, bridge_widgets, + ARRAY_SIZE(bridge_widgets)); + if (ret) { + dev_err(card->dev, "widgets addition failed: %d\n", ret); + return ret; + } + + ret = snd_soc_dapm_add_routes(&card->dapm, bridge_map, ARRAY_SIZE(bridge_map)); + if (ret) { + dev_err(card->dev, "map addition failed: %d\n", ret); + return ret; + } + + /* 4 x 16-bit sample slots and FSYNC=48000, BCLK=3.072 MHz */ + for_each_rtd_codec_dais(rtd, i, codec_dai) { + ret = snd_soc_dai_set_tdm_slot(codec_dai, tx_mask, rx_mask, 4, 16); + if (ret < 0) + return ret; + + ret = snd_soc_dai_set_sysclk(codec_dai, 0, 3072000, SND_SOC_CLOCK_IN); + if (ret < 0) + return ret; + } + + for_each_rtd_cpu_dais(rtd, i, cpu_dai) { + ret = snd_soc_dai_set_tdm_slot(cpu_dai, tx_mask, rx_mask, 4, 16); + if (ret < 0) + return ret; + } + + return 0; +} + +static const struct snd_soc_pcm_stream bridge_params = { + .formats = SNDRV_PCM_FMTBIT_S16_LE, + .rate_min = 48000, + .rate_max = 48000, + .channels_min = 2, + .channels_max = 2, +}; + +SND_SOC_DAILINK_DEFS(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")), + DAILINK_COMP_ARRAY(COMP_PLATFORM("cs42l43-codec"))); + +static const struct snd_soc_dai_link bridge_dai_template = { + .name = "cs42l43-cs35l56", + .init = bridge_cs35l56_asp_init, + .c2c_params = &bridge_params, + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_CBC_CFC, + SND_SOC_DAILINK_REG(bridge_dai), +}; + +int bridge_cs35l56_count_sidecar(struct snd_soc_card *card, + int *num_dais, int *num_devs) +{ + if (sof_sdw_quirk & SOF_SIDECAR_AMPS) { + (*num_dais)++; + (*num_devs) += ARRAY_SIZE(bridge_cs35l56_name_prefixes); + } + + 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) +{ + if (sof_sdw_quirk & SOF_SIDECAR_AMPS) { + **dai_links = bridge_dai_template; + + for (int i = 0; i < ARRAY_SIZE(bridge_cs35l56_name_prefixes); i++) { + (*codec_conf)->dlc.name = (*dai_links)->codecs[i].name; + (*codec_conf)->name_prefix = bridge_cs35l56_name_prefixes[i]; + (*codec_conf)++; + } + + (*dai_links)++; + } + + return 0; +} + +int bridge_cs35l56_spk_init(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_links, + struct sof_sdw_codec_info *info, + bool playback) +{ + if (sof_sdw_quirk & SOF_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 eaa79e29f5c2..b1595fdb500d 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -39,6 +39,8 @@ static void log_quirks(struct device *dev) 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"); } static int sof_sdw_quirk_cb(const struct dmi_system_id *id) @@ -995,6 +997,8 @@ static struct sof_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, .dais = { { .direction = {true, false}, @@ -1023,7 +1027,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID}, .init = sof_sdw_cs42l43_spk_init, .rtd_init = cs42l43_spk_rtd_init, - .quirk = SOF_CODEC_SPKR, + .quirk = SOF_CODEC_SPKR | SOF_SIDECAR_AMPS, }, }, .dai_num = 4, diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index 9dd42a8da8d7..94657dd210f5 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -55,6 +55,16 @@ enum { #define SOF_SDW_NO_AGGREGATION BIT(14) /* If a CODEC has an optional speaker output, this quirk will enable it */ #define SOF_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 + */ +#define SOF_SIDECAR_AMPS BIT(16) /* BT audio offload: reserve 3 bits for future */ #define SOF_BT_OFFLOAD_SSP_SHIFT 15 @@ -177,6 +187,16 @@ int sof_sdw_cs42l43_spk_init(struct snd_soc_card *card, 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 sof_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, diff --git a/sound/soc/intel/boards/sof_sdw_cs42l43.c b/sound/soc/intel/boards/sof_sdw_cs42l43.c index 5361249f0f53..0fd5e099bb1a 100644 --- a/sound/soc/intel/boards/sof_sdw_cs42l43.c +++ b/sound/soc/intel/boards/sof_sdw_cs42l43.c @@ -124,10 +124,14 @@ int cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd) struct snd_soc_card *card = rtd->card; int ret; - card->components = devm_kasprintf(card->dev, GFP_KERNEL, "%s spk:cs42l43-spk", - card->components); - if (!card->components) - return -ENOMEM; + if (!(sof_sdw_quirk & SOF_SIDECAR_AMPS)) { + /* Will be set by the bridge code in this case */ + card->components = devm_kasprintf(card->dev, GFP_KERNEL, + "%s spk:cs42l43-spk", + card->components); + if (!card->components) + return -ENOMEM; + } ret = snd_soc_dapm_new_controls(&card->dapm, cs42l43_spk_widgets, ARRAY_SIZE(cs42l43_spk_widgets)); @@ -155,7 +159,7 @@ int sof_sdw_cs42l43_spk_init(struct snd_soc_card *card, info->amp_num++; - return 0; + return bridge_cs35l56_spk_init(card, dai_links, info, playback); } int cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd)