Lines Matching defs:handle
217 * handle: PCD handle.
223 static enum usb_status usb_dwc2_flush_tx_fifo(void *handle, uint32_t num)
225 uintptr_t usb_base_addr = (uintptr_t)handle;
243 * handle: PCD handle.
246 static enum usb_status usb_dwc2_flush_rx_fifo(void *handle)
248 uintptr_t usb_base_addr = (uintptr_t)handle;
265 * handle: PCD handle.
268 static uint32_t usb_dwc2_read_int(void *handle)
270 uintptr_t usb_base_addr = (uintptr_t)handle;
278 * handle: PCD handle.
281 static uint32_t usb_dwc2_all_out_ep_int(void *handle)
283 uintptr_t usb_base_addr = (uintptr_t)handle;
292 * handle: PCD handle.
295 static uint32_t usb_dwc2_all_in_ep_int(void *handle)
297 uintptr_t usb_base_addr = (uintptr_t)handle;
306 * handle: PCD handle.
311 static uint32_t usb_dwc2_out_ep_int(void *handle, uint8_t epnum)
313 uintptr_t usb_base_addr = (uintptr_t)handle;
322 * handle: PCD handle.
327 static uint32_t usb_dwc2_in_ep_int(void *handle, uint8_t epnum)
329 uintptr_t usb_base_addr = (uintptr_t)handle;
343 * handle: PCD handle.
347 static uint32_t usb_dwc2_get_mode(void *handle)
349 uintptr_t usb_base_addr = (uintptr_t)handle;
356 * handle: PCD handle.
359 static enum usb_status usb_dwc2_activate_setup(void *handle)
361 uintptr_t usb_base_addr = (uintptr_t)handle;
379 * handle: Selected device.
382 static enum usb_status usb_dwc2_ep0_out_start(void *handle)
384 uintptr_t usb_base_addr = (uintptr_t)handle;
400 * handle: Selected device.
406 static enum usb_status usb_dwc2_write_packet(void *handle, uint8_t *src,
413 reg_offset = (uintptr_t)handle + OTG_FIFO_BASE +
434 * handle: Selected device.
439 static void *usb_dwc2_read_packet(void *handle, uint8_t *dest, uint16_t len)
447 reg_offset = (uintptr_t)handle + OTG_FIFO_BASE;
460 * handle: Selected device
464 static enum usb_status usb_dwc2_ep_start_xfer(void *handle, struct usbd_ep *ep)
466 uintptr_t usb_base_addr = (uintptr_t)handle;
515 usb_dwc2_write_packet(handle, ep->xfer_buff, ep->num, ep->xfer_len);
556 * handle: Selected device.
560 static enum usb_status usb_dwc2_ep0_start_xfer(void *handle, struct usbd_ep *ep)
562 uintptr_t usb_base_addr = (uintptr_t)handle;
629 * handle: Selected device.
633 static enum usb_status usb_dwc2_ep_set_stall(void *handle, struct usbd_ep *ep)
635 uintptr_t usb_base_addr = (uintptr_t)handle;
670 * handle: Selected device.
673 static enum usb_status usb_dwc2_stop_device(void *handle)
675 uintptr_t usb_base_addr = (uintptr_t)handle;
697 usb_dwc2_flush_rx_fifo(handle);
698 usb_dwc2_flush_tx_fifo(handle, EP_ALL);
701 mmio_setbits_32((uintptr_t)handle + OTG_DCTL, OTG_DCTL_SDIS);
708 * handle: Selected device.
713 static enum usb_status usb_dwc2_set_address(void *handle, uint8_t address)
715 uintptr_t usb_base_addr = (uintptr_t)handle;
726 * handle: Selected device.
734 static enum usb_status usb_dwc2_write_empty_tx_fifo(void *handle,
741 uintptr_t usb_base_addr = (uintptr_t)handle;
769 ret = usb_dwc2_write_packet(handle, *xfer_buff, epnum, len);
787 * handle: PCD handle.
791 static enum usb_action usb_dwc2_it_handler(void *handle, uint32_t *param)
793 uintptr_t usb_base_addr = (uintptr_t)handle;
800 if (usb_dwc2_get_mode(handle) != USB_OTG_MODE_DEVICE) {
805 if (usb_dwc2_read_int(handle) == 0U) {
809 if ((usb_dwc2_read_int(handle) & OTG_GINTSTS_MMIS) != 0U) {
814 if ((usb_dwc2_read_int(handle) & OTG_GINTSTS_OEPINT) != 0U) {
818 ep_intr = usb_dwc2_all_out_ep_int(handle);
827 epint = usb_dwc2_out_ep_int(handle, epnum);
848 if ((usb_dwc2_read_int(handle) & OTG_GINTSTS_IEPINT) != 0U) {
852 ep_intr = usb_dwc2_all_in_ep_int(handle);
861 epint = usb_dwc2_in_ep_int(handle, epnum);
895 if ((usb_dwc2_read_int(handle) & OTG_GINTSTS_WKUPINT) != 0U) {
896 INFO("handle USB : Resume\n");
906 if ((usb_dwc2_read_int(handle) & OTG_GINTSTS_USBSUSP) != 0U) {
907 INFO("handle USB : Suspend int\n");
918 if ((usb_dwc2_read_int(handle) & OTG_GINTSTS_LPMINT) != 0U) {
919 INFO("handle USB : LPM int enter in suspend\n");
929 if ((usb_dwc2_read_int(handle) & OTG_GINTSTS_USBRST) != 0U) {
930 INFO("handle USB : Reset\n");
934 usb_dwc2_flush_tx_fifo(handle, 0U);
950 ret = usb_dwc2_ep0_out_start(handle);
959 if ((usb_dwc2_read_int(handle) & OTG_GINTSTS_ENUMDNE) != 0U) {
960 ret = usb_dwc2_activate_setup(handle);
974 if ((usb_dwc2_read_int(handle) & OTG_GINTSTS_RXFLVL) != 0U) {
1001 if ((usb_dwc2_read_int(handle) & OTG_GINTSTS_SOF) != 0U) {
1002 INFO("handle USB : SOF\n");
1010 if ((usb_dwc2_read_int(handle) & OTG_GINTSTS_IISOIXFR) != 0U) {
1011 INFO("handle USB : ISO IN\n");
1018 if ((usb_dwc2_read_int(handle) & OTG_GINTSTS_IPXFR_INCOMPISOOUT) !=
1020 INFO("handle USB : ISO OUT\n");
1027 if ((usb_dwc2_read_int(handle) & OTG_GINTSTS_SRQINT) != 0U) {
1028 INFO("handle USB : Connect\n");
1034 if ((usb_dwc2_read_int(handle) & OTG_GINTSTS_OTGINT) != 0U) {
1035 INFO("handle USB : Disconnect\n");
1049 * usb_core_handle: USB core driver handle.
1052 static enum usb_status usb_dwc2_start_device(void *handle)
1054 uintptr_t usb_base_addr = (uintptr_t)handle;
1078 * usb_core_handle: USB core driver handle.
1079 * pcd_handle: PCD handle.