Lines Matching full:info

20 	.info = SNDRV_PCM_INFO_INTERLEAVED |
37 struct rpmsg_info *info) in imx_rpmsg_pcm_send_message() argument
39 struct rpmsg_device *rpdev = info->rpdev; in imx_rpmsg_pcm_send_message()
42 mutex_lock(&info->msg_lock); in imx_rpmsg_pcm_send_message()
44 dev_err(info->dev, "rpmsg channel not ready\n"); in imx_rpmsg_pcm_send_message()
45 mutex_unlock(&info->msg_lock); in imx_rpmsg_pcm_send_message()
52 reinit_completion(&info->cmd_complete); in imx_rpmsg_pcm_send_message()
58 mutex_unlock(&info->msg_lock); in imx_rpmsg_pcm_send_message()
64 mutex_unlock(&info->msg_lock); in imx_rpmsg_pcm_send_message()
69 ret = wait_for_completion_timeout(&info->cmd_complete, in imx_rpmsg_pcm_send_message()
74 mutex_unlock(&info->msg_lock); in imx_rpmsg_pcm_send_message()
78 memcpy(&msg->r_msg, &info->r_msg, sizeof(struct rpmsg_r_msg)); in imx_rpmsg_pcm_send_message()
79 memcpy(&info->msg[msg->r_msg.header.cmd].r_msg, in imx_rpmsg_pcm_send_message()
91 info->msg[TX_POINTER].r_msg.param.buffer_offset = 0; in imx_rpmsg_pcm_send_message()
94 info->msg[RX_POINTER].r_msg.param.buffer_offset = 0; in imx_rpmsg_pcm_send_message()
101 info->r_msg.param.resp); in imx_rpmsg_pcm_send_message()
103 mutex_unlock(&info->msg_lock); in imx_rpmsg_pcm_send_message()
110 struct rpmsg_info *info) in imx_rpmsg_insert_workqueue() argument
119 spin_lock_irqsave(&info->wq_lock, flags); in imx_rpmsg_insert_workqueue()
120 if (info->work_write_index != info->work_read_index) { in imx_rpmsg_insert_workqueue()
121 int index = info->work_write_index; in imx_rpmsg_insert_workqueue()
123 memcpy(&info->work_list[index].msg, msg, in imx_rpmsg_insert_workqueue()
126 queue_work(info->rpmsg_wq, &info->work_list[index].work); in imx_rpmsg_insert_workqueue()
127 info->work_write_index++; in imx_rpmsg_insert_workqueue()
128 info->work_write_index %= WORK_MAX_NUM; in imx_rpmsg_insert_workqueue()
130 info->msg_drop_count[substream->stream]++; in imx_rpmsg_insert_workqueue()
133 spin_unlock_irqrestore(&info->wq_lock, flags); in imx_rpmsg_insert_workqueue()
142 struct rpmsg_info *info = dev_get_drvdata(component->dev); in imx_rpmsg_pcm_hw_params() local
146 msg = &info->msg[TX_HW_PARAM]; in imx_rpmsg_pcm_hw_params()
149 msg = &info->msg[RX_HW_PARAM]; in imx_rpmsg_pcm_hw_params()
185 info->send_message(msg, info); in imx_rpmsg_pcm_hw_params()
193 struct rpmsg_info *info = dev_get_drvdata(component->dev); in imx_rpmsg_pcm_pointer() local
199 msg = &info->msg[TX_PERIOD_DONE + MSG_TYPE_A_NUM]; in imx_rpmsg_pcm_pointer()
201 msg = &info->msg[RX_PERIOD_DONE + MSG_TYPE_A_NUM]; in imx_rpmsg_pcm_pointer()
214 struct rpmsg_info *info = stream_timer->info; in imx_rpmsg_timer_callback() local
218 msg = &info->msg[TX_PERIOD_DONE + MSG_TYPE_A_NUM]; in imx_rpmsg_timer_callback()
221 msg = &info->msg[RX_PERIOD_DONE + MSG_TYPE_A_NUM]; in imx_rpmsg_timer_callback()
225 imx_rpmsg_insert_workqueue(substream, msg, info); in imx_rpmsg_timer_callback()
231 struct rpmsg_info *info = dev_get_drvdata(component->dev); in imx_rpmsg_pcm_open() local
241 msg = &info->msg[TX_OPEN]; in imx_rpmsg_pcm_open()
246 info->msg[cmd].s_msg.param.buffer_tail = 0; in imx_rpmsg_pcm_open()
247 info->msg[cmd].r_msg.param.buffer_tail = 0; in imx_rpmsg_pcm_open()
248 info->msg[TX_POINTER].r_msg.param.buffer_offset = 0; in imx_rpmsg_pcm_open()
251 msg = &info->msg[RX_OPEN]; in imx_rpmsg_pcm_open()
256 info->msg[cmd].s_msg.param.buffer_tail = 0; in imx_rpmsg_pcm_open()
257 info->msg[cmd].r_msg.param.buffer_tail = 0; in imx_rpmsg_pcm_open()
258 info->msg[RX_POINTER].r_msg.param.buffer_offset = 0; in imx_rpmsg_pcm_open()
261 info->send_message(msg, info); in imx_rpmsg_pcm_open()
274 info->msg_drop_count[substream->stream] = 0; in imx_rpmsg_pcm_open()
277 info->stream_timer[substream->stream].info = info; in imx_rpmsg_pcm_open()
278 info->stream_timer[substream->stream].substream = substream; in imx_rpmsg_pcm_open()
279 timer_setup(&info->stream_timer[substream->stream].timer, in imx_rpmsg_pcm_open()
288 struct rpmsg_info *info = dev_get_drvdata(component->dev); in imx_rpmsg_pcm_close() local
292 flush_workqueue(info->rpmsg_wq); in imx_rpmsg_pcm_close()
295 msg = &info->msg[TX_CLOSE]; in imx_rpmsg_pcm_close()
298 msg = &info->msg[RX_CLOSE]; in imx_rpmsg_pcm_close()
302 info->send_message(msg, info); in imx_rpmsg_pcm_close()
304 del_timer(&info->stream_timer[substream->stream].timer); in imx_rpmsg_pcm_close()
308 if (info->msg_drop_count[substream->stream]) in imx_rpmsg_pcm_close()
310 info->msg_drop_count[substream->stream]); in imx_rpmsg_pcm_close()
353 struct rpmsg_info *info = dev_get_drvdata(component->dev); in imx_rpmsg_prepare_and_submit() local
357 msg = &info->msg[TX_BUFFER]; in imx_rpmsg_prepare_and_submit()
360 msg = &info->msg[RX_BUFFER]; in imx_rpmsg_prepare_and_submit()
370 info->num_period[substream->stream] = msg->s_msg.param.buffer_size / in imx_rpmsg_prepare_and_submit()
373 info->callback[substream->stream] = imx_rpmsg_pcm_dma_complete; in imx_rpmsg_prepare_and_submit()
374 info->callback_param[substream->stream] = substream; in imx_rpmsg_prepare_and_submit()
376 return imx_rpmsg_insert_workqueue(substream, msg, info); in imx_rpmsg_prepare_and_submit()
382 struct rpmsg_info *info = dev_get_drvdata(component->dev); in imx_rpmsg_async_issue_pending() local
386 msg = &info->msg[TX_START]; in imx_rpmsg_async_issue_pending()
389 msg = &info->msg[RX_START]; in imx_rpmsg_async_issue_pending()
393 return imx_rpmsg_insert_workqueue(substream, msg, info); in imx_rpmsg_async_issue_pending()
399 struct rpmsg_info *info = dev_get_drvdata(component->dev); in imx_rpmsg_restart() local
403 msg = &info->msg[TX_RESTART]; in imx_rpmsg_restart()
406 msg = &info->msg[RX_RESTART]; in imx_rpmsg_restart()
410 return imx_rpmsg_insert_workqueue(substream, msg, info); in imx_rpmsg_restart()
416 struct rpmsg_info *info = dev_get_drvdata(component->dev); in imx_rpmsg_pause() local
420 msg = &info->msg[TX_PAUSE]; in imx_rpmsg_pause()
423 msg = &info->msg[RX_PAUSE]; in imx_rpmsg_pause()
427 return imx_rpmsg_insert_workqueue(substream, msg, info); in imx_rpmsg_pause()
433 struct rpmsg_info *info = dev_get_drvdata(component->dev); in imx_rpmsg_terminate_all() local
438 msg = &info->msg[TX_TERMINATE]; in imx_rpmsg_terminate_all()
442 info->msg[cmd].s_msg.param.buffer_tail = 0; in imx_rpmsg_terminate_all()
443 info->msg[cmd].r_msg.param.buffer_tail = 0; in imx_rpmsg_terminate_all()
444 info->msg[TX_POINTER].r_msg.param.buffer_offset = 0; in imx_rpmsg_terminate_all()
446 msg = &info->msg[RX_TERMINATE]; in imx_rpmsg_terminate_all()
450 info->msg[cmd].s_msg.param.buffer_tail = 0; in imx_rpmsg_terminate_all()
451 info->msg[cmd].r_msg.param.buffer_tail = 0; in imx_rpmsg_terminate_all()
452 info->msg[RX_POINTER].r_msg.param.buffer_offset = 0; in imx_rpmsg_terminate_all()
455 del_timer(&info->stream_timer[substream->stream].timer); in imx_rpmsg_terminate_all()
457 return imx_rpmsg_insert_workqueue(substream, msg, info); in imx_rpmsg_terminate_all()
485 if (runtime->info & SNDRV_PCM_INFO_PAUSE) in imx_rpmsg_pcm_trigger()
521 struct rpmsg_info *info = dev_get_drvdata(component->dev); in imx_rpmsg_pcm_ack() local
534 msg = &info->msg[TX_PERIOD_DONE + MSG_TYPE_A_NUM]; in imx_rpmsg_pcm_ack()
537 msg = &info->msg[RX_PERIOD_DONE + MSG_TYPE_A_NUM]; in imx_rpmsg_pcm_ack()
556 spin_lock_irqsave(&info->lock[substream->stream], flags); in imx_rpmsg_pcm_ack()
557 memcpy(&info->notify[substream->stream], msg, in imx_rpmsg_pcm_ack()
559 info->notify_updated[substream->stream] = true; in imx_rpmsg_pcm_ack()
560 spin_unlock_irqrestore(&info->lock[substream->stream], flags); in imx_rpmsg_pcm_ack()
567 timer = &info->stream_timer[substream->stream].timer; in imx_rpmsg_pcm_ack()
581 imx_rpmsg_insert_workqueue(substream, msg, info); in imx_rpmsg_pcm_ack()
626 struct rpmsg_info *info; in imx_rpmsg_pcm_work() local
631 info = work_of_rpmsg->info; in imx_rpmsg_pcm_work()
639 spin_lock_irqsave(&info->lock[TX], flags); in imx_rpmsg_pcm_work()
640 if (info->notify_updated[TX]) { in imx_rpmsg_pcm_work()
641 memcpy(&msg, &info->notify[TX], sizeof(struct rpmsg_s_msg)); in imx_rpmsg_pcm_work()
642 info->notify_updated[TX] = false; in imx_rpmsg_pcm_work()
643 spin_unlock_irqrestore(&info->lock[TX], flags); in imx_rpmsg_pcm_work()
644 info->send_message(&msg, info); in imx_rpmsg_pcm_work()
646 spin_unlock_irqrestore(&info->lock[TX], flags); in imx_rpmsg_pcm_work()
649 spin_lock_irqsave(&info->lock[RX], flags); in imx_rpmsg_pcm_work()
650 if (info->notify_updated[RX]) { in imx_rpmsg_pcm_work()
651 memcpy(&msg, &info->notify[RX], sizeof(struct rpmsg_s_msg)); in imx_rpmsg_pcm_work()
652 info->notify_updated[RX] = false; in imx_rpmsg_pcm_work()
653 spin_unlock_irqrestore(&info->lock[RX], flags); in imx_rpmsg_pcm_work()
654 info->send_message(&msg, info); in imx_rpmsg_pcm_work()
656 spin_unlock_irqrestore(&info->lock[RX], flags); in imx_rpmsg_pcm_work()
666 info->send_message(&work_of_rpmsg->msg, info); in imx_rpmsg_pcm_work()
669 spin_lock_irqsave(&info->wq_lock, flags); in imx_rpmsg_pcm_work()
670 info->work_read_index++; in imx_rpmsg_pcm_work()
671 info->work_read_index %= WORK_MAX_NUM; in imx_rpmsg_pcm_work()
672 spin_unlock_irqrestore(&info->wq_lock, flags); in imx_rpmsg_pcm_work()
678 struct rpmsg_info *info; in imx_rpmsg_pcm_probe() local
681 info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); in imx_rpmsg_pcm_probe()
682 if (!info) in imx_rpmsg_pcm_probe()
685 platform_set_drvdata(pdev, info); in imx_rpmsg_pcm_probe()
687 info->rpdev = container_of(pdev->dev.parent, struct rpmsg_device, dev); in imx_rpmsg_pcm_probe()
688 info->dev = &pdev->dev; in imx_rpmsg_pcm_probe()
690 info->rpmsg_wq = alloc_ordered_workqueue(info->rpdev->id.name, in imx_rpmsg_pcm_probe()
694 if (!info->rpmsg_wq) { in imx_rpmsg_pcm_probe()
700 info->work_write_index = 1; in imx_rpmsg_pcm_probe()
701 info->send_message = imx_rpmsg_pcm_send_message; in imx_rpmsg_pcm_probe()
704 INIT_WORK(&info->work_list[i].work, imx_rpmsg_pcm_work); in imx_rpmsg_pcm_probe()
705 info->work_list[i].info = info; in imx_rpmsg_pcm_probe()
710 info->msg[i].s_msg.header.cate = IMX_RPMSG_AUDIO; in imx_rpmsg_pcm_probe()
711 info->msg[i].s_msg.header.major = IMX_RMPSG_MAJOR; in imx_rpmsg_pcm_probe()
712 info->msg[i].s_msg.header.minor = IMX_RMPSG_MINOR; in imx_rpmsg_pcm_probe()
713 info->msg[i].s_msg.header.type = MSG_TYPE_A; in imx_rpmsg_pcm_probe()
714 info->msg[i].s_msg.param.audioindex = 0; in imx_rpmsg_pcm_probe()
717 init_completion(&info->cmd_complete); in imx_rpmsg_pcm_probe()
718 mutex_init(&info->msg_lock); in imx_rpmsg_pcm_probe()
719 spin_lock_init(&info->lock[TX]); in imx_rpmsg_pcm_probe()
720 spin_lock_init(&info->lock[RX]); in imx_rpmsg_pcm_probe()
721 spin_lock_init(&info->wq_lock); in imx_rpmsg_pcm_probe()
736 component->name = info->rpdev->id.name; in imx_rpmsg_pcm_probe()
745 if (info->rpmsg_wq) in imx_rpmsg_pcm_probe()
746 destroy_workqueue(info->rpmsg_wq); in imx_rpmsg_pcm_probe()
753 struct rpmsg_info *info = platform_get_drvdata(pdev); in imx_rpmsg_pcm_remove() local
755 if (info->rpmsg_wq) in imx_rpmsg_pcm_remove()
756 destroy_workqueue(info->rpmsg_wq); in imx_rpmsg_pcm_remove()
762 struct rpmsg_info *info = dev_get_drvdata(dev); in imx_rpmsg_pcm_runtime_resume() local
764 cpu_latency_qos_add_request(&info->pm_qos_req, 0); in imx_rpmsg_pcm_runtime_resume()
771 struct rpmsg_info *info = dev_get_drvdata(dev); in imx_rpmsg_pcm_runtime_suspend() local
773 cpu_latency_qos_remove_request(&info->pm_qos_req); in imx_rpmsg_pcm_runtime_suspend()
782 struct rpmsg_info *info = dev_get_drvdata(dev); in imx_rpmsg_pcm_suspend() local
786 rpmsg_tx = &info->msg[TX_SUSPEND]; in imx_rpmsg_pcm_suspend()
787 rpmsg_rx = &info->msg[RX_SUSPEND]; in imx_rpmsg_pcm_suspend()
790 info->send_message(rpmsg_tx, info); in imx_rpmsg_pcm_suspend()
793 info->send_message(rpmsg_rx, info); in imx_rpmsg_pcm_suspend()
800 struct rpmsg_info *info = dev_get_drvdata(dev); in imx_rpmsg_pcm_resume() local
804 rpmsg_tx = &info->msg[TX_RESUME]; in imx_rpmsg_pcm_resume()
805 rpmsg_rx = &info->msg[RX_RESUME]; in imx_rpmsg_pcm_resume()
808 info->send_message(rpmsg_tx, info); in imx_rpmsg_pcm_resume()
811 info->send_message(rpmsg_rx, info); in imx_rpmsg_pcm_resume()