Lines Matching full:controller
3 * MUSB OTG driver - support for Mentor's DMA controller
55 struct musb_dma_controller *controller; member
65 struct dma_controller controller; member
76 static void dma_controller_stop(struct musb_dma_controller *controller) in dma_controller_stop() argument
78 struct musb *musb = controller->private_data; in dma_controller_stop()
82 if (controller->used_channels != 0) { in dma_controller_stop()
83 dev_err(musb->controller, in dma_controller_stop()
84 "Stopping DMA controller while channel active\n"); in dma_controller_stop()
87 if (controller->used_channels & (1 << bit)) { in dma_controller_stop()
88 channel = &controller->channel[bit].channel; in dma_controller_stop()
91 if (!controller->used_channels) in dma_controller_stop()
101 struct musb_dma_controller *controller = container_of(c, in dma_channel_allocate() local
102 struct musb_dma_controller, controller); in dma_channel_allocate()
108 if (!(controller->used_channels & (1 << bit))) { in dma_channel_allocate()
109 controller->used_channels |= (1 << bit); in dma_channel_allocate()
110 musb_channel = &(controller->channel[bit]); in dma_channel_allocate()
111 musb_channel->controller = controller; in dma_channel_allocate()
137 musb_channel->controller->used_channels &= in dma_channel_release()
148 struct musb_dma_controller *controller = musb_channel->controller; in configure_channel() local
149 struct musb *musb = controller->private_data; in configure_channel()
150 void __iomem *mbase = controller->base; in configure_channel()
186 struct musb_dma_controller *controller = musb_channel->controller; in dma_channel_program() local
187 struct musb *musb = controller->private_data; in dma_channel_program()
223 void __iomem *mbase = musb_channel->controller->base; in dma_channel_abort()
224 struct musb *musb = musb_channel->controller->private_data; in dma_channel_abort()
268 struct musb_dma_controller *controller = private_data; in dma_controller_irq() local
269 struct musb *musb = controller->private_data; in dma_controller_irq()
273 void __iomem *mbase = controller->base; in dma_controller_irq()
294 &(controller->channel[bchannel]); in dma_controller_irq()
313 &(controller->channel[bchannel]); in dma_controller_irq()
381 struct musb_dma_controller *controller = container_of(c, in musbhs_dma_controller_destroy() local
382 struct musb_dma_controller, controller); in musbhs_dma_controller_destroy()
384 dma_controller_stop(controller); in musbhs_dma_controller_destroy()
386 if (controller->irq) in musbhs_dma_controller_destroy()
387 free_irq(controller->irq, c); in musbhs_dma_controller_destroy()
389 kfree(controller); in musbhs_dma_controller_destroy()
396 struct musb_dma_controller *controller; in dma_controller_alloc() local
398 controller = kzalloc(sizeof(*controller), GFP_KERNEL); in dma_controller_alloc()
399 if (!controller) in dma_controller_alloc()
402 controller->channel_count = MUSB_HSDMA_CHANNELS; in dma_controller_alloc()
403 controller->private_data = musb; in dma_controller_alloc()
404 controller->base = base; in dma_controller_alloc()
406 controller->controller.channel_alloc = dma_channel_allocate; in dma_controller_alloc()
407 controller->controller.channel_release = dma_channel_release; in dma_controller_alloc()
408 controller->controller.channel_program = dma_channel_program; in dma_controller_alloc()
409 controller->controller.channel_abort = dma_channel_abort; in dma_controller_alloc()
410 return controller; in dma_controller_alloc()
416 struct musb_dma_controller *controller; in musbhs_dma_controller_create() local
417 struct device *dev = musb->controller; in musbhs_dma_controller_create()
426 controller = dma_controller_alloc(musb, base); in musbhs_dma_controller_create()
427 if (!controller) in musbhs_dma_controller_create()
431 dev_name(musb->controller), controller)) { in musbhs_dma_controller_create()
433 musb_dma_controller_destroy(&controller->controller); in musbhs_dma_controller_create()
438 controller->irq = irq; in musbhs_dma_controller_create()
440 return &controller->controller; in musbhs_dma_controller_create()
447 struct musb_dma_controller *controller; in musbhs_dma_controller_create_noirq() local
449 controller = dma_controller_alloc(musb, base); in musbhs_dma_controller_create_noirq()
450 if (!controller) in musbhs_dma_controller_create_noirq()
453 return &controller->controller; in musbhs_dma_controller_create_noirq()