linux-stable/sound/soc
Peter Ujfalusi 6d4295d615 ASoC: SOF: Intel: hda-codec: Delay the codec device registration
commit c344ef36db upstream.

The current code flow is:
1. snd_hdac_device_register()
2. set parameters needed by the hdac driver
3. request_codec_module()
   the hdac driver is probed at this point

During boot the codec drivers are not loaded when the hdac device is
registered, it is going to be probed later when loading the codec module,
which point the parameters are set.

On module remove/insert
rmmod snd_sof_pci_intel_tgl
modprobe snd_sof_pci_intel_tgl

The codec module remains loaded and the driver will be probed when the
hdac device is created right away, before the parameters for the driver
has been configured:

1. snd_hdac_device_register()
   the hdac driver is probed at this point
2. set parameters needed by the hdac driver
3. request_codec_module()
   will be a NOP as the module is already loaded

Move the snd_hdac_device_register() later, to be done right before
requesting the codec module to make sure that the parameters are all set
before the device is created:

1. set parameters needed by the hdac driver
2. snd_hdac_device_register()
3. request_codec_module()

This way at the hdac driver probe all parameters will be set in all cases.

Link: https://github.com/thesofproject/linux/issues/4731
Fixes: a0575b4add ("ASoC: hdac_hda: Conditionally register dais for HDMI and Analog")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231207095425.19597-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/ZYvUIxtrqBQZbNlC@shine.dominikbrodowski.net
Link: https://bugzilla.kernel.org/show_bug.cgi?id=218304
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-01-20 11:51:47 +01:00
..
adi ASoC: adi: merge DAI call back functions into ops 2023-08-14 13:10:03 +01:00
amd ASoC: amd: yc: Add DMI entry to support System76 Pangolin 13 2024-01-20 11:51:40 +01:00
apple
atmel ASoC: dmaengine: Drop unused iov_iter for process callback 2023-09-01 15:38:29 +02:00
au1x ASoC: au1x: merge DAI call back functions into ops 2023-08-14 13:10:15 +01:00
bcm ASoC: bcm: merge DAI call back functions into ops 2023-08-14 13:10:06 +01:00
cirrus ASoC: cirrus: merge DAI call back functions into ops 2023-08-14 13:10:22 +01:00
codecs ASoC: cs35l45: Prevents spinning during runtime suspend 2024-01-20 11:51:44 +01:00
dwc ASoC: dwc: Fix non-DT instantiation 2023-10-13 18:40:27 +01:00
fsl ASoC: fsl_xcvr: refine the requested phy clock frequency 2024-01-20 11:51:40 +01:00
generic ASoC: simple-card: fixup asoc_simple_probe() error handling 2023-09-19 13:48:38 +01:00
google
hisilicon ASoC: hisilicon: merge DAI call back functions into ops 2023-08-14 13:10:30 +01:00
img ASoC: img: merge DAI call back functions into ops 2023-08-14 13:10:08 +01:00
intel ASoC: Intel: bytcr_rt5640: Add new swapped-speakers quirk 2024-01-20 11:51:45 +01:00
jz4740 ASoC: jz4740: merge DAI call back functions into ops 2023-08-14 13:10:21 +01:00
kirkwood
loongson ASoC: loongson: merge DAI call back functions into ops 2023-08-14 13:10:28 +01:00
mediatek ASoC: mediatek: mt8186: fix AUD_PAD_TOP register and offset 2024-01-10 17:16:49 +01:00
meson ASoC: meson: g12a-tohdmitx: Fix event generation for S/PDIF mux 2024-01-10 17:16:51 +01:00
mxs
pxa ASoC: pxa: fix a memory leak in probe() 2023-10-09 13:13:50 +01:00
qcom ASoC: qcom: sc8280xp: Limit speaker digital volumes 2023-12-13 18:45:35 +01:00
rockchip ASoC: rockchip: Fix Wvoid-pointer-to-enum-cast warning 2023-08-15 19:23:00 +01:00
samsung ASoC: samsung: tm2_wm5110: parse audio-routing 2023-08-16 14:47:20 +01:00
sh ASoC: rsnd: add missing of_node_put 2023-09-11 01:23:54 +01:00
sof ASoC: SOF: Intel: hda-codec: Delay the codec device registration 2024-01-20 11:51:47 +01:00
spear
sprd
starfive ASoC: starfive: merge DAI call back functions into ops 2023-08-14 13:10:29 +01:00
sti ASoC: sti: merge DAI call back functions into ops 2023-08-14 13:10:10 +01:00
stm ASoC: dmaengine: Drop unused iov_iter for process callback 2023-09-01 15:38:29 +02:00
sunxi ASoC: sunxi: merge DAI call back functions into ops 2023-08-14 13:10:17 +01:00
tegra ASoC: tegra: Fix redundant PLLA and PLLA_OUT0 updates 2023-09-11 01:23:51 +01:00
ti ASoC: ti: omap-mcbsp: Fix runtime PM underflow warnings 2023-11-28 17:19:47 +00:00
uniphier ASoC: uniphier: merge DAI call back functions into ops 2023-08-14 13:10:27 +01:00
ux500 ASoC: ux500: merge DAI call back functions into ops 2023-08-14 13:10:16 +01:00
xilinx
xtensa
Kconfig
Makefile
soc-ac97.c
soc-acpi.c ASoC: soc-acpi: improve log messagesin link_slaves_found() 2023-07-31 23:24:01 +01:00
soc-card.c
soc-component.c ASoC: soc-dapm: Add helper for comparing widget name 2023-10-09 13:03:28 +01:00
soc-compress.c ASoC: Fixes that got left after v6.4 2023-08-28 16:56:54 +02:00
soc-core.c ASoC: core: Do not call link_exit() on uninitialized rtd objects 2023-09-29 14:17:49 +02:00
soc-dai.c ASoC: soc-dai: add flag to mute and unmute stream during trigger 2023-11-28 17:20:04 +00:00
soc-dapm.c ASoC: dapm: fix clock get name 2023-11-20 11:59:37 +01:00
soc-devres.c
soc-generic-dmaengine-pcm.c ASoC: soc-generic-dmaengine-pcm: Fix function name in comment 2023-09-22 17:33:04 +01:00
soc-jack.c ASoC: soc-jack: calling snd_soc_jack_report causes a null pointer access 2023-08-14 22:10:35 +01:00
soc-link.c
soc-ops.c ASoC: ops: add correct range check for limiting volume 2023-12-13 18:45:31 +01:00
soc-pcm.c ASoC: soc-dai: add flag to mute and unmute stream during trigger 2023-11-28 17:20:04 +00:00
soc-topology-test.c
soc-topology.c ASoC: Updates for v6.6 2023-08-28 16:13:03 +02:00
soc-utils-test.c
soc-utils.c ASoC: soc-utils: Export snd_soc_dai_is_dummy() symbol 2023-09-11 01:23:50 +01:00