Skip to contentSkip to conversation

ASoC: Intel: add sof-nau8825 machine driver

PATCH Superseded Mac Chiang 3 participants 4 messages Nov 1, 2021 – Nov 8, 2021

Subsystems (3)
lore
Share & tools
lore

Mac Chiang

author
#0 lore raw

PATCH v2 1/1 ASoC: Intel: add sof-nau8825 machine driver

From: David Lin <[email protected]>

The machine driver is a generic machine driver for SOF with nau8825 codec w or w/o speaker additionally. Depending on the SOC HDMI, DMIC, Bluetooth offload support are added dynamically.

Only add information related to SOF since the machine driver was only tested with SOF.

There are currently 4 i2s machine variants of ADL.
This supports the headphone NUA8825(SSP0) alone or with smart or dumb speakers.
Board 2,3,4 use SSP2 for Bluetooth offload support except board 1.

Board 1 : NAU8825 + RT1019P(SSP2)
Board 2 : NAU8825 + MAX98373(SSP1)
Board 3 : NAU8825 + MAX98360A(SSP1)
Board 4 : NAU8825

---
1. remove hdac_hdmi relevant codes support
2. remove duplicated max_98360a_dai_link calls. Instead of checking no_amp condition
3. alter module license name to "GPL"
4. due to rt1019 non-i2c mode, so change to SND_SOC_RT1015P in KConfig

---
 sound/soc/intel/boards/Kconfig                |  19 +
 sound/soc/intel/boards/Makefile               |   2 +
 sound/soc/intel/boards/sof_nau8825.c          | 651 ++++++++++++++++++
 .../intel/common/soc-acpi-intel-adl-match.c   |  35 +
 4 files changed, 707 insertions(+)
 create mode 100644 sound/soc/intel/boards/sof_nau8825.c
sound/soc/intel/boards/Kconfig +19 -0
index 5a225a4ce604..31d2f10672fd 100644
@@ -526,6 +526,25 @@ config SND_SOC_INTEL_SOF_ES8336_MACH
 	   Say Y if you have such a device.
 	   If unsure select "N".
 
+config SND_SOC_INTEL_SOF_NAU8825_MACH
+	tristate "SOF with nau8825 codec in I2S Mode"
+	depends on I2C && ACPI && GPIOLIB
+	depends on ((SND_HDA_CODEC_HDMI && SND_SOC_SOF_HDA_AUDIO_CODEC) &&\
+		    (MFD_INTEL_LPSS || COMPILE_TEST))
+	select SND_SOC_NAU8825
+	select SND_SOC_RT1015P
+	select SND_SOC_MAX98373_I2C
+	select SND_SOC_MAX98357A
+	select SND_SOC_DMIC
+	select SND_SOC_HDAC_HDMI
+	select SND_SOC_INTEL_HDA_DSP_COMMON
+	select SND_SOC_INTEL_SOF_MAXIM_COMMON
+	help
+	   This adds support for ASoC machine driver for SOF platforms
+	   with nau8825 codec.
+	   Say Y if you have such a device.
+	   If unsure select "N".
+
 endif ## SND_SOC_SOF_HDA_LINK || SND_SOC_SOF_BAYTRAIL
 
 if (SND_SOC_SOF_COMETLAKE && SND_SOC_SOF_HDA_LINK)
sound/soc/intel/boards/Makefile +2 -0
index 9ee8ed864f5d..3ea273d27168 100644
@@ -22,6 +22,7 @@ snd-soc-sst-byt-cht-nocodec-objs := bytcht_nocodec.o
 snd-soc-sof_rt5682-objs := sof_rt5682.o sof_realtek_common.o
 snd-soc-sof_cs42l42-objs := sof_cs42l42.o
 snd-soc-sof_es8336-objs := sof_es8336.o
+snd-soc-sof_nau8825-objs := sof_nau8825.o sof_realtek_common.o
 snd-soc-cml_rt1011_rt5682-objs := cml_rt1011_rt5682.o
 snd-soc-kbl_da7219_max98357a-objs := kbl_da7219_max98357a.o
 snd-soc-kbl_da7219_max98927-objs := kbl_da7219_max98927.o
@@ -44,6 +45,7 @@ snd-soc-sof-sdw-objs += sof_sdw.o				\
 obj-$(CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH) += snd-soc-sof_rt5682.o
 obj-$(CONFIG_SND_SOC_INTEL_SOF_CS42L42_MACH) += snd-soc-sof_cs42l42.o
 obj-$(CONFIG_SND_SOC_INTEL_SOF_ES8336_MACH) += snd-soc-sof_es8336.o
+obj-$(CONFIG_SND_SOC_INTEL_SOF_NAU8825_MACH) += snd-soc-sof_nau8825.o
 obj-$(CONFIG_SND_SOC_INTEL_HASWELL_MACH) += snd-soc-sst-haswell.o
 obj-$(CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_COMMON) += snd-soc-sst-bxt-da7219_max98357a.o
 obj-$(CONFIG_SND_SOC_INTEL_BXT_RT298_MACH) += snd-soc-sst-bxt-rt298.o
sound/soc/intel/boards/sof_nau8825.c new file +651 -0

651 lines not on this page · raw message

sound/soc/intel/common/soc-acpi-intel-adl-match.c +35 -0
index f5b21a95d222..98dc41b682cf 100644
@@ -285,6 +285,11 @@ static const struct snd_soc_acpi_codecs adl_max98360a_amp = {
 	.codecs = {"MX98360A"}
 };
 
+static const struct snd_soc_acpi_codecs adl_rt1019p_amp = {
+	.num_codecs = 1,
+	.codecs = {"RTL1019"}
+};
+
 struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
 	{
 		.id = "10EC5682",
@@ -310,6 +315,36 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
 		.sof_fw_filename = "sof-adl.ri",
 		.sof_tplg_filename = "sof-adl-max98360a-rt5682.tplg",
 	},
+	{
+		.id = "10508825",
+		.drv_name = "adl_rt1019p_nau8825",
+		.machine_quirk = snd_soc_acpi_codec_list,
+		.quirk_data = &adl_rt1019p_amp,
+		.sof_fw_filename = "sof-adl.ri",
+		.sof_tplg_filename = "sof-adl-rt1019-nau8825.tplg",
+	},
+	{
+		.id = "10508825",
+		.drv_name = "adl_max98373_nau8825",
+		.machine_quirk = snd_soc_acpi_codec_list,
+		.quirk_data = &adl_max98373_amp,
+		.sof_fw_filename = "sof-adl.ri",
+		.sof_tplg_filename = "sof-adl-max98373-nau8825.tplg",
+	},
+	{
+		.id = "10508825",
+		.drv_name = "adl_mx98360a_nau8825",
+		.machine_quirk = snd_soc_acpi_codec_list,
+		.quirk_data = &adl_max98360a_amp,
+		.sof_fw_filename = "sof-adl.ri",
+		.sof_tplg_filename = "sof-adl-mx98360a-nau8825.tplg",
+	},
+	{
+		.id = "10508825",
+		.drv_name = "sof_nau8825",
+		.sof_fw_filename = "sof-adl.ri",
+		.sof_tplg_filename = "sof-adl-nau8825.tplg",
+	},
 	{},
 };
 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_adl_machines);
Signature · 1 line
2.20.1
Acked-by on v2 1/1
#1 lore raw
Quoted 22 lines · Mac Chiang

From: David Lin <[email protected]>

The machine driver is a generic machine driver for SOF with nau8825 codec w or w/o speaker additionally. Depending on the SOC HDMI, DMIC, Bluetooth offload support are added dynamically.

Only add information related to SOF since the machine driver was only tested with SOF.

There are currently 4 i2s machine variants of ADL.
This supports the headphone NUA8825(SSP0) alone or with smart or dumb speakers.
Board 2,3,4 use SSP2 for Bluetooth offload support except board 1.

Board 1 : NAU8825 + RT1019P(SSP2)
Board 2 : NAU8825 + MAX98373(SSP1)
Board 3 : NAU8825 + MAX98360A(SSP1)
Board 4 : NAU8825

Quoted 6 lines

---
1. remove hdac_hdmi relevant codes support
2. remove duplicated max_98360a_dai_link calls. Instead of checking no_amp condition
3. alter module license name to "GPL"
4. due to rt1019 non-i2c mode, so change to SND_SOC_RT1015P in KConfig
---

Looks good to me, thanks.

#2 lore raw
Quoted 39 lines

-----Original Message-----
From: Pierre-Louis Bossart <[email protected]>
Sent: Thursday, November 4, 2021 12:37 AM
To: Chiang, Mac <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Gopal, Vamshi Krishna <[email protected]>; M R, Sathya Prakash <[email protected]>; Liao, Bard <[email protected]>
Subject: Re: [PATCH v2] ASoC: Intel: add sof-nau8825 machine driver

Quoted 19 lines · Mac Chiang

From: David Lin <[email protected]>

The machine driver is a generic machine driver for SOF with nau8825 codec w or w/o speaker additionally. Depending on the SOC HDMI, DMIC, Bluetooth offload support are added dynamically.

Only add information related to SOF since the machine driver was only tested with SOF.

There are currently 4 i2s machine variants of ADL.
This supports the headphone NUA8825(SSP0) alone or with smart or dumb speakers.
Board 2,3,4 use SSP2 for Bluetooth offload support except board 1.

Board 1 : NAU8825 + RT1019P(SSP2)
Board 2 : NAU8825 + MAX98373(SSP1)
Board 3 : NAU8825 + MAX98360A(SSP1)
Board 4 : NAU8825

Quoted 6 lines

---
1. remove hdac_hdmi relevant codes support
2. remove duplicated max_98360a_dai_link calls. Instead of checking

no_amp condition

Quoted 8 lines
Quoted 4 lines

3. alter module license name to "GPL"
4. due to rt1019 non-i2c mode, so change to SND_SOC_RT1015P in
KConfig
---

Looks good to me, thanks.

Add Mark for comments, CC: Mark Brown <[email protected]>
Or I need to RESEND V2 with Acked-by:... in comment messages for your applying?

maintainer
#3 lore raw
Quoted 2 lines · Mac

Add Mark for comments, CC: Mark Brown <[email protected]>
Or I need to RESEND V2 with Acked-by:... in comment messages for your applying?

As documented in submitting-patches.rst please send patches to the maintainers for the code you would like to change. The normal kernel workflow is that people apply patches from their inboxes, if they aren't copied they are likely to not see the patch at all and it is much more difficult to apply patches.