All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ASoC: Intel: boards: Chromebook configuration updates
@ 2022-05-09 17:09 Pierre-Louis Bossart
  2022-05-09 17:09 ` [PATCH 1/3] ASoC: Intel: sof_rt5682: Add support for adl_rt1019_rt5682s Pierre-Louis Bossart
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Pierre-Louis Bossart @ 2022-05-09 17:09 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Pierre-Louis Bossart

two minor changes to enable DMIC and capture for CS35L41, and one new
configuration for AlderLake hardware.

Brent Lu (2):
  ASoC: Intel: sof_ssp_amp: fix no DMIC BE Link on Chromebooks
  ASoC: Intel: sof_ssp_amp: enable capture stream from cs35l41

Vamshi Krishna (1):
  ASoC: Intel: sof_rt5682: Add support for adl_rt1019_rt5682s

 sound/soc/intel/boards/sof_realtek_common.c   | 39 +++++++++++++++++++
 sound/soc/intel/boards/sof_realtek_common.h   |  5 +++
 sound/soc/intel/boards/sof_rt5682.c           | 13 +++++++
 sound/soc/intel/boards/sof_ssp_amp.c          | 19 ++++++++-
 .../intel/common/soc-acpi-intel-adl-match.c   |  7 ++++
 5 files changed, 81 insertions(+), 2 deletions(-)

-- 
2.30.2


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

* [PATCH 1/3] ASoC: Intel: sof_rt5682: Add support for adl_rt1019_rt5682s
  2022-05-09 17:09 [PATCH 0/3] ASoC: Intel: boards: Chromebook configuration updates Pierre-Louis Bossart
@ 2022-05-09 17:09 ` Pierre-Louis Bossart
  2022-05-09 17:09 ` [PATCH 2/3] ASoC: Intel: sof_ssp_amp: fix no DMIC BE Link on Chromebooks Pierre-Louis Bossart
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Pierre-Louis Bossart @ 2022-05-09 17:09 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Brent Lu, Vamshi Krishna, Pierre-Louis Bossart

From: Vamshi Krishna <vamshi.krishna.gopal@intel.com>

This patch adds the driver data for two rt1019 speaker amplifiers on
SSP1 and rt5682s on SSP0 for ADL platform

Reviewed-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Vamshi Krishna <vamshi.krishna.gopal@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/sof_realtek_common.c   | 39 +++++++++++++++++++
 sound/soc/intel/boards/sof_realtek_common.h   |  5 +++
 sound/soc/intel/boards/sof_rt5682.c           | 13 +++++++
 .../intel/common/soc-acpi-intel-adl-match.c   |  7 ++++
 4 files changed, 64 insertions(+)

diff --git a/sound/soc/intel/boards/sof_realtek_common.c b/sound/soc/intel/boards/sof_realtek_common.c
index a2bcbeee02162..2ab568c1d40ba 100644
--- a/sound/soc/intel/boards/sof_realtek_common.c
+++ b/sound/soc/intel/boards/sof_realtek_common.c
@@ -459,5 +459,44 @@ void sof_rt1308_dai_link(struct snd_soc_dai_link *link)
 }
 EXPORT_SYMBOL_NS(sof_rt1308_dai_link, SND_SOC_INTEL_SOF_REALTEK_COMMON);
 
+/*
+ * 2-amp Configuration for RT1019
+ */
+
+static const struct snd_soc_dapm_route rt1019_dapm_routes[] = {
+	/* speaker */
+	{ "Left Spk", NULL, "Speaker" },
+	{ "Right Spk", NULL, "Speaker" },
+};
+
+static struct snd_soc_dai_link_component rt1019_components[] = {
+	{
+		.name = RT1019_DEV0_NAME,
+		.dai_name = RT1019_CODEC_DAI,
+	},
+};
+
+static int rt1019_init(struct snd_soc_pcm_runtime *rtd)
+{
+	struct snd_soc_card *card = rtd->card;
+	int ret;
+
+	ret = snd_soc_dapm_add_routes(&card->dapm, rt1019_dapm_routes,
+				      ARRAY_SIZE(rt1019_dapm_routes));
+	if (ret) {
+		dev_err(rtd->dev, "Speaker map addition failed: %d\n", ret);
+		return ret;
+	}
+	return ret;
+}
+
+void sof_rt1019_dai_link(struct snd_soc_dai_link *link)
+{
+	link->codecs = rt1019_components;
+	link->num_codecs = ARRAY_SIZE(rt1019_components);
+	link->init = rt1019_init;
+}
+EXPORT_SYMBOL_NS(sof_rt1019_dai_link, SND_SOC_INTEL_SOF_REALTEK_COMMON);
+
 MODULE_DESCRIPTION("ASoC Intel SOF Realtek helpers");
 MODULE_LICENSE("GPL");
diff --git a/sound/soc/intel/boards/sof_realtek_common.h b/sound/soc/intel/boards/sof_realtek_common.h
index e0a5518e8dd25..ec3eea633e048 100644
--- a/sound/soc/intel/boards/sof_realtek_common.h
+++ b/sound/soc/intel/boards/sof_realtek_common.h
@@ -39,4 +39,9 @@ void sof_rt1015_codec_conf(struct snd_soc_card *card);
 #define RT1308_DEV0_NAME	"i2c-10EC1308:00"
 void sof_rt1308_dai_link(struct snd_soc_dai_link *link);
 
+#define RT1019_CODEC_DAI	"HiFi"
+#define RT1019_DEV0_NAME	"RTL1019:00"
+
+void sof_rt1019_dai_link(struct snd_soc_dai_link *link);
+
 #endif /* __SOF_REALTEK_COMMON_H */
diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c
index e926d06b35292..5d67a2c87a1d4 100644
--- a/sound/soc/intel/boards/sof_rt5682.c
+++ b/sound/soc/intel/boards/sof_rt5682.c
@@ -60,6 +60,7 @@
 #define SOF_RT5682S_HEADPHONE_CODEC_PRESENT	BIT(23)
 #define SOF_MAX98390_SPEAKER_AMP_PRESENT	BIT(24)
 #define SOF_MAX98390_TWEETER_SPEAKER_PRESENT	BIT(25)
+#define SOF_RT1019_SPEAKER_AMP_PRESENT	BIT(26)
 
 
 /* Default: MCLK on, MCLK 19.2M, SSP0  */
@@ -733,6 +734,8 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
 					SOF_RT1015_SPEAKER_AMP_100FS) ? 100 : 64);
 		} else if (sof_rt5682_quirk & SOF_RT1015P_SPEAKER_AMP_PRESENT) {
 			sof_rt1015p_dai_link(&links[id]);
+		} else if (sof_rt5682_quirk & SOF_RT1019_SPEAKER_AMP_PRESENT) {
+			sof_rt1019_dai_link(&links[id]);
 		} else if (sof_rt5682_quirk &
 				SOF_MAX98373_SPEAKER_AMP_PRESENT) {
 			links[id].codecs = max_98373_components;
@@ -1070,6 +1073,16 @@ static const struct platform_device_id board_ids[] = {
 					SOF_BT_OFFLOAD_SSP(2) |
 					SOF_SSP_BT_OFFLOAD_PRESENT),
 	},
+	{
+		.name = "adl_rt1019_rt5682s",
+		.driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN |
+					SOF_RT5682_SSP_CODEC(0) |
+					SOF_RT5682S_HEADPHONE_CODEC_PRESENT |
+					SOF_SPEAKER_AMP_PRESENT |
+					SOF_RT1019_SPEAKER_AMP_PRESENT |
+					SOF_RT5682_SSP_AMP(1) |
+					SOF_RT5682_NUM_HDMIDEV(4)),
+	},
 	{ }
 };
 MODULE_DEVICE_TABLE(platform, board_ids);
diff --git a/sound/soc/intel/common/soc-acpi-intel-adl-match.c b/sound/soc/intel/common/soc-acpi-intel-adl-match.c
index 8bfe7070b84a1..e6e52c7b68033 100644
--- a/sound/soc/intel/common/soc-acpi-intel-adl-match.c
+++ b/sound/soc/intel/common/soc-acpi-intel-adl-match.c
@@ -455,6 +455,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
 		.quirk_data = &adl_max98360a_amp,
 		.sof_tplg_filename = "sof-adl-mx98360a-nau8825.tplg",
 	},
+	{
+		.id = "RTL5682",
+		.drv_name = "adl_rt1019_rt5682s",
+		.machine_quirk = snd_soc_acpi_codec_list,
+		.quirk_data = &adl_rt1019p_amp,
+		.sof_tplg_filename = "sof-adl-rt1019-rt5682.tplg",
+	},
 	{
 		.id = "10508825",
 		.drv_name = "sof_nau8825",
-- 
2.30.2


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

* [PATCH 2/3] ASoC: Intel: sof_ssp_amp: fix no DMIC BE Link on Chromebooks
  2022-05-09 17:09 [PATCH 0/3] ASoC: Intel: boards: Chromebook configuration updates Pierre-Louis Bossart
  2022-05-09 17:09 ` [PATCH 1/3] ASoC: Intel: sof_rt5682: Add support for adl_rt1019_rt5682s Pierre-Louis Bossart
@ 2022-05-09 17:09 ` Pierre-Louis Bossart
  2022-05-09 17:09 ` [PATCH 3/3] ASoC: Intel: sof_ssp_amp: enable capture stream from cs35l41 Pierre-Louis Bossart
  2022-05-11 18:26 ` [PATCH 0/3] ASoC: Intel: boards: Chromebook configuration updates Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Pierre-Louis Bossart @ 2022-05-09 17:09 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Bard Liao, Brent Lu, Pierre-Louis Bossart

From: Brent Lu <brent.lu@intel.com>

The SOF topology supports 2 BE Links(dmic01 and dmic16k) and each
link supports up to four DMICs. However, Chromebook does not implement
ACPI NHLT table so the mach->mach_params.dmic_num is always zero. We
add a quirk so machine driver knows it's running on a Chromebook and
need to create BE Links for DMIC.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/sof_ssp_amp.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/boards/sof_ssp_amp.c b/sound/soc/intel/boards/sof_ssp_amp.c
index 8f5b9ebbe8287..675ade8187b65 100644
--- a/sound/soc/intel/boards/sof_ssp_amp.c
+++ b/sound/soc/intel/boards/sof_ssp_amp.c
@@ -9,6 +9,7 @@
 
 #include <linux/acpi.h>
 #include <linux/delay.h>
+#include <linux/dmi.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <sound/core.h>
@@ -78,6 +79,16 @@ struct sof_card_private {
 	bool idisp_codec;
 };
 
+static const struct dmi_system_id chromebook_platforms[] = {
+	{
+		.ident = "Google Chromebooks",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Google"),
+		}
+	},
+	{},
+};
+
 static const struct snd_soc_dapm_widget sof_ssp_amp_dapm_widgets[] = {
 	SND_SOC_DAPM_MIC("SoC DMIC", NULL),
 };
@@ -371,7 +382,7 @@ static int sof_ssp_amp_probe(struct platform_device *pdev)
 	struct snd_soc_dai_link *dai_links;
 	struct snd_soc_acpi_mach *mach;
 	struct sof_card_private *ctx;
-	int dmic_be_num, hdmi_num = 0;
+	int dmic_be_num = 0, hdmi_num = 0;
 	int ret, ssp_codec;
 
 	ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
@@ -383,7 +394,8 @@ static int sof_ssp_amp_probe(struct platform_device *pdev)
 
 	mach = pdev->dev.platform_data;
 
-	dmic_be_num = mach->mach_params.dmic_num;
+	if (dmi_check_system(chromebook_platforms) || mach->mach_params.dmic_num > 0)
+		dmic_be_num = 2;
 
 	ssp_codec = sof_ssp_amp_quirk & SOF_AMPLIFIER_SSP_MASK;
 
-- 
2.30.2


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

* [PATCH 3/3] ASoC: Intel: sof_ssp_amp: enable capture stream from cs35l41
  2022-05-09 17:09 [PATCH 0/3] ASoC: Intel: boards: Chromebook configuration updates Pierre-Louis Bossart
  2022-05-09 17:09 ` [PATCH 1/3] ASoC: Intel: sof_rt5682: Add support for adl_rt1019_rt5682s Pierre-Louis Bossart
  2022-05-09 17:09 ` [PATCH 2/3] ASoC: Intel: sof_ssp_amp: fix no DMIC BE Link on Chromebooks Pierre-Louis Bossart
@ 2022-05-09 17:09 ` Pierre-Louis Bossart
  2022-05-11 18:26 ` [PATCH 0/3] ASoC: Intel: boards: Chromebook configuration updates Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Pierre-Louis Bossart @ 2022-05-09 17:09 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Bard Liao, Brent Lu, Pierre-Louis Bossart

From: Brent Lu <brent.lu@intel.com>

Enable capture stream of the cs35l41 dai link to support feedback
stream from amplifier.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/sof_ssp_amp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/intel/boards/sof_ssp_amp.c b/sound/soc/intel/boards/sof_ssp_amp.c
index 675ade8187b65..4a762e002ac75 100644
--- a/sound/soc/intel/boards/sof_ssp_amp.c
+++ b/sound/soc/intel/boards/sof_ssp_amp.c
@@ -258,6 +258,9 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
 		sof_rt1308_dai_link(&links[id]);
 	} else if (sof_ssp_amp_quirk & SOF_CS35L41_SPEAKER_AMP_PRESENT) {
 		cs35l41_set_dai_link(&links[id]);
+
+		/* feedback from amplifier */
+		links[id].dpcm_capture = 1;
 	}
 	links[id].platforms = platform_component;
 	links[id].num_platforms = ARRAY_SIZE(platform_component);
-- 
2.30.2


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

* Re: [PATCH 0/3] ASoC: Intel: boards: Chromebook configuration updates
  2022-05-09 17:09 [PATCH 0/3] ASoC: Intel: boards: Chromebook configuration updates Pierre-Louis Bossart
                   ` (2 preceding siblings ...)
  2022-05-09 17:09 ` [PATCH 3/3] ASoC: Intel: sof_ssp_amp: enable capture stream from cs35l41 Pierre-Louis Bossart
@ 2022-05-11 18:26 ` Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2022-05-11 18:26 UTC (permalink / raw)
  To: alsa-devel, pierre-louis.bossart; +Cc: tiwai

On Mon, 9 May 2022 12:09:19 -0500, Pierre-Louis Bossart wrote:
> two minor changes to enable DMIC and capture for CS35L41, and one new
> configuration for AlderLake hardware.
> 
> Brent Lu (2):
>   ASoC: Intel: sof_ssp_amp: fix no DMIC BE Link on Chromebooks
>   ASoC: Intel: sof_ssp_amp: enable capture stream from cs35l41
> 
> [...]

Applied to

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

Thanks!

[1/3] ASoC: Intel: sof_rt5682: Add support for adl_rt1019_rt5682s
      commit: 0b56ed197d7df394fc4918bfea0f77e6192996b0
[2/3] ASoC: Intel: sof_ssp_amp: fix no DMIC BE Link on Chromebooks
      commit: d1c808765deb2bcd35d827402ed4d75d068aae18
[3/3] ASoC: Intel: sof_ssp_amp: enable capture stream from cs35l41
      commit: cebbefbd22d5afd161a4762ced7212c10971d011

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

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

end of thread, other threads:[~2022-05-11 18:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09 17:09 [PATCH 0/3] ASoC: Intel: boards: Chromebook configuration updates Pierre-Louis Bossart
2022-05-09 17:09 ` [PATCH 1/3] ASoC: Intel: sof_rt5682: Add support for adl_rt1019_rt5682s Pierre-Louis Bossart
2022-05-09 17:09 ` [PATCH 2/3] ASoC: Intel: sof_ssp_amp: fix no DMIC BE Link on Chromebooks Pierre-Louis Bossart
2022-05-09 17:09 ` [PATCH 3/3] ASoC: Intel: sof_ssp_amp: enable capture stream from cs35l41 Pierre-Louis Bossart
2022-05-11 18:26 ` [PATCH 0/3] ASoC: Intel: boards: Chromebook configuration updates Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.