From patchwork Tue Aug 27 12:31:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13779447 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C19261BC073 for ; Tue, 27 Aug 2024 12:32:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761953; cv=none; b=db4vpDFd7IEdQ2HTaZDHzeggnwwN0f/5AMMfKvGKrP5X/ZMKjKzHKy4sgUsjorH5hf7hDl+PBe0w8C0QTxKJ4qzo90uIjIFAAJXcNm0WY95UfysXw7sDX2ogI2UgNzVA5KBSWRnjpbNl88xEo8v76e2Iwo7zkohbp4T19UMES98= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761953; c=relaxed/simple; bh=hnAANfMFW0xmLVKd2Pe610xJ63d/vRJrR6+877isFbk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DfE50w3clbjXT29lKi0HNzUm8Jl+haqgq/ije9W213iLnCjDyS92xhXSc8iwHDYGduY6HHTrDfsYclnsbHXNuVB1cqwUJDJf/XbEdXdMSIY8HtI0I4jmIJ52hRcXS25TPTWEaCAK++45aFnhNZNMthkAFkZN4FPqSxF6DJU6bqY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Wk2vldTK; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Wk2vldTK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724761952; x=1756297952; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hnAANfMFW0xmLVKd2Pe610xJ63d/vRJrR6+877isFbk=; b=Wk2vldTK9asLraLugHCnAra6AlHAg9n5s4dvCT/rpawN3xpSOej5Ypeo YjAr8pNOB00z6XMTF/OSFywZx8u5f6OBxuilsJtF5wCbkYiZ0A1ilKgn9 Df3hZ8Rdo5CKtDSoXruHk231S5uI/VlwB7YpYTGZq87abLl+LrPrw7tRb J+3FwbbUCjKNdtZWcWlekSna1z5TtGfCn0f5icM0916skReFT2EF6xziv 5+NIbJfgur88bOKO9hT2enc63KP8VRI80628AMJ3wcP9zSFzexkscKdqY G1AX+/m754lOf/ALwRGk8syQjtRadSMZfRqEtcy3v6T5ri+Id9Hh+Cbid g==; X-CSE-ConnectionGUID: MdlKyQp7QdqxpQDg5T9xJg== X-CSE-MsgGUID: Q18e7FcASbKR8k/2e/eP6g== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="13235485" X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="13235485" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:31 -0700 X-CSE-ConnectionGUID: uFlYLTGdQ7W+T8jHP3b3fQ== X-CSE-MsgGUID: kaO6SmEuTwSsO0lU4dFsoA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="62676762" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.118.39]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:29 -0700 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: linux-sound@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, peter.ujfalusi@linux.intel.com Subject: [PATCH v2 01/17] ASoC: Intel: sof_sdw: make sof_sdw_quirk static Date: Tue, 27 Aug 2024 20:31:59 +0800 Message-ID: <20240827123215.258859-2-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> References: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Pierre-Louis Bossart There's no need to make this variable visible at a higher level. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- sound/soc/intel/boards/sof_sdw.c | 2 +- sound/soc/intel/boards/sof_sdw_common.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index b1fb6fabd3b7..9b642c6883b0 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -17,7 +17,7 @@ #include "sof_sdw_common.h" #include "../../codecs/rt711.h" -unsigned long sof_sdw_quirk = RT711_JD1; +static unsigned long sof_sdw_quirk = RT711_JD1; static int quirk_override = -1; module_param_named(quirk, quirk_override, int, 0444); MODULE_PARM_DESC(quirk, "Board-specific quirk override"); diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index c10d2711b730..3aa1dcec5172 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -58,8 +58,6 @@ struct intel_mc_ctx { unsigned int sdw_pin_index[SDW_INTEL_MAX_LINKS]; }; -extern unsigned long sof_sdw_quirk; - /* generic HDMI support */ int sof_sdw_hdmi_init(struct snd_soc_pcm_runtime *rtd); From patchwork Tue Aug 27 12:32:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13779448 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D9AE1BC073 for ; Tue, 27 Aug 2024 12:32:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761955; cv=none; b=Txb6UonwQZLLEK1h8JH6/V7wrk3SkO+cKZUUnQG7jN6gkBR4SFi5Ny/OPPN00+PkVQUXW2PzlEzDQkpsqsLKQCV+k5/85t+9v3/6yGZQAs2l52j2eV6za+eZDzel2dbK6EwkUnYFEQsGsBv66gYQSWdKBaHeXEE5j4CjkJYkqL4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761955; c=relaxed/simple; bh=kEwY1c5jCHqQo3mClaPg/ISlbhMxoF+ffjISSZVISy0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Cf6vuOPSujYLW8TMU6xgOd6Ru+UJ07iA44rRcVqKuR1GmZnSefQ+R7tRxVnIWPJD+Xkx9x62EULMb9uNiUL95O+YSkQMwMs3I5No42RTaU4aKr9nFI4PVIQHT13hA7xpzwlOdUieUhb5WpIR7UrO8BjS2dUrYz4NduUnQjR8cwI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=lAJUWzI7; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="lAJUWzI7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724761954; x=1756297954; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kEwY1c5jCHqQo3mClaPg/ISlbhMxoF+ffjISSZVISy0=; b=lAJUWzI7LILMli4KEAr/Ju+TZrRpCrLiyMtdG2fpOYqcA2ADCbbEZBIR /UPe0pqVK46s2FLDEybw7VDmncFMReBKrZJeDDj2jjeiPNvyS6CcN4S9f /cigt7r3dIrSGX+wu6TDj+4j942PS9Btc7A10Z899/Wf4LxQWdTU+jJH9 cfre71/w322B3LTt5U4QOPD32JK5PP9Ut6ImSRQdLlbmJq81+3P5Uv2EP B70t/piI9APjVw21YC+C9xguzjp7liIBx4Z53+1VxTivsLAOie4PNH8JG TxPlWNwuNb4cPwqa29q6pCGUU066cdOlNSlagI2URbSYhRWwjc2mYLrPP A==; X-CSE-ConnectionGUID: IYbSIrVTTeG2APiX1ckglw== X-CSE-MsgGUID: EN1nOBYRRlW+yPMmKV96HA== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="13235488" X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="13235488" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:34 -0700 X-CSE-ConnectionGUID: iL+uVjTUQi6EG+5I8CJGMw== X-CSE-MsgGUID: vbjRIJ7hRR6dKrM0Qm3Acw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="62676766" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.118.39]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:31 -0700 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: linux-sound@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, peter.ujfalusi@linux.intel.com Subject: [PATCH v2 02/17] ASoC: Intel: sof_sdw: add rt1320 amp support Date: Tue, 27 Aug 2024 20:32:00 +0800 Message-ID: <20240827123215.258859-3-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> References: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add Realtek rt1320 amp support. Signed-off-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- sound/soc/intel/boards/Kconfig | 1 + sound/soc/sdw_utils/soc_sdw_rt_amp.c | 11 ++++++++++- sound/soc/sdw_utils/soc_sdw_utils.c | 19 +++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig index cb952183f5ed..1141fe1263ce 100644 --- a/sound/soc/intel/boards/Kconfig +++ b/sound/soc/intel/boards/Kconfig @@ -524,6 +524,7 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH select SND_SOC_RT1308 select SND_SOC_RT1316_SDW select SND_SOC_RT1318_SDW + select SND_SOC_RT1320_SDW select SND_SOC_RT5682_SDW select SND_SOC_CS42L42_SDW select SND_SOC_CS42L43 diff --git a/sound/soc/sdw_utils/soc_sdw_rt_amp.c b/sound/soc/sdw_utils/soc_sdw_rt_amp.c index 42be01405ab4..6951dfb56526 100644 --- a/sound/soc/sdw_utils/soc_sdw_rt_amp.c +++ b/sound/soc/sdw_utils/soc_sdw_rt_amp.c @@ -160,6 +160,13 @@ static const struct snd_soc_dapm_route rt1318_map[] = { { "Speaker", NULL, "rt1318-2 SPOR" }, }; +static const struct snd_soc_dapm_route rt1320_map[] = { + { "Speaker", NULL, "rt1320-1 SPOL" }, + { "Speaker", NULL, "rt1320-1 SPOR" }, + { "Speaker", NULL, "rt1320-2 SPOL" }, + { "Speaker", NULL, "rt1320-2 SPOR" }, +}; + static const struct snd_soc_dapm_route *get_codec_name_and_route(struct snd_soc_dai *dai, char *codec_name) { @@ -171,8 +178,10 @@ static const struct snd_soc_dapm_route *get_codec_name_and_route(struct snd_soc_ return rt1308_map; else if (strcmp(codec_name, "rt1316") == 0) return rt1316_map; - else + else if (strcmp(codec_name, "rt1318") == 0) return rt1318_map; + else + return rt1320_map; } int asoc_sdw_rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) diff --git a/sound/soc/sdw_utils/soc_sdw_utils.c b/sound/soc/sdw_utils/soc_sdw_utils.c index e8d0f199155d..d59ccb56642c 100644 --- a/sound/soc/sdw_utils/soc_sdw_utils.c +++ b/sound/soc/sdw_utils/soc_sdw_utils.c @@ -254,6 +254,25 @@ struct asoc_sdw_codec_info codec_info_list[] = { }, .dai_num = 1, }, + { + .part_id = 0x1320, + .dais = { + { + .direction = {true, false}, + .dai_name = "rt1320-aif1", + .dai_type = SOC_SDW_DAI_TYPE_AMP, + .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, + .init = asoc_sdw_rt_amp_init, + .exit = asoc_sdw_rt_amp_exit, + .rtd_init = asoc_sdw_rt_amp_spk_rtd_init, + .controls = generic_spk_controls, + .num_controls = ARRAY_SIZE(generic_spk_controls), + .widgets = generic_spk_widgets, + .num_widgets = ARRAY_SIZE(generic_spk_widgets), + }, + }, + .dai_num = 1, + }, { .part_id = 0x714, .version_id = 3, From patchwork Tue Aug 27 12:32:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13779461 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0465C1BAEDA for ; Tue, 27 Aug 2024 12:32:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761958; cv=none; b=cKf8fg+MKi/IDI+aZceKeEkjEgBuEBFgGF9iBk1xXkI/mTxtHeIucDdH+VIPx3pg7vzJMntYZMGyUB/YLy6ujhj/3Mg4FSWe//dD/E156MVNDbGFO4FEq/7ZJkXULbqsNuOUYv9MlXAJJHSVjawPO/jscGpQO4w1Szmqbx+zBD4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761958; c=relaxed/simple; bh=rPUyYzQd/NymgQax8wXqS1QKPsiIRfZ2HDEbpdYfIZ8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lDSpkGjuNbPJbp019+EcGhlczO4WrHtohaLnfRgh5MbJig29xXsqdnUf5ltCnyUemfn2QZ2tmzh387HEAcQgvNkB+2vBftnuLZXy/bPko83qUnIVaWfxwruuM3f4FbyO+yvh16FY+gbnT+L9VCzap55mexFZNVTB+eMgUx8P2FM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=gKwsvAgb; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="gKwsvAgb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724761957; x=1756297957; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rPUyYzQd/NymgQax8wXqS1QKPsiIRfZ2HDEbpdYfIZ8=; b=gKwsvAgbUtX1H3QZmyb+Uy31GMwNQn1yy5GGWgT8KLG09GvuhVG8xA9Y NMkhy+NklHrA3SobvhHfn3gPtKiTGUkTdXugrheec4Qta8c30Jfv5ensF nJw6lWfy0gOrDFpjzrUzLpaqe5cjusvbDBb31NCJRK4vtcBwH/d0xrZ3O 2QKph36EMcZLn5usy1VUL4+EHJOkdHi7rhXhJ9fD44k6L5vNGrp+4HLzF 6gxntVwJbLHAJu1TR7WMKOUJdiWtlqUcaz2zcHZ9/Xi0HVw5tdAY/Lesl UJRRDDhqR3ZhQcQErcE7vws1LNVkPg9xndgK7YYdlWz6CH53oHb18BTZl w==; X-CSE-ConnectionGUID: dyFT58DwQCSOeKgT0VdRCw== X-CSE-MsgGUID: 7Y1XFSGeSleNTCzX6ABXVQ== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="13235492" X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="13235492" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:36 -0700 X-CSE-ConnectionGUID: VfPm6jktSjuqCVUkynN4jg== X-CSE-MsgGUID: WIMNiWqYRGe2QgbTi8oWyA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="62676773" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.118.39]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:34 -0700 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: linux-sound@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, peter.ujfalusi@linux.intel.com Subject: [PATCH v2 03/17] ASoC: Intel: boards: always check the result of acpi_dev_get_first_match_dev() Date: Tue, 27 Aug 2024 20:32:01 +0800 Message-ID: <20240827123215.258859-4-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> References: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Pierre-Louis Bossart The code seems mostly copy-pasted, with some machine drivers forgetting to test if the 'adev' result is NULL. Add this check when missing, and use -ENOENT consistently as an error code. Reported-by: Dan Carpenter Closes: https://lore.kernel.org/alsa-devel/918944d2-3d00-465e-a9d1-5d57fc966113@stanley.mountain/T/#u Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Signed-off-by: Bard Liao --- sound/soc/intel/boards/bytcht_cx2072x.c | 4 ++++ sound/soc/intel/boards/bytcht_da7213.c | 4 ++++ sound/soc/intel/boards/bytcht_es8316.c | 2 +- sound/soc/intel/boards/bytcr_rt5640.c | 2 +- sound/soc/intel/boards/bytcr_rt5651.c | 2 +- sound/soc/intel/boards/cht_bsw_rt5645.c | 4 ++++ sound/soc/intel/boards/cht_bsw_rt5672.c | 4 ++++ sound/soc/intel/boards/sof_es8336.c | 2 +- sound/soc/intel/boards/sof_wm8804.c | 4 ++++ 9 files changed, 24 insertions(+), 4 deletions(-) diff --git a/sound/soc/intel/boards/bytcht_cx2072x.c b/sound/soc/intel/boards/bytcht_cx2072x.c index df3c2a7b64d2..8c2b4ab764bb 100644 --- a/sound/soc/intel/boards/bytcht_cx2072x.c +++ b/sound/soc/intel/boards/bytcht_cx2072x.c @@ -255,7 +255,11 @@ static int snd_byt_cht_cx2072x_probe(struct platform_device *pdev) snprintf(codec_name, sizeof(codec_name), "i2c-%s", acpi_dev_name(adev)); byt_cht_cx2072x_dais[dai_index].codecs->name = codec_name; + } else { + dev_err(&pdev->dev, "Error cannot find '%s' dev\n", mach->id); + return -ENOENT; } + acpi_dev_put(adev); /* override platform name, if required */ diff --git a/sound/soc/intel/boards/bytcht_da7213.c b/sound/soc/intel/boards/bytcht_da7213.c index 08c598b7e1ee..9178bbe8d995 100644 --- a/sound/soc/intel/boards/bytcht_da7213.c +++ b/sound/soc/intel/boards/bytcht_da7213.c @@ -258,7 +258,11 @@ static int bytcht_da7213_probe(struct platform_device *pdev) snprintf(codec_name, sizeof(codec_name), "i2c-%s", acpi_dev_name(adev)); dailink[dai_index].codecs->name = codec_name; + } else { + dev_err(&pdev->dev, "Error cannot find '%s' dev\n", mach->id); + return -ENOENT; } + acpi_dev_put(adev); /* override platform name, if required */ diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c index 77b91ea4dc32..3539c9ff0fd2 100644 --- a/sound/soc/intel/boards/bytcht_es8316.c +++ b/sound/soc/intel/boards/bytcht_es8316.c @@ -562,7 +562,7 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) byt_cht_es8316_dais[dai_index].codecs->name = codec_name; } else { dev_err(dev, "Error cannot find '%s' dev\n", mach->id); - return -ENXIO; + return -ENOENT; } codec_dev = acpi_get_first_physical_node(adev); diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c index db4a33680d94..4479825c08b5 100644 --- a/sound/soc/intel/boards/bytcr_rt5640.c +++ b/sound/soc/intel/boards/bytcr_rt5640.c @@ -1693,7 +1693,7 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) byt_rt5640_dais[dai_index].codecs->name = byt_rt5640_codec_name; } else { dev_err(dev, "Error cannot find '%s' dev\n", mach->id); - return -ENXIO; + return -ENOENT; } codec_dev = acpi_get_first_physical_node(adev); diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c index 8514b79f389b..1f54da98aacf 100644 --- a/sound/soc/intel/boards/bytcr_rt5651.c +++ b/sound/soc/intel/boards/bytcr_rt5651.c @@ -926,7 +926,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) byt_rt5651_dais[dai_index].codecs->name = byt_rt5651_codec_name; } else { dev_err(dev, "Error cannot find '%s' dev\n", mach->id); - return -ENXIO; + return -ENOENT; } codec_dev = acpi_get_first_physical_node(adev); diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c index 1da9ceee4d59..ac23a8b7cafc 100644 --- a/sound/soc/intel/boards/cht_bsw_rt5645.c +++ b/sound/soc/intel/boards/cht_bsw_rt5645.c @@ -582,7 +582,11 @@ static int snd_cht_mc_probe(struct platform_device *pdev) snprintf(cht_rt5645_codec_name, sizeof(cht_rt5645_codec_name), "i2c-%s", acpi_dev_name(adev)); cht_dailink[dai_index].codecs->name = cht_rt5645_codec_name; + } else { + dev_err(&pdev->dev, "Error cannot find '%s' dev\n", mach->id); + return -ENOENT; } + /* acpi_get_first_physical_node() returns a borrowed ref, no need to deref */ codec_dev = acpi_get_first_physical_node(adev); acpi_dev_put(adev); diff --git a/sound/soc/intel/boards/cht_bsw_rt5672.c b/sound/soc/intel/boards/cht_bsw_rt5672.c index d68e5bc755de..c6c469d51243 100644 --- a/sound/soc/intel/boards/cht_bsw_rt5672.c +++ b/sound/soc/intel/boards/cht_bsw_rt5672.c @@ -479,7 +479,11 @@ static int snd_cht_mc_probe(struct platform_device *pdev) snprintf(drv->codec_name, sizeof(drv->codec_name), "i2c-%s", acpi_dev_name(adev)); cht_dailink[dai_index].codecs->name = drv->codec_name; + } else { + dev_err(&pdev->dev, "Error cannot find '%s' dev\n", mach->id); + return -ENOENT; } + acpi_dev_put(adev); /* Use SSP0 on Bay Trail CR devices */ diff --git a/sound/soc/intel/boards/sof_es8336.c b/sound/soc/intel/boards/sof_es8336.c index 2a88efaa6d26..b45d0501f109 100644 --- a/sound/soc/intel/boards/sof_es8336.c +++ b/sound/soc/intel/boards/sof_es8336.c @@ -681,7 +681,7 @@ static int sof_es8336_probe(struct platform_device *pdev) dai_links[0].codecs->dai_name = "ES8326 HiFi"; } else { dev_err(dev, "Error cannot find '%s' dev\n", mach->id); - return -ENXIO; + return -ENOENT; } codec_dev = acpi_get_first_physical_node(adev); diff --git a/sound/soc/intel/boards/sof_wm8804.c b/sound/soc/intel/boards/sof_wm8804.c index b2d02cc92a6a..0a5ce34d7f7b 100644 --- a/sound/soc/intel/boards/sof_wm8804.c +++ b/sound/soc/intel/boards/sof_wm8804.c @@ -270,7 +270,11 @@ static int sof_wm8804_probe(struct platform_device *pdev) snprintf(codec_name, sizeof(codec_name), "%s%s", "i2c-", acpi_dev_name(adev)); dailink[dai_index].codecs->name = codec_name; + } else { + dev_err(&pdev->dev, "Error cannot find '%s' dev\n", mach->id); + return -ENOENT; } + acpi_dev_put(adev); snd_soc_card_set_drvdata(card, ctx); From patchwork Tue Aug 27 12:32:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13779462 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 584371BAEDA for ; Tue, 27 Aug 2024 12:32:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761960; cv=none; b=QE8TvQMqOrEXPqe8X/CxR/nfzVN5YJnhPcQw1nedIBO9EP2WVWhMl6yr+w+CAt35TXWuMMxV/Sapfwzp2z3t+Otoxi27+f7KZkB3LzLDPPzXdgI/1iVQnNlbnahBzHFm1YzN6FrdMcj5dCqohCViQEBy8sg8wT7NQjtDureql/o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761960; c=relaxed/simple; bh=BUIzXtdsJwciPGmXwG9tb9lsQ7YTcdAEF4kgC5NdsnE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Jv+++w8D9zpLPvM6fwzOtWKFBxk4rR3c1R2kHXXg7IgYc0clQ9VvcYJ1ve4a4y2XZwvCruoaER+9O1wTVwHOT5FUoA1zkdeJQhjSBzbl1FuZPOQywcrQa6tdsL8pI3+FIZ3uhsTKcy0phkJ60nFLkzr/tZiojx+t/Cn4k+rZqeA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=R0bUXgXC; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="R0bUXgXC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724761959; x=1756297959; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BUIzXtdsJwciPGmXwG9tb9lsQ7YTcdAEF4kgC5NdsnE=; b=R0bUXgXCYcGW2GqtyAPVXBVUW549u0UeKpeoW0dZkvoUY6+zG8u6O4JU CLBe7d99A89l99a/fnvBzvELUFZGM7ZK1Y2Jcl/CNNqH4lw7vZpZ519gh vn/cV4174baZO/LsKF7Tw4+3yp5aqYBWDCVrA93yNyCB77L1EnMO9qgix ggPckl95qAt6H/xqjETL5bQt8lXXzifmq5AZy2V6gQu+mionWd1JGl3qV /obY9UXy9Psb16QGSZ9KnD7oPR/ECll96+urz9TNAKWQ1myal49fl2I96 XuEDZhwjHatMETZa5EPJQyKNg3xmYljilmMsVxsdicmyk1Hw8Y2tFM/Lh w==; X-CSE-ConnectionGUID: x3Qqed00TEOxLnq1BKy0NA== X-CSE-MsgGUID: TA3qqvBySIujBKkbOFEolw== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="13235495" X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="13235495" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:39 -0700 X-CSE-ConnectionGUID: t4NxYG4wQWqxFlA+81uKLw== X-CSE-MsgGUID: 1DBy/bf9R1ajE0lycRH2ZQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="62676776" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.118.39]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:37 -0700 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: linux-sound@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, peter.ujfalusi@linux.intel.com Subject: [PATCH v2 04/17] ASoC: SOF: Intel: hda: refactoring topology name fixup for HDA mach Date: Tue, 27 Aug 2024 20:32:02 +0800 Message-ID: <20240827123215.258859-5-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> References: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Move I2S mach's topology name fixup code to the end of machine driver enumeration flow so HDA mach could also use same code to fixup its topology file name as well. No functional change in this commit. Signed-off-by: Brent Lu Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- .../intel/common/soc-acpi-intel-hda-match.c | 12 +-- sound/soc/sof/intel/hda.c | 84 ++++++++++--------- 2 files changed, 45 insertions(+), 51 deletions(-) diff --git a/sound/soc/intel/common/soc-acpi-intel-hda-match.c b/sound/soc/intel/common/soc-acpi-intel-hda-match.c index 007ccd8a60e5..e93336e27beb 100644 --- a/sound/soc/intel/common/soc-acpi-intel-hda-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-hda-match.c @@ -13,16 +13,8 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_hda_machines[] = { { /* .id is not used in this file */ .drv_name = "skl_hda_dsp_generic", - - /* .fw_filename is dynamically set in skylake driver */ - - .sof_tplg_filename = "sof-hda-generic.tplg", - - /* - * .machine_quirk and .quirk_data are not used here but - * can be used if we need a more complicated machine driver - * combining HDA+other device (e.g. DMIC). - */ + .sof_tplg_filename = "sof-hda-generic", /* the tplg suffix is added at run time */ + .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER, }, {}, }; diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 5a40b8fbbbd3..128687b24bf5 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -558,7 +558,7 @@ static int check_nhlt_ssp_mclk_mask(struct snd_sof_dev *sdev, int ssp_num) return intel_nhlt_ssp_mclk_mask(nhlt, ssp_num); } -#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC) || IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE) +#if IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE) static const char *fixup_tplg_name(struct snd_sof_dev *sdev, const char *sof_tplg_filename, @@ -1045,10 +1045,7 @@ static void hda_generic_machine_select(struct snd_sof_dev *sdev, struct snd_soc_acpi_mach *hda_mach; struct snd_sof_pdata *pdata = sdev->pdata; const char *tplg_filename; - const char *idisp_str; - int dmic_num = 0; int codec_num = 0; - int ret; int i; /* codec detection */ @@ -1071,33 +1068,30 @@ static void hda_generic_machine_select(struct snd_sof_dev *sdev, * - one external HDAudio codec */ if (!*mach && codec_num <= 2) { - bool tplg_fixup; + bool tplg_fixup = false; hda_mach = snd_soc_acpi_intel_hda_machines; dev_info(bus->dev, "using HDA machine driver %s now\n", hda_mach->drv_name); - if (codec_num == 1 && HDA_IDISP_CODEC(bus->codec_mask)) - idisp_str = "-idisp"; - else - idisp_str = ""; - - /* topology: use the info from hda_machines */ - if (pdata->tplg_filename) { - tplg_fixup = false; - tplg_filename = pdata->tplg_filename; - } else { + /* + * topology: use the info from hda_machines since tplg file name + * is not overwritten + */ + if (!pdata->tplg_filename) tplg_fixup = true; - tplg_filename = hda_mach->sof_tplg_filename; + + if (tplg_fixup && + codec_num == 1 && HDA_IDISP_CODEC(bus->codec_mask)) { + tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, + "%s-idisp", + hda_mach->sof_tplg_filename); + if (!tplg_filename) + return; + + hda_mach->sof_tplg_filename = tplg_filename; } - ret = dmic_detect_topology_fixup(sdev, &tplg_filename, idisp_str, &dmic_num, - tplg_fixup); - if (ret < 0) - return; - - hda_mach->mach_params.dmic_num = dmic_num; - pdata->tplg_filename = tplg_filename; if (codec_num == 2 || (codec_num == 1 && !HDA_IDISP_CODEC(bus->codec_mask))) { @@ -1311,11 +1305,35 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev) const char *tplg_filename; const char *tplg_suffix; bool amp_name_valid; + bool i2s_mach_found = false; /* Try I2S or DMIC if it is supported */ - if (interface_mask & (BIT(SOF_DAI_INTEL_SSP) | BIT(SOF_DAI_INTEL_DMIC))) + if (interface_mask & (BIT(SOF_DAI_INTEL_SSP) | BIT(SOF_DAI_INTEL_DMIC))) { mach = snd_soc_acpi_find_machine(desc->machines); + if (mach) + i2s_mach_found = true; + } + /* + * If I2S fails and no external HDaudio codec is detected, + * try SoundWire if it is supported + */ + if (!mach && !HDA_EXT_CODEC(bus->codec_mask) && + (interface_mask & BIT(SOF_DAI_INTEL_ALH))) + mach = hda_sdw_machine_select(sdev); + + /* + * Choose HDA generic machine driver if mach is NULL. + * Otherwise, set certain mach params. + */ + hda_generic_machine_select(sdev, &mach); + if (!mach) + dev_warn(sdev->dev, "warning: No matching ASoC machine driver found\n"); + + /* + * Fixup tplg file name by appending dmic num, ssp num, codec/amplifier + * name string if quirk flag is set. + */ if (mach) { bool add_extension = false; bool tplg_fixup = false; @@ -1349,7 +1367,7 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev) tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, "%s%s%d%s", sof_pdata->tplg_filename, - "-dmic", + i2s_mach_found ? "-dmic" : "-", mach->mach_params.dmic_num, "ch"); if (!tplg_filename) @@ -1479,22 +1497,6 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev) } } - /* - * If I2S fails and no external HDaudio codec is detected, - * try SoundWire if it is supported - */ - if (!mach && !HDA_EXT_CODEC(bus->codec_mask) && - (interface_mask & BIT(SOF_DAI_INTEL_ALH))) - mach = hda_sdw_machine_select(sdev); - - /* - * Choose HDA generic machine driver if mach is NULL. - * Otherwise, set certain mach params. - */ - hda_generic_machine_select(sdev, &mach); - if (!mach) - dev_warn(sdev->dev, "warning: No matching ASoC machine driver found\n"); - return mach; } From patchwork Tue Aug 27 12:32:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13779463 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4236E1BAEDA for ; Tue, 27 Aug 2024 12:32:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761964; cv=none; b=R8zIHzrIT7u0RhnCXY0M22IPjuO4xrySSz+y+Pgaak6GMm8uEtald3Re+QDKTHb6jsC6SSAlLqbjPVg9D41Rp05aIqXzXi4Os3Ig7pytr+FoDVU5hLUFKK5Lbk9mgf051CVjKeH0dAI86gO5h5L01AARhZZ6IgpyLfK/kZNJVF0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761964; c=relaxed/simple; bh=LlW3KEo2/oGjxRJrsaksJVpTotQd0KVu179YH7KjAHY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uSU7MjwAd3Nmnsz1FvffPPJhVhR/RCPnD/kgVqViBR7QYr55UeImSHWUfk9r7MZ6DS2tn+Gq+6ljGyTM+kmmR8C+pf3EapaawTjtK/f2qBvYZ1LE+sopnXSxwg8jEogT7QOdiyUS/GfRez38BhxpVGe2WEJOnXGHdi4zLoK6AHU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=aQ4z2TXx; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="aQ4z2TXx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724761962; x=1756297962; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LlW3KEo2/oGjxRJrsaksJVpTotQd0KVu179YH7KjAHY=; b=aQ4z2TXx6yRLZa0EFmWQ0J5MbL5xA8MfybCPxPFrFa7WjubmRIJX+jUP 7Dal/l8ckyL9Ms0m8ZAZ0a1fw/C5BTrJt0IAgQ+pPwstFHvhRT7ER4IU0 +uBOqhJ0cE6EjNVIGiXsOHpmk7T7ffyuN6mf9ml2d9Vc9gowpnJGZcRKX H6WyZRpxlm1Fdfq951THVyN8/6iBV7ZY1/DAR3HnwfgS340jTJmHueyfU zHeUvdp6udJ5SiXwCRDQN131iFzoH3ynR/KxJXGNdzrgWk8VEfmc+u1Vr 9wEOOIZBxgAul2/tjtKPfaiew+NrpoGec+wVexfa+0zr1kQgUyLMpj8hr Q==; X-CSE-ConnectionGUID: dWvvczBHSyea7LY/5KfMPw== X-CSE-MsgGUID: mFHja1GoR6ajGRiJfmlpNw== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="13235498" X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="13235498" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:42 -0700 X-CSE-ConnectionGUID: 44B7cdR0S4K57stQJH1PoA== X-CSE-MsgGUID: ExsOyI8XQ1WphzP0V3W2Xw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="62676779" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.118.39]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:39 -0700 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: linux-sound@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, peter.ujfalusi@linux.intel.com Subject: [PATCH v2 05/17] ASoC: SOF: Intel: hda: refactoring topology name fixup for SDW mach Date: Tue, 27 Aug 2024 20:32:03 +0800 Message-ID: <20240827123215.258859-6-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> References: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Brent Lu Remove SDW mach's topology name fixup code and use the code in hda_machine_select() to fixup its topology file name. No functional change in this commit. Compared with I2S/HDA mach, SDW mach always fixup topology file name with dmic num without using DMIC quirk flag and pass topology name with file extension to SOF driver. Therefore, we add extra code to remove file extension if it exists. Signed-off-by: Brent Lu Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- sound/soc/sof/intel/hda.c | 166 +++++++++++--------------------------- 1 file changed, 46 insertions(+), 120 deletions(-) diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 128687b24bf5..2f24b5abc91b 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -511,6 +511,8 @@ static int check_dmic_num(struct snd_sof_dev *sdev) if (nhlt) dmic_num = intel_nhlt_get_dmic_geo(sdev->dev, nhlt); + dev_info(sdev->dev, "DMICs detected in NHLT tables: %d\n", dmic_num); + /* allow for module parameter override */ if (dmic_num_override != -1) { dev_dbg(sdev->dev, @@ -558,82 +560,6 @@ static int check_nhlt_ssp_mclk_mask(struct snd_sof_dev *sdev, int ssp_num) return intel_nhlt_ssp_mclk_mask(nhlt, ssp_num); } -#if IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE) - -static const char *fixup_tplg_name(struct snd_sof_dev *sdev, - const char *sof_tplg_filename, - const char *idisp_str, - const char *dmic_str) -{ - const char *tplg_filename = NULL; - char *filename, *tmp; - const char *split_ext; - - filename = kstrdup(sof_tplg_filename, GFP_KERNEL); - if (!filename) - return NULL; - - /* this assumes a .tplg extension */ - tmp = filename; - split_ext = strsep(&tmp, "."); - if (split_ext) - tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, - "%s%s%s.tplg", - split_ext, idisp_str, dmic_str); - kfree(filename); - - return tplg_filename; -} - -static int dmic_detect_topology_fixup(struct snd_sof_dev *sdev, - const char **tplg_filename, - const char *idisp_str, - int *dmic_found, - bool tplg_fixup) -{ - const char *dmic_str; - int dmic_num; - - /* first check for DMICs (using NHLT or module parameter) */ - dmic_num = check_dmic_num(sdev); - - switch (dmic_num) { - case 1: - dmic_str = "-1ch"; - break; - case 2: - dmic_str = "-2ch"; - break; - case 3: - dmic_str = "-3ch"; - break; - case 4: - dmic_str = "-4ch"; - break; - default: - dmic_num = 0; - dmic_str = ""; - break; - } - - if (tplg_fixup) { - const char *default_tplg_filename = *tplg_filename; - const char *fixed_tplg_filename; - - fixed_tplg_filename = fixup_tplg_name(sdev, default_tplg_filename, - idisp_str, dmic_str); - if (!fixed_tplg_filename) - return -ENOMEM; - *tplg_filename = fixed_tplg_filename; - } - - dev_info(sdev->dev, "DMICs detected in NHLT tables: %d\n", dmic_num); - *dmic_found = dmic_num; - - return 0; -} -#endif - static int hda_init_caps(struct snd_sof_dev *sdev) { u32 interface_mask = hda_get_interface_mask(sdev); @@ -1199,45 +1125,10 @@ static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev break; } if (mach && mach->link_mask) { - int dmic_num = 0; - bool tplg_fixup; - const char *tplg_filename; - mach->mach_params.links = mach->links; mach->mach_params.link_mask = mach->link_mask; mach->mach_params.platform = dev_name(sdev->dev); - if (pdata->tplg_filename) { - tplg_fixup = false; - } else { - tplg_fixup = true; - tplg_filename = mach->sof_tplg_filename; - } - - /* - * DMICs use up to 4 pins and are typically pin-muxed with SoundWire - * link 2 and 3, or link 1 and 2, thus we only try to enable dmics - * if all conditions are true: - * a) 2 or fewer links are used by SoundWire - * b) the NHLT table reports the presence of microphones - */ - if (hweight_long(mach->link_mask) <= 2) { - int ret; - - ret = dmic_detect_topology_fixup(sdev, &tplg_filename, "", - &dmic_num, tplg_fixup); - if (ret < 0) - return NULL; - } - if (tplg_fixup) - pdata->tplg_filename = tplg_filename; - mach->mach_params.dmic_num = dmic_num; - - dev_dbg(sdev->dev, - "SoundWire machine driver %s topology %s\n", - mach->drv_name, - pdata->tplg_filename); - return mach; } @@ -1294,6 +1185,19 @@ static int check_tplg_quirk_mask(struct snd_soc_acpi_mach *mach) return 0; } +static char *remove_file_ext(const char *tplg_filename) +{ + char *filename, *tmp; + + filename = kstrdup(tplg_filename, GFP_KERNEL); + if (!filename) + return NULL; + + /* remove file extension if exist */ + tmp = filename; + return strsep(&tmp, "."); +} + struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev) { u32 interface_mask = hda_get_interface_mask(sdev); @@ -1306,6 +1210,7 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev) const char *tplg_suffix; bool amp_name_valid; bool i2s_mach_found = false; + bool sdw_mach_found = false; /* Try I2S or DMIC if it is supported */ if (interface_mask & (BIT(SOF_DAI_INTEL_SSP) | BIT(SOF_DAI_INTEL_DMIC))) { @@ -1319,8 +1224,11 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev) * try SoundWire if it is supported */ if (!mach && !HDA_EXT_CODEC(bus->codec_mask) && - (interface_mask & BIT(SOF_DAI_INTEL_ALH))) + (interface_mask & BIT(SOF_DAI_INTEL_ALH))) { mach = hda_sdw_machine_select(sdev); + if (mach) + sdw_mach_found = true; + } /* * Choose HDA generic machine driver if mach is NULL. @@ -1335,15 +1243,20 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev) * name string if quirk flag is set. */ if (mach) { - bool add_extension = false; bool tplg_fixup = false; + bool dmic_fixup = false; /* * If tplg file name is overridden, use it instead of * the one set in mach table */ if (!sof_pdata->tplg_filename) { - sof_pdata->tplg_filename = mach->sof_tplg_filename; + /* remove file extension if it exists */ + tplg_filename = remove_file_ext(mach->sof_tplg_filename); + if (!tplg_filename) + return NULL; + + sof_pdata->tplg_filename = tplg_filename; tplg_fixup = true; } @@ -1361,8 +1274,25 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev) /* report to machine driver if any DMICs are found */ mach->mach_params.dmic_num = check_dmic_num(sdev); + if (sdw_mach_found) { + /* + * DMICs use up to 4 pins and are typically pin-muxed with SoundWire + * link 2 and 3, or link 1 and 2, thus we only try to enable dmics + * if all conditions are true: + * a) 2 or fewer links are used by SoundWire + * b) the NHLT table reports the presence of microphones + */ + if (hweight_long(mach->link_mask) <= 2) + dmic_fixup = true; + else + mach->mach_params.dmic_num = 0; + } else { + if (mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER) + dmic_fixup = true; + } + if (tplg_fixup && - mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER && + dmic_fixup && mach->mach_params.dmic_num) { tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, "%s%s%d%s", @@ -1374,7 +1304,6 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev) return NULL; sof_pdata->tplg_filename = tplg_filename; - add_extension = true; } if (mach->link_mask) { @@ -1414,7 +1343,6 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev) return NULL; sof_pdata->tplg_filename = tplg_filename; - add_extension = true; mclk_mask = check_nhlt_ssp_mclk_mask(sdev, ssp_num); @@ -1453,7 +1381,6 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev) return NULL; sof_pdata->tplg_filename = tplg_filename; - add_extension = true; } @@ -1475,10 +1402,9 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev) return NULL; sof_pdata->tplg_filename = tplg_filename; - add_extension = true; } - if (tplg_fixup && add_extension) { + if (tplg_fixup) { tplg_filename = devm_kasprintf(sdev->dev, GFP_KERNEL, "%s%s", sof_pdata->tplg_filename, From patchwork Tue Aug 27 12:32:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13779464 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABEDA1BC097 for ; Tue, 27 Aug 2024 12:32:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761966; cv=none; b=CSbpUkj3tNM3R2Xl2xU+SkVhsEl6Fz4Hgq4O79IC0eZp9ChOKyLjEeAUd+ZHnfLGeC0uuCrfB0nzMXBXJ26AjDaD44ZiRt5bEl46Vo5P/f3ne6hPxXEPq0BSuj6wcFwKL2NQzpkOOQNhZqjeyGoLn5jGRYgDKY03/LQXCFdPQk8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761966; c=relaxed/simple; bh=+erI0cZfbAPbte3WK3rAmGM0TnJT/SoElDyA6rCuVSc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=vDx2p/akwk97mly5zPlenDW3wD+t3gNTJNOOusDvGFCyEHvwTiPblrNsgKiSfapb2FP40XYySy8P2ZVu0L66EIouEshORWWNrlPKrEWK0jR7NiXa2fCIA2xOR80V8qppHXuV80s3ds78mbhncE/imqRxhwumtbtTZqiNCGPA3Og= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=a2THlJpV; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="a2THlJpV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724761964; x=1756297964; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+erI0cZfbAPbte3WK3rAmGM0TnJT/SoElDyA6rCuVSc=; b=a2THlJpVl5ah4qKSrfM/9PnYJi9Bg4DfPaU6Lf2mSFRP4iqrop/vZDEd wZIuM2mJ5teMCdYdepR4SHnluGVFXODID0Pe1I2A5PzoRm/eVvYWUstLD 8KADIPjd8/yp14smylGIvNLRAixFzcWTyHP+NQVSzSwMGjMX/HWEToyzl ykMc3rBnmZNr6l/FMnW9FsHfdvt5hfXuaBo1xhIlyykGbDql2FbXuUWoI OnLYbnhVBu5qMtPjD1YZCaVS5eRRof6Td/HV+OnlJxj5J7mSDAqD4nnmV Nc4LcRBXi1dWoyJdw8DL4njGI9kwnuebMRdHHcgXmcAzdjxmiMHnzv04n w==; X-CSE-ConnectionGUID: p5q54yoSTMC3fq4uJq/zmg== X-CSE-MsgGUID: 7pmBBucBRImAlUd5R1uOYw== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="13235501" X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="13235501" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:44 -0700 X-CSE-ConnectionGUID: aocFy+k0QPyPn0kQrEMzIA== X-CSE-MsgGUID: +1zbyfXqScexuf+01Teaxg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="62676783" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.118.39]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:42 -0700 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: linux-sound@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, peter.ujfalusi@linux.intel.com Subject: [PATCH v2 06/17] ASoC: Intel: sof_sdw: move ignore_internal_dmic check earlier Date: Tue, 27 Aug 2024 20:32:04 +0800 Message-ID: <20240827123215.258859-7-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> References: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 dmic links will not be created if ctx->ignore_internal_dmic is set, and dmic_num should be 0 in this case. Move ignore_internal_dmic check earlier where dmic_num is set to get an accurate dmic_num. Signed-off-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 9b642c6883b0..3781a27bfbed 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1102,8 +1102,12 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) hdmi_num = SOF_PRE_TGL_HDMI_COUNT; /* enable dmic01 & dmic16k */ - if (sof_sdw_quirk & SOC_SDW_PCH_DMIC || mach_params->dmic_num) - dmic_num = 2; + if (sof_sdw_quirk & SOC_SDW_PCH_DMIC || mach_params->dmic_num) { + if (ctx->ignore_internal_dmic) + dev_warn(dev, "Ignoring PCH DMIC\n"); + else + dmic_num = 2; + } if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT) bt_num = 1; @@ -1148,14 +1152,10 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) } /* dmic */ - if (dmic_num > 0) { - if (ctx->ignore_internal_dmic) { - dev_warn(dev, "Ignoring PCH DMIC\n"); - } else { - ret = create_dmic_dailinks(card, &dai_links, &be_id); - if (ret) - goto err_end; - } + if (dmic_num) { + ret = create_dmic_dailinks(card, &dai_links, &be_id); + if (ret) + goto err_end; } /* HDMI */ From patchwork Tue Aug 27 12:32:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13779465 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 35AE21BCA18 for ; Tue, 27 Aug 2024 12:32:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761968; cv=none; b=E01W2uFZxftEepZ+MtzZdaD72FEPSZF1YG0JfIhffQ4LSYMjTiICmLuYWGUl0sQ43xo6vR0YgFOJRaNwtu+akgyf6kIc/AHoajci7eEyt3TOZPms9kvUd6cpxqKrVlqBhXPdqBJh3PG2MBd8ecdGgwX6qkA3PEalnwxK+RC/W7Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761968; c=relaxed/simple; bh=hyKMyMBXgP+b4y3sT/vY+bGBaq0hxImDrTq+DdJRA5g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oRl7QpHo2ePj01nORbxUtDr2uj23biB9PAJbRkgdRLIplx+/1StTFMYQuQKkMwlxVshJXJI6x7/QBpg7TORyJAefdCmyAW0OAYYt4ez1CL1RFM5EJR2NYxtqe4h9do2GTNqmG4/ySqglWkC9v3Tib5Sz8dsWT9oaiMH12s+6JnY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=IUAEftX2; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="IUAEftX2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724761967; x=1756297967; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hyKMyMBXgP+b4y3sT/vY+bGBaq0hxImDrTq+DdJRA5g=; b=IUAEftX2KySJJavW3xncgcGsnRRZBAnBRYkvUuTeYP8oin8BoYNxzFa/ YC4VwbVp7RAcPuKnjwiU6JekAOXRxUuBDXEjdgK8FRTzzTU58wnDD0RhW 93GhX6DBkbGxa9lzIcTSDKAzhv1LCcDOvT/WMEkO3POA+ritRhPuEgmqa zaByd0D+hyhvVE2ma146hhdWjeKqbHA6OxqWFL9dqaACVj4xGjj/qJOqS oker1xO82Zdi2b6tUsvBkEmZBdtlHEeyNu0NV4jDicABN9Vst3skbjmEG ncawpWw4IdFg/qHOD3KjKf6qlAKHyailYvFgkm3JaU/WH32Bq11bfi7D2 g==; X-CSE-ConnectionGUID: IqtLkRXNTZmllIkTzZ8qqg== X-CSE-MsgGUID: BdDjyJRKTbGF3IJVA4zG7g== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="13235507" X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="13235507" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:47 -0700 X-CSE-ConnectionGUID: IkFkjXHtT/6Z/L+tJ/H0og== X-CSE-MsgGUID: 2wwyy7ccSZmyfSXnSdQjhQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="62676792" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.118.39]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:45 -0700 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: linux-sound@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, peter.ujfalusi@linux.intel.com Subject: [PATCH v2 07/17] ASoC: Intel: sof_sdw: overwrite mach_params->dmic_num Date: Tue, 27 Aug 2024 20:32:05 +0800 Message-ID: <20240827123215.258859-8-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> References: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 mach_params->dmic_num will be used to set the cfg-mics value of card->components string. Overwrite it to the actual number of PCH DMICs used in the device. Signed-off-by: Bard Liao Reviewed-by: Pierre-Louis Bossart --- sound/soc/intel/boards/sof_sdw.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index 3781a27bfbed..b06948c16b3f 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -1108,6 +1108,11 @@ static int sof_card_dai_links_create(struct snd_soc_card *card) else dmic_num = 2; } + /* + * mach_params->dmic_num will be used to set the cfg-mics value of card->components + * string. Overwrite it to the actual number of PCH DMICs used in the device. + */ + mach_params->dmic_num = dmic_num; if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT) bt_num = 1; From patchwork Tue Aug 27 12:32:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13779466 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 210571BCA1A for ; Tue, 27 Aug 2024 12:32:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761971; cv=none; b=CQNsACYdTHX3i4naq7afvwd9YuzcycRP3dsFDziojaYDv4xCa+lr2RmlrICbToPGTjvmm6IqX5ZxC+jx4vqvKEP6VcSJKduyFOER26kdandk6OyLC+rLFeeZx9ITqBRNRrvC3eATKiQ80xbr/Y5iXwA5wNK4MoAFb2OXXZNvlIE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761971; c=relaxed/simple; bh=hrgIBF/kjLvhxqduTdBGm06GdC1+j5ttVo4QAvRMuDU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=H7TP5awdFb2sO4YAQRccM8XdTPhtegHoiXdc5JbA3XBJ+af/Gax4CuJ4LozHAo2Hr91xmdDLIBDK4uhKwhjL+dtHEFAKDsUUEadF2GdTDTS8Dv2uZ1YuGTM/a1zhVp00jftUQkhNERrO8WYT19J3uRx3An9pNUsx2K7JFaasXHk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=RMDEfYZ6; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="RMDEfYZ6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724761970; x=1756297970; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hrgIBF/kjLvhxqduTdBGm06GdC1+j5ttVo4QAvRMuDU=; b=RMDEfYZ6/Vz/kW2dCqqRMo9CnkdjEDLBJxnsSw5LHbouUfbEzZdF0ilA 95NV8he806+RtY4nUGmudAtBK21RMjz4+V9R3rtEPLqgX2Iso6nqxYXQ6 2Tps8ixAdWSsfgsBwppiDBkk8RxTDGW/8px1DAdUVYroj5YMq6DznTfgN RjCJs/RKp2edtNYKIz+QPxtZAzWrUDgMzx6DsxAJqwn/vIUjf2XPcRtfI jYRKTxi4iZy+zIdBQAEYIpEtowfyvWrFIw/xRxz0wIL1pZgb3ulljw3Fv kbQx1JBg/30q2kHO7c699p2UoORsGkp8xHlEdOUXxk8mT6yqVp92RLpy/ g==; X-CSE-ConnectionGUID: ptRw9K0TQ2uNwlRD6FVxYw== X-CSE-MsgGUID: AYU/k0mlS5KdmxlJXogSeA== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="13235510" X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="13235510" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:50 -0700 X-CSE-ConnectionGUID: V2xfCT2HQ8yTu99QTiXuSQ== X-CSE-MsgGUID: zzFtQVeQSUW2cSlDruUJmQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="62676795" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.118.39]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:47 -0700 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: linux-sound@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, peter.ujfalusi@linux.intel.com Subject: [PATCH v2 08/17] ASoC: SOF: Intel: hda: support BT link mask in mach_params Date: Tue, 27 Aug 2024 20:32:06 +0800 Message-ID: <20240827123215.258859-9-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> References: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Brent Lu Add an new variable bt_link_mask to snd_soc_acpi_mach_params structure. SSP port mask of BT offload found in NHLT table will be sent to machine driver to setup BE dai link with correct SSP port number. This patch only detects and enables the BT dailink. The functionality will only be unlocked with a topology file that makes a reference to that BT dailink. For backwards-compatibility reasons, this topology will not be used by default. Chromebooks and Linux users willing to experiment shall use the tplg_name kernel parameter to force the use of an enhanced topology. Signed-off-by: Brent Lu Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- include/sound/soc-acpi.h | 2 ++ sound/soc/sof/intel/hda.c | 37 ++++++++++++++++++++++++++++++++----- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h index b6d301946244..c1552bc6e31c 100644 --- a/include/sound/soc-acpi.h +++ b/include/sound/soc-acpi.h @@ -73,6 +73,7 @@ static inline struct snd_soc_acpi_mach *snd_soc_acpi_codec_list(void *arg) * @subsystem_rev: optional PCI SSID revision value * @subsystem_id_set: true if a value has been written to * subsystem_vendor and subsystem_device. + * @bt_link_mask: BT offload link enabled on the board */ struct snd_soc_acpi_mach_params { u32 acpi_ipc_irq_index; @@ -89,6 +90,7 @@ struct snd_soc_acpi_mach_params { unsigned short subsystem_device; unsigned short subsystem_rev; bool subsystem_id_set; + u32 bt_link_mask; }; /** diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 2f24b5abc91b..d0a41e8e6334 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -444,6 +444,10 @@ static int mclk_id_override = -1; module_param_named(mclk_id, mclk_id_override, int, 0444); MODULE_PARM_DESC(mclk_id, "SOF SSP mclk_id"); +static int bt_link_mask_override; +module_param_named(bt_link_mask, bt_link_mask_override, int, 0444); +MODULE_PARM_DESC(bt_link_mask, "SOF BT offload link mask"); + static int hda_init(struct snd_sof_dev *sdev) { struct hda_bus *hbus; @@ -529,7 +533,7 @@ static int check_dmic_num(struct snd_sof_dev *sdev) return dmic_num; } -static int check_nhlt_ssp_mask(struct snd_sof_dev *sdev) +static int check_nhlt_ssp_mask(struct snd_sof_dev *sdev, u8 device_type) { struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; struct nhlt_acpi_table *nhlt; @@ -540,9 +544,11 @@ static int check_nhlt_ssp_mask(struct snd_sof_dev *sdev) return ssp_mask; if (intel_nhlt_has_endpoint_type(nhlt, NHLT_LINK_SSP)) { - ssp_mask = intel_nhlt_ssp_endpoint_mask(nhlt, NHLT_DEVICE_I2S); + ssp_mask = intel_nhlt_ssp_endpoint_mask(nhlt, device_type); if (ssp_mask) - dev_info(sdev->dev, "NHLT_DEVICE_I2S detected, ssp_mask %#x\n", ssp_mask); + dev_info(sdev->dev, "NHLT device %s(%d) detected, ssp_mask %#x\n", + device_type == NHLT_DEVICE_BT ? "BT" : "I2S", + device_type, ssp_mask); } return ssp_mask; @@ -1235,8 +1241,29 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev) * Otherwise, set certain mach params. */ hda_generic_machine_select(sdev, &mach); - if (!mach) + if (!mach) { dev_warn(sdev->dev, "warning: No matching ASoC machine driver found\n"); + return NULL; + } + + /* report BT offload link mask to machine driver */ + mach->mach_params.bt_link_mask = check_nhlt_ssp_mask(sdev, NHLT_DEVICE_BT); + + dev_info(sdev->dev, "BT link detected in NHLT tables: %#x\n", + mach->mach_params.bt_link_mask); + + /* allow for module parameter override */ + if (bt_link_mask_override) { + dev_dbg(sdev->dev, "overriding BT link detected in NHLT tables %#x by kernel param %#x\n", + mach->mach_params.bt_link_mask, bt_link_mask_override); + mach->mach_params.bt_link_mask = bt_link_mask_override; + } + + if (hweight_long(mach->mach_params.bt_link_mask) > 1) { + dev_warn(sdev->dev, "invalid BT link mask %#x found, reset the mask\n", + mach->mach_params.bt_link_mask); + mach->mach_params.bt_link_mask = 0; + } /* * Fixup tplg file name by appending dmic num, ssp num, codec/amplifier @@ -1312,7 +1339,7 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev) } /* report SSP link mask to machine driver */ - mach->mach_params.i2s_link_mask = check_nhlt_ssp_mask(sdev); + mach->mach_params.i2s_link_mask = check_nhlt_ssp_mask(sdev, NHLT_DEVICE_I2S); if (tplg_fixup && mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER && From patchwork Tue Aug 27 12:32:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13779467 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5CDB1BCA1A for ; Tue, 27 Aug 2024 12:32:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761974; cv=none; b=Qc8d3JjaaCHFAQxvVsuJ1KgRwl2uRrLqyULK6qjJ73hTSsvzDQasN3XgIqtFmp02JsYyj386idKDd/fWoE9fLZgkJXKGCXQ8IxOjzXGw9her25L8BHTYUGWDefpDlCfelJ1wKY6mwFwxiq3uw8DKBjsgC15MdgIE/tw1J0UGDSM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761974; c=relaxed/simple; bh=EX9HX0gv6nW7PHCmwnHtkTIRS7HVRSkeFAqkJsRhKIQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pi69t491sEBfgBHzeOqcGRyAW1yG0KTvZkcjw6+RIR+89dhTMd4aGWe0Bk2TRPh/hFFWl2SkKi/2cBkruOCxAvsbXQdyVq2NODNFNfB8/VvfMqtIQ/SOKNfy8zKk76wpSQ57U6hUoxs/tecfhhWMYP9eXK/rDs832n3RhGs7wdI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ienqbIsr; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ienqbIsr" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724761973; x=1756297973; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EX9HX0gv6nW7PHCmwnHtkTIRS7HVRSkeFAqkJsRhKIQ=; b=ienqbIsrGKduBZlzeFS6hIQgov/gF4/Go3+X21hyKBGZZLW2FuEgxoih UdttyPLZ6g16QHUULG/jN8ZW5qqyB6AArsxrvdSGmcRD6YE320BnubZA0 xHaoWcFnh73BCxanoVFIRmxt7NSnJ18zLJkuQaxB54YHFzgPMER4/X6mc 3bBXTKpjQTMkSudizTRcs4TXQsopy/M8W7F4IWmtjdlXHrAibJuajxQSu VNMorEiQVl62c1ETZnrm/Td4cn+jSvX07M3fcS/x2eWAMcpMPlJRKdLfT C1CwUwVyjenjQnY/cJfMpnMuo/EbAGrqoItBQ7SYmXY2fNDASU7bsTavh Q==; X-CSE-ConnectionGUID: Mrz8Vg7MRjW97lZGbhQ2Ow== X-CSE-MsgGUID: PXFUilfTQ2qA8gUPWKGlyw== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="13235513" X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="13235513" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:52 -0700 X-CSE-ConnectionGUID: uOEfNp/aQfSD8uDw329uww== X-CSE-MsgGUID: Psrfl/pSS1S4HrZ/OX59qQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="62676799" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.118.39]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:50 -0700 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: linux-sound@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, peter.ujfalusi@linux.intel.com Subject: [PATCH v2 09/17] ASoC: Intel: skl_hda_dsp_generic: support BT audio offload Date: Tue, 27 Aug 2024 20:32:07 +0800 Message-ID: <20240827123215.258859-10-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> References: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Brent Lu Add BT offload BE link to dai link array if the BT offload link mask is valid (only one bit set). Signed-off-by: Brent Lu Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- sound/soc/intel/boards/skl_hda_dsp_common.c | 13 +++++++ sound/soc/intel/boards/skl_hda_dsp_common.h | 4 ++- sound/soc/intel/boards/skl_hda_dsp_generic.c | 37 +++++++++++++++++--- 3 files changed, 49 insertions(+), 5 deletions(-) diff --git a/sound/soc/intel/boards/skl_hda_dsp_common.c b/sound/soc/intel/boards/skl_hda_dsp_common.c index e9cefa4ae56d..5eb63f4df241 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_common.c +++ b/sound/soc/intel/boards/skl_hda_dsp_common.c @@ -75,6 +75,11 @@ SND_SOC_DAILINK_DEF(dmic_codec, SND_SOC_DAILINK_DEF(dmic16k, DAILINK_COMP_ARRAY(COMP_CPU("DMIC16k Pin"))); +SND_SOC_DAILINK_DEF(bt_offload_pin, + DAILINK_COMP_ARRAY(COMP_CPU(""))); /* initialized in driver probe function */ +SND_SOC_DAILINK_DEF(dummy, + DAILINK_COMP_ARRAY(COMP_DUMMY())); + SND_SOC_DAILINK_DEF(platform, DAILINK_COMP_ARRAY(COMP_PLATFORM("0000:00:1f.3"))); @@ -132,6 +137,14 @@ struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS] = { .no_pcm = 1, SND_SOC_DAILINK_REG(dmic16k, dmic_codec, platform), }, + { + .name = NULL, /* initialized in driver probe function */ + .id = 8, + .dpcm_playback = 1, + .dpcm_capture = 1, + .no_pcm = 1, + SND_SOC_DAILINK_REG(bt_offload_pin, dummy, platform), + }, }; int skl_hda_hdmi_jack_init(struct snd_soc_card *card) diff --git a/sound/soc/intel/boards/skl_hda_dsp_common.h b/sound/soc/intel/boards/skl_hda_dsp_common.h index 19b814dee4ad..9d714f747dca 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_common.h +++ b/sound/soc/intel/boards/skl_hda_dsp_common.h @@ -18,7 +18,7 @@ #include "../../codecs/hdac_hda.h" #include "hda_dsp_common.h" -#define HDA_DSP_MAX_BE_DAI_LINKS 7 +#define HDA_DSP_MAX_BE_DAI_LINKS 8 struct skl_hda_hdmi_pcm { struct list_head head; @@ -35,6 +35,8 @@ struct skl_hda_private { const char *platform_name; bool common_hdmi_codec_drv; bool idisp_codec; + bool bt_offload_present; + int ssp_bt; }; extern struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS]; diff --git a/sound/soc/intel/boards/skl_hda_dsp_generic.c b/sound/soc/intel/boards/skl_hda_dsp_generic.c index 88d91c0280bb..927c73bef065 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_generic.c +++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c @@ -95,6 +95,7 @@ skl_hda_add_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *link) #define IDISP_DAI_COUNT 3 #define HDAC_DAI_COUNT 2 #define DMIC_DAI_COUNT 2 +#define BT_DAI_COUNT 1 /* there are two routes per iDisp output */ #define IDISP_ROUTE_COUNT (IDISP_DAI_COUNT * 2) @@ -102,11 +103,12 @@ skl_hda_add_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *link) #define HDA_CODEC_AUTOSUSPEND_DELAY_MS 1000 -static int skl_hda_fill_card_info(struct snd_soc_card *card, +static int skl_hda_fill_card_info(struct device *dev, struct snd_soc_card *card, struct snd_soc_acpi_mach_params *mach_params) { struct skl_hda_private *ctx = snd_soc_card_get_drvdata(card); struct snd_soc_dai_link *dai_link; + struct snd_soc_dai_link *bt_link; u32 codec_count, codec_mask; int i, num_links, num_route; @@ -120,7 +122,7 @@ static int skl_hda_fill_card_info(struct snd_soc_card *card, if (codec_mask == IDISP_CODEC_MASK) { /* topology with iDisp as the only HDA codec */ - num_links = IDISP_DAI_COUNT + DMIC_DAI_COUNT; + num_links = IDISP_DAI_COUNT + DMIC_DAI_COUNT + BT_DAI_COUNT; num_route = IDISP_ROUTE_COUNT; /* @@ -129,7 +131,7 @@ static int skl_hda_fill_card_info(struct snd_soc_card *card, * num_links of dai links need to be registered * to ASoC. */ - for (i = 0; i < DMIC_DAI_COUNT; i++) { + for (i = 0; i < (DMIC_DAI_COUNT + BT_DAI_COUNT); i++) { skl_hda_be_dai_links[IDISP_DAI_COUNT + i] = skl_hda_be_dai_links[IDISP_DAI_COUNT + HDAC_DAI_COUNT + i]; @@ -150,6 +152,28 @@ static int skl_hda_fill_card_info(struct snd_soc_card *card, } } + if (!ctx->bt_offload_present) { + /* remove last link since bt audio offload is not supported */ + num_links -= BT_DAI_COUNT; + } else { + if (codec_mask == IDISP_CODEC_MASK) + bt_link = &skl_hda_be_dai_links[IDISP_DAI_COUNT + DMIC_DAI_COUNT]; + else + bt_link = &skl_hda_be_dai_links[IDISP_DAI_COUNT + HDAC_DAI_COUNT + DMIC_DAI_COUNT]; + + /* complete the link name and dai name with SSP port number */ + bt_link->name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-BT", + ctx->ssp_bt); + if (!bt_link->name) + return -ENOMEM; + + bt_link->cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, + "SSP%d Pin", + ctx->ssp_bt); + if (!bt_link->cpus->dai_name) + return -ENOMEM; + } + card->num_links = num_links; card->num_dapm_routes = num_route; @@ -213,7 +237,12 @@ static int skl_hda_audio_probe(struct platform_device *pdev) snd_soc_card_set_drvdata(card, ctx); - ret = skl_hda_fill_card_info(card, &mach->mach_params); + if (hweight_long(mach->mach_params.bt_link_mask) == 1) { + ctx->bt_offload_present = true; + ctx->ssp_bt = fls(mach->mach_params.bt_link_mask) - 1; + } + + ret = skl_hda_fill_card_info(&pdev->dev, card, &mach->mach_params); if (ret < 0) { dev_err(&pdev->dev, "Unsupported HDAudio/iDisp configuration found\n"); return ret; From patchwork Tue Aug 27 12:32:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13779468 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 898DC1BC076 for ; Tue, 27 Aug 2024 12:32:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761977; cv=none; b=rl6w1yefBhQMc0NoverwhtrIStMs4Jv4lVwWWg2FGE5c+EpBVWCgHBXpPVMm8NhFXsc8drJ9th4dZqURfF+llvIs9Xj/dfnVrA4OL1hvS2bI0DTTWfNPmh2SCdjYvyI1C5LPZUmZsQI+2cLv9Z0uog6Kz9zbzoIHC1Rgl9/r2ps= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761977; c=relaxed/simple; bh=Mh88cm8V9fupie2apx+3RJbcBNZQHonK0QsbemxPlXU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=reiRAV2nMi2CkN9lRIAVlvsf+QbFfyZGi9bZLl4qaXonF+V12GEfgso/uvI6tQWrB3rXNsyQOrUpVkXSaEIeYLKUPlhLgVwLvtwmaOtB6YhWXjRkESN1JjFYgxLNrdl20fVoG+jhjz2fUPmbCI1Ct2vOPctZ2R49DlwTRkBExOU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Wgzwhg3D; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Wgzwhg3D" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724761975; x=1756297975; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Mh88cm8V9fupie2apx+3RJbcBNZQHonK0QsbemxPlXU=; b=Wgzwhg3DQDI3C9bOPp+XE9Ot/WXwpcBc3iIZP54PjI33BwwN0dwzeZ4Y zEUOzQ9pLBfDgurpU7cE3BFSnab4cw1VFNDv87+y8rc4e0U80pQ6mG4NR Y5cZzf9sZZCpTZ13bc54SQGAiBERIfXP+XiAiZ4RQk6vJ3/D0TQQPDc4a aLTc4qWvXmEKpsyQtGf27ciEBCjfORoHo7mzknLoaxrVD3USPivzy+Cl0 Hq5DCPZLbZGsBM+D9F+06mZfMIUyhO7vXfLKYxmWw4YyMTbL/AqZ19H7r Rrec7RS8GiVRCzywi6o+ERZQjuGYwZGiI6P4nkFfH1aq+fSbpx1kr+3iL Q==; X-CSE-ConnectionGUID: quV0cwuwRcSLI58pM8KXNA== X-CSE-MsgGUID: 7YtFlxEnQ1mbA9L5BXHE4g== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="13235516" X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="13235516" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:55 -0700 X-CSE-ConnectionGUID: LAa1rJxrTH6ztjZ63cK7Ag== X-CSE-MsgGUID: +gpkA7SNQ6Sclrlf7KapnQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="62676802" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.118.39]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:52 -0700 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: linux-sound@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, peter.ujfalusi@linux.intel.com Subject: [PATCH v2 10/17] ASoC: Intel: soc-acpi: Add entry for sof_es8336 in ARL match table. Date: Tue, 27 Aug 2024 20:32:08 +0800 Message-ID: <20240827123215.258859-11-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> References: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Balamurugan C Adding ES83x6 codec support for ARL platforms and entry in match table. Signed-off-by: Balamurugan C Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- sound/soc/intel/common/soc-acpi-intel-arl-match.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sound/soc/intel/common/soc-acpi-intel-arl-match.c b/sound/soc/intel/common/soc-acpi-intel-arl-match.c index cc87c34e5a08..304f974dc960 100644 --- a/sound/soc/intel/common/soc-acpi-intel-arl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-arl-match.c @@ -95,7 +95,20 @@ static const struct snd_soc_acpi_link_adr arl_sdca_rvp[] = { {} }; +static const struct snd_soc_acpi_codecs arl_essx_83x6 = { + .num_codecs = 3, + .codecs = { "ESSX8316", "ESSX8326", "ESSX8336"}, +}; + struct snd_soc_acpi_mach snd_soc_acpi_intel_arl_machines[] = { + { + .comp_ids = &arl_essx_83x6, + .drv_name = "sof-essx8336", + .sof_tplg_filename = "sof-arl-es8336", /* the tplg suffix is added at run time */ + .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER | + SND_SOC_ACPI_TPLG_INTEL_SSP_MSB | + SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER, + }, {}, }; EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_arl_machines); From patchwork Tue Aug 27 12:32:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13779469 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0EF041C460D for ; Tue, 27 Aug 2024 12:32:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761980; cv=none; b=lDQz9Zh//J9at+nKD7c+cu9w6akyfUtbB9mSX23pnyTt7N2nYSCbniHIVaaw5X3LTgs9lEClb7ATEshMF2+kyTKgedmNZ1JZo5hxzpUbdvMXia6QO5Vlep8sHpL0keKaS0n65N2RkK0cKtruiYiJa7QasF/pwRpmlRFgLYXZXto= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761980; c=relaxed/simple; bh=PxL0aMKSvwXL//qeHZymFfYwo3xE8toXcHBVq72XSEQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PofEkWMXtvDZYyewq/FhZOhXtQch37xj41Ozd8bvLSUs9xyjuTO57as0seZheGwVHCrTmriNARizC8+ygE7eeBDHS2OeBiOZ3zvPqu9/K+EzAIGuFqBrtCX1mdwxPbfQqe+tqygkFCeIZolDOk2wkmn4zqtMCxh09j5wAe6xH3w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=nrBLw5IK; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="nrBLw5IK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724761978; x=1756297978; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PxL0aMKSvwXL//qeHZymFfYwo3xE8toXcHBVq72XSEQ=; b=nrBLw5IKUa3qJpUI1El8anDJXQDD/Gsjo2Q9i1RqjKGqWR3a09QsHlo9 wS+xOKAGP3o8+zvUWrk5zn7Tzk7IL0tkbyxnnrkL9mpFGLbt8HgloT+XJ CCYRJdIP0PkOmSYm/3FBSZywzr9qw3jksdOA/m4Ih2hDCubjGSnGffcYi wG94zowUlSoMIF6/aJTclljCEp8LlnOm7WBpWWukX6Cr1tg4P/fNcTf/b nj2sdEOtMXLYr6xfAogmilOs1/JYlLzrrHPZh+YWTZUi4DXPB01ogMJZQ KeNd4tPDLp/0DLs1xOb3NNpClHlc4wj775LhmvlatmBVrhJaAoSs6HB1v Q==; X-CSE-ConnectionGUID: 9bw22gxTQYqQjz55K/Tn+A== X-CSE-MsgGUID: 43pTvnVARFOfwTWsX8KA/g== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="13235519" X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="13235519" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:57 -0700 X-CSE-ConnectionGUID: cuHP9bCQQnaqq3SwPkod9g== X-CSE-MsgGUID: 7QhAf8jtRhG7r1nTiiIRuQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="62676807" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.118.39]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:55 -0700 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: linux-sound@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, peter.ujfalusi@linux.intel.com Subject: [PATCH v2 11/17] ASoC: Intel: soc-acpi: Add entry for HDMI_In capture support in ARL match table Date: Tue, 27 Aug 2024 20:32:09 +0800 Message-ID: <20240827123215.258859-12-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> References: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Balamurugan C Adding HDMI-In capture via I2S feature support in ARL platform. Signed-off-by: Balamurugan C Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- sound/soc/intel/boards/sof_es8336.c | 10 ++++++++++ sound/soc/intel/common/soc-acpi-intel-arl-match.c | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/sound/soc/intel/boards/sof_es8336.c b/sound/soc/intel/boards/sof_es8336.c index b45d0501f109..578271b4230a 100644 --- a/sound/soc/intel/boards/sof_es8336.c +++ b/sound/soc/intel/boards/sof_es8336.c @@ -818,6 +818,16 @@ static const struct platform_device_id board_ids[] = { SOF_ES8336_SPEAKERS_EN_GPIO1_QUIRK | SOF_ES8336_JD_INVERTED), }, + { + .name = "arl_es83x6_c1_h02", + .driver_data = (kernel_ulong_t)(SOF_ES8336_SSP_CODEC(1) | + SOF_NO_OF_HDMI_CAPTURE_SSP(2) | + SOF_HDMI_CAPTURE_1_SSP(0) | + SOF_HDMI_CAPTURE_2_SSP(2) | + SOF_SSP_HDMI_CAPTURE_PRESENT | + SOF_ES8336_SPEAKERS_EN_GPIO1_QUIRK | + SOF_ES8336_JD_INVERTED), + }, { } }; MODULE_DEVICE_TABLE(platform, board_ids); diff --git a/sound/soc/intel/common/soc-acpi-intel-arl-match.c b/sound/soc/intel/common/soc-acpi-intel-arl-match.c index 304f974dc960..8f69d61ea39c 100644 --- a/sound/soc/intel/common/soc-acpi-intel-arl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-arl-match.c @@ -100,7 +100,19 @@ static const struct snd_soc_acpi_codecs arl_essx_83x6 = { .codecs = { "ESSX8316", "ESSX8326", "ESSX8336"}, }; +static const struct snd_soc_acpi_codecs arl_lt6911_hdmi = { + .num_codecs = 1, + .codecs = {"INTC10B0"} +}; + struct snd_soc_acpi_mach snd_soc_acpi_intel_arl_machines[] = { + { + .comp_ids = &arl_essx_83x6, + .drv_name = "arl_es83x6_c1_h02", + .machine_quirk = snd_soc_acpi_codec_list, + .quirk_data = &arl_lt6911_hdmi, + .sof_tplg_filename = "sof-arl-es83x6-ssp1-hdmi-ssp02.tplg", + }, { .comp_ids = &arl_essx_83x6, .drv_name = "sof-essx8336", From patchwork Tue Aug 27 12:32:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13779470 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 97F751C460D for ; Tue, 27 Aug 2024 12:33:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761982; cv=none; b=on3hvbP0wwDgZD2bgkaqm/00TrW8faOtBP05hF+RV/2HqS9eqK905F34BRMSJb8WxtVGbHYkPy7kfrn30O/pu7hCp3c/lzmLBW4Q4WaSbaj0ulM3nAMaCN0Z9ajIH2pbfeT1HvCFR9vbKXK8klJQ8lLCoGw18lLMYXcG9Y/WKW0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761982; c=relaxed/simple; bh=GAXssEYxSMcqOuV3uPxRaPmNeAofcYK9DNL5VOOEe84=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TV+h3nU6jadPaFmlKbya7BUXBqhe31IFSTa8pv1X3AGdtJe6wNfTzOEtQMn8pumBfyA2KHQywzF+WE80ky8b6Wven9oAHNGbqruRX+IE0hQrOUqLXpmR7al6Eatmvzcd4hG5rxW74dlejidP5dqspAGySoG0zOGUiVJ30431GRs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=WwGZCS8L; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="WwGZCS8L" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724761980; x=1756297980; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GAXssEYxSMcqOuV3uPxRaPmNeAofcYK9DNL5VOOEe84=; b=WwGZCS8LhTWJKe03Off807ccFpPp0w04yC0Y7OiDsD3+E1/fU7eXHaBR 6XJR+jBgaZkrrViSV7JF1YPm+/AA50iB8e+Qwdk5KW8PtevjEjhACBQKg jaYqvR6+fOS3eBtg2ujpl797EXyd4VVtzvvvSP5KumX32kyXsHl8xLypj mBrrHwB1aZl1A07ofrX36L9Lgw6BtarxmGMOwMISUKNb6+Y+ylep4sE8s VGBoxYQC64yq8TLlqeTeqWaMTjCCPa9hmHQzmSK0Vk5edGBeIHFkkASiL RA0WQgs/x4saSos+1hk044Yzu26O5S9fXHQQY8nGI1akTQG/whJfvPGXh g==; X-CSE-ConnectionGUID: e7RQsisKQwCLGMO7OzFtYQ== X-CSE-MsgGUID: FVGgmBv4QH2QdUlZAkp5+w== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="13235522" X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="13235522" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:33:00 -0700 X-CSE-ConnectionGUID: LD9MG9KuQm6G9lt1xXTvzw== X-CSE-MsgGUID: eTZ1asK4RxeeJ9r+26WIcA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="62676814" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.118.39]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:32:58 -0700 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: linux-sound@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, peter.ujfalusi@linux.intel.com Subject: [PATCH v2 12/17] ASoC: Intel: skl_hda_dsp_generic: remove hdac-hdmi support Date: Tue, 27 Aug 2024 20:32:10 +0800 Message-ID: <20240827123215.258859-13-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> References: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Brent Lu Since this machine driver has no longer been enumerated by SKL platform driver, we could remove hdac-hdmi support code just like what we did to other SOF machine drivers. Signed-off-by: Brent Lu Reviewed-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Signed-off-by: Bard Liao --- sound/soc/intel/boards/Kconfig | 1 - sound/soc/intel/boards/skl_hda_dsp_common.c | 32 +++++--------------- sound/soc/intel/boards/skl_hda_dsp_common.h | 26 ---------------- sound/soc/intel/boards/skl_hda_dsp_generic.c | 8 +---- 4 files changed, 9 insertions(+), 58 deletions(-) diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig index 1141fe1263ce..793a9170513a 100644 --- a/sound/soc/intel/boards/Kconfig +++ b/sound/soc/intel/boards/Kconfig @@ -305,7 +305,6 @@ if SND_SOC_SOF_HDA_AUDIO_CODEC config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH tristate "Skylake+ with HDA Codecs" depends on SND_HDA_CODEC_HDMI - select SND_SOC_HDAC_HDMI select SND_SOC_INTEL_HDA_DSP_COMMON select SND_SOC_DMIC # SND_SOC_HDAC_HDA is already selected diff --git a/sound/soc/intel/boards/skl_hda_dsp_common.c b/sound/soc/intel/boards/skl_hda_dsp_common.c index 5eb63f4df241..d1de772e9304 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_common.c +++ b/sound/soc/intel/boards/skl_hda_dsp_common.c @@ -11,7 +11,6 @@ #include #include #include -#include "../../codecs/hdac_hdmi.h" #include "skl_hda_dsp_common.h" #include @@ -35,7 +34,6 @@ int skl_hda_hdmi_add_pcm(struct snd_soc_card *card, int device) if (!pcm->codec_dai) return -EINVAL; - pcm->device = device; list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); return 0; @@ -150,32 +148,18 @@ struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS] = { int skl_hda_hdmi_jack_init(struct snd_soc_card *card) { struct skl_hda_private *ctx = snd_soc_card_get_drvdata(card); - struct snd_soc_component *component = NULL; + struct snd_soc_component *component; struct skl_hda_hdmi_pcm *pcm; - char jack_name[NAME_SIZE]; - int err; - if (ctx->common_hdmi_codec_drv) - return skl_hda_hdmi_build_controls(card); - - list_for_each_entry(pcm, &ctx->hdmi_pcm_list, head) { - component = pcm->codec_dai->component; - snprintf(jack_name, sizeof(jack_name), - "HDMI/DP, pcm=%d Jack", pcm->device); - err = snd_soc_card_jack_new(card, jack_name, - SND_JACK_AVOUT, &pcm->hdmi_jack); - - if (err) - return err; - - err = hdac_hdmi_jack_init(pcm->codec_dai, pcm->device, - &pcm->hdmi_jack); - if (err < 0) - return err; - } + /* HDMI disabled, do not create controls */ + if (list_empty(&ctx->hdmi_pcm_list)) + return 0; + pcm = list_first_entry(&ctx->hdmi_pcm_list, struct skl_hda_hdmi_pcm, + head); + component = pcm->codec_dai->component; if (!component) return -EINVAL; - return hdac_hdmi_jack_port_init(component, &card->dapm); + return hda_dsp_hdmi_build_controls(card, component); } diff --git a/sound/soc/intel/boards/skl_hda_dsp_common.h b/sound/soc/intel/boards/skl_hda_dsp_common.h index 9d714f747dca..8455f953f4b8 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_common.h +++ b/sound/soc/intel/boards/skl_hda_dsp_common.h @@ -23,8 +23,6 @@ struct skl_hda_hdmi_pcm { struct list_head head; struct snd_soc_dai *codec_dai; - struct snd_soc_jack hdmi_jack; - int device; }; struct skl_hda_private { @@ -33,7 +31,6 @@ struct skl_hda_private { int pcm_count; int dai_index; const char *platform_name; - bool common_hdmi_codec_drv; bool idisp_codec; bool bt_offload_present; int ssp_bt; @@ -43,27 +40,4 @@ extern struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS]; int skl_hda_hdmi_jack_init(struct snd_soc_card *card); int skl_hda_hdmi_add_pcm(struct snd_soc_card *card, int device); -/* - * Search card topology and register HDMI PCM related controls - * to codec driver. - */ -static inline int skl_hda_hdmi_build_controls(struct snd_soc_card *card) -{ - struct skl_hda_private *ctx = snd_soc_card_get_drvdata(card); - struct snd_soc_component *component; - struct skl_hda_hdmi_pcm *pcm; - - /* HDMI disabled, do not create controls */ - if (list_empty(&ctx->hdmi_pcm_list)) - return 0; - - pcm = list_first_entry(&ctx->hdmi_pcm_list, struct skl_hda_hdmi_pcm, - head); - component = pcm->codec_dai->component; - if (!component) - return -EINVAL; - - return hda_dsp_hdmi_build_controls(card, component); -} - #endif /* __SOUND_SOC_HDA_DSP_COMMON_H */ diff --git a/sound/soc/intel/boards/skl_hda_dsp_generic.c b/sound/soc/intel/boards/skl_hda_dsp_generic.c index 927c73bef065..860a21915bce 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_generic.c +++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c @@ -13,7 +13,6 @@ #include #include #include -#include "../../codecs/hdac_hdmi.h" #include "skl_hda_dsp_common.h" static const struct snd_soc_dapm_widget skl_hda_widgets[] = { @@ -208,7 +207,7 @@ static void skl_set_hda_codec_autosuspend_delay(struct snd_soc_card *card) static int skl_hda_audio_probe(struct platform_device *pdev) { - struct snd_soc_acpi_mach *mach; + struct snd_soc_acpi_mach *mach = pdev->dev.platform_data; struct skl_hda_private *ctx; struct snd_soc_card *card; int ret; @@ -221,10 +220,6 @@ static int skl_hda_audio_probe(struct platform_device *pdev) INIT_LIST_HEAD(&ctx->hdmi_pcm_list); - mach = pdev->dev.platform_data; - if (!mach) - return -EINVAL; - card = &ctx->card; card->name = "hda-dsp", card->owner = THIS_MODULE, @@ -251,7 +246,6 @@ static int skl_hda_audio_probe(struct platform_device *pdev) ctx->pcm_count = card->num_links; ctx->dai_index = 1; /* hdmi codec dai name starts from index 1 */ ctx->platform_name = mach->mach_params.platform; - ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv; card->dev = &pdev->dev; if (!snd_soc_acpi_sof_parent(&pdev->dev)) From patchwork Tue Aug 27 12:32:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13779471 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 399631C4621 for ; Tue, 27 Aug 2024 12:33:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761984; cv=none; b=e1970Bd94nd8hlznGs90c+FLB6EU6QEpYkswhOcByjCTl7fp7dNWn3tGPipopgbejYQtRDbealD1hwBgaktA2AggCMOqOmA7G/l6j7epCU9218+IdkA+zyJyOWhGJ20FNcZnKmqNgr6fYUvSFEDzn4U0+kqOswUnk85sCJXfUYU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761984; c=relaxed/simple; bh=wW/2pLJSjdZPh1qaw9OqI4sD1uYGY+4NcDSA8I0HQ5E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UyoxrkZt+dn/2FpaLsQi/YhGGA22Mw0A1QSnb7FCN+T4mSMrKhp7Bj5vVVEMR1XTO18ko2IM8F9EVd8MBMhxNSVDZlTcE4LIVCUgOu9dONRQmMyRDLyNTfUHeiZt5QejPtBx2BAzFuFFDEnGC7WfVSrf66jhoBr6duaG0inJLKY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=bcb/PPZ8; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="bcb/PPZ8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724761983; x=1756297983; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wW/2pLJSjdZPh1qaw9OqI4sD1uYGY+4NcDSA8I0HQ5E=; b=bcb/PPZ8s+rlDcIi2otp7mKUEWjOA473pjn5bXVOXpqNcvaCrDl6D+k1 h4CDAtYAfXU7HZAPAWg6e5F6mlEaFDhe8jXbNvUnqml9rs5oeBw+O95Gp UAWuFN/CiVrhHKqOpkwg+pb+xHlW9vTYY5W7OiGgGMqfYE26HMekPZSu5 0+arfQjvfuA2FiMHLst0E0K4QC3oCT4n4lqocrNFi+Dj4lzvSrmcWXk/e 91SCpf+ea0bhCPH5It2ZIJmIbTpTQ3zCmT3Nfmh3EI1g34EkDUXiF30/P BF7GCcWg3vS6f8kHkqJVGLKv11Gq63TAqIpZCVpUs1jRkJvTuorw2m9U0 g==; X-CSE-ConnectionGUID: 2hMooHa4SZOHd08I+2yADQ== X-CSE-MsgGUID: uBxFKwnqSXi6rRmuKJty0Q== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="13235525" X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="13235525" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:33:03 -0700 X-CSE-ConnectionGUID: BBoBJOAdSVSFu3D2ReRO5Q== X-CSE-MsgGUID: Kuj6TxfsSXmL4K/03EscMA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="62676823" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.118.39]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:33:00 -0700 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: linux-sound@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, peter.ujfalusi@linux.intel.com Subject: [PATCH v2 13/17] ASoC: Intel: skl_hda_dsp_generic: use sof_hdmi_private to init HDMI Date: Tue, 27 Aug 2024 20:32:11 +0800 Message-ID: <20240827123215.258859-14-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> References: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Brent Lu Use sof_hdmi_private structure instead of a link list of skl_hda_hdmi_pcm structure for HDMI dai link initialization since hdac-hdmi support is removed. Signed-off-by: Brent Lu Reviewed-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Signed-off-by: Bard Liao --- sound/soc/intel/boards/skl_hda_dsp_common.c | 23 ++++++-------------- sound/soc/intel/boards/skl_hda_dsp_common.h | 9 ++------ sound/soc/intel/boards/skl_hda_dsp_generic.c | 13 +++++------ 3 files changed, 15 insertions(+), 30 deletions(-) diff --git a/sound/soc/intel/boards/skl_hda_dsp_common.c b/sound/soc/intel/boards/skl_hda_dsp_common.c index d1de772e9304..5019bdfa5b45 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_common.c +++ b/sound/soc/intel/boards/skl_hda_dsp_common.c @@ -21,20 +21,16 @@ int skl_hda_hdmi_add_pcm(struct snd_soc_card *card, int device) { struct skl_hda_private *ctx = snd_soc_card_get_drvdata(card); - struct skl_hda_hdmi_pcm *pcm; + struct snd_soc_dai *dai; char dai_name[NAME_SIZE]; - pcm = devm_kzalloc(card->dev, sizeof(*pcm), GFP_KERNEL); - if (!pcm) - return -ENOMEM; - snprintf(dai_name, sizeof(dai_name), "intel-hdmi-hifi%d", ctx->dai_index); - pcm->codec_dai = snd_soc_card_get_codec_dai(card, dai_name); - if (!pcm->codec_dai) + dai = snd_soc_card_get_codec_dai(card, dai_name); + if (!dai) return -EINVAL; - list_add_tail(&pcm->head, &ctx->hdmi_pcm_list); + ctx->hdmi.hdmi_comp = dai->component; return 0; } @@ -148,18 +144,13 @@ struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS] = { int skl_hda_hdmi_jack_init(struct snd_soc_card *card) { struct skl_hda_private *ctx = snd_soc_card_get_drvdata(card); - struct snd_soc_component *component; - struct skl_hda_hdmi_pcm *pcm; /* HDMI disabled, do not create controls */ - if (list_empty(&ctx->hdmi_pcm_list)) + if (!ctx->hdmi.idisp_codec) return 0; - pcm = list_first_entry(&ctx->hdmi_pcm_list, struct skl_hda_hdmi_pcm, - head); - component = pcm->codec_dai->component; - if (!component) + if (!ctx->hdmi.hdmi_comp) return -EINVAL; - return hda_dsp_hdmi_build_controls(card, component); + return hda_dsp_hdmi_build_controls(card, ctx->hdmi.hdmi_comp); } diff --git a/sound/soc/intel/boards/skl_hda_dsp_common.h b/sound/soc/intel/boards/skl_hda_dsp_common.h index 8455f953f4b8..40ffbccb2fe0 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_common.h +++ b/sound/soc/intel/boards/skl_hda_dsp_common.h @@ -17,21 +17,16 @@ #include #include "../../codecs/hdac_hda.h" #include "hda_dsp_common.h" +#include "sof_hdmi_common.h" #define HDA_DSP_MAX_BE_DAI_LINKS 8 -struct skl_hda_hdmi_pcm { - struct list_head head; - struct snd_soc_dai *codec_dai; -}; - struct skl_hda_private { struct snd_soc_card card; - struct list_head hdmi_pcm_list; + struct sof_hdmi_private hdmi; int pcm_count; int dai_index; const char *platform_name; - bool idisp_codec; bool bt_offload_present; int ssp_bt; }; diff --git a/sound/soc/intel/boards/skl_hda_dsp_generic.c b/sound/soc/intel/boards/skl_hda_dsp_generic.c index 860a21915bce..225867bb3310 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_generic.c +++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c @@ -75,7 +75,7 @@ skl_hda_add_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *link) link->platforms->name = ctx->platform_name; link->nonatomic = 1; - if (!ctx->idisp_codec) + if (!ctx->hdmi.idisp_codec) return 0; if (strstr(link->name, "HDMI")) { @@ -98,7 +98,6 @@ skl_hda_add_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *link) /* there are two routes per iDisp output */ #define IDISP_ROUTE_COUNT (IDISP_DAI_COUNT * 2) -#define IDISP_CODEC_MASK 0x4 #define HDA_CODEC_AUTOSUSPEND_DELAY_MS 1000 @@ -113,10 +112,9 @@ static int skl_hda_fill_card_info(struct device *dev, struct snd_soc_card *card, codec_mask = mach_params->codec_mask; codec_count = hweight_long(codec_mask); - ctx->idisp_codec = !!(codec_mask & IDISP_CODEC_MASK); if (!codec_count || codec_count > 2 || - (codec_count == 2 && !ctx->idisp_codec)) + (codec_count == 2 && !ctx->hdmi.idisp_codec)) return -EINVAL; if (codec_mask == IDISP_CODEC_MASK) { @@ -141,7 +139,7 @@ static int skl_hda_fill_card_info(struct device *dev, struct snd_soc_card *card, num_route = ARRAY_SIZE(skl_hda_map); card->dapm_widgets = skl_hda_widgets; card->num_dapm_widgets = ARRAY_SIZE(skl_hda_widgets); - if (!ctx->idisp_codec) { + if (!ctx->hdmi.idisp_codec) { card->dapm_routes = &skl_hda_map[IDISP_ROUTE_COUNT]; num_route -= IDISP_ROUTE_COUNT; for (i = 0; i < IDISP_DAI_COUNT; i++) { @@ -218,8 +216,6 @@ static int skl_hda_audio_probe(struct platform_device *pdev) if (!ctx) return -ENOMEM; - INIT_LIST_HEAD(&ctx->hdmi_pcm_list); - card = &ctx->card; card->name = "hda-dsp", card->owner = THIS_MODULE, @@ -232,6 +228,9 @@ static int skl_hda_audio_probe(struct platform_device *pdev) snd_soc_card_set_drvdata(card, ctx); + if (mach->mach_params.codec_mask & IDISP_CODEC_MASK) + ctx->hdmi.idisp_codec = true; + if (hweight_long(mach->mach_params.bt_link_mask) == 1) { ctx->bt_offload_present = true; ctx->ssp_bt = fls(mach->mach_params.bt_link_mask) - 1; From patchwork Tue Aug 27 12:32:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13779472 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3F0B1BD03A for ; Tue, 27 Aug 2024 12:33:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761987; cv=none; b=V1xHYFuZmQiw4s0Ph4v9hCmVfKwzDuUyt8K7bnjIqTp95mDUPFx6bMDqW4P66IRCIh36FOCRJM7haJZ3SRw85wTu9efyOz2roFhR01Drqh9hLN1aGiiJht6+qLovLj5jabpV+6HAiyq581u8EBvU/Z/OmYBpbYoYhCI+94+5mZ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761987; c=relaxed/simple; bh=qcl5K7Jxr6xC3mex/t1yEXqmgPSTaXdqXxFfQlamcTk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PNVGG9ss2y/1RySeaNRobKuMul9TrcFUtFg7aEKxSL26is23uGkZxhyD4ObMMA6iFYhXfvSpG+aj1WtCVZCtg49jGK0FrGY0VizuXPDctZD8qZz33KY4viQdk8TZOqKqJlv8Naaj/MGCbbkvjaImdswNQzXLfQEfFcACOJd0uec= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=RnxHMzwZ; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="RnxHMzwZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724761986; x=1756297986; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qcl5K7Jxr6xC3mex/t1yEXqmgPSTaXdqXxFfQlamcTk=; b=RnxHMzwZ0F/TgR8irKBOIEnmhOwSEVnxVLTWy5rf+NQFoRrzpslAD6jV Jkbcj/rREl041houZlhpQKHwNzZhSDzo4if9D1aWvLSHMrVW0EZQBHoo4 +8yP5KYjIXHpR/+umqpDzvwhv3GbPe2jWFUzKTOn//b1LqdAeRSZUFhwl gqNzZfZ7zrWSRwW1Fg0ibj3m7X2QTPjHGPP+JoplSlkOmjSUsPX1UnKrl dnOAEZkmmi+AMBoan993KNMT3IMHMuFDmmWRm422OS+xhFejnXiU+2wm0 lDGvECkxskgBdrUDStnMCq4lUDXJEPIfF3CqWco0jDhemQmNYho0QnRhu w==; X-CSE-ConnectionGUID: x5G4qkNjRM+34PS9uarniQ== X-CSE-MsgGUID: jjJB/4XIQuaF/eunQauvfA== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="13235528" X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="13235528" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:33:05 -0700 X-CSE-ConnectionGUID: OAZ+6YD7SaGCdCGVTZ2WSQ== X-CSE-MsgGUID: vKMJ4fooQuyZYK6OJ7Ai1A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="62676832" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.118.39]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:33:03 -0700 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: linux-sound@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, peter.ujfalusi@linux.intel.com Subject: [PATCH v2 14/17] ASoC: Intel: soc-acpi: arl: Add match entries for new cs42l43 laptops Date: Tue, 27 Aug 2024 20:32:12 +0800 Message-ID: <20240827123215.258859-15-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> References: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Charles Keepax Add some new match table entries on Arrowlake for some coming cs42l43 laptops. Signed-off-by: Charles Keepax Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- .../intel/common/soc-acpi-intel-arl-match.c | 219 ++++++++++++++++++ 1 file changed, 219 insertions(+) diff --git a/sound/soc/intel/common/soc-acpi-intel-arl-match.c b/sound/soc/intel/common/soc-acpi-intel-arl-match.c index 8f69d61ea39c..9936a4b4eee7 100644 --- a/sound/soc/intel/common/soc-acpi-intel-arl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-arl-match.c @@ -15,6 +15,112 @@ static const struct snd_soc_acpi_endpoint single_endpoint = { .group_id = 0, }; +static const struct snd_soc_acpi_endpoint spk_l_endpoint = { + .num = 0, + .aggregated = 1, + .group_position = 0, + .group_id = 1, +}; + +static const struct snd_soc_acpi_endpoint spk_r_endpoint = { + .num = 0, + .aggregated = 1, + .group_position = 1, + .group_id = 1, +}; + +static const struct snd_soc_acpi_endpoint spk_2_endpoint = { + .num = 0, + .aggregated = 1, + .group_position = 2, + .group_id = 1, +}; + +static const struct snd_soc_acpi_endpoint spk_3_endpoint = { + .num = 0, + .aggregated = 1, + .group_position = 3, + .group_id = 1, +}; + +static const struct snd_soc_acpi_adr_device cs35l56_2_lr_adr[] = { + { + .adr = 0x00023001FA355601ull, + .num_endpoints = 1, + .endpoints = &spk_l_endpoint, + .name_prefix = "AMP1" + }, + { + .adr = 0x00023101FA355601ull, + .num_endpoints = 1, + .endpoints = &spk_r_endpoint, + .name_prefix = "AMP2" + } +}; + +static const struct snd_soc_acpi_adr_device cs35l56_3_lr_adr[] = { + { + .adr = 0x00033001FA355601ull, + .num_endpoints = 1, + .endpoints = &spk_l_endpoint, + .name_prefix = "AMP1" + }, + { + .adr = 0x00033401FA355601ull, + .num_endpoints = 1, + .endpoints = &spk_r_endpoint, + .name_prefix = "AMP2" + } +}; + +static const struct snd_soc_acpi_adr_device cs35l56_2_r_adr[] = { + { + .adr = 0x00023201FA355601ull, + .num_endpoints = 1, + .endpoints = &spk_r_endpoint, + .name_prefix = "AMP3" + }, + { + .adr = 0x00023301FA355601ull, + .num_endpoints = 1, + .endpoints = &spk_3_endpoint, + .name_prefix = "AMP4" + } +}; + +static const struct snd_soc_acpi_adr_device cs35l56_3_l_adr[] = { + { + .adr = 0x00033001fa355601ull, + .num_endpoints = 1, + .endpoints = &spk_l_endpoint, + .name_prefix = "AMP1" + }, + { + .adr = 0x00033101fa355601ull, + .num_endpoints = 1, + .endpoints = &spk_2_endpoint, + .name_prefix = "AMP2" + } +}; + +static const struct snd_soc_acpi_adr_device cs35l56_2_r1_adr[] = { + { + .adr = 0x00023101FA355601ull, + .num_endpoints = 1, + .endpoints = &spk_r_endpoint, + .name_prefix = "AMP2" + }, +}; + +static const struct snd_soc_acpi_adr_device cs35l56_3_l1_adr[] = { + { + .adr = 0x00033301fa355601ull, + .num_endpoints = 1, + .endpoints = &spk_l_endpoint, + .name_prefix = "AMP1" + }, +}; + static const struct snd_soc_acpi_endpoint cs42l43_endpoints[] = { { /* Jack Playback Endpoint */ .num = 0, @@ -51,6 +157,15 @@ static const struct snd_soc_acpi_adr_device cs42l43_0_adr[] = { } }; +static const struct snd_soc_acpi_adr_device cs42l43_2_adr[] = { + { + .adr = 0x00023001FA424301ull, + .num_endpoints = ARRAY_SIZE(cs42l43_endpoints), + .endpoints = cs42l43_endpoints, + .name_prefix = "cs42l43" + } +}; + static const struct snd_soc_acpi_adr_device rt711_0_adr[] = { { .adr = 0x000020025D071100ull, @@ -77,6 +192,80 @@ static const struct snd_soc_acpi_link_adr arl_cs42l43_l0[] = { }, }; +static const struct snd_soc_acpi_link_adr arl_cs42l43_l2[] = { + { + .mask = BIT(2), + .num_adr = ARRAY_SIZE(cs42l43_2_adr), + .adr_d = cs42l43_2_adr, + }, +}; + +static const struct snd_soc_acpi_link_adr arl_cs42l43_l2_cs35l56_l3[] = { + { + .mask = BIT(2), + .num_adr = ARRAY_SIZE(cs42l43_2_adr), + .adr_d = cs42l43_2_adr, + }, + { + .mask = BIT(3), + .num_adr = ARRAY_SIZE(cs35l56_3_lr_adr), + .adr_d = cs35l56_3_lr_adr, + }, + {} +}; + +static const struct snd_soc_acpi_link_adr arl_cs42l43_l0_cs35l56_l2[] = { + { + .mask = BIT(0), + .num_adr = ARRAY_SIZE(cs42l43_0_adr), + .adr_d = cs42l43_0_adr, + }, + { + .mask = BIT(2), + .num_adr = ARRAY_SIZE(cs35l56_2_lr_adr), + .adr_d = cs35l56_2_lr_adr, + }, + {} +}; + +static const struct snd_soc_acpi_link_adr arl_cs42l43_l0_cs35l56_l23[] = { + { + .mask = BIT(0), + .num_adr = ARRAY_SIZE(cs42l43_0_adr), + .adr_d = cs42l43_0_adr, + }, + { + .mask = BIT(2), + .num_adr = ARRAY_SIZE(cs35l56_2_r_adr), + .adr_d = cs35l56_2_r_adr, + }, + { + .mask = BIT(3), + .num_adr = ARRAY_SIZE(cs35l56_3_l_adr), + .adr_d = cs35l56_3_l_adr, + }, + {} +}; + +static const struct snd_soc_acpi_link_adr arl_cs42l43_l0_cs35l56_2_l23[] = { + { + .mask = BIT(0), + .num_adr = ARRAY_SIZE(cs42l43_0_adr), + .adr_d = cs42l43_0_adr, + }, + { + .mask = BIT(2), + .num_adr = ARRAY_SIZE(cs35l56_2_r1_adr), + .adr_d = cs35l56_2_r1_adr, + }, + { + .mask = BIT(3), + .num_adr = ARRAY_SIZE(cs35l56_3_l1_adr), + .adr_d = cs35l56_3_l1_adr, + }, + {} +}; + static const struct snd_soc_acpi_link_adr arl_rvp[] = { { .mask = BIT(0), @@ -127,12 +316,42 @@ EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_arl_machines); /* this table is used when there is no I2S codec present */ struct snd_soc_acpi_mach snd_soc_acpi_intel_arl_sdw_machines[] = { + { + .link_mask = BIT(0) | BIT(2) | BIT(3), + .links = arl_cs42l43_l0_cs35l56_l23, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-arl-cs42l43-l0-cs35l56-l23.tplg", + }, + { + .link_mask = BIT(0) | BIT(2) | BIT(3), + .links = arl_cs42l43_l0_cs35l56_2_l23, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-arl-cs42l43-l0-cs35l56-l23.tplg", + }, + { + .link_mask = BIT(0) | BIT(2), + .links = arl_cs42l43_l0_cs35l56_l2, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-arl-cs42l43-l0-cs35l56-l2.tplg", + }, { .link_mask = BIT(0), .links = arl_cs42l43_l0, .drv_name = "sof_sdw", .sof_tplg_filename = "sof-arl-cs42l43-l0.tplg", }, + { + .link_mask = BIT(2), + .links = arl_cs42l43_l2, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-arl-cs42l43-l2.tplg", + }, + { + .link_mask = BIT(2) | BIT(3), + .links = arl_cs42l43_l2_cs35l56_l3, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-arl-cs42l43-l2-cs35l56-l3.tplg", + }, { .link_mask = 0x1, /* link0 required */ .links = arl_rvp, From patchwork Tue Aug 27 12:32:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13779473 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 726011BC9FC for ; Tue, 27 Aug 2024 12:33:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761989; cv=none; b=ZkW3uzQ5ADZZdRU1Wd1etSPrvY15XxZ3hB4lFGW8Af5vphrK3ZlNFZl9b71/eLZdNQWkPQ9RuDaYrW9jOYsFlJMtjf0RnjM/J3z5x4PZ4eDrTt0sDn15DvXmPQwvZ2o6wTg0zrSZDLpBAyug8Tb46M/y+MxjIus7oHLtedgTRbI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761989; c=relaxed/simple; bh=sXMeZZNRbQaUfBswDOyMGOTkyfQ9jRFyGA4IgezDZho=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qmd89BQx/SDI6oZ/dQyhyAa1vTIwmyHQttCY/Jk2pn6wbK4Rdqg+MFtQSv5fe+zyjphjv4ZQyDDLptv976gJiUSM1ZVObCtHJTIXcZIZjcGoTZGN1MZCFA/6Bu+J4r0ZK+m4Ev6dQX3rgLOv6CUNAX9br2psryaUFirwMXRoLy4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=jmnv6W31; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="jmnv6W31" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724761988; x=1756297988; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sXMeZZNRbQaUfBswDOyMGOTkyfQ9jRFyGA4IgezDZho=; b=jmnv6W31riPkO7/x97L3mnsjSD51ix5vVwGm0gOPil6BtJR/ZCTrJ4r9 5aQAUuYrIgpUUWZgDptvUzbTMvC1OD9o7W/nYmyEvW/zbPQlGvkPjzMDR 1E/m/hPqn1oHFtvpw49o9XJuP+K7CNkcyaaS/+pQt27ziO8aMlyr2GvA+ W4RSXDjaFRuTXBWV1KlpKOk5vcY1QQlVyR+VgHODxHXNq5bvCJJRHegoI 1fbUCMy1SyAfnXYwLn/pN/431XMLHxnJ03b85DMCeVVsG+I4OZO2jDylO GMjgcZhDv1eqIb7qOPCWFLLNJFkwJs1mVdu/8hBi8q+4K+VKPgMhNSWDx Q==; X-CSE-ConnectionGUID: q7znXLHkTneu8En4GSzoZA== X-CSE-MsgGUID: Hvoci8oRQPSeq+ZFCxZHhw== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="13235531" X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="13235531" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:33:08 -0700 X-CSE-ConnectionGUID: sQHt9OdrQn68r+ccqP220g== X-CSE-MsgGUID: HlJ6tRLaSDOEFEEl/L5iFg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="62676838" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.118.39]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:33:05 -0700 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: linux-sound@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, peter.ujfalusi@linux.intel.com Subject: [PATCH v2 15/17] ASoC: Intel: soc-acpi: adl: Add match entries for new cs42l43 laptops Date: Tue, 27 Aug 2024 20:32:13 +0800 Message-ID: <20240827123215.258859-16-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> References: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Charles Keepax Add some new match table entries on Alderlake for some coming cs42l43 laptops. Signed-off-by: Charles Keepax Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- .../intel/common/soc-acpi-intel-adl-match.c | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/sound/soc/intel/common/soc-acpi-intel-adl-match.c b/sound/soc/intel/common/soc-acpi-intel-adl-match.c index 4167b2e9bc6a..bb1324fb588e 100644 --- a/sound/soc/intel/common/soc-acpi-intel-adl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-adl-match.c @@ -35,6 +35,86 @@ static const struct snd_soc_acpi_endpoint spk_r_endpoint = { .group_id = 1, }; +static const struct snd_soc_acpi_endpoint spk_2_endpoint = { + .num = 0, + .aggregated = 1, + .group_position = 2, + .group_id = 1, +}; + +static const struct snd_soc_acpi_endpoint spk_3_endpoint = { + .num = 0, + .aggregated = 1, + .group_position = 3, + .group_id = 1, +}; + +static const struct snd_soc_acpi_adr_device cs35l56_2_r_adr[] = { + { + .adr = 0x00023201FA355601ull, + .num_endpoints = 1, + .endpoints = &spk_r_endpoint, + .name_prefix = "AMP3" + }, + { + .adr = 0x00023301FA355601ull, + .num_endpoints = 1, + .endpoints = &spk_3_endpoint, + .name_prefix = "AMP4" + } +}; + +static const struct snd_soc_acpi_adr_device cs35l56_3_l_adr[] = { + { + .adr = 0x00033001fa355601ull, + .num_endpoints = 1, + .endpoints = &spk_l_endpoint, + .name_prefix = "AMP1" + }, + { + .adr = 0x00033101fa355601ull, + .num_endpoints = 1, + .endpoints = &spk_2_endpoint, + .name_prefix = "AMP2" + } +}; + +static const struct snd_soc_acpi_endpoint cs42l43_endpoints[] = { + { /* Jack Playback Endpoint */ + .num = 0, + .aggregated = 0, + .group_position = 0, + .group_id = 0, + }, + { /* DMIC Capture Endpoint */ + .num = 1, + .aggregated = 0, + .group_position = 0, + .group_id = 0, + }, + { /* Jack Capture Endpoint */ + .num = 2, + .aggregated = 0, + .group_position = 0, + .group_id = 0, + }, + { /* Speaker Playback Endpoint */ + .num = 3, + .aggregated = 0, + .group_position = 0, + .group_id = 0, + }, +}; + +static const struct snd_soc_acpi_adr_device cs42l43_0_adr[] = { + { + .adr = 0x00003001FA424301ull, + .num_endpoints = ARRAY_SIZE(cs42l43_endpoints), + .endpoints = cs42l43_endpoints, + .name_prefix = "cs42l43" + } +}; + static const struct snd_soc_acpi_adr_device rt711_0_adr[] = { { .adr = 0x000020025D071100ull, @@ -416,6 +496,25 @@ static const struct snd_soc_acpi_adr_device rt5682_0_adr[] = { } }; +static const struct snd_soc_acpi_link_adr adl_cs42l43_l0_cs35l56_l23[] = { + { + .mask = BIT(0), + .num_adr = ARRAY_SIZE(cs42l43_0_adr), + .adr_d = cs42l43_0_adr, + }, + { + .mask = BIT(2), + .num_adr = ARRAY_SIZE(cs35l56_2_r_adr), + .adr_d = cs35l56_2_r_adr, + }, + { + .mask = BIT(3), + .num_adr = ARRAY_SIZE(cs35l56_3_l_adr), + .adr_d = cs35l56_3_l_adr, + }, + {} +}; + static const struct snd_soc_acpi_link_adr adl_rvp[] = { { .mask = BIT(0), @@ -560,6 +659,12 @@ EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_adl_machines); /* this table is used when there is no I2S codec present */ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_sdw_machines[] = { + { + .link_mask = BIT(0) | BIT(2) | BIT(3), + .links = adl_cs42l43_l0_cs35l56_l23, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-adl-cs42l43-l0-cs35l56-l23.tplg", + }, { .link_mask = 0xF, /* 4 active links required */ .links = adl_default, From patchwork Tue Aug 27 12:32:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13779474 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16F3F1BC9FC for ; Tue, 27 Aug 2024 12:33:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761992; cv=none; b=AcZ6xPNvHd5jPX/++tjrV/70oOh4Eg5ociB4mq8zyvc/bjEzJlzExInfeNyLF/iNcD//IPwF9t9RPLir+ShtAxXj1f6PgCD/+6Uapa1HJB3HARAy9g4e61Qw16gaaiMCvkZclwTg6vUTjhjPfDOt1WNsmxJGktS7LmaYMOJCuoA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761992; c=relaxed/simple; bh=lezY8n3FfGb0RUs9k8urcnsN7Kic2at/ihL04g8sWeE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eC70m9jyO5nmrLgxTJQUeby+QDeXxfIu1RV4VDJ5VQO7/0NSpaWrNynMLZJGOjU8mYmehvKdw0ik/z/EDtMu3Ies92wfRr5D1YfuDEvrdQdwfImG54N0RaE/DuqxDQJFxHEB375750x0i7W/EluIqy6XBQGcSX79OsCbR6UIhiA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=j+NCSypv; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="j+NCSypv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724761991; x=1756297991; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lezY8n3FfGb0RUs9k8urcnsN7Kic2at/ihL04g8sWeE=; b=j+NCSypv3SbIhCGPaaqJjdmir0o5SW9u5COVfiJikcKbBPXzWaYTn/Yq KaLXVhzM7t6dPk8FDc9nfdiCRIlhsc8klJkPeTBBghfytkslh95qBA8tS sGtnuE2EVmGm8XFJtoss/zV91XHO0/o/cuXxhk9dJDy/UrQ6tNEmWd4qw 6bznHBHzxjflCcGVwNftu4kAA+rePKacZJsK/aPKgez3JctBiax6O6qHw sT+FEnSL/lSoOnxVhxsEVATGL739uBgYUl+6uzss9fOPR4Ue1Snm0fhUB a02h3L7UDITUR7n6Z4vcetL5EowicnJeAQLa8TJairhOsdxMvNr1FQzh8 g==; X-CSE-ConnectionGUID: 4OKn2W3/RwGGByd64gPsjA== X-CSE-MsgGUID: egmYBk7gQm+hBw1P2X+JGg== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="13235534" X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="13235534" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:33:11 -0700 X-CSE-ConnectionGUID: J8iL3o+lSLyWaCBv/xlLpg== X-CSE-MsgGUID: bZL12jRKQJGtHoNMY2vguw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="62676842" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.118.39]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:33:08 -0700 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: linux-sound@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, peter.ujfalusi@linux.intel.com Subject: [PATCH v2 16/17] ASoC: Intel: soc-acpi: lnl: Add match entries for new cs42l43 laptops Date: Tue, 27 Aug 2024 20:32:14 +0800 Message-ID: <20240827123215.258859-17-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> References: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Charles Keepax Add some new match table entries on Lunarlake for some coming cs42l43 laptops. Signed-off-by: Charles Keepax Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- .../intel/common/soc-acpi-intel-lnl-match.c | 104 ++++++++++++++++++ 1 file changed, 104 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 e6ffcd5be6c5..2522e6f11749 100644 --- a/sound/soc/intel/common/soc-acpi-intel-lnl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-lnl-match.c @@ -36,6 +36,20 @@ static const struct snd_soc_acpi_endpoint spk_r_endpoint = { .group_id = 1, }; +static const struct snd_soc_acpi_endpoint spk_2_endpoint = { + .num = 0, + .aggregated = 1, + .group_position = 2, + .group_id = 1, +}; + +static const struct snd_soc_acpi_endpoint spk_3_endpoint = { + .num = 0, + .aggregated = 1, + .group_position = 3, + .group_id = 1, +}; + static const struct snd_soc_acpi_endpoint rt712_endpoints[] = { { .num = 0, @@ -103,6 +117,51 @@ static const struct snd_soc_acpi_endpoint cs42l43_endpoints[] = { }, }; +static const struct snd_soc_acpi_adr_device cs35l56_2_l_adr[] = { + { + .adr = 0x00023001FA355601ull, + .num_endpoints = 1, + .endpoints = &spk_l_endpoint, + .name_prefix = "AMP1" + }, + { + .adr = 0x00023101FA355601ull, + .num_endpoints = 1, + .endpoints = &spk_2_endpoint, + .name_prefix = "AMP2" + } +}; + +static const struct snd_soc_acpi_adr_device cs35l56_3_r_adr[] = { + { + .adr = 0x00033201fa355601ull, + .num_endpoints = 1, + .endpoints = &spk_r_endpoint, + .name_prefix = "AMP3" + }, + { + .adr = 0x00033301fa355601ull, + .num_endpoints = 1, + .endpoints = &spk_3_endpoint, + .name_prefix = "AMP4" + } +}; + +static const struct snd_soc_acpi_adr_device cs35l56_3_lr_adr[] = { + { + .adr = 0x00033001fa355601ull, + .num_endpoints = 1, + .endpoints = &spk_l_endpoint, + .name_prefix = "AMP1" + }, + { + .adr = 0x00033101fa355601ull, + .num_endpoints = 1, + .endpoints = &spk_r_endpoint, + .name_prefix = "AMP2" + } +}; + static const struct snd_soc_acpi_adr_device cs42l43_0_adr[] = { { .adr = 0x00003001FA424301ull, @@ -210,6 +269,39 @@ static const struct snd_soc_acpi_link_adr lnl_cs42l43_l0[] = { }, }; +static const struct snd_soc_acpi_link_adr lnl_cs42l43_l0_cs35l56_l3[] = { + { + .mask = BIT(0), + .num_adr = ARRAY_SIZE(cs42l43_0_adr), + .adr_d = cs42l43_0_adr, + }, + { + .mask = BIT(3), + .num_adr = ARRAY_SIZE(cs35l56_3_lr_adr), + .adr_d = cs35l56_3_lr_adr, + }, + {} +}; + +static const struct snd_soc_acpi_link_adr lnl_cs42l43_l0_cs35l56_l23[] = { + { + .mask = BIT(0), + .num_adr = ARRAY_SIZE(cs42l43_0_adr), + .adr_d = cs42l43_0_adr, + }, + { + .mask = BIT(2), + .num_adr = ARRAY_SIZE(cs35l56_2_l_adr), + .adr_d = cs35l56_2_l_adr, + }, + { + .mask = BIT(3), + .num_adr = ARRAY_SIZE(cs35l56_3_r_adr), + .adr_d = cs35l56_3_r_adr, + }, + {} +}; + static const struct snd_soc_acpi_link_adr lnl_rvp[] = { { .mask = BIT(0), @@ -312,6 +404,18 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_lnl_sdw_machines[] = { .drv_name = "sof_sdw", .sof_tplg_filename = "sof-lnl-rt711-l0-rt1316-l23-rt714-l1.tplg", }, + { + .link_mask = BIT(0) | BIT(2) | BIT(3), + .links = lnl_cs42l43_l0_cs35l56_l23, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-lnl-cs42l43-l0-cs35l56-l23.tplg", + }, + { + .link_mask = BIT(0) | BIT(3), + .links = lnl_cs42l43_l0_cs35l56_l3, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-lnl-cs42l43-l0-cs35l56-l3.tplg", + }, { .link_mask = BIT(0), .links = lnl_cs42l43_l0, From patchwork Tue Aug 27 12:32:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13779475 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACAEE1BBBF5 for ; Tue, 27 Aug 2024 12:33:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761995; cv=none; b=IDRHtDyJQayZk1Eg9mFotyzD+YI+EM+ssnLo3zHJp8PrYKCSLu8ICDk82IabW5NbO8/c87zlvJz88ZKIoEFl9wDr6SD34u2+Tn87UaIMuZiFcIfuXsRnzB7WJ2awdHCqez2OfrcocCyTdKmirAAPlg3Ek1JKOOXFU9kyquBsYOQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724761995; c=relaxed/simple; bh=plgYLZUH4hSB8RBHdWrUYinlJ2D8P8EfiRGnW+DxjRs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kslbZAdbcE+Se/bM/lcA9FniiZM7RBYL91f7lfsa+5Ha1YmiTgC8/RfcszY8uKGsFeOJ1r39U3eNYbCAZprKJbMC+GZ0fjwnnCrLOKNIpulGMvmeJgCDBNEZma6DhjGDkY4DRphcczM2bIEsrQ8nqowH/78OkgdDT7WAsRwWPy0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Sbh6jngk; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Sbh6jngk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724761994; x=1756297994; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=plgYLZUH4hSB8RBHdWrUYinlJ2D8P8EfiRGnW+DxjRs=; b=Sbh6jngk0rBVdFc4qI5EkDtCXcaW2C2P/+I4TxNJcq4fnMnex31iXLWd weJEkSJPCRpHIq9iLZ/KUDDD9O47kBUT0B8YjqYkUQunE20sF0eniFoPq VRs5lu/dDiQvoxNLFfLJN34nCiGKSgCxRmDf5yQp8EwXDpZnCgmHaL6FD bbeGvYL+FE7seQdssNZ1mGRyQTlsMSBWqmWhZnwuLN220kjFkJ2xnS7Z7 si51x4wl1MvlBtjeCOg+j6ATQbGDcUyi5ES6ulcGfy6fZ7biDVEQQi/R5 vQkW7hoIyR2p2+vO/ec4n0SXPl29PPmGkyuNbe9REHownygMmRgHwijQ6 g==; X-CSE-ConnectionGUID: 2+VrbTv2SgerSwl1iwQ+EQ== X-CSE-MsgGUID: mRg/ozkbQKiYVJRS7EIRuA== X-IronPort-AV: E=McAfee;i="6700,10204,11176"; a="13235537" X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="13235537" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:33:13 -0700 X-CSE-ConnectionGUID: RMTPYqCGQc6DbXibbX4PAQ== X-CSE-MsgGUID: GsPZAnbXS8eNxtwcXPpZiA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,180,1719903600"; d="scan'208";a="62676855" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.118.39]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Aug 2024 05:33:11 -0700 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: linux-sound@vger.kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, peter.ujfalusi@linux.intel.com Subject: [PATCH v2 17/17] ASoC: Intel: sof_sdw: Add quirks from some new Dell laptops Date: Tue, 27 Aug 2024 20:32:15 +0800 Message-ID: <20240827123215.258859-18-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> References: <20240827123215.258859-1-yung-chuan.liao@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Maciej Strozek Add quirks for some new Dell laptops using cs42l43's speaker outputs. Signed-off-by: Maciej Strozek Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- sound/soc/intel/boards/sof_sdw.c | 58 ++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index b06948c16b3f..855109d22131 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -480,6 +480,14 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { .driver_data = (void *)(SOF_SDW_TGL_HDMI | RT711_JD2), }, + { + .callback = sof_sdw_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0CF9") + }, + .driver_data = (void *)(SOC_SDW_CODEC_SPKR), + }, /* MeteorLake devices */ { .callback = sof_sdw_quirk_cb, @@ -540,6 +548,56 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { }, .driver_data = (void *)(SOC_SDW_SIDECAR_AMPS), }, + { + .callback = sof_sdw_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0CDB") + }, + .driver_data = (void *)(SOC_SDW_CODEC_SPKR), + }, + { + .callback = sof_sdw_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0CDC") + }, + .driver_data = (void *)(SOC_SDW_CODEC_SPKR), + }, + { + .callback = sof_sdw_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0CDD") + }, + .driver_data = (void *)(SOC_SDW_CODEC_SPKR), + }, + { + .callback = sof_sdw_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0CF8") + }, + .driver_data = (void *)(SOC_SDW_CODEC_SPKR), + }, + + /* ArrowLake devices */ + { + .callback = sof_sdw_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0CE8") + }, + .driver_data = (void *)(SOC_SDW_CODEC_SPKR), + }, + { + .callback = sof_sdw_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0CF7") + }, + .driver_data = (void *)(SOC_SDW_CODEC_SPKR), + }, {} };