summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/imx-pcm-rpmsg.c
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@nxp.com>2018-03-06 12:46:18 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:52:59 +0800
commit35c675bc633467825bc68eb58d6b47121df498db (patch)
treef6f978439b9f474f0faec8593cb603bd136987ff /sound/soc/fsl/imx-pcm-rpmsg.c
parentf823c83ef989e3c470115ff8a6c92df9be2a4d4f (diff)
MLK-17156-6: ASoC: imx-pcm-rpmsg: fix get codec data failed
Receive message is only used when the type is B. originally we copy the receive message to revg_msg all the time, when the message type is C, which will overide the revg_msg, which cause the get codec data command return wrong value. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Diffstat (limited to 'sound/soc/fsl/imx-pcm-rpmsg.c')
-rw-r--r--sound/soc/fsl/imx-pcm-rpmsg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/fsl/imx-pcm-rpmsg.c b/sound/soc/fsl/imx-pcm-rpmsg.c
index 67b44a60cbfe..fc48451083bc 100644
--- a/sound/soc/fsl/imx-pcm-rpmsg.c
+++ b/sound/soc/fsl/imx-pcm-rpmsg.c
@@ -463,8 +463,6 @@ static int i2s_rpmsg_cb(struct rpmsg_device *rpdev, void *data, int len,
dev_dbg(&rpdev->dev, "get from%d: cmd:%d.\n", src, msg->header.cmd);
- memcpy(&i2s_info_g->recv_msg, msg, sizeof(struct i2s_rpmsg_r));
-
if (msg->header.type == I2S_TYPE_C) {
if (msg->header.cmd == I2S_TX_PERIOD_DONE) {
spin_lock_irqsave(&i2s_info_g->lock[0], flags);
@@ -483,8 +481,10 @@ static int i2s_rpmsg_cb(struct rpmsg_device *rpdev, void *data, int len,
}
}
- if (msg->header.type == I2S_TYPE_B)
+ if (msg->header.type == I2S_TYPE_B) {
+ memcpy(&i2s_info_g->recv_msg, msg, sizeof(struct i2s_rpmsg_r));
complete(&i2s_info_g->cmd_complete);
+ }
return 0;
}