From: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
To: <broonie@kernel.org>, <alsa-devel@alsa-project.org>
Cc: <Vijendar.Mukunda@amd.com>, <Basavaraj.Hiregoudar@amd.com>,
<Sunil-kumar.Dommati@amd.com>, <Alexander.Deucher@amd.com>,
Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>,
Liam Girdwood <lgirdwood@gmail.com>,
"Jaroslav Kysela" <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
open list <linux-kernel@vger.kernel.org>
Subject: [PATCH 8/8] ASoC: amd: acp: Add support for RT5682-VS codec
Date: Thu, 30 Sep 2021 18:54:18 +0530 [thread overview]
Message-ID: <20210930132418.14077-9-AjitKumar.Pandey@amd.com> (raw)
In-Reply-To: <20210930132418.14077-1-AjitKumar.Pandey@amd.com>
Add new codec endpoints and define components to support RT5682-VS
variants of codec with ACP machines.
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
---
sound/soc/amd/acp/Kconfig | 1 +
sound/soc/amd/acp/acp-mach-common.c | 25 +++++++++++++++++++++++++
sound/soc/amd/acp/acp-mach.h | 1 +
3 files changed, 27 insertions(+)
diff --git a/sound/soc/amd/acp/Kconfig b/sound/soc/amd/acp/Kconfig
index 8257b8e1e7cc..7e3c32f5b982 100644
--- a/sound/soc/amd/acp/Kconfig
+++ b/sound/soc/amd/acp/Kconfig
@@ -31,6 +31,7 @@ config SND_SOC_AMD_MACH_COMMON
select SND_SOC_DMIC
select SND_SOC_RT1019
select SND_SOC_MAX98357A
+ select SND_SOC_RT5682S
depends on X86 && PCI && I2C
help
This option enables common Machine driver module for ACP
diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c
index 80c6cd220674..5e7da4515e5e 100644
--- a/sound/soc/amd/acp/acp-mach-common.c
+++ b/sound/soc/amd/acp/acp-mach-common.c
@@ -23,6 +23,7 @@
#include "../../codecs/rt5682.h"
#include "../../codecs/rt1019.h"
+#include "../../codecs/rt5682s.h"
#include "acp-mach.h"
#define PCO_PLAT_CLK 48000000
@@ -64,6 +65,9 @@ static int acp_clk_enable(struct acp_card_drvdata *drvdata)
SND_SOC_DAILINK_DEF(rt5682,
DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC5682:00", "rt5682-aif1")));
+SND_SOC_DAILINK_DEF(rt5682s,
+ DAILINK_COMP_ARRAY(COMP_CODEC("i2c-RTL5682:00", "rt5682s-aif1")));
+
static const struct snd_soc_dapm_route rt5682_map[] = {
{ "Headphone Jack", NULL, "HPOL" },
{ "Headphone Jack", NULL, "HPOR" },
@@ -135,6 +139,19 @@ static int acp_asoc_hs_init(struct snd_soc_pcm_runtime *rtd)
| SND_SOC_DAIFMT_CBP_CFP;
snd_soc_dapm_add_routes(&rtd->card->dapm, rt5682_map, ARRAY_SIZE(rt5682_map));
break;
+ case RT5682S:
+ pll_id = RT5682S_PLL2;
+ pll_src = RT5682S_PLL_S_MCLK;
+ freq_in = PCO_PLAT_CLK;
+ freq_out = RT5682_PLL_FREQ;
+ clk_id = RT5682S_SCLK_S_PLL2;
+ clk_freq = RT5682_PLL_FREQ;
+ wclk_name = "rt5682-dai-wclk";
+ bclk_name = "rt5682-dai-bclk";
+ drvdata->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
+ | SND_SOC_DAIFMT_CBM_CFM;
+ snd_soc_dapm_add_routes(&rtd->card->dapm, rt5682_map, ARRAY_SIZE(rt5682_map));
+ break;
default:
dev_err(rtd->dev, "Invalid codec id %d\n", drvdata->hs_codec_id);
return -EINVAL;
@@ -401,6 +418,10 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
links[i].codecs = rt5682;
links[i].num_codecs = ARRAY_SIZE(rt5682);
}
+ if (drv_data->hs_codec_id == RT5682S) {
+ links[i].codecs = rt5682s;
+ links[i].num_codecs = ARRAY_SIZE(rt5682s);
+ }
i++;
}
@@ -492,6 +513,10 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
links[i].codecs = rt5682;
links[i].num_codecs = ARRAY_SIZE(rt5682);
}
+ if (drv_data->hs_codec_id == RT5682S) {
+ links[i].codecs = rt5682s;
+ links[i].num_codecs = ARRAY_SIZE(rt5682s);
+ }
i++;
}
diff --git a/sound/soc/amd/acp/acp-mach.h b/sound/soc/amd/acp/acp-mach.h
index b6a43d1b9ad4..5dc47cfbff10 100644
--- a/sound/soc/amd/acp/acp-mach.h
+++ b/sound/soc/amd/acp/acp-mach.h
@@ -36,6 +36,7 @@ enum codec_endpoints {
RT5682,
RT1019,
MAX98360A,
+ RT5682S,
};
struct acp_card_drvdata {
--
2.25.1
prev parent reply other threads:[~2021-09-30 13:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210930132418.14077-1-AjitKumar.Pandey@amd.com>
2021-09-30 13:24 ` [PATCH 1/8] ASoC: amd: Add common framework to support I2S on ACP SOC Ajit Kumar Pandey
2021-09-30 13:24 ` [PATCH 2/8] ASoC: amd: acp: Add I2S support on Renoir platform Ajit Kumar Pandey
2021-09-30 22:06 ` Randy Dunlap
2021-09-30 13:24 ` [PATCH 3/8] ASoC: amd: acp: Add callback for machine driver on ACP Ajit Kumar Pandey
2021-09-30 13:24 ` [PATCH 4/8] ASoC: amd: acp: Add generic machine driver support for ACP cards Ajit Kumar Pandey
2021-09-30 22:08 ` Randy Dunlap
2021-10-08 15:49 ` Mark Brown
2021-09-30 13:24 ` [PATCH 5/8] ASoC: amd: acp: Add legacy sound card support for Guybrush board Ajit Kumar Pandey
2021-09-30 13:24 ` [PATCH 6/8] ASoC: amd: acp: Add SOF sound card support on " Ajit Kumar Pandey
2021-09-30 13:24 ` [PATCH 7/8] ASoC: amd: acp: Add support for Maxim amplifier codec Ajit Kumar Pandey
2021-09-30 13:24 ` Ajit Kumar Pandey [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210930132418.14077-9-AjitKumar.Pandey@amd.com \
--to=ajitkumar.pandey@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=Basavaraj.Hiregoudar@amd.com \
--cc=Sunil-kumar.Dommati@amd.com \
--cc=Vijendar.Mukunda@amd.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).