summaryrefslogtreecommitdiff
path: root/sound/soc/sof/sof-of-dev.c
AgeCommit message (Collapse)AuthorFilesLines
2024-05-27ASoC: SOF: add missing MODULE_DESCRIPTION()Pierre-Louis Bossart1-0/+1
MODULE_DESCRIPTION() was optional until it became mandatory and flagged as an error by 'make W=1'. Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://msgid.link/r/20240527194414.166156-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-04ASoC: SOF: Move sof_of_machine_select() to core.c from sof-of-dev.cChen-Yu Tsai1-23/+0
Commit 014fdeb0d747 ("ASoC: SOF: Move sof_of_machine_select() to sof-of-dev.c from sof-audio.c") caused a circular dependency between the snd_sof and snd_sof_of modules: depmod: ERROR: Cycle detected: snd_sof -> snd_sof_of -> snd_sof depmod: ERROR: Found 2 modules in dependency cycles! Move the function back with sof_machine_select(). Fixes: 014fdeb0d747 ("ASoC: SOF: Move sof_of_machine_select() to sof-of-dev.c from sof-audio.c") Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20231204033549.2020289-1-wenst@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
2023-11-29ASoC: SOF: sof-of-dev: Rely on core to create the file pathsPeter Ujfalusi1-11/+0
The core is now using the information from ipc_file_profile_base to create the paths for the loadable files, no need to set it in here anymore. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20231129125327.23708-10-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-11-29ASoC: SOF: sof-of-dev: Save the default IPC type and path overridesPeter Ujfalusi1-0/+4
Store the default IPC type and the firmware and topology path overrides to ipc_file_profile_base Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20231129125327.23708-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-11-29ASoC: SOF: Move sof_of_machine_select() to sof-of-dev.c from sof-audio.cPeter Ujfalusi1-0/+23
Move the sof_of_machine_select() function to sof-of-dev.c file and provide an inline stub in case of non OF builds. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20231129125327.23708-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-10-10ASoC: SOF: Convert to platform remove callback returning voidUwe Kleine-König1-3/+1
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). The SOF platform drivers all use either sof_of_remove() or sof_acpi_remove() which both return zero unconditionally. Change these functions to return void and the drivers to use .remove_new(). There is no semantical change. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20231009155945.285537-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-19ASoC: SOF: Use generic names for IPC typesPeter Ujfalusi1-3/+3
Use the new SOF_IPC_TYPE_3, SOF_IPC_TYPE_4 in core code. No functional changes, just renaming. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230919104226.32239-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-19ASoC: SOF: add IPC-dependent file namesPierre-Louis Bossart1-1/+1
To avoid misleading file names, use different names for INTEL_IPC4 firmware files. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Chao Song <chao.song@intel.com> Link: https://lore.kernel.org/r/20220414184817.362215-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-19ASoC: SOF: add path indirection to each IPC typePierre-Louis Bossart1-2/+2
With the addition of the IPCv4, we need the ability to select different paths for firmware and topologies. First add an indirection. Follow-up patches will add mechanisms to select a default IPC or override it. No functionality change in this patch. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20220414184817.362215-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-07ASoC: SOF: OF: Add shutdown callback for SOF OF deviceYC Hung1-0/+6
Add shutdown callback function for SOF OF device and call snd_sof_device_shutdown in sof_of_shutdown callback for DSP shutdown sequence. Signed-off-by: YC Hung <yc.hung@mediatek.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20220406194048.289787-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-15ASoC: SOF: OF: Avoid reverse module dependencyDaniel Baluta1-70/+7
Similar with commit 8a49cd11e68ed0 ("ASoC: SOF: ACPI: avoid reverse module dependency") we will be having hardware specific drivers that link against a common "helper" framework. sof-of-dev.c becomes a library with the interface defined in the newly created file sof-of-dev.h. This is the final step started with Kconfig simplification in commit 7548a391c53ca ("ASoC: SOF: i.MX: simplify Kconfig") Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20211215085703.137414-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-14ASoC: SOF: Remove pm_runtime_put_autosuspend() for SOF OF deviceAllen-KH Cheng1-3/+1
In SOF OF device, pm_runtime_put_autosuspend() is not matching any pm_runtime_get_sync(). This is imbalanced for PM runtime. Also, for consistency we call pm_runtime_mark_last_busy() before enabling PM runtime. 1. Remove pm_runtime_put_autosuspend() in probe_complete 2. Reorder PM runtime calls int probe_complete Signed-off-by: Allen-KH Cheng <Allen-KH.Cheng@mediatek.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20211209200830.145005-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18ASoC: SOF: Add mt8195 device descriptorYC Hung1-0/+13
Add SOF device and DT descriptor for Mediatek mt8195 platform. Signed-off-by: YC Hung <yc.hung@mediatek.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20211118100749.54628-6-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-05ASoC: SOF: OF: Add fw_path and tplg_path parametersDaniel Baluta1-3/+18
This allows specifying an alternate path for SOF firmware or SOF topology. This is particularly useful for i.MX when running Linux vs Android. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20211005071949.1277613-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-28ASoC: SOF: imx: add header file for opsPierre-Louis Bossart1-4/+1
Sparse (make C=2) complains about undeclared variables. Fix by adding a real prototype instead of 'extern' in sof-of-dev.c Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20210928072807.27838-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-21ASoC: SOF: Check desc->ops directly in acpi/pci/of probe functionsPeter Ujfalusi1-4/+1
We can check for the desc->ops directly in the probe functions, the ops is not used directly in the functions. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20210521092804.3721324-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-12ASoC: SOF: Simplify sof_probe_complete handling for acpi/pci/ofPeter Ujfalusi1-15/+3
Set the sof_data->sof_probe_complete callback unconditionally of CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE. The sof_probe_complete will be called when the sof_probe_continue() function is successfully executed, called either directly from snd_sof_device_probe() or from the scheduled work. Since all error cases within the call chain of snd_sof_device_probe() have error prints, there is no need to print again in the acpi/pci/of level. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20210409220959.1543456-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-25ASoC: SOF: Add .prepare/.complete callbacksDaniel Baluta1-0/+2
Use SOF defined callbacks (snd_sof_prepare/snd_sof_complete) in order to update internal SOF system suspend target. Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Paul Olaru <paul.olaru@nxp.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20200924151518.15841-3-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-25ASoC: SOF: Activate runtime PM with SOF OF deviceDaniel Baluta1-0/+4
SOF boots the DSP at probe and keeps it up all the time. With this change, after booting if no one is using the DSP the SOF core will turn off the DSP to save power. Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Paul Olaru <paul.olaru@nxp.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20200924151518.15841-2-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-01ASoC: SOF/Intel: clarify SPDX license with GPL-2.0-onlyPierre-Louis Bossart1-1/+1
Remove the ambiguity with GPL-2.0 and use an explicit GPL-2.0-only tag. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Link: https://lore.kernel.org/r/20200501145850.15178-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-16ASoC: SOF: Add i.MX8MP device descriptorDaniel Baluta1-0/+14
Add SOF device and DT descriptor for i.MX8MP platform. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20200409071832.2039-5-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-11ASoC: SOF: Add i.MX8QM device descriptorPaul Olaru1-0/+10
Add SOF device and DT descriptors for i.MX8QM platform. Signed-off-by: Paul Olaru <paul.olaru@nxp.com> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200210095817.13226-4-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-11ASoC: SOF: Rename i.MX8 platform to i.MX8XPaul Olaru1-2/+2
i.MX8 and i.MX8X platforms are very similar and were treated the same. Anyhow, we need to account for the differences somehow. Current supported platform is i.MX8QXP which is from i.MX8X family. Rename i.MX8 platform to i.MX8X to prepare for future i.MX8 platforms. Signed-off-by: Paul Olaru <paul.olaru@nxp.com> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200210095817.13226-2-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-09ASoC: SOF: remove nocodec_fw_filenameRanjani Sridharan1-1/+0
Remove nocodec_fw_filename from struct sof_dev_desc as it is not longer needed. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191204211556.12671-12-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-09ASoC: SOF: Make creation of machine device from SOF core optionalDaniel Baluta1-21/+1
Currently, SOF probes machine drivers by creating a platform device and passing the machine description as private data. This is driven by the ACPI restrictions. Ideally, ACPI tables should contain the description for the machine driver. This is not possible because ACPI tables are frozen and used on multiple OS-es (e.g Windows). In the case of Device Tree we don't have this restriction, so we choose to probe the machine drivers by creating a DT node as is the standard ALSA way. This patch makes the probing of machine drivers from SOF core optional allowing for Device Tree platforms to decouple the SOF core from machine driver probing. Along with this, it also consolidates the machine driver selection for Intel platforms by defining optional ops for selecting the machine driver based on the ACPI match for HDA and non-HDA platforms and setting the mach params. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191204211556.12671-11-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-09ASoC: SOF: Introduce default_fw_filename member in sof_dev_descRanjani Sridharan1-0/+1
Currently the FW filename is obtained from the ACPI matching table when determining which machine driver to use. In preparation for making the machine driver ACPI match optional for Device Tree platforms and moving the machine driver selection out of the SOF core, this patch introduces the default_fw_filename member in struct sof_dev_desc. Once the machine driver selection is moved out of SOF core, the nocodec_fw_filename will become obsolete and will be removed. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191204211556.12671-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-22ASoC: SOF: Add OF DSP device supportDaniel Baluta1-0/+143
Add support for device tree based SOF DSP devices. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20190821164730.7385-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>