Lines Matching refs:controller

37 	struct dma_controller controller;
61 if (!is_host_active(cppi41_channel->controller->controller.musb))
187 struct cppi41_dma_controller *controller;
193 controller = container_of(timer, struct cppi41_dma_controller,
195 musb = controller->controller.musb;
198 list_for_each_entry_safe(cppi41_channel, n, &controller->early_tx_list,
210 if (!list_empty(&controller->early_tx_list) &&
211 !hrtimer_is_queued(&controller->early_tx)) {
213 hrtimer_forward_now(&controller->early_tx, 20 * NSEC_PER_USEC);
226 struct cppi41_dma_controller *controller;
234 controller = cppi41_channel->controller;
235 if (controller->controller.dma_callback)
236 controller->controller.dma_callback(&controller->controller);
315 &controller->early_tx_list);
316 if (!hrtimer_is_queued(&controller->early_tx)) {
319 hrtimer_start_range_ns(&controller->early_tx,
342 struct cppi41_dma_controller *controller = cppi41_channel->controller;
343 struct musb *musb = controller->controller.musb;
349 old_mode = controller->tx_mode;
351 old_mode = controller->rx_mode;
358 controller->tx_mode = new_mode;
361 controller->rx_mode = new_mode;
369 struct cppi41_dma_controller *controller = cppi41_channel->controller;
370 struct musb *musb = controller->controller.musb;
376 old_mode = controller->tx_mode;
387 controller->tx_mode = new_mode;
395 struct cppi41_dma_controller *controller = cppi41_channel->controller;
400 old_mode = controller->auto_req;
406 controller->auto_req = new_mode;
407 musb_writel(controller->controller.musb->ctrl_base,
408 controller->autoreq_reg, new_mode);
416 struct cppi41_dma_controller *controller = cppi41_channel->controller;
420 struct musb *musb = cppi41_channel->controller->controller.musb;
442 controller->set_dma_mode(cppi41_channel,
451 controller->set_dma_mode(cppi41_channel,
458 controller->set_dma_mode(cppi41_channel,
485 struct cppi41_dma_controller *controller = container_of(c,
486 struct cppi41_dma_controller, controller);
490 if (ch_num >= controller->num_channels)
494 cppi41_channel = &controller->tx_channel[ch_num];
496 cppi41_channel = &controller->rx_channel[ch_num];
534 if (is_host_active(cppi41_channel->controller->controller.musb)) {
558 struct cppi41_dma_controller *controller = cppi41_channel->controller;
559 struct musb *musb = controller->controller.musb;
576 struct cppi41_dma_controller *controller = cppi41_channel->controller;
577 struct musb *musb = controller->controller.musb;
626 musb_writel(musb->ctrl_base, controller->tdown_reg,
632 musb_writel(musb->ctrl_base, controller->tdown_reg, tdbit);
660 static void cppi41_dma_controller_stop(struct cppi41_dma_controller *controller)
662 cppi41_release_all_dma_chans(controller);
665 static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller)
667 struct musb *musb = controller->controller.musb;
668 struct device *dev = musb->controller;
702 if (port > controller->num_channels || !port)
705 cppi41_channel = &controller->tx_channel[port - 1];
707 cppi41_channel = &controller->rx_channel[port - 1];
709 cppi41_channel->controller = controller;
730 cppi41_release_all_dma_chans(controller);
736 struct cppi41_dma_controller *controller = container_of(c,
737 struct cppi41_dma_controller, controller);
739 hrtimer_cancel(&controller->early_tx);
740 cppi41_dma_controller_stop(controller);
741 kfree(controller->rx_channel);
742 kfree(controller->tx_channel);
743 kfree(controller);
750 struct cppi41_dma_controller *controller;
754 if (!musb->controller->parent->of_node) {
755 dev_err(musb->controller, "Need DT for the DMA engine.\n");
759 controller = kzalloc(sizeof(*controller), GFP_KERNEL);
760 if (!controller)
763 hrtimer_setup(&controller->early_tx, cppi41_recheck_tx_req, CLOCK_MONOTONIC,
765 INIT_LIST_HEAD(&controller->early_tx_list);
767 controller->controller.channel_alloc = cppi41_dma_channel_allocate;
768 controller->controller.channel_release = cppi41_dma_channel_release;
769 controller->controller.channel_program = cppi41_dma_channel_program;
770 controller->controller.channel_abort = cppi41_dma_channel_abort;
771 controller->controller.is_compatible = cppi41_is_compatible;
772 controller->controller.musb = musb;
775 controller->tdown_reg = DA8XX_USB_TEARDOWN;
776 controller->autoreq_reg = DA8XX_USB_AUTOREQ;
777 controller->set_dma_mode = da8xx_set_dma_mode;
778 controller->num_channels = DA8XX_DMA_NUM_CHANNELS;
780 controller->tdown_reg = USB_TDOWN;
781 controller->autoreq_reg = USB_CTRL_AUTOREQ;
782 controller->set_dma_mode = cppi41_set_dma_mode;
783 controller->num_channels = MUSB_DMA_NUM_CHANNELS;
786 channel_size = controller->num_channels *
788 controller->rx_channel = kzalloc(channel_size, GFP_KERNEL);
789 if (!controller->rx_channel)
791 controller->tx_channel = kzalloc(channel_size, GFP_KERNEL);
792 if (!controller->tx_channel)
795 ret = cppi41_dma_controller_start(controller);
798 return &controller->controller;
801 kfree(controller->tx_channel);
803 kfree(controller->rx_channel);
805 kfree(controller);