aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/atmel/sam9g20_wm8731.c3
-rw-r--r--sound/soc/codecs/Kconfig2
-rw-r--r--sound/soc/codecs/pcm186x.c7
-rw-r--r--sound/soc/codecs/wm8940.c7
-rw-r--r--sound/soc/mediatek/mt8195/mt8195-dai-pcm.c8
-rw-r--r--sound/soc/mediatek/mt8195/mt8195-mt6359.c4
-rw-r--r--sound/soc/sof/sof-client-ipc-msg-injector.c181
-rw-r--r--sound/soc/sof/sof-client-probes.c5
-rw-r--r--sound/soc/sof/sof-client.c66
-rw-r--r--sound/soc/sof/sof-client.h2
-rw-r--r--sound/soc/sof/trace.c4
-rw-r--r--sound/soc/uniphier/aio-compress.c7
12 files changed, 244 insertions, 52 deletions
diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c
index 0365b583ba70..4d25fb61c652 100644
--- a/sound/soc/atmel/sam9g20_wm8731.c
+++ b/sound/soc/atmel/sam9g20_wm8731.c
@@ -171,7 +171,8 @@ static int at91sam9g20ek_audio_probe(struct platform_device *pdev)
ret = snd_soc_register_card(card);
if (ret) {
- dev_err(&pdev->dev, "snd_soc_register_card() failed\n");
+ dev_err_probe(&pdev->dev, ret,
+ "snd_soc_register_card() failed: %d\n", ret);
goto err;
}
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index b106e5517090..095712316baf 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -1868,7 +1868,7 @@ config SND_SOC_WM8904
depends on I2C
config SND_SOC_WM8940
- tristate
+ tristate "Wolfson Microelectronics WM8940 codec"
depends on I2C
config SND_SOC_WM8955
diff --git a/sound/soc/codecs/pcm186x.c b/sound/soc/codecs/pcm186x.c
index 2c78dccb3f62..fda9d7ee3fe6 100644
--- a/sound/soc/codecs/pcm186x.c
+++ b/sound/soc/codecs/pcm186x.c
@@ -534,19 +534,14 @@ static int pcm186x_power_on(struct snd_soc_component *component)
static int pcm186x_power_off(struct snd_soc_component *component)
{
struct pcm186x_priv *priv = snd_soc_component_get_drvdata(component);
- int ret;
snd_soc_component_update_bits(component, PCM186X_POWER_CTRL,
PCM186X_PWR_CTRL_PWRDN, PCM186X_PWR_CTRL_PWRDN);
regcache_cache_only(priv->regmap, true);
- ret = regulator_bulk_disable(ARRAY_SIZE(priv->supplies),
+ return regulator_bulk_disable(ARRAY_SIZE(priv->supplies),
priv->supplies);
- if (ret)
- return ret;
-
- return 0;
}
static int pcm186x_set_bias_level(struct snd_soc_component *component,
diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c
index 99b4524f53d8..589394d420ce 100644
--- a/sound/soc/codecs/wm8940.c
+++ b/sound/soc/codecs/wm8940.c
@@ -778,9 +778,16 @@ static const struct i2c_device_id wm8940_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, wm8940_i2c_id);
+static const struct of_device_id wm8940_of_match[] = {
+ { .compatible = "wlf,wm8940", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, wm8940_of_match);
+
static struct i2c_driver wm8940_i2c_driver = {
.driver = {
.name = "wm8940",
+ .of_match_table = wm8940_of_match,
},
.probe_new = wm8940_i2c_probe,
.id_table = wm8940_i2c_id,
diff --git a/sound/soc/mediatek/mt8195/mt8195-dai-pcm.c b/sound/soc/mediatek/mt8195/mt8195-dai-pcm.c
index 151914c873ac..12644ded83d5 100644
--- a/sound/soc/mediatek/mt8195/mt8195-dai-pcm.c
+++ b/sound/soc/mediatek/mt8195/mt8195-dai-pcm.c
@@ -213,8 +213,6 @@ static int mtk_dai_pcm_configure(struct snd_pcm_substream *substream,
static int mtk_dai_pcm_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- int ret;
-
dev_dbg(dai->dev, "%s(), id %d, stream %d, widget active p %d, c %d\n",
__func__, dai->id, substream->stream,
dai->playback_widget->active, dai->capture_widget->active);
@@ -222,11 +220,7 @@ static int mtk_dai_pcm_prepare(struct snd_pcm_substream *substream,
if (dai->playback_widget->active || dai->capture_widget->active)
return 0;
- ret = mtk_dai_pcm_configure(substream, dai);
- if (ret)
- return ret;
-
- return 0;
+ return mtk_dai_pcm_configure(substream, dai);
}
static int mtk_dai_pcm_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
diff --git a/sound/soc/mediatek/mt8195/mt8195-mt6359.c b/sound/soc/mediatek/mt8195/mt8195-mt6359.c
index 3e32fe801b3c..54a00b0699b1 100644
--- a/sound/soc/mediatek/mt8195/mt8195-mt6359.c
+++ b/sound/soc/mediatek/mt8195/mt8195-mt6359.c
@@ -1641,7 +1641,6 @@ static struct mt8195_card_data mt8195_mt6359_max98390_rt5682_card = {
.quirk = MAX98390_SPEAKER_AMP_PRESENT,
};
-#ifdef CONFIG_OF
static const struct of_device_id mt8195_mt6359_dt_match[] = {
{
.compatible = "mediatek,mt8195_mt6359_rt1019_rt5682",
@@ -1657,7 +1656,6 @@ static const struct of_device_id mt8195_mt6359_dt_match[] = {
},
{},
};
-#endif
static const struct dev_pm_ops mt8195_mt6359_pm_ops = {
.poweroff = snd_soc_poweroff,
@@ -1667,9 +1665,7 @@ static const struct dev_pm_ops mt8195_mt6359_pm_ops = {
static struct platform_driver mt8195_mt6359_driver = {
.driver = {
.name = "mt8195_mt6359",
-#ifdef CONFIG_OF
.of_match_table = mt8195_mt6359_dt_match,
-#endif
.pm = &mt8195_mt6359_pm_ops,
},
.probe = mt8195_mt6359_dev_probe,
diff --git a/sound/soc/sof/sof-client-ipc-msg-injector.c b/sound/soc/sof/sof-client-ipc-msg-injector.c
index c711981187aa..c2480317730c 100644
--- a/sound/soc/sof/sof-client-ipc-msg-injector.c
+++ b/sound/soc/sof/sof-client-ipc-msg-injector.c
@@ -15,6 +15,7 @@
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <sound/sof/header.h>
+#include <sound/sof/ipc4/header.h>
#include "sof-client.h"
@@ -22,6 +23,8 @@
struct sof_msg_inject_priv {
struct dentry *dfs_file;
+ size_t max_msg_size;
+ enum sof_ipc_type ipc_type;
void *tx_buffer;
void *rx_buffer;
@@ -66,22 +69,54 @@ static ssize_t sof_msg_inject_dfs_read(struct file *file, char __user *buffer,
return count;
}
-static ssize_t sof_msg_inject_dfs_write(struct file *file, const char __user *buffer,
- size_t count, loff_t *ppos)
+static ssize_t sof_msg_inject_ipc4_dfs_read(struct file *file,
+ char __user *buffer,
+ size_t count, loff_t *ppos)
{
struct sof_client_dev *cdev = file->private_data;
struct sof_msg_inject_priv *priv = cdev->data;
- struct device *dev = &cdev->auxdev.dev;
- int ret, err;
- size_t size;
+ struct sof_ipc4_msg *ipc4_msg = priv->rx_buffer;
+ size_t remaining;
- if (*ppos)
+ if (!ipc4_msg->header_u64 || !count || *ppos)
return 0;
- size = simple_write_to_buffer(priv->tx_buffer, SOF_IPC_MSG_MAX_SIZE,
- ppos, buffer, count);
- if (size != count)
- return size > 0 ? -EFAULT : size;
+ remaining = sizeof(ipc4_msg->header_u64);
+
+ /* Only get large config have payload */
+ if (SOF_IPC4_MSG_IS_MODULE_MSG(ipc4_msg->primary) &&
+ (SOF_IPC4_MSG_TYPE_GET(ipc4_msg->primary) == SOF_IPC4_MOD_LARGE_CONFIG_GET))
+ remaining += ipc4_msg->data_size;
+
+ if (count > remaining)
+ count = remaining;
+
+ /* copy the header first */
+ if (copy_to_user(buffer, &ipc4_msg->header_u64, sizeof(ipc4_msg->header_u64)))
+ return -EFAULT;
+
+ *ppos += sizeof(ipc4_msg->header_u64);
+ remaining -= sizeof(ipc4_msg->header_u64);
+
+ if (!remaining)
+ return count;
+
+ if (remaining > ipc4_msg->data_size)
+ remaining = ipc4_msg->data_size;
+
+ /* Copy the payload */
+ if (copy_to_user(buffer + *ppos, ipc4_msg->data_ptr, remaining))
+ return -EFAULT;
+
+ *ppos += remaining;
+ return count;
+}
+
+static int sof_msg_inject_send_message(struct sof_client_dev *cdev)
+{
+ struct sof_msg_inject_priv *priv = cdev->data;
+ struct device *dev = &cdev->auxdev.dev;
+ int ret, err;
ret = pm_runtime_resume_and_get(dev);
if (ret < 0 && ret != -EACCES) {
@@ -90,19 +125,94 @@ static ssize_t sof_msg_inject_dfs_write(struct file *file, const char __user *bu
}
/* send the message */
- memset(priv->rx_buffer, 0, SOF_IPC_MSG_MAX_SIZE);
ret = sof_client_ipc_tx_message(cdev, priv->tx_buffer, priv->rx_buffer,
- SOF_IPC_MSG_MAX_SIZE);
+ priv->max_msg_size);
+ if (ret)
+ dev_err(dev, "IPC message send failed: %d\n", ret);
+
pm_runtime_mark_last_busy(dev);
err = pm_runtime_put_autosuspend(dev);
if (err < 0)
dev_err_ratelimited(dev, "debugfs write failed to idle %d\n", err);
- /* return size if test is successful */
- if (ret >= 0)
- ret = size;
-
return ret;
+}
+
+static ssize_t sof_msg_inject_dfs_write(struct file *file, const char __user *buffer,
+ size_t count, loff_t *ppos)
+{
+ struct sof_client_dev *cdev = file->private_data;
+ struct sof_msg_inject_priv *priv = cdev->data;
+ size_t size;
+ int ret;
+
+ if (*ppos)
+ return 0;
+
+ size = simple_write_to_buffer(priv->tx_buffer, priv->max_msg_size,
+ ppos, buffer, count);
+ if (size != count)
+ return size > 0 ? -EFAULT : size;
+
+ memset(priv->rx_buffer, 0, priv->max_msg_size);
+
+ ret = sof_msg_inject_send_message(cdev);
+
+ /* return the error code if test failed */
+ if (ret < 0)
+ size = ret;
+
+ return size;
+};
+
+static ssize_t sof_msg_inject_ipc4_dfs_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *ppos)
+{
+ struct sof_client_dev *cdev = file->private_data;
+ struct sof_msg_inject_priv *priv = cdev->data;
+ struct sof_ipc4_msg *ipc4_msg = priv->tx_buffer;
+ size_t size;
+ int ret;
+
+ if (*ppos)
+ return 0;
+
+ if (count < sizeof(ipc4_msg->header_u64))
+ return -EINVAL;
+
+ /* copy the header first */
+ size = simple_write_to_buffer(&ipc4_msg->header_u64,
+ sizeof(ipc4_msg->header_u64),
+ ppos, buffer, count);
+ if (size != sizeof(ipc4_msg->header_u64))
+ return size > 0 ? -EFAULT : size;
+
+ count -= size;
+ if (!count) {
+ /* Copy the payload */
+ size = simple_write_to_buffer(ipc4_msg->data_ptr,
+ priv->max_msg_size, ppos, buffer,
+ count);
+ if (size != count)
+ return size > 0 ? -EFAULT : size;
+ }
+
+ ipc4_msg->data_size = count;
+
+ /* Initialize the reply storage */
+ ipc4_msg = priv->rx_buffer;
+ ipc4_msg->header_u64 = 0;
+ ipc4_msg->data_size = priv->max_msg_size;
+ memset(ipc4_msg->data_ptr, 0, priv->max_msg_size);
+
+ ret = sof_msg_inject_send_message(cdev);
+
+ /* return the error code if test failed */
+ if (ret < 0)
+ size = ret;
+
+ return size;
};
static int sof_msg_inject_dfs_release(struct inode *inode, struct file *file)
@@ -122,28 +232,61 @@ static const struct file_operations sof_msg_inject_fops = {
.owner = THIS_MODULE,
};
+static const struct file_operations sof_msg_inject_ipc4_fops = {
+ .open = sof_msg_inject_dfs_open,
+ .read = sof_msg_inject_ipc4_dfs_read,
+ .write = sof_msg_inject_ipc4_dfs_write,
+ .llseek = default_llseek,
+ .release = sof_msg_inject_dfs_release,
+
+ .owner = THIS_MODULE,
+};
+
static int sof_msg_inject_probe(struct auxiliary_device *auxdev,
const struct auxiliary_device_id *id)
{
struct sof_client_dev *cdev = auxiliary_dev_to_sof_client_dev(auxdev);
struct dentry *debugfs_root = sof_client_get_debugfs_root(cdev);
+ static const struct file_operations *fops;
struct device *dev = &auxdev->dev;
struct sof_msg_inject_priv *priv;
+ size_t alloc_size;
/* allocate memory for client data */
priv = devm_kzalloc(&auxdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
- priv->tx_buffer = devm_kmalloc(dev, SOF_IPC_MSG_MAX_SIZE, GFP_KERNEL);
- priv->rx_buffer = devm_kzalloc(dev, SOF_IPC_MSG_MAX_SIZE, GFP_KERNEL);
+ priv->ipc_type = sof_client_get_ipc_type(cdev);
+ priv->max_msg_size = sof_client_get_ipc_max_payload_size(cdev);
+ alloc_size = priv->max_msg_size;
+
+ if (priv->ipc_type == SOF_INTEL_IPC4)
+ alloc_size += sizeof(struct sof_ipc4_msg);
+
+ priv->tx_buffer = devm_kmalloc(dev, alloc_size, GFP_KERNEL);
+ priv->rx_buffer = devm_kzalloc(dev, alloc_size, GFP_KERNEL);
if (!priv->tx_buffer || !priv->rx_buffer)
return -ENOMEM;
+ if (priv->ipc_type == SOF_INTEL_IPC4) {
+ struct sof_ipc4_msg *ipc4_msg;
+
+ ipc4_msg = priv->tx_buffer;
+ ipc4_msg->data_ptr = priv->tx_buffer + sizeof(struct sof_ipc4_msg);
+
+ ipc4_msg = priv->rx_buffer;
+ ipc4_msg->data_ptr = priv->rx_buffer + sizeof(struct sof_ipc4_msg);
+
+ fops = &sof_msg_inject_ipc4_fops;
+ } else {
+ fops = &sof_msg_inject_fops;
+ }
+
cdev->data = priv;
priv->dfs_file = debugfs_create_file("ipc_msg_inject", 0644, debugfs_root,
- cdev, &sof_msg_inject_fops);
+ cdev, fops);
/* enable runtime PM */
pm_runtime_set_autosuspend_delay(dev, SOF_IPC_CLIENT_SUSPEND_DELAY_MS);
diff --git a/sound/soc/sof/sof-client-probes.c b/sound/soc/sof/sof-client-probes.c
index c4c6e03c8133..34e6bd356e71 100644
--- a/sound/soc/sof/sof-client-probes.c
+++ b/sound/soc/sof/sof-client-probes.c
@@ -132,6 +132,7 @@ static int sof_probes_deinit(struct sof_client_dev *cdev)
static int sof_probes_info(struct sof_client_dev *cdev, unsigned int cmd,
void **params, size_t *num_params)
{
+ size_t max_msg_size = sof_client_get_ipc_max_payload_size(cdev);
struct sof_ipc_probe_info_params msg = {{{0}}};
struct sof_ipc_probe_info_params *reply;
size_t bytes;
@@ -140,13 +141,13 @@ static int sof_probes_info(struct sof_client_dev *cdev, unsigned int cmd,
*params = NULL;
*num_params = 0;
- reply = kzalloc(SOF_IPC_MSG_MAX_SIZE, GFP_KERNEL);
+ reply = kzalloc(max_msg_size, GFP_KERNEL);
if (!reply)
return -ENOMEM;
msg.rhdr.hdr.size = sizeof(msg);
msg.rhdr.hdr.cmd = SOF_IPC_GLB_PROBE | cmd;
- ret = sof_client_ipc_tx_message(cdev, &msg, reply, SOF_IPC_MSG_MAX_SIZE);
+ ret = sof_client_ipc_tx_message(cdev, &msg, reply, max_msg_size);
if (ret < 0 || reply->rhdr.error < 0)
goto exit;
diff --git a/sound/soc/sof/sof-client.c b/sound/soc/sof/sof-client.c
index 5fb3eb21bf7d..16cca666bb85 100644
--- a/sound/soc/sof/sof-client.c
+++ b/sound/soc/sof/sof-client.c
@@ -12,6 +12,7 @@
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/slab.h>
+#include <sound/sof/ipc4/header.h>
#include "ops.h"
#include "sof-client.h"
#include "sof-priv.h"
@@ -72,6 +73,9 @@ static int sof_register_ipc_flood_test(struct snd_sof_dev *sdev)
int ret = 0;
int i;
+ if (sdev->pdata->ipc_type != SOF_IPC)
+ return 0;
+
for (i = 0; i < CONFIG_SND_SOC_SOF_DEBUG_IPC_FLOOD_TEST_NUM; i++) {
ret = sof_client_dev_register(sdev, "ipc_flood", i, NULL, 0);
if (ret < 0)
@@ -245,10 +249,19 @@ EXPORT_SYMBOL_NS_GPL(sof_client_dev_unregister, SND_SOC_SOF_CLIENT);
int sof_client_ipc_tx_message(struct sof_client_dev *cdev, void *ipc_msg,
void *reply_data, size_t reply_bytes)
{
- struct sof_ipc_cmd_hdr *hdr = ipc_msg;
+ if (cdev->sdev->pdata->ipc_type == SOF_IPC) {
+ struct sof_ipc_cmd_hdr *hdr = ipc_msg;
+
+ return sof_ipc_tx_message(cdev->sdev->ipc, ipc_msg, hdr->size,
+ reply_data, reply_bytes);
+ } else if (cdev->sdev->pdata->ipc_type == SOF_INTEL_IPC4) {
+ struct sof_ipc4_msg *msg = ipc_msg;
- return sof_ipc_tx_message(cdev->sdev->ipc, ipc_msg, hdr->size,
- reply_data, reply_bytes);
+ return sof_ipc_tx_message(cdev->sdev->ipc, ipc_msg, msg->data_size,
+ reply_data, reply_bytes);
+ }
+
+ return -EINVAL;
}
EXPORT_SYMBOL_NS_GPL(sof_client_ipc_tx_message, SND_SOC_SOF_CLIENT);
@@ -319,6 +332,22 @@ const struct sof_ipc_fw_version *sof_client_get_fw_version(struct sof_client_dev
}
EXPORT_SYMBOL_NS_GPL(sof_client_get_fw_version, SND_SOC_SOF_CLIENT);
+size_t sof_client_get_ipc_max_payload_size(struct sof_client_dev *cdev)
+{
+ struct snd_sof_dev *sdev = sof_client_dev_to_sof_dev(cdev);
+
+ return sdev->ipc->max_payload_size;
+}
+EXPORT_SYMBOL_NS_GPL(sof_client_get_ipc_max_payload_size, SND_SOC_SOF_CLIENT);
+
+enum sof_ipc_type sof_client_get_ipc_type(struct sof_client_dev *cdev)
+{
+ struct snd_sof_dev *sdev = sof_client_dev_to_sof_dev(cdev);
+
+ return sdev->pdata->ipc_type;
+}
+EXPORT_SYMBOL_NS_GPL(sof_client_get_ipc_type, SND_SOC_SOF_CLIENT);
+
/* module refcount management of SOF core */
int sof_client_core_module_get(struct sof_client_dev *cdev)
{
@@ -342,9 +371,22 @@ EXPORT_SYMBOL_NS_GPL(sof_client_core_module_put, SND_SOC_SOF_CLIENT);
/* IPC event handling */
void sof_client_ipc_rx_dispatcher(struct snd_sof_dev *sdev, void *msg_buf)
{
- struct sof_ipc_cmd_hdr *hdr = msg_buf;
- u32 msg_type = hdr->cmd & SOF_GLB_TYPE_MASK;
struct sof_ipc_event_entry *event;
+ u32 msg_type;
+
+ if (sdev->pdata->ipc_type == SOF_IPC) {
+ struct sof_ipc_cmd_hdr *hdr = msg_buf;
+
+ msg_type = hdr->cmd & SOF_GLB_TYPE_MASK;
+ } else if (sdev->pdata->ipc_type == SOF_INTEL_IPC4) {
+ struct sof_ipc4_msg *msg = msg_buf;
+
+ msg_type = SOF_IPC4_NOTIFICATION_TYPE_GET(msg->primary);
+ } else {
+ dev_dbg_once(sdev->dev, "%s: Not supported IPC version: %d\n",
+ __func__, sdev->pdata->ipc_type);
+ return;
+ }
mutex_lock(&sdev->client_event_handler_mutex);
@@ -363,9 +405,21 @@ int sof_client_register_ipc_rx_handler(struct sof_client_dev *cdev,
struct snd_sof_dev *sdev = sof_client_dev_to_sof_dev(cdev);
struct sof_ipc_event_entry *event;
- if (!callback || !(ipc_msg_type & SOF_GLB_TYPE_MASK))
+ if (!callback)
return -EINVAL;
+ if (cdev->sdev->pdata->ipc_type == SOF_IPC) {
+ if (!(ipc_msg_type & SOF_GLB_TYPE_MASK))
+ return -EINVAL;
+ } else if (cdev->sdev->pdata->ipc_type == SOF_INTEL_IPC4) {
+ if (!(ipc_msg_type & SOF_IPC4_NOTIFICATION_TYPE_MASK))
+ return -EINVAL;
+ } else {
+ dev_warn(sdev->dev, "%s: Not supported IPC version: %d\n",
+ __func__, sdev->pdata->ipc_type);
+ return -EINVAL;
+ }
+
event = kmalloc(sizeof(*event), GFP_KERNEL);
if (!event)
return -ENOMEM;
diff --git a/sound/soc/sof/sof-client.h b/sound/soc/sof/sof-client.h
index 4b6394b4c694..46b215d9200f 100644
--- a/sound/soc/sof/sof-client.h
+++ b/sound/soc/sof/sof-client.h
@@ -41,6 +41,8 @@ int sof_client_ipc_tx_message(struct sof_client_dev *cdev, void *ipc_msg,
struct dentry *sof_client_get_debugfs_root(struct sof_client_dev *cdev);
struct device *sof_client_get_dma_dev(struct sof_client_dev *cdev);
const struct sof_ipc_fw_version *sof_client_get_fw_version(struct sof_client_dev *cdev);
+size_t sof_client_get_ipc_max_payload_size(struct sof_client_dev *cdev);
+enum sof_ipc_type sof_client_get_ipc_type(struct sof_client_dev *cdev);
/* module refcount management of SOF core */
int sof_client_core_module_get(struct sof_client_dev *cdev);
diff --git a/sound/soc/sof/trace.c b/sound/soc/sof/trace.c
index ba6361b5d64b..5d171bf8a5ea 100644
--- a/sound/soc/sof/trace.c
+++ b/sound/soc/sof/trace.c
@@ -457,6 +457,10 @@ int snd_sof_init_trace(struct snd_sof_dev *sdev)
{
int ret;
+ /* dtrace is only supported with SOF_IPC */
+ if (sdev->pdata->ipc_type != SOF_IPC)
+ sdev->dtrace_is_supported = false;
+
if (!sdev->dtrace_is_supported)
return 0;
diff --git a/sound/soc/uniphier/aio-compress.c b/sound/soc/uniphier/aio-compress.c
index 0f76bc601ca9..7d1492c15b57 100644
--- a/sound/soc/uniphier/aio-compress.c
+++ b/sound/soc/uniphier/aio-compress.c
@@ -139,7 +139,6 @@ static int uniphier_aio_compr_set_params(struct snd_soc_component *component,
struct uniphier_aio *aio = uniphier_priv(asoc_rtd_to_cpu(rtd, 0));
struct uniphier_aio_sub *sub = &aio->sub[cstream->direction];
struct device *dev = &aio->chip->pdev->dev;
- int ret;
if (params->codec.id != SND_AUDIOCODEC_IEC61937) {
dev_err(dev, "Codec ID is not supported(%d)\n",
@@ -161,11 +160,7 @@ static int uniphier_aio_compr_set_params(struct snd_soc_component *component,
aio_port_reset(sub);
aio_src_reset(sub);
- ret = uniphier_aio_compr_prepare(component, cstream);
- if (ret)
- return ret;
-
- return 0;
+ return uniphier_aio_compr_prepare(component, cstream);
}
static int uniphier_aio_compr_hw_free(struct snd_soc_component *component,