linux/sound/soc/sof
Peter Ujfalusi b976593219 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>
History 2024-01-20 11:50:10 +01:00
..
amd ASoC: SOF: amd: fix for firmware reload failure after playback 2023-10-19 23:08:51 +02:00
imx ASoC: SOF: imx8ulp: add missing of_node_put() in imx8ulp_probe() 2022-08-24 12:21:28 +01:00
intel ASoC: SOF: Intel: hda-codec: Delay the codec device registration 2024-01-20 11:50:10 +01:00
mediatek ASoC: SOF: mediatek: initialize panic_info to zero 2023-01-12 12:02:37 +01:00
xtensa ASoC: SOF: dsp_arch_ops: add kernel log level parameter for oops and stack 2021-12-23 13:38:25 +00:00
compress.c ASoC: SOF: compress: Add copy function for capture case 2022-08-31 12:12:59 +01:00
control.c ASoC: SOF: control: use pm_runtime_resume_and_get() 2022-04-27 14:15:24 +01:00
core.c ASoC: SOF: core: Ensure sof_ops_free() is still called when probe never ran. 2023-11-20 11:52:06 +01:00
debug.c ASoC: SOF: debug: conditionally bump runtime_pm counter on exceptions 2023-06-09 10:34:13 +02:00
iomem-utils.c ASoC: SOF: Split up utils.c into sof-utils and iomem-utils 2022-02-10 15:19:04 +00:00
ipc.c ASoC: SOF: Compile and runtime IPC version selection 2022-06-14 11:22:12 +01:00
ipc3-control.c ASoC: SOF: ipc3: Remove the ipc3-ops.h header file 2022-05-04 15:31:18 +01:00
ipc3-dtrace.c ASoC: SOF: ipc3-dtrace: uninitialized data in dfsentry_trace_filter_write() 2023-07-27 08:50:40 +02:00
ipc3-loader.c ASoC: SOF: ipc3-loader: Print out the non matching ext_man magic number 2022-07-15 20:11:34 +01:00
ipc3-pcm.c ASoC: SOF: Adding amd HS functionality to the sof core 2022-09-20 19:38:03 +01:00
ipc3-priv.h ASoC: SOF: Modify the host trace_init parameter list to include dmab 2022-05-19 16:44:17 +01:00
ipc3-topology.c ASoC: SOF: ipc3-topology: use old pipeline teardown flow with SOF2.1 and older 2022-11-01 18:28:07 +00:00
ipc3.c ASoC: SOF: ipc3: Check for upper size limit for the received message 2023-04-06 12:10:38 +02:00
ipc4-control.c ASoC: SOF: IPC4: update gain ipc msg definition to align with fw 2023-04-06 12:10:39 +02:00
ipc4-loader.c ASoC: SOF: replace ipc4-loader dev_vdbg with tracepoints 2022-09-19 15:44:08 +01:00
ipc4-mtrace.c ASoC: SOF: ipc4-mtrace: prevent underflow in sof_ipc4_priority_mask_dfs_write() 2023-02-09 11:28:01 +01:00
ipc4-pcm.c ASoC: SOF: ipc4-pcm: set pcm rate to dai setting 2022-07-15 20:11:31 +01:00
ipc4-priv.h ASoC: SOF: ipc4: Add support for mtrace log extraction 2022-09-09 18:48:48 +01:00
ipc4-topology.c ASoC: SOF: IPC4: update gain ipc msg definition to align with fw 2023-04-06 12:10:39 +02:00
ipc4-topology.h ASoC: SOF: IPC4: update gain ipc msg definition to align with fw 2023-04-06 12:10:39 +02:00
ipc4.c ASoC: SOF: ipc4: handle EXCEPTION_CAUGHT notification from firmware 2023-11-28 17:06:59 +00:00
Kconfig ASoC: SOF: Kconfig: Make IPC_MESSAGE_INJECTOR depend on SND_SOC_SOF 2022-08-23 13:49:56 +01:00
loader.c ASoC: SOF: loader: Call optional query_fw_configuration on first boot 2022-04-29 13:06:17 +01:00
Makefile ASoC: SOF: ipc4: Add support for mtrace log extraction 2022-09-09 18:48:48 +01:00
nocodec.c ASOC: SOF: use devm_kcalloc() instead of devm_kzalloc() 2022-09-19 17:52:36 +01:00
ops.c ASoC: SOF: Switch to IPC generic firmware tracing 2022-05-19 16:44:15 +01:00
ops.h ASoC: SOF: Add ops_free 2022-06-10 13:32:05 +01:00
pcm.c ASoC: SOF: pcm: fix pm_runtime imbalance in error handling 2023-06-09 10:34:13 +02:00
pm.c ASoC: SOF: pm: save io region state in case of errors in resume 2023-06-09 10:34:13 +02:00
sof-acpi-dev.c ASoC: SOF: add IPC-dependent file names 2022-04-19 12:03:34 +01:00
sof-acpi-dev.h ASoC: SOF: ACPI: avoid reverse module dependency 2021-03-02 15:31:40 +01:00
sof-audio.c ASoC: SOF: Pass PCI SSID to machine driver 2023-11-28 17:06:58 +00:00
sof-audio.h ASoC: SOF: topology: add code to parse config params for ACPDMIC dai 2022-06-14 11:22:10 +01:00
sof-client-ipc-flood-test.c ASoC: SOF: sof-client-ipc-flood-test: use pm_runtime_resume_and_get() 2022-05-19 16:44:29 +01:00
sof-client-ipc-msg-injector.c ASoC: SOF: ipc-msg-injector: fix copy in sof_msg_inject_ipc4_dfs_write() 2022-07-14 13:26:37 +01:00
sof-client-probes.c ASoC: SOF: sof-client-probes: fix pm_runtime imbalance in error handling 2023-06-09 10:34:13 +02:00
sof-client-probes.h ASoC: SOF: probes: rename assign/free callbacks as startup/shutdown 2022-07-15 20:11:38 +01:00
sof-client.c ASoC: SOF: sof-client: remove use of __func__ in dev_dbg 2022-06-17 10:46:46 +01:00
sof-client.h ASoC: SOF: sof-client: Add API to get the ipc_type 2022-05-09 18:17:58 +01:00
sof-of-dev.c ASoC: SOF: add IPC-dependent file names 2022-04-19 12:03:34 +01:00
sof-of-dev.h ASoC: SOF: Introduce function sof_of_machine_select 2022-08-23 18:22:29 +01:00
sof-pci-dev.c ASoC: SOF: Pass PCI SSID to machine driver 2023-11-28 17:06:58 +00:00
sof-pci-dev.h ASoC: SOF: pci: split PCI into different drivers 2021-03-02 15:32:00 +01:00
sof-priv.h ASoC: SOF: add quirk to override topology mclk_id 2022-09-19 18:11:45 +01:00
sof-utils.c ASoC: SOF: remove unneeded dev_vdbg 2022-09-19 15:44:06 +01:00
sof-utils.h ASoC: SOF: Split up utils.c into sof-utils and iomem-utils 2022-02-10 15:19:04 +00:00
stream-ipc.c ASoC: SOF: Remove ipc_pcm_params() ops 2022-03-11 13:41:09 +00:00
topology.c ASoC: SOF: topology: simplify code to prevent static analysis warnings 2023-09-23 11:11:04 +02:00
trace.c ASoC: SOF: Switch to IPC generic firmware tracing 2022-05-19 16:44:15 +01:00