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"
21 struct imx_audio_rpmsg *rpmsg = dev_get_drvdata(&rpdev->dev); in imx_audio_rpmsg_cb()
27 if (!rpmsg->rpmsg_pdev) in imx_audio_rpmsg_cb()
30 info = platform_get_drvdata(rpmsg->rpmsg_pdev); in imx_audio_rpmsg_cb()
32 dev_dbg(&rpdev->dev, "get from%d: cmd:%d. %d\n", in imx_audio_rpmsg_cb()
33 src, r_msg->header.cmd, r_msg->param.resp); in imx_audio_rpmsg_cb()
35 switch (r_msg->header.type) { in imx_audio_rpmsg_cb()
38 switch (r_msg->header.cmd) { in imx_audio_rpmsg_cb()
40 spin_lock_irqsave(&info->lock[TX], flags); in imx_audio_rpmsg_cb()
41 msg = &info->msg[TX_PERIOD_DONE + MSG_TYPE_A_NUM]; in imx_audio_rpmsg_cb()
42 msg->r_msg.param.buffer_tail = in imx_audio_rpmsg_cb()
43 r_msg->param.buffer_tail; in imx_audio_rpmsg_cb()
44 msg->r_msg.param.buffer_tail %= info->num_period[TX]; in imx_audio_rpmsg_cb()
45 spin_unlock_irqrestore(&info->lock[TX], flags); in imx_audio_rpmsg_cb()
46 info->callback[TX](info->callback_param[TX]); in imx_audio_rpmsg_cb()
49 spin_lock_irqsave(&info->lock[RX], flags); in imx_audio_rpmsg_cb()
50 msg = &info->msg[RX_PERIOD_DONE + MSG_TYPE_A_NUM]; in imx_audio_rpmsg_cb()
51 msg->r_msg.param.buffer_tail = in imx_audio_rpmsg_cb()
52 r_msg->param.buffer_tail; in imx_audio_rpmsg_cb()
53 msg->r_msg.param.buffer_tail %= info->num_period[1]; in imx_audio_rpmsg_cb()
54 spin_unlock_irqrestore(&info->lock[RX], flags); in imx_audio_rpmsg_cb()
55 info->callback[RX](info->callback_param[RX]); in imx_audio_rpmsg_cb()
58 dev_warn(&rpdev->dev, "unknown msg command\n"); in imx_audio_rpmsg_cb()
64 memcpy(&info->r_msg, r_msg, sizeof(struct rpmsg_r_msg)); in imx_audio_rpmsg_cb()
65 complete(&info->cmd_complete); in imx_audio_rpmsg_cb()
68 dev_warn(&rpdev->dev, "unknown msg type\n"); in imx_audio_rpmsg_cb()
80 dev_info(&rpdev->dev, "new channel: 0x%x -> 0x%x!\n", in imx_audio_rpmsg_probe()
81 rpdev->src, rpdev->dst); in imx_audio_rpmsg_probe()
83 data = devm_kzalloc(&rpdev->dev, sizeof(*data), GFP_KERNEL); in imx_audio_rpmsg_probe()
85 return -ENOMEM; in imx_audio_rpmsg_probe()
87 dev_set_drvdata(&rpdev->dev, data); in imx_audio_rpmsg_probe()
90 data->rpmsg_pdev = platform_device_register_data(&rpdev->dev, in imx_audio_rpmsg_probe()
91 rpdev->id.name, in imx_audio_rpmsg_probe()
94 if (IS_ERR(data->rpmsg_pdev)) { in imx_audio_rpmsg_probe()
95 dev_err(&rpdev->dev, "failed to register rpmsg platform.\n"); in imx_audio_rpmsg_probe()
96 ret = PTR_ERR(data->rpmsg_pdev); in imx_audio_rpmsg_probe()
99 data->card_pdev = platform_device_register_data(&rpdev->dev, in imx_audio_rpmsg_probe()
100 "imx-audio-rpmsg", in imx_audio_rpmsg_probe()
102 rpdev->id.name, in imx_audio_rpmsg_probe()
103 strlen(rpdev->id.name) + 1); in imx_audio_rpmsg_probe()
104 if (IS_ERR(data->card_pdev)) { in imx_audio_rpmsg_probe()
105 dev_err(&rpdev->dev, "failed to register rpmsg card.\n"); in imx_audio_rpmsg_probe()
106 ret = PTR_ERR(data->card_pdev); in imx_audio_rpmsg_probe()
114 struct imx_audio_rpmsg *data = dev_get_drvdata(&rpdev->dev); in imx_audio_rpmsg_remove()
116 if (data->rpmsg_pdev) in imx_audio_rpmsg_remove()
117 platform_device_unregister(data->rpmsg_pdev); in imx_audio_rpmsg_remove()
119 if (data->card_pdev) in imx_audio_rpmsg_remove()
120 platform_device_unregister(data->card_pdev); in imx_audio_rpmsg_remove()
122 dev_info(&rpdev->dev, "audio rpmsg driver is removed\n"); in imx_audio_rpmsg_remove()
126 { .name = "rpmsg-audio-channel" },
127 { .name = "rpmsg-micfil-channel" },
142 MODULE_DESCRIPTION("Freescale SoC Audio RPMSG interface");