Lines Matching full:controller

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