Add Machine driver support for nau8825, max98560 and rt5682s, rt1019
Subsystems (3)
v4 cover Add Machine driver support for nau8825, max98560 and rt5682s, rt1019
This patch set depends on:
--gpio patch
--https://patchwork.kernel.org/project/alsa-devel/patch/[email protected]/
--https://patchwork.kernel.org/project/alsa-devel/patch/[email protected]/v3 --> v4:
Resolved:
. Assigning direct address without (void *) typecast.
. Used snd_soc_card_jack_new instead of snd_soc_card_jack_new_pins as per suggestion.
v2 --> v3:
Resolved compilation error:
/build/stage/linux/sound/soc/amd/acp/acp-mach-common.c: In function ‘acp_card_nau8825_init’:
/build/stage/linux/sound/soc/amd/acp/acp-mach-common.c:479:15: error: too many arguments to function ‘snd_soc_card_jack_new’
479 | ret = snd_soc_card_jack_new(card, "Headset Jack",
| ^~~~~~~~~~~~~~~~~~~~~
In file included from /build/stage/linux/include/sound/soc.h:1362,
from /build/stage/linux/sound/soc/amd/acp/acp-mach-common.c:20:
/build/stage/linux/include/sound/soc-card.h:18:5: note: declared here
18 | int snd_soc_card_jack_new(struct snd_soc_card *card, const char *id,
V sujith kumar Reddy (2):
ASoC: amd: acp: Add support for nau8825 and max98360 card
ASoC: amd: acp: Add support for rt5682s and rt1019 card with hs
instance
sound/soc/amd/acp-config.c | 30 ++++ sound/soc/amd/acp/Kconfig | 1 + sound/soc/amd/acp/acp-mach-common.c | 235 ++++++++++++++++++++++++++-- sound/soc/amd/acp/acp-mach.h | 3 + sound/soc/amd/acp/acp-sof-mach.c | 30 ++++ sound/soc/amd/mach-config.h | 1 + 6 files changed, 283 insertions(+), 17 deletions(-)
Signature · 1 line
2.25.1
PATCH v4 1/2 ASoC: amd: acp: Add support for nau8825 and max98360 card
We have new platform with nau8825 as a primary codec and max98360 as an amp codec. Add machine struct to register sof audio based sound card on such Chrome machine.
--- sound/soc/amd/acp-config.c | 21 ++++ sound/soc/amd/acp/Kconfig | 1 + sound/soc/amd/acp/acp-mach-common.c | 166 +++++++++++++++++++++++++++- sound/soc/amd/acp/acp-mach.h | 3 + sound/soc/amd/acp/acp-sof-mach.c | 15 +++ sound/soc/amd/mach-config.h | 1 + 6 files changed, 201 insertions(+), 6 deletions(-)
sound/soc/amd/acp-config.c +21 -0
@@ -130,4 +130,25 @@ struct snd_soc_acpi_mach snd_soc_acpi_amd_sof_machines[] = { };EXPORT_SYMBOL (snd_soc_acpi_amd_sof_machines); +struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_sof_machines[] = { + { + .id ="AMDI1019" , + .drv_name ="rmb-dsp" , + .pdata = &acp_quirk_data, + .fw_filename ="sof-rmb.ri" , + .sof_tplg_filename ="sof-acp-rmb.tplg" , + }, + { + .id ="10508825" , + .drv_name ="nau8825-max" , + .pdata = &acp_quirk_data, + .machine_quirk = snd_soc_acpi_codec_list, + .quirk_data = &_max, + .fw_filename ="sof-rmb.ri" , + .sof_tplg_filename ="sof-acp-rmb.tplg" , + }, + {}, +}; +EXPORT_SYMBOL (snd_soc_acpi_amd_rmb_sof_machines); +MODULE_LICENSE ("Dual BSD/GPL" );
sound/soc/amd/acp/Kconfig +1 -0
@@ -49,6 +49,7 @@ config SND_SOC_AMD_MACH_COMMON select SND_SOC_RT1019 select SND_SOC_MAX98357A select SND_SOC_RT5682S + select SND_SOC_NAU8825 help This option enables common Machine driver module for ACP.
sound/soc/amd/acp/acp-mach-common.c +160 -6
214 lines not on this page · raw message
sound/soc/amd/acp/acp-mach.h +3 -0
@@ -26,6 +26,7 @@ enum be_id {enum cpu_endpoints {NONE =0 , +I2S_HS ,I2S_SP ,I2S_BT ,DMIC ,
@@ -37,6 +38,7 @@ enum codec_endpoints {RT1019 ,MAX98360A ,RT5682S , + NAU8825, }; struct acp_card_drvdata {
@@ -49,6 +51,7 @@ struct acp_card_drvdata {unsigned int dai_fmt;struct clk *wclk;struct clk *bclk; +bool soc_mclk; };int acp_sofdsp_dai_links_create (struct snd_soc_card *card);
sound/soc/amd/acp/acp-sof-mach.c +15 -0
@@ -56,6 +56,16 @@ static struct acp_card_drvdata sof_rt5682s_max_data = { .dmic_codec_id = DMIC, }; +static struct acp_card_drvdata sof_nau8825_data = { + .hs_cpu_id =I2S_HS , + .amp_cpu_id =I2S_HS , + .dmic_cpu_id =DMIC , + .hs_codec_id =NAU8825 , + .amp_codec_id =MAX98360A , + .dmic_codec_id =DMIC , + .soc_mclk = true, +}; +static const struct snd_kcontrol_new acp_controls[] = {SOC_DAPM_PIN_SWITCH ("Headphone Jack" ),SOC_DAPM_PIN_SWITCH ("Headset Mic" ),
@@ -124,6 +134,10 @@ static const struct platform_device_id board_ids[] = { .name = "rt5682s-rt1019", .driver_data = (kernel_ulong_t)&sof_rt5682s_rt1019_data }, + { + .name = "nau8825-max", + .driver_data = (kernel_ulong_t)&sof_nau8825_data + }, { } };static struct platform_driver acp_asoc_audio = {
@@ -143,4 +157,5 @@ MODULE_ALIAS("platform:rt5682-rt1019");MODULE_ALIAS ("platform:rt5682-max" );MODULE_ALIAS ("platform:rt5682s-max" );MODULE_ALIAS ("platform:rt5682s-rt1019" ); +MODULE_ALIAS ("platform:nau8825-max" );MODULE_LICENSE ("GPL v2" );
sound/soc/amd/mach-config.h +1 -0
@@ -19,6 +19,7 @@#define ACP_PCI_DEV_ID 0x15E2extern struct snd_soc_acpi_mach snd_soc_acpi_amd_sof_machines[]; +extern struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_sof_machines[];struct config_entry {u32 flags;
Signature · 1 line
2.25.1
Re: [PATCH v4 1/2] ASoC: amd: acp: Add support for nau8825 and max98360 card
Quoted 9 lines
sound/soc/amd/acp-config.c +6
-0+struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_sof_machines[] = { + { + .id ="AMDI1019" , + .drv_name ="rmb-dsp" , + .pdata = &acp_quirk_data, + .fw_filename ="sof-rmb.ri" ,
sound/soc/amd/acp-config.c struct snd_soc_acpi_mach snd_soc_acpi_amd_sof_machines[] = { · line 148
Quoted 10 lines
sound/soc/amd/acp-config.c +10
-0+ .sof_tplg_filename = "sof-acp-rmb.tplg", + }, + { + .id = "10508825", + .drv_name = "nau8825-max", + .pdata = &acp_quirk_data, + .machine_quirk = snd_soc_acpi_codec_list, + .quirk_data = &_max, + .fw_filename = "sof-rmb.ri", + .sof_tplg_filename = "sof-acp-rmb.tplg",
this looks rather odd, you have two entries in the table that point to the exact same pair of firmware and topology files. This is either intentional and missing a comment, or a copy-paste mistake, or some of these fields are not required.
sound/soc/amd/acp/acp-mach-common.c static void acp_card_shutdown(struct snd_pcm_substream *substream) · line 181
Quoted 4 lines
sound/soc/amd/acp/acp-mach-common.c +2
-1-clk_disable_unprepare (drvdata->wclk); +if (!drvdata->soc_mclk) +clk_disable_unprepare (drvdata->wclk); }
mclk and wclk are different concepts usually.
sound/soc/amd/acp/acp-mach.h struct acp_card_drvdata { · line 54
Quoted 6 lines
struct
acp_card_drvdata{sound/soc/amd/acp/acp-mach.h +1
-0@@ -49,6 +51,7 @@ struct acp_card_drvdata {unsigned int dai_fmt;struct clk *wclk;struct clk *bclk; +bool soc_mclk;
I wonder if soc_mclk means 'soc_clock_provider' ?
it looks like a configuration instead of a real/physical clock?
Re: [PATCH v4 1/2] ASoC: amd: acp: Add support for nau8825 and max98360 card
Quoted 16 lines · Pierre-Louis Bossart
Quoted 6 lines
sound/soc/amd/acp-config.c +6
-0+struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_sof_machines[] = { + { + .id ="AMDI1019" , + .drv_name ="rmb-dsp" , + .pdata = &acp_quirk_data, + .fw_filename ="sof-rmb.ri" ,sound/soc/amd/acp-config.c struct snd_soc_acpi_mach snd_soc_acpi_amd_sof_machines[] = { · line 148
Quoted 10 lines
sound/soc/amd/acp-config.c +10
-0+ .sof_tplg_filename = "sof-acp-rmb.tplg", + }, + { + .id = "10508825", + .drv_name = "nau8825-max", + .pdata = &acp_quirk_data, + .machine_quirk = snd_soc_acpi_codec_list, + .quirk_data = &_max, + .fw_filename = "sof-rmb.ri", + .sof_tplg_filename = "sof-acp-rmb.tplg",
Quoted 4 lines
this looks rather odd, you have two entries in the table that point to the exact same pair of firmware and topology files. This is either intentional and missing a comment, or a copy-paste mistake, or some of these fields are not required.
This is intentional only ,will update this once platforms are confirmed, will add comments
Quoted 6 lines
sound/soc/amd/acp/acp-mach-common.c static void acp_card_shutdown(struct snd_pcm_substream *substream) · line 181
Quoted 5 lines
sound/soc/amd/acp/acp-mach-common.c +2
-1-clk_disable_unprepare (drvdata->wclk); +if (!drvdata->soc_mclk) +clk_disable_unprepare (drvdata->wclk); }mclk and wclk are different concepts usually.
Our intention here we don't want to enable /disable wclk(clock) when soc is a clock master.
Quoted 9 lines
sound/soc/amd/acp/acp-mach.h struct acp_card_drvdata { · line 54
Quoted 8 lines
struct acp_card_drvdata {sound/soc/amd/acp/acp-mach.h +1
-0@@ -49,6 +51,7 @@ struct acp_card_drvdata {unsigned int dai_fmt;struct clk *wclk;struct clk *bclk; +bool soc_mclk;I wonder if
soc_mclkmeans 'soc_clock_provider' ?
yes
Quoted 1 line
it looks like a configuration instead of a real/physical clock?
yes ,its just a flag to know whether soc is in a clock master mode or not.
PATCH v4 2/2 ASoC: amd: acp: Add support for rt5682s and rt1019 card with hs instance
In reply to V sujith kumar ReddyWe have new platform with rt5682s as a primary codec and rt1019 as an amp codec. Add machine struct to register sof audio based sound card on such Chrome machine.
Here we are configuring as a soc mclk master and codec slave.
--- sound/soc/amd/acp-config.c | 9 ++++ sound/soc/amd/acp/acp-mach-common.c | 69 ++++++++++++++++++++++++----- sound/soc/amd/acp/acp-sof-mach.c | 15 +++++++ 3 files changed, 82 insertions(+), 11 deletions(-)
sound/soc/amd/acp-config.c +9 -0
@@ -147,6 +147,15 @@ struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_sof_machines[] = { .fw_filename = "sof-rmb.ri", .sof_tplg_filename = "sof-acp-rmb.tplg", }, + { + .id = "RTL5682", + .drv_name = "rt5682s-hs-rt1019", + .pdata = &acp_quirk_data, + .machine_quirk = snd_soc_acpi_codec_list, + .quirk_data = &_rt1019, + .fw_filename = "sof-rmb.ri", + .sof_tplg_filename = "sof-acp-rmb.tplg", + }, {}, };EXPORT_SYMBOL (snd_soc_acpi_amd_rmb_sof_machines);
sound/soc/amd/acp/acp-mach-common.c +58 -11
124 lines not on this page · raw message
sound/soc/amd/acp/acp-sof-mach.c +15 -0
@@ -66,6 +66,16 @@ static struct acp_card_drvdata sof_nau8825_data = { .soc_mclk = true, }; +static struct acp_card_drvdata sof_rt5682s_hs_rt1019_data = { + .hs_cpu_id =I2S_HS , + .amp_cpu_id =I2S_HS , + .dmic_cpu_id =DMIC , + .hs_codec_id =RT5682S , + .amp_codec_id =RT1019 , + .dmic_codec_id =DMIC , + .soc_mclk = true, +}; +static const struct snd_kcontrol_new acp_controls[] = {SOC_DAPM_PIN_SWITCH ("Headphone Jack" ),SOC_DAPM_PIN_SWITCH ("Headset Mic" ),
@@ -138,6 +148,10 @@ static const struct platform_device_id board_ids[] = { .name = "nau8825-max", .driver_data = (kernel_ulong_t)&sof_nau8825_data }, + { + .name = "rt5682s-hs-rt1019", + .driver_data = (kernel_ulong_t)&sof_rt5682s_hs_rt1019_data + }, { } };static struct platform_driver acp_asoc_audio = {
@@ -158,4 +172,5 @@ MODULE_ALIAS("platform:rt5682-max");MODULE_ALIAS ("platform:rt5682s-max" );MODULE_ALIAS ("platform:rt5682s-rt1019" );MODULE_ALIAS ("platform:nau8825-max" ); +MODULE_ALIAS ("platform:rt5682s-hs-rt1019" );MODULE_LICENSE ("GPL v2" );
Signature · 1 line
2.25.1
Re: [PATCH v4 2/2] ASoC: amd: acp: Add support for rt5682s and rt1019 card with hs instance
Quoted 20 lines · V sujith kumar Reddy
We have new platform with rt5682s as a primary codec and rt1019 as an amp codec. Add machine struct to register sof audio based sound card on such Chrome machine.
Here we are configuring as a soc mclk master and codec slave.
Signed-off-by V sujith kumar Reddy <[email protected]>--- sound/soc/amd/acp-config.c | 9 ++++ sound/soc/amd/acp/acp-mach-common.c | 69 ++++++++++++++++++++++++----- sound/soc/amd/acp/acp-sof-mach.c | 15 +++++++ 3 files changed, 82 insertions(+), 11 deletions(-)sound/soc/amd/acp-config.c +0
-0@@ -147,6 +147,15 @@ struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_sof_machines[] = { .fw_filename = "sof-rmb.ri", .sof_tplg_filename = "sof-acp-rmb.tplg",
sound/soc/amd/acp-config.c struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_sof_machines[] = { · line 158
Quoted 10 lines
sound/soc/amd/acp-config.c +9
-0}, + { + .id = "RTL5682", + .drv_name = "rt5682s-hs-rt1019", + .pdata = &acp_quirk_data, + .machine_quirk = snd_soc_acpi_codec_list, + .quirk_data = &_rt1019, + .fw_filename = "sof-rmb.ri", + .sof_tplg_filename = "sof-acp-rmb.tplg", + },
that means a 3rd entry with the same pair of firmware/topology files?
sound/soc/amd/acp/acp-mach-common.c static int acp_card_hs_startup(struct snd_pcm_substream *substream) · line 151
Quoted 13 lines
sound/soc/amd/acp-config.c +0
-0{}, };EXPORT_SYMBOL (snd_soc_acpi_amd_rmb_sof_machines);sound/soc/amd/acp/acp-mach-common.c +1
-1@@ -148,10 +148,15 @@ static int acp_card_hs_startup(struct snd_pcm_substream *substream)struct snd_soc_card *card = rtd->card;struct acp_card_drvdata *drvdata = card->drvdata;struct snd_soc_dai *codec_dai =asoc_rtd_to_codec (rtd,0 ); -int ret; +unsigned int fmt =0 ;
fmt initialization is overridden below.
sound/soc/amd/acp/acp-mach-common.c static int acp_card_hs_startup(struct snd_pcm_substream *substream) · line 152
Quoted 1 line
sound/soc/amd/acp/acp-mach-common.c +1
-0+int ret =0 ;
useless init...
sound/soc/amd/acp/acp-mach-common.c static int acp_card_hs_startup(struct snd_pcm_substream *substream) · line 159
Quoted 9 lines
sound/soc/amd/acp/acp-mach-common.c +6
-2- ret =snd_soc_dai_set_fmt (codec_dai,SND_SOC_DAIFMT_I2S |SND_SOC_DAIFMT_NB_NF - |SND_SOC_DAIFMT_CBP_CFP ); +if (drvdata->soc_mclk) + fmt =SND_SOC_DAIFMT_I2S |SND_SOC_DAIFMT_NB_NF |SND_SOC_DAIFMT_CBC_CFC ; +else + fmt =SND_SOC_DAIFMT_I2S |SND_SOC_DAIFMT_NB_NF |SND_SOC_DAIFMT_CBP_CFP ; + + ret =snd_soc_dai_set_fmt (codec_dai, fmt);
... overridden here
Quoted 3 lines
sound/soc/amd/acp/acp-mach-common.c +0
-0if (ret <0 ) {dev_err (rtd->card->dev,"Failed to set dai fmt: %d\n" , ret);return ret;
Re: [PATCH v4 2/2] ASoC: amd: acp: Add support for rt5682s and rt1019 card with hs instance
Quoted 26 lines · Pierre-Louis Bossart
[CAUTION: External Email]
Quoted 23 lines · V sujith kumar Reddy
We have new platform with rt5682s as a primary codec and rt1019 as an amp codec. Add machine struct to register sof audio based sound card on such Chrome machine.
Here we are configuring as a soc mclk master and codec slave.
Signed-off-by V sujith kumar Reddy <[email protected]>--- sound/soc/amd/acp-config.c | 9 ++++ sound/soc/amd/acp/acp-mach-common.c | 69 ++++++++++++++++++++++++----- sound/soc/amd/acp/acp-sof-mach.c | 15 +++++++ 3 files changed, 82 insertions(+), 11 deletions(-)sound/soc/amd/acp-config.c +2
-0@@ -147,6 +147,15 @@ struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_sof_machines[] = { .fw_filename = "sof-rmb.ri", .sof_tplg_filename = "sof-acp-rmb.tplg", }, + { + .id = "RTL5682",
Quoted 8 lines
sound/soc/amd/acp-config.c struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_sof_machines[] = { · line 158
Quoted 7 lines
sound/soc/amd/acp-config.c +7
-0+ .drv_name = "rt5682s-hs-rt1019", + .pdata = &acp_quirk_data, + .machine_quirk = snd_soc_acpi_codec_list, + .quirk_data = &_rt1019, + .fw_filename = "sof-rmb.ri", + .sof_tplg_filename = "sof-acp-rmb.tplg", + },that means a 3rd entry with the same pair of
firmware/topologyfiles?
will change and push new patchset
Quoted 15 lines
Quoted 9 lines
sound/soc/amd/acp-config.c +0
-0{}, };EXPORT_SYMBOL (snd_soc_acpi_amd_rmb_sof_machines);sound/soc/amd/acp/acp-mach-common.c +0
-0sound/soc/amd/acp/acp-mach-common.c static int acp_card_hs_startup(struct snd_pcm_substream *substream) · line 151
Quoted 5 lines
sound/soc/amd/acp/acp-mach-common.c +1
-1@@ -148,10 +148,15 @@ static int acp_card_hs_startup(struct snd_pcm_substream *substream)struct snd_soc_card *card = rtd->card;struct acp_card_drvdata *drvdata = card->drvdata;struct snd_soc_dai *codec_dai =asoc_rtd_to_codec (rtd,0 ); -int ret; +unsigned int fmt =0 ;fmt initialization is overridden below.
will change and push new patchset
Quoted 3 lines
sound/soc/amd/acp/acp-mach-common.c static int acp_card_hs_startup(struct snd_pcm_substream *substream) · line 152
Quoted 2 lines
sound/soc/amd/acp/acp-mach-common.c +1
-0+int ret =0 ;useless init...
will change and push new patchset
Quoted 10 lines
sound/soc/amd/acp/acp-mach-common.c static int acp_card_hs_startup(struct snd_pcm_substream *substream) · line 159
Quoted 9 lines
sound/soc/amd/acp/acp-mach-common.c +6
-2- ret =snd_soc_dai_set_fmt (codec_dai,SND_SOC_DAIFMT_I2S |SND_SOC_DAIFMT_NB_NF - |SND_SOC_DAIFMT_CBP_CFP ); +if (drvdata->soc_mclk) + fmt =SND_SOC_DAIFMT_I2S |SND_SOC_DAIFMT_NB_NF |SND_SOC_DAIFMT_CBC_CFC ; +else + fmt =SND_SOC_DAIFMT_I2S |SND_SOC_DAIFMT_NB_NF |SND_SOC_DAIFMT_CBP_CFP ; + + ret =snd_soc_dai_set_fmt (codec_dai, fmt);... overridden here
will change and push new patchset
Quoted 4 lines
Quoted 4 lines
sound/soc/amd/acp/acp-mach-common.c +0
-0if (ret <0 ) {dev_err (rtd->card->dev,"Failed to set dai fmt: %d\n" , ret);return ret;
Mark Brown
maintainerQuoted 11 lines · V sujith kumar Reddy
This patch set depends on:
--gpio patch --https://patchwork.kernel.org/project/alsa-devel/patch/[email protected]/ --https://patchwork.kernel.org/project/alsa-devel/patch/[email protected]/v3 --> v4:
Resolved:
. Assigning direct address without (void *) typecast.
. Usedsnd_soc_card_jack_newinstead ofsnd_soc_card_jack_new_pinsas per suggestion.[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/2] ASoC: amd: acp: Add support for nau8825 and max98360 card
commit: 0439eb4d94e0fc17c6dd3829fabd88c11773381d
[2/2] ASoC: amd: acp: Add support for rt5682s and rt1019 card with hs instance
commit: 4dc6737cfe882765d914fcb88b5eaa14551ffdddAll being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark