Lines Matching full:udc

29  * UDC register definitions  *
182 struct ast_udc_dev *udc; member
248 dev_dbg(&(e)->udc->pdev->dev, "%s():%s " fmt, __func__, \
269 #define ast_udc_read(udc, offset) \ argument
270 readl((udc)->reg + (offset))
271 #define ast_udc_write(udc, val, offset) \ argument
272 writel((val), (udc)->reg + (offset))
284 struct ast_udc_dev *udc = ep->udc; in ast_udc_done() local
300 spin_unlock(&udc->lock); in ast_udc_done()
302 spin_lock(&udc->lock); in ast_udc_done()
329 static void ast_udc_stop_activity(struct ast_udc_dev *udc) in ast_udc_stop_activity() argument
335 ep = &udc->ep[i]; in ast_udc_stop_activity()
346 struct ast_udc_dev *udc = ep->udc; in ast_udc_ep_enable() local
359 if (!udc->driver) { in ast_udc_ep_enable()
366 spin_lock_irqsave(&udc->lock, flags); in ast_udc_ep_enable()
399 ep->desc_mode = udc->desc_mode && ep->descs_dma && ep->dir_in; in ast_udc_ep_enable()
418 ast_udc_write(udc, EP_TOGGLE_SET_EPNUM(epnum), AST_VHUB_EP_DATA); in ast_udc_ep_enable()
425 spin_unlock_irqrestore(&udc->lock, flags); in ast_udc_ep_enable()
433 struct ast_udc_dev *udc = ep->udc; in ast_udc_ep_disable() local
436 spin_lock_irqsave(&udc->lock, flags); in ast_udc_ep_disable()
444 spin_unlock_irqrestore(&udc->lock, flags); in ast_udc_ep_disable()
477 struct ast_udc_dev *udc = ep->udc; in ast_dma_descriptor_setup() local
478 struct device *dev = &udc->pdev->dev; in ast_dma_descriptor_setup()
585 struct ast_udc_dev *udc = ep->udc; in ast_udc_ep0_queue() local
592 ast_udc_write(udc, req->req.dma + req->req.actual, in ast_udc_ep0_queue()
597 SETUP_DBG(udc, "IN: %s:0x%x, %s:0x%x, %s:%d (%d/%d), %s:%d\n", in ast_udc_ep0_queue()
605 ast_udc_write(udc, EP0_TX_LEN(tx_len), AST_UDC_EP0_CTRL); in ast_udc_ep0_queue()
606 ast_udc_write(udc, EP0_TX_LEN(tx_len) | EP0_TX_BUFF_RDY, in ast_udc_ep0_queue()
611 SETUP_DBG(udc, "OUT: %s:%x, %s:%x, %s:(%d/%d), %s:%d\n", in ast_udc_ep0_queue()
619 ast_udc_write(udc, EP0_TX_BUFF_RDY, AST_UDC_EP0_CTRL); in ast_udc_ep0_queue()
622 ast_udc_write(udc, EP0_RX_BUFF_RDY, AST_UDC_EP0_CTRL); in ast_udc_ep0_queue()
631 struct ast_udc_dev *udc = ep->udc; in ast_udc_ep_queue() local
632 struct device *dev = &udc->pdev->dev; in ast_udc_ep_queue()
646 spin_lock_irqsave(&udc->lock, flags); in ast_udc_ep_queue()
654 rc = usb_gadget_map_request(&udc->gadget, &req->req, ep->dir_in); in ast_udc_ep_queue()
686 spin_unlock_irqrestore(&udc->lock, flags); in ast_udc_ep_queue()
694 struct ast_udc_dev *udc = ep->udc; in ast_udc_ep_dequeue() local
699 spin_lock_irqsave(&udc->lock, flags); in ast_udc_ep_dequeue()
715 spin_unlock_irqrestore(&udc->lock, flags); in ast_udc_ep_dequeue()
723 struct ast_udc_dev *udc = ep->udc; in ast_udc_ep_set_halt() local
730 spin_lock_irqsave(&udc->lock, flags); in ast_udc_ep_set_halt()
736 ctrl = ast_udc_read(udc, AST_UDC_EP0_CTRL); in ast_udc_ep_set_halt()
742 ast_udc_write(udc, ctrl, AST_UDC_EP0_CTRL); in ast_udc_ep_set_halt()
746 ctrl = ast_udc_read(udc, AST_UDC_EP_CONFIG); in ast_udc_ep_set_halt()
758 spin_unlock_irqrestore(&udc->lock, flags); in ast_udc_ep_set_halt()
774 static void ast_udc_ep0_rx(struct ast_udc_dev *udc) in ast_udc_ep0_rx() argument
776 ast_udc_write(udc, udc->ep0_buf_dma, AST_UDC_EP0_DATA_BUFF); in ast_udc_ep0_rx()
777 ast_udc_write(udc, EP0_RX_BUFF_RDY, AST_UDC_EP0_CTRL); in ast_udc_ep0_rx()
780 static void ast_udc_ep0_tx(struct ast_udc_dev *udc) in ast_udc_ep0_tx() argument
782 ast_udc_write(udc, udc->ep0_buf_dma, AST_UDC_EP0_DATA_BUFF); in ast_udc_ep0_tx()
783 ast_udc_write(udc, EP0_TX_BUFF_RDY, AST_UDC_EP0_CTRL); in ast_udc_ep0_tx()
786 static void ast_udc_ep0_out(struct ast_udc_dev *udc) in ast_udc_ep0_out() argument
788 struct device *dev = &udc->pdev->dev; in ast_udc_ep0_out()
789 struct ast_udc_ep *ep = &udc->ep[0]; in ast_udc_ep0_out()
798 rx_len = EP0_GET_RX_LEN(ast_udc_read(udc, AST_UDC_EP0_CTRL)); in ast_udc_ep0_out()
801 SETUP_DBG(udc, "req %p (%d/%d)\n", req, in ast_udc_ep0_out()
806 ast_udc_ep0_tx(udc); in ast_udc_ep0_out()
815 ast_udc_ep0_tx(udc); in ast_udc_ep0_out()
827 static void ast_udc_ep0_in(struct ast_udc_dev *udc) in ast_udc_ep0_in() argument
829 struct ast_udc_ep *ep = &udc->ep[0]; in ast_udc_ep0_in()
833 if (udc->is_control_tx) { in ast_udc_ep0_in()
834 ast_udc_ep0_rx(udc); in ast_udc_ep0_in()
835 udc->is_control_tx = 0; in ast_udc_ep0_in()
843 SETUP_DBG(udc, "req %p (%d/%d)\n", req, in ast_udc_ep0_in()
848 ast_udc_ep0_rx(udc); in ast_udc_ep0_in()
859 static void ast_udc_epn_handle(struct ast_udc_dev *udc, u16 ep_num) in ast_udc_epn_handle() argument
861 struct ast_udc_ep *ep = &udc->ep[ep_num]; in ast_udc_epn_handle()
898 static void ast_udc_epn_handle_desc(struct ast_udc_dev *udc, u16 ep_num) in ast_udc_epn_handle_desc() argument
900 struct ast_udc_ep *ep = &udc->ep[ep_num]; in ast_udc_epn_handle_desc()
901 struct device *dev = &udc->pdev->dev; in ast_udc_epn_handle_desc()
979 static void ast_udc_ep0_data_tx(struct ast_udc_dev *udc, u8 *tx_data, u32 len) in ast_udc_ep0_data_tx() argument
982 memcpy(udc->ep0_buf, tx_data, len); in ast_udc_ep0_data_tx()
984 ast_udc_write(udc, udc->ep0_buf_dma, AST_UDC_EP0_DATA_BUFF); in ast_udc_ep0_data_tx()
985 ast_udc_write(udc, EP0_TX_LEN(len), AST_UDC_EP0_CTRL); in ast_udc_ep0_data_tx()
986 ast_udc_write(udc, EP0_TX_LEN(len) | EP0_TX_BUFF_RDY, in ast_udc_ep0_data_tx()
988 udc->is_control_tx = 1; in ast_udc_ep0_data_tx()
991 ast_udc_write(udc, EP0_TX_BUFF_RDY, AST_UDC_EP0_CTRL); in ast_udc_ep0_data_tx()
994 static void ast_udc_getstatus(struct ast_udc_dev *udc) in ast_udc_getstatus() argument
1001 memcpy_fromio(&crq, udc->creq, sizeof(crq)); in ast_udc_getstatus()
1014 status = udc->ep[epnum].stopped; in ast_udc_getstatus()
1020 ep = &udc->ep[epnum]; in ast_udc_getstatus()
1022 ast_udc_ep0_data_tx(udc, (u8 *)&status, sizeof(status)); in ast_udc_getstatus()
1028 ast_udc_write(udc, ast_udc_read(udc, AST_UDC_EP0_CTRL) | EP0_STALL, in ast_udc_getstatus()
1032 static void ast_udc_ep0_handle_setup(struct ast_udc_dev *udc) in ast_udc_ep0_handle_setup() argument
1034 struct ast_udc_ep *ep = &udc->ep[0]; in ast_udc_ep0_handle_setup()
1041 memcpy_fromio(&crq, udc->creq, sizeof(crq)); in ast_udc_ep0_handle_setup()
1043 SETUP_DBG(udc, "SETUP packet: %02x/%02x/%04x/%04x/%04x\n", in ast_udc_ep0_handle_setup()
1051 list_for_each_entry(req, &udc->ep[0].queue, queue) { in ast_udc_ep0_handle_setup()
1057 ast_udc_nuke(&udc->ep[0], -ETIMEDOUT); in ast_udc_ep0_handle_setup()
1059 udc->ep[0].dir_in = crq.bRequestType & USB_DIR_IN; in ast_udc_ep0_handle_setup()
1064 if (ast_udc_read(udc, AST_UDC_STS) & UDC_STS_HIGHSPEED) in ast_udc_ep0_handle_setup()
1065 udc->gadget.speed = USB_SPEED_HIGH; in ast_udc_ep0_handle_setup()
1067 udc->gadget.speed = USB_SPEED_FULL; in ast_udc_ep0_handle_setup()
1069 SETUP_DBG(udc, "set addr: 0x%x\n", crq.wValue); in ast_udc_ep0_handle_setup()
1070 reg = ast_udc_read(udc, AST_UDC_CONFIG); in ast_udc_ep0_handle_setup()
1073 ast_udc_write(udc, reg, AST_UDC_CONFIG); in ast_udc_ep0_handle_setup()
1077 SETUP_DBG(udc, "ep0: CLEAR FEATURE\n"); in ast_udc_ep0_handle_setup()
1081 SETUP_DBG(udc, "ep0: SET FEATURE\n"); in ast_udc_ep0_handle_setup()
1085 ast_udc_getstatus(udc); in ast_udc_ep0_handle_setup()
1095 if (udc->driver) { in ast_udc_ep0_handle_setup()
1096 SETUP_DBG(udc, "Forwarding %s to gadget...\n", in ast_udc_ep0_handle_setup()
1097 udc->gadget.name); in ast_udc_ep0_handle_setup()
1099 spin_unlock(&udc->lock); in ast_udc_ep0_handle_setup()
1100 rc = udc->driver->setup(&udc->gadget, &crq); in ast_udc_ep0_handle_setup()
1101 spin_lock(&udc->lock); in ast_udc_ep0_handle_setup()
1104 SETUP_DBG(udc, "No gadget for request !\n"); in ast_udc_ep0_handle_setup()
1111 SETUP_DBG(udc, "Stalling, rc:0x%x\n", rc); in ast_udc_ep0_handle_setup()
1112 ast_udc_write(udc, ast_udc_read(udc, AST_UDC_EP0_CTRL) | EP0_STALL, in ast_udc_ep0_handle_setup()
1117 SETUP_DBG(udc, "ep0: Sending IN status without data\n"); in ast_udc_ep0_handle_setup()
1118 ast_udc_write(udc, EP0_TX_BUFF_RDY, AST_UDC_EP0_CTRL); in ast_udc_ep0_handle_setup()
1123 struct ast_udc_dev *udc = (struct ast_udc_dev *)data; in ast_udc_isr() local
1128 spin_lock(&udc->lock); in ast_udc_isr()
1130 isr = ast_udc_read(udc, AST_UDC_ISR); in ast_udc_isr()
1135 ast_udc_write(udc, isr, AST_UDC_ISR); in ast_udc_isr()
1138 ISR_DBG(udc, "UDC_IRQ_BUS_RESET\n"); in ast_udc_isr()
1139 udc->gadget.speed = USB_SPEED_UNKNOWN; in ast_udc_isr()
1141 ep = &udc->ep[1]; in ast_udc_isr()
1145 if (udc->driver && udc->driver->reset) { in ast_udc_isr()
1146 spin_unlock(&udc->lock); in ast_udc_isr()
1147 udc->driver->reset(&udc->gadget); in ast_udc_isr()
1148 spin_lock(&udc->lock); in ast_udc_isr()
1153 ISR_DBG(udc, "UDC_IRQ_BUS_SUSPEND\n"); in ast_udc_isr()
1154 udc->suspended_from = udc->gadget.state; in ast_udc_isr()
1155 usb_gadget_set_state(&udc->gadget, USB_STATE_SUSPENDED); in ast_udc_isr()
1157 if (udc->driver && udc->driver->suspend) { in ast_udc_isr()
1158 spin_unlock(&udc->lock); in ast_udc_isr()
1159 udc->driver->suspend(&udc->gadget); in ast_udc_isr()
1160 spin_lock(&udc->lock); in ast_udc_isr()
1165 ISR_DBG(udc, "UDC_IRQ_BUS_RESUME\n"); in ast_udc_isr()
1166 usb_gadget_set_state(&udc->gadget, udc->suspended_from); in ast_udc_isr()
1168 if (udc->driver && udc->driver->resume) { in ast_udc_isr()
1169 spin_unlock(&udc->lock); in ast_udc_isr()
1170 udc->driver->resume(&udc->gadget); in ast_udc_isr()
1171 spin_lock(&udc->lock); in ast_udc_isr()
1176 ISR_DBG(udc, "UDC_IRQ_EP0_IN_ACK_STALL\n"); in ast_udc_isr()
1177 ast_udc_ep0_in(udc); in ast_udc_isr()
1181 ISR_DBG(udc, "UDC_IRQ_EP0_OUT_ACK_STALL\n"); in ast_udc_isr()
1182 ast_udc_ep0_out(udc); in ast_udc_isr()
1186 ISR_DBG(udc, "UDC_IRQ_EP0_SETUP\n"); in ast_udc_isr()
1187 ast_udc_ep0_handle_setup(udc); in ast_udc_isr()
1191 ISR_DBG(udc, "UDC_IRQ_EP_POOL_ACK_STALL\n"); in ast_udc_isr()
1192 ep_isr = ast_udc_read(udc, AST_UDC_EP_ACK_ISR); in ast_udc_isr()
1195 ast_udc_write(udc, ep_isr, AST_UDC_EP_ACK_ISR); in ast_udc_isr()
1200 ep = &udc->ep[i + 1]; in ast_udc_isr()
1202 ast_udc_epn_handle_desc(udc, i + 1); in ast_udc_isr()
1204 ast_udc_epn_handle(udc, i + 1); in ast_udc_isr()
1210 spin_unlock(&udc->lock); in ast_udc_isr()
1216 struct ast_udc_dev *udc = to_ast_dev(gadget); in ast_udc_gadget_getframe() local
1218 return (ast_udc_read(udc, AST_UDC_STS) >> 16) & 0x7ff; in ast_udc_gadget_getframe()
1223 struct ast_udc_dev *udc = container_of(work, struct ast_udc_dev, in ast_udc_wake_work() local
1228 spin_lock_irqsave(&udc->lock, flags); in ast_udc_wake_work()
1230 UDC_DBG(udc, "Wakeup Host !\n"); in ast_udc_wake_work()
1231 ctrl = ast_udc_read(udc, AST_UDC_FUNC_CTRL); in ast_udc_wake_work()
1232 ast_udc_write(udc, ctrl | USB_REMOTE_WAKEUP_EN, AST_UDC_FUNC_CTRL); in ast_udc_wake_work()
1234 spin_unlock_irqrestore(&udc->lock, flags); in ast_udc_wake_work()
1237 static void ast_udc_wakeup_all(struct ast_udc_dev *udc) in ast_udc_wakeup_all() argument
1244 schedule_work(&udc->wake_work); in ast_udc_wakeup_all()
1249 struct ast_udc_dev *udc = to_ast_dev(gadget); in ast_udc_wakeup() local
1253 spin_lock_irqsave(&udc->lock, flags); in ast_udc_wakeup()
1255 if (!udc->wakeup_en) { in ast_udc_wakeup()
1256 UDC_DBG(udc, "Remote Wakeup is disabled\n"); in ast_udc_wakeup()
1261 UDC_DBG(udc, "Device initiated wakeup\n"); in ast_udc_wakeup()
1262 ast_udc_wakeup_all(udc); in ast_udc_wakeup()
1265 spin_unlock_irqrestore(&udc->lock, flags); in ast_udc_wakeup()
1274 struct ast_udc_dev *udc = to_ast_dev(gadget); in ast_udc_pullup() local
1278 spin_lock_irqsave(&udc->lock, flags); in ast_udc_pullup()
1280 UDC_DBG(udc, "is_on: %d\n", is_on); in ast_udc_pullup()
1282 ctrl = ast_udc_read(udc, AST_UDC_FUNC_CTRL) | USB_UPSTREAM_EN; in ast_udc_pullup()
1284 ctrl = ast_udc_read(udc, AST_UDC_FUNC_CTRL) & ~USB_UPSTREAM_EN; in ast_udc_pullup()
1286 ast_udc_write(udc, ctrl, AST_UDC_FUNC_CTRL); in ast_udc_pullup()
1288 spin_unlock_irqrestore(&udc->lock, flags); in ast_udc_pullup()
1296 struct ast_udc_dev *udc = to_ast_dev(gadget); in ast_udc_start() local
1301 spin_lock_irqsave(&udc->lock, flags); in ast_udc_start()
1303 UDC_DBG(udc, "\n"); in ast_udc_start()
1304 udc->driver = driver; in ast_udc_start()
1305 udc->gadget.dev.of_node = udc->pdev->dev.of_node; in ast_udc_start()
1308 ep = &udc->ep[i]; in ast_udc_start()
1312 spin_unlock_irqrestore(&udc->lock, flags); in ast_udc_start()
1319 struct ast_udc_dev *udc = to_ast_dev(gadget); in ast_udc_stop() local
1323 spin_lock_irqsave(&udc->lock, flags); in ast_udc_stop()
1325 UDC_DBG(udc, "\n"); in ast_udc_stop()
1326 ctrl = ast_udc_read(udc, AST_UDC_FUNC_CTRL) & ~USB_UPSTREAM_EN; in ast_udc_stop()
1327 ast_udc_write(udc, ctrl, AST_UDC_FUNC_CTRL); in ast_udc_stop()
1329 udc->gadget.speed = USB_SPEED_UNKNOWN; in ast_udc_stop()
1330 udc->driver = NULL; in ast_udc_stop()
1332 ast_udc_stop_activity(udc); in ast_udc_stop()
1333 usb_gadget_set_state(&udc->gadget, USB_STATE_NOTATTACHED); in ast_udc_stop()
1335 spin_unlock_irqrestore(&udc->lock, flags); in ast_udc_stop()
1353 static void ast_udc_init_ep(struct ast_udc_dev *udc) in ast_udc_init_ep() argument
1359 ep = &udc->ep[i]; in ast_udc_init_ep()
1372 ep->udc = udc; in ast_udc_init_ep()
1382 ep->ep_reg = udc->reg + AST_UDC_EP_BASE + in ast_udc_init_ep()
1385 ep->epn_buf = udc->ep0_buf + (i * AST_UDC_EP_DMA_SIZE); in ast_udc_init_ep()
1386 ep->epn_buf_dma = udc->ep0_buf_dma + (i * AST_UDC_EP_DMA_SIZE); in ast_udc_init_ep()
1393 list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list); in ast_udc_init_ep()
1397 static void ast_udc_init_dev(struct ast_udc_dev *udc) in ast_udc_init_dev() argument
1399 INIT_WORK(&udc->wake_work, ast_udc_wake_work); in ast_udc_init_dev()
1402 static void ast_udc_init_hw(struct ast_udc_dev *udc) in ast_udc_init_hw() argument
1408 ast_udc_write(udc, ctrl, AST_UDC_FUNC_CTRL); in ast_udc_init_hw()
1411 ast_udc_write(udc, 0, AST_UDC_DEV_RESET); in ast_udc_init_hw()
1416 ast_udc_write(udc, ctrl, AST_UDC_FUNC_CTRL); in ast_udc_init_hw()
1420 ast_udc_write(udc, 0, AST_UDC_IER); in ast_udc_init_hw()
1421 ast_udc_write(udc, UDC_IRQ_ACK_ALL, AST_UDC_ISR); in ast_udc_init_hw()
1428 ast_udc_write(udc, ctrl, AST_UDC_IER); in ast_udc_init_hw()
1431 ast_udc_write(udc, UDC_IRQ_EP_ACK_ALL, AST_UDC_EP_ACK_IER); in ast_udc_init_hw()
1432 ast_udc_write(udc, UDC_IRQ_EP_ACK_ALL, AST_UDC_EP_ACK_ISR); in ast_udc_init_hw()
1434 ast_udc_write(udc, 0, AST_UDC_EP0_CTRL); in ast_udc_init_hw()
1439 struct ast_udc_dev *udc = platform_get_drvdata(pdev); in ast_udc_remove() local
1443 usb_del_gadget_udc(&udc->gadget); in ast_udc_remove()
1444 if (udc->driver) { in ast_udc_remove()
1456 spin_lock_irqsave(&udc->lock, flags); in ast_udc_remove()
1459 ctrl = ast_udc_read(udc, AST_UDC_FUNC_CTRL) & ~USB_UPSTREAM_EN; in ast_udc_remove()
1460 ast_udc_write(udc, ctrl, AST_UDC_FUNC_CTRL); in ast_udc_remove()
1462 clk_disable_unprepare(udc->clk); in ast_udc_remove()
1464 spin_unlock_irqrestore(&udc->lock, flags); in ast_udc_remove()
1466 if (udc->ep0_buf) in ast_udc_remove()
1469 udc->ep0_buf, in ast_udc_remove()
1470 udc->ep0_buf_dma); in ast_udc_remove()
1472 udc->ep0_buf = NULL; in ast_udc_remove()
1479 struct ast_udc_dev *udc; in ast_udc_probe() local
1482 udc = devm_kzalloc(&pdev->dev, sizeof(struct ast_udc_dev), GFP_KERNEL); in ast_udc_probe()
1483 if (!udc) in ast_udc_probe()
1486 udc->gadget.dev.parent = dev; in ast_udc_probe()
1487 udc->pdev = pdev; in ast_udc_probe()
1488 spin_lock_init(&udc->lock); in ast_udc_probe()
1490 udc->gadget.ops = &ast_udc_ops; in ast_udc_probe()
1491 udc->gadget.ep0 = &udc->ep[0].ep; in ast_udc_probe()
1492 udc->gadget.name = "aspeed-udc"; in ast_udc_probe()
1493 udc->gadget.dev.init_name = "gadget"; in ast_udc_probe()
1495 udc->reg = devm_platform_ioremap_resource(pdev, 0); in ast_udc_probe()
1496 if (IS_ERR(udc->reg)) { in ast_udc_probe()
1498 return PTR_ERR(udc->reg); in ast_udc_probe()
1501 platform_set_drvdata(pdev, udc); in ast_udc_probe()
1503 udc->clk = devm_clk_get(&pdev->dev, NULL); in ast_udc_probe()
1504 if (IS_ERR(udc->clk)) { in ast_udc_probe()
1505 rc = PTR_ERR(udc->clk); in ast_udc_probe()
1508 rc = clk_prepare_enable(udc->clk); in ast_udc_probe()
1517 udc->force_usb1 = true; in ast_udc_probe()
1522 udc->ep0_buf = dma_alloc_coherent(&pdev->dev, in ast_udc_probe()
1525 &udc->ep0_buf_dma, GFP_KERNEL); in ast_udc_probe()
1527 udc->gadget.speed = USB_SPEED_UNKNOWN; in ast_udc_probe()
1528 udc->gadget.max_speed = USB_SPEED_HIGH; in ast_udc_probe()
1529 udc->creq = udc->reg + AST_UDC_SETUP0; in ast_udc_probe()
1535 udc->desc_mode = AST_UDC_DESC_MODE; in ast_udc_probe()
1537 dev_info(&pdev->dev, "DMA %s\n", udc->desc_mode ? in ast_udc_probe()
1540 INIT_LIST_HEAD(&udc->gadget.ep_list); in ast_udc_probe()
1541 INIT_LIST_HEAD(&udc->gadget.ep0->ep_list); in ast_udc_probe()
1543 /* Initialized udc ep */ in ast_udc_probe()
1544 ast_udc_init_ep(udc); in ast_udc_probe()
1546 /* Initialized udc device */ in ast_udc_probe()
1547 ast_udc_init_dev(udc); in ast_udc_probe()
1549 /* Initialized udc hardware */ in ast_udc_probe()
1550 ast_udc_init_hw(udc); in ast_udc_probe()
1553 udc->irq = platform_get_irq(pdev, 0); in ast_udc_probe()
1554 if (udc->irq < 0) { in ast_udc_probe()
1555 rc = udc->irq; in ast_udc_probe()
1559 rc = devm_request_irq(&pdev->dev, udc->irq, ast_udc_isr, 0, in ast_udc_probe()
1560 KBUILD_MODNAME, udc); in ast_udc_probe()
1566 rc = usb_add_gadget_udc(&pdev->dev, &udc->gadget); in ast_udc_probe()
1568 dev_err(&pdev->dev, "Failed to add gadget udc\n"); in ast_udc_probe()
1572 dev_info(&pdev->dev, "Initialized udc in USB%s mode\n", in ast_udc_probe()
1573 udc->force_usb1 ? "1" : "2"); in ast_udc_probe()
1578 dev_err(&pdev->dev, "Failed to udc probe, rc:0x%x\n", rc); in ast_udc_probe()
1585 { .compatible = "aspeed,ast2600-udc", },
1602 MODULE_DESCRIPTION("ASPEED UDC driver");