Lines Matching refs:dir

61 static inline int hw_ep_bit(int num, int dir)  in hw_ep_bit()  argument
63 return num + (dir ? 16 : 0); in hw_ep_bit()
102 static int hw_ep_flush(struct ci_hdrc *ci, int num, int dir) in hw_ep_flush() argument
104 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
125 hw_ep_flush(ci, num, dir); in hw_ep_disable()
127 dir ? 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) { in hw_ep_enable()
173 static int hw_ep_get_halt(struct ci_hdrc *ci, int num, int dir) in hw_ep_get_halt() argument
175 u32 mask = dir ? ENDPTCTRL_TXS : ENDPTCTRL_RXS; in hw_ep_get_halt()
188 static int hw_ep_prime(struct ci_hdrc *ci, int num, int dir, int is_ctrl) in hw_ep_prime() argument
190 int n = hw_ep_bit(num, dir); in hw_ep_prime()
192 if (is_ctrl && dir == RX && hw_read(ci, OP_ENDPTSETUPSTAT, BIT(num))) in hw_ep_prime()
199 if (is_ctrl && dir == RX && hw_read(ci, OP_ENDPTSETUPSTAT, BIT(num))) in hw_ep_prime()
215 static int hw_ep_set_halt(struct ci_hdrc *ci, int num, int dir, int value) in hw_ep_set_halt() argument
222 u32 mask_xs = dir ? ENDPTCTRL_TXS : ENDPTCTRL_RXS; in hw_ep_set_halt()
223 u32 mask_xr = dir ? ENDPTCTRL_TXR : ENDPTCTRL_RXR; in hw_ep_set_halt()
228 } while (value != hw_ep_get_halt(ci, num, dir)); in hw_ep_set_halt()
363 if (hwep->type == USB_ENDPOINT_XFER_ISOC && hwep->dir == TX) { in add_td_to_list()
403 return ((ep->dir == TX) ? USB_ENDPOINT_DIR_MASK : 0) | ep->num; in _usb_addr()
427 ret = usb_gadget_map_request(&ci->gadget, &hwreq->req, hwep->dir); in _hardware_enqueue()
448 if (hwreq->req.zero && hwreq->req.length && hwep->dir == TX in _hardware_enqueue()
465 int n = hw_ep_bit(hwep->num, hwep->dir); in _hardware_enqueue()
493 if (hwep->type == USB_ENDPOINT_XFER_ISOC && hwep->dir == RX) { in _hardware_enqueue()
504 ret = hw_ep_prime(ci, hwep->num, hwep->dir, in _hardware_enqueue()
533 return hw_ep_prime(ci, hwep->num, hwep->dir, in reprime_dtd()
560 int n = hw_ep_bit(hwep->num, hwep->dir); in _hardware_dequeue()
586 if (hwep->dir) { in _hardware_dequeue()
603 usb_gadget_unmap_request(&hwep->ci->gadget, &hwreq->req, hwep->dir); in _hardware_dequeue()
628 hw_ep_flush(hwep->ci, hwep->num, hwep->dir); in _ep_nuke()
673 if (value && hwep->dir == TX && check_transfer && in _ep_set_halt()
680 direction = hwep->dir; in _ep_set_halt()
682 retval |= hw_ep_set_halt(hwep->ci, hwep->num, hwep->dir, value); in _ep_set_halt()
688 hwep->dir = (hwep->dir == TX) ? RX : TX; in _ep_set_halt()
690 } while (hwep->dir != direction); in _ep_set_halt()
858 int dir, num, retval; in isr_get_status_response() local
882 dir = (le16_to_cpu(setup->wIndex) & USB_ENDPOINT_DIR_MASK) ? in isr_get_status_response()
885 *(u16 *)req->buf = hw_ep_get_halt(ci, num, dir); in isr_get_status_response()
1007 int type, num, dir, err = -EINVAL; in isr_setup_packet_handler() local
1035 dir = num & USB_ENDPOINT_DIR_MASK; in isr_setup_packet_handler()
1037 if (dir) /* TX */ in isr_setup_packet_handler()
1086 dir = num & USB_ENDPOINT_DIR_MASK; in isr_setup_packet_handler()
1088 if (dir) /* TX */ in isr_setup_packet_handler()
1236 hwep->dir = usb_endpoint_dir_in(desc) ? TX : RX; in ep_enable()
1252 if (hwep->type == USB_ENDPOINT_XFER_ISOC && hwep->dir == TX) in ep_enable()
1269 retval |= hw_ep_enable(hwep->ci, hwep->num, hwep->dir, in ep_enable()
1296 direction = hwep->dir; in ep_disable()
1299 retval |= hw_ep_disable(hwep->ci, hwep->num, hwep->dir); in ep_disable()
1302 hwep->dir = (hwep->dir == TX) ? RX : TX; in ep_disable()
1304 } while (hwep->dir != direction); in ep_disable()
1406 hw_ep_flush(hwep->ci, hwep->num, hwep->dir); in ep_dequeue()
1417 usb_gadget_unmap_request(&hwep->ci->gadget, req, hwep->dir); in ep_dequeue()
1478 hw_ep_flush(hwep->ci, hwep->num, hwep->dir); in ep_fifo_flush()