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>
This commit is contained in:
parent
6f5875b428
commit
463ddb8b1b
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue