summaryrefslogtreecommitdiff
path: root/sound/soc/sof/imx
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2021-10-18 15:50:42 +0300
committerMark Brown <broonie@kernel.org>2021-10-18 15:50:42 +0300
commitb8f3b564937c1f3529bc4897cc41c5d95d2cdbe9 (patch)
treeb71ed4906bbe2ca96d68dbf1d6d6f0fe2676f1de /sound/soc/sof/imx
parent4e52cb9e2c22c9d860910794c82461064baadd9f (diff)
parent519d81956ee277b4419c723adfb154603c2565ba (diff)
downloadlinux-b8f3b564937c1f3529bc4897cc41c5d95d2cdbe9.tar.xz
Merge tag 'v5.15-rc6' into asoc-5.16
Linux 5.15-rc6
Diffstat (limited to 'sound/soc/sof/imx')
-rw-r--r--sound/soc/sof/imx/imx8.c9
-rw-r--r--sound/soc/sof/imx/imx8m.c9
2 files changed, 16 insertions, 2 deletions
diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c
index 20695fe288ce..dd59a74480d6 100644
--- a/sound/soc/sof/imx/imx8.c
+++ b/sound/soc/sof/imx/imx8.c
@@ -366,7 +366,14 @@ static int imx8_remove(struct snd_sof_dev *sdev)
/* on i.MX8 there is 1 to 1 match between type and BAR idx */
static int imx8_get_bar_index(struct snd_sof_dev *sdev, u32 type)
{
- return type;
+ /* Only IRAM and SRAM bars are valid */
+ switch (type) {
+ case SOF_FW_BLK_TYPE_IRAM:
+ case SOF_FW_BLK_TYPE_SRAM:
+ return type;
+ default:
+ return -EINVAL;
+ }
}
static struct snd_soc_dai_driver imx8_dai[] = {
diff --git a/sound/soc/sof/imx/imx8m.c b/sound/soc/sof/imx/imx8m.c
index ae1b48abbae0..e4618980cf8b 100644
--- a/sound/soc/sof/imx/imx8m.c
+++ b/sound/soc/sof/imx/imx8m.c
@@ -229,7 +229,14 @@ static int imx8m_remove(struct snd_sof_dev *sdev)
/* on i.MX8 there is 1 to 1 match between type and BAR idx */
static int imx8m_get_bar_index(struct snd_sof_dev *sdev, u32 type)
{
- return type;
+ /* Only IRAM and SRAM bars are valid */
+ switch (type) {
+ case SOF_FW_BLK_TYPE_IRAM:
+ case SOF_FW_BLK_TYPE_SRAM:
+ return type;
+ default:
+ return -EINVAL;
+ }
}
static struct snd_soc_dai_driver imx8m_dai[] = {