From patchwork Thu Feb 8 16:55: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: 770913 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 365BBC4828F for ; Thu, 8 Feb 2024 16:57:39 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 78FE6820; Thu, 8 Feb 2024 17:57:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 78FE6820 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1707411457; bh=hFinSNxO5QebP9372ub5GWFoHS3nI5f2YuCXMjpNQZs=; 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=TvNYZfkoCvsdbf3loWWkM50X/k75b4CCL+vXIow725RQQsibuHw/sN9H136AL1ox8 OpaZxcQoc7FbSbEAX4bkbJYPOD75OPBHjroutRj6rWr8/cGjQ9k4aPzMgezYgFHPfm UMeDDP0hpqGP6mgPXX/dT/Lk8dXlWMRItIZyrF1E= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 40D25F80633; Thu, 8 Feb 2024 17:56:20 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id ACFF5F80602; Thu, 8 Feb 2024 17:56:19 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B940FF8056F; Thu, 8 Feb 2024 17:56:07 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (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 D1C40F80153 for ; Thu, 8 Feb 2024 17:56:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D1C40F80153 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=AMQ105FD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707411363; x=1738947363; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hFinSNxO5QebP9372ub5GWFoHS3nI5f2YuCXMjpNQZs=; b=AMQ105FDiUqBi/aTRXBhdeyFOgUmiGgB07ysDYL7dwybTicq8CEvI772 R7VOrrjCS+eIdFD9YU+1eBMgdLC0DwUDV2y4OX56WfsD2qi9ucU73TQ0r zWdLgvWAW001N9VyunWag317hI2PgLz537GusvpDVMZ0bdLjfZTFWt0+o sZrxgbRIvYJgY2db3/z/qTjsRKQiMx9MKGyHL3mjxgkdF8xf924xhRi3x PkFLEft6w6YPWgygrVvdcCC7iV6uUWff4GJE+2VZAnQTJrAZZ+ob+ySna fJsVsDdTAUXr4ghfQe3Aw0oixDWetzT7Ym1kCEO/EfYDlwniPuhkZIVyi g==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="395675306" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="395675306" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:55:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="1690140" Received: from stang1-mobl1.amr.corp.intel.com (HELO localhost.localdomain) ([10.212.92.130]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:55:55 -0800 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Brent Lu , Bard Liao , Pierre-Louis Bossart Subject: [PATCH 01/24] ASoC: Intel: sof_rt5682: board id cleanup for jsl boards Date: Thu, 8 Feb 2024 10:55:22 -0600 Message-Id: <20240208165545.93811-2-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> References: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: 6WEBDTVCABVBJSGVTPMIHYWHAYZMY5GT X-Message-ID-Hash: 6WEBDTVCABVBJSGVTPMIHYWHAYZMY5GT 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: Brent Lu Many board configs are duplicated since codec and amplifier type are removed from board quirk. Introduce "jsl_rt5682_def" board to reduce the number of jsl board configs. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_rt5682.c | 25 +------------------ .../intel/common/soc-acpi-intel-jsl-match.c | 10 ++++---- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c index cd50f26d1edb..3763985f570f 100644 --- a/sound/soc/intel/boards/sof_rt5682.c +++ b/sound/soc/intel/boards/sof_rt5682.c @@ -810,30 +810,7 @@ static const struct platform_device_id board_ids[] = { SOF_RT5682_SSP_AMP(1)), }, { - .name = "jsl_rt5682_rt1015", - .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | - SOF_RT5682_SSP_CODEC(0) | - SOF_RT5682_SSP_AMP(1)), - }, - { - .name = "jsl_rt5682_mx98360", - .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | - SOF_RT5682_SSP_CODEC(0) | - SOF_RT5682_SSP_AMP(1)), - }, - { - .name = "jsl_rt5682_rt1015p", - .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | - SOF_RT5682_SSP_CODEC(0) | - SOF_RT5682_SSP_AMP(1)), - }, - { - .name = "jsl_rt5682", - .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | - SOF_RT5682_SSP_CODEC(0)), - }, - { - .name = "jsl_rt5650", + .name = "jsl_rt5682_def", .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | SOF_RT5682_SSP_CODEC(0) | SOF_RT5682_SSP_AMP(1)), diff --git a/sound/soc/intel/common/soc-acpi-intel-jsl-match.c b/sound/soc/intel/common/soc-acpi-intel-jsl-match.c index 342bbbb48ca7..a6ac2525df17 100644 --- a/sound/soc/intel/common/soc-acpi-intel-jsl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-jsl-match.c @@ -66,28 +66,28 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_jsl_machines[] = { }, { .comp_ids = &rt5682_rt5682s_hp, - .drv_name = "jsl_rt5682_rt1015", + .drv_name = "jsl_rt5682_def", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &rt1015_spk, .sof_tplg_filename = "sof-jsl-rt5682-rt1015.tplg", }, { .comp_ids = &rt5682_rt5682s_hp, - .drv_name = "jsl_rt5682_rt1015p", + .drv_name = "jsl_rt5682_def", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &rt1015p_spk, .sof_tplg_filename = "sof-jsl-rt5682-rt1015.tplg", }, { .comp_ids = &rt5682_rt5682s_hp, - .drv_name = "jsl_rt5682_mx98360", + .drv_name = "jsl_rt5682_def", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &mx98360a_spk, .sof_tplg_filename = "sof-jsl-rt5682-mx98360a.tplg", }, { .comp_ids = &rt5682_rt5682s_hp, - .drv_name = "jsl_rt5682", + .drv_name = "jsl_rt5682_def", .sof_tplg_filename = "sof-jsl-rt5682.tplg", }, { @@ -107,7 +107,7 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_jsl_machines[] = { }, { .id = "10EC5650", - .drv_name = "jsl_rt5650", + .drv_name = "jsl_rt5682_def", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &rt5650_spk, .sof_tplg_filename = "sof-jsl-rt5650.tplg", From patchwork Thu Feb 8 16:55: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: 770914 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 44335C48260 for ; Thu, 8 Feb 2024 16:57:03 +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 4226382B; Thu, 8 Feb 2024 17:56:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4226382B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1707411421; bh=CwCQqe8Wtinvw9+lp8kMPSEZjWhZhkC5BLRRyJmVlaM=; 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=rei4ARgXxZNGEPTsqujOrH4LyANd3h4DXx6yPtHa1YXOJridf/gxnUdNe7k1loDbv TW1GqDR9d4IXsrh0TPA8LNyt2vec5hsc1lTn6POJy1uIv6E8IuQGfn/9uKNaXW78e/ ov534MSYesGlhNzvSp8E5Rt+5nNll0lBn8/YGlTI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 81C4CF805E1; Thu, 8 Feb 2024 17:56:13 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 06FB0F805E4; Thu, 8 Feb 2024 17:56:13 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4107AF80568; Thu, 8 Feb 2024 17:56:06 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (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 31087F801EB for ; Thu, 8 Feb 2024 17:56:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 31087F801EB 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=N9PPuh3J DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707411363; x=1738947363; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CwCQqe8Wtinvw9+lp8kMPSEZjWhZhkC5BLRRyJmVlaM=; b=N9PPuh3JLTCGjkDlM2DdBLl6VRn4DpfI4ZIU9RQzo1dawqe7sWAtuHWt VgsqTUJ7QAsXa0urkvnF4fawD5HjqX21mx7JJLmBPtVnaNHkRpisqbRLb 6EPaYxMxbnrgsCvW7KFrYuRbBVUiMYuT3vy2PIY11yBqQZUXgFUjr/yNv PvnPsvEoAp/pA6mbpB979TkCfgtsxcmfHfhOf2T2zYShtGctYn9Rodoox DNzeFa4FbNuyuvgPQ0ENwU2uJCIRSxN9xlJPiwJJA381/pfVzYwy/Z9wi E5oh6lI0qsyiepsWFWSU2I3bcJWzTd8OhCatlT9mho6y8qVeVO7NRkac1 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="395675310" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="395675310" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:55:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="1690146" Received: from stang1-mobl1.amr.corp.intel.com (HELO localhost.localdomain) ([10.212.92.130]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:55:56 -0800 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Brent Lu , Bard Liao , Pierre-Louis Bossart Subject: [PATCH 02/24] ASoC: Intel: sof_rt5682: board id cleanup for tgl boards Date: Thu, 8 Feb 2024 10:55:23 -0600 Message-Id: <20240208165545.93811-3-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> References: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: EV7HYYWSOO6V3BW7QB55D626O7J56LCU X-Message-ID-Hash: EV7HYYWSOO6V3BW7QB55D626O7J56LCU 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: Brent Lu Many board configs are duplicated since codec and amplifier type are removed from board quirk. Introduce "tgl_rt5682_def" board to reduce the number of tgl board configs. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_rt5682.c | 20 +------------------ .../intel/common/soc-acpi-intel-tgl-match.c | 6 +++--- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c index 3763985f570f..9644ae22c6ee 100644 --- a/sound/soc/intel/boards/sof_rt5682.c +++ b/sound/soc/intel/boards/sof_rt5682.c @@ -816,25 +816,7 @@ static const struct platform_device_id board_ids[] = { SOF_RT5682_SSP_AMP(1)), }, { - .name = "tgl_mx98357_rt5682", - .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | - SOF_RT5682_SSP_CODEC(0) | - SOF_RT5682_SSP_AMP(1) | - SOF_RT5682_NUM_HDMIDEV(4) | - SOF_BT_OFFLOAD_SSP(2) | - SOF_SSP_BT_OFFLOAD_PRESENT), - }, - { - .name = "tgl_rt1011_rt5682", - .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | - SOF_RT5682_SSP_CODEC(0) | - SOF_RT5682_SSP_AMP(1) | - SOF_RT5682_NUM_HDMIDEV(4) | - SOF_BT_OFFLOAD_SSP(2) | - SOF_SSP_BT_OFFLOAD_PRESENT), - }, - { - .name = "tgl_mx98373_rt5682", + .name = "tgl_rt5682_def", .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | SOF_RT5682_SSP_CODEC(0) | SOF_RT5682_SSP_AMP(1) | diff --git a/sound/soc/intel/common/soc-acpi-intel-tgl-match.c b/sound/soc/intel/common/soc-acpi-intel-tgl-match.c index e5f721ba5ed4..0fba0a60d9c7 100644 --- a/sound/soc/intel/common/soc-acpi-intel-tgl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-tgl-match.c @@ -495,21 +495,21 @@ static const struct snd_soc_acpi_codecs tgl_lt6911_hdmi = { struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_machines[] = { { .comp_ids = &tgl_rt5682_rt5682s_hp, - .drv_name = "tgl_mx98357_rt5682", + .drv_name = "tgl_rt5682_def", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &tgl_codecs, .sof_tplg_filename = "sof-tgl-max98357a-rt5682.tplg", }, { .comp_ids = &tgl_rt5682_rt5682s_hp, - .drv_name = "tgl_mx98373_rt5682", + .drv_name = "tgl_rt5682_def", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &tgl_max98373_amp, .sof_tplg_filename = "sof-tgl-max98373-rt5682.tplg", }, { .comp_ids = &tgl_rt5682_rt5682s_hp, - .drv_name = "tgl_rt1011_rt5682", + .drv_name = "tgl_rt5682_def", .machine_quirk = snd_soc_acpi_codec_list, .quirk_data = &tgl_rt1011_amp, .sof_tplg_filename = "sof-tgl-rt1011-rt5682.tplg", From patchwork Thu Feb 8 16:55:27 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: 770910 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 54EE3C48260 for ; Thu, 8 Feb 2024 16:59: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 72152E94; Thu, 8 Feb 2024 17:59:03 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 72152E94 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1707411553; bh=rQO9FLpkFRLxbU1v+Ijha8xImycqkNNU8d2LzJfHFaU=; 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=mnDY6ZexWaEWk6+OE5BDs/DoNj+AoUuwtJBWGn4tVGxCe381wHppF4fF2x6H64MVb E5mZR9yKoCfXVNqhMdyOR/LCbNL0++o5tGHXq2fSnh/CfFjuR+c5O6ddZnAWwIlU50 qaUwdEXod3RG7HsLyajB3RBgm4wsCxIK90oWOs9E= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8E264F806E3; Thu, 8 Feb 2024 17:56:49 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id B8DF8F806DF; Thu, 8 Feb 2024 17:56:48 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 078F8F8060B; Thu, 8 Feb 2024 17:56:16 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (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 8DCE4F801EB for ; Thu, 8 Feb 2024 17:56:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8DCE4F801EB 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=eh/KHK39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707411366; x=1738947366; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rQO9FLpkFRLxbU1v+Ijha8xImycqkNNU8d2LzJfHFaU=; b=eh/KHK39dkTNiRi0TSR7g4otJwjAD/YeY73c/HH2JuqufkMsfhUFMUFB R1WWwVahe4YX5Oj+ImxNX3vmLByT1vU7rVQHyeyKcBvRf+kZeZvHXO8e2 /iSCCoHXPatGhCneZXfP+IgTiQcWKI10f8mLJxp9P8bCxscbY8IkDsM2p 3TD1fjMJpiN40pAJ95k7HOKeHqWKPorwYp4xilZ/l6Sy1AGcdc1BgsXNL gYY1p9vue8uhg4g82C1lbAJk2qUXEhvPnvmn5J+4dK1Kala8Xv7fFOH/3 e2uVuoO2K6TLAOAXjiHX9e8dOvTqJ+e2jmCX/FMLdKD8jYaU6zP8IIHln Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="395675333" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="395675333" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:55:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="1690166" Received: from stang1-mobl1.amr.corp.intel.com (HELO localhost.localdomain) ([10.212.92.130]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:55:58 -0800 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Brent Lu , Bard Liao , Pierre-Louis Bossart Subject: [PATCH 06/24] ASoC: Intel: sof_rt5682: dmi quirk cleanup for mtl boards Date: Thu, 8 Feb 2024 10:55:27 -0600 Message-Id: <20240208165545.93811-7-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> References: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: 3T6V5J5TTN4ECXLMOGLISYEE4H464HY3 X-Message-ID-Hash: 3T6V5J5TTN4ECXLMOGLISYEE4H464HY3 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: Brent Lu Some dmi quirks are duplicated since codec and amplifier type are removed from board quirk. Remove redundant quirks. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_rt5682.c | 40 ----------------------------- 1 file changed, 40 deletions(-) diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c index fc2582045598..640d17c6cd35 100644 --- a/sound/soc/intel/boards/sof_rt5682.c +++ b/sound/soc/intel/boards/sof_rt5682.c @@ -154,46 +154,6 @@ static const struct dmi_system_id sof_rt5682_quirk_table[] = { SOF_RT5682_SSP_AMP(2) | SOF_RT5682_NUM_HDMIDEV(4)), }, - { - .callback = sof_rt5682_quirk_cb, - .matches = { - DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Rex"), - DMI_MATCH(DMI_OEM_STRING, "AUDIO-MAX98360_ALC5682I_I2S"), - }, - .driver_data = (void *)(SOF_RT5682_MCLK_EN | - SOF_RT5682_SSP_CODEC(2) | - SOF_RT5682_SSP_AMP(0) | - SOF_RT5682_NUM_HDMIDEV(3) | - SOF_BT_OFFLOAD_SSP(1) | - SOF_SSP_BT_OFFLOAD_PRESENT - ), - }, - { - .callback = sof_rt5682_quirk_cb, - .matches = { - DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Rex"), - DMI_MATCH(DMI_OEM_STRING, "AUDIO-MAX98360_ALC5682I_DISCRETE_I2S_BT"), - }, - .driver_data = (void *)(SOF_RT5682_MCLK_EN | - SOF_RT5682_SSP_CODEC(2) | - SOF_RT5682_SSP_AMP(0) | - SOF_RT5682_NUM_HDMIDEV(3) | - SOF_BT_OFFLOAD_SSP(1) | - SOF_SSP_BT_OFFLOAD_PRESENT - ), - }, - { - .callback = sof_rt5682_quirk_cb, - .matches = { - DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Rex"), - DMI_MATCH(DMI_OEM_STRING, "AUDIO-ALC1019_ALC5682I_I2S"), - }, - .driver_data = (void *)(SOF_RT5682_MCLK_EN | - SOF_RT5682_SSP_CODEC(2) | - SOF_RT5682_SSP_AMP(0) | - SOF_RT5682_NUM_HDMIDEV(3) - ), - }, { .callback = sof_rt5682_quirk_cb, .matches = { From patchwork Thu Feb 8 16:55:28 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: 770912 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 E470AC48260 for ; Thu, 8 Feb 2024 16:58:11 +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 E522CE9D; Thu, 8 Feb 2024 17:57:59 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E522CE9D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1707411489; bh=xdfWejQVbul49etFkgjB6iDos3edVlsKpJlTGBqcd30=; 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=eHdkr9kCNI4sf1wBRI7NYrhUOagC1gfj2bj1JBZ9iT0alv5H8M+KWnjDJdfDPwf8K cA6/a196ziTgyk+2Tema/x9z7PkLHv4tdht9GZEVwampDYlBTA/hHeBgb4VA7PSfoQ hvxvn5WrRVmABQKQOtyRFh6VEOe/kQnj+jnNgyEo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6190AF805F2; Thu, 8 Feb 2024 17:56:29 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 64906F805E2; Thu, 8 Feb 2024 17:56:29 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C486EF805E5; Thu, 8 Feb 2024 17:56:13 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (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 D0FAAF80567 for ; Thu, 8 Feb 2024 17:56:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D0FAAF80567 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=ACvREZ5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707411367; x=1738947367; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xdfWejQVbul49etFkgjB6iDos3edVlsKpJlTGBqcd30=; b=ACvREZ5Dn46IZHB1wmrtWYRvD1ihBkolSasyvTveB6mP9MORw937jpae +VuPmQOKvxOeVozlJr879minP23AdwZ/+tz3ivj1/OB4SPXax9rcWKy27 lrTyfHI9m4TPxIHCfb9/Zz7ym2MpkgClxroXYUFx5fQfsoF27a3MifVC3 S0ZvuYPqlC0K9aFNZEYkFMrvT4fs6DnU34Krjz06GScVbKLW2YJb4Nco5 9Iq4ih9eIPwcFzCKZRNrUyHIymf4rZU7YCrJH6zZ+UQCHWn+zfZpmkEnY xkODhElw2u7DdMM1m/gxz8IQaJK9Y2ym3u/OT3IfaScHRk5RnGRpeXIWW g==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="395675338" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="395675338" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:55:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="1690175" Received: from stang1-mobl1.amr.corp.intel.com (HELO localhost.localdomain) ([10.212.92.130]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:55:58 -0800 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Brent Lu , Bard Liao , Pierre-Louis Bossart Subject: [PATCH 07/24] ASoC: Intel: board_helpers: support DAI link order customization Date: Thu, 8 Feb 2024 10:55:28 -0600 Message-Id: <20240208165545.93811-8-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> References: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: XWD6MKXKGMMWCJF4TU4ZJBWPV4GI4VQT X-Message-ID-Hash: XWD6MKXKGMMWCJF4TU4ZJBWPV4GI4VQT 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: Brent Lu Add an new field link_order_overwrite to sof_card_private structure to support machine drivers which DAI link order is different from the order used in sof_rt5682 (i.e. GLK boards or no-codec boards). Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_board_helpers.c | 207 +++++++++++++-------- sound/soc/intel/boards/sof_board_helpers.h | 26 +++ 2 files changed, 158 insertions(+), 75 deletions(-) diff --git a/sound/soc/intel/boards/sof_board_helpers.c b/sound/soc/intel/boards/sof_board_helpers.c index 4f2cb8e52971..25f9ff12618c 100644 --- a/sound/soc/intel/boards/sof_board_helpers.c +++ b/sound/soc/intel/boards/sof_board_helpers.c @@ -73,6 +73,16 @@ static int dmic_init(struct snd_soc_pcm_runtime *rtd) /* * DAI Link Helpers */ + +/* DEFAULT_LINK_ORDER: the order used in sof_rt5682 */ +#define DEFAULT_LINK_ORDER SOF_LINK_ORDER(SOF_LINK_CODEC, \ + SOF_LINK_DMIC01, \ + SOF_LINK_DMIC16K, \ + SOF_LINK_IDISP_HDMI, \ + SOF_LINK_AMP, \ + SOF_LINK_BT_OFFLOAD, \ + SOF_LINK_HDMI_IN) + static struct snd_soc_dai_link_component dmic_component[] = { { .name = "dmic-codec", @@ -416,6 +426,7 @@ int sof_intel_board_set_dai_link(struct device *dev, struct snd_soc_card *card, int idx = 0; int ret; int ssp_hdmi_in = 0; + unsigned long link_order, link; num_links = calculate_num_links(ctx); @@ -424,94 +435,140 @@ int sof_intel_board_set_dai_link(struct device *dev, struct snd_soc_card *card, if (!links) return -ENOMEM; - /* headphone codec */ - if (ctx->codec_type != CODEC_NONE) { - ret = sof_intel_board_set_codec_link(dev, &links[idx], idx, - ctx->codec_type, - ctx->ssp_codec); - if (ret) { - dev_err(dev, "fail to set codec link, ret %d\n", ret); - return ret; - } + if (ctx->link_order_overwrite) + link_order = ctx->link_order_overwrite; + else + link_order = DEFAULT_LINK_ORDER; - ctx->codec_link = &links[idx]; - idx++; - } + dev_dbg(dev, "create dai links, link_order 0x%lx\n", link_order); - /* dmic01 and dmic16k */ - if (ctx->dmic_be_num > 0) { - /* at least we have dmic01 */ - ret = sof_intel_board_set_dmic_link(dev, &links[idx], idx, - SOF_DMIC_01); - if (ret) { - dev_err(dev, "fail to set dmic01 link, ret %d\n", ret); - return ret; - } + while (link_order) { + link = link_order & SOF_LINK_ORDER_MASK; + link_order >>= SOF_LINK_ORDER_SHIFT; - idx++; - } + switch (link) { + case SOF_LINK_CODEC: + /* headphone codec */ + if (ctx->codec_type == CODEC_NONE) + continue; - if (ctx->dmic_be_num > 1) { - /* set up 2 BE links at most */ - ret = sof_intel_board_set_dmic_link(dev, &links[idx], idx, - SOF_DMIC_16K); - if (ret) { - dev_err(dev, "fail to set dmic16k link, ret %d\n", ret); - return ret; - } + ret = sof_intel_board_set_codec_link(dev, &links[idx], + idx, + ctx->codec_type, + ctx->ssp_codec); + if (ret) { + dev_err(dev, "fail to set codec link, ret %d\n", + ret); + return ret; + } - idx++; - } + ctx->codec_link = &links[idx]; + idx++; + break; + case SOF_LINK_DMIC01: + /* dmic01 */ + if (ctx->dmic_be_num == 0) + continue; - /* idisp HDMI */ - for (i = 1; i <= ctx->hdmi_num; i++) { - ret = sof_intel_board_set_intel_hdmi_link(dev, &links[idx], idx, - i, - ctx->hdmi.idisp_codec); - if (ret) { - dev_err(dev, "fail to set hdmi link, ret %d\n", ret); - return ret; - } + /* at least we have dmic01 */ + ret = sof_intel_board_set_dmic_link(dev, &links[idx], + idx, SOF_DMIC_01); + if (ret) { + dev_err(dev, "fail to set dmic01 link, ret %d\n", + ret); + return ret; + } - idx++; - } + idx++; + break; + case SOF_LINK_DMIC16K: + /* dmic16k */ + if (ctx->dmic_be_num <= 1) + continue; - /* speaker amp */ - if (ctx->amp_type != CODEC_NONE) { - ret = sof_intel_board_set_ssp_amp_link(dev, &links[idx], idx, - ctx->amp_type, - ctx->ssp_amp); - if (ret) { - dev_err(dev, "fail to set amp link, ret %d\n", ret); - return ret; - } + /* set up 2 BE links at most */ + ret = sof_intel_board_set_dmic_link(dev, &links[idx], + idx, SOF_DMIC_16K); + if (ret) { + dev_err(dev, "fail to set dmic16k link, ret %d\n", + ret); + return ret; + } - ctx->amp_link = &links[idx]; - idx++; - } + idx++; + break; + case SOF_LINK_IDISP_HDMI: + /* idisp HDMI */ + for (i = 1; i <= ctx->hdmi_num; i++) { + ret = sof_intel_board_set_intel_hdmi_link(dev, + &links[idx], + idx, i, + ctx->hdmi.idisp_codec); + if (ret) { + dev_err(dev, "fail to set hdmi link, ret %d\n", + ret); + return ret; + } - /* BT audio offload */ - if (ctx->bt_offload_present) { - ret = sof_intel_board_set_bt_link(dev, &links[idx], idx, - ctx->ssp_bt); - if (ret) { - dev_err(dev, "fail to set bt link, ret %d\n", ret); - return ret; - } + idx++; + } + break; + case SOF_LINK_AMP: + /* speaker amp */ + if (ctx->amp_type == CODEC_NONE) + continue; - idx++; - } + ret = sof_intel_board_set_ssp_amp_link(dev, &links[idx], + idx, + ctx->amp_type, + ctx->ssp_amp); + if (ret) { + dev_err(dev, "fail to set amp link, ret %d\n", + ret); + return ret; + } - /* HDMI-In */ - for_each_set_bit(ssp_hdmi_in, &ctx->ssp_mask_hdmi_in, 32) { - ret = sof_intel_board_set_hdmi_in_link(dev, &links[idx], idx, - ssp_hdmi_in); - if (ret) { - dev_err(dev, "fail to set hdmi-in link, ret %d\n", ret); - return ret; - } + ctx->amp_link = &links[idx]; + idx++; + break; + case SOF_LINK_BT_OFFLOAD: + /* BT audio offload */ + if (!ctx->bt_offload_present) + continue; + + ret = sof_intel_board_set_bt_link(dev, &links[idx], idx, + ctx->ssp_bt); + if (ret) { + dev_err(dev, "fail to set bt link, ret %d\n", + ret); + return ret; + } - idx++; + idx++; + break; + case SOF_LINK_HDMI_IN: + /* HDMI-In */ + for_each_set_bit(ssp_hdmi_in, &ctx->ssp_mask_hdmi_in, 32) { + ret = sof_intel_board_set_hdmi_in_link(dev, + &links[idx], + idx, + ssp_hdmi_in); + if (ret) { + dev_err(dev, "fail to set hdmi-in link, ret %d\n", + ret); + return ret; + } + + idx++; + } + break; + case SOF_LINK_NONE: + /* caught here if it's not used as terminator in macro */ + fallthrough; + default: + dev_err(dev, "invalid link type %ld\n", link); + return -EINVAL; + } } if (idx != num_links) { diff --git a/sound/soc/intel/boards/sof_board_helpers.h b/sound/soc/intel/boards/sof_board_helpers.h index 3b36058118ca..c5d6e7bec5d4 100644 --- a/sound/soc/intel/boards/sof_board_helpers.h +++ b/sound/soc/intel/boards/sof_board_helpers.h @@ -10,6 +10,29 @@ #include "sof_hdmi_common.h" #include "sof_ssp_common.h" +enum { + SOF_LINK_NONE = 0, + SOF_LINK_CODEC, + SOF_LINK_DMIC01, + SOF_LINK_DMIC16K, + SOF_LINK_IDISP_HDMI, + SOF_LINK_AMP, + SOF_LINK_BT_OFFLOAD, + SOF_LINK_HDMI_IN, +}; + +#define SOF_LINK_ORDER_MASK (0xF) +#define SOF_LINK_ORDER_SHIFT (4) + +#define SOF_LINK_ORDER(k1, k2, k3, k4, k5, k6, k7) \ + ((((k1) & SOF_LINK_ORDER_MASK) << (SOF_LINK_ORDER_SHIFT * 0)) | \ + (((k2) & SOF_LINK_ORDER_MASK) << (SOF_LINK_ORDER_SHIFT * 1)) | \ + (((k3) & SOF_LINK_ORDER_MASK) << (SOF_LINK_ORDER_SHIFT * 2)) | \ + (((k4) & SOF_LINK_ORDER_MASK) << (SOF_LINK_ORDER_SHIFT * 3)) | \ + (((k5) & SOF_LINK_ORDER_MASK) << (SOF_LINK_ORDER_SHIFT * 4)) | \ + (((k6) & SOF_LINK_ORDER_MASK) << (SOF_LINK_ORDER_SHIFT * 5)) | \ + (((k7) & SOF_LINK_ORDER_MASK) << (SOF_LINK_ORDER_SHIFT * 6))) + /* * sof_rt5682_private: private data for rt5682 machine driver * @@ -37,6 +60,7 @@ struct sof_rt5682_private { * @bt_offload_present: true to create BT offload BE link * @codec_link: pointer to headset codec dai link * @amp_link: pointer to speaker amplifier dai link + * @link_order_overwrite: custom DAI link order * @rt5682: private data for rt5682 machine driver */ struct sof_card_private { @@ -59,6 +83,8 @@ struct sof_card_private { struct snd_soc_dai_link *codec_link; struct snd_soc_dai_link *amp_link; + unsigned long link_order_overwrite; + union { struct sof_rt5682_private rt5682; }; From patchwork Thu Feb 8 16:55:31 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: 770911 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 C4A13C4828F for ; Thu, 8 Feb 2024 16:58:38 +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 A31F1844; Thu, 8 Feb 2024 17:58:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A31F1844 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1707411516; bh=4n8aJxdWfRtljlJtGHex4bY9uxESjHTI/pSkkgcvYhs=; 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=XBg4HW1AAam2+KZNkUrVZZPyitlyE2vmMRMZrnodA9X3Qo5UJcix6ABeogO1zHMbV doJNgykEZnbCr4aHW/cJRYq5bJUeUtbmo9r/U0916dTZc6+G9Vw3wH9vsz2I9nvnu3 yanPBomQPX9mg6hQNyyBa3DbzOQdbppW+3mEMVvI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 09F6AF806AA; Thu, 8 Feb 2024 17:56:38 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 8DF33F806AA; Thu, 8 Feb 2024 17:56:38 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 77906F805FB; Thu, 8 Feb 2024 17:56:16 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (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 F304DF804E7 for ; Thu, 8 Feb 2024 17:56:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F304DF804E7 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=YLJAvjdQ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707411369; x=1738947369; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4n8aJxdWfRtljlJtGHex4bY9uxESjHTI/pSkkgcvYhs=; b=YLJAvjdQafj5ll1mu+ELvqPvn3DLfPuUUMAKdihe/13Z7/6Qc0JFN78u 6DdAhZ81zqTlYae8CVd7NDijX071kIMir1N4qB1j7kp7bIZ0Mg+FLUeqp XyE3ttJKZnjXlW/3wxfwIOvRVTDdf+GrAlThZZBECEvmT/mdp4jr2X0UW zSeTPuyyo2YXoRh5vxoQfzu5abHMmjldK/N0apKTxtHaHAlzR8oO2oO6N hb/QxiKI8EvZGpHbbj3HieRae7gbcgd6v4OiRMjPeS9mtOnpRElIejMk2 Blhs3L28bIEaopBGutQZTCgniKP3Usb/nwj4r/qSNle3MTn/bOmpGX55v w==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="395675355" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="395675355" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:56:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="1690190" Received: from stang1-mobl1.amr.corp.intel.com (HELO localhost.localdomain) ([10.212.92.130]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:56:00 -0800 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Bard Liao , Rander Wang , Pierre-Louis Bossart Subject: [PATCH 10/24] ASoC: Intel: add get_codec_dai_by_name helper function Date: Thu, 8 Feb 2024 10:55:31 -0600 Message-Id: <20240208165545.93811-11-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> References: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: SAG7HMJKP4R2DDFSO5IJCSVDAP6K36ZW X-Message-ID-Hash: SAG7HMJKP4R2DDFSO5IJCSVDAP6K36ZW 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 Currently, we assume the codecs in a dai link are all the same. So that we get codec dai with snd_soc_rtd_to_codec(rtd, 0) in dai_links ->init callback. However, a link can include different codecs. For example, a 4 speakers link can consist of rt712 and rt1316. Therefore, we need to select the codec dai by name in the dai link. Reviewed-by: Rander Wang Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_board_helpers.c | 18 ++++++++++++++++++ sound/soc/intel/boards/sof_board_helpers.h | 3 +++ 2 files changed, 21 insertions(+) diff --git a/sound/soc/intel/boards/sof_board_helpers.c b/sound/soc/intel/boards/sof_board_helpers.c index 25f9ff12618c..9c08d3e54e3b 100644 --- a/sound/soc/intel/boards/sof_board_helpers.c +++ b/sound/soc/intel/boards/sof_board_helpers.c @@ -584,6 +584,24 @@ int sof_intel_board_set_dai_link(struct device *dev, struct snd_soc_card *card, } EXPORT_SYMBOL_NS(sof_intel_board_set_dai_link, SND_SOC_INTEL_SOF_BOARD_HELPERS); +struct snd_soc_dai *get_codec_dai_by_name(struct snd_soc_pcm_runtime *rtd, + const char *dai_name[], int num_dais) +{ + struct snd_soc_dai *dai; + int index; + int i; + + for (index = 0; index < num_dais; index++) + for_each_rtd_codec_dais(rtd, i, dai) + if (strstr(dai->name, dai_name[index])) { + dev_dbg(rtd->card->dev, "get dai %s\n", dai->name); + return dai; + } + + return NULL; +} +EXPORT_SYMBOL_NS(get_codec_dai_by_name, SND_SOC_INTEL_SOF_BOARD_HELPERS); + MODULE_DESCRIPTION("ASoC Intel SOF Machine Driver Board Helpers"); MODULE_AUTHOR("Brent Lu "); MODULE_LICENSE("GPL"); diff --git a/sound/soc/intel/boards/sof_board_helpers.h b/sound/soc/intel/boards/sof_board_helpers.h index c5d6e7bec5d4..b626198f685d 100644 --- a/sound/soc/intel/boards/sof_board_helpers.h +++ b/sound/soc/intel/boards/sof_board_helpers.h @@ -118,4 +118,7 @@ int sof_intel_board_set_hdmi_in_link(struct device *dev, struct snd_soc_dai_link *link, int be_id, int ssp_hdmi); +struct snd_soc_dai *get_codec_dai_by_name(struct snd_soc_pcm_runtime *rtd, + const char *dai_name[], int num_dais); + #endif /* __SOF_INTEL_BOARD_HELPERS_H */ From patchwork Thu Feb 8 16:55:32 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: 770909 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 1F317C4828F for ; Thu, 8 Feb 2024 16:59:47 +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 4867EDF8; Thu, 8 Feb 2024 17:59:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4867EDF8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1707411585; bh=UdCYLIte7m8ilxEaeKXcyDxzS4kkNFr4Tmp4bU+PaIY=; 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=VMX+24yoaSh7N2bu6L+zwNfw4dDhrHZ9BPCzDeS9bthbFTaX8t+CQPYv4pFAuK0ey 3paPDaUdFvKuwzJqOdrgRN9sOWd0kIfcuzm3pckqrEU+UCVzPKrgxBnOO7NPSHxEJ9 uuVO5u5LLV5zyo4z2kHFAmdGtytOtVkZVOUt+zDo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 38616F805C1; Thu, 8 Feb 2024 17:56:55 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 20773F805D3; Thu, 8 Feb 2024 17:56:55 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4759CF8063E; Thu, 8 Feb 2024 17:56:22 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (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 22A24F80568 for ; Thu, 8 Feb 2024 17:56:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 22A24F80568 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=frBzb+NG DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707411369; x=1738947369; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UdCYLIte7m8ilxEaeKXcyDxzS4kkNFr4Tmp4bU+PaIY=; b=frBzb+NG6izZWCNSQUH8A47IzpnJkzzzwx1KDw3kt8VnWSapT03hkJx1 TwesYyMazDOA+tiU92al+5k5DMqjzfpO5H05Fq38qhiWU+agdiHgGtUPz wDEmFC8VnvRiz/zxVddvmz/Ia7LExmSyN1wWBdDr6ylatRBXJKTk7JGrd tKTq7moBDzqdlRCSQBFrf9zCdi0+aucC+4YOgW2wX+YoVXkyFdXhVrc8a p+P1ImpX2j/AyaKGFJRIQKoicQZT++ank5ohvwLJtHTzwWlxnyImQan4U e0OzrO2NdNI0s5fbApM29pdnHHqurVtLpunnHM+tCmZ+wBaIH2zEBH9Yv g==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="395675364" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="395675364" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:56:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="1690198" Received: from stang1-mobl1.amr.corp.intel.com (HELO localhost.localdomain) ([10.212.92.130]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:56:00 -0800 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Bard Liao , Rander Wang , Pierre-Louis Bossart Subject: [PATCH 11/24] ASoC: Intel: sof_sdw_rt_sdca_jack_common: use helper to get codec dai by name Date: Thu, 8 Feb 2024 10:55:32 -0600 Message-Id: <20240208165545.93811-12-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> References: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: 47JLPUV55GBMIDGLZOZKKYQECEM2OQ7L X-Message-ID-Hash: 47JLPUV55GBMIDGLZOZKKYQECEM2OQ7L 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 Use helper to get codec dai by name. Reviewed-by: Rander Wang Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/Kconfig | 1 + sound/soc/intel/boards/sof_board_helpers.c | 2 +- sound/soc/intel/boards/sof_board_helpers.h | 2 +- .../intel/boards/sof_sdw_rt_sdca_jack_common.c | 15 +++++++++++++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig index 8fd5e7f83054..18ac3ce0752e 100644 --- a/sound/soc/intel/boards/Kconfig +++ b/sound/soc/intel/boards/Kconfig @@ -677,6 +677,7 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH depends on MFD_INTEL_LPSS || COMPILE_TEST depends on SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES || COMPILE_TEST depends on SOUNDWIRE + select SND_SOC_INTEL_SOF_BOARD_HELPERS select SND_SOC_MAX98363 select SND_SOC_MAX98373_I2C select SND_SOC_MAX98373_SDW diff --git a/sound/soc/intel/boards/sof_board_helpers.c b/sound/soc/intel/boards/sof_board_helpers.c index 9c08d3e54e3b..088894ff4165 100644 --- a/sound/soc/intel/boards/sof_board_helpers.c +++ b/sound/soc/intel/boards/sof_board_helpers.c @@ -585,7 +585,7 @@ int sof_intel_board_set_dai_link(struct device *dev, struct snd_soc_card *card, EXPORT_SYMBOL_NS(sof_intel_board_set_dai_link, SND_SOC_INTEL_SOF_BOARD_HELPERS); struct snd_soc_dai *get_codec_dai_by_name(struct snd_soc_pcm_runtime *rtd, - const char *dai_name[], int num_dais) + const char * const dai_name[], int num_dais) { struct snd_soc_dai *dai; int index; diff --git a/sound/soc/intel/boards/sof_board_helpers.h b/sound/soc/intel/boards/sof_board_helpers.h index b626198f685d..f42d5d640321 100644 --- a/sound/soc/intel/boards/sof_board_helpers.h +++ b/sound/soc/intel/boards/sof_board_helpers.h @@ -119,6 +119,6 @@ int sof_intel_board_set_hdmi_in_link(struct device *dev, int ssp_hdmi); struct snd_soc_dai *get_codec_dai_by_name(struct snd_soc_pcm_runtime *rtd, - const char *dai_name[], int num_dais); + const char * const dai_name[], int num_dais); #endif /* __SOF_INTEL_BOARD_HELPERS_H */ diff --git a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c b/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c index d9c283829fc7..4f2e105a1124 100644 --- a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c +++ b/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c @@ -15,6 +15,7 @@ #include #include #include +#include "sof_board_helpers.h" #include "sof_sdw_common.h" /* @@ -84,15 +85,24 @@ static struct snd_soc_jack_pin rt_sdca_jack_pins[] = { }, }; +static const char * const jack_codecs[] = { + "rt711", "rt712", "rt713" +}; + static int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; struct mc_private *ctx = snd_soc_card_get_drvdata(card); - struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0); - struct snd_soc_component *component = codec_dai->component; + struct snd_soc_dai *codec_dai; + struct snd_soc_component *component; struct snd_soc_jack *jack; int ret; + codec_dai = get_codec_dai_by_name(rtd, jack_codecs, ARRAY_SIZE(jack_codecs)); + if (!codec_dai) + return -EINVAL; + + component = codec_dai->component; card->components = devm_kasprintf(card->dev, GFP_KERNEL, "%s hs:%s-sdca", card->components, component->name_prefix); @@ -213,3 +223,4 @@ int sof_sdw_rt_sdca_jack_init(struct snd_soc_card *card, return 0; } +MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); From patchwork Thu Feb 8 16:55:33 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: 770907 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 D05B2C4828F for ; Thu, 8 Feb 2024 17:00:53 +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 AE2D9823; Thu, 8 Feb 2024 18:00:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AE2D9823 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1707411651; bh=WbMrcOtxEPTqPuAD9SZO9DSAuLMiWP+miOcXhisgqok=; 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=qwztoojVqUNSdurHOi1k2fIr/qhAWc4hfbmWaZKQgnIapyGPomOMFRdO7gIHQRuXg Zrs5MeUmjIjfUVixEOmHTOeM4IhRJywa2wTDQ9Mz03Z/x5KvUMHUhQyNrv0Ic+xkxE BGNobcpANPXa1vKIUAkTQSDyvq4xmp/Gya+4JL1I= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 44ABFF8087B; Thu, 8 Feb 2024 17:57:07 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 8312BF8087C; Thu, 8 Feb 2024 17:57:07 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E6C87F80637; Thu, 8 Feb 2024 17:56:25 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (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 B2B16F80579 for ; Thu, 8 Feb 2024 17:56:09 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B2B16F80579 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=MiQVfxdg DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707411371; x=1738947371; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WbMrcOtxEPTqPuAD9SZO9DSAuLMiWP+miOcXhisgqok=; b=MiQVfxdg2ZINiePtX8rmHeosGi6vSPAQgyv7D5v6OoiTTncuae5OdER3 zGwSkvbb5e/mRWwLH5FsYhbONPvv+/RhXl5XqUwMwXtWGMcCkEZgG+SiL 7UFbPoELHnw0iAEfPANAXf0rXLGZU87jvdecA2/SCKGSOF4blUWn4XBw5 TbHCAeuqm9IuKA7H7G8mUBozP3UJYOr5yAVh/xYrK+CCe75lAjTjyEUgb jbbzxuM99ItZ0/h+735gdPvsKIoVJ0ZDl4HkiFso96iynRRK7HmvqgZQC dUgnihWibGP13V0iFjoAqHYvKYGrhiCPHD20FI1Ghk01clyrUOg0Vg2iK Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="395675372" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="395675372" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:56:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="1690207" Received: from stang1-mobl1.amr.corp.intel.com (HELO localhost.localdomain) ([10.212.92.130]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:56:01 -0800 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Bard Liao , Rander Wang , Pierre-Louis Bossart Subject: [PATCH 12/24] ASoC: Intel: sof_sdw_rt711: use helper to get codec dai by name Date: Thu, 8 Feb 2024 10:55:33 -0600 Message-Id: <20240208165545.93811-13-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> References: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: PRON5ESPFMAYAWVS4WMNEMQFVN6SGVEO X-Message-ID-Hash: PRON5ESPFMAYAWVS4WMNEMQFVN6SGVEO 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 Use helper to get codec dai by name. Reviewed-by: Rander Wang Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw_rt711.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw_rt711.c b/sound/soc/intel/boards/sof_sdw_rt711.c index 38782fdfcf15..5d8f90f2bf55 100644 --- a/sound/soc/intel/boards/sof_sdw_rt711.c +++ b/sound/soc/intel/boards/sof_sdw_rt711.c @@ -15,6 +15,7 @@ #include #include #include +#include "sof_board_helpers.h" #include "sof_sdw_common.h" /* @@ -69,15 +70,24 @@ static struct snd_soc_jack_pin rt711_jack_pins[] = { }, }; +static const char * const jack_codecs[] = { + "rt711" +}; + static int rt711_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; struct mc_private *ctx = snd_soc_card_get_drvdata(card); - struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0); - struct snd_soc_component *component = codec_dai->component; + struct snd_soc_dai *codec_dai; + struct snd_soc_component *component; struct snd_soc_jack *jack; int ret; + codec_dai = get_codec_dai_by_name(rtd, jack_codecs, ARRAY_SIZE(jack_codecs)); + if (!codec_dai) + return -EINVAL; + + component = codec_dai->component; card->components = devm_kasprintf(card->dev, GFP_KERNEL, "%s hs:rt711", card->components); @@ -180,3 +190,4 @@ int sof_sdw_rt711_init(struct snd_soc_card *card, return 0; } +MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); From patchwork Thu Feb 8 16:55:36 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: 770908 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 5A588C4828F for ; Thu, 8 Feb 2024 17:00: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 24B42846; Thu, 8 Feb 2024 18:00:03 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 24B42846 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1707411613; bh=KqUKDtXlJkWIpAsWAyeaN4J4Fr5x6Ik5O1TuLR3mj/c=; 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=rk+rfTxWBFHEnbgJmtED1/EOj2gYs/w3aRuv6q0fxaA/zjvOTuqdPdzqGgfeXSQRV aplrPDw4+2stzxGzT1FA5tt7+YWNruwYUS7t/g4YxD/mxcY7sV7vF0/WTsEAZp1lai T71yJ2PwVIfp+mNkIWr2oEMeHBbA7QNxwjIt/I4o= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8632BF80793; Thu, 8 Feb 2024 17:57:01 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 08DFFF80803; Thu, 8 Feb 2024 17:57:01 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BE7F9F8065C; Thu, 8 Feb 2024 17:56:24 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (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 BE18FF805D9 for ; Thu, 8 Feb 2024 17:56:11 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BE18FF805D9 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=iE8vyu3g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707411373; x=1738947373; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KqUKDtXlJkWIpAsWAyeaN4J4Fr5x6Ik5O1TuLR3mj/c=; b=iE8vyu3gYX6xG29uqkkZE36ItQpHxiSKutYZ7G6WSkugzBlTLvkAUX7D AyktTwG+yApi2OwH9ec1iJPalFlVN97ygnH9ZYpGarMH12fp+A5uFPYbd KpAxoyybRn+0XLhiH20971a1AuG7exJmiwmZrqbuis645w/cwVXisEjvp oADwu2QF5JhrEJdEvOtB/f19If/bPFCDBV/s5zyhzTyt8ZSlHlaqZMWSY Zn2h9JSv6qd3+PUE67TBJXwGiL3XakC/FeTrGVKKoJZczcAaFc6CEsJ5w HFX4OWQi636Im0w+qg53CWVvWJ8v7Ld0VWeASKZRWzqwQW2CSYiL45QXl Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="395675397" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="395675397" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:56:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="1690237" Received: from stang1-mobl1.amr.corp.intel.com (HELO localhost.localdomain) ([10.212.92.130]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:56:02 -0800 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Bard Liao , Rander Wang , Pierre-Louis Bossart Subject: [PATCH 15/24] ASoC: Intel: sof_sdw_cs42l42: use helper to get codec dai by name Date: Thu, 8 Feb 2024 10:55:36 -0600 Message-Id: <20240208165545.93811-16-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> References: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: NF3C6IOG3XFKJ6BRUDD5BX4RXGYHWMI7 X-Message-ID-Hash: NF3C6IOG3XFKJ6BRUDD5BX4RXGYHWMI7 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 Use helper to get codec dai by name. Reviewed-by: Rander Wang Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw_cs42l42.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw_cs42l42.c b/sound/soc/intel/boards/sof_sdw_cs42l42.c index 436f41086da6..22f4f9a19088 100644 --- a/sound/soc/intel/boards/sof_sdw_cs42l42.c +++ b/sound/soc/intel/boards/sof_sdw_cs42l42.c @@ -15,6 +15,7 @@ #include #include #include +#include "sof_board_helpers.h" #include "sof_sdw_common.h" static const struct snd_soc_dapm_widget cs42l42_widgets[] = { @@ -46,15 +47,24 @@ static struct snd_soc_jack_pin cs42l42_jack_pins[] = { }, }; +static const char * const jack_codecs[] = { + "cs42l42" +}; + static int cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; struct mc_private *ctx = snd_soc_card_get_drvdata(card); - struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0); - struct snd_soc_component *component = codec_dai->component; + struct snd_soc_dai *codec_dai; + struct snd_soc_component *component; struct snd_soc_jack *jack; int ret; + codec_dai = get_codec_dai_by_name(rtd, jack_codecs, ARRAY_SIZE(jack_codecs)); + if (!codec_dai) + return -EINVAL; + + component = codec_dai->component; card->components = devm_kasprintf(card->dev, GFP_KERNEL, "%s hs:cs42l42", card->components); @@ -129,3 +139,4 @@ int sof_sdw_cs42l42_init(struct snd_soc_card *card, return 0; } +MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); From patchwork Thu Feb 8 16:55:38 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: 770903 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 ABF8CC4828F for ; Thu, 8 Feb 2024 17:03: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 0525A827; Thu, 8 Feb 2024 18:02:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0525A827 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1707411781; bh=w/08Apl5ExoaCSROJAUFzeC3pL17+3exv81cgUwnrHs=; 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=nvHqwyFna+sVAckJNDHmmteyhlQGAs/KgefQjZiIdch4N45QTQQq1f8hIWmzJgfRY uoRM0g9JsWZdreNSbx5NjxMClhnNKvYaN82NA8O+AEElgP+UZd9xuk+mwifpOikZ18 GKQoiK02mDUKaEsZCNwP0hgti09CM62UNKEUgP4Q= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B022FF89711; Thu, 8 Feb 2024 17:57:37 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 0CC80F8970E; Thu, 8 Feb 2024 17:57:37 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2C014F806D5; Thu, 8 Feb 2024 17:56:47 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (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 0E3CEF80567 for ; Thu, 8 Feb 2024 17:56:11 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0E3CEF80567 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=laex2VuC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707411373; x=1738947373; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=w/08Apl5ExoaCSROJAUFzeC3pL17+3exv81cgUwnrHs=; b=laex2VuC3UUBRQTzqyazuHWWuNzH4LFgtO0ch2N4fBmbJ8hFp66kWPq0 2xuh2YyOsL+Ibfnl9ICNa6Bp7P+5lVDCnJBACldnG/78ZuzqjnyufWC87 SO7cuyi2fI6GHSK6DkDWghRO9E3Lf++1ybG6Nf2MWLG3Yd6T5GQHZll3Q ms4u8dZRXhehTXbVXZKEjJf9sgDHJilaY3+Z00aO2Fibc5kny3njrLI8L uc9xcj7Q7GUDkrRrtCmknd7rbT9WHA9BnZ0ToXGk4Rt9eUVNiPUUKx18t aNLrm5E8joAKML7DPCmzAP32A98gl/9ZNwG/ib4z9VuF6sviwJaHR3xXz w==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="395675411" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="395675411" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:56:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="1690258" Received: from stang1-mobl1.amr.corp.intel.com (HELO localhost.localdomain) ([10.212.92.130]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:56:03 -0800 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Bard Liao , Rander Wang , Pierre-Louis Bossart Subject: [PATCH 17/24] ASoC: Intel: sof_sdw: add common sdw dai link init Date: Thu, 8 Feb 2024 10:55:38 -0600 Message-Id: <20240208165545.93811-18-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> References: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: N7SVLM7XLUQBEFPO6A2PTLKIZPBSNLGY X-Message-ID-Hash: N7SVLM7XLUQBEFPO6A2PTLKIZPBSNLGY 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 Currently, we set sdw dai link .init callback in the codec_info_list's dais.init function. This works fine if all codecs in the dai link are the same. However, we need to do all the .init stuff for all different codecs in the dai link if not all codecs in the dai link are the same. Use a common dai link .init callback to call the new rtd_init callback in sof_sdw_dai_info{} to do rtd_init for each dai. Some codec init callback will become empty after this change. They will be removed in the follow up patch. Reviewed-by: Rander Wang Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 75 ++++++++++++++++++- sound/soc/intel/boards/sof_sdw_common.h | 20 +++++ sound/soc/intel/boards/sof_sdw_cs42l42.c | 4 +- sound/soc/intel/boards/sof_sdw_cs42l43.c | 7 +- sound/soc/intel/boards/sof_sdw_cs_amp.c | 3 +- sound/soc/intel/boards/sof_sdw_maxim.c | 4 +- sound/soc/intel/boards/sof_sdw_rt5682.c | 4 +- sound/soc/intel/boards/sof_sdw_rt700.c | 4 +- sound/soc/intel/boards/sof_sdw_rt711.c | 4 +- sound/soc/intel/boards/sof_sdw_rt712_sdca.c | 8 +- sound/soc/intel/boards/sof_sdw_rt715.c | 4 +- sound/soc/intel/boards/sof_sdw_rt715_sdca.c | 4 +- sound/soc/intel/boards/sof_sdw_rt_amp.c | 3 +- .../boards/sof_sdw_rt_sdca_jack_common.c | 4 +- 14 files changed, 108 insertions(+), 40 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 300391fbc2fc..782b45adb21e 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -651,6 +651,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_type = SOF_SDW_DAI_TYPE_JACK, .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, .init = sof_sdw_rt700_init, + .rtd_init = rt700_rtd_init, }, }, .dai_num = 1, @@ -666,6 +667,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, .init = sof_sdw_rt_sdca_jack_init, .exit = sof_sdw_rt_sdca_jack_exit, + .rtd_init = rt_sdca_jack_rtd_init, }, }, .dai_num = 1, @@ -681,6 +683,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, .init = sof_sdw_rt711_init, .exit = sof_sdw_rt711_exit, + .rtd_init = rt711_rtd_init, }, }, .dai_num = 1, @@ -696,6 +699,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, .init = sof_sdw_rt_sdca_jack_init, .exit = sof_sdw_rt_sdca_jack_exit, + .rtd_init = rt_sdca_jack_rtd_init, }, { .direction = {true, false}, @@ -703,6 +707,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_type = SOF_SDW_DAI_TYPE_AMP, .dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID}, .init = sof_sdw_rt712_spk_init, + .rtd_init = rt712_spk_rtd_init, }, }, .dai_num = 2, @@ -717,6 +722,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_type = SOF_SDW_DAI_TYPE_MIC, .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, .init = sof_sdw_rt712_sdca_dmic_init, + .rtd_init = rt712_sdca_dmic_rtd_init, }, }, .dai_num = 1, @@ -732,6 +738,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, .init = sof_sdw_rt_sdca_jack_init, .exit = sof_sdw_rt_sdca_jack_exit, + .rtd_init = rt_sdca_jack_rtd_init, }, }, .dai_num = 1, @@ -746,6 +753,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_type = SOF_SDW_DAI_TYPE_MIC, .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, .init = sof_sdw_rt712_sdca_dmic_init, + .rtd_init = rt712_sdca_dmic_rtd_init, }, }, .dai_num = 1, @@ -761,6 +769,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID}, .init = sof_sdw_rt_amp_init, .exit = sof_sdw_rt_amp_exit, + .rtd_init = rt_amp_spk_rtd_init, }, }, .dai_num = 1, @@ -776,6 +785,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID}, .init = sof_sdw_rt_amp_init, .exit = sof_sdw_rt_amp_exit, + .rtd_init = rt_amp_spk_rtd_init, }, }, .dai_num = 1, @@ -790,6 +800,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID}, .init = sof_sdw_rt_amp_init, .exit = sof_sdw_rt_amp_exit, + .rtd_init = rt_amp_spk_rtd_init, }, }, .dai_num = 1, @@ -805,6 +816,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_type = SOF_SDW_DAI_TYPE_MIC, .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, .init = sof_sdw_rt715_sdca_init, + .rtd_init = rt715_sdca_rtd_init, }, }, .dai_num = 1, @@ -820,6 +832,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_type = SOF_SDW_DAI_TYPE_MIC, .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, .init = sof_sdw_rt715_sdca_init, + .rtd_init = rt715_sdca_rtd_init, }, }, .dai_num = 1, @@ -835,6 +848,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_type = SOF_SDW_DAI_TYPE_MIC, .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, .init = sof_sdw_rt715_init, + .rtd_init = rt715_rtd_init, }, }, .dai_num = 1, @@ -850,6 +864,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_type = SOF_SDW_DAI_TYPE_MIC, .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, .init = sof_sdw_rt715_init, + .rtd_init = rt715_rtd_init, }, }, .dai_num = 1, @@ -893,6 +908,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_type = SOF_SDW_DAI_TYPE_AMP, .dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID}, .init = sof_sdw_maxim_init, + .rtd_init = maxim_spk_rtd_init, }, }, .dai_num = 1, @@ -906,6 +922,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_type = SOF_SDW_DAI_TYPE_AMP, .dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID}, .init = sof_sdw_maxim_init, + .rtd_init = maxim_spk_rtd_init, }, }, .dai_num = 1, @@ -919,6 +936,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_type = SOF_SDW_DAI_TYPE_JACK, .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, .init = sof_sdw_rt5682_init, + .rtd_init = rt5682_rtd_init, }, }, .dai_num = 1, @@ -932,6 +950,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_type = SOF_SDW_DAI_TYPE_AMP, .dailink = {SDW_AMP_OUT_DAI_ID, SDW_AMP_IN_DAI_ID}, .init = sof_sdw_cs_amp_init, + .rtd_init = cs_spk_rtd_init, }, }, .dai_num = 1, @@ -945,6 +964,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_type = SOF_SDW_DAI_TYPE_JACK, .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID}, .init = sof_sdw_cs42l42_init, + .rtd_init = cs42l42_rtd_init, }, }, .dai_num = 1, @@ -959,6 +979,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_type = SOF_SDW_DAI_TYPE_JACK, .dailink = {SDW_JACK_OUT_DAI_ID, SDW_UNUSED_DAI_ID}, .init = sof_sdw_cs42l43_hs_init, + .rtd_init = cs42l43_hs_rtd_init, }, { .direction = {false, true}, @@ -966,6 +987,7 @@ static struct sof_sdw_codec_info codec_info_list[] = { .dai_type = SOF_SDW_DAI_TYPE_MIC, .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID}, .init = sof_sdw_cs42l43_dmic_init, + .rtd_init = cs42l43_dmic_rtd_init, }, { .direction = {false, true}, @@ -1387,6 +1409,56 @@ static void set_dailink_map(struct snd_soc_dai_link_ch_map *sdw_codec_ch_maps, } } +static inline int find_codec_info_dai(const char *dai_name, int *dai_index) +{ + int i, j; + + for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) { + for (j = 0; j < codec_info_list[i].dai_num; j++) { + if (!strcmp(codec_info_list[i].dais[j].dai_name, dai_name)) { + *dai_index = j; + return i; + } + } + } + + return -EINVAL; +} + +static int sof_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd) +{ + struct sof_sdw_codec_info *codec_info; + struct snd_soc_dai *dai; + int codec_index; + int dai_index; + int ret; + int i; + + for_each_rtd_codec_dais(rtd, i, dai) { + codec_index = find_codec_info_dai(dai->name, &dai_index); + if (codec_index < 0) + return -EINVAL; + + codec_info = &codec_info_list[codec_index]; + /* + * A codec dai can be connected to different dai links for capture and playback, + * but we only need to call the rtd_init function once. + * The rtd_init for each codec dai is independent. So, the order of rtd_init + * doesn't matter. + */ + if (codec_info->dais[dai_index].rtd_init_done) + continue; + if (codec_info->dais[dai_index].rtd_init) { + ret = codec_info->dais[dai_index].rtd_init(rtd); + if (ret) + return ret; + } + codec_info->dais[dai_index].rtd_init_done = true; + } + + return 0; +} + static const char * const type_strings[] = {"SimpleJack", "SmartAmp", "SmartMic"}; static int create_sdw_dailink(struct snd_soc_card *card, int *link_index, @@ -1547,7 +1619,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, int *link_index, init_dai_link(dev, dai_links + *link_index, be_id, name, playback, capture, cpus, cpu_dai_num, codecs, codec_num, - NULL, &sdw_ops); + sof_sdw_rtd_init, &sdw_ops); /* * SoundWire DAILINKs use 'stream' functions and Bank Switch operations @@ -1880,6 +1952,7 @@ static void mc_dailink_exit_loop(struct snd_soc_card *card) for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) { for (j = 0; j < codec_info_list[i].dai_num; j++) { + codec_info_list[i].dais[j].rtd_init_done = false; /* Check each dai in codec_info_lis to see if it is used in the link */ if (!codec_info_list[i].dais[j].exit) continue; diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index f16456945edb..ab444dae46ab 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -78,6 +78,8 @@ struct sof_sdw_dai_info { struct sof_sdw_codec_info *info, bool playback); int (*exit)(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); + int (*rtd_init)(struct snd_soc_pcm_runtime *rtd); + bool rtd_init_done; /* Indicate that the rtd_init callback is done */ }; struct sof_sdw_codec_info { @@ -235,4 +237,22 @@ int sof_sdw_cs_amp_init(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, struct sof_sdw_codec_info *info, bool playback); + +/* dai_link init callbacks */ + +int cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd); +int cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd); +int cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd); +int cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd); +int maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd); +int rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd); +int rt700_rtd_init(struct snd_soc_pcm_runtime *rtd); +int rt711_rtd_init(struct snd_soc_pcm_runtime *rtd); +int rt712_sdca_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd); +int rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd); +int rt715_rtd_init(struct snd_soc_pcm_runtime *rtd); +int rt715_sdca_rtd_init(struct snd_soc_pcm_runtime *rtd); +int rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd); +int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd); + #endif diff --git a/sound/soc/intel/boards/sof_sdw_cs42l42.c b/sound/soc/intel/boards/sof_sdw_cs42l42.c index 22f4f9a19088..5d0915b72c7f 100644 --- a/sound/soc/intel/boards/sof_sdw_cs42l42.c +++ b/sound/soc/intel/boards/sof_sdw_cs42l42.c @@ -51,7 +51,7 @@ static const char * const jack_codecs[] = { "cs42l42" }; -static int cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd) +int cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; struct mc_private *ctx = snd_soc_card_get_drvdata(card); @@ -135,8 +135,6 @@ int sof_sdw_cs42l42_init(struct snd_soc_card *card, if (!playback) return 0; - dai_links->init = cs42l42_rtd_init; - return 0; } MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); diff --git a/sound/soc/intel/boards/sof_sdw_cs42l43.c b/sound/soc/intel/boards/sof_sdw_cs42l43.c index 360f11b72aa2..7909ea9c9c14 100644 --- a/sound/soc/intel/boards/sof_sdw_cs42l43.c +++ b/sound/soc/intel/boards/sof_sdw_cs42l43.c @@ -50,7 +50,7 @@ static struct snd_soc_jack_pin sof_jack_pins[] = { }, }; -static int cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd) +int cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; struct mc_private *ctx = snd_soc_card_get_drvdata(rtd->card); @@ -116,12 +116,11 @@ int sof_sdw_cs42l43_hs_init(struct snd_soc_card *card, const struct snd_soc_acpi * No need to test if (!playback) like other codecs as cs42l43 uses separated dai for * playback and capture, and sof_sdw_cs42l43_init is only linked to the playback dai. */ - dai_links->init = cs42l43_hs_rtd_init; return 0; } -static int cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd) +int cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; int ret; @@ -150,7 +149,5 @@ int sof_sdw_cs42l43_dmic_init(struct snd_soc_card *card, const struct snd_soc_ac struct snd_soc_dai_link *dai_links, struct sof_sdw_codec_info *info, bool playback) { - dai_links->init = cs42l43_dmic_rtd_init; - return 0; } diff --git a/sound/soc/intel/boards/sof_sdw_cs_amp.c b/sound/soc/intel/boards/sof_sdw_cs_amp.c index f88c01552a92..56cf75bc6cc4 100644 --- a/sound/soc/intel/boards/sof_sdw_cs_amp.c +++ b/sound/soc/intel/boards/sof_sdw_cs_amp.c @@ -18,7 +18,7 @@ static const struct snd_soc_dapm_widget sof_widgets[] = { SND_SOC_DAPM_SPK("Speakers", NULL), }; -static int cs_spk_init(struct snd_soc_pcm_runtime *rtd) +int cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd) { const char *dai_name = rtd->dai_link->codecs->dai_name; struct snd_soc_card *card = rtd->card; @@ -67,7 +67,6 @@ int sof_sdw_cs_amp_init(struct snd_soc_card *card, return 0; info->amp_num++; - dai_links->init = cs_spk_init; return 0; } diff --git a/sound/soc/intel/boards/sof_sdw_maxim.c b/sound/soc/intel/boards/sof_sdw_maxim.c index e36b8d8c70c9..034730432671 100644 --- a/sound/soc/intel/boards/sof_sdw_maxim.c +++ b/sound/soc/intel/boards/sof_sdw_maxim.c @@ -27,7 +27,7 @@ static const struct snd_kcontrol_new maxim_controls[] = { SOC_DAPM_PIN_SWITCH("Right Spk"), }; -static int spk_init(struct snd_soc_pcm_runtime *rtd) +int maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; int ret; @@ -145,8 +145,6 @@ int sof_sdw_maxim_init(struct snd_soc_card *card, bool playback) { info->amp_num++; - if (info->amp_num == 2) - dai_links->init = spk_init; maxim_part_id = info->part_id; switch (maxim_part_id) { diff --git a/sound/soc/intel/boards/sof_sdw_rt5682.c b/sound/soc/intel/boards/sof_sdw_rt5682.c index 27aca76dbee4..4e3fcc861074 100644 --- a/sound/soc/intel/boards/sof_sdw_rt5682.c +++ b/sound/soc/intel/boards/sof_sdw_rt5682.c @@ -50,7 +50,7 @@ static const char * const jack_codecs[] = { "rt5682" }; -static int rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd) +int rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; struct mc_private *ctx = snd_soc_card_get_drvdata(card); @@ -134,8 +134,6 @@ int sof_sdw_rt5682_init(struct snd_soc_card *card, if (!playback) return 0; - dai_links->init = rt5682_rtd_init; - return 0; } MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); diff --git a/sound/soc/intel/boards/sof_sdw_rt700.c b/sound/soc/intel/boards/sof_sdw_rt700.c index d9a45392bbbf..781d41e35191 100644 --- a/sound/soc/intel/boards/sof_sdw_rt700.c +++ b/sound/soc/intel/boards/sof_sdw_rt700.c @@ -50,7 +50,7 @@ static const char * const jack_codecs[] = { "rt700" }; -static int rt700_rtd_init(struct snd_soc_pcm_runtime *rtd) +int rt700_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; struct mc_private *ctx = snd_soc_card_get_drvdata(card); @@ -133,8 +133,6 @@ int sof_sdw_rt700_init(struct snd_soc_card *card, if (!playback) return 0; - dai_links->init = rt700_rtd_init; - return 0; } MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); diff --git a/sound/soc/intel/boards/sof_sdw_rt711.c b/sound/soc/intel/boards/sof_sdw_rt711.c index 5d8f90f2bf55..cdd1587b246c 100644 --- a/sound/soc/intel/boards/sof_sdw_rt711.c +++ b/sound/soc/intel/boards/sof_sdw_rt711.c @@ -74,7 +74,7 @@ static const char * const jack_codecs[] = { "rt711" }; -static int rt711_rtd_init(struct snd_soc_pcm_runtime *rtd) +int rt711_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; struct mc_private *ctx = snd_soc_card_get_drvdata(card); @@ -186,8 +186,6 @@ int sof_sdw_rt711_init(struct snd_soc_card *card, } ctx->headset_codec_dev = sdw_dev; - dai_links->init = rt711_rtd_init; - return 0; } MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); diff --git a/sound/soc/intel/boards/sof_sdw_rt712_sdca.c b/sound/soc/intel/boards/sof_sdw_rt712_sdca.c index 27c924885ffc..dddb27e4c943 100644 --- a/sound/soc/intel/boards/sof_sdw_rt712_sdca.c +++ b/sound/soc/intel/boards/sof_sdw_rt712_sdca.c @@ -35,7 +35,7 @@ static const struct snd_kcontrol_new rt712_spk_controls[] = { SOC_DAPM_PIN_SWITCH("Speaker"), }; -static int rt712_spk_init(struct snd_soc_pcm_runtime *rtd) +int rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; int ret; @@ -73,8 +73,6 @@ int sof_sdw_rt712_spk_init(struct snd_soc_card *card, struct sof_sdw_codec_info *info, bool playback) { - dai_links->init = rt712_spk_init; - return 0; } @@ -82,7 +80,7 @@ static const char * const dmics[] = { "rt712-sdca-dmic" }; -static int rt712_sdca_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd) +int rt712_sdca_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; struct snd_soc_dai *codec_dai; @@ -108,8 +106,6 @@ int sof_sdw_rt712_sdca_dmic_init(struct snd_soc_card *card, struct sof_sdw_codec_info *info, bool playback) { - dai_links->init = rt712_sdca_dmic_rtd_init; - return 0; } MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); diff --git a/sound/soc/intel/boards/sof_sdw_rt715.c b/sound/soc/intel/boards/sof_sdw_rt715.c index 7c068dc6b9cf..19194fe92b8e 100644 --- a/sound/soc/intel/boards/sof_sdw_rt715.c +++ b/sound/soc/intel/boards/sof_sdw_rt715.c @@ -11,7 +11,7 @@ #include #include "sof_sdw_common.h" -static int rt715_rtd_init(struct snd_soc_pcm_runtime *rtd) +int rt715_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; @@ -30,7 +30,5 @@ int sof_sdw_rt715_init(struct snd_soc_card *card, struct sof_sdw_codec_info *info, bool playback) { - dai_links->init = rt715_rtd_init; - return 0; } diff --git a/sound/soc/intel/boards/sof_sdw_rt715_sdca.c b/sound/soc/intel/boards/sof_sdw_rt715_sdca.c index ca0cf3db2e4d..3089fa8450fa 100644 --- a/sound/soc/intel/boards/sof_sdw_rt715_sdca.c +++ b/sound/soc/intel/boards/sof_sdw_rt715_sdca.c @@ -11,7 +11,7 @@ #include #include "sof_sdw_common.h" -static int rt715_sdca_rtd_init(struct snd_soc_pcm_runtime *rtd) +int rt715_sdca_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; @@ -30,7 +30,5 @@ int sof_sdw_rt715_sdca_init(struct snd_soc_card *card, struct sof_sdw_codec_info *info, bool playback) { - dai_links->init = rt715_sdca_rtd_init; - return 0; } diff --git a/sound/soc/intel/boards/sof_sdw_rt_amp.c b/sound/soc/intel/boards/sof_sdw_rt_amp.c index a4414c9793b4..202edab95000 100644 --- a/sound/soc/intel/boards/sof_sdw_rt_amp.c +++ b/sound/soc/intel/boards/sof_sdw_rt_amp.c @@ -185,7 +185,7 @@ static const struct snd_soc_dapm_route *get_codec_name_and_route(struct snd_soc_ return rt1318_map; } -static int rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd) +int rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; const struct snd_soc_dapm_route *rt_amp_map; @@ -295,7 +295,6 @@ int sof_sdw_rt_amp_init(struct snd_soc_card *card, return 0; info->amp_num++; - dai_links->init = rt_amp_spk_rtd_init; if (info->amp_num == 2) { sdw_dev1 = bus_find_device_by_name(&sdw_bus_type, NULL, dai_links->codecs[0].name); diff --git a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c b/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c index 4f2e105a1124..5253d8332780 100644 --- a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c +++ b/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c @@ -89,7 +89,7 @@ static const char * const jack_codecs[] = { "rt711", "rt712", "rt713" }; -static int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd) +int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; struct mc_private *ctx = snd_soc_card_get_drvdata(card); @@ -219,8 +219,6 @@ int sof_sdw_rt_sdca_jack_init(struct snd_soc_card *card, } ctx->headset_codec_dev = sdw_dev; - dai_links->init = rt_sdca_jack_rtd_init; - return 0; } MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); From patchwork Thu Feb 8 16:55:40 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: 770906 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 0DC2FC4828F for ; Thu, 8 Feb 2024 17:01:26 +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 D8131F50; Thu, 8 Feb 2024 18:01:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D8131F50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1707411683; bh=V92CfbYk61vu8Lu87qyGidx+d8Y00Or+SdwAb6vYum4=; 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=rhH2T1cQbt3e8VJfM3basMhGyU2Xf4DXZAtslOyTr5tJzrgU8hq/E8eC4cGwcJOFn dXjXkeNPwmlvPTXXy15+2W0pKkM14+OkxC1QYfGrrv1wRLHOFOmu2fBt/uLx1+jgTh khJK8zJW2LpmeaAg13XPXStjfz7bFRx14c8Pl47E= Received: by alsa1.perex.cz (Postfix, from userid 50401) id D8AD3F80C73; Thu, 8 Feb 2024 17:57:13 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 1184AF805E7; Thu, 8 Feb 2024 17:57:13 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 73C81F8067C; Thu, 8 Feb 2024 17:56:31 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (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 D95ACF805F2 for ; Thu, 8 Feb 2024 17:56:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D95ACF805F2 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=P9DNw5g6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707411375; x=1738947375; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=V92CfbYk61vu8Lu87qyGidx+d8Y00Or+SdwAb6vYum4=; b=P9DNw5g6FW3+bQplLolG/IirtmA+hYudWU9dLgBwGMCWC1U9WppdojUT yVF8bWaYpYmoInBpq3bVUmT+mZqfgHkava2SWmBIWNUYdu85PjldZclkq 4ZXAWTNo/sWjHiwIwaMN1mSyPZnh9ShmmzfZXIEGdGrv+TcPF1EJY2hqy sVcvrVHIlz5nZLkFg5zkmvr0lSW6Uj8LyEpzhtjzc++U5KzIY9WcHAFKd 9wxmqdeVIU3xC7KZbHJGxO/F4kqf3tdZxboejncirXNvgd9/CSHp8qkhh WPuMdcG/9olBXsGpahUByohAgyDwI/FLUbDSKE8tf1jkkbtSmDoPJyqpn Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="395675421" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="395675421" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:56:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="1690269" Received: from stang1-mobl1.amr.corp.intel.com (HELO localhost.localdomain) ([10.212.92.130]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:56:04 -0800 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, mosomate , Bard Liao , Pierre-Louis Bossart Subject: [PATCH 19/24] ASoC: Intel: common: DMI remap for rebranded Intel NUC M15 (LAPRC710) laptops Date: Thu, 8 Feb 2024 10:55:40 -0600 Message-Id: <20240208165545.93811-20-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> References: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: N6G4ZLEZWTCGLZ56U2JRQRYIIYA5A6FP X-Message-ID-Hash: N6G4ZLEZWTCGLZ56U2JRQRYIIYA5A6FP 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: mosomate Added DMI quirk to handle the rebranded variants of Intel NUC M15 (LAPRC710) laptops. The DMI matching is based on motherboard attributes. Link: https://github.com/thesofproject/linux/issues/4218 Signed-off-by: Máté Mosonyi Reviewed-by: Bard Liao Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/dmi-quirks.c | 8 ++++++++ sound/soc/intel/boards/sof_sdw.c | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/drivers/soundwire/dmi-quirks.c b/drivers/soundwire/dmi-quirks.c index 9ebdd0cd0b1c..91ab97a456fa 100644 --- a/drivers/soundwire/dmi-quirks.c +++ b/drivers/soundwire/dmi-quirks.c @@ -130,6 +130,14 @@ static const struct dmi_system_id adr_remap_quirk_table[] = { }, .driver_data = (void *)intel_rooks_county, }, + { + /* quirk used for NUC15 LAPRC710 skew */ + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"), + DMI_MATCH(DMI_BOARD_NAME, "LAPRC710"), + }, + .driver_data = (void *)intel_rooks_county, + }, { .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 801cfe9c4dd3..e4b9f4d1ec06 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -236,6 +236,17 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { SOF_SDW_PCH_DMIC | RT711_JD2_100K), }, + { + /* NUC15 LAPRC710 skews */ + .callback = sof_sdw_quirk_cb, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"), + DMI_MATCH(DMI_BOARD_NAME, "LAPRC710"), + }, + .driver_data = (void *)(SOF_SDW_TGL_HDMI | + SOF_SDW_PCH_DMIC | + RT711_JD2_100K), + }, /* TigerLake-SDCA devices */ { .callback = sof_sdw_quirk_cb, From patchwork Thu Feb 8 16:55:41 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: 770905 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 AFE13C48260 for ; Thu, 8 Feb 2024 17:02:01 +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 97E57820; Thu, 8 Feb 2024 18:01:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 97E57820 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1707411719; bh=Q3kKBT2OCE5WYq141Fdi7TsGKTc9+dGxIYt5YbVnmB0=; 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=c9ynRrS5o57CjClv0fXgsEiqryTTTAm3cJWL0sDb5KwKrCyJNdyLKNG86FL0yrI8H hD1XR1wfML/3d8uZe+TwpZoT+28cwrBo345ZZtSw0uEgFf0ak16n9+Vd6KsF7+06Uk lE23pXIS1lgMKm3S51kR5WzM+HCzQ5kVf55y3M5c= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B1778F89615; Thu, 8 Feb 2024 17:57:21 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 4F5E9F80CB4; Thu, 8 Feb 2024 17:57:21 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AC64AF806A0; Thu, 8 Feb 2024 17:56:35 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (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 F27D7F805E6 for ; Thu, 8 Feb 2024 17:56:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F27D7F805E6 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=PbTrNDhc DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707411375; x=1738947375; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Q3kKBT2OCE5WYq141Fdi7TsGKTc9+dGxIYt5YbVnmB0=; b=PbTrNDhc0ovcIuHEMcUsL0Ccat0c5c7aQmwT7N3gqxs+0xnf3HNbHImQ 4JUAyiDg9C8ssdZ+/K52/gPeOPfGjdFJ0g/dBWKGwhdEv42EYxM78B5WD O8WQFJpmO987gN3Fm/UxVTxbIg2xqBZeaDb/sErzWk+8pnzVz1yyzde2C DC+1OxeHblRyING+LjqYgfXJmMnL9EacKwylX68p0w7rlkFFJECjlZ4Lm mDCDgptfGI9bS0lrkk880XCJI3BelY4UIsBbN/GCuY6uX8SdvXIuIU+LG p5lI6eg+Q3/5fTKCZdPDeDJ0788TayELcgLlpu11dM9+knn7VTpBMb4Fu g==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="395675428" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="395675428" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:56:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="1690275" Received: from stang1-mobl1.amr.corp.intel.com (HELO localhost.localdomain) ([10.212.92.130]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:56:05 -0800 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 , =?utf-8?q?P=C3=A9ter_Ujfalusi?= , Pierre-Louis Bossart Subject: [PATCH 20/24] ASoC: Intel: ssp-common: Add stub for sof_ssp_get_codec_name Date: Thu, 8 Feb 2024 10:55:41 -0600 Message-Id: <20240208165545.93811-21-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> References: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: IVXDZPIZPU7DLXAF57ZG7DXONNC5EF7C X-Message-ID-Hash: IVXDZPIZPU7DLXAF57ZG7DXONNC5EF7C 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 As this function is now used in sof_board_helpers it requires a build stub for the case SSP_COMMON is not built in. Fixes: ba0c7c328762 ("ASoC: Intel: board_helpers: support amp link initialization") Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_ssp_common.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/soc/intel/boards/sof_ssp_common.h b/sound/soc/intel/boards/sof_ssp_common.h index 6d827103479b..d24888bc99fd 100644 --- a/sound/soc/intel/boards/sof_ssp_common.h +++ b/sound/soc/intel/boards/sof_ssp_common.h @@ -67,6 +67,14 @@ enum sof_ssp_codec { enum sof_ssp_codec sof_ssp_detect_codec_type(struct device *dev); enum sof_ssp_codec sof_ssp_detect_amp_type(struct device *dev); + +#if IS_ENABLED(CONFIG_SND_SOC_INTEL_SOF_SSP_COMMON) const char *sof_ssp_get_codec_name(enum sof_ssp_codec codec_type); +#else +static inline const char *sof_ssp_get_codec_name(enum sof_ssp_codec codec_type) +{ + return NULL; +} +#endif #endif /* __SOF_SSP_COMMON_H */ From patchwork Thu Feb 8 16:55:44 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: 770904 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 93002C4829A for ; Thu, 8 Feb 2024 17:02: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 86F0914DD; Thu, 8 Feb 2024 18:02:18 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 86F0914DD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1707411748; bh=iRATeZtRrW+PHtKv+nCULUFBqBZO+V/KE5hbLZcj5RU=; 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=rLW26BjsfydBnceE55VSMh3onknBC6oWwK/UIVaBlbdxP7j13Y5lIN5FRVkENuzau HGFID01BEj1EtgYXj2G7FR21x4wxvhz5oB/VqpJp388Lh0nusYJM6e8av/GAgYGch6 OjyXQC5vp6X7U7LpakiOYHrsk08Fpn4gF1s9ZYQA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0ACF6F896E2; Thu, 8 Feb 2024 17:57:30 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 49CAFF896DD; Thu, 8 Feb 2024 17:57:29 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A8524F806BC; Thu, 8 Feb 2024 17:56:40 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (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 EBFE7F8060C for ; Thu, 8 Feb 2024 17:56:15 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EBFE7F8060C 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=OITOTBzL DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707411377; x=1738947377; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iRATeZtRrW+PHtKv+nCULUFBqBZO+V/KE5hbLZcj5RU=; b=OITOTBzLjyfA7afpXYqL2DiZKP1yhZQPPCE1WhSuQHE7zfepK5R3lWao tc7JUgut6jAhvbQmybZvvrgsWaTJjAoxNYCWx+cL5PeJ9UNNZriRKcAx9 04GVg4P8Aq/Iiiws0DQYv41R2iAa8ChZGKrqus2g8fGsVyypwTLj9ZTUg bwFhRhk6aqv9LabL4J93B+aImfBPNk+3ndrD9qdHS/2BZ957XQYECjMHV +FKEm8leCmjcWucmdCBayJP762KgL+nUNksLxnAJOTn18Oo1VUarVRWRG ENCW++cz7boU2Vm5V4hOiMePzSJyl7qu6RHo0Z/Bve37SPxjkgaMntxnt g==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="395675447" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="395675447" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:56:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="1690284" Received: from stang1-mobl1.amr.corp.intel.com (HELO localhost.localdomain) ([10.212.92.130]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:56:07 -0800 From: Pierre-Louis Bossart To: linux-sound@vger.kernel.org Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, Chao Song , Bard Liao , Pierre-Louis Bossart Subject: [PATCH 23/24] ASoC: Intel: soc-acpi-intel-lnl-match: Add rt722 support Date: Thu, 8 Feb 2024 10:55:44 -0600 Message-Id: <20240208165545.93811-24-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> References: <20240208165545.93811-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: UR7EYMKIX7W7MPUOKUW4PJB5JEU4RD5Q X-Message-ID-Hash: UR7EYMKIX7W7MPUOKUW4PJB5JEU4RD5Q 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: Chao Song This patch adds match table for rt722 multiple function codec on link 0. Reviewed-by: Bard Liao Signed-off-by: Chao Song Signed-off-by: Pierre-Louis Bossart --- .../intel/common/soc-acpi-intel-lnl-match.c | 49 +++++++++++++++++++ 1 file changed, 49 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 3d48e161cb33..74d6dcd7471f 100644 --- a/sound/soc/intel/common/soc-acpi-intel-lnl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-lnl-match.c @@ -51,6 +51,31 @@ static const struct snd_soc_acpi_endpoint rt712_endpoints[] = { }, }; +/* + * RT722 is a multi-function codec, three endpoints are created for + * its headset, amp and dmic functions. + */ +static const struct snd_soc_acpi_endpoint rt722_endpoints[] = { + { + .num = 0, + .aggregated = 0, + .group_position = 0, + .group_id = 0, + }, + { + .num = 1, + .aggregated = 0, + .group_position = 0, + .group_id = 0, + }, + { + .num = 2, + .aggregated = 0, + .group_position = 0, + .group_id = 0, + }, +}; + static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = { { .adr = 0x000030025D071101ull, @@ -78,6 +103,15 @@ static const struct snd_soc_acpi_adr_device rt1712_3_single_adr[] = { } }; +static const struct snd_soc_acpi_adr_device rt722_0_single_adr[] = { + { + .adr = 0x000030025d072201ull, + .num_endpoints = ARRAY_SIZE(rt722_endpoints), + .endpoints = rt722_endpoints, + .name_prefix = "rt722" + } +}; + static const struct snd_soc_acpi_adr_device rt1316_2_group1_adr[] = { { .adr = 0x000230025D131601ull, @@ -128,6 +162,15 @@ static const struct snd_soc_acpi_link_adr lnl_712_only[] = { {} }; +static const struct snd_soc_acpi_link_adr lnl_rt722_only[] = { + { + .mask = BIT(0), + .num_adr = ARRAY_SIZE(rt722_0_single_adr), + .adr_d = rt722_0_single_adr, + }, + {} +}; + static const struct snd_soc_acpi_link_adr lnl_3_in_1_sdca[] = { { .mask = BIT(0), @@ -191,6 +234,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_lnl_sdw_machines[] = { .drv_name = "sof_sdw", .sof_tplg_filename = "sof-lnl-rt712-l2-rt1712-l3.tplg", }, + { + .link_mask = BIT(0), + .links = lnl_rt722_only, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-lnl-rt722-l0.tplg", + }, {}, }; EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_lnl_sdw_machines);