• Home
  • Raw
  • Download

Lines Matching refs:epn

64 		if (ep->epn.is_in) {  in ast_vhub_epn_kick()
68 writel(ep->buf_dma, ep->epn.regs + AST_VHUB_EP_DESC_BASE); in ast_vhub_epn_kick()
70 if (ep->epn.is_in) in ast_vhub_epn_kick()
72 writel(req->req.dma + act, ep->epn.regs + AST_VHUB_EP_DESC_BASE); in ast_vhub_epn_kick()
78 ep->epn.regs + AST_VHUB_EP_DESC_STATUS); in ast_vhub_epn_kick()
80 ep->epn.regs + AST_VHUB_EP_DESC_STATUS); in ast_vhub_epn_kick()
90 stat = readl(ep->epn.regs + AST_VHUB_EP_DESC_STATUS); in ast_vhub_epn_handle_ack()
96 stat, ep->epn.is_in, req, req ? req->active : 0); in ast_vhub_epn_handle_ack()
122 if (!req->req.dma && !ep->epn.is_in && len) in ast_vhub_epn_handle_ack()
157 return (ep->epn.d_last + AST_VHUB_DESCS_COUNT - ep->epn.d_next - 1) & in ast_vhub_count_free_descs()
177 act, len, ep->epn.chunk_max, ast_vhub_count_free_descs(ep)); in ast_vhub_epn_kick_desc()
184 d_num = ep->epn.d_next; in ast_vhub_epn_kick_desc()
185 desc = &ep->epn.descs[d_num]; in ast_vhub_epn_kick_desc()
186 ep->epn.d_next = (d_num + 1) & (AST_VHUB_DESCS_COUNT - 1); in ast_vhub_epn_kick_desc()
190 if (chunk <= ep->epn.chunk_max) { in ast_vhub_epn_kick_desc()
202 chunk = ep->epn.chunk_max; in ast_vhub_epn_kick_desc()
234 writel(VHUB_EP_DMA_SET_CPU_WPTR(ep->epn.d_next), in ast_vhub_epn_kick_desc()
235 ep->epn.regs + AST_VHUB_EP_DESC_STATUS); in ast_vhub_epn_kick_desc()
238 ep->epn.d_next, readl(ep->epn.regs + AST_VHUB_EP_DESC_STATUS)); in ast_vhub_epn_kick_desc()
249 stat = readl(ep->epn.regs + AST_VHUB_EP_DESC_STATUS); in ast_vhub_epn_handle_ack_desc()
250 stat1 = readl(ep->epn.regs + AST_VHUB_EP_DESC_STATUS); in ast_vhub_epn_handle_ack_desc()
260 stat, ep->epn.is_in, ep->epn.d_last, d_last); in ast_vhub_epn_handle_ack_desc()
263 while (ep->epn.d_last != d_last) { in ast_vhub_epn_handle_ack_desc()
269 d_num = ep->epn.d_last; in ast_vhub_epn_handle_ack_desc()
270 desc = &ep->epn.descs[d_num]; in ast_vhub_epn_handle_ack_desc()
271 ep->epn.d_last = (d_num + 1) & (AST_VHUB_DESCS_COUNT - 1); in ast_vhub_epn_handle_ack_desc()
302 CHECK(ep, d_last == ep->epn.d_last, in ast_vhub_epn_handle_ack_desc()
304 d_last, ep->epn.d_last); in ast_vhub_epn_handle_ack_desc()
322 if (ep->epn.desc_mode) in ast_vhub_epn_ack_irq()
349 if (!ep->epn.enabled || !u_ep->desc || !ep->dev || !ep->d_idx || in ast_vhub_epn_queue()
371 if (ep->epn.desc_mode || in ast_vhub_epn_queue()
373 (ep->epn.is_in || !(u_req->length & (u_ep->maxpacket - 1))))) { in ast_vhub_epn_queue()
375 ep->epn.is_in); in ast_vhub_epn_queue()
388 ep->epn.is_in); in ast_vhub_epn_queue()
402 if (ep->epn.desc_mode) in ast_vhub_epn_queue()
418 if (ep->epn.desc_mode) in ast_vhub_stop_active_req()
419 writel(VHUB_EP_DMA_CTRL_RESET, ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_stop_active_req()
421 writel(0, ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_stop_active_req()
425 state = readl(ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_stop_active_req()
440 if (ep->epn.desc_mode) { in ast_vhub_stop_active_req()
451 reg = VHUB_EP_DMA_SET_RPTR(ep->epn.d_next) | in ast_vhub_stop_active_req()
452 VHUB_EP_DMA_SET_CPU_WPTR(ep->epn.d_next); in ast_vhub_stop_active_req()
453 writel(reg, ep->epn.regs + AST_VHUB_EP_DESC_STATUS); in ast_vhub_stop_active_req()
456 writel(ep->epn.dma_conf, in ast_vhub_stop_active_req()
457 ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_stop_active_req()
460 writel(ep->epn.dma_conf, in ast_vhub_stop_active_req()
461 ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_stop_active_req()
500 reg = readl(ep->epn.regs + AST_VHUB_EP_CONFIG); in ast_vhub_update_epn_stall()
501 if (ep->epn.stalled || ep->epn.wedged) in ast_vhub_update_epn_stall()
505 writel(reg, ep->epn.regs + AST_VHUB_EP_CONFIG); in ast_vhub_update_epn_stall()
507 if (!ep->epn.stalled && !ep->epn.wedged) in ast_vhub_update_epn_stall()
508 writel(VHUB_EP_TOGGLE_SET_EPNUM(ep->epn.g_idx), in ast_vhub_update_epn_stall()
525 if (ep->epn.is_iso) in ast_vhub_set_halt_and_wedge()
531 if (halt && ep->epn.is_in && !list_empty(&ep->queue)) { in ast_vhub_set_halt_and_wedge()
535 ep->epn.stalled = halt; in ast_vhub_set_halt_and_wedge()
536 ep->epn.wedged = wedge; in ast_vhub_set_halt_and_wedge()
565 ep->epn.enabled = false; in ast_vhub_epn_disable()
571 writel(0, ep->epn.regs + AST_VHUB_EP_CONFIG); in ast_vhub_epn_disable()
574 imask = VHUB_EP_IRQ(ep->epn.g_idx); in ast_vhub_epn_disable()
619 if (ep->epn.enabled) { in ast_vhub_epn_enable()
634 ep->epn.is_in = usb_endpoint_dir_in(desc); in ast_vhub_epn_enable()
637 ep->epn.d_next = ep->epn.d_last = 0; in ast_vhub_epn_enable()
638 ep->epn.is_iso = false; in ast_vhub_epn_enable()
639 ep->epn.stalled = false; in ast_vhub_epn_enable()
640 ep->epn.wedged = false; in ast_vhub_epn_enable()
643 ep->epn.is_in ? "in" : "out", usb_ep_type_string(type), in ast_vhub_epn_enable()
647 ep->epn.desc_mode = ep->epn.descs && ep->epn.is_in; in ast_vhub_epn_enable()
648 if (ep->epn.desc_mode) in ast_vhub_epn_enable()
649 memset(ep->epn.descs, 0, 8 * AST_VHUB_DESCS_COUNT); in ast_vhub_epn_enable()
655 ep->epn.chunk_max = ep->ep.maxpacket; in ast_vhub_epn_enable()
656 if (ep->epn.is_in) { in ast_vhub_epn_enable()
657 ep->epn.chunk_max <<= 3; in ast_vhub_epn_enable()
658 while (ep->epn.chunk_max > 4095) in ast_vhub_epn_enable()
659 ep->epn.chunk_max -= ep->ep.maxpacket; in ast_vhub_epn_enable()
674 ep->epn.is_iso = true; in ast_vhub_epn_enable()
683 if (!ep->epn.is_in) in ast_vhub_epn_enable()
693 writel(0, ep->epn.regs + AST_VHUB_EP_CONFIG); in ast_vhub_epn_enable()
695 ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_epn_enable()
698 writel(ep_conf, ep->epn.regs + AST_VHUB_EP_CONFIG); in ast_vhub_epn_enable()
700 if (ep->epn.desc_mode) { in ast_vhub_epn_enable()
702 writel(0, ep->epn.regs + AST_VHUB_EP_DESC_STATUS); in ast_vhub_epn_enable()
705 writel(ep->epn.descs_dma, in ast_vhub_epn_enable()
706 ep->epn.regs + AST_VHUB_EP_DESC_BASE); in ast_vhub_epn_enable()
709 ep->epn.dma_conf = VHUB_EP_DMA_DESC_MODE; in ast_vhub_epn_enable()
710 if (ep->epn.is_in) in ast_vhub_epn_enable()
711 ep->epn.dma_conf |= VHUB_EP_DMA_IN_LONG_MODE; in ast_vhub_epn_enable()
714 writel(ep->epn.dma_conf | VHUB_EP_DMA_CTRL_RESET, in ast_vhub_epn_enable()
715 ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_epn_enable()
718 writel(ep->epn.dma_conf, in ast_vhub_epn_enable()
719 ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_epn_enable()
722 ep->epn.dma_conf = VHUB_EP_DMA_SINGLE_STAGE; in ast_vhub_epn_enable()
725 writel(ep->epn.dma_conf | VHUB_EP_DMA_CTRL_RESET, in ast_vhub_epn_enable()
726 ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_epn_enable()
727 writel(ep->epn.dma_conf, in ast_vhub_epn_enable()
728 ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT); in ast_vhub_epn_enable()
729 writel(0, ep->epn.regs + AST_VHUB_EP_DESC_STATUS); in ast_vhub_epn_enable()
733 writel(VHUB_EP_TOGGLE_SET_EPNUM(ep->epn.g_idx), in ast_vhub_epn_enable()
737 imask = VHUB_EP_IRQ(ep->epn.g_idx); in ast_vhub_epn_enable()
744 ep->epn.enabled = true; in ast_vhub_epn_enable()
774 ep->epn.descs = NULL; in ast_vhub_epn_dispose()
821 ep->epn.g_idx = i; in ast_vhub_alloc_epn()
822 ep->epn.regs = vhub->regs + 0x200 + (i * 0x10); in ast_vhub_alloc_epn()
833 ep->epn.descs = ep->buf + AST_VHUB_EPn_MAX_PACKET; in ast_vhub_alloc_epn()
834 ep->epn.descs_dma = ep->buf_dma + AST_VHUB_EPn_MAX_PACKET; in ast_vhub_alloc_epn()