Lines Matching +full:micfil +full:- +full:audio
1 // SPDX-License-Identifier: GPL-2.0+
2 // Copyright 2017-2020 NXP
6 #include "imx-pcm-rpmsg.h"
20 struct imx_audio_rpmsg *rpmsg = dev_get_drvdata(&rpdev->dev); in imx_audio_rpmsg_cb()
26 if (!rpmsg->rpmsg_pdev) in imx_audio_rpmsg_cb()
29 info = platform_get_drvdata(rpmsg->rpmsg_pdev); in imx_audio_rpmsg_cb()
31 dev_dbg(&rpdev->dev, "get from%d: cmd:%d. %d\n", in imx_audio_rpmsg_cb()
32 src, r_msg->header.cmd, r_msg->param.resp); in imx_audio_rpmsg_cb()
34 switch (r_msg->header.type) { in imx_audio_rpmsg_cb()
37 switch (r_msg->header.cmd) { in imx_audio_rpmsg_cb()
39 spin_lock_irqsave(&info->lock[TX], flags); in imx_audio_rpmsg_cb()
40 msg = &info->msg[TX_PERIOD_DONE + MSG_TYPE_A_NUM]; in imx_audio_rpmsg_cb()
41 msg->r_msg.param.buffer_tail = in imx_audio_rpmsg_cb()
42 r_msg->param.buffer_tail; in imx_audio_rpmsg_cb()
43 msg->r_msg.param.buffer_tail %= info->num_period[TX]; in imx_audio_rpmsg_cb()
44 spin_unlock_irqrestore(&info->lock[TX], flags); in imx_audio_rpmsg_cb()
45 info->callback[TX](info->callback_param[TX]); in imx_audio_rpmsg_cb()
48 spin_lock_irqsave(&info->lock[RX], flags); in imx_audio_rpmsg_cb()
49 msg = &info->msg[RX_PERIOD_DONE + MSG_TYPE_A_NUM]; in imx_audio_rpmsg_cb()
50 msg->r_msg.param.buffer_tail = in imx_audio_rpmsg_cb()
51 r_msg->param.buffer_tail; in imx_audio_rpmsg_cb()
52 msg->r_msg.param.buffer_tail %= info->num_period[1]; in imx_audio_rpmsg_cb()
53 spin_unlock_irqrestore(&info->lock[RX], flags); in imx_audio_rpmsg_cb()
54 info->callback[RX](info->callback_param[RX]); in imx_audio_rpmsg_cb()
57 dev_warn(&rpdev->dev, "unknown msg command\n"); in imx_audio_rpmsg_cb()
63 memcpy(&info->r_msg, r_msg, sizeof(struct rpmsg_r_msg)); in imx_audio_rpmsg_cb()
64 complete(&info->cmd_complete); in imx_audio_rpmsg_cb()
67 dev_warn(&rpdev->dev, "unknown msg type\n"); in imx_audio_rpmsg_cb()
79 dev_info(&rpdev->dev, "new channel: 0x%x -> 0x%x!\n", in imx_audio_rpmsg_probe()
80 rpdev->src, rpdev->dst); in imx_audio_rpmsg_probe()
82 data = devm_kzalloc(&rpdev->dev, sizeof(*data), GFP_KERNEL); in imx_audio_rpmsg_probe()
84 return -ENOMEM; in imx_audio_rpmsg_probe()
86 dev_set_drvdata(&rpdev->dev, data); in imx_audio_rpmsg_probe()
89 data->rpmsg_pdev = platform_device_register_data(&rpdev->dev, in imx_audio_rpmsg_probe()
93 if (IS_ERR(data->rpmsg_pdev)) { in imx_audio_rpmsg_probe()
94 dev_err(&rpdev->dev, "failed to register rpmsg platform.\n"); in imx_audio_rpmsg_probe()
95 ret = PTR_ERR(data->rpmsg_pdev); in imx_audio_rpmsg_probe()
103 struct imx_audio_rpmsg *data = dev_get_drvdata(&rpdev->dev); in imx_audio_rpmsg_remove()
105 if (data->rpmsg_pdev) in imx_audio_rpmsg_remove()
106 platform_device_unregister(data->rpmsg_pdev); in imx_audio_rpmsg_remove()
108 dev_info(&rpdev->dev, "audio rpmsg driver is removed\n"); in imx_audio_rpmsg_remove()
112 { .name = "rpmsg-audio-channel" },
113 { .name = "rpmsg-micfil-channel" },
127 MODULE_DESCRIPTION("Freescale SoC Audio RPMSG interface");