Lines Matching refs:epn
69 if (ep->epn.is_in) { in ast_vhub_epn_kick()
73 writel(ep->buf_dma, ep->epn.regs + AST_VHUB_EP_DESC_BASE); in ast_vhub_epn_kick()
75 if (ep->epn.is_in) in ast_vhub_epn_kick()
77 writel(req->req.dma + act, ep->epn.regs + AST_VHUB_EP_DESC_BASE); in ast_vhub_epn_kick()
83 ep->epn.regs + AST_VHUB_EP_DESC_STATUS); in ast_vhub_epn_kick()
85 ep->epn.regs + AST_VHUB_EP_DESC_STATUS); in ast_vhub_epn_kick()
95 stat = readl(ep->epn.regs + AST_VHUB_EP_DESC_STATUS); in ast_vhub_epn_handle_ack()
101 stat, ep->epn.is_in, req, req ? req->active : 0); in ast_vhub_epn_handle_ack()
127 if (!req->req.dma && !ep->epn.is_in && len) in ast_vhub_epn_handle_ack()
162 return (ep->epn.d_last + AST_VHUB_DESCS_COUNT - ep->epn.d_next - 1) & in ast_vhub_count_free_descs()
182 act, len, ep->epn.chunk_max, ast_vhub_count_free_descs(ep)); in ast_vhub_epn_kick_desc()
189 d_num = ep->epn.d_next; in ast_vhub_epn_kick_desc()
190 desc = &ep->epn.descs[d_num]; in ast_vhub_epn_kick_desc()
191 ep->epn.d_next = (d_num + 1) & (AST_VHUB_DESCS_COUNT - 1); in ast_vhub_epn_kick_desc()
195 if (chunk <= ep->epn.chunk_max) { in ast_vhub_epn_kick_desc()
207 chunk = ep->epn.chunk_max; in ast_vhub_epn_kick_desc()
239 writel(VHUB_EP_DMA_SET_CPU_WPTR(ep->epn.d_next), in ast_vhub_epn_kick_desc()
240 ep->epn.regs + AST_VHUB_EP_DESC_STATUS); in ast_vhub_epn_kick_desc()
243 ep->epn.d_next, readl(ep->epn.regs + AST_VHUB_EP_DESC_STATUS)); in ast_vhub_epn_kick_desc()
254 stat = readl(ep->epn.regs + AST_VHUB_EP_DESC_STATUS); in ast_vhub_epn_handle_ack_desc()
255 stat1 = readl(ep->epn.regs + AST_VHUB_EP_DESC_STATUS); in ast_vhub_epn_handle_ack_desc()
265 stat, ep->epn.is_in, ep->epn.d_last, d_last); in ast_vhub_epn_handle_ack_desc()
268 while (ep->epn.d_last != d_last) { in ast_vhub_epn_handle_ack_desc()
274 d_num = ep->epn.d_last; in ast_vhub_epn_handle_ack_desc()
275 desc = &ep->epn.descs[d_num]; in ast_vhub_epn_handle_ack_desc()
276 ep->epn.d_last = (d_num + 1) & (AST_VHUB_DESCS_COUNT - 1); in ast_vhub_epn_handle_ack_desc()
307 CHECK(ep, d_last == ep->epn.d_last, in ast_vhub_epn_handle_ack_desc()
309 d_last, ep->epn.d_last); in ast_vhub_epn_handle_ack_desc()
327 if (ep->epn.desc_mode) in ast_vhub_epn_ack_irq()
354 if (!ep->epn.enabled || !u_ep->desc || !ep->dev || !ep->d_idx || in ast_vhub_epn_queue()
376 if (ep->epn.desc_mode || in ast_vhub_epn_queue()
378 (ep->epn.is_in || !(u_req->length & (u_ep->maxpacket - 1))))) { in ast_vhub_epn_queue()
380 ep->epn.is_in); in ast_vhub_epn_queue()
393 ep->epn.is_in); in ast_vhub_epn_queue()
407 if (ep->epn.desc_mode) in ast_vhub_epn_queue()
423 writel(0, ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_stop_active_req()
427 state = readl(ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_stop_active_req()
442 if (ep->epn.desc_mode) { in ast_vhub_stop_active_req()
453 reg = VHUB_EP_DMA_SET_RPTR(ep->epn.d_next) | in ast_vhub_stop_active_req()
454 VHUB_EP_DMA_SET_CPU_WPTR(ep->epn.d_next); in ast_vhub_stop_active_req()
455 writel(reg, ep->epn.regs + AST_VHUB_EP_DESC_STATUS); in ast_vhub_stop_active_req()
458 writel(ep->epn.dma_conf, in ast_vhub_stop_active_req()
459 ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_stop_active_req()
462 writel(ep->epn.dma_conf, in ast_vhub_stop_active_req()
463 ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_stop_active_req()
502 reg = readl(ep->epn.regs + AST_VHUB_EP_CONFIG); in ast_vhub_update_epn_stall()
503 if (ep->epn.stalled || ep->epn.wedged) in ast_vhub_update_epn_stall()
507 writel(reg, ep->epn.regs + AST_VHUB_EP_CONFIG); in ast_vhub_update_epn_stall()
509 if (!ep->epn.stalled && !ep->epn.wedged) in ast_vhub_update_epn_stall()
510 writel(VHUB_EP_TOGGLE_SET_EPNUM(ep->epn.g_idx), in ast_vhub_update_epn_stall()
527 if (ep->epn.is_iso) in ast_vhub_set_halt_and_wedge()
533 if (halt && ep->epn.is_in && !list_empty(&ep->queue)) { in ast_vhub_set_halt_and_wedge()
537 ep->epn.stalled = halt; in ast_vhub_set_halt_and_wedge()
538 ep->epn.wedged = wedge; in ast_vhub_set_halt_and_wedge()
567 ep->epn.enabled = false; in ast_vhub_epn_disable()
573 writel(0, ep->epn.regs + AST_VHUB_EP_CONFIG); in ast_vhub_epn_disable()
576 imask = VHUB_EP_IRQ(ep->epn.g_idx); in ast_vhub_epn_disable()
621 if (ep->epn.enabled) { in ast_vhub_epn_enable()
636 ep->epn.is_in = usb_endpoint_dir_in(desc); in ast_vhub_epn_enable()
639 ep->epn.d_next = ep->epn.d_last = 0; in ast_vhub_epn_enable()
640 ep->epn.is_iso = false; in ast_vhub_epn_enable()
641 ep->epn.stalled = false; in ast_vhub_epn_enable()
642 ep->epn.wedged = false; in ast_vhub_epn_enable()
645 ep->epn.is_in ? "in" : "out", usb_ep_type_string(type), in ast_vhub_epn_enable()
649 ep->epn.desc_mode = ep->epn.descs && ep->epn.is_in; in ast_vhub_epn_enable()
650 if (ep->epn.desc_mode) in ast_vhub_epn_enable()
651 memset(ep->epn.descs, 0, 8 * AST_VHUB_DESCS_COUNT); in ast_vhub_epn_enable()
657 ep->epn.chunk_max = ep->ep.maxpacket; in ast_vhub_epn_enable()
658 if (ep->epn.is_in) { in ast_vhub_epn_enable()
659 ep->epn.chunk_max <<= 3; in ast_vhub_epn_enable()
660 while (ep->epn.chunk_max > 4095) in ast_vhub_epn_enable()
661 ep->epn.chunk_max -= ep->ep.maxpacket; in ast_vhub_epn_enable()
676 ep->epn.is_iso = true; in ast_vhub_epn_enable()
685 if (!ep->epn.is_in) in ast_vhub_epn_enable()
695 writel(0, ep->epn.regs + AST_VHUB_EP_CONFIG); in ast_vhub_epn_enable()
697 ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_epn_enable()
700 writel(ep_conf, ep->epn.regs + AST_VHUB_EP_CONFIG); in ast_vhub_epn_enable()
702 if (ep->epn.desc_mode) { in ast_vhub_epn_enable()
704 writel(0, ep->epn.regs + AST_VHUB_EP_DESC_STATUS); in ast_vhub_epn_enable()
707 writel(ep->epn.descs_dma, in ast_vhub_epn_enable()
708 ep->epn.regs + AST_VHUB_EP_DESC_BASE); in ast_vhub_epn_enable()
711 ep->epn.dma_conf = VHUB_EP_DMA_DESC_MODE; in ast_vhub_epn_enable()
712 if (ep->epn.is_in) in ast_vhub_epn_enable()
713 ep->epn.dma_conf |= VHUB_EP_DMA_IN_LONG_MODE; in ast_vhub_epn_enable()
716 writel(ep->epn.dma_conf | VHUB_EP_DMA_CTRL_RESET, in ast_vhub_epn_enable()
717 ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_epn_enable()
720 writel(ep->epn.dma_conf, in ast_vhub_epn_enable()
721 ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_epn_enable()
724 ep->epn.dma_conf = VHUB_EP_DMA_SINGLE_STAGE; in ast_vhub_epn_enable()
727 writel(ep->epn.dma_conf | VHUB_EP_DMA_CTRL_RESET, in ast_vhub_epn_enable()
728 ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_epn_enable()
729 writel(ep->epn.dma_conf, in ast_vhub_epn_enable()
730 ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_epn_enable()
731 writel(0, ep->epn.regs + AST_VHUB_EP_DESC_STATUS); in ast_vhub_epn_enable()
735 writel(VHUB_EP_TOGGLE_SET_EPNUM(ep->epn.g_idx), in ast_vhub_epn_enable()
739 imask = VHUB_EP_IRQ(ep->epn.g_idx); in ast_vhub_epn_enable()
746 ep->epn.enabled = true; in ast_vhub_epn_enable()
776 ep->epn.descs = NULL; in ast_vhub_epn_dispose()
823 ep->epn.g_idx = i; in ast_vhub_alloc_epn()
824 ep->epn.regs = vhub->regs + 0x200 + (i * 0x10); in ast_vhub_alloc_epn()
835 ep->epn.descs = ep->buf + AST_VHUB_EPn_MAX_PACKET; in ast_vhub_alloc_epn()
836 ep->epn.descs_dma = ep->buf_dma + AST_VHUB_EPn_MAX_PACKET; in ast_vhub_alloc_epn()