summary refs log tree commit diff
path: root/sound/soc/amd
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/amd')
-rw-r--r--sound/soc/amd/acp-config.c44
-rw-r--r--sound/soc/amd/acp/acp-mach-common.c36
-rw-r--r--sound/soc/amd/acp/acp-mach.h5
-rw-r--r--sound/soc/amd/acp/acp-sof-mach.c18
-rw-r--r--sound/soc/amd/mach-config.h2
-rw-r--r--sound/soc/amd/vangogh/pci-acp5x.c3
6 files changed, 75 insertions, 33 deletions
diff --git a/sound/soc/amd/acp-config.c b/sound/soc/amd/acp-config.c
index e8a357c8f997..d38ac9ab723e 100644
--- a/sound/soc/amd/acp-config.c
+++ b/sound/soc/amd/acp-config.c
@@ -47,6 +47,34 @@ static const struct config_entry config_table[] = {
 			{}
 		},
 	},
+	{
+		.flags = FLAG_AMD_LEGACY,
+		.device = ACP_PCI_DEV_ID,
+		.dmi_table = (const struct dmi_system_id []) {
+			{
+				.matches = {
+					DMI_MATCH(DMI_SYS_VENDOR, "Valve"),
+					DMI_MATCH(DMI_PRODUCT_NAME, "Jupiter"),
+					DMI_MATCH(DMI_PRODUCT_FAMILY, "Aerith"),
+				},
+			},
+			{}
+		},
+	},
+	{
+		.flags = FLAG_AMD_SOF,
+		.device = ACP_PCI_DEV_ID,
+		.dmi_table = (const struct dmi_system_id []) {
+			{
+				.matches = {
+					DMI_MATCH(DMI_SYS_VENDOR, "Valve"),
+					DMI_MATCH(DMI_PRODUCT_NAME, "Galileo"),
+					DMI_MATCH(DMI_PRODUCT_FAMILY, "Sephiroth"),
+				},
+			},
+			{}
+		},
+	},
 };
 
 int snd_amd_acp_find_config(struct pci_dev *pci)
@@ -82,14 +110,12 @@ static struct snd_soc_acpi_codecs amp_max = {
 	.codecs = {"MX98360A"}
 };
 
-static struct snd_soc_acpi_codecs amp_cs35l41 = {
-	.num_codecs = 1,
-	.codecs = {"CLSA3541"}
-};
+static struct snd_soc_acpi_codecs amp_max98388 = { .num_codecs = 1,
+						   .codecs = { "ADS8388" } };
 
-static struct snd_soc_acpi_codecs amp_max98388 = {
-	.num_codecs = 1,
-	.codecs = {"ADS8388"}
+static struct snd_soc_acpi_codecs amp_cs35l41 = {
+   .num_codecs = 1,
+   .codecs = {"CLSA3541"}
 };
 
 struct snd_soc_acpi_mach snd_soc_acpi_amd_sof_machines[] = {
@@ -140,7 +166,7 @@ struct snd_soc_acpi_mach snd_soc_acpi_amd_sof_machines[] = {
 };
 EXPORT_SYMBOL(snd_soc_acpi_amd_sof_machines);
 
-struct snd_soc_acpi_mach snd_soc_acpi_amd_vgh_sof_machines[] = {
+struct snd_soc_acpi_mach snd_soc_acpi_amd_vangogh_sof_machines[] = {
 	{
 		.id = "NVTN2020",
 		.drv_name = "nau8821-cs3",
@@ -161,7 +187,7 @@ struct snd_soc_acpi_mach snd_soc_acpi_amd_vgh_sof_machines[] = {
 	},
 	{},
 };
-EXPORT_SYMBOL(snd_soc_acpi_amd_vgh_sof_machines);
+EXPORT_SYMBOL(snd_soc_acpi_amd_vangogh_sof_machines);
 
 struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_sof_machines[] = {
 	{
diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c
index b76552514926..5c4467e48f2b 100644
--- a/sound/soc/amd/acp/acp-mach-common.c
+++ b/sound/soc/amd/acp/acp-mach-common.c
@@ -35,10 +35,10 @@ static struct snd_soc_jack vg_headset;
 #define RT5682_PLL_FREQ (48000 * 512)
 #define DUAL_CHANNEL	2
 #define FOUR_CHANNEL	4
+#define MAX98388_CODEC_DAI	"max98388-aif1"
 #define NAU8821_CODEC_DAI	"nau8821-hifi"
 #define NAU8821_BCLK		1536000
 #define NAU8821_FREQ_OUT	12288000
-#define MAX98388_CODEC_DAI	"max98388-aif1"
 
 #define TDM_MODE_ENABLE 1
 
@@ -725,7 +725,7 @@ static int acp_card_max98388_init(struct snd_soc_pcm_runtime *rtd)
 		return -EINVAL;
 
 	ret = snd_soc_dapm_new_controls(&card->dapm, max98388_widgets,
-						ARRAY_SIZE(max98388_widgets));
+					ARRAY_SIZE(max98388_widgets));
 
 	if (ret) {
 		dev_err(rtd->dev, "unable to add widget dapm controls, ret %d\n", ret);
@@ -737,7 +737,7 @@ static int acp_card_max98388_init(struct snd_soc_pcm_runtime *rtd)
 }
 
 static int acp_max98388_hw_params(struct snd_pcm_substream *substream,
-				    struct snd_pcm_hw_params *params)
+				  struct snd_pcm_hw_params *params)
 {
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_card *card = rtd->card;
@@ -755,7 +755,7 @@ static int acp_max98388_hw_params(struct snd_pcm_substream *substream,
 	return ret;
 }
 
-static const struct snd_soc_ops acp_card_max98388_ops = {
+static const struct snd_soc_ops acp_max98388_ops = {
 	.startup = acp_card_max98388_startup,
 	.hw_params = acp_max98388_hw_params,
 };
@@ -1160,6 +1160,8 @@ SND_SOC_DAILINK_DEF(sof_hs,
 		    DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-hs")));
 SND_SOC_DAILINK_DEF(sof_hs_virtual,
 	DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-hs-virtual")));
+SND_SOC_DAILINK_DEF(sof_bt,
+		    DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-bt")));
 SND_SOC_DAILINK_DEF(sof_dmic,
 	DAILINK_COMP_ARRAY(COMP_CPU("acp-sof-dmic")));
 SND_SOC_DAILINK_DEF(pdm_dmic,
@@ -1218,6 +1220,8 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
 
 	if (drv_data->hs_cpu_id)
 		num_links++;
+	if (drv_data->bt_cpu_id)
+		num_links++;
 	if (drv_data->amp_cpu_id)
 		num_links++;
 	if (drv_data->dmic_cpu_id)
@@ -1303,6 +1307,7 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
 		links[i].platforms = sof_component;
 		links[i].num_platforms = ARRAY_SIZE(sof_component);
 		links[i].dpcm_playback = 1;
+		links[i].dpcm_capture = 1;
 		links[i].nonatomic = true;
 		links[i].no_pcm = 1;
 		if (!drv_data->amp_codec_id) {
@@ -1335,6 +1340,7 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
 		links[i].platforms = sof_component;
 		links[i].num_platforms = ARRAY_SIZE(sof_component);
 		links[i].dpcm_playback = 1;
+		links[i].dpcm_capture = 1;
 		links[i].nonatomic = true;
 		links[i].no_pcm = 1;
 		if (!drv_data->amp_codec_id) {
@@ -1351,7 +1357,7 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
 		if (drv_data->amp_codec_id == MAX98388) {
 			links[i].codecs = max98388;
 			links[i].num_codecs = ARRAY_SIZE(max98388);
-			links[i].ops = &acp_card_max98388_ops;
+			links[i].ops = &acp_max98388_ops;
 			links[i].init = acp_card_max98388_init;
 			card->codec_conf = max98388_conf;
 			card->num_configs = ARRAY_SIZE(max98388_conf);
@@ -1375,6 +1381,26 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
 		i++;
 	}
 
+	if (drv_data->bt_cpu_id == I2S_BT) {
+		links[i].name = "acp-bt-codec";
+		links[i].id = BT_BE_ID;
+		links[i].cpus = sof_bt;
+		links[i].num_cpus = ARRAY_SIZE(sof_bt);
+		links[i].platforms = sof_component;
+		links[i].num_platforms = ARRAY_SIZE(sof_component);
+		links[i].dpcm_playback = 1;
+		links[i].dpcm_capture = 1;
+		links[i].nonatomic = true;
+		links[i].no_pcm = 1;
+		if (!drv_data->bt_codec_id) {
+			/* Use dummy codec if codec id not specified */
+			links[i].codecs = dummy_codec;
+			links[i].num_codecs = ARRAY_SIZE(dummy_codec);
+			links[i].num_codecs = 1;
+		}
+		i++;
+	}
+
 	if (drv_data->dmic_cpu_id == DMIC) {
 		links[i].name = "acp-dmic-codec";
 		links[i].id = DMIC_BE_ID;
diff --git a/sound/soc/amd/acp/acp-mach.h b/sound/soc/amd/acp/acp-mach.h
index 16801b4882a4..e8da98c1cb88 100644
--- a/sound/soc/amd/acp/acp-mach.h
+++ b/sound/soc/amd/acp/acp-mach.h
@@ -23,6 +23,7 @@
 enum be_id {
 	HEADSET_BE_ID = 0,
 	AMP_BE_ID,
+	BT_BE_ID,
 	DMIC_BE_ID,
 };
 
@@ -41,9 +42,9 @@ enum codec_endpoints {
 	MAX98360A,
 	RT5682S,
 	NAU8825,
-	NAU8821,
 	CS35L41,
 	MAX98388,
+	NAU8821,
 };
 
 enum platform_end_point {
@@ -54,9 +55,11 @@ enum platform_end_point {
 struct acp_card_drvdata {
 	unsigned int hs_cpu_id;
 	unsigned int amp_cpu_id;
+	unsigned int bt_cpu_id;
 	unsigned int dmic_cpu_id;
 	unsigned int hs_codec_id;
 	unsigned int amp_codec_id;
+	unsigned int bt_codec_id;
 	unsigned int dmic_codec_id;
 	unsigned int dai_fmt;
 	unsigned int platform;
diff --git a/sound/soc/amd/acp/acp-sof-mach.c b/sound/soc/amd/acp/acp-sof-mach.c
index 1e003f7910c8..d01c358f0be2 100644
--- a/sound/soc/amd/acp/acp-sof-mach.c
+++ b/sound/soc/amd/acp/acp-sof-mach.c
@@ -83,23 +83,14 @@ static struct acp_card_drvdata sof_rt5682s_hs_rt1019_data = {
 	.tdm_mode = false,
 };
 
-static struct acp_card_drvdata sof_nau8821_cs35l41_data = {
-	.hs_cpu_id = I2S_SP,
-	.amp_cpu_id = I2S_HS,
-	.dmic_cpu_id = NONE,
-	.hs_codec_id = NAU8821,
-	.amp_codec_id = CS35L41,
-	.dmic_codec_id = NONE,
-	.soc_mclk = true,
-	.tdm_mode = false,
-};
-
 static struct acp_card_drvdata sof_nau8821_max98388_data = {
 	.hs_cpu_id = I2S_SP,
 	.amp_cpu_id = I2S_HS,
+	.bt_cpu_id	= I2S_BT,
 	.dmic_cpu_id = NONE,
 	.hs_codec_id = NAU8821,
 	.amp_codec_id = MAX98388,
+	.bt_codec_id = NONE,
 	.dmic_codec_id = NONE,
 	.soc_mclk = true,
 	.tdm_mode = false,
@@ -189,10 +180,6 @@ static const struct platform_device_id board_ids[] = {
 		.driver_data = (kernel_ulong_t)&sof_rt5682s_hs_rt1019_data
 	},
 	{
-		.name = "nau8821-cs3",
-		.driver_data = (kernel_ulong_t)&sof_nau8821_cs35l41_data
-	},
-	{
 		.name = "nau8821-max",
 		.driver_data = (kernel_ulong_t)&sof_nau8821_max98388_data
 	},
@@ -217,6 +204,5 @@ MODULE_ALIAS("platform:rt5682s-max");
 MODULE_ALIAS("platform:rt5682s-rt1019");
 MODULE_ALIAS("platform:nau8825-max");
 MODULE_ALIAS("platform:rt5682s-hs-rt1019");
-MODULE_ALIAS("platform:nau8821-cs3");
 MODULE_ALIAS("platform:nau8821-max");
 MODULE_LICENSE("GPL v2");
diff --git a/sound/soc/amd/mach-config.h b/sound/soc/amd/mach-config.h
index bad694df2732..d392e6d6e6e1 100644
--- a/sound/soc/amd/mach-config.h
+++ b/sound/soc/amd/mach-config.h
@@ -20,7 +20,7 @@
 
 extern struct snd_soc_acpi_mach snd_soc_acpi_amd_sof_machines[];
 extern struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_sof_machines[];
-extern struct snd_soc_acpi_mach snd_soc_acpi_amd_vgh_sof_machines[];
+extern struct snd_soc_acpi_mach snd_soc_acpi_amd_vangogh_sof_machines[];
 
 struct config_entry {
 	u32 flags;
diff --git a/sound/soc/amd/vangogh/pci-acp5x.c b/sound/soc/amd/vangogh/pci-acp5x.c
index c4634a8a17cd..e29c4cc10e0f 100644
--- a/sound/soc/amd/vangogh/pci-acp5x.c
+++ b/sound/soc/amd/vangogh/pci-acp5x.c
@@ -13,6 +13,7 @@
 #include <linux/pm_runtime.h>
 
 #include "acp5x.h"
+#include "../mach-config.h"
 
 struct acp5x_dev_data {
 	void __iomem *acp5x_base;
@@ -131,7 +132,7 @@ static int snd_acp5x_probe(struct pci_dev *pci,
 
 	/* Return if acp config flag is defined */
 	flag = snd_amd_acp_find_config(pci);
-	if (flag)
+	if (flag != FLAG_AMD_LEGACY)
 		return -ENODEV;
 
 	irqflags = IRQF_SHARED;