Commit ba7523bb authored by Ajye Huang's avatar Ajye Huang Committed by Mark Brown

ASoC: Intel: sof_nau8825: add variant with nau8318 amplifier.

This patch adds the driver data for two nau8318 speaker amplifiers on
SSP1 and nau8825 on SSP0 for ADL platform.

The nau8315 and nau8318 are both Nuvoton Amp chips. They use the same
Amp driver nau8315.c. The acpi_device_id for nau8315 is "NVTN2010",
for nau8318 is "NVTN2012".
The nau8825 is one of Nuvoton headset codec, and its acpi_device_id is
"10508825".
Signed-off-by: default avatarAjye Huang <ajye_huang@compal.corp-partner.google.com>
Acked-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20221222042624.557869-1-ajye_huang@compal.corp-partner.google.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 68506a17
...@@ -554,6 +554,7 @@ config SND_SOC_INTEL_SOF_NAU8825_MACH ...@@ -554,6 +554,7 @@ config SND_SOC_INTEL_SOF_NAU8825_MACH
select SND_SOC_RT1015P select SND_SOC_RT1015P
select SND_SOC_MAX98373_I2C select SND_SOC_MAX98373_I2C
select SND_SOC_MAX98357A select SND_SOC_MAX98357A
select SND_SOC_NAU8315
select SND_SOC_DMIC select SND_SOC_DMIC
select SND_SOC_HDAC_HDMI select SND_SOC_HDAC_HDMI
select SND_SOC_INTEL_HDA_DSP_COMMON select SND_SOC_INTEL_HDA_DSP_COMMON
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#define SOF_MAX98373_SPEAKER_AMP_PRESENT BIT(15) #define SOF_MAX98373_SPEAKER_AMP_PRESENT BIT(15)
#define SOF_MAX98360A_SPEAKER_AMP_PRESENT BIT(16) #define SOF_MAX98360A_SPEAKER_AMP_PRESENT BIT(16)
#define SOF_RT1015P_SPEAKER_AMP_PRESENT BIT(17) #define SOF_RT1015P_SPEAKER_AMP_PRESENT BIT(17)
#define SOF_NAU8318_SPEAKER_AMP_PRESENT BIT(18)
static unsigned long sof_nau8825_quirk = SOF_NAU8825_SSP_CODEC(0); static unsigned long sof_nau8825_quirk = SOF_NAU8825_SSP_CODEC(0);
...@@ -338,6 +339,13 @@ static struct snd_soc_dai_link_component rt1019p_component[] = { ...@@ -338,6 +339,13 @@ static struct snd_soc_dai_link_component rt1019p_component[] = {
} }
}; };
static struct snd_soc_dai_link_component nau8318_components[] = {
{
.name = "NVTN2012:00",
.dai_name = "nau8315-hifi",
}
};
static struct snd_soc_dai_link_component dummy_component[] = { static struct snd_soc_dai_link_component dummy_component[] = {
{ {
.name = "snd-soc-dummy", .name = "snd-soc-dummy",
...@@ -486,6 +494,11 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev, ...@@ -486,6 +494,11 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
max_98360a_dai_link(&links[id]); max_98360a_dai_link(&links[id]);
} else if (sof_nau8825_quirk & SOF_RT1015P_SPEAKER_AMP_PRESENT) { } else if (sof_nau8825_quirk & SOF_RT1015P_SPEAKER_AMP_PRESENT) {
sof_rt1015p_dai_link(&links[id]); sof_rt1015p_dai_link(&links[id]);
} else if (sof_nau8825_quirk &
SOF_NAU8318_SPEAKER_AMP_PRESENT) {
links[id].codecs = nau8318_components;
links[id].num_codecs = ARRAY_SIZE(nau8318_components);
links[id].init = speaker_codec_init;
} else { } else {
goto devm_err; goto devm_err;
} }
...@@ -657,6 +670,16 @@ static const struct platform_device_id board_ids[] = { ...@@ -657,6 +670,16 @@ static const struct platform_device_id board_ids[] = {
SOF_BT_OFFLOAD_SSP(2) | SOF_BT_OFFLOAD_SSP(2) |
SOF_SSP_BT_OFFLOAD_PRESENT), SOF_SSP_BT_OFFLOAD_PRESENT),
}, },
{
.name = "adl_nau8318_8825",
.driver_data = (kernel_ulong_t)(SOF_NAU8825_SSP_CODEC(0) |
SOF_SPEAKER_AMP_PRESENT |
SOF_NAU8318_SPEAKER_AMP_PRESENT |
SOF_NAU8825_SSP_AMP(1) |
SOF_NAU8825_NUM_HDMIDEV(4) |
SOF_BT_OFFLOAD_SSP(2) |
SOF_SSP_BT_OFFLOAD_PRESENT),
},
{ } { }
}; };
MODULE_DEVICE_TABLE(platform, board_ids); MODULE_DEVICE_TABLE(platform, board_ids);
......
...@@ -450,6 +450,11 @@ static const struct snd_soc_acpi_codecs adl_lt6911_hdmi = { ...@@ -450,6 +450,11 @@ static const struct snd_soc_acpi_codecs adl_lt6911_hdmi = {
.codecs = {"INTC10B0"} .codecs = {"INTC10B0"}
}; };
static const struct snd_soc_acpi_codecs adl_nau8318_amp = {
.num_codecs = 1,
.codecs = {"NVTN2012"}
};
struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = { struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
{ {
.comp_ids = &adl_rt5682_rt5682s_hp, .comp_ids = &adl_rt5682_rt5682s_hp,
...@@ -507,6 +512,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = { ...@@ -507,6 +512,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
.quirk_data = &adl_rt1015p_amp, .quirk_data = &adl_rt1015p_amp,
.sof_tplg_filename = "sof-adl-rt1015-nau8825.tplg", .sof_tplg_filename = "sof-adl-rt1015-nau8825.tplg",
}, },
{
.id = "10508825",
.drv_name = "adl_nau8318_8825",
.machine_quirk = snd_soc_acpi_codec_list,
.quirk_data = &adl_nau8318_amp,
.sof_tplg_filename = "sof-adl-nau8318-nau8825.tplg",
},
{ {
.id = "10508825", .id = "10508825",
.drv_name = "sof_nau8825", .drv_name = "sof_nau8825",
......
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