alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/13] ASoC: Intel: machine drivers update for 5.8
@ 2020-04-09 18:58 Pierre-Louis Bossart
  2020-04-09 18:58 ` [PATCH 01/13] ASoC: Intel: sof_da7219_max98373: Add BE dailink for dmic16k Pierre-Louis Bossart
                   ` (12 more replies)
  0 siblings, 13 replies; 31+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-09 18:58 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Pierre-Louis Bossart

This patchset
a) adds support for the Intel ElkhartLake platforms
b)aligns the HDaudio mic detection with the snd-hda-intel driver
c) correct DMIC missing configurations
d) fixes initialization/compilation problems for SoundWire platforms
d) completes the removal of codec_dais missing in Morimoto-san's series.

Bard Liao (1):
  ASoC: intel: sof_sdw: init all aggregated codecs

Hui Wang (1):
  ASoC: intel/skl/hda - set autosuspend timeout for hda codecs

Keyon Jie (1):
  ASoC: Intel: sof-da7219-max98373: add DMIC widget and route

Libin Yang (3):
  ALSA: hda: Add ElkhartLake HDMI codec vid
  ASoC: SOF: Intel: add PCI ID for ElkhartLake
  ASoC: Intel: boards: support Elkhart Lake with rt5660

Pierre-Louis Bossart (6):
  ASoC: Intel: sof_sdw_hdmi: fix compilation issue in fallback mode
  ASoC: Intel: sof_sdw_hdmi: remove codec_dai use
  ASoC: Intel: sof_sdw_rt1308: remove codec dai use
  ASoC: Intel: sof_sdw_rt5682: remove codec_dai use
  ASoC: Intel: sof_sdw_rt700: remove codec_dai use
  ASoC: Intel: sof_sdw_rt711: remove codec_dai use

Yong Zhi (1):
  ASoC: Intel: sof_da7219_max98373: Add BE dailink for dmic16k

 sound/pci/hda/patch_hdmi.c                    |   1 +
 sound/soc/intel/boards/Kconfig                |  15 +
 sound/soc/intel/boards/Makefile               |   2 +
 sound/soc/intel/boards/ehl_rt5660.c           | 323 ++++++++++++++++++
 sound/soc/intel/boards/skl_hda_dsp_generic.c  |  29 +-
 sound/soc/intel/boards/sof_da7219_max98373.c  |  21 ++
 sound/soc/intel/boards/sof_sdw.c              |  41 ++-
 sound/soc/intel/boards/sof_sdw_hdmi.c         |   4 +-
 sound/soc/intel/boards/sof_sdw_rt1308.c       |   2 +-
 sound/soc/intel/boards/sof_sdw_rt5682.c       |   3 +-
 sound/soc/intel/boards/sof_sdw_rt700.c        |   3 +-
 sound/soc/intel/boards/sof_sdw_rt711.c        |   3 +-
 .../intel/common/soc-acpi-intel-ehl-match.c   |   7 +
 sound/soc/sof/sof-pci-dev.c                   |   2 +
 14 files changed, 434 insertions(+), 22 deletions(-)
 create mode 100644 sound/soc/intel/boards/ehl_rt5660.c


base-commit: dd8e871d4e560eeb8d22af82dde91457ad835a63
-- 
2.20.1


^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 01/13] ASoC: Intel: sof_da7219_max98373: Add BE dailink for dmic16k
  2020-04-09 18:58 [PATCH 00/13] ASoC: Intel: machine drivers update for 5.8 Pierre-Louis Bossart
@ 2020-04-09 18:58 ` Pierre-Louis Bossart
  2020-04-14 14:48   ` Applied "ASoC: Intel: sof_da7219_max98373: Add BE dailink for dmic16k" to the asoc tree Mark Brown
  2020-04-09 18:58 ` [PATCH 02/13] ASoC: intel/skl/hda - set autosuspend timeout for hda codecs Pierre-Louis Bossart
                   ` (11 subsequent siblings)
  12 siblings, 1 reply; 31+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-09 18:58 UTC (permalink / raw)
  To: alsa-devel
  Cc: Kai Vehmanen, tiwai, Pierre-Louis Bossart, Ranjani Sridharan,
	broonie, Yong Zhi

From: Yong Zhi <yong.zhi@intel.com>

Add dmic16k BE dailink for keyword detection support, FE is
added in topology tplg file.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/sof_da7219_max98373.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sound/soc/intel/boards/sof_da7219_max98373.c b/sound/soc/intel/boards/sof_da7219_max98373.c
index b707dd3b5625..8b5b74ba349f 100644
--- a/sound/soc/intel/boards/sof_da7219_max98373.c
+++ b/sound/soc/intel/boards/sof_da7219_max98373.c
@@ -265,6 +265,9 @@ SND_SOC_DAILINK_DEF(dmic_pin,
 SND_SOC_DAILINK_DEF(dmic_codec,
 	DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", "dmic-hifi")));
 
+SND_SOC_DAILINK_DEF(dmic16k_pin,
+	DAILINK_COMP_ARRAY(COMP_CPU("DMIC16k Pin")));
+
 SND_SOC_DAILINK_DEF(idisp1_pin,
 	DAILINK_COMP_ARRAY(COMP_CPU("iDisp1 Pin")));
 SND_SOC_DAILINK_DEF(idisp1_codec,
@@ -337,6 +340,14 @@ static struct snd_soc_dai_link dais[] = {
 		.no_pcm = 1,
 		SND_SOC_DAILINK_REG(idisp3_pin, idisp3_codec, platform),
 	},
+	{
+		.name = "dmic16k",
+		.id = 6,
+		.ignore_suspend = 1,
+		.dpcm_capture = 1,
+		.no_pcm = 1,
+		SND_SOC_DAILINK_REG(dmic16k_pin, dmic_codec, platform),
+	}
 };
 
 static struct snd_soc_card card_da7219_m98373 = {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 02/13] ASoC: intel/skl/hda - set autosuspend timeout for hda codecs
  2020-04-09 18:58 [PATCH 00/13] ASoC: Intel: machine drivers update for 5.8 Pierre-Louis Bossart
  2020-04-09 18:58 ` [PATCH 01/13] ASoC: Intel: sof_da7219_max98373: Add BE dailink for dmic16k Pierre-Louis Bossart
@ 2020-04-09 18:58 ` Pierre-Louis Bossart
  2020-04-14 14:48   ` Applied "ASoC: intel/skl/hda - set autosuspend timeout for hda codecs" to the asoc tree Mark Brown
  2020-04-09 18:58 ` [PATCH 03/13] ALSA: hda: Add ElkhartLake HDMI codec vid Pierre-Louis Bossart
                   ` (10 subsequent siblings)
  12 siblings, 1 reply; 31+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-09 18:58 UTC (permalink / raw)
  To: alsa-devel
  Cc: Kai Vehmanen, tiwai, Ranjani Sridharan, Pierre-Louis Bossart,
	Hui Wang, Clarex Zhou, broonie, Jaska Uimonen

From: Hui Wang <hui.wang@canonical.com>

On some Lenovo and HP laptops, if both codec driver and SOF driver
are in runtime suspend mode, we plug a headset to the audio jack,
the headphone could be detected but Mic couldn't.

That is because when plugging, the headphone triggers a unsol event
first, and about 0.7s later (on the Lenovo X1 Carbon 7th), the Mic
triggers a unsol event. But if the codec driver enters runtime suspend
within 0.7s, the Mic can't trigger the unsol event.

If we don't set autosuspend_delay to a non-zero value for the hda codec
driver, it will enter runtime suspend immediately after the headphone
triggers the unsol event.

Follow the sequence of legacy hda driver and set a autosuspend delay
of 1sec after card registration (refer to pci/hda/hda_intel.c and
pci/hda/hda_codec.c).

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Co-developed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Co-developed-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Clarex Zhou <clarex.zhou@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/skl_hda_dsp_generic.c | 29 +++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/skl_hda_dsp_generic.c b/sound/soc/intel/boards/skl_hda_dsp_generic.c
index 3be764299ab0..64197b010e7d 100644
--- a/sound/soc/intel/boards/skl_hda_dsp_generic.c
+++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c
@@ -113,6 +113,8 @@ static char hda_soc_components[30];
 #define IDISP_ROUTE_COUNT	(IDISP_DAI_COUNT * 2)
 #define IDISP_CODEC_MASK	0x4
 
+#define HDA_CODEC_AUTOSUSPEND_DELAY_MS 1000
+
 static int skl_hda_fill_card_info(struct snd_soc_acpi_mach_params *mach_params)
 {
 	struct snd_soc_card *card = &hda_soc_card;
@@ -168,6 +170,27 @@ static int skl_hda_fill_card_info(struct snd_soc_acpi_mach_params *mach_params)
 	return 0;
 }
 
+static void skl_set_hda_codec_autosuspend_delay(struct snd_soc_card *card)
+{
+	struct snd_soc_pcm_runtime *rtd =
+		list_first_entry(&card->rtd_list,
+				 struct snd_soc_pcm_runtime, list);
+	struct snd_soc_dai *codec_dai = rtd->codec_dai;
+	struct hdac_hda_priv *hda_pvt;
+
+	if (!codec_dai)
+		return;
+
+	/*
+	 * all codecs are on the same bus, so it's sufficient
+	 * to lookup the first runtime and its codec, and set
+	 * power save defaults for all codecs on the bus
+	 */
+	hda_pvt = snd_soc_component_get_drvdata(codec_dai->component);
+	snd_hda_set_power_save(hda_pvt->codec.bus,
+			       HDA_CODEC_AUTOSUSPEND_DELAY_MS);
+}
+
 static int skl_hda_audio_probe(struct platform_device *pdev)
 {
 	struct snd_soc_acpi_mach *mach;
@@ -206,7 +229,11 @@ static int skl_hda_audio_probe(struct platform_device *pdev)
 		hda_soc_card.components = hda_soc_components;
 	}
 
-	return devm_snd_soc_register_card(&pdev->dev, &hda_soc_card);
+	ret = devm_snd_soc_register_card(&pdev->dev, &hda_soc_card);
+	if (!ret)
+		skl_set_hda_codec_autosuspend_delay(&hda_soc_card);
+
+	return ret;
 }
 
 static struct platform_driver skl_hda_audio = {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 03/13] ALSA: hda: Add ElkhartLake HDMI codec vid
  2020-04-09 18:58 [PATCH 00/13] ASoC: Intel: machine drivers update for 5.8 Pierre-Louis Bossart
  2020-04-09 18:58 ` [PATCH 01/13] ASoC: Intel: sof_da7219_max98373: Add BE dailink for dmic16k Pierre-Louis Bossart
  2020-04-09 18:58 ` [PATCH 02/13] ASoC: intel/skl/hda - set autosuspend timeout for hda codecs Pierre-Louis Bossart
@ 2020-04-09 18:58 ` Pierre-Louis Bossart
  2020-04-11 10:29   ` Takashi Iwai
  2020-04-14 14:48   ` Applied "ALSA: hda: Add ElkhartLake HDMI codec vid" to the asoc tree Mark Brown
  2020-04-09 18:58 ` [PATCH 04/13] ASoC: SOF: Intel: add PCI ID for ElkhartLake Pierre-Louis Bossart
                   ` (9 subsequent siblings)
  12 siblings, 2 replies; 31+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-09 18:58 UTC (permalink / raw)
  To: alsa-devel
  Cc: Guennadi Liakhovetski, Kai Vehmanen, tiwai, Pierre-Louis Bossart,
	broonie, Libin Yang, Bard Liao

From: Libin Yang <libin.yang@linux.intel.com>

Add HDMI codec vid for the Intel ElkhartLake platform

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/pci/hda/patch_hdmi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 5119a9ae3d8a..e473247f1a14 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -4289,6 +4289,7 @@ HDA_CODEC_ENTRY(0x8086280d, "Geminilake HDMI",	patch_i915_glk_hdmi),
 HDA_CODEC_ENTRY(0x8086280f, "Icelake HDMI",	patch_i915_icl_hdmi),
 HDA_CODEC_ENTRY(0x80862812, "Tigerlake HDMI",	patch_i915_tgl_hdmi),
 HDA_CODEC_ENTRY(0x8086281a, "Jasperlake HDMI",	patch_i915_icl_hdmi),
+HDA_CODEC_ENTRY(0x8086281b, "Elkhartlake HDMI",	patch_i915_icl_hdmi),
 HDA_CODEC_ENTRY(0x80862880, "CedarTrail HDMI",	patch_generic_hdmi),
 HDA_CODEC_ENTRY(0x80862882, "Valleyview2 HDMI",	patch_i915_byt_hdmi),
 HDA_CODEC_ENTRY(0x80862883, "Braswell HDMI",	patch_i915_byt_hdmi),
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 04/13] ASoC: SOF: Intel: add PCI ID for ElkhartLake
  2020-04-09 18:58 [PATCH 00/13] ASoC: Intel: machine drivers update for 5.8 Pierre-Louis Bossart
                   ` (2 preceding siblings ...)
  2020-04-09 18:58 ` [PATCH 03/13] ALSA: hda: Add ElkhartLake HDMI codec vid Pierre-Louis Bossart
@ 2020-04-09 18:58 ` Pierre-Louis Bossart
  2020-04-14 14:48   ` Applied "ASoC: SOF: Intel: add PCI ID for ElkhartLake" to the asoc tree Mark Brown
  2020-04-09 18:58 ` [PATCH 05/13] ASoC: Intel: boards: support Elkhart Lake with rt5660 Pierre-Louis Bossart
                   ` (8 subsequent siblings)
  12 siblings, 1 reply; 31+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-09 18:58 UTC (permalink / raw)
  To: alsa-devel
  Cc: Guennadi Liakhovetski, Kai Vehmanen, tiwai, Pierre-Louis Bossart,
	broonie, Libin Yang, Bard Liao

From: Libin Yang <libin.yang@linux.intel.com>

Add PCI ID for ElkhartLake platform.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/sof/sof-pci-dev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c
index cec631a1389b..b5f0221d624f 100644
--- a/sound/soc/sof/sof-pci-dev.c
+++ b/sound/soc/sof/sof-pci-dev.c
@@ -435,6 +435,8 @@ static const struct pci_device_id sof_pci_ids[] = {
 #if IS_ENABLED(CONFIG_SND_SOC_SOF_ELKHARTLAKE)
 	{ PCI_DEVICE(0x8086, 0x4b55),
 		.driver_data = (unsigned long)&ehl_desc},
+	{ PCI_DEVICE(0x8086, 0x4b58),
+		.driver_data = (unsigned long)&ehl_desc},
 #endif
 	{ 0, }
 };
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 05/13] ASoC: Intel: boards: support Elkhart Lake with rt5660
  2020-04-09 18:58 [PATCH 00/13] ASoC: Intel: machine drivers update for 5.8 Pierre-Louis Bossart
                   ` (3 preceding siblings ...)
  2020-04-09 18:58 ` [PATCH 04/13] ASoC: SOF: Intel: add PCI ID for ElkhartLake Pierre-Louis Bossart
@ 2020-04-09 18:58 ` Pierre-Louis Bossart
  2020-04-14 14:48   ` Applied "ASoC: Intel: boards: support Elkhart Lake with rt5660" to the asoc tree Mark Brown
  2020-04-09 18:58 ` [PATCH 06/13] ASoC: intel: sof_sdw: init all aggregated codecs Pierre-Louis Bossart
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 31+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-09 18:58 UTC (permalink / raw)
  To: alsa-devel
  Cc: Guennadi Liakhovetski, Kai Vehmanen, tiwai, Pierre-Louis Bossart,
	Muhammad Nazif Bin Mohd Borhan, broonie, Libin Yang, Bard Liao

From: Libin Yang <libin.yang@linux.intel.com>

This patch adds the support of Intel Elkhart Lake with
Realtek rt5660 codec.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Signed-off-by: Muhammad Nazif Bin Mohd Borhan <muhammad.nazif.mohd.borhan@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/Kconfig                |  15 +
 sound/soc/intel/boards/Makefile               |   2 +
 sound/soc/intel/boards/ehl_rt5660.c           | 323 ++++++++++++++++++
 .../intel/common/soc-acpi-intel-ehl-match.c   |   7 +
 4 files changed, 347 insertions(+)
 create mode 100644 sound/soc/intel/boards/ehl_rt5660.c

diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig
index 556c3104e641..c57bc6d0f145 100644
--- a/sound/soc/intel/boards/Kconfig
+++ b/sound/soc/intel/boards/Kconfig
@@ -524,6 +524,21 @@ config SND_SOC_INTEL_SOF_DA7219_MAX98373_MACH
 
 endif ## SND_SOC_SOF_JASPERLAKE
 
+if SND_SOC_SOF_ELKHARTLAKE
+
+config SND_SOC_INTEL_EHL_RT5660_MACH
+	tristate "EHL with RT5660 in I2S mode"
+	depends on I2C && ACPI
+	depends on MFD_INTEL_LPSS || COMPILE_TEST
+	depends on SND_HDA_CODEC_HDMI
+	select SND_SOC_RT5660
+	select SND_SOC_DMIC
+	help
+	  This adds support for ASoC machine driver for Elkhart Lake
+	  platform with RT5660 I2S audio codec.
+
+endif ## SND_SOC_SOF_ELKHARTLAKE
+
 if SND_SOC_SOF_INTEL_SOUNDWIRE
 
 config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH
diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile
index 1ef6e60bc2a0..98bf42463a1b 100644
--- a/sound/soc/intel/boards/Makefile
+++ b/sound/soc/intel/boards/Makefile
@@ -31,6 +31,7 @@ snd-soc-skl_hda_dsp-objs := skl_hda_dsp_generic.o skl_hda_dsp_common.o hda_dsp_c
 snd-skl_nau88l25_max98357a-objs := skl_nau88l25_max98357a.o
 snd-soc-skl_nau88l25_ssm4567-objs := skl_nau88l25_ssm4567.o
 snd-soc-sof_da7219_max98373-objs := sof_da7219_max98373.o hda_dsp_common.o
+snd-soc-ehl-rt5660-objs := ehl_rt5660.o hda_dsp_common.o
 snd-soc-sof-sdw-objs += sof_sdw.o				\
 			sof_sdw_rt711.o sof_sdw_rt700.o		\
 			sof_sdw_rt1308.o sof_sdw_rt715.o	\
@@ -68,4 +69,5 @@ obj-$(CONFIG_SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH) += snd-skl_nau88l25_max9
 obj-$(CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH) += snd-soc-skl_nau88l25_ssm4567.o
 obj-$(CONFIG_SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH) += snd-soc-skl_hda_dsp.o
 obj-$(CONFIG_SND_SOC_INTEL_SOF_DA7219_MAX98373_MACH) += snd-soc-sof_da7219_max98373.o
+obj-$(CONFIG_SND_SOC_INTEL_EHL_RT5660_MACH) += snd-soc-ehl-rt5660.o
 obj-$(CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH) += snd-soc-sof-sdw.o
diff --git a/sound/soc/intel/boards/ehl_rt5660.c b/sound/soc/intel/boards/ehl_rt5660.c
new file mode 100644
index 000000000000..2e3244d5496b
--- /dev/null
+++ b/sound/soc/intel/boards/ehl_rt5660.c
@@ -0,0 +1,323 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright (c) 2020 Intel Corporation
+
+/*
+ * ehl_rt5660 - ASOC Machine driver for Elkhart Lake platforms
+ * with rt5660 codec
+ */
+
+#include <linux/acpi.h>
+#include <sound/core.h>
+#include <linux/device.h>
+#include <linux/errno.h>
+#include <linux/gfp.h>
+#include <sound/jack.h>
+#include <linux/kernel.h>
+#include <linux/list.h>
+#include <linux/module.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+#include <sound/soc-acpi.h>
+
+#include "hda_dsp_common.h"
+#include "../../codecs/rt5660.h"
+
+#define DUAL_CHANNEL 2
+#define HDMI_LINK_START 3
+#define HDMI_LINE_END 6
+#define NAME_SIZE	32
+#define IDISP_CODEC_MASK	0x4
+
+struct sof_card_private {
+	struct list_head hdmi_pcm_list;
+	bool idisp_codec;
+};
+
+static const struct snd_kcontrol_new rt5660_controls[] = {
+	SOC_DAPM_PIN_SWITCH("Speaker"),
+	/* There are two MICBIAS in rt5660, each for one MIC */
+	SOC_DAPM_PIN_SWITCH("Headset Mic"),
+	SOC_DAPM_PIN_SWITCH("Headset Mic2"),
+	SOC_DAPM_PIN_SWITCH("Line Out"),
+};
+
+static const struct snd_soc_dapm_widget rt5660_widgets[] = {
+	SND_SOC_DAPM_SPK("Speaker", NULL),
+	SND_SOC_DAPM_MIC("Headset Mic", NULL),
+	SND_SOC_DAPM_MIC("Headset Mic2", NULL),
+	SND_SOC_DAPM_MIC("SoC DMIC", NULL),
+	SND_SOC_DAPM_LINE("Line Out", NULL),
+};
+
+static const struct snd_soc_dapm_route rt5660_map[] = {
+	{"Speaker", NULL, "SPO"},
+
+	{"Headset Mic", NULL, "MICBIAS1"},
+	{"Headset Mic2", NULL, "MICBIAS2"},
+
+	{"IN1P", NULL, "Headset Mic"},
+	{"IN2P", NULL, "Headset Mic2"},
+
+	{"Line Out", NULL, "LOUTL"},
+	{"Line Out", NULL, "LOUTR"},
+
+	{"DMic", NULL, "SoC DMIC"},
+};
+
+struct sof_hdmi_pcm {
+	struct list_head head;
+	struct snd_soc_dai *codec_dai;
+	int device;
+};
+
+static int hdmi_init(struct snd_soc_pcm_runtime *rtd)
+{
+	struct sof_card_private *ctx = snd_soc_card_get_drvdata(rtd->card);
+	struct snd_soc_dai *dai = asoc_rtd_to_codec(rtd, 0);
+	struct sof_hdmi_pcm *pcm;
+
+	pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL);
+	if (!pcm)
+		return -ENOMEM;
+
+	/* dai_link id is 1:1 mapped to the PCM device */
+	pcm->device = rtd->dai_link->id;
+	pcm->codec_dai = dai;
+
+	list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
+
+	return 0;
+}
+
+static int card_late_probe(struct snd_soc_card *card)
+{
+	struct sof_card_private *ctx = snd_soc_card_get_drvdata(card);
+	struct sof_hdmi_pcm *pcm;
+
+	if (list_empty(&ctx->hdmi_pcm_list))
+		return -ENOENT;
+
+	if (!ctx->idisp_codec)
+		return 0;
+
+	pcm = list_first_entry(&ctx->hdmi_pcm_list, struct sof_hdmi_pcm, head);
+
+	return hda_dsp_hdmi_build_controls(card, pcm->codec_dai->component);
+}
+
+static int rt5660_hw_params(struct snd_pcm_substream *substream,
+			    struct snd_pcm_hw_params *params)
+{
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
+	int ret;
+
+	ret = snd_soc_dai_set_sysclk(codec_dai,
+				     RT5660_SCLK_S_PLL1,
+				     params_rate(params) * 512,
+				     SND_SOC_CLOCK_IN);
+	if (ret < 0) {
+		dev_err(rtd->dev, "snd_soc_dai_set_sysclk err = %d\n", ret);
+		return ret;
+	}
+
+	ret = snd_soc_dai_set_pll(codec_dai, 0,
+				  RT5660_PLL1_S_BCLK,
+				  params_rate(params) * 50,
+				  params_rate(params) * 512);
+	if (ret < 0)
+		dev_err(codec_dai->dev, "can't set codec pll: %d\n", ret);
+
+	return ret;
+}
+
+static struct snd_soc_ops rt5660_ops = {
+	.hw_params = rt5660_hw_params,
+};
+
+SND_SOC_DAILINK_DEF(ssp0_pin,
+	DAILINK_COMP_ARRAY(COMP_CPU("SSP0 Pin")));
+
+SND_SOC_DAILINK_DEF(rt5660_codec,
+	DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC5660:00", "rt5660-aif1")));
+
+SND_SOC_DAILINK_DEF(platform,
+	DAILINK_COMP_ARRAY(COMP_PLATFORM("0000:00:1f.3")));
+
+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(idisp1_pin,
+	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_pin,
+	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_pin,
+	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(idisp4_pin,
+	DAILINK_COMP_ARRAY(COMP_CPU("iDisp4 Pin")));
+SND_SOC_DAILINK_DEF(idisp4_codec,
+	DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi4")));
+
+static struct snd_soc_dai_link ehl_rt5660_dailink[] = {
+	/* back ends */
+	{
+		.name = "SSP0-Codec",
+		.id = 0,
+		.no_pcm = 1,
+		.dpcm_playback = 1,
+		.dpcm_capture = 1,
+		.ops = &rt5660_ops,
+		.nonatomic = true,
+		SND_SOC_DAILINK_REG(ssp0_pin, rt5660_codec, platform),
+	},
+	{
+		.name = "dmic48k",
+		.id = 1,
+		.ignore_suspend = 1,
+		.dpcm_capture = 1,
+		.no_pcm = 1,
+		SND_SOC_DAILINK_REG(dmic_pin, dmic_codec, platform),
+	},
+	{
+		.name = "dmic16k",
+		.id = 2,
+		.ignore_suspend = 1,
+		.dpcm_capture = 1,
+		.no_pcm = 1,
+		SND_SOC_DAILINK_REG(dmic16k, dmic_codec, platform),
+	},
+	{
+		.name = "iDisp1",
+		.id = 5,
+		.init = hdmi_init,
+		.dpcm_playback = 1,
+		.no_pcm = 1,
+		SND_SOC_DAILINK_REG(idisp1_pin, idisp1_codec, platform),
+	},
+	{
+		.name = "iDisp2",
+		.id = 6,
+		.init = hdmi_init,
+		.dpcm_playback = 1,
+		.no_pcm = 1,
+		SND_SOC_DAILINK_REG(idisp2_pin, idisp2_codec, platform),
+	},
+	{
+		.name = "iDisp3",
+		.id = 7,
+		.init = hdmi_init,
+		.dpcm_playback = 1,
+		.no_pcm = 1,
+		SND_SOC_DAILINK_REG(idisp3_pin, idisp3_codec, platform),
+	},
+	{
+		.name = "iDisp4",
+		.id = 8,
+		.init = hdmi_init,
+		.dpcm_playback = 1,
+		.no_pcm = 1,
+		SND_SOC_DAILINK_REG(idisp4_pin, idisp4_codec, platform),
+	},
+};
+
+/* SoC card */
+static struct snd_soc_card snd_soc_card_ehl_rt5660 = {
+	.name = "ehl-rt5660",
+	.owner = THIS_MODULE,
+	.dai_link = ehl_rt5660_dailink,
+	.num_links = ARRAY_SIZE(ehl_rt5660_dailink),
+	.dapm_widgets = rt5660_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(rt5660_widgets),
+	.dapm_routes = rt5660_map,
+	.num_dapm_routes = ARRAY_SIZE(rt5660_map),
+	.controls = rt5660_controls,
+	.num_controls = ARRAY_SIZE(rt5660_controls),
+	.fully_routed = true,
+	.late_probe = card_late_probe,
+};
+
+/* If hdmi codec is not supported, switch to use dummy codec */
+static void hdmi_link_init(struct snd_soc_card *card,
+			   struct sof_card_private *ctx,
+			   struct snd_soc_acpi_mach *mach)
+{
+	struct snd_soc_dai_link *link;
+	int i;
+
+	if (mach->mach_params.common_hdmi_codec_drv &&
+	    (mach->mach_params.codec_mask & IDISP_CODEC_MASK)) {
+		ctx->idisp_codec = true;
+		return;
+	}
+
+	/*
+	 * if HDMI is not enabled in kernel config, or
+	 * hdmi codec is not supported
+	 */
+	for (i = HDMI_LINK_START; i <= HDMI_LINE_END; i++) {
+		link = &card->dai_link[i];
+		link->codecs[0].name = "snd-soc-dummy";
+		link->codecs[0].dai_name = "snd-soc-dummy-dai";
+	}
+}
+
+static int snd_ehl_rt5660_probe(struct platform_device *pdev)
+{
+	struct snd_soc_acpi_mach *mach;
+	struct snd_soc_card *card = &snd_soc_card_ehl_rt5660;
+	struct sof_card_private *ctx;
+	int ret;
+
+	card->dev = &pdev->dev;
+
+	ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
+	if (!ctx)
+		return -ENOMEM;
+	INIT_LIST_HEAD(&ctx->hdmi_pcm_list);
+	snd_soc_card_set_drvdata(card, ctx);
+
+	mach = pdev->dev.platform_data;
+	ret = snd_soc_fixup_dai_links_platform_name(card,
+						    mach->mach_params.platform);
+	if (ret)
+		return ret;
+
+	hdmi_link_init(card, ctx, mach);
+
+	return devm_snd_soc_register_card(&pdev->dev, card);
+}
+
+static const struct platform_device_id ehl_board_ids[] = {
+	{ .name = "ehl_rt5660" },
+	{ }
+};
+
+static struct platform_driver snd_ehl_rt5660_driver = {
+	.driver = {
+		.name = "ehl_rt5660",
+		.pm = &snd_soc_pm_ops,
+	},
+	.probe = snd_ehl_rt5660_probe,
+	.id_table = ehl_board_ids,
+};
+
+module_platform_driver(snd_ehl_rt5660_driver);
+
+MODULE_DESCRIPTION("ASoC Intel(R) Elkhartlake + rt5660 Machine driver");
+MODULE_AUTHOR("libin.yang@intel.com");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:ehl_rt5660");
diff --git a/sound/soc/intel/common/soc-acpi-intel-ehl-match.c b/sound/soc/intel/common/soc-acpi-intel-ehl-match.c
index a1290c3fa99f..b9ae0e2c959f 100644
--- a/sound/soc/intel/common/soc-acpi-intel-ehl-match.c
+++ b/sound/soc/intel/common/soc-acpi-intel-ehl-match.c
@@ -8,8 +8,15 @@
 
 #include <sound/soc-acpi.h>
 #include <sound/soc-acpi-intel-match.h>
+#include "../skylake/skl.h"
 
 struct snd_soc_acpi_mach snd_soc_acpi_intel_ehl_machines[] = {
+	{
+		.id = "INTC1027",
+		.drv_name = "ehl_rt5660",
+		.sof_fw_filename = "sof-ehl.ri",
+		.sof_tplg_filename = "sof-ehl-rt5660.tplg",
+	},
 	{},
 };
 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_ehl_machines);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 06/13] ASoC: intel: sof_sdw: init all aggregated codecs
  2020-04-09 18:58 [PATCH 00/13] ASoC: Intel: machine drivers update for 5.8 Pierre-Louis Bossart
                   ` (4 preceding siblings ...)
  2020-04-09 18:58 ` [PATCH 05/13] ASoC: Intel: boards: support Elkhart Lake with rt5660 Pierre-Louis Bossart
@ 2020-04-09 18:58 ` Pierre-Louis Bossart
  2020-04-14 14:47   ` Applied "ASoC: intel: sof_sdw: init all aggregated codecs" to the asoc tree Mark Brown
  2020-04-09 18:58 ` [PATCH 07/13] ASoC: Intel: sof-da7219-max98373: add DMIC widget and route Pierre-Louis Bossart
                   ` (6 subsequent siblings)
  12 siblings, 1 reply; 31+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-09 18:58 UTC (permalink / raw)
  To: alsa-devel
  Cc: Guennadi Liakhovetski, Kai Vehmanen, tiwai, Ranjani Sridharan,
	Pierre-Louis Bossart, broonie, Bard Liao

From: Bard Liao <yung-chuan.liao@linux.intel.com>

Init codecs which belong to the same group id on all links.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/sof_sdw.c | 41 ++++++++++++++++++++------------
 1 file changed, 26 insertions(+), 15 deletions(-)

diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index a64dc563b47e..6a1b51c0546b 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -411,25 +411,36 @@ static int create_codec_dai_name(struct device *dev,
 
 static int set_codec_init_func(const struct snd_soc_acpi_link_adr *link,
 			       struct snd_soc_dai_link *dai_links,
-			       bool playback)
+			       bool playback, int group_id)
 {
 	int i;
 
-	for (i = 0; i < link->num_adr; i++) {
-		unsigned int part_id;
-		int codec_index;
-
-		part_id = SDW_PART_ID(link->adr_d[i].adr);
-		codec_index = find_codec_info_part(part_id);
+	do {
+		/*
+		 * Initialize the codec. If codec is part of an aggregated
+		 * group (group_id>0), initialize all codecs belonging to
+		 * same group.
+		 */
+		for (i = 0; i < link->num_adr; i++) {
+			unsigned int part_id;
+			int codec_index;
 
-		if (codec_index < 0)
-			return codec_index;
+			part_id = SDW_PART_ID(link->adr_d[i].adr);
+			codec_index = find_codec_info_part(part_id);
 
-		if (codec_info_list[codec_index].init)
-			codec_info_list[codec_index].init(link, dai_links,
-						 &codec_info_list[codec_index],
-						 playback);
-	}
+			if (codec_index < 0)
+				return codec_index;
+			/* The group_id is > 0 iff the codec is aggregated */
+			if (link->adr_d[i].endpoints->group_id != group_id)
+				continue;
+			if (codec_info_list[codec_index].init)
+				codec_info_list[codec_index].init(link,
+						dai_links,
+						&codec_info_list[codec_index],
+						playback);
+		}
+		link++;
+	} while (link->mask && group_id);
 
 	return 0;
 }
@@ -623,7 +634,7 @@ static int create_sdw_dailink(struct device *dev, int *be_index,
 			      NULL, &sdw_ops);
 
 		ret = set_codec_init_func(link, dai_links + (*be_index)++,
-					  playback);
+					  playback, group_id);
 		if (ret < 0) {
 			dev_err(dev, "failed to init codec %d", codec_index);
 			return ret;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 07/13] ASoC: Intel: sof-da7219-max98373: add DMIC widget and route
  2020-04-09 18:58 [PATCH 00/13] ASoC: Intel: machine drivers update for 5.8 Pierre-Louis Bossart
                   ` (5 preceding siblings ...)
  2020-04-09 18:58 ` [PATCH 06/13] ASoC: intel: sof_sdw: init all aggregated codecs Pierre-Louis Bossart
@ 2020-04-09 18:58 ` Pierre-Louis Bossart
  2020-04-14 14:47   ` Applied "ASoC: Intel: sof-da7219-max98373: add DMIC widget and route" to the asoc tree Mark Brown
  2020-04-09 18:58 ` [PATCH 08/13] ASoC: Intel: sof_sdw_hdmi: fix compilation issue in fallback mode Pierre-Louis Bossart
                   ` (5 subsequent siblings)
  12 siblings, 1 reply; 31+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-09 18:58 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, broonie, Keyon Jie, Ranjani Sridharan, Pierre-Louis Bossart

From: Keyon Jie <yang.jie@linux.intel.com>

Add DMIC endpoint widget and route to make DMIC DAPM routes completed,
to make DAPM Power Management works for DMIC streams.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/sof_da7219_max98373.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sound/soc/intel/boards/sof_da7219_max98373.c b/sound/soc/intel/boards/sof_da7219_max98373.c
index 8b5b74ba349f..8ca8f76470fa 100644
--- a/sound/soc/intel/boards/sof_da7219_max98373.c
+++ b/sound/soc/intel/boards/sof_da7219_max98373.c
@@ -86,6 +86,8 @@ static const struct snd_soc_dapm_widget widgets[] = {
 	SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
 			    platform_clock_control, SND_SOC_DAPM_POST_PMD |
 			    SND_SOC_DAPM_PRE_PMU),
+
+	SND_SOC_DAPM_MIC("SoC DMIC", NULL),
 };
 
 static const struct snd_soc_dapm_route audio_map[] = {
@@ -99,6 +101,9 @@ static const struct snd_soc_dapm_route audio_map[] = {
 
 	{ "Left Spk", NULL, "Left BE_OUT" },
 	{ "Right Spk", NULL, "Right BE_OUT" },
+
+	/* digital mics */
+	{"DMic", NULL, "SoC DMIC"},
 };
 
 /* For MAX98360A amp */
@@ -111,6 +116,8 @@ static const struct snd_soc_dapm_widget max98360a_widgets[] = {
 	SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
 			    platform_clock_control, SND_SOC_DAPM_POST_PMD |
 			    SND_SOC_DAPM_PRE_PMU),
+
+	SND_SOC_DAPM_MIC("SoC DMIC", NULL),
 };
 
 static const struct snd_soc_dapm_route max98360a_map[] = {
@@ -123,6 +130,9 @@ static const struct snd_soc_dapm_route max98360a_map[] = {
 	{ "Headset Mic", NULL, "Platform Clock" },
 
 	{"Spk", NULL, "Speaker"},
+
+	/* digital mics */
+	{"DMic", NULL, "SoC DMIC"},
 };
 
 static struct snd_soc_jack headset;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 08/13] ASoC: Intel: sof_sdw_hdmi: fix compilation issue in fallback mode
  2020-04-09 18:58 [PATCH 00/13] ASoC: Intel: machine drivers update for 5.8 Pierre-Louis Bossart
                   ` (6 preceding siblings ...)
  2020-04-09 18:58 ` [PATCH 07/13] ASoC: Intel: sof-da7219-max98373: add DMIC widget and route Pierre-Louis Bossart
@ 2020-04-09 18:58 ` Pierre-Louis Bossart
  2020-04-14 14:47   ` Applied "ASoC: Intel: sof_sdw_hdmi: fix compilation issue in fallback mode" to the asoc tree Mark Brown
  2020-04-09 18:58 ` [PATCH 09/13] ASoC: Intel: sof_sdw_hdmi: remove codec_dai use Pierre-Louis Bossart
                   ` (4 subsequent siblings)
  12 siblings, 1 reply; 31+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-09 18:58 UTC (permalink / raw)
  To: alsa-devel
  Cc: Guennadi Liakhovetski, Kai Vehmanen, tiwai, Pierre-Louis Bossart,
	Ranjani Sridharan, broonie

Missing prefix causing build fail when NOCODEC option is selected

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/sof_sdw_hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/sof_sdw_hdmi.c b/sound/soc/intel/boards/sof_sdw_hdmi.c
index c7b5612a39e6..93e00b03cf85 100644
--- a/sound/soc/intel/boards/sof_sdw_hdmi.c
+++ b/sound/soc/intel/boards/sof_sdw_hdmi.c
@@ -90,7 +90,7 @@ int sof_sdw_hdmi_card_late_probe(struct snd_soc_card *card)
 	return hdac_hdmi_jack_port_init(component, &card->dapm);
 }
 #else
-int hdmi_card_late_probe(struct snd_soc_card *card)
+int sof_sdw_hdmi_card_late_probe(struct snd_soc_card *card)
 {
 	return 0;
 }
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 09/13] ASoC: Intel: sof_sdw_hdmi: remove codec_dai use
  2020-04-09 18:58 [PATCH 00/13] ASoC: Intel: machine drivers update for 5.8 Pierre-Louis Bossart
                   ` (7 preceding siblings ...)
  2020-04-09 18:58 ` [PATCH 08/13] ASoC: Intel: sof_sdw_hdmi: fix compilation issue in fallback mode Pierre-Louis Bossart
@ 2020-04-09 18:58 ` Pierre-Louis Bossart
  2020-04-14 14:47   ` Applied "ASoC: Intel: sof_sdw_hdmi: remove codec_dai use" to the asoc tree Mark Brown
  2020-04-09 18:58 ` [PATCH 10/13] ASoC: Intel: sof_sdw_rt1308: remove codec dai use Pierre-Louis Bossart
                   ` (3 subsequent siblings)
  12 siblings, 1 reply; 31+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-09 18:58 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Pierre-Louis Bossart

Use macro instead.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/sof_sdw_hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/sof_sdw_hdmi.c b/sound/soc/intel/boards/sof_sdw_hdmi.c
index 93e00b03cf85..cb1118e78e89 100644
--- a/sound/soc/intel/boards/sof_sdw_hdmi.c
+++ b/sound/soc/intel/boards/sof_sdw_hdmi.c
@@ -28,7 +28,7 @@ struct hdmi_pcm {
 int sof_sdw_hdmi_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct mc_private *ctx = snd_soc_card_get_drvdata(rtd->card);
-	struct snd_soc_dai *dai = rtd->codec_dai;
+	struct snd_soc_dai *dai = asoc_rtd_to_codec(rtd, 0);
 	struct hdmi_pcm *pcm;
 
 	pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 10/13] ASoC: Intel: sof_sdw_rt1308: remove codec dai use
  2020-04-09 18:58 [PATCH 00/13] ASoC: Intel: machine drivers update for 5.8 Pierre-Louis Bossart
                   ` (8 preceding siblings ...)
  2020-04-09 18:58 ` [PATCH 09/13] ASoC: Intel: sof_sdw_hdmi: remove codec_dai use Pierre-Louis Bossart
@ 2020-04-09 18:58 ` Pierre-Louis Bossart
  2020-04-14 14:47   ` Applied "ASoC: Intel: sof_sdw_rt1308: remove codec dai use" to the asoc tree Mark Brown
  2020-04-09 18:58 ` [PATCH 11/13] ASoC: Intel: sof_sdw_rt5682: remove codec_dai use Pierre-Louis Bossart
                   ` (2 subsequent siblings)
  12 siblings, 1 reply; 31+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-09 18:58 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Pierre-Louis Bossart

Use macro.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/sof_sdw_rt1308.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/sof_sdw_rt1308.c b/sound/soc/intel/boards/sof_sdw_rt1308.c
index 321768e54d08..a3d0e053b1a6 100644
--- a/sound/soc/intel/boards/sof_sdw_rt1308.c
+++ b/sound/soc/intel/boards/sof_sdw_rt1308.c
@@ -93,7 +93,7 @@ static int rt1308_i2s_hw_params(struct snd_pcm_substream *substream,
 {
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_card *card = rtd->card;
-	struct snd_soc_dai *codec_dai = rtd->codec_dai;
+	struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
 	int clk_id, clk_freq, pll_out;
 	int err;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 11/13] ASoC: Intel: sof_sdw_rt5682: remove codec_dai use
  2020-04-09 18:58 [PATCH 00/13] ASoC: Intel: machine drivers update for 5.8 Pierre-Louis Bossart
                   ` (9 preceding siblings ...)
  2020-04-09 18:58 ` [PATCH 10/13] ASoC: Intel: sof_sdw_rt1308: remove codec dai use Pierre-Louis Bossart
@ 2020-04-09 18:58 ` Pierre-Louis Bossart
  2020-04-14 14:47   ` Applied "ASoC: Intel: sof_sdw_rt5682: remove codec_dai use" to the asoc tree Mark Brown
  2020-04-09 18:58 ` [PATCH 12/13] ASoC: Intel: sof_sdw_rt700: remove codec_dai use Pierre-Louis Bossart
  2020-04-09 18:58 ` [PATCH 13/13] ASoC: Intel: sof_sdw_rt711: remove codec_dai use Pierre-Louis Bossart
  12 siblings, 1 reply; 31+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-09 18:58 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Pierre-Louis Bossart

Use macro.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/sof_sdw_rt5682.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/sof_sdw_rt5682.c b/sound/soc/intel/boards/sof_sdw_rt5682.c
index 5aa6211a1ed9..6680dde76682 100644
--- a/sound/soc/intel/boards/sof_sdw_rt5682.c
+++ b/sound/soc/intel/boards/sof_sdw_rt5682.c
@@ -47,7 +47,8 @@ static int rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_card *card = rtd->card;
 	struct mc_private *ctx = snd_soc_card_get_drvdata(card);
-	struct snd_soc_component *component = rtd->codec_dai->component;
+	struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
+	struct snd_soc_component *component = codec_dai->component;
 	struct snd_soc_jack *jack;
 	int ret;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 12/13] ASoC: Intel: sof_sdw_rt700: remove codec_dai use
  2020-04-09 18:58 [PATCH 00/13] ASoC: Intel: machine drivers update for 5.8 Pierre-Louis Bossart
                   ` (10 preceding siblings ...)
  2020-04-09 18:58 ` [PATCH 11/13] ASoC: Intel: sof_sdw_rt5682: remove codec_dai use Pierre-Louis Bossart
@ 2020-04-09 18:58 ` Pierre-Louis Bossart
  2020-04-14 14:47   ` Applied "ASoC: Intel: sof_sdw_rt700: remove codec_dai use" to the asoc tree Mark Brown
  2020-04-09 18:58 ` [PATCH 13/13] ASoC: Intel: sof_sdw_rt711: remove codec_dai use Pierre-Louis Bossart
  12 siblings, 1 reply; 31+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-09 18:58 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Pierre-Louis Bossart

Use macro

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/sof_sdw_rt700.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/sof_sdw_rt700.c b/sound/soc/intel/boards/sof_sdw_rt700.c
index 2ee4e6910d7f..d3725bb91e43 100644
--- a/sound/soc/intel/boards/sof_sdw_rt700.c
+++ b/sound/soc/intel/boards/sof_sdw_rt700.c
@@ -47,7 +47,8 @@ static int rt700_rtd_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_card *card = rtd->card;
 	struct mc_private *ctx = snd_soc_card_get_drvdata(card);
-	struct snd_soc_component *component = rtd->codec_dai->component;
+	struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
+	struct snd_soc_component *component = codec_dai->component;
 	struct snd_soc_jack *jack;
 	int ret;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 13/13] ASoC: Intel: sof_sdw_rt711: remove codec_dai use
  2020-04-09 18:58 [PATCH 00/13] ASoC: Intel: machine drivers update for 5.8 Pierre-Louis Bossart
                   ` (11 preceding siblings ...)
  2020-04-09 18:58 ` [PATCH 12/13] ASoC: Intel: sof_sdw_rt700: remove codec_dai use Pierre-Louis Bossart
@ 2020-04-09 18:58 ` Pierre-Louis Bossart
  2020-04-14 14:47   ` Applied "ASoC: Intel: sof_sdw_rt711: remove codec_dai use" to the asoc tree Mark Brown
  12 siblings, 1 reply; 31+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-09 18:58 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Pierre-Louis Bossart

Use macro.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/sof_sdw_rt711.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/sof_sdw_rt711.c b/sound/soc/intel/boards/sof_sdw_rt711.c
index 2a4917e3d561..8590a8a8889f 100644
--- a/sound/soc/intel/boards/sof_sdw_rt711.c
+++ b/sound/soc/intel/boards/sof_sdw_rt711.c
@@ -71,7 +71,8 @@ static int rt711_rtd_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_card *card = rtd->card;
 	struct mc_private *ctx = snd_soc_card_get_drvdata(card);
-	struct snd_soc_component *component = rtd->codec_dai->component;
+	struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
+	struct snd_soc_component *component = codec_dai->component;
 	struct snd_soc_jack *jack;
 	int ret;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH 03/13] ALSA: hda: Add ElkhartLake HDMI codec vid
  2020-04-09 18:58 ` [PATCH 03/13] ALSA: hda: Add ElkhartLake HDMI codec vid Pierre-Louis Bossart
@ 2020-04-11 10:29   ` Takashi Iwai
  2020-04-14 16:09     ` Kai Vehmanen
  2020-04-14 14:48   ` Applied "ALSA: hda: Add ElkhartLake HDMI codec vid" to the asoc tree Mark Brown
  1 sibling, 1 reply; 31+ messages in thread
From: Takashi Iwai @ 2020-04-11 10:29 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: Guennadi Liakhovetski, alsa-devel, Kai Vehmanen, broonie,
	Libin Yang, Bard Liao

On Thu, 09 Apr 2020 20:58:17 +0200,
Pierre-Louis Bossart wrote:
> 
> From: Libin Yang <libin.yang@linux.intel.com>
> 
> Add HDMI codec vid for the Intel ElkhartLake platform
> 
> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
> Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

I suppose this can go through ASoC tree unless HDA legacy driver
supports the device.

Acked-by: Takashi Iwai <tiwai@suse.de>


thanks,

Takashi

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Applied "ASoC: Intel: sof_sdw_rt711: remove codec_dai use" to the asoc tree
  2020-04-09 18:58 ` [PATCH 13/13] ASoC: Intel: sof_sdw_rt711: remove codec_dai use Pierre-Louis Bossart
@ 2020-04-14 14:47   ` Mark Brown
  0 siblings, 0 replies; 31+ messages in thread
From: Mark Brown @ 2020-04-14 14:47 UTC (permalink / raw)
  To: Pierre-Louis Bossart; +Cc: tiwai, alsa-devel, Mark Brown

The patch

   ASoC: Intel: sof_sdw_rt711: remove codec_dai use

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 30e3edfbd1bf2f79287a5586508bb51f3fce5826 Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Date: Thu, 9 Apr 2020 13:58:27 -0500
Subject: [PATCH] ASoC: Intel: sof_sdw_rt711: remove codec_dai use

Use macro.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200409185827.16255-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/sof_sdw_rt711.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/sof_sdw_rt711.c b/sound/soc/intel/boards/sof_sdw_rt711.c
index 2a4917e3d561..8590a8a8889f 100644
--- a/sound/soc/intel/boards/sof_sdw_rt711.c
+++ b/sound/soc/intel/boards/sof_sdw_rt711.c
@@ -71,7 +71,8 @@ static int rt711_rtd_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_card *card = rtd->card;
 	struct mc_private *ctx = snd_soc_card_get_drvdata(card);
-	struct snd_soc_component *component = rtd->codec_dai->component;
+	struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
+	struct snd_soc_component *component = codec_dai->component;
 	struct snd_soc_jack *jack;
 	int ret;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Applied "ASoC: Intel: sof_sdw_rt700: remove codec_dai use" to the asoc tree
  2020-04-09 18:58 ` [PATCH 12/13] ASoC: Intel: sof_sdw_rt700: remove codec_dai use Pierre-Louis Bossart
@ 2020-04-14 14:47   ` Mark Brown
  0 siblings, 0 replies; 31+ messages in thread
From: Mark Brown @ 2020-04-14 14:47 UTC (permalink / raw)
  To: Pierre-Louis Bossart; +Cc: tiwai, alsa-devel, Mark Brown

The patch

   ASoC: Intel: sof_sdw_rt700: remove codec_dai use

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 6a739362211b14c1cfe56929c1da71f15c5e6143 Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Date: Thu, 9 Apr 2020 13:58:26 -0500
Subject: [PATCH] ASoC: Intel: sof_sdw_rt700: remove codec_dai use

Use macro

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200409185827.16255-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/sof_sdw_rt700.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/sof_sdw_rt700.c b/sound/soc/intel/boards/sof_sdw_rt700.c
index 2ee4e6910d7f..d3725bb91e43 100644
--- a/sound/soc/intel/boards/sof_sdw_rt700.c
+++ b/sound/soc/intel/boards/sof_sdw_rt700.c
@@ -47,7 +47,8 @@ static int rt700_rtd_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_card *card = rtd->card;
 	struct mc_private *ctx = snd_soc_card_get_drvdata(card);
-	struct snd_soc_component *component = rtd->codec_dai->component;
+	struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
+	struct snd_soc_component *component = codec_dai->component;
 	struct snd_soc_jack *jack;
 	int ret;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Applied "ASoC: Intel: sof_sdw_rt5682: remove codec_dai use" to the asoc tree
  2020-04-09 18:58 ` [PATCH 11/13] ASoC: Intel: sof_sdw_rt5682: remove codec_dai use Pierre-Louis Bossart
@ 2020-04-14 14:47   ` Mark Brown
  0 siblings, 0 replies; 31+ messages in thread
From: Mark Brown @ 2020-04-14 14:47 UTC (permalink / raw)
  To: Pierre-Louis Bossart; +Cc: tiwai, alsa-devel, Mark Brown

The patch

   ASoC: Intel: sof_sdw_rt5682: remove codec_dai use

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From f11633da41bd00cc436e4e9b143bd6a00b9b65c6 Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Date: Thu, 9 Apr 2020 13:58:25 -0500
Subject: [PATCH] ASoC: Intel: sof_sdw_rt5682: remove codec_dai use

Use macro.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200409185827.16255-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/sof_sdw_rt5682.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/sof_sdw_rt5682.c b/sound/soc/intel/boards/sof_sdw_rt5682.c
index 5aa6211a1ed9..6680dde76682 100644
--- a/sound/soc/intel/boards/sof_sdw_rt5682.c
+++ b/sound/soc/intel/boards/sof_sdw_rt5682.c
@@ -47,7 +47,8 @@ static int rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_card *card = rtd->card;
 	struct mc_private *ctx = snd_soc_card_get_drvdata(card);
-	struct snd_soc_component *component = rtd->codec_dai->component;
+	struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
+	struct snd_soc_component *component = codec_dai->component;
 	struct snd_soc_jack *jack;
 	int ret;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Applied "ASoC: Intel: sof_sdw_rt1308: remove codec dai use" to the asoc tree
  2020-04-09 18:58 ` [PATCH 10/13] ASoC: Intel: sof_sdw_rt1308: remove codec dai use Pierre-Louis Bossart
@ 2020-04-14 14:47   ` Mark Brown
  0 siblings, 0 replies; 31+ messages in thread
From: Mark Brown @ 2020-04-14 14:47 UTC (permalink / raw)
  To: Pierre-Louis Bossart; +Cc: tiwai, alsa-devel, Mark Brown

The patch

   ASoC: Intel: sof_sdw_rt1308: remove codec dai use

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 680ca80f731e11ff510f8ec2777f920ee228e54a Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Date: Thu, 9 Apr 2020 13:58:24 -0500
Subject: [PATCH] ASoC: Intel: sof_sdw_rt1308: remove codec dai use

Use macro.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200409185827.16255-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/sof_sdw_rt1308.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/sof_sdw_rt1308.c b/sound/soc/intel/boards/sof_sdw_rt1308.c
index 321768e54d08..a3d0e053b1a6 100644
--- a/sound/soc/intel/boards/sof_sdw_rt1308.c
+++ b/sound/soc/intel/boards/sof_sdw_rt1308.c
@@ -93,7 +93,7 @@ static int rt1308_i2s_hw_params(struct snd_pcm_substream *substream,
 {
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_card *card = rtd->card;
-	struct snd_soc_dai *codec_dai = rtd->codec_dai;
+	struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
 	int clk_id, clk_freq, pll_out;
 	int err;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Applied "ASoC: Intel: sof_sdw_hdmi: remove codec_dai use" to the asoc tree
  2020-04-09 18:58 ` [PATCH 09/13] ASoC: Intel: sof_sdw_hdmi: remove codec_dai use Pierre-Louis Bossart
@ 2020-04-14 14:47   ` Mark Brown
  0 siblings, 0 replies; 31+ messages in thread
From: Mark Brown @ 2020-04-14 14:47 UTC (permalink / raw)
  To: Pierre-Louis Bossart; +Cc: tiwai, alsa-devel, Mark Brown

The patch

   ASoC: Intel: sof_sdw_hdmi: remove codec_dai use

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 5611e6f4b32bbdfe973e22d1534c2838c57408b7 Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Date: Thu, 9 Apr 2020 13:58:23 -0500
Subject: [PATCH] ASoC: Intel: sof_sdw_hdmi: remove codec_dai use

Use macro instead.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200409185827.16255-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/sof_sdw_hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/sof_sdw_hdmi.c b/sound/soc/intel/boards/sof_sdw_hdmi.c
index 93e00b03cf85..cb1118e78e89 100644
--- a/sound/soc/intel/boards/sof_sdw_hdmi.c
+++ b/sound/soc/intel/boards/sof_sdw_hdmi.c
@@ -28,7 +28,7 @@ struct hdmi_pcm {
 int sof_sdw_hdmi_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct mc_private *ctx = snd_soc_card_get_drvdata(rtd->card);
-	struct snd_soc_dai *dai = rtd->codec_dai;
+	struct snd_soc_dai *dai = asoc_rtd_to_codec(rtd, 0);
 	struct hdmi_pcm *pcm;
 
 	pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Applied "ASoC: Intel: sof_sdw_hdmi: fix compilation issue in fallback mode" to the asoc tree
  2020-04-09 18:58 ` [PATCH 08/13] ASoC: Intel: sof_sdw_hdmi: fix compilation issue in fallback mode Pierre-Louis Bossart
@ 2020-04-14 14:47   ` Mark Brown
  0 siblings, 0 replies; 31+ messages in thread
From: Mark Brown @ 2020-04-14 14:47 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: Guennadi Liakhovetski, alsa-devel, Kai Vehmanen, tiwai,
	Ranjani Sridharan, Mark Brown

The patch

   ASoC: Intel: sof_sdw_hdmi: fix compilation issue in fallback mode

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 272e68d06539d0abc39d949657a2bc6c5ee25647 Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Date: Thu, 9 Apr 2020 13:58:22 -0500
Subject: [PATCH] ASoC: Intel: sof_sdw_hdmi: fix compilation issue in fallback
 mode

Missing prefix causing build fail when NOCODEC option is selected

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200409185827.16255-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/sof_sdw_hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/sof_sdw_hdmi.c b/sound/soc/intel/boards/sof_sdw_hdmi.c
index c7b5612a39e6..93e00b03cf85 100644
--- a/sound/soc/intel/boards/sof_sdw_hdmi.c
+++ b/sound/soc/intel/boards/sof_sdw_hdmi.c
@@ -90,7 +90,7 @@ int sof_sdw_hdmi_card_late_probe(struct snd_soc_card *card)
 	return hdac_hdmi_jack_port_init(component, &card->dapm);
 }
 #else
-int hdmi_card_late_probe(struct snd_soc_card *card)
+int sof_sdw_hdmi_card_late_probe(struct snd_soc_card *card)
 {
 	return 0;
 }
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Applied "ASoC: Intel: sof-da7219-max98373: add DMIC widget and route" to the asoc tree
  2020-04-09 18:58 ` [PATCH 07/13] ASoC: Intel: sof-da7219-max98373: add DMIC widget and route Pierre-Louis Bossart
@ 2020-04-14 14:47   ` Mark Brown
  0 siblings, 0 replies; 31+ messages in thread
From: Mark Brown @ 2020-04-14 14:47 UTC (permalink / raw)
  To: Keyon Jie
  Cc: tiwai, alsa-devel, Mark Brown, Pierre-Louis Bossart, Ranjani Sridharan

The patch

   ASoC: Intel: sof-da7219-max98373: add DMIC widget and route

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 35e648cc66ac814ae1114695e6ace26bc63504c8 Mon Sep 17 00:00:00 2001
From: Keyon Jie <yang.jie@linux.intel.com>
Date: Thu, 9 Apr 2020 13:58:21 -0500
Subject: [PATCH] ASoC: Intel: sof-da7219-max98373: add DMIC widget and route

Add DMIC endpoint widget and route to make DMIC DAPM routes completed,
to make DAPM Power Management works for DMIC streams.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200409185827.16255-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/sof_da7219_max98373.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sound/soc/intel/boards/sof_da7219_max98373.c b/sound/soc/intel/boards/sof_da7219_max98373.c
index 8b5b74ba349f..8ca8f76470fa 100644
--- a/sound/soc/intel/boards/sof_da7219_max98373.c
+++ b/sound/soc/intel/boards/sof_da7219_max98373.c
@@ -86,6 +86,8 @@ static const struct snd_soc_dapm_widget widgets[] = {
 	SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
 			    platform_clock_control, SND_SOC_DAPM_POST_PMD |
 			    SND_SOC_DAPM_PRE_PMU),
+
+	SND_SOC_DAPM_MIC("SoC DMIC", NULL),
 };
 
 static const struct snd_soc_dapm_route audio_map[] = {
@@ -99,6 +101,9 @@ static const struct snd_soc_dapm_route audio_map[] = {
 
 	{ "Left Spk", NULL, "Left BE_OUT" },
 	{ "Right Spk", NULL, "Right BE_OUT" },
+
+	/* digital mics */
+	{"DMic", NULL, "SoC DMIC"},
 };
 
 /* For MAX98360A amp */
@@ -111,6 +116,8 @@ static const struct snd_soc_dapm_widget max98360a_widgets[] = {
 	SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
 			    platform_clock_control, SND_SOC_DAPM_POST_PMD |
 			    SND_SOC_DAPM_PRE_PMU),
+
+	SND_SOC_DAPM_MIC("SoC DMIC", NULL),
 };
 
 static const struct snd_soc_dapm_route max98360a_map[] = {
@@ -123,6 +130,9 @@ static const struct snd_soc_dapm_route max98360a_map[] = {
 	{ "Headset Mic", NULL, "Platform Clock" },
 
 	{"Spk", NULL, "Speaker"},
+
+	/* digital mics */
+	{"DMic", NULL, "SoC DMIC"},
 };
 
 static struct snd_soc_jack headset;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Applied "ASoC: intel: sof_sdw: init all aggregated codecs" to the asoc tree
  2020-04-09 18:58 ` [PATCH 06/13] ASoC: intel: sof_sdw: init all aggregated codecs Pierre-Louis Bossart
@ 2020-04-14 14:47   ` Mark Brown
  0 siblings, 0 replies; 31+ messages in thread
From: Mark Brown @ 2020-04-14 14:47 UTC (permalink / raw)
  To: Bard Liao
  Cc: Guennadi Liakhovetski, alsa-devel, Kai Vehmanen, tiwai,
	Pierre-Louis Bossart, Ranjani Sridharan, Mark Brown

The patch

   ASoC: intel: sof_sdw: init all aggregated codecs

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 5930d02c2d533aa9cbc2b55ad27b41802858da16 Mon Sep 17 00:00:00 2001
From: Bard Liao <yung-chuan.liao@linux.intel.com>
Date: Thu, 9 Apr 2020 13:58:20 -0500
Subject: [PATCH] ASoC: intel: sof_sdw: init all aggregated codecs

Init codecs which belong to the same group id on all links.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200409185827.16255-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/sof_sdw.c | 41 ++++++++++++++++++++------------
 1 file changed, 26 insertions(+), 15 deletions(-)

diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index a64dc563b47e..6a1b51c0546b 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -411,25 +411,36 @@ static int create_codec_dai_name(struct device *dev,
 
 static int set_codec_init_func(const struct snd_soc_acpi_link_adr *link,
 			       struct snd_soc_dai_link *dai_links,
-			       bool playback)
+			       bool playback, int group_id)
 {
 	int i;
 
-	for (i = 0; i < link->num_adr; i++) {
-		unsigned int part_id;
-		int codec_index;
-
-		part_id = SDW_PART_ID(link->adr_d[i].adr);
-		codec_index = find_codec_info_part(part_id);
+	do {
+		/*
+		 * Initialize the codec. If codec is part of an aggregated
+		 * group (group_id>0), initialize all codecs belonging to
+		 * same group.
+		 */
+		for (i = 0; i < link->num_adr; i++) {
+			unsigned int part_id;
+			int codec_index;
 
-		if (codec_index < 0)
-			return codec_index;
+			part_id = SDW_PART_ID(link->adr_d[i].adr);
+			codec_index = find_codec_info_part(part_id);
 
-		if (codec_info_list[codec_index].init)
-			codec_info_list[codec_index].init(link, dai_links,
-						 &codec_info_list[codec_index],
-						 playback);
-	}
+			if (codec_index < 0)
+				return codec_index;
+			/* The group_id is > 0 iff the codec is aggregated */
+			if (link->adr_d[i].endpoints->group_id != group_id)
+				continue;
+			if (codec_info_list[codec_index].init)
+				codec_info_list[codec_index].init(link,
+						dai_links,
+						&codec_info_list[codec_index],
+						playback);
+		}
+		link++;
+	} while (link->mask && group_id);
 
 	return 0;
 }
@@ -623,7 +634,7 @@ static int create_sdw_dailink(struct device *dev, int *be_index,
 			      NULL, &sdw_ops);
 
 		ret = set_codec_init_func(link, dai_links + (*be_index)++,
-					  playback);
+					  playback, group_id);
 		if (ret < 0) {
 			dev_err(dev, "failed to init codec %d", codec_index);
 			return ret;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Applied "ASoC: Intel: boards: support Elkhart Lake with rt5660" to the asoc tree
  2020-04-09 18:58 ` [PATCH 05/13] ASoC: Intel: boards: support Elkhart Lake with rt5660 Pierre-Louis Bossart
@ 2020-04-14 14:48   ` Mark Brown
  0 siblings, 0 replies; 31+ messages in thread
From: Mark Brown @ 2020-04-14 14:48 UTC (permalink / raw)
  To: Libin Yang
  Cc: Guennadi Liakhovetski, alsa-devel, Kai Vehmanen, tiwai,
	Pierre-Louis Bossart, Muhammad Nazif Bin Mohd Borhan, Mark Brown,
	Bard Liao

The patch

   ASoC: Intel: boards: support Elkhart Lake with rt5660

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From db8cfae8c4fdffee9f287a9172605450b5c5bc2e Mon Sep 17 00:00:00 2001
From: Libin Yang <libin.yang@linux.intel.com>
Date: Thu, 9 Apr 2020 13:58:19 -0500
Subject: [PATCH] ASoC: Intel: boards: support Elkhart Lake with rt5660

This patch adds the support of Intel Elkhart Lake with
Realtek rt5660 codec.

Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Signed-off-by: Muhammad Nazif Bin Mohd Borhan <muhammad.nazif.mohd.borhan@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200409185827.16255-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/Kconfig                |  15 +
 sound/soc/intel/boards/Makefile               |   2 +
 sound/soc/intel/boards/ehl_rt5660.c           | 323 ++++++++++++++++++
 .../intel/common/soc-acpi-intel-ehl-match.c   |   7 +
 4 files changed, 347 insertions(+)
 create mode 100644 sound/soc/intel/boards/ehl_rt5660.c

diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig
index 556c3104e641..c57bc6d0f145 100644
--- a/sound/soc/intel/boards/Kconfig
+++ b/sound/soc/intel/boards/Kconfig
@@ -524,6 +524,21 @@ config SND_SOC_INTEL_SOF_DA7219_MAX98373_MACH
 
 endif ## SND_SOC_SOF_JASPERLAKE
 
+if SND_SOC_SOF_ELKHARTLAKE
+
+config SND_SOC_INTEL_EHL_RT5660_MACH
+	tristate "EHL with RT5660 in I2S mode"
+	depends on I2C && ACPI
+	depends on MFD_INTEL_LPSS || COMPILE_TEST
+	depends on SND_HDA_CODEC_HDMI
+	select SND_SOC_RT5660
+	select SND_SOC_DMIC
+	help
+	  This adds support for ASoC machine driver for Elkhart Lake
+	  platform with RT5660 I2S audio codec.
+
+endif ## SND_SOC_SOF_ELKHARTLAKE
+
 if SND_SOC_SOF_INTEL_SOUNDWIRE
 
 config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH
diff --git a/sound/soc/intel/boards/Makefile b/sound/soc/intel/boards/Makefile
index 1ef6e60bc2a0..98bf42463a1b 100644
--- a/sound/soc/intel/boards/Makefile
+++ b/sound/soc/intel/boards/Makefile
@@ -31,6 +31,7 @@ snd-soc-skl_hda_dsp-objs := skl_hda_dsp_generic.o skl_hda_dsp_common.o hda_dsp_c
 snd-skl_nau88l25_max98357a-objs := skl_nau88l25_max98357a.o
 snd-soc-skl_nau88l25_ssm4567-objs := skl_nau88l25_ssm4567.o
 snd-soc-sof_da7219_max98373-objs := sof_da7219_max98373.o hda_dsp_common.o
+snd-soc-ehl-rt5660-objs := ehl_rt5660.o hda_dsp_common.o
 snd-soc-sof-sdw-objs += sof_sdw.o				\
 			sof_sdw_rt711.o sof_sdw_rt700.o		\
 			sof_sdw_rt1308.o sof_sdw_rt715.o	\
@@ -68,4 +69,5 @@ obj-$(CONFIG_SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH) += snd-skl_nau88l25_max9
 obj-$(CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH) += snd-soc-skl_nau88l25_ssm4567.o
 obj-$(CONFIG_SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH) += snd-soc-skl_hda_dsp.o
 obj-$(CONFIG_SND_SOC_INTEL_SOF_DA7219_MAX98373_MACH) += snd-soc-sof_da7219_max98373.o
+obj-$(CONFIG_SND_SOC_INTEL_EHL_RT5660_MACH) += snd-soc-ehl-rt5660.o
 obj-$(CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH) += snd-soc-sof-sdw.o
diff --git a/sound/soc/intel/boards/ehl_rt5660.c b/sound/soc/intel/boards/ehl_rt5660.c
new file mode 100644
index 000000000000..2e3244d5496b
--- /dev/null
+++ b/sound/soc/intel/boards/ehl_rt5660.c
@@ -0,0 +1,323 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright (c) 2020 Intel Corporation
+
+/*
+ * ehl_rt5660 - ASOC Machine driver for Elkhart Lake platforms
+ * with rt5660 codec
+ */
+
+#include <linux/acpi.h>
+#include <sound/core.h>
+#include <linux/device.h>
+#include <linux/errno.h>
+#include <linux/gfp.h>
+#include <sound/jack.h>
+#include <linux/kernel.h>
+#include <linux/list.h>
+#include <linux/module.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+#include <sound/soc-acpi.h>
+
+#include "hda_dsp_common.h"
+#include "../../codecs/rt5660.h"
+
+#define DUAL_CHANNEL 2
+#define HDMI_LINK_START 3
+#define HDMI_LINE_END 6
+#define NAME_SIZE	32
+#define IDISP_CODEC_MASK	0x4
+
+struct sof_card_private {
+	struct list_head hdmi_pcm_list;
+	bool idisp_codec;
+};
+
+static const struct snd_kcontrol_new rt5660_controls[] = {
+	SOC_DAPM_PIN_SWITCH("Speaker"),
+	/* There are two MICBIAS in rt5660, each for one MIC */
+	SOC_DAPM_PIN_SWITCH("Headset Mic"),
+	SOC_DAPM_PIN_SWITCH("Headset Mic2"),
+	SOC_DAPM_PIN_SWITCH("Line Out"),
+};
+
+static const struct snd_soc_dapm_widget rt5660_widgets[] = {
+	SND_SOC_DAPM_SPK("Speaker", NULL),
+	SND_SOC_DAPM_MIC("Headset Mic", NULL),
+	SND_SOC_DAPM_MIC("Headset Mic2", NULL),
+	SND_SOC_DAPM_MIC("SoC DMIC", NULL),
+	SND_SOC_DAPM_LINE("Line Out", NULL),
+};
+
+static const struct snd_soc_dapm_route rt5660_map[] = {
+	{"Speaker", NULL, "SPO"},
+
+	{"Headset Mic", NULL, "MICBIAS1"},
+	{"Headset Mic2", NULL, "MICBIAS2"},
+
+	{"IN1P", NULL, "Headset Mic"},
+	{"IN2P", NULL, "Headset Mic2"},
+
+	{"Line Out", NULL, "LOUTL"},
+	{"Line Out", NULL, "LOUTR"},
+
+	{"DMic", NULL, "SoC DMIC"},
+};
+
+struct sof_hdmi_pcm {
+	struct list_head head;
+	struct snd_soc_dai *codec_dai;
+	int device;
+};
+
+static int hdmi_init(struct snd_soc_pcm_runtime *rtd)
+{
+	struct sof_card_private *ctx = snd_soc_card_get_drvdata(rtd->card);
+	struct snd_soc_dai *dai = asoc_rtd_to_codec(rtd, 0);
+	struct sof_hdmi_pcm *pcm;
+
+	pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL);
+	if (!pcm)
+		return -ENOMEM;
+
+	/* dai_link id is 1:1 mapped to the PCM device */
+	pcm->device = rtd->dai_link->id;
+	pcm->codec_dai = dai;
+
+	list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
+
+	return 0;
+}
+
+static int card_late_probe(struct snd_soc_card *card)
+{
+	struct sof_card_private *ctx = snd_soc_card_get_drvdata(card);
+	struct sof_hdmi_pcm *pcm;
+
+	if (list_empty(&ctx->hdmi_pcm_list))
+		return -ENOENT;
+
+	if (!ctx->idisp_codec)
+		return 0;
+
+	pcm = list_first_entry(&ctx->hdmi_pcm_list, struct sof_hdmi_pcm, head);
+
+	return hda_dsp_hdmi_build_controls(card, pcm->codec_dai->component);
+}
+
+static int rt5660_hw_params(struct snd_pcm_substream *substream,
+			    struct snd_pcm_hw_params *params)
+{
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
+	int ret;
+
+	ret = snd_soc_dai_set_sysclk(codec_dai,
+				     RT5660_SCLK_S_PLL1,
+				     params_rate(params) * 512,
+				     SND_SOC_CLOCK_IN);
+	if (ret < 0) {
+		dev_err(rtd->dev, "snd_soc_dai_set_sysclk err = %d\n", ret);
+		return ret;
+	}
+
+	ret = snd_soc_dai_set_pll(codec_dai, 0,
+				  RT5660_PLL1_S_BCLK,
+				  params_rate(params) * 50,
+				  params_rate(params) * 512);
+	if (ret < 0)
+		dev_err(codec_dai->dev, "can't set codec pll: %d\n", ret);
+
+	return ret;
+}
+
+static struct snd_soc_ops rt5660_ops = {
+	.hw_params = rt5660_hw_params,
+};
+
+SND_SOC_DAILINK_DEF(ssp0_pin,
+	DAILINK_COMP_ARRAY(COMP_CPU("SSP0 Pin")));
+
+SND_SOC_DAILINK_DEF(rt5660_codec,
+	DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC5660:00", "rt5660-aif1")));
+
+SND_SOC_DAILINK_DEF(platform,
+	DAILINK_COMP_ARRAY(COMP_PLATFORM("0000:00:1f.3")));
+
+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(idisp1_pin,
+	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_pin,
+	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_pin,
+	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(idisp4_pin,
+	DAILINK_COMP_ARRAY(COMP_CPU("iDisp4 Pin")));
+SND_SOC_DAILINK_DEF(idisp4_codec,
+	DAILINK_COMP_ARRAY(COMP_CODEC("ehdaudio0D2", "intel-hdmi-hifi4")));
+
+static struct snd_soc_dai_link ehl_rt5660_dailink[] = {
+	/* back ends */
+	{
+		.name = "SSP0-Codec",
+		.id = 0,
+		.no_pcm = 1,
+		.dpcm_playback = 1,
+		.dpcm_capture = 1,
+		.ops = &rt5660_ops,
+		.nonatomic = true,
+		SND_SOC_DAILINK_REG(ssp0_pin, rt5660_codec, platform),
+	},
+	{
+		.name = "dmic48k",
+		.id = 1,
+		.ignore_suspend = 1,
+		.dpcm_capture = 1,
+		.no_pcm = 1,
+		SND_SOC_DAILINK_REG(dmic_pin, dmic_codec, platform),
+	},
+	{
+		.name = "dmic16k",
+		.id = 2,
+		.ignore_suspend = 1,
+		.dpcm_capture = 1,
+		.no_pcm = 1,
+		SND_SOC_DAILINK_REG(dmic16k, dmic_codec, platform),
+	},
+	{
+		.name = "iDisp1",
+		.id = 5,
+		.init = hdmi_init,
+		.dpcm_playback = 1,
+		.no_pcm = 1,
+		SND_SOC_DAILINK_REG(idisp1_pin, idisp1_codec, platform),
+	},
+	{
+		.name = "iDisp2",
+		.id = 6,
+		.init = hdmi_init,
+		.dpcm_playback = 1,
+		.no_pcm = 1,
+		SND_SOC_DAILINK_REG(idisp2_pin, idisp2_codec, platform),
+	},
+	{
+		.name = "iDisp3",
+		.id = 7,
+		.init = hdmi_init,
+		.dpcm_playback = 1,
+		.no_pcm = 1,
+		SND_SOC_DAILINK_REG(idisp3_pin, idisp3_codec, platform),
+	},
+	{
+		.name = "iDisp4",
+		.id = 8,
+		.init = hdmi_init,
+		.dpcm_playback = 1,
+		.no_pcm = 1,
+		SND_SOC_DAILINK_REG(idisp4_pin, idisp4_codec, platform),
+	},
+};
+
+/* SoC card */
+static struct snd_soc_card snd_soc_card_ehl_rt5660 = {
+	.name = "ehl-rt5660",
+	.owner = THIS_MODULE,
+	.dai_link = ehl_rt5660_dailink,
+	.num_links = ARRAY_SIZE(ehl_rt5660_dailink),
+	.dapm_widgets = rt5660_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(rt5660_widgets),
+	.dapm_routes = rt5660_map,
+	.num_dapm_routes = ARRAY_SIZE(rt5660_map),
+	.controls = rt5660_controls,
+	.num_controls = ARRAY_SIZE(rt5660_controls),
+	.fully_routed = true,
+	.late_probe = card_late_probe,
+};
+
+/* If hdmi codec is not supported, switch to use dummy codec */
+static void hdmi_link_init(struct snd_soc_card *card,
+			   struct sof_card_private *ctx,
+			   struct snd_soc_acpi_mach *mach)
+{
+	struct snd_soc_dai_link *link;
+	int i;
+
+	if (mach->mach_params.common_hdmi_codec_drv &&
+	    (mach->mach_params.codec_mask & IDISP_CODEC_MASK)) {
+		ctx->idisp_codec = true;
+		return;
+	}
+
+	/*
+	 * if HDMI is not enabled in kernel config, or
+	 * hdmi codec is not supported
+	 */
+	for (i = HDMI_LINK_START; i <= HDMI_LINE_END; i++) {
+		link = &card->dai_link[i];
+		link->codecs[0].name = "snd-soc-dummy";
+		link->codecs[0].dai_name = "snd-soc-dummy-dai";
+	}
+}
+
+static int snd_ehl_rt5660_probe(struct platform_device *pdev)
+{
+	struct snd_soc_acpi_mach *mach;
+	struct snd_soc_card *card = &snd_soc_card_ehl_rt5660;
+	struct sof_card_private *ctx;
+	int ret;
+
+	card->dev = &pdev->dev;
+
+	ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
+	if (!ctx)
+		return -ENOMEM;
+	INIT_LIST_HEAD(&ctx->hdmi_pcm_list);
+	snd_soc_card_set_drvdata(card, ctx);
+
+	mach = pdev->dev.platform_data;
+	ret = snd_soc_fixup_dai_links_platform_name(card,
+						    mach->mach_params.platform);
+	if (ret)
+		return ret;
+
+	hdmi_link_init(card, ctx, mach);
+
+	return devm_snd_soc_register_card(&pdev->dev, card);
+}
+
+static const struct platform_device_id ehl_board_ids[] = {
+	{ .name = "ehl_rt5660" },
+	{ }
+};
+
+static struct platform_driver snd_ehl_rt5660_driver = {
+	.driver = {
+		.name = "ehl_rt5660",
+		.pm = &snd_soc_pm_ops,
+	},
+	.probe = snd_ehl_rt5660_probe,
+	.id_table = ehl_board_ids,
+};
+
+module_platform_driver(snd_ehl_rt5660_driver);
+
+MODULE_DESCRIPTION("ASoC Intel(R) Elkhartlake + rt5660 Machine driver");
+MODULE_AUTHOR("libin.yang@intel.com");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:ehl_rt5660");
diff --git a/sound/soc/intel/common/soc-acpi-intel-ehl-match.c b/sound/soc/intel/common/soc-acpi-intel-ehl-match.c
index a1290c3fa99f..b9ae0e2c959f 100644
--- a/sound/soc/intel/common/soc-acpi-intel-ehl-match.c
+++ b/sound/soc/intel/common/soc-acpi-intel-ehl-match.c
@@ -8,8 +8,15 @@
 
 #include <sound/soc-acpi.h>
 #include <sound/soc-acpi-intel-match.h>
+#include "../skylake/skl.h"
 
 struct snd_soc_acpi_mach snd_soc_acpi_intel_ehl_machines[] = {
+	{
+		.id = "INTC1027",
+		.drv_name = "ehl_rt5660",
+		.sof_fw_filename = "sof-ehl.ri",
+		.sof_tplg_filename = "sof-ehl-rt5660.tplg",
+	},
 	{},
 };
 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_ehl_machines);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Applied "ASoC: SOF: Intel: add PCI ID for ElkhartLake" to the asoc tree
  2020-04-09 18:58 ` [PATCH 04/13] ASoC: SOF: Intel: add PCI ID for ElkhartLake Pierre-Louis Bossart
@ 2020-04-14 14:48   ` Mark Brown
  0 siblings, 0 replies; 31+ messages in thread
From: Mark Brown @ 2020-04-14 14:48 UTC (permalink / raw)
  To: Libin Yang
  Cc: Guennadi Liakhovetski, alsa-devel, Kai Vehmanen, tiwai,
	Pierre-Louis Bossart, Mark Brown, Bard Liao

The patch

   ASoC: SOF: Intel: add PCI ID for ElkhartLake

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From a4ed29273376cb1f5aa05b90eb3c4d5877564976 Mon Sep 17 00:00:00 2001
From: Libin Yang <libin.yang@linux.intel.com>
Date: Thu, 9 Apr 2020 13:58:18 -0500
Subject: [PATCH] ASoC: SOF: Intel: add PCI ID for ElkhartLake

Add PCI ID for ElkhartLake platform.

Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200409185827.16255-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sof/sof-pci-dev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c
index cec631a1389b..b5f0221d624f 100644
--- a/sound/soc/sof/sof-pci-dev.c
+++ b/sound/soc/sof/sof-pci-dev.c
@@ -435,6 +435,8 @@ static const struct pci_device_id sof_pci_ids[] = {
 #if IS_ENABLED(CONFIG_SND_SOC_SOF_ELKHARTLAKE)
 	{ PCI_DEVICE(0x8086, 0x4b55),
 		.driver_data = (unsigned long)&ehl_desc},
+	{ PCI_DEVICE(0x8086, 0x4b58),
+		.driver_data = (unsigned long)&ehl_desc},
 #endif
 	{ 0, }
 };
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Applied "ALSA: hda: Add ElkhartLake HDMI codec vid" to the asoc tree
  2020-04-09 18:58 ` [PATCH 03/13] ALSA: hda: Add ElkhartLake HDMI codec vid Pierre-Louis Bossart
  2020-04-11 10:29   ` Takashi Iwai
@ 2020-04-14 14:48   ` Mark Brown
  1 sibling, 0 replies; 31+ messages in thread
From: Mark Brown @ 2020-04-14 14:48 UTC (permalink / raw)
  To: Libin Yang
  Cc: Guennadi Liakhovetski, alsa-devel, Kai Vehmanen, tiwai,
	Pierre-Louis Bossart, Mark Brown, Bard Liao

The patch

   ALSA: hda: Add ElkhartLake HDMI codec vid

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From d233c4941630af0ec2e14be7c2a693e9c9ce3087 Mon Sep 17 00:00:00 2001
From: Libin Yang <libin.yang@linux.intel.com>
Date: Thu, 9 Apr 2020 13:58:17 -0500
Subject: [PATCH] ALSA: hda: Add ElkhartLake HDMI codec vid

Add HDMI codec vid for the Intel ElkhartLake platform

Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200409185827.16255-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/pci/hda/patch_hdmi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index bb287a916dae..403baca89452 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -4156,6 +4156,7 @@ HDA_CODEC_ENTRY(0x8086280d, "Geminilake HDMI",	patch_i915_glk_hdmi),
 HDA_CODEC_ENTRY(0x8086280f, "Icelake HDMI",	patch_i915_icl_hdmi),
 HDA_CODEC_ENTRY(0x80862812, "Tigerlake HDMI",	patch_i915_tgl_hdmi),
 HDA_CODEC_ENTRY(0x8086281a, "Jasperlake HDMI",	patch_i915_icl_hdmi),
+HDA_CODEC_ENTRY(0x8086281b, "Elkhartlake HDMI",	patch_i915_icl_hdmi),
 HDA_CODEC_ENTRY(0x80862880, "CedarTrail HDMI",	patch_generic_hdmi),
 HDA_CODEC_ENTRY(0x80862882, "Valleyview2 HDMI",	patch_i915_byt_hdmi),
 HDA_CODEC_ENTRY(0x80862883, "Braswell HDMI",	patch_i915_byt_hdmi),
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Applied "ASoC: intel/skl/hda - set autosuspend timeout for hda codecs" to the asoc tree
  2020-04-09 18:58 ` [PATCH 02/13] ASoC: intel/skl/hda - set autosuspend timeout for hda codecs Pierre-Louis Bossart
@ 2020-04-14 14:48   ` Mark Brown
  0 siblings, 0 replies; 31+ messages in thread
From: Mark Brown @ 2020-04-14 14:48 UTC (permalink / raw)
  To: Hui Wang
  Cc: alsa-devel, Kai Vehmanen, tiwai, Pierre-Louis Bossart,
	Ranjani Sridharan, Clarex Zhou, Mark Brown, Jaska Uimonen

The patch

   ASoC: intel/skl/hda - set autosuspend timeout for hda codecs

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 3a24f135e6cc58c2dc042dde44031ec31b706ce5 Mon Sep 17 00:00:00 2001
From: Hui Wang <hui.wang@canonical.com>
Date: Thu, 9 Apr 2020 13:58:16 -0500
Subject: [PATCH] ASoC: intel/skl/hda - set autosuspend timeout for hda codecs

On some Lenovo and HP laptops, if both codec driver and SOF driver
are in runtime suspend mode, we plug a headset to the audio jack,
the headphone could be detected but Mic couldn't.

That is because when plugging, the headphone triggers a unsol event
first, and about 0.7s later (on the Lenovo X1 Carbon 7th), the Mic
triggers a unsol event. But if the codec driver enters runtime suspend
within 0.7s, the Mic can't trigger the unsol event.

If we don't set autosuspend_delay to a non-zero value for the hda codec
driver, it will enter runtime suspend immediately after the headphone
triggers the unsol event.

Follow the sequence of legacy hda driver and set a autosuspend delay
of 1sec after card registration (refer to pci/hda/hda_intel.c and
pci/hda/hda_codec.c).

Co-developed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Co-developed-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Clarex Zhou <clarex.zhou@intel.com>
Link: https://lore.kernel.org/r/20200409185827.16255-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/skl_hda_dsp_generic.c | 29 +++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/skl_hda_dsp_generic.c b/sound/soc/intel/boards/skl_hda_dsp_generic.c
index 3be764299ab0..64197b010e7d 100644
--- a/sound/soc/intel/boards/skl_hda_dsp_generic.c
+++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c
@@ -113,6 +113,8 @@ static char hda_soc_components[30];
 #define IDISP_ROUTE_COUNT	(IDISP_DAI_COUNT * 2)
 #define IDISP_CODEC_MASK	0x4
 
+#define HDA_CODEC_AUTOSUSPEND_DELAY_MS 1000
+
 static int skl_hda_fill_card_info(struct snd_soc_acpi_mach_params *mach_params)
 {
 	struct snd_soc_card *card = &hda_soc_card;
@@ -168,6 +170,27 @@ static int skl_hda_fill_card_info(struct snd_soc_acpi_mach_params *mach_params)
 	return 0;
 }
 
+static void skl_set_hda_codec_autosuspend_delay(struct snd_soc_card *card)
+{
+	struct snd_soc_pcm_runtime *rtd =
+		list_first_entry(&card->rtd_list,
+				 struct snd_soc_pcm_runtime, list);
+	struct snd_soc_dai *codec_dai = rtd->codec_dai;
+	struct hdac_hda_priv *hda_pvt;
+
+	if (!codec_dai)
+		return;
+
+	/*
+	 * all codecs are on the same bus, so it's sufficient
+	 * to lookup the first runtime and its codec, and set
+	 * power save defaults for all codecs on the bus
+	 */
+	hda_pvt = snd_soc_component_get_drvdata(codec_dai->component);
+	snd_hda_set_power_save(hda_pvt->codec.bus,
+			       HDA_CODEC_AUTOSUSPEND_DELAY_MS);
+}
+
 static int skl_hda_audio_probe(struct platform_device *pdev)
 {
 	struct snd_soc_acpi_mach *mach;
@@ -206,7 +229,11 @@ static int skl_hda_audio_probe(struct platform_device *pdev)
 		hda_soc_card.components = hda_soc_components;
 	}
 
-	return devm_snd_soc_register_card(&pdev->dev, &hda_soc_card);
+	ret = devm_snd_soc_register_card(&pdev->dev, &hda_soc_card);
+	if (!ret)
+		skl_set_hda_codec_autosuspend_delay(&hda_soc_card);
+
+	return ret;
 }
 
 static struct platform_driver skl_hda_audio = {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Applied "ASoC: Intel: sof_da7219_max98373: Add BE dailink for dmic16k" to the asoc tree
  2020-04-09 18:58 ` [PATCH 01/13] ASoC: Intel: sof_da7219_max98373: Add BE dailink for dmic16k Pierre-Louis Bossart
@ 2020-04-14 14:48   ` Mark Brown
  0 siblings, 0 replies; 31+ messages in thread
From: Mark Brown @ 2020-04-14 14:48 UTC (permalink / raw)
  To: Yong Zhi
  Cc: alsa-devel, Kai Vehmanen, tiwai, Pierre-Louis Bossart,
	Ranjani Sridharan, Mark Brown

The patch

   ASoC: Intel: sof_da7219_max98373: Add BE dailink for dmic16k

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From a8bb72f160020db5d7f81824b2dba6c8e29ef67a Mon Sep 17 00:00:00 2001
From: Yong Zhi <yong.zhi@intel.com>
Date: Thu, 9 Apr 2020 13:58:15 -0500
Subject: [PATCH] ASoC: Intel: sof_da7219_max98373: Add BE dailink for dmic16k

Add dmic16k BE dailink for keyword detection support, FE is
added in topology tplg file.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200409185827.16255-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/sof_da7219_max98373.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sound/soc/intel/boards/sof_da7219_max98373.c b/sound/soc/intel/boards/sof_da7219_max98373.c
index b707dd3b5625..8b5b74ba349f 100644
--- a/sound/soc/intel/boards/sof_da7219_max98373.c
+++ b/sound/soc/intel/boards/sof_da7219_max98373.c
@@ -265,6 +265,9 @@ SND_SOC_DAILINK_DEF(dmic_pin,
 SND_SOC_DAILINK_DEF(dmic_codec,
 	DAILINK_COMP_ARRAY(COMP_CODEC("dmic-codec", "dmic-hifi")));
 
+SND_SOC_DAILINK_DEF(dmic16k_pin,
+	DAILINK_COMP_ARRAY(COMP_CPU("DMIC16k Pin")));
+
 SND_SOC_DAILINK_DEF(idisp1_pin,
 	DAILINK_COMP_ARRAY(COMP_CPU("iDisp1 Pin")));
 SND_SOC_DAILINK_DEF(idisp1_codec,
@@ -337,6 +340,14 @@ static struct snd_soc_dai_link dais[] = {
 		.no_pcm = 1,
 		SND_SOC_DAILINK_REG(idisp3_pin, idisp3_codec, platform),
 	},
+	{
+		.name = "dmic16k",
+		.id = 6,
+		.ignore_suspend = 1,
+		.dpcm_capture = 1,
+		.no_pcm = 1,
+		SND_SOC_DAILINK_REG(dmic16k_pin, dmic_codec, platform),
+	}
 };
 
 static struct snd_soc_card card_da7219_m98373 = {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH 03/13] ALSA: hda: Add ElkhartLake HDMI codec vid
  2020-04-11 10:29   ` Takashi Iwai
@ 2020-04-14 16:09     ` Kai Vehmanen
  2020-04-14 16:32       ` Takashi Iwai
  2020-04-14 16:36       ` Pierre-Louis Bossart
  0 siblings, 2 replies; 31+ messages in thread
From: Kai Vehmanen @ 2020-04-14 16:09 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Guennadi Liakhovetski, alsa-devel, Kai Vehmanen,
	Pierre-Louis Bossart, broonie, Libin Yang, Bard Liao

Hey,

On Sat, 11 Apr 2020, Takashi Iwai wrote:

> On Thu, 09 Apr 2020 20:58:17 +0200, Pierre-Louis Bossart wrote:
>> Add HDMI codec vid for the Intel ElkhartLake platform
> 
> I suppose this can go through ASoC tree unless HDA legacy driver
> supports the device.

hmm, good point. In short, both DSP and non-DSP usage continue to be 
possible, so HDA legacy driver can be used as well. This is a (positive) 
new problem of SOF now using common codec driver for HDMI. The patch got 
merged already (and I think this is ok as we specifically enable and test 
HDMI with the ASoC stack), but maybe in the future we can send these codec 
driver patches directly, and not via ASoC.

Br, Kai

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 03/13] ALSA: hda: Add ElkhartLake HDMI codec vid
  2020-04-14 16:09     ` Kai Vehmanen
@ 2020-04-14 16:32       ` Takashi Iwai
  2020-04-14 16:36       ` Pierre-Louis Bossart
  1 sibling, 0 replies; 31+ messages in thread
From: Takashi Iwai @ 2020-04-14 16:32 UTC (permalink / raw)
  To: Kai Vehmanen
  Cc: Guennadi Liakhovetski, alsa-devel, Pierre-Louis Bossart, broonie,
	Libin Yang, Bard Liao

On Tue, 14 Apr 2020 18:09:58 +0200,
Kai Vehmanen wrote:
> 
> Hey,
> 
> On Sat, 11 Apr 2020, Takashi Iwai wrote:
> 
> > On Thu, 09 Apr 2020 20:58:17 +0200, Pierre-Louis Bossart wrote:
> >> Add HDMI codec vid for the Intel ElkhartLake platform
> > 
> > I suppose this can go through ASoC tree unless HDA legacy driver
> > supports the device.
> 
> hmm, good point. In short, both DSP and non-DSP usage continue to be 
> possible, so HDA legacy driver can be used as well. This is a (positive) 
> new problem of SOF now using common codec driver for HDMI. The patch got 
> merged already (and I think this is ok as we specifically enable and test 
> HDMI with the ASoC stack), but maybe in the future we can send these codec 
> driver patches directly, and not via ASoC.

I thought ELK controller code wasn't present in HDA legacy side, but
it's been already there.  So yeah, this could have been merged through
my tree better, but it's no big problem for now as the platform is too
new and not found in market yet :)

If any, we can sync in the early RC, if Mark can send a pull request.
I always prefer it in general.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 03/13] ALSA: hda: Add ElkhartLake HDMI codec vid
  2020-04-14 16:09     ` Kai Vehmanen
  2020-04-14 16:32       ` Takashi Iwai
@ 2020-04-14 16:36       ` Pierre-Louis Bossart
  1 sibling, 0 replies; 31+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-14 16:36 UTC (permalink / raw)
  To: Kai Vehmanen, Takashi Iwai
  Cc: Guennadi Liakhovetski, alsa-devel, broonie, Bard Liao, Libin Yang


>> On Thu, 09 Apr 2020 20:58:17 +0200, Pierre-Louis Bossart wrote:
>>> Add HDMI codec vid for the Intel ElkhartLake platform
>>
>> I suppose this can go through ASoC tree unless HDA legacy driver
>> supports the device.
> 
> hmm, good point. In short, both DSP and non-DSP usage continue to be
> possible, so HDA legacy driver can be used as well. This is a (positive)
> new problem of SOF now using common codec driver for HDMI. The patch got
> merged already (and I think this is ok as we specifically enable and test
> HDMI with the ASoC stack), but maybe in the future we can send these codec
> driver patches directly, and not via ASoC.

ElkhartLake support was added to the legacy driver a while back (5.3). 
Don't ask me why the hdmi codec id was not added at the time, it was 
indeed a miss.
I chose to send this patch as part of the ASoC series, so that at least 
we have consistency. Takashi, if you prefer it that way feel free to 
take this patch in your tree, but then Mark would need a tag for the 
rest of this series. I agree with Kai that moving forward the hdmi codec 
parts should be better tracked.
Thanks
-Pierre

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2020-04-14 16:37 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09 18:58 [PATCH 00/13] ASoC: Intel: machine drivers update for 5.8 Pierre-Louis Bossart
2020-04-09 18:58 ` [PATCH 01/13] ASoC: Intel: sof_da7219_max98373: Add BE dailink for dmic16k Pierre-Louis Bossart
2020-04-14 14:48   ` Applied "ASoC: Intel: sof_da7219_max98373: Add BE dailink for dmic16k" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 02/13] ASoC: intel/skl/hda - set autosuspend timeout for hda codecs Pierre-Louis Bossart
2020-04-14 14:48   ` Applied "ASoC: intel/skl/hda - set autosuspend timeout for hda codecs" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 03/13] ALSA: hda: Add ElkhartLake HDMI codec vid Pierre-Louis Bossart
2020-04-11 10:29   ` Takashi Iwai
2020-04-14 16:09     ` Kai Vehmanen
2020-04-14 16:32       ` Takashi Iwai
2020-04-14 16:36       ` Pierre-Louis Bossart
2020-04-14 14:48   ` Applied "ALSA: hda: Add ElkhartLake HDMI codec vid" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 04/13] ASoC: SOF: Intel: add PCI ID for ElkhartLake Pierre-Louis Bossart
2020-04-14 14:48   ` Applied "ASoC: SOF: Intel: add PCI ID for ElkhartLake" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 05/13] ASoC: Intel: boards: support Elkhart Lake with rt5660 Pierre-Louis Bossart
2020-04-14 14:48   ` Applied "ASoC: Intel: boards: support Elkhart Lake with rt5660" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 06/13] ASoC: intel: sof_sdw: init all aggregated codecs Pierre-Louis Bossart
2020-04-14 14:47   ` Applied "ASoC: intel: sof_sdw: init all aggregated codecs" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 07/13] ASoC: Intel: sof-da7219-max98373: add DMIC widget and route Pierre-Louis Bossart
2020-04-14 14:47   ` Applied "ASoC: Intel: sof-da7219-max98373: add DMIC widget and route" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 08/13] ASoC: Intel: sof_sdw_hdmi: fix compilation issue in fallback mode Pierre-Louis Bossart
2020-04-14 14:47   ` Applied "ASoC: Intel: sof_sdw_hdmi: fix compilation issue in fallback mode" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 09/13] ASoC: Intel: sof_sdw_hdmi: remove codec_dai use Pierre-Louis Bossart
2020-04-14 14:47   ` Applied "ASoC: Intel: sof_sdw_hdmi: remove codec_dai use" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 10/13] ASoC: Intel: sof_sdw_rt1308: remove codec dai use Pierre-Louis Bossart
2020-04-14 14:47   ` Applied "ASoC: Intel: sof_sdw_rt1308: remove codec dai use" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 11/13] ASoC: Intel: sof_sdw_rt5682: remove codec_dai use Pierre-Louis Bossart
2020-04-14 14:47   ` Applied "ASoC: Intel: sof_sdw_rt5682: remove codec_dai use" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 12/13] ASoC: Intel: sof_sdw_rt700: remove codec_dai use Pierre-Louis Bossart
2020-04-14 14:47   ` Applied "ASoC: Intel: sof_sdw_rt700: remove codec_dai use" to the asoc tree Mark Brown
2020-04-09 18:58 ` [PATCH 13/13] ASoC: Intel: sof_sdw_rt711: remove codec_dai use Pierre-Louis Bossart
2020-04-14 14:47   ` Applied "ASoC: Intel: sof_sdw_rt711: remove codec_dai use" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).