Skip to content

Commit 0ab8956

Browse files
ajye-huangpull[bot]
authored andcommitted
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: Ajye Huang <ajye_huang@compal.corp-partner.google.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20221222042624.557869-1-ajye_huang@compal.corp-partner.google.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 25bd03b commit 0ab8956

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

sound/soc/intel/boards/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ config SND_SOC_INTEL_SOF_NAU8825_MACH
554554
select SND_SOC_RT1015P
555555
select SND_SOC_MAX98373_I2C
556556
select SND_SOC_MAX98357A
557+
select SND_SOC_NAU8315
557558
select SND_SOC_DMIC
558559
select SND_SOC_HDAC_HDMI
559560
select SND_SOC_INTEL_HDA_DSP_COMMON

sound/soc/intel/boards/sof_nau8825.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#define SOF_MAX98373_SPEAKER_AMP_PRESENT BIT(15)
4949
#define SOF_MAX98360A_SPEAKER_AMP_PRESENT BIT(16)
5050
#define SOF_RT1015P_SPEAKER_AMP_PRESENT BIT(17)
51+
#define SOF_NAU8318_SPEAKER_AMP_PRESENT BIT(18)
5152

5253
static unsigned long sof_nau8825_quirk = SOF_NAU8825_SSP_CODEC(0);
5354

@@ -338,6 +339,13 @@ static struct snd_soc_dai_link_component rt1019p_component[] = {
338339
}
339340
};
340341

342+
static struct snd_soc_dai_link_component nau8318_components[] = {
343+
{
344+
.name = "NVTN2012:00",
345+
.dai_name = "nau8315-hifi",
346+
}
347+
};
348+
341349
static struct snd_soc_dai_link_component dummy_component[] = {
342350
{
343351
.name = "snd-soc-dummy",
@@ -486,6 +494,11 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
486494
max_98360a_dai_link(&links[id]);
487495
} else if (sof_nau8825_quirk & SOF_RT1015P_SPEAKER_AMP_PRESENT) {
488496
sof_rt1015p_dai_link(&links[id]);
497+
} else if (sof_nau8825_quirk &
498+
SOF_NAU8318_SPEAKER_AMP_PRESENT) {
499+
links[id].codecs = nau8318_components;
500+
links[id].num_codecs = ARRAY_SIZE(nau8318_components);
501+
links[id].init = speaker_codec_init;
489502
} else {
490503
goto devm_err;
491504
}
@@ -657,6 +670,16 @@ static const struct platform_device_id board_ids[] = {
657670
SOF_BT_OFFLOAD_SSP(2) |
658671
SOF_SSP_BT_OFFLOAD_PRESENT),
659672
},
673+
{
674+
.name = "adl_nau8318_8825",
675+
.driver_data = (kernel_ulong_t)(SOF_NAU8825_SSP_CODEC(0) |
676+
SOF_SPEAKER_AMP_PRESENT |
677+
SOF_NAU8318_SPEAKER_AMP_PRESENT |
678+
SOF_NAU8825_SSP_AMP(1) |
679+
SOF_NAU8825_NUM_HDMIDEV(4) |
680+
SOF_BT_OFFLOAD_SSP(2) |
681+
SOF_SSP_BT_OFFLOAD_PRESENT),
682+
},
660683
{ }
661684
};
662685
MODULE_DEVICE_TABLE(platform, board_ids);

sound/soc/intel/common/soc-acpi-intel-adl-match.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,11 @@ static const struct snd_soc_acpi_codecs adl_lt6911_hdmi = {
450450
.codecs = {"INTC10B0"}
451451
};
452452

453+
static const struct snd_soc_acpi_codecs adl_nau8318_amp = {
454+
.num_codecs = 1,
455+
.codecs = {"NVTN2012"}
456+
};
457+
453458
struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
454459
{
455460
.comp_ids = &adl_rt5682_rt5682s_hp,
@@ -507,6 +512,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
507512
.quirk_data = &adl_rt1015p_amp,
508513
.sof_tplg_filename = "sof-adl-rt1015-nau8825.tplg",
509514
},
515+
{
516+
.id = "10508825",
517+
.drv_name = "adl_nau8318_8825",
518+
.machine_quirk = snd_soc_acpi_codec_list,
519+
.quirk_data = &adl_nau8318_amp,
520+
.sof_tplg_filename = "sof-adl-nau8318-nau8825.tplg",
521+
},
510522
{
511523
.id = "10508825",
512524
.drv_name = "sof_nau8825",

0 commit comments

Comments
 (0)