From patchwork Thu Sep 12 12:03:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13802060 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (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 C1FC819F11E for ; Thu, 12 Sep 2024 12:03:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726142602; cv=none; b=Lo1vOCEGbSYQStbuyMVkTxNz2qxmAMYbl/92kifuO5RNsWrRdPKWO6LAoK77rEb50THzI1aNHHIchNaHwG1lU661Z3fTBvxgca7uuME9LfNHFjYj7Eoyh0wrTkj1ZyhryGKPBnQ5PmMT5rCpPln84HJuGjFhkm35R5AOSjTrpvk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726142602; c=relaxed/simple; bh=z04rk308BNPTE0LiI1962pjzJABoDnmEOEeiOwbKf+c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cr30zBDTPMAQc3+NCaByAH2jH2HVCgDiaIDl52vBI1uKd6AeKVEf6ViGJ6AwoGpBAVk60Gl4Df9OTe06RfAYvxIheL4BQUw43Ac9KwyQfjN3KyguZD6QVf+Kua0TyfDIZRE/JTJHAEF0NXBCiEJ041mnMu75f1+8vKPmeg7R1R8= 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=UcgKnPrs; arc=none smtp.client-ip=198.175.65.20 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="UcgKnPrs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1726142601; x=1757678601; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=z04rk308BNPTE0LiI1962pjzJABoDnmEOEeiOwbKf+c=; b=UcgKnPrsGfkAmqzi2uZw6j2bqR7tYAWZyr4pRo3ZtNwKJltEMW7U/YW4 1zHnRE0uuRbpqMMAeqj7/lVKuGOs6CnnpHrbvywBD7ZpFIDsa/XZHVL/G FIX3sr5OwwlU98jG1g1CMm9wE/d8oq3+8lVuNjkC5wRcRVB+3vSe6XVKG 6+4Up41Qx7hWDcVM3MSNgw4wvJ96s0OdpZnPPf5JI/3y7+qfi5FQB+WoP Hrm8/viNrrB7DoG9yTXuh6pYogXPUlvjBwpoUXGGV80uHQhPux8JNsWuC eURqIxYtzU5uDUJMaZ6SZ8Egfu/dzmUussPmyA3NTCHaneF+AqVctFvoZ A==; X-CSE-ConnectionGUID: yMUDcX4DT2GwB/uNbOSOgw== X-CSE-MsgGUID: Uy8SZudgTBGr/J0owGEAzg== X-IronPort-AV: E=McAfee;i="6700,10204,11192"; a="24812766" X-IronPort-AV: E=Sophos;i="6.10,222,1719903600"; d="scan'208";a="24812766" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2024 05:03:21 -0700 X-CSE-ConnectionGUID: eRfQ5NX0Rzya+FLVRp40rw== X-CSE-MsgGUID: 93geCChVS1CBYA9gcj/3Tg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,222,1719903600"; d="scan'208";a="68459152" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.119.14]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2024 05:03:19 -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 1/7] ASoC: Intel: board_helpers: support HDA link initialization Date: Thu, 12 Sep 2024 20:03:02 +0800 Message-ID: <20240912120308.134762-2-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240912120308.134762-1-yung-chuan.liao@linux.intel.com> References: <20240912120308.134762-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 a helper function for machine drivers to initialize HDA external codec DAI link. Signed-off-by: Brent Lu Reviewed-by: Péter Ujfalusi Signed-off-by: Bard Liao --- sound/soc/intel/boards/sof_board_helpers.c | 152 +++++++++++++++++++++ sound/soc/intel/boards/sof_board_helpers.h | 3 + 2 files changed, 155 insertions(+) diff --git a/sound/soc/intel/boards/sof_board_helpers.c b/sound/soc/intel/boards/sof_board_helpers.c index 7519c545cbe2..24f716e42d6a 100644 --- a/sound/soc/intel/boards/sof_board_helpers.c +++ b/sound/soc/intel/boards/sof_board_helpers.c @@ -70,6 +70,64 @@ static int dmic_init(struct snd_soc_pcm_runtime *rtd) return 0; } +/* + * HDA External Codec DAI Link + */ +static const struct snd_soc_dapm_widget hda_widgets[] = { + SND_SOC_DAPM_MIC("Analog In", NULL), + SND_SOC_DAPM_MIC("Digital In", NULL), + SND_SOC_DAPM_MIC("Alt Analog In", NULL), + + SND_SOC_DAPM_HP("Analog Out", NULL), + SND_SOC_DAPM_SPK("Digital Out", NULL), + SND_SOC_DAPM_HP("Alt Analog Out", NULL), +}; + +static const struct snd_soc_dapm_route hda_routes[] = { + { "Codec Input Pin1", NULL, "Analog In" }, + { "Codec Input Pin2", NULL, "Digital In" }, + { "Codec Input Pin3", NULL, "Alt Analog In" }, + + { "Analog Out", NULL, "Codec Output Pin1" }, + { "Digital Out", NULL, "Codec Output Pin2" }, + { "Alt Analog Out", NULL, "Codec Output Pin3" }, + + /* CODEC BE connections */ + { "codec0_in", NULL, "Analog CPU Capture" }, + { "Analog CPU Capture", NULL, "Analog Codec Capture" }, + { "codec1_in", NULL, "Digital CPU Capture" }, + { "Digital CPU Capture", NULL, "Digital Codec Capture" }, + { "codec2_in", NULL, "Alt Analog CPU Capture" }, + { "Alt Analog CPU Capture", NULL, "Alt Analog Codec Capture" }, + + { "Analog Codec Playback", NULL, "Analog CPU Playback" }, + { "Analog CPU Playback", NULL, "codec0_out" }, + { "Digital Codec Playback", NULL, "Digital CPU Playback" }, + { "Digital CPU Playback", NULL, "codec1_out" }, + { "Alt Analog Codec Playback", NULL, "Alt Analog CPU Playback" }, + { "Alt Analog CPU Playback", NULL, "codec2_out" }, +}; + +static int hda_init(struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_card *card = rtd->card; + int ret; + + ret = snd_soc_dapm_new_controls(&card->dapm, hda_widgets, + ARRAY_SIZE(hda_widgets)); + if (ret) { + dev_err(rtd->dev, "fail to add hda widgets, ret %d\n", ret); + return ret; + } + + ret = snd_soc_dapm_add_routes(&card->dapm, hda_routes, + ARRAY_SIZE(hda_routes)); + if (ret) + dev_err(rtd->dev, "fail to add hda routes, ret %d\n", ret); + + return ret; +} + /* * DAI Link Helpers */ @@ -79,6 +137,11 @@ enum sof_dmic_be_type { SOF_DMIC_16K, }; +enum sof_hda_be_type { + SOF_HDA_ANALOG, + SOF_HDA_DIGITAL, +}; + /* DEFAULT_LINK_ORDER: the order used in sof_rt5682 */ #define DEFAULT_LINK_ORDER SOF_LINK_ORDER(SOF_LINK_CODEC, \ SOF_LINK_DMIC01, \ @@ -95,6 +158,16 @@ static struct snd_soc_dai_link_component dmic_component[] = { } }; +SND_SOC_DAILINK_DEF(hda_analog_cpus, + DAILINK_COMP_ARRAY(COMP_CPU("Analog CPU DAI"))); +SND_SOC_DAILINK_DEF(hda_analog_codecs, + DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D0", "Analog Codec DAI"))); + +SND_SOC_DAILINK_DEF(hda_digital_cpus, + DAILINK_COMP_ARRAY(COMP_CPU("Digital CPU DAI"))); +SND_SOC_DAILINK_DEF(hda_digital_codecs, + DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D0", "Digital Codec DAI"))); + static struct snd_soc_dai_link_component platform_component[] = { { /* name might be overridden during probe */ @@ -380,6 +453,55 @@ static int set_hdmi_in_link(struct device *dev, struct snd_soc_dai_link *link, return 0; } +static int set_hda_codec_link(struct device *dev, struct snd_soc_dai_link *link, + int be_id, enum sof_hda_be_type be_type) +{ + switch (be_type) { + case SOF_HDA_ANALOG: + dev_dbg(dev, "link %d: hda analog\n", be_id); + + link->name = "Analog Playback and Capture"; + + /* cpus */ + link->cpus = hda_analog_cpus; + link->num_cpus = ARRAY_SIZE(hda_analog_cpus); + + /* codecs */ + link->codecs = hda_analog_codecs; + link->num_codecs = ARRAY_SIZE(hda_analog_codecs); + break; + case SOF_HDA_DIGITAL: + dev_dbg(dev, "link %d: hda digital\n", be_id); + + link->name = "Digital Playback and Capture"; + + /* cpus */ + link->cpus = hda_digital_cpus; + link->num_cpus = ARRAY_SIZE(hda_digital_cpus); + + /* codecs */ + link->codecs = hda_digital_codecs; + link->num_codecs = ARRAY_SIZE(hda_digital_codecs); + break; + default: + dev_err(dev, "invalid be type %d\n", be_type); + return -EINVAL; + } + + /* platforms */ + link->platforms = platform_component; + link->num_platforms = ARRAY_SIZE(platform_component); + + link->id = be_id; + if (be_type == SOF_HDA_ANALOG) + link->init = hda_init; + link->no_pcm = 1; + link->dpcm_capture = 1; + link->dpcm_playback = 1; + + return 0; +} + static int calculate_num_links(struct sof_card_private *ctx) { int num_links = 0; @@ -409,6 +531,10 @@ static int calculate_num_links(struct sof_card_private *ctx) /* HDMI-In */ num_links += hweight32(ctx->ssp_mask_hdmi_in); + /* HDA external codec */ + if (ctx->hda_codec_present) + num_links += 2; + return num_links; } @@ -566,6 +692,32 @@ int sof_intel_board_set_dai_link(struct device *dev, struct snd_soc_card *card, be_id++; } break; + case SOF_LINK_HDA: + /* HDA external codec */ + if (!ctx->hda_codec_present) + continue; + + ret = set_hda_codec_link(dev, &links[idx], be_id, + SOF_HDA_ANALOG); + if (ret) { + dev_err(dev, "fail to set hda analog link, ret %d\n", + ret); + return ret; + } + + idx++; + be_id++; + + ret = set_hda_codec_link(dev, &links[idx], be_id, + SOF_HDA_DIGITAL); + if (ret) { + dev_err(dev, "fail to set hda digital link, ret %d\n", + ret); + return ret; + } + + idx++; + break; case SOF_LINK_NONE: /* caught here if it's not used as terminator in macro */ fallthrough; diff --git a/sound/soc/intel/boards/sof_board_helpers.h b/sound/soc/intel/boards/sof_board_helpers.h index faba847bb7c9..33a9601b770c 100644 --- a/sound/soc/intel/boards/sof_board_helpers.h +++ b/sound/soc/intel/boards/sof_board_helpers.h @@ -57,6 +57,7 @@ enum { SOF_LINK_AMP, SOF_LINK_BT_OFFLOAD, SOF_LINK_HDMI_IN, + SOF_LINK_HDA, }; #define SOF_LINK_ORDER_MASK (0xF) @@ -121,6 +122,7 @@ struct sof_rt5682_private { * @ssp_bt: ssp port number of BT offload BE link * @ssp_mask_hdmi_in: ssp port mask of HDMI-IN BE link * @bt_offload_present: true to create BT offload BE link + * @hda_codec_present: true to create HDA codec BE links * @codec_link: pointer to headset codec dai link * @amp_link: pointer to speaker amplifier dai link * @link_order_overwrite: custom DAI link order @@ -144,6 +146,7 @@ struct sof_card_private { unsigned long ssp_mask_hdmi_in; bool bt_offload_present; + bool hda_codec_present; struct snd_soc_dai_link *codec_link; struct snd_soc_dai_link *amp_link; From patchwork Thu Sep 12 12:03:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13802061 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (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 9C68B1A0BDE for ; Thu, 12 Sep 2024 12:03:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726142605; cv=none; b=PfZ3O5FKpLEpxX2lcDAjczFEhiwS+H8ov3yL1TwKZr2nj2lxaDvgywSwgnY9/nJ2ibN1GcD+YS/zCkMTWuvnAqSAdxug79zJjrqB3/Swdvgjd0kyXt1lciWRIzI0gDixrzFkLSHt5MjBMcOBnjrENxLPLvdLZ+FH0oADF+nXc/w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726142605; c=relaxed/simple; bh=i/vSHoNMZnw+mH7af6xFtH7GzAKW2VccRUgH3IU/usQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=u05Mp1s4640d8He6z77idUWNHUXhpHiP9dNoPeX5LywlCQjeIhopVDWTt8un8s3zl9DHaM2JZsdPU4Cp32MpciE0MNtqwprPN1xsHZhFgoMabkakFD2W28oFHmQPFkf124Ux4vBdcgM9iqZJ7yz0rIRxT53GTxVaG2i1C6Eos8c= 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=Y+GA1FR+; arc=none smtp.client-ip=198.175.65.20 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="Y+GA1FR+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1726142604; x=1757678604; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=i/vSHoNMZnw+mH7af6xFtH7GzAKW2VccRUgH3IU/usQ=; b=Y+GA1FR+Qruu5+EkFZyiQopMvLDJTfHExE5/YuO+VwJXftciMqD/Z7Rp eHSPaIq7iQXNHlvTWL0iFrwEzXl1tdzDGZdNsYzPyObVgBIMX7DENZheh /ySWRcRHBsEZZXnGAOwztSDm6YyKgHhlLxbeayupB/LNtoN2gmaIy/8eE jeN/bf872jMFfS3o5EnOnLVshkqTYhJ6LEwy2vTjo5Fh82ehw12uZjJM1 SOMSiIyKeTHDI1X+xYpRqyHU9z5FbBer0Yb3G/oYZE7Kz2F9TC+PQ5ZZc gQZ+a5spySwjUtBFhoCGDUFQU2S2T/LI9xqVKFqnCkSSI6NX6zrugJDGu A==; X-CSE-ConnectionGUID: TP1p2O1xTmeRIOuRpFqf8A== X-CSE-MsgGUID: 4LzFNwshQeyvoqlYVGSdDw== X-IronPort-AV: E=McAfee;i="6700,10204,11192"; a="24812770" X-IronPort-AV: E=Sophos;i="6.10,222,1719903600"; d="scan'208";a="24812770" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2024 05:03:24 -0700 X-CSE-ConnectionGUID: 4NrLj1MFS3uaangsoN/GAw== X-CSE-MsgGUID: 71ReAwK7RzKej/68fae3og== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,222,1719903600"; d="scan'208";a="68459157" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.119.14]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2024 05:03:21 -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 2/7] ASoC: Intel: skl_hda_dsp_generic: use common module for DAI links Date: Thu, 12 Sep 2024 20:03:03 +0800 Message-ID: <20240912120308.134762-3-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240912120308.134762-1-yung-chuan.liao@linux.intel.com> References: <20240912120308.134762-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 intel_board module to create DAI link array for Intel iDisp HDMI, HDA external codec, DMIC01, DMIC16K, and BT audio offload DAI BE links. Signed-off-by: Brent Lu Reviewed-by: Péter Ujfalusi Signed-off-by: Bard Liao --- sound/soc/intel/boards/Kconfig | 1 + sound/soc/intel/boards/Makefile | 2 +- sound/soc/intel/boards/skl_hda_dsp_common.c | 156 ------------ sound/soc/intel/boards/skl_hda_dsp_common.h | 38 --- sound/soc/intel/boards/skl_hda_dsp_generic.c | 252 +++++-------------- 5 files changed, 70 insertions(+), 379 deletions(-) delete mode 100644 sound/soc/intel/boards/skl_hda_dsp_common.c delete mode 100644 sound/soc/intel/boards/skl_hda_dsp_common.h diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig index 793a9170513a..cc10ae58b0c7 100644 --- a/sound/soc/intel/boards/Kconfig +++ b/sound/soc/intel/boards/Kconfig @@ -306,6 +306,7 @@ config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH tristate "Skylake+ with HDA Codecs" depends on SND_HDA_CODEC_HDMI select SND_SOC_INTEL_HDA_DSP_COMMON + select SND_SOC_INTEL_SOF_BOARD_HELPERS select SND_SOC_DMIC # SND_SOC_HDAC_HDA is already selected help diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile index 9b24de731332..fcd517d6c279 100644 --- a/sound/soc/intel/boards/Makefile +++ b/sound/soc/intel/boards/Makefile @@ -21,7 +21,7 @@ snd-soc-sof_cs42l42-y := sof_cs42l42.o snd-soc-sof_es8336-y := sof_es8336.o snd-soc-sof_nau8825-y := sof_nau8825.o snd-soc-sof_da7219-y := sof_da7219.o -snd-soc-skl_hda_dsp-y := skl_hda_dsp_generic.o skl_hda_dsp_common.o +snd-soc-skl_hda_dsp-y := skl_hda_dsp_generic.o snd-soc-ehl-rt5660-y := ehl_rt5660.o snd-soc-sof-ssp-amp-y := sof_ssp_amp.o snd-soc-sof-sdw-y += sof_sdw.o \ diff --git a/sound/soc/intel/boards/skl_hda_dsp_common.c b/sound/soc/intel/boards/skl_hda_dsp_common.c deleted file mode 100644 index 5019bdfa5b45..000000000000 --- a/sound/soc/intel/boards/skl_hda_dsp_common.c +++ /dev/null @@ -1,156 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -// Copyright(c) 2015-18 Intel Corporation. - -/* - * Common functions used in different Intel machine drivers - */ -#include -#include -#include -#include -#include -#include -#include -#include "skl_hda_dsp_common.h" - -#include -#include "../../codecs/hdac_hda.h" - -#define NAME_SIZE 32 - -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 snd_soc_dai *dai; - char dai_name[NAME_SIZE]; - - snprintf(dai_name, sizeof(dai_name), "intel-hdmi-hifi%d", - ctx->dai_index); - dai = snd_soc_card_get_codec_dai(card, dai_name); - if (!dai) - return -EINVAL; - - ctx->hdmi.hdmi_comp = dai->component; - - return 0; -} - -SND_SOC_DAILINK_DEF(idisp1_cpu, - DAILINK_COMP_ARRAY(COMP_CPU("iDisp1 Pin"))); -SND_SOC_DAILINK_DEF(idisp1_codec, - DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi1"))); - -SND_SOC_DAILINK_DEF(idisp2_cpu, - DAILINK_COMP_ARRAY(COMP_CPU("iDisp2 Pin"))); -SND_SOC_DAILINK_DEF(idisp2_codec, - DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi2"))); - -SND_SOC_DAILINK_DEF(idisp3_cpu, - DAILINK_COMP_ARRAY(COMP_CPU("iDisp3 Pin"))); -SND_SOC_DAILINK_DEF(idisp3_codec, - DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi3"))); - -SND_SOC_DAILINK_DEF(analog_cpu, - DAILINK_COMP_ARRAY(COMP_CPU("Analog CPU DAI"))); -SND_SOC_DAILINK_DEF(analog_codec, - DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D0", "Analog Codec DAI"))); - -SND_SOC_DAILINK_DEF(digital_cpu, - DAILINK_COMP_ARRAY(COMP_CPU("Digital CPU DAI"))); -SND_SOC_DAILINK_DEF(digital_codec, - DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D0", "Digital Codec DAI"))); - -SND_SOC_DAILINK_DEF(dmic_pin, - DAILINK_COMP_ARRAY(COMP_CPU("DMIC01 Pin"))); - -SND_SOC_DAILINK_DEF(dmic_codec, - DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", "dmic-hifi"))); - -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"))); - -/* skl_hda_digital audio interface glue - connects codec <--> CPU */ -struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS] = { - /* Back End DAI links */ - { - .name = "iDisp1", - .id = 1, - .dpcm_playback = 1, - .no_pcm = 1, - SND_SOC_DAILINK_REG(idisp1_cpu, idisp1_codec, platform), - }, - { - .name = "iDisp2", - .id = 2, - .dpcm_playback = 1, - .no_pcm = 1, - SND_SOC_DAILINK_REG(idisp2_cpu, idisp2_codec, platform), - }, - { - .name = "iDisp3", - .id = 3, - .dpcm_playback = 1, - .no_pcm = 1, - SND_SOC_DAILINK_REG(idisp3_cpu, idisp3_codec, platform), - }, - { - .name = "Analog Playback and Capture", - .id = 4, - .dpcm_playback = 1, - .dpcm_capture = 1, - .no_pcm = 1, - SND_SOC_DAILINK_REG(analog_cpu, analog_codec, platform), - }, - { - .name = "Digital Playback and Capture", - .id = 5, - .dpcm_playback = 1, - .dpcm_capture = 1, - .no_pcm = 1, - SND_SOC_DAILINK_REG(digital_cpu, digital_codec, platform), - }, - { - .name = "dmic01", - .id = 6, - .dpcm_capture = 1, - .no_pcm = 1, - SND_SOC_DAILINK_REG(dmic_pin, dmic_codec, platform), - }, - { - .name = "dmic16k", - .id = 7, - .dpcm_capture = 1, - .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) -{ - struct skl_hda_private *ctx = snd_soc_card_get_drvdata(card); - - /* HDMI disabled, do not create controls */ - if (!ctx->hdmi.idisp_codec) - return 0; - - if (!ctx->hdmi.hdmi_comp) - return -EINVAL; - - 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 deleted file mode 100644 index 40ffbccb2fe0..000000000000 --- a/sound/soc/intel/boards/skl_hda_dsp_common.h +++ /dev/null @@ -1,38 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * Copyright(c) 2015-18 Intel Corporation. - */ - -/* - * This file defines data structures used in Machine Driver for Intel - * platforms with HDA Codecs. - */ - -#ifndef __SKL_HDA_DSP_COMMON_H -#define __SKL_HDA_DSP_COMMON_H -#include -#include -#include -#include -#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_private { - struct snd_soc_card card; - struct sof_hdmi_private hdmi; - int pcm_count; - int dai_index; - const char *platform_name; - bool bt_offload_present; - int ssp_bt; -}; - -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); - -#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 8e104874d58c..9edd6d985cf1 100644 --- a/sound/soc/intel/boards/skl_hda_dsp_generic.c +++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c @@ -8,178 +8,23 @@ #include #include #include +#include #include #include #include #include #include -#include "skl_hda_dsp_common.h" - -static const struct snd_soc_dapm_widget skl_hda_widgets[] = { - SND_SOC_DAPM_HP("Analog Out", NULL), - SND_SOC_DAPM_MIC("Analog In", NULL), - SND_SOC_DAPM_HP("Alt Analog Out", NULL), - SND_SOC_DAPM_MIC("Alt Analog In", NULL), - SND_SOC_DAPM_SPK("Digital Out", NULL), - SND_SOC_DAPM_MIC("Digital In", NULL), - SND_SOC_DAPM_MIC("SoC DMIC", NULL), -}; - -static const struct snd_soc_dapm_route skl_hda_map[] = { - { "hifi3", NULL, "iDisp3 Tx"}, - { "iDisp3 Tx", NULL, "iDisp3_out"}, - { "hifi2", NULL, "iDisp2 Tx"}, - { "iDisp2 Tx", NULL, "iDisp2_out"}, - { "hifi1", NULL, "iDisp1 Tx"}, - { "iDisp1 Tx", NULL, "iDisp1_out"}, - - { "Analog Out", NULL, "Codec Output Pin1" }, - { "Digital Out", NULL, "Codec Output Pin2" }, - { "Alt Analog Out", NULL, "Codec Output Pin3" }, - - { "Codec Input Pin1", NULL, "Analog In" }, - { "Codec Input Pin2", NULL, "Digital In" }, - { "Codec Input Pin3", NULL, "Alt Analog In" }, - - /* digital mics */ - {"DMic", NULL, "SoC DMIC"}, - - /* CODEC BE connections */ - { "Analog Codec Playback", NULL, "Analog CPU Playback" }, - { "Analog CPU Playback", NULL, "codec0_out" }, - { "Digital Codec Playback", NULL, "Digital CPU Playback" }, - { "Digital CPU Playback", NULL, "codec1_out" }, - { "Alt Analog Codec Playback", NULL, "Alt Analog CPU Playback" }, - { "Alt Analog CPU Playback", NULL, "codec2_out" }, - - { "codec0_in", NULL, "Analog CPU Capture" }, - { "Analog CPU Capture", NULL, "Analog Codec Capture" }, - { "codec1_in", NULL, "Digital CPU Capture" }, - { "Digital CPU Capture", NULL, "Digital Codec Capture" }, - { "codec2_in", NULL, "Alt Analog CPU Capture" }, - { "Alt Analog CPU Capture", NULL, "Alt Analog Codec Capture" }, -}; +#include "../../codecs/hdac_hda.h" +#include "../../sof/intel/hda.h" +#include "sof_board_helpers.h" static int skl_hda_card_late_probe(struct snd_soc_card *card) { - return skl_hda_hdmi_jack_init(card); + return sof_intel_board_card_late_probe(card); } -static int -skl_hda_add_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *link) -{ - struct skl_hda_private *ctx = snd_soc_card_get_drvdata(card); - int ret = 0; - - dev_dbg(card->dev, "dai link name - %s\n", link->name); - link->platforms->name = ctx->platform_name; - link->nonatomic = 1; - - if (!ctx->hdmi.idisp_codec) - return 0; - - if (strstr(link->name, "HDMI")) { - ret = skl_hda_hdmi_add_pcm(card, ctx->pcm_count); - - if (ret < 0) - return ret; - - ctx->dai_index++; - } - - ctx->pcm_count++; - return ret; -} - -#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) - #define HDA_CODEC_AUTOSUSPEND_DELAY_MS 1000 -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; - - codec_mask = mach_params->codec_mask; - codec_count = hweight_long(codec_mask); - - if (!codec_count || codec_count > 2 || - (codec_count == 2 && !ctx->hdmi.idisp_codec)) - return -EINVAL; - - if (codec_mask == IDISP_CODEC_MASK) { - /* topology with iDisp as the only HDA codec */ - num_links = IDISP_DAI_COUNT + DMIC_DAI_COUNT + BT_DAI_COUNT; - num_route = IDISP_ROUTE_COUNT; - - /* - * rearrange the dai link array and make the - * dmic dai links follow idsp dai links for only - * num_links of dai links need to be registered - * to ASoC. - */ - 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]; - } - } else { - /* topology with external and iDisp HDA codecs */ - num_links = ARRAY_SIZE(skl_hda_be_dai_links); - num_route = ARRAY_SIZE(skl_hda_map); - card->dapm_widgets = skl_hda_widgets; - card->num_dapm_widgets = ARRAY_SIZE(skl_hda_widgets); - 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++) { - skl_hda_be_dai_links[i].codecs = &snd_soc_dummy_dlc; - skl_hda_be_dai_links[i].num_codecs = 1; - } - } - } - - 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; - - for_each_card_prelinks(card, i, dai_link) - dai_link->platforms->name = mach_params->platform; - - return 0; -} - static void skl_set_hda_codec_autosuspend_delay(struct snd_soc_card *card) { struct snd_soc_pcm_runtime *rtd; @@ -203,48 +48,80 @@ static void skl_set_hda_codec_autosuspend_delay(struct snd_soc_card *card) } } +#define IDISP_HDMI_BE_ID 1 +#define HDA_BE_ID 4 +#define DMIC01_BE_ID 6 +#define DMIC16K_BE_ID 7 +#define BT_OFFLOAD_BE_ID 8 + +#define HDA_LINK_ORDER SOF_LINK_ORDER(SOF_LINK_IDISP_HDMI, \ + SOF_LINK_HDA, \ + SOF_LINK_DMIC01, \ + SOF_LINK_DMIC16K, \ + SOF_LINK_BT_OFFLOAD, \ + SOF_LINK_NONE, \ + SOF_LINK_NONE) + +#define HDA_LINK_IDS SOF_LINK_ORDER(IDISP_HDMI_BE_ID, \ + HDA_BE_ID, \ + DMIC01_BE_ID, \ + DMIC16K_BE_ID, \ + BT_OFFLOAD_BE_ID, \ + 0, \ + 0) + +static unsigned long +skl_hda_get_board_quirk(struct snd_soc_acpi_mach_params *mach_params) +{ + unsigned long board_quirk = 0; + int ssp_bt; + + if (hweight_long(mach_params->bt_link_mask) == 1) { + ssp_bt = fls(mach_params->bt_link_mask) - 1; + board_quirk |= SOF_SSP_PORT_BT_OFFLOAD(ssp_bt) | + SOF_BT_OFFLOAD_PRESENT; + } + + return board_quirk; +} + static int skl_hda_audio_probe(struct platform_device *pdev) { struct snd_soc_acpi_mach *mach = pdev->dev.platform_data; - struct skl_hda_private *ctx; + struct sof_card_private *ctx; struct snd_soc_card *card; + unsigned long board_quirk = skl_hda_get_board_quirk(&mach->mach_params); int ret; - dev_dbg(&pdev->dev, "entry\n"); - - ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); - if (!ctx) + card = devm_kzalloc(&pdev->dev, sizeof(struct snd_soc_card), GFP_KERNEL); + if (!card) return -ENOMEM; - card = &ctx->card; card->name = "hda-dsp"; card->owner = THIS_MODULE; - card->dai_link = skl_hda_be_dai_links; - card->dapm_widgets = skl_hda_widgets; - card->dapm_routes = skl_hda_map; - card->add_dai_link = skl_hda_add_dai_link; card->fully_routed = true; card->late_probe = skl_hda_card_late_probe; - snd_soc_card_set_drvdata(card, ctx); + dev_dbg(&pdev->dev, "board_quirk = %lx\n", board_quirk); + + /* initialize ctx with board quirk */ + ctx = sof_intel_board_get_ctx(&pdev->dev, board_quirk); + if (!ctx) + return -ENOMEM; + + if (HDA_EXT_CODEC(mach->mach_params.codec_mask)) + ctx->hda_codec_present = true; 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; - } + ctx->link_order_overwrite = HDA_LINK_ORDER; + ctx->link_id_overwrite = HDA_LINK_IDS; - 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"); + /* update dai_link */ + ret = sof_intel_board_set_dai_link(&pdev->dev, card, ctx); + if (ret) return ret; - } - - 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; card->dev = &pdev->dev; if (!snd_soc_acpi_sof_parent(&pdev->dev)) @@ -258,6 +135,13 @@ static int skl_hda_audio_probe(struct platform_device *pdev) return -ENOMEM; } + ret = snd_soc_fixup_dai_links_platform_name(card, + mach->mach_params.platform); + if (ret) + return ret; + + snd_soc_card_set_drvdata(card, ctx); + ret = devm_snd_soc_register_card(&pdev->dev, card); if (!ret) skl_set_hda_codec_autosuspend_delay(card); @@ -280,4 +164,4 @@ MODULE_DESCRIPTION("SKL/KBL/BXT/APL HDA Generic Machine driver"); MODULE_AUTHOR("Rakesh Ughreja "); MODULE_LICENSE("GPL v2"); MODULE_ALIAS("platform:skl_hda_dsp_generic"); -MODULE_IMPORT_NS(SND_SOC_INTEL_HDA_DSP_COMMON); +MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS); From patchwork Thu Sep 12 12:03:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13802062 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (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 108561A0BFD for ; Thu, 12 Sep 2024 12:03:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726142613; cv=none; b=HfDaXlYv2I3K0JEduooLF/NTvlsRB4vRLxsySQCkRcyNCRakyY6SEX0D90a/QaCeAcf7+4rIgj6BV/xx6xe7U6F3sR1lVIB3yqEKzScZpry3NLl2XwiyDkhCgo0anjrUg6M+l5Y8KIAiR4DZZGpgGhmqhfIhdQ0vfyd/9s9WrPo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726142613; c=relaxed/simple; bh=yZhP2xmJEUfYuCKL+dlYAtUSzAdTI+TZ8PJ8BI7MthU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KwL1CVmkOKHBiTd+7lF7iEg3joHNEdpVaHkOKHvQZ3n6IhCSqC629LVBUMvalGxJw/XmC+zLsvDSSOtb3a+QUKNIeiwindFzZ40/sTQidxvn50hfX8L7fFizU9xCHzZXuQwC/uHHq5RBitjImokh/mgqtsrITYysHOHP9HtEVJ4= 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=egYUbYpu; arc=none smtp.client-ip=198.175.65.20 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="egYUbYpu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1726142612; x=1757678612; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yZhP2xmJEUfYuCKL+dlYAtUSzAdTI+TZ8PJ8BI7MthU=; b=egYUbYpunKvIEQVJgLszrubvvyO2aZ0W1o1OPr6BE3f0+RWeY4riySIR w+40FLB4ZU2BafR39Mn+aWI8Bskb1+YGEB/9i/aLypr8VS3a4CVN4w7hJ ESYGvocaEUq4vR2fAS1yc0JhmDL+mAMacRZnzkBfGPir65E3I/L3S5G+a sZmx/Tv1vzbrMKKQzqsewAnlYV6O2mXQd6LZspNbIkbAnQjc7DNdRVY8g WHRa1LCunEmYh6Zf9uYkJbm85PlW2bJYcGWA1iGGQCHtxRrid4Z7lsfmh b3ZXahECjKIkRbC7YxL4ZxFRoT0OB4oUnoP2JFbpzE/pXuZ5Kn7U+ojH6 g==; X-CSE-ConnectionGUID: 3keizsbnTUKCrV7VcQQM0g== X-CSE-MsgGUID: XEot1WwmSr+0F0SSsZZhfA== X-IronPort-AV: E=McAfee;i="6700,10204,11192"; a="24812776" X-IronPort-AV: E=Sophos;i="6.10,222,1719903600"; d="scan'208";a="24812776" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2024 05:03:26 -0700 X-CSE-ConnectionGUID: IfW4mWatQuS6aSh7iWOyWQ== X-CSE-MsgGUID: o6XkTrzqREeDQAwaEh/WsA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,222,1719903600"; d="scan'208";a="68459168" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.119.14]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2024 05:03:24 -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 3/7] ASoC: Intel: ehl_rt5660: do not check common_hdmi_codec_drv Date: Thu, 12 Sep 2024 20:03:04 +0800 Message-ID: <20240912120308.134762-4-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240912120308.134762-1-yung-chuan.liao@linux.intel.com> References: <20240912120308.134762-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 The variable common_hdmi_codec_drv is always true on SOF platform so we could remove the reference in machine driver. Signed-off-by: Brent Lu Reviewed-by: Péter Ujfalusi Signed-off-by: Bard Liao --- sound/soc/intel/boards/ehl_rt5660.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/intel/boards/ehl_rt5660.c b/sound/soc/intel/boards/ehl_rt5660.c index 26289e8fdd87..90d93e667bd9 100644 --- a/sound/soc/intel/boards/ehl_rt5660.c +++ b/sound/soc/intel/boards/ehl_rt5660.c @@ -256,8 +256,7 @@ static void hdmi_link_init(struct snd_soc_card *card, { int i; - if (mach->mach_params.common_hdmi_codec_drv && - (mach->mach_params.codec_mask & IDISP_CODEC_MASK)) { + if (mach->mach_params.codec_mask & IDISP_CODEC_MASK) { ctx->idisp_codec = true; return; } From patchwork Thu Sep 12 12:03:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13802063 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (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 BDF491A0BF7 for ; Thu, 12 Sep 2024 12:03:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726142615; cv=none; b=SUIXpfevPvXC4gATA1K+eOCI/1N0LGtdpjz5QpAKPi9plosEhQEEfy8IyG913dgoaNtvVqSXCdIjOOvJdTnG3xiQwaRHLKUqp0MfnEn6iWm4MTF2HXJAzNxxqSF2+D/najD4WHBA4ifynYtZpKvnd1g1n3ZyZFRc+/t0ckHIJtk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726142615; c=relaxed/simple; bh=Pl865cnIKOAZRPbGTwMrsc3uFn8+kgQUiZB0h6AiTEc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Gmr/Ctdt9z6CLldNKQbbucIhkBQK3vxVHb42A9Gj0Hj5dJ5hzCINGZBna7+DxeQhDOVOf4HMTtLZfPJbtohq0+ZZAZHzMzRa1yrTCzxXuDJY5HgzPc6KAyUzWK8xPFW4BtrWVsdjGalymQ27g+aHin1qGfXZVGsL1qbewtCG7WU= 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=a+7+LmXe; arc=none smtp.client-ip=198.175.65.20 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="a+7+LmXe" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1726142614; x=1757678614; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Pl865cnIKOAZRPbGTwMrsc3uFn8+kgQUiZB0h6AiTEc=; b=a+7+LmXer/c9DFoRVvnXE7/SUKpMZMSlxG/Ma+sESG6E8kAjjg//F1JQ 5iB/pIBw+wd+H5awK5+ZuvcisQG35OtVCsAuiLHsn2JTC8MqMQWZEFZ8n GCrlGwpAImPKUEipXtO6GuJfkogJnzXszzzT8Uk4WHfJ4MWHz4hWv3/7t WgbDCzKyzfb7rOoXq4xs56DUeOom1C1IKXIz18/XEB0oyWRPWuDFOK81j sE2PWKeCVcSF+UvC7+xVIlq882wPd6JuUTb1OTUtOiPMmUcZOGHYMG3aF 71F9z+tjc0fcVY3Hx6ywokIesjUef/7ROSIh70tIHIrq6oBwBuCB530xc A==; X-CSE-ConnectionGUID: VAWpuDuUTU+iIvuBMOG82w== X-CSE-MsgGUID: vBFmBuz6T02+RqS8mFsb0A== X-IronPort-AV: E=McAfee;i="6700,10204,11192"; a="24812781" X-IronPort-AV: E=Sophos;i="6.10,222,1719903600"; d="scan'208";a="24812781" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2024 05:03:29 -0700 X-CSE-ConnectionGUID: 1fEnGL9UQyaM86KPK8nv+w== X-CSE-MsgGUID: aiK2B+12RYSsv5TZk2bYDw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,222,1719903600"; d="scan'208";a="68459178" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.119.14]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2024 05:03:27 -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 4/7] ASoC: Intel: sof_pcm512x: do not check common_hdmi_codec_drv Date: Thu, 12 Sep 2024 20:03:05 +0800 Message-ID: <20240912120308.134762-5-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240912120308.134762-1-yung-chuan.liao@linux.intel.com> References: <20240912120308.134762-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 The variable common_hdmi_codec_drv is always true on SOF platform so we could remove the reference in machine driver. Signed-off-by: Brent Lu Reviewed-by: Péter Ujfalusi Signed-off-by: Bard Liao --- sound/soc/intel/boards/sof_pcm512x.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/intel/boards/sof_pcm512x.c b/sound/soc/intel/boards/sof_pcm512x.c index 5de883b9563e..8d237f67bd06 100644 --- a/sound/soc/intel/boards/sof_pcm512x.c +++ b/sound/soc/intel/boards/sof_pcm512x.c @@ -371,8 +371,7 @@ static int sof_audio_probe(struct platform_device *pdev) sof_pcm512x_quirk = SOF_PCM512X_SSP_CODEC(2); } else { dmic_be_num = 2; - if (mach->mach_params.common_hdmi_codec_drv && - (mach->mach_params.codec_mask & IDISP_CODEC_MASK)) + if (mach->mach_params.codec_mask & IDISP_CODEC_MASK) ctx->idisp_codec = true; /* links are always present in topology */ From patchwork Thu Sep 12 12:03:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13802064 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (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 2B3401A0BFD for ; Thu, 12 Sep 2024 12:03:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726142615; cv=none; b=SgVYDc5fPk9XuYRf+zpEuF6JE70G0eJFjpLc8zz24GLuZJN1x7+pUsQZN7OmphJXpDXjGMGu895hUjRhCRMeiHGEpwUCB/Uu8/hCwhFQ8akdj2F0Z2lHT++VxNfLKBmpWLjcuOjuvol7kJMPOtlrk7HU0r3nyBbeoED6GJ0tbWU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726142615; c=relaxed/simple; bh=ptQbojTywScC+fZE1h5CWKeL5LHKDu2/C6I0qyIJaD0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UaAWz8qVa8sJDC4/wm+uSrhWuBeqsFeM1KRBL3VLLHINQ+PN/4yYzk2FOpMjb2yhdARmIZFRTWH9aNIDO+Cf870v6xNsSDgeYPuhxQ85Lniu8arJgq6goIsm6YA07MqnZw10iLvyxm1MMW22zYnx2aAaKUiFI5Sp9rg8Tjs/Zsc= 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=nhNa7+M3; arc=none smtp.client-ip=198.175.65.20 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="nhNa7+M3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1726142615; x=1757678615; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ptQbojTywScC+fZE1h5CWKeL5LHKDu2/C6I0qyIJaD0=; b=nhNa7+M3nH5LdLsqzXFHG7RpV8nTT1QTTdrhgFGVfF7wA3wFbmfCuhOI R7FRICk01hfTEMuoAnF3GUyl5OuYfm26WvfzuDyDyyn0XX6WycZNIDKnB bQ2MI209xN7ccpfzZMYelsXNt7UHjT6a0xs4LQXamICXZG3b0HbyqU0mA QTztKO5iGk9kvWc21OS4ouol6H+6aVjTIgjBuTnxw/KWG9UNGQUejGOjq pGR7JWeHgZ4kUTqqaGE8Pd1x9aat0IlBfQJr8Z18YvUs81MjW2rDplbKN ma/rMAtwtbUGjw58NAIJQLd4n1Jiqcuw8vEtmb1lZRpP75LfSm64Ff0Nx Q==; X-CSE-ConnectionGUID: EzPR4GWAT3qamhHwM1o9jg== X-CSE-MsgGUID: L1esGsNVSTWoUP0gVM/KaA== X-IronPort-AV: E=McAfee;i="6700,10204,11192"; a="24812787" X-IronPort-AV: E=Sophos;i="6.10,222,1719903600"; d="scan'208";a="24812787" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2024 05:03:32 -0700 X-CSE-ConnectionGUID: 7NdI2B1RTbahetRwiFrnGA== X-CSE-MsgGUID: XRhl0mL+Sw62KkVJMBa8Rw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,222,1719903600"; d="scan'208";a="68459188" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.119.14]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2024 05:03: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 5/7] ASoC: SOF: Intel: hda: remove common_hdmi_codec_drv Date: Thu, 12 Sep 2024 20:03:06 +0800 Message-ID: <20240912120308.134762-6-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240912120308.134762-1-yung-chuan.liao@linux.intel.com> References: <20240912120308.134762-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 Do not set common_hdmi_codec_drv in SOF platform driver since no machine driver needs it. Remove member variable common_hdmi_codec_drv from snd_soc_acpi_mach_params structure. Signed-off-by: Brent Lu Reviewed-by: Péter Ujfalusi Signed-off-by: Bard Liao --- include/sound/soc-acpi.h | 2 -- sound/soc/sof/intel/hda.c | 1 - 2 files changed, 3 deletions(-) diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h index c1552bc6e31c..60d3b86a4660 100644 --- a/include/sound/soc-acpi.h +++ b/include/sound/soc-acpi.h @@ -62,7 +62,6 @@ static inline struct snd_soc_acpi_mach *snd_soc_acpi_codec_list(void *arg) * @platform: string used for HDAudio codec support * @codec_mask: used for HDAudio support * @dmic_num: number of SoC- or chipset-attached PDM digital microphones - * @common_hdmi_codec_drv: use commom HDAudio HDMI codec driver * @link_mask: SoundWire links enabled on the board * @links: array of SoundWire link _ADR descriptors, null terminated * @i2s_link_mask: I2S/TDM links enabled on the board @@ -80,7 +79,6 @@ struct snd_soc_acpi_mach_params { const char *platform; u32 codec_mask; u32 dmic_num; - bool common_hdmi_codec_drv; u32 link_mask; const struct snd_soc_acpi_link_adr *links; u32 i2s_link_mask; diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index d0a41e8e6334..70fc08c8fc99 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -1051,7 +1051,6 @@ static void hda_generic_machine_select(struct snd_sof_dev *sdev, if (*mach) { mach_params = &(*mach)->mach_params; mach_params->codec_mask = bus->codec_mask; - mach_params->common_hdmi_codec_drv = true; } } #else From patchwork Thu Sep 12 12:03: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: 13802065 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (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 2AF321A263E for ; Thu, 12 Sep 2024 12:03:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726142616; cv=none; b=Xza5jDePg7x5tefp9kpM9y2o51hhWc5pNvHjXY2+eij0JfY8unxFu9V9gjQlk+6mVc+0+7PKbaOPhP2DL5RII7BKxRoaCTqNRrfjGYA8mGyBha4tyBKB1ZPBU41S60hAMBR8RL0G9X3CKOEW/8mVd115UVGaRL79RO8QDU9U5TY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726142616; c=relaxed/simple; bh=G1T6fGo/525oLZSKNzVFmMxTU/Cry1bigfolNU5BPZA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a4w/lgJHiAlAlqlQGcAFALLc3DKwEONB/tgEUfTLMwaTiZR805F9Xd12dGecy3yQJU+Udz4E7FRGXB++AVkRcOEvh1VbXn8v1Uo7RNSrDPPyXgS5hUqFGH/t1FAwBkTl/TWPWE26BKFzDKhKd6R3BcNMVS1BcKt1JoueIHwVCXk= 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=gGIM1nvK; arc=none smtp.client-ip=198.175.65.20 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="gGIM1nvK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1726142615; x=1757678615; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=G1T6fGo/525oLZSKNzVFmMxTU/Cry1bigfolNU5BPZA=; b=gGIM1nvKOUFL8xpE9HWzSziVzd6L7OtQAqbUwL7OvBof0e/H4nF99UZP 3BbvB8x6ppk/nJeYeRc68vGadYWwOhhMHmwkYzCmLAd8WMoynnvpzykHk bb80A9ttohiiPXKskK7OoZQuw6RFKAFPpjvlCSo3Na6KC+2KcStC1nwDc /QXAff9wOND8hHCcXwBisBmJFagBejRtuhB471o2/YpK6x7awfUQksGb2 CW532zDc0RUJ0CjiZDYe5nm6oxaOSwqJv9o2uv8VqouxYtDb7cQpMfrGI mADJLupYhZoiWh6oecllZofI/HfLFAoicBlPOvYUPP/XcdOeEeyDukWI0 w==; X-CSE-ConnectionGUID: oyPpfxpOTM+RbaEGFZs1ew== X-CSE-MsgGUID: pq6TSxQJQ4m22siu3gmBrQ== X-IronPort-AV: E=McAfee;i="6700,10204,11192"; a="24812795" X-IronPort-AV: E=Sophos;i="6.10,222,1719903600"; d="scan'208";a="24812795" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2024 05:03:34 -0700 X-CSE-ConnectionGUID: WAzGqDKMRcaPPcNrwTTJgQ== X-CSE-MsgGUID: RZWdwF6MSaq3SozUzTo6dw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,222,1719903600"; d="scan'208";a="68459200" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.119.14]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2024 05:03:32 -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 6/7] ASoC: Intel: sof_rt5682: Add HDMI-In capture with rt5682 support for ARL. Date: Thu, 12 Sep 2024 20:03:07 +0800 Message-ID: <20240912120308.134762-7-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240912120308.134762-1-yung-chuan.liao@linux.intel.com> References: <20240912120308.134762-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 Added match table entry on arl machines to support HDMI-In capture with rt5682 I2S audio codec. also added the respective quirk configuration in rt5682 machine driver. Signed-off-by: Balamurugan C Signed-off-by: Bard Liao --- sound/soc/intel/boards/sof_rt5682.c | 7 +++++++ sound/soc/intel/common/soc-acpi-intel-arl-match.c | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c index 23a40b913290..bc581fea0e3a 100644 --- a/sound/soc/intel/boards/sof_rt5682.c +++ b/sound/soc/intel/boards/sof_rt5682.c @@ -870,6 +870,13 @@ static const struct platform_device_id board_ids[] = { SOF_SSP_PORT_BT_OFFLOAD(2) | SOF_BT_OFFLOAD_PRESENT), }, + { + .name = "arl_rt5682_c1_h02", + .driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN | + SOF_SSP_PORT_CODEC(1) | + /* SSP 0 and SSP 2 are used for HDMI IN */ + SOF_SSP_MASK_HDMI_CAPTURE(0x5)), + }, { } }; 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 9936a4b4eee7..c13afff84923 100644 --- a/sound/soc/intel/common/soc-acpi-intel-arl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-arl-match.c @@ -7,6 +7,7 @@ #include #include +#include static const struct snd_soc_acpi_endpoint single_endpoint = { .num = 0, @@ -289,6 +290,11 @@ static const struct snd_soc_acpi_codecs arl_essx_83x6 = { .codecs = { "ESSX8316", "ESSX8326", "ESSX8336"}, }; +static const struct snd_soc_acpi_codecs arl_rt5682_hp = { + .num_codecs = 2, + .codecs = {RT5682_ACPI_HID, RT5682S_ACPI_HID}, +}; + static const struct snd_soc_acpi_codecs arl_lt6911_hdmi = { .num_codecs = 1, .codecs = {"INTC10B0"} @@ -310,6 +316,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_arl_machines[] = { SND_SOC_ACPI_TPLG_INTEL_SSP_MSB | SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER, }, + { + .comp_ids = &arl_rt5682_hp, + .drv_name = "arl_rt5682_c1_h02", + .machine_quirk = snd_soc_acpi_codec_list, + .quirk_data = &arl_lt6911_hdmi, + .sof_tplg_filename = "sof-arl-rt5682-ssp1-hdmi-ssp02.tplg", + }, {}, }; EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_arl_machines); From patchwork Thu Sep 12 12:03: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: 13802066 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (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 2D4221A263E for ; Thu, 12 Sep 2024 12:03:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726142618; cv=none; b=ks4nJuN0FOVVZg8VX3/+NFo49IBD3Oe/y6XEO9x+I3Md2MxBDhnsh4D45RetbNRxE4QeWLax9UGHpLdTn+WdiKWdwFrOrqudOsYevYAAEbLM97UXZf1ZpphW5efOFkiZkwtOJAbba1iaG98ECTfkJLwQPwFB9SnRZWA5vJMig7Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726142618; c=relaxed/simple; bh=8l2/JABV6H5hQ/YCfrafkBQB+l3NZBTPfqVM1ryBXtg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DFKZR1Uvysxn2Y8dx31ZLNdfJ0C+bKrIkj7B16pqJ4dg75RUjmoVwFwKY8/yVuDeCS1cIWS+KS1x+bx0i168o7oRlu24UAvzt3nugrtNk7QwyJE5hUedxr7VdTeWJTc2M4i5FKmuKCwbRFXIUtXesqQ+s6mgaIYiGg3SXMpmSNw= 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=WMJH/+UL; arc=none smtp.client-ip=198.175.65.20 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="WMJH/+UL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1726142618; x=1757678618; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8l2/JABV6H5hQ/YCfrafkBQB+l3NZBTPfqVM1ryBXtg=; b=WMJH/+ULwKa11TsvkidEIAtKDuSDcX9o7DlTTq9QUxEb3GYURra+yZ9u 4z1SZHjwWmrfqK8hNlx25HoFyXioTFudaJm/hIXmzMiA0CDV/A8ttak1i NBYywqRjxewXx0snTluQsrksCxl44fEnW4M7ECPY4pmMVdPIeBhQPhOvy RO5pWDOfXp98+ahnaONXHVHJRDmrKwTv3CnlumcmFRetta7tMV/bdFaNo 0xT1bvy6bfgRd7nCP5JyxYkhu/z6R5s3YkuT+UI+QY9WqJV8NdV5aatUQ +M+BJLjrE+Ilwpweh3uA8kHVfAwZuAgp4e03WACU0/iR4HEg8CcsZCCI4 g==; X-CSE-ConnectionGUID: GD2ZZWyxQDODaAqemljBIw== X-CSE-MsgGUID: 2v3TMWBOTIG7sZMWUB7g7g== X-IronPort-AV: E=McAfee;i="6700,10204,11192"; a="24812804" X-IronPort-AV: E=Sophos;i="6.10,222,1719903600"; d="scan'208";a="24812804" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2024 05:03:37 -0700 X-CSE-ConnectionGUID: bZDq6MwRT2eYDeUsyJBHQw== X-CSE-MsgGUID: mxFHo/UESHCgllSYipeGbA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,222,1719903600"; d="scan'208";a="68459213" Received: from anmitta2-mobl4.gar.corp.intel.com (HELO yungchua-desk.intel.com) ([10.247.119.14]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2024 05:03:35 -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 7/7] ASoC: Intel: ARL: Add entry for HDMI-In capture support to non-I2S codec boards. Date: Thu, 12 Sep 2024 20:03:08 +0800 Message-ID: <20240912120308.134762-8-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240912120308.134762-1-yung-chuan.liao@linux.intel.com> References: <20240912120308.134762-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 support for the ARL products which doesn't have onboard I2S codec. But need to support HDMI-In capture via I2S and audio playback through HDMI/DP monitor. Signed-off-by: Balamurugan C Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- sound/soc/intel/boards/sof_ssp_amp.c | 6 ++++++ sound/soc/intel/common/soc-acpi-intel-arl-match.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/sound/soc/intel/boards/sof_ssp_amp.c b/sound/soc/intel/boards/sof_ssp_amp.c index f51f1008e016..6ff8895a294a 100644 --- a/sound/soc/intel/boards/sof_ssp_amp.c +++ b/sound/soc/intel/boards/sof_ssp_amp.c @@ -210,6 +210,12 @@ static const struct platform_device_id board_ids[] = { /* SSP 0 and SSP 2 are used for HDMI IN */ SOF_HDMI_PLAYBACK_PRESENT), }, + { + .name = "arl_lt6911_hdmi_ssp", + .driver_data = (kernel_ulong_t)(SOF_SSP_MASK_HDMI_CAPTURE(0x5) | + /* SSP 0 and SSP 2 are used for HDMI IN */ + SOF_HDMI_PLAYBACK_PRESENT), + }, { } }; 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 c13afff84923..c97c961187dd 100644 --- a/sound/soc/intel/common/soc-acpi-intel-arl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-arl-match.c @@ -323,6 +323,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_arl_machines[] = { .quirk_data = &arl_lt6911_hdmi, .sof_tplg_filename = "sof-arl-rt5682-ssp1-hdmi-ssp02.tplg", }, + /* place amp-only boards in the end of table */ + { + .id = "INTC10B0", + .drv_name = "arl_lt6911_hdmi_ssp", + .sof_tplg_filename = "sof-arl-hdmi-ssp02.tplg", + }, {}, }; EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_arl_machines);