mirror_ubuntu-kernels/sound/soc/amd/acp
Alper Nebi Yasak 919a4a9418
ASoC: amd: acp: Add kcontrols and widgets per-codec in common code
Commit 7ac3404c2e ("ASoC: amd: acp: Map missing jack kcontrols") adds
card kcontrols and DAPM widgets corresponding to jacks for Headphone and
Headset Mic. But these were already being added in acp-legacy-mach.c and
acp-sof-mach.c, so this causes a probe error:

  sof_mach rt5682s-hs-rt1019: control 2:0:0:Headphone Jack Switch:0 is already present
  sof_mach rt5682s-hs-rt1019: ASoC: Failed to add Headphone Jack Switch: -16
  sof_mach rt5682s-hs-rt1019: devm_snd_soc_register_card(sof-rt5682s-hs-rt1019) failed: -16
  sof_mach: probe of rt5682s-hs-rt1019 failed with error -16

Removing the new duplicates from the common code might be enough to fix
the issue. But some of the codecs use different kcontrols and widgets.
NAU8821 alone has an "Int Mic". MAX98360A has a single "Spk", while
RT1019 has "Left Spk" and "Right Spk" (and two codec instances with name
prefixes).

Since there are per-codec differences, add the kcontrols and widgets
in the common code as each dai-link is being initialized, instead of in
the two machine drivers' probe().

Also, MAX98388 has Left and Right instances, but uses a single "SPK"
widget. That seems weird, so normalize it to use two widgets (one per
each instance like RT1019) while we're adding controls.

Fixes: 7ac3404c2e ("ASoC: amd: acp: Map missing jack kcontrols")
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Link: https://lore.kernel.org/r/20230818080314.32991-1-alpernebiyasak@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-18 13:55:06 +01:00
..
acp-i2s.c ASoC: amd: merge DAI call back functions into ops 2023-08-14 13:10:04 +01:00
acp-legacy-common.c ASoC: amd: acp: add pm ops support for rembrandt platform 2023-07-09 22:47:41 +01:00
acp-legacy-mach.c ASoC: amd: acp: Add kcontrols and widgets per-codec in common code 2023-08-18 13:55:06 +01:00
acp-mach-common.c ASoC: amd: acp: Add kcontrols and widgets per-codec in common code 2023-08-18 13:55:06 +01:00
acp-mach.h ASoC: amd: acp: Add machine driver support for max98388 codec 2023-07-09 22:48:01 +01:00
acp-pci.c ASoC: amd: acp: add pm ops support for acp pci driver 2023-07-09 22:47:36 +01:00
acp-pdm.c ASoC: amd: acp: move pdm macros to common header file 2023-07-09 22:47:40 +01:00
acp-platform.c ASoC: amd: acp: export config_acp_dma() and config_pte_for_stream() symbols 2023-07-09 22:47:38 +01:00
acp-rembrandt.c ASoC: amd: merge DAI call back functions into ops 2023-08-14 13:10:04 +01:00
acp-renoir.c ASoC: amd: merge DAI call back functions into ops 2023-08-14 13:10:04 +01:00
acp-sof-mach.c ASoC: amd: acp: Add kcontrols and widgets per-codec in common code 2023-08-18 13:55:06 +01:00
amd.h ASoC: amd: merge DAI call back functions into ops 2023-08-14 13:10:04 +01:00
chip_offset_byte.h ASoC: amd: acp: Add legacy audio driver support for Rembrandt platform 2022-07-08 18:53:15 +01:00
Kconfig ASoC: amd: acp: fix SND_SOC_AMD_ACP_PCI depdenencies 2023-07-19 14:31:21 +01:00
Makefile ASoC: amd: acp: refactor the acp init and de-init sequence 2023-07-09 22:47:33 +01:00