Lines Matching refs:dir

58 static inline int hw_ep_bit(int num, int dir)  in hw_ep_bit()  argument
60 return num + ((dir == TX) ? 16 : 0); in hw_ep_bit()
101 static int hw_ep_flush(struct ci_hdrc *ci, int num, int dir) in hw_ep_flush() argument
103 int n = hw_ep_bit(num, dir); in hw_ep_flush()
123 static int hw_ep_disable(struct ci_hdrc *ci, int num, int dir) in hw_ep_disable() argument
126 (dir == TX) ? ENDPTCTRL_TXE : ENDPTCTRL_RXE, 0); in hw_ep_disable()
139 static int hw_ep_enable(struct ci_hdrc *ci, int num, int dir, int type) in hw_ep_enable() argument
143 if (dir == TX) { in hw_ep_enable()
174 static int hw_ep_get_halt(struct ci_hdrc *ci, int num, int dir) in hw_ep_get_halt() argument
176 u32 mask = (dir == TX) ? ENDPTCTRL_TXS : ENDPTCTRL_RXS; in hw_ep_get_halt()
190 static int hw_ep_prime(struct ci_hdrc *ci, int num, int dir, int is_ctrl) in hw_ep_prime() argument
192 int n = hw_ep_bit(num, dir); in hw_ep_prime()
197 if (is_ctrl && dir == RX && hw_read(ci, OP_ENDPTSETUPSTAT, BIT(num))) in hw_ep_prime()
204 if (is_ctrl && dir == RX && hw_read(ci, OP_ENDPTSETUPSTAT, BIT(num))) in hw_ep_prime()
221 static int hw_ep_set_halt(struct ci_hdrc *ci, int num, int dir, int value) in hw_ep_set_halt() argument
228 u32 mask_xs = (dir == TX) ? ENDPTCTRL_TXS : ENDPTCTRL_RXS; in hw_ep_set_halt()
229 u32 mask_xr = (dir == TX) ? ENDPTCTRL_TXR : ENDPTCTRL_RXR; in hw_ep_set_halt()
234 } while (value != hw_ep_get_halt(ci, num, dir)); in hw_ep_set_halt()
374 if (hwep->type == USB_ENDPOINT_XFER_ISOC && hwep->dir == TX) { in add_td_to_list()
420 return ((ep->dir == TX) ? USB_ENDPOINT_DIR_MASK : 0) | ep->num; in _usb_addr()
454 if (hwreq->req.zero && hwreq->req.length && hwep->dir == TX in prepare_td_for_non_sg()
560 &hwreq->req, hwep->dir); in _hardware_enqueue()
585 int n = hw_ep_bit(hwep->num, hwep->dir); in _hardware_enqueue()
613 if (hwep->type == USB_ENDPOINT_XFER_ISOC && hwep->dir == RX) { in _hardware_enqueue()
622 ret = hw_ep_prime(ci, hwep->num, hwep->dir, in _hardware_enqueue()
648 return hw_ep_prime(ci, hwep->num, hwep->dir, in reprime_dtd()
675 int n = hw_ep_bit(hwep->num, hwep->dir); in _hardware_dequeue()
701 if (hwep->dir == TX) { in _hardware_dequeue()
719 &hwreq->req, hwep->dir); in _hardware_dequeue()
744 hw_ep_flush(hwep->ci, hwep->num, hwep->dir); in _ep_nuke()
789 if (value && hwep->dir == TX && check_transfer && in _ep_set_halt()
796 direction = hwep->dir; in _ep_set_halt()
798 retval |= hw_ep_set_halt(hwep->ci, hwep->num, hwep->dir, value); in _ep_set_halt()
804 hwep->dir = (hwep->dir == TX) ? RX : TX; in _ep_set_halt()
806 } while (hwep->dir != direction); in _ep_set_halt()
977 int dir, num, retval; in isr_get_status_response() local
1001 dir = (le16_to_cpu(setup->wIndex) & USB_ENDPOINT_DIR_MASK) ? in isr_get_status_response()
1004 *(u16 *)req->buf = hw_ep_get_halt(ci, num, dir); in isr_get_status_response()
1135 int type, num, dir, err = -EINVAL; in isr_setup_packet_handler() local
1163 dir = (num & USB_ENDPOINT_DIR_MASK) ? TX : RX; in isr_setup_packet_handler()
1165 if (dir == TX) in isr_setup_packet_handler()
1215 dir = (num & USB_ENDPOINT_DIR_MASK) ? TX : RX; in isr_setup_packet_handler()
1217 if (dir == TX) in isr_setup_packet_handler()
1365 hwep->dir = usb_endpoint_dir_in(desc) ? TX : RX; in ep_enable()
1381 if (hwep->type == USB_ENDPOINT_XFER_ISOC && hwep->dir == TX) in ep_enable()
1398 retval |= hw_ep_enable(hwep->ci, hwep->num, hwep->dir, in ep_enable()
1429 direction = hwep->dir; in ep_disable()
1432 retval |= hw_ep_disable(hwep->ci, hwep->num, hwep->dir); in ep_disable()
1435 hwep->dir = (hwep->dir == TX) ? RX : TX; in ep_disable()
1437 } while (hwep->dir != direction); in ep_disable()
1543 hw_ep_flush(hwep->ci, hwep->num, hwep->dir); in ep_dequeue()
1554 usb_gadget_unmap_request(&hwep->ci->gadget, req, hwep->dir); in ep_dequeue()
1619 hw_ep_flush(hwep->ci, hwep->num, hwep->dir); in ep_fifo_flush()