summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/core.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2022-05-23 16:03:04 +0200
committerTakashi Iwai <tiwai@suse.de>2022-05-23 16:03:04 +0200
commit0163717ed5dec4fc3aaf937baa9f66f21ca11c1d (patch)
treeb0618a944385d1d35bd829c9aa09eddb5c9633fa /sound/soc/sof/core.c
parent1693e265e0a5dbe11fba21b48272dd15dbb71ec0 (diff)
parente5cd20e0d6713138444cc3f3f982712cf9a36143 (diff)
downloadlinux-0163717ed5dec4fc3aaf937baa9f66f21ca11c1d.tar.gz
linux-0163717ed5dec4fc3aaf937baa9f66f21ca11c1d.tar.bz2
linux-0163717ed5dec4fc3aaf937baa9f66f21ca11c1d.zip
Merge tag 'asoc-v5.19' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v5.19 This is quite a big update, partly due to the addition of some larger drivers (more of which is to follow since at least the AVS driver is still a work in progress) and partly due to Charles' work sorting out our handling of endianness. As has been the case recently it's much more about drivers than the core. - Overhaul of endianness specification for data formats, avoiding needless restrictions due to CODECs. - Initial stages of Intel AVS driver merge. - Introduction of v4 IPC mechanism for SOF. - TDM mode support for AK4613. - Support for Analog Devices ADAU1361, Cirrus Logic CS35L45, Maxim MAX98396, MediaTek MT8186, NXP i.MX8 micfil and SAI interfaces, nVidia Tegra186 ASRC, and Texas Instruments TAS2764 and TAS2780
Diffstat (limited to 'sound/soc/sof/core.c')
-rw-r--r--sound/soc/sof/core.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c
index e91631618bff..53719c04658f 100644
--- a/sound/soc/sof/core.c
+++ b/sound/soc/sof/core.c
@@ -250,14 +250,13 @@ static int sof_probe_continue(struct snd_sof_dev *sdev)
}
if (sof_debug_check_flag(SOF_DBG_ENABLE_TRACE)) {
- sdev->dtrace_is_supported = true;
+ sdev->fw_trace_is_supported = true;
- /* init DMA trace */
- ret = snd_sof_init_trace(sdev);
+ /* init firmware tracing */
+ ret = sof_fw_trace_init(sdev);
if (ret < 0) {
/* non fatal */
- dev_warn(sdev->dev,
- "warning: failed to initialize trace %d\n",
+ dev_warn(sdev->dev, "failed to initialize firmware tracing %d\n",
ret);
}
} else {
@@ -308,7 +307,7 @@ static int sof_probe_continue(struct snd_sof_dev *sdev)
sof_machine_err:
snd_sof_machine_unregister(sdev, plat_data);
fw_trace_err:
- snd_sof_free_trace(sdev);
+ sof_fw_trace_free(sdev);
fw_run_err:
snd_sof_fw_unload(sdev);
fw_load_err:
@@ -342,6 +341,7 @@ static void sof_probe_work(struct work_struct *work)
int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
{
struct snd_sof_dev *sdev;
+ int ret;
sdev = devm_kzalloc(dev, sizeof(*sdev), GFP_KERNEL);
if (!sdev)
@@ -357,11 +357,23 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
sdev->first_boot = true;
dev_set_drvdata(dev, sdev);
+ /* check IPC support */
+ if (!(BIT(plat_data->ipc_type) & plat_data->desc->ipc_supported_mask)) {
+ dev_err(dev, "ipc_type %d is not supported on this platform, mask is %#x\n",
+ plat_data->ipc_type, plat_data->desc->ipc_supported_mask);
+ return -EINVAL;
+ }
+
+ /* init ops, if necessary */
+ ret = sof_ops_init(sdev);
+ if (ret < 0)
+ return ret;
+
/* check all mandatory ops */
if (!sof_ops(sdev) || !sof_ops(sdev)->probe || !sof_ops(sdev)->run ||
!sof_ops(sdev)->block_read || !sof_ops(sdev)->block_write ||
!sof_ops(sdev)->send_msg || !sof_ops(sdev)->load_firmware ||
- !sof_ops(sdev)->ipc_msg_data || !sof_ops(sdev)->fw_ready) {
+ !sof_ops(sdev)->ipc_msg_data) {
dev_err(dev, "error: missing mandatory ops\n");
return -EINVAL;
}
@@ -434,7 +446,7 @@ int snd_sof_device_remove(struct device *dev)
snd_sof_machine_unregister(sdev, pdata);
if (sdev->fw_state > SOF_FW_BOOT_NOT_STARTED) {
- snd_sof_free_trace(sdev);
+ sof_fw_trace_free(sdev);
ret = snd_sof_dsp_power_down_notify(sdev);
if (ret < 0)
dev_warn(dev, "error: %d failed to prepare DSP for device removal",