Commit eee33bac authored by Ajit Kumar Pandey's avatar Ajit Kumar Pandey Committed by Mark Brown

ASoC: amd: acp-legacy: Add legacy card support for new machines

We have newer renoir platforms with different codecs combinations.
Add struct in legacy machine driver and add to list of supported
renoir machine to support sound card registration on platform with
rt5682s as primary headset codec and max98360 and rt1019 as speaker
amp codec.

This also fixes error reported by kernel robot:
"error: 'EN_SPKR_GPIO_DW' undeclared here"
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarAjit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20220222124213.721224-3-AjitKumar.Pandey@amd.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent abdcf728
...@@ -30,6 +30,26 @@ static struct acp_card_drvdata rt5682_rt1019_data = { ...@@ -30,6 +30,26 @@ static struct acp_card_drvdata rt5682_rt1019_data = {
.gpio_spkr_en = EN_SPKR_GPIO_GB, .gpio_spkr_en = EN_SPKR_GPIO_GB,
}; };
static struct acp_card_drvdata rt5682s_max_data = {
.hs_cpu_id = I2S_SP,
.amp_cpu_id = I2S_SP,
.dmic_cpu_id = DMIC,
.hs_codec_id = RT5682S,
.amp_codec_id = MAX98360A,
.dmic_codec_id = DMIC,
.gpio_spkr_en = EN_SPKR_GPIO_NONE,
};
static struct acp_card_drvdata rt5682s_rt1019_data = {
.hs_cpu_id = I2S_SP,
.amp_cpu_id = I2S_SP,
.dmic_cpu_id = DMIC,
.hs_codec_id = RT5682S,
.amp_codec_id = RT1019,
.dmic_codec_id = DMIC,
.gpio_spkr_en = EN_SPKR_GPIO_NONE,
};
static const struct snd_kcontrol_new acp_controls[] = { static const struct snd_kcontrol_new acp_controls[] = {
SOC_DAPM_PIN_SWITCH("Headphone Jack"), SOC_DAPM_PIN_SWITCH("Headphone Jack"),
SOC_DAPM_PIN_SWITCH("Headset Mic"), SOC_DAPM_PIN_SWITCH("Headset Mic"),
...@@ -99,6 +119,14 @@ static const struct platform_device_id board_ids[] = { ...@@ -99,6 +119,14 @@ static const struct platform_device_id board_ids[] = {
.name = "acp3xalc56821019", .name = "acp3xalc56821019",
.driver_data = (kernel_ulong_t)&rt5682_rt1019_data, .driver_data = (kernel_ulong_t)&rt5682_rt1019_data,
}, },
{
.name = "acp3xalc5682sm98360",
.driver_data = (kernel_ulong_t)&rt5682s_max_data,
},
{
.name = "acp3xalc5682s1019",
.driver_data = (kernel_ulong_t)&rt5682s_rt1019_data,
},
{ } { }
}; };
static struct platform_driver acp_asoc_audio = { static struct platform_driver acp_asoc_audio = {
...@@ -114,4 +142,6 @@ module_platform_driver(acp_asoc_audio); ...@@ -114,4 +142,6 @@ module_platform_driver(acp_asoc_audio);
MODULE_IMPORT_NS(SND_SOC_AMD_MACH); MODULE_IMPORT_NS(SND_SOC_AMD_MACH);
MODULE_DESCRIPTION("ACP chrome audio support"); MODULE_DESCRIPTION("ACP chrome audio support");
MODULE_ALIAS("platform:acp3xalc56821019"); MODULE_ALIAS("platform:acp3xalc56821019");
MODULE_ALIAS("platform:acp3xalc5682sm98360");
MODULE_ALIAS("platform:acp3xalc5682s1019");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
...@@ -44,6 +44,11 @@ static struct snd_soc_acpi_codecs amp_rt1019 = { ...@@ -44,6 +44,11 @@ static struct snd_soc_acpi_codecs amp_rt1019 = {
.codecs = {"10EC1019"} .codecs = {"10EC1019"}
}; };
static struct snd_soc_acpi_codecs amp_max = {
.num_codecs = 1,
.codecs = {"MX98360A"}
};
static struct snd_soc_acpi_mach snd_soc_acpi_amd_acp_machines[] = { static struct snd_soc_acpi_mach snd_soc_acpi_amd_acp_machines[] = {
{ {
.id = "10EC5682", .id = "10EC5682",
...@@ -51,6 +56,18 @@ static struct snd_soc_acpi_mach snd_soc_acpi_amd_acp_machines[] = { ...@@ -51,6 +56,18 @@ static struct snd_soc_acpi_mach snd_soc_acpi_amd_acp_machines[] = {
.machine_quirk = snd_soc_acpi_codec_list, .machine_quirk = snd_soc_acpi_codec_list,
.quirk_data = &amp_rt1019, .quirk_data = &amp_rt1019,
}, },
{
.id = "RTL5682",
.drv_name = "acp3xalc5682sm98360",
.machine_quirk = snd_soc_acpi_codec_list,
.quirk_data = &amp_max,
},
{
.id = "RTL5682",
.drv_name = "acp3xalc5682s1019",
.machine_quirk = snd_soc_acpi_codec_list,
.quirk_data = &amp_rt1019,
},
{ {
.id = "AMDI1019", .id = "AMDI1019",
.drv_name = "renoir-acp", .drv_name = "renoir-acp",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment