Lines Matching refs:fotg210

32 static void fotg210_ack_int(struct fotg210_udc *fotg210, u32 offset, u32 mask)  in fotg210_ack_int()  argument
34 u32 value = ioread32(fotg210->reg + offset); in fotg210_ack_int()
37 iowrite32(value, fotg210->reg + offset); in fotg210_ack_int()
42 u32 value = ioread32(ep->fotg210->reg + FOTG210_DMISGR1); in fotg210_disable_fifo_int()
48 iowrite32(value, ep->fotg210->reg + FOTG210_DMISGR1); in fotg210_disable_fifo_int()
53 u32 value = ioread32(ep->fotg210->reg + FOTG210_DMISGR1); in fotg210_enable_fifo_int()
59 iowrite32(value, ep->fotg210->reg + FOTG210_DMISGR1); in fotg210_enable_fifo_int()
62 static void fotg210_set_cxdone(struct fotg210_udc *fotg210) in fotg210_set_cxdone() argument
64 u32 value = ioread32(fotg210->reg + FOTG210_DCFESR); in fotg210_set_cxdone()
67 iowrite32(value, fotg210->reg + FOTG210_DCFESR); in fotg210_set_cxdone()
76 if (ep->fotg210->gadget.speed == USB_SPEED_UNKNOWN) in fotg210_done()
81 spin_unlock(&ep->fotg210->lock); in fotg210_done()
83 spin_lock(&ep->fotg210->lock); in fotg210_done()
89 fotg210_set_cxdone(ep->fotg210); in fotg210_done()
96 struct fotg210_udc *fotg210 = ep->fotg210; in fotg210_fifo_ep_mapping() local
104 val = ioread32(fotg210->reg + FOTG210_EPMAP); in fotg210_fifo_ep_mapping()
107 iowrite32(val, fotg210->reg + FOTG210_EPMAP); in fotg210_fifo_ep_mapping()
110 val = ioread32(fotg210->reg + FOTG210_FIFOMAP); in fotg210_fifo_ep_mapping()
113 iowrite32(val, fotg210->reg + FOTG210_FIFOMAP); in fotg210_fifo_ep_mapping()
116 val = ioread32(fotg210->reg + FOTG210_FIFOCF); in fotg210_fifo_ep_mapping()
118 iowrite32(val, fotg210->reg + FOTG210_FIFOCF); in fotg210_fifo_ep_mapping()
123 struct fotg210_udc *fotg210 = ep->fotg210; in fotg210_set_fifo_dir() local
126 val = ioread32(fotg210->reg + FOTG210_FIFOMAP); in fotg210_set_fifo_dir()
128 iowrite32(val, fotg210->reg + FOTG210_FIFOMAP); in fotg210_set_fifo_dir()
133 struct fotg210_udc *fotg210 = ep->fotg210; in fotg210_set_tfrtype() local
136 val = ioread32(fotg210->reg + FOTG210_FIFOCF); in fotg210_set_tfrtype()
138 iowrite32(val, fotg210->reg + FOTG210_FIFOCF); in fotg210_set_tfrtype()
144 struct fotg210_udc *fotg210 = ep->fotg210; in fotg210_set_mps() local
149 val = ioread32(fotg210->reg + offset); in fotg210_set_mps()
151 iowrite32(val, fotg210->reg + offset); in fotg210_set_mps()
157 struct fotg210_udc *fotg210 = ep->fotg210; in fotg210_config_ep() local
164 fotg210->ep[ep->epnum] = ep; in fotg210_config_ep()
185 static void fotg210_reset_tseq(struct fotg210_udc *fotg210, u8 epnum) in fotg210_reset_tseq() argument
187 struct fotg210_ep *ep = fotg210->ep[epnum]; in fotg210_reset_tseq()
192 fotg210->reg + FOTG210_INEPMPSR(epnum) : in fotg210_reset_tseq()
193 fotg210->reg + FOTG210_OUTEPMPSR(epnum); in fotg210_reset_tseq()
216 fotg210_reset_tseq(ep->fotg210, ep->epnum); in fotg210_ep_release()
234 spin_lock_irqsave(&ep->fotg210->lock, flags); in fotg210_ep_disable()
236 spin_unlock_irqrestore(&ep->fotg210->lock, flags); in fotg210_ep_disable()
269 struct fotg210_udc *fotg210 = ep->fotg210; in fotg210_enable_dma() local
272 value = ioread32(fotg210->reg + FOTG210_DMACPSR1); in fotg210_enable_dma()
275 iowrite32(value, fotg210->reg + FOTG210_DMACPSR1); in fotg210_enable_dma()
278 value = ioread32(fotg210->reg + FOTG210_DMATFNR); in fotg210_enable_dma()
283 iowrite32(value, fotg210->reg + FOTG210_DMATFNR); in fotg210_enable_dma()
286 iowrite32(d, fotg210->reg + FOTG210_DMACPSR2); in fotg210_enable_dma()
289 value = ioread32(fotg210->reg + FOTG210_DMISGR2); in fotg210_enable_dma()
291 iowrite32(value, fotg210->reg + FOTG210_DMISGR2); in fotg210_enable_dma()
294 value = ioread32(fotg210->reg + FOTG210_DMACPSR1); in fotg210_enable_dma()
296 iowrite32(value, fotg210->reg + FOTG210_DMACPSR1); in fotg210_enable_dma()
301 iowrite32(DMATFNR_DISDMA, ep->fotg210->reg + FOTG210_DMATFNR); in fotg210_disable_dma()
309 value = ioread32(ep->fotg210->reg + FOTG210_DISGR2); in fotg210_wait_dma_done()
315 fotg210_ack_int(ep->fotg210, FOTG210_DISGR2, DISGR2_DMA_CMPLT); in fotg210_wait_dma_done()
319 value = ioread32(ep->fotg210->reg + FOTG210_DMACPSR1); in fotg210_wait_dma_done()
321 iowrite32(value, ep->fotg210->reg + FOTG210_DMACPSR1); in fotg210_wait_dma_done()
325 value = ioread32(ep->fotg210->reg + in fotg210_wait_dma_done()
328 iowrite32(value, ep->fotg210->reg + in fotg210_wait_dma_done()
331 value = ioread32(ep->fotg210->reg + FOTG210_DCFESR); in fotg210_wait_dma_done()
333 iowrite32(value, ep->fotg210->reg + FOTG210_DCFESR); in fotg210_wait_dma_done()
340 struct device *dev = &ep->fotg210->gadget.dev; in fotg210_start_dma()
351 length = ioread32(ep->fotg210->reg + in fotg210_start_dma()
397 u32 value = ioread32(ep->fotg210->reg + FOTG210_DMISGR0); in fotg210_ep0_queue()
400 iowrite32(value, ep->fotg210->reg + FOTG210_DMISGR0); in fotg210_ep0_queue()
415 if (ep->fotg210->gadget.speed == USB_SPEED_UNKNOWN) in fotg210_ep_queue()
418 spin_lock_irqsave(&ep->fotg210->lock, flags); in fotg210_ep_queue()
433 spin_unlock_irqrestore(&ep->fotg210->lock, flags); in fotg210_ep_queue()
447 spin_lock_irqsave(&ep->fotg210->lock, flags); in fotg210_ep_dequeue()
450 spin_unlock_irqrestore(&ep->fotg210->lock, flags); in fotg210_ep_dequeue()
457 struct fotg210_udc *fotg210 = ep->fotg210; in fotg210_set_epnstall() local
464 value = ioread32(fotg210->reg + FOTG210_DCFESR); in fotg210_set_epnstall()
469 fotg210->reg + FOTG210_INEPMPSR(ep->epnum) : in fotg210_set_epnstall()
470 fotg210->reg + FOTG210_OUTEPMPSR(ep->epnum); in fotg210_set_epnstall()
478 struct fotg210_udc *fotg210 = ep->fotg210; in fotg210_clear_epnstall() local
483 fotg210->reg + FOTG210_INEPMPSR(ep->epnum) : in fotg210_clear_epnstall()
484 fotg210->reg + FOTG210_OUTEPMPSR(ep->epnum); in fotg210_clear_epnstall()
493 struct fotg210_udc *fotg210; in fotg210_set_halt_and_wedge() local
498 fotg210 = ep->fotg210; in fotg210_set_halt_and_wedge()
500 spin_lock_irqsave(&ep->fotg210->lock, flags); in fotg210_set_halt_and_wedge()
508 fotg210_reset_tseq(fotg210, ep->epnum); in fotg210_set_halt_and_wedge()
516 spin_unlock_irqrestore(&ep->fotg210->lock, flags); in fotg210_set_halt_and_wedge()
549 static void fotg210_clear_tx0byte(struct fotg210_udc *fotg210) in fotg210_clear_tx0byte() argument
551 u32 value = ioread32(fotg210->reg + FOTG210_TX0BYTE); in fotg210_clear_tx0byte()
555 iowrite32(value, fotg210->reg + FOTG210_TX0BYTE); in fotg210_clear_tx0byte()
558 static void fotg210_clear_rx0byte(struct fotg210_udc *fotg210) in fotg210_clear_rx0byte() argument
560 u32 value = ioread32(fotg210->reg + FOTG210_RX0BYTE); in fotg210_clear_rx0byte()
564 iowrite32(value, fotg210->reg + FOTG210_RX0BYTE); in fotg210_clear_rx0byte()
568 static void fotg210_rdsetupp(struct fotg210_udc *fotg210, in fotg210_rdsetupp() argument
576 iowrite32(DMATFNR_ACC_CXF, fotg210->reg + FOTG210_DMATFNR); in fotg210_rdsetupp()
579 data = ioread32(fotg210->reg + FOTG210_CXPORT); in fotg210_rdsetupp()
589 data = ioread32(fotg210->reg + FOTG210_CXPORT); in fotg210_rdsetupp()
593 data = ioread32(fotg210->reg + FOTG210_CXPORT); in fotg210_rdsetupp()
598 data = ioread32(fotg210->reg + FOTG210_CXPORT); in fotg210_rdsetupp()
607 iowrite32(DMATFNR_DISDMA, fotg210->reg + FOTG210_DMATFNR); in fotg210_rdsetupp()
610 static void fotg210_set_configuration(struct fotg210_udc *fotg210) in fotg210_set_configuration() argument
612 u32 value = ioread32(fotg210->reg + FOTG210_DAR); in fotg210_set_configuration()
615 iowrite32(value, fotg210->reg + FOTG210_DAR); in fotg210_set_configuration()
618 static void fotg210_set_dev_addr(struct fotg210_udc *fotg210, u32 addr) in fotg210_set_dev_addr() argument
620 u32 value = ioread32(fotg210->reg + FOTG210_DAR); in fotg210_set_dev_addr()
623 iowrite32(value, fotg210->reg + FOTG210_DAR); in fotg210_set_dev_addr()
626 static void fotg210_set_cxstall(struct fotg210_udc *fotg210) in fotg210_set_cxstall() argument
628 u32 value = ioread32(fotg210->reg + FOTG210_DCFESR); in fotg210_set_cxstall()
631 iowrite32(value, fotg210->reg + FOTG210_DCFESR); in fotg210_set_cxstall()
634 static void fotg210_request_error(struct fotg210_udc *fotg210) in fotg210_request_error() argument
636 fotg210_set_cxstall(fotg210); in fotg210_request_error()
640 static void fotg210_set_address(struct fotg210_udc *fotg210, in fotg210_set_address() argument
644 fotg210_request_error(fotg210); in fotg210_set_address()
646 fotg210_set_dev_addr(fotg210, le16_to_cpu(ctrl->wValue)); in fotg210_set_address()
647 fotg210_set_cxdone(fotg210); in fotg210_set_address()
651 static void fotg210_set_feature(struct fotg210_udc *fotg210, in fotg210_set_feature() argument
656 fotg210_set_cxdone(fotg210); in fotg210_set_feature()
659 fotg210_set_cxdone(fotg210); in fotg210_set_feature()
665 fotg210_set_epnstall(fotg210->ep[epnum]); in fotg210_set_feature()
667 fotg210_set_cxstall(fotg210); in fotg210_set_feature()
668 fotg210_set_cxdone(fotg210); in fotg210_set_feature()
672 fotg210_request_error(fotg210); in fotg210_set_feature()
677 static void fotg210_clear_feature(struct fotg210_udc *fotg210, in fotg210_clear_feature() argument
681 fotg210->ep[ctrl->wIndex & USB_ENDPOINT_NUMBER_MASK]; in fotg210_clear_feature()
685 fotg210_set_cxdone(fotg210); in fotg210_clear_feature()
688 fotg210_set_cxdone(fotg210); in fotg210_clear_feature()
693 fotg210_set_cxdone(fotg210); in fotg210_clear_feature()
699 fotg210_set_cxdone(fotg210); in fotg210_clear_feature()
702 fotg210_request_error(fotg210); in fotg210_clear_feature()
709 struct fotg210_udc *fotg210 = ep->fotg210; in fotg210_is_epnstall() local
714 fotg210->reg + FOTG210_INEPMPSR(ep->epnum) : in fotg210_is_epnstall()
715 fotg210->reg + FOTG210_OUTEPMPSR(ep->epnum); in fotg210_is_epnstall()
724 struct fotg210_udc *fotg210; in fotg210_ep0_complete() local
727 fotg210 = ep->fotg210; in fotg210_ep0_complete()
730 dev_warn(&fotg210->gadget.dev, "EP0 request failed: %d\n", req->status); in fotg210_ep0_complete()
734 static void fotg210_get_status(struct fotg210_udc *fotg210, in fotg210_get_status() argument
741 fotg210->ep0_data = cpu_to_le16(1 << USB_DEVICE_SELF_POWERED); in fotg210_get_status()
744 fotg210->ep0_data = cpu_to_le16(0); in fotg210_get_status()
749 fotg210->ep0_data = in fotg210_get_status()
750 cpu_to_le16(fotg210_is_epnstall(fotg210->ep[epnum]) in fotg210_get_status()
753 fotg210_request_error(fotg210); in fotg210_get_status()
757 fotg210_request_error(fotg210); in fotg210_get_status()
761 fotg210->ep0_req->buf = &fotg210->ep0_data; in fotg210_get_status()
762 fotg210->ep0_req->length = 2; in fotg210_get_status()
764 spin_unlock(&fotg210->lock); in fotg210_get_status()
765 fotg210_ep_queue(fotg210->gadget.ep0, fotg210->ep0_req, GFP_ATOMIC); in fotg210_get_status()
766 spin_lock(&fotg210->lock); in fotg210_get_status()
769 static int fotg210_setup_packet(struct fotg210_udc *fotg210, in fotg210_setup_packet() argument
775 fotg210_rdsetupp(fotg210, p); in fotg210_setup_packet()
777 fotg210->ep[0]->dir_in = ctrl->bRequestType & USB_DIR_IN; in fotg210_setup_packet()
779 if (fotg210->gadget.speed == USB_SPEED_UNKNOWN) { in fotg210_setup_packet()
780 u32 value = ioread32(fotg210->reg + FOTG210_DMCR); in fotg210_setup_packet()
781 fotg210->gadget.speed = value & DMCR_HS_EN ? in fotg210_setup_packet()
789 fotg210_get_status(fotg210, ctrl); in fotg210_setup_packet()
792 fotg210_clear_feature(fotg210, ctrl); in fotg210_setup_packet()
795 fotg210_set_feature(fotg210, ctrl); in fotg210_setup_packet()
798 fotg210_set_address(fotg210, ctrl); in fotg210_setup_packet()
801 fotg210_set_configuration(fotg210); in fotg210_setup_packet()
815 static void fotg210_ep0out(struct fotg210_udc *fotg210) in fotg210_ep0out() argument
817 struct fotg210_ep *ep = fotg210->ep[0]; in fotg210_ep0out()
835 static void fotg210_ep0in(struct fotg210_udc *fotg210) in fotg210_ep0in() argument
837 struct fotg210_ep *ep = fotg210->ep[0]; in fotg210_ep0in()
851 fotg210_set_cxdone(fotg210); in fotg210_ep0in()
869 int disgr1 = ioread32(ep->fotg210->reg + FOTG210_DISGR1); in fotg210_out_fifo_handler()
884 struct fotg210_udc *fotg210 = _fotg210; in fotg210_irq() local
885 u32 int_grp = ioread32(fotg210->reg + FOTG210_DIGR); in fotg210_irq()
886 u32 int_msk = ioread32(fotg210->reg + FOTG210_DMIGR); in fotg210_irq()
890 spin_lock(&fotg210->lock); in fotg210_irq()
893 void __iomem *reg = fotg210->reg + FOTG210_DISGR2; in fotg210_irq()
895 u32 int_msk2 = ioread32(fotg210->reg + FOTG210_DMISGR2); in fotg210_irq()
900 usb_gadget_udc_reset(&fotg210->gadget, in fotg210_irq()
901 fotg210->driver); in fotg210_irq()
902 fotg210_ack_int(fotg210, FOTG210_DISGR2, DISGR2_USBRST_INT); in fotg210_irq()
906 fotg210_ack_int(fotg210, FOTG210_DISGR2, DISGR2_SUSP_INT); in fotg210_irq()
910 fotg210_ack_int(fotg210, FOTG210_DISGR2, DISGR2_RESM_INT); in fotg210_irq()
914 fotg210_ack_int(fotg210, FOTG210_DISGR2, DISGR2_ISO_SEQ_ERR_INT); in fotg210_irq()
918 fotg210_ack_int(fotg210, FOTG210_DISGR2, DISGR2_ISO_SEQ_ABORT_INT); in fotg210_irq()
922 fotg210_clear_tx0byte(fotg210); in fotg210_irq()
923 fotg210_ack_int(fotg210, FOTG210_DISGR2, DISGR2_TX0BYTE_INT); in fotg210_irq()
927 fotg210_clear_rx0byte(fotg210); in fotg210_irq()
928 fotg210_ack_int(fotg210, FOTG210_DISGR2, DISGR2_RX0BYTE_INT); in fotg210_irq()
932 fotg210_ack_int(fotg210, FOTG210_DISGR2, DISGR2_DMA_ERROR); in fotg210_irq()
937 void __iomem *reg = fotg210->reg + FOTG210_DISGR0; in fotg210_irq()
939 u32 int_msk0 = ioread32(fotg210->reg + FOTG210_DMISGR0); in fotg210_irq()
946 fotg210_ack_int(fotg210, FOTG210_DISGR0, DISGR0_CX_COMABT_INT); in fotg210_irq()
951 if (fotg210_setup_packet(fotg210, &ctrl)) { in fotg210_irq()
952 spin_unlock(&fotg210->lock); in fotg210_irq()
953 if (fotg210->driver->setup(&fotg210->gadget, in fotg210_irq()
955 fotg210_set_cxstall(fotg210); in fotg210_irq()
956 spin_lock(&fotg210->lock); in fotg210_irq()
963 fotg210_ep0in(fotg210); in fotg210_irq()
966 fotg210_ep0out(fotg210); in fotg210_irq()
969 fotg210_set_cxstall(fotg210); in fotg210_irq()
975 void __iomem *reg = fotg210->reg + FOTG210_DISGR1; in fotg210_irq()
977 u32 int_msk1 = ioread32(fotg210->reg + FOTG210_DMISGR1); in fotg210_irq()
984 fotg210_in_fifo_handler(fotg210->ep[fifo + 1]); in fotg210_irq()
988 fotg210_out_fifo_handler(fotg210->ep[fifo + 1]); in fotg210_irq()
992 spin_unlock(&fotg210->lock); in fotg210_irq()
997 static void fotg210_disable_unplug(struct fotg210_udc *fotg210) in fotg210_disable_unplug() argument
999 u32 reg = ioread32(fotg210->reg + FOTG210_PHYTMSR); in fotg210_disable_unplug()
1002 iowrite32(reg, fotg210->reg + FOTG210_PHYTMSR); in fotg210_disable_unplug()
1008 struct fotg210_udc *fotg210 = gadget_to_fotg210(g); in fotg210_udc_start() local
1013 fotg210->driver = driver; in fotg210_udc_start()
1014 fotg210->gadget.dev.of_node = fotg210->dev->of_node; in fotg210_udc_start()
1015 fotg210->gadget.speed = USB_SPEED_UNKNOWN; in fotg210_udc_start()
1017 dev_info(fotg210->dev, "bound driver %s\n", driver->driver.name); in fotg210_udc_start()
1019 if (!IS_ERR_OR_NULL(fotg210->phy)) { in fotg210_udc_start()
1020 ret = otg_set_peripheral(fotg210->phy->otg, in fotg210_udc_start()
1021 &fotg210->gadget); in fotg210_udc_start()
1023 dev_err(fotg210->dev, "can't bind to phy\n"); in fotg210_udc_start()
1027 value = ioread32(fotg210->reg + FOTG210_DMCR); in fotg210_udc_start()
1029 iowrite32(value, fotg210->reg + FOTG210_DMCR); in fotg210_udc_start()
1032 value = ioread32(fotg210->reg + FOTG210_DMCR); in fotg210_udc_start()
1034 iowrite32(value, fotg210->reg + FOTG210_DMCR); in fotg210_udc_start()
1039 static void fotg210_init(struct fotg210_udc *fotg210) in fotg210_init() argument
1045 fotg210->reg + FOTG210_GMIR); in fotg210_init()
1049 fotg210->reg + FOTG210_DMIGR); in fotg210_init()
1052 iowrite32(DMCR_SFRST, fotg210->reg + FOTG210_DMCR); in fotg210_init()
1057 value = ioread32(fotg210->reg + FOTG210_DMCR); in fotg210_init()
1059 iowrite32(value, fotg210->reg + FOTG210_DMCR); in fotg210_init()
1065 fotg210->reg + FOTG210_DMISGR2); in fotg210_init()
1068 iowrite32(~(u32)0, fotg210->reg + FOTG210_DMISGR1); in fotg210_init()
1071 value = ioread32(fotg210->reg + FOTG210_DMISGR0); in fotg210_init()
1073 iowrite32(value, fotg210->reg + FOTG210_DMISGR0); in fotg210_init()
1078 struct fotg210_udc *fotg210 = gadget_to_fotg210(g); in fotg210_udc_stop() local
1081 if (!IS_ERR_OR_NULL(fotg210->phy)) in fotg210_udc_stop()
1082 return otg_set_peripheral(fotg210->phy->otg, NULL); in fotg210_udc_stop()
1084 spin_lock_irqsave(&fotg210->lock, flags); in fotg210_udc_stop()
1086 fotg210_init(fotg210); in fotg210_udc_stop()
1087 fotg210->driver = NULL; in fotg210_udc_stop()
1088 fotg210->gadget.speed = USB_SPEED_UNKNOWN; in fotg210_udc_stop()
1090 spin_unlock_irqrestore(&fotg210->lock, flags); in fotg210_udc_stop()
1104 struct fotg210_udc *fotg210 = gadget_to_fotg210(g); in fotg210_vbus_session() local
1107 fotg210_vbus(fotg210->fotg, is_active); in fotg210_vbus_session()
1153 struct fotg210_udc *fotg210 = platform_get_drvdata(pdev); in fotg210_udc_remove() local
1156 usb_del_gadget_udc(&fotg210->gadget); in fotg210_udc_remove()
1157 if (!IS_ERR_OR_NULL(fotg210->phy)) { in fotg210_udc_remove()
1158 usb_unregister_notifier(fotg210->phy, &fotg210_phy_notifier); in fotg210_udc_remove()
1159 usb_put_phy(fotg210->phy); in fotg210_udc_remove()
1161 iounmap(fotg210->reg); in fotg210_udc_remove()
1162 free_irq(platform_get_irq(pdev, 0), fotg210); in fotg210_udc_remove()
1164 fotg210_ep_free_request(&fotg210->ep[0]->ep, fotg210->ep0_req); in fotg210_udc_remove()
1166 kfree(fotg210->ep[i]); in fotg210_udc_remove()
1168 kfree(fotg210); in fotg210_udc_remove()
1173 int fotg210_udc_probe(struct platform_device *pdev, struct fotg210 *fotg) in fotg210_udc_probe()
1175 struct fotg210_udc *fotg210 = NULL; in fotg210_udc_probe() local
1186 fotg210 = kzalloc(sizeof(struct fotg210_udc), GFP_KERNEL); in fotg210_udc_probe()
1187 if (fotg210 == NULL) in fotg210_udc_probe()
1190 fotg210->dev = dev; in fotg210_udc_probe()
1191 fotg210->fotg = fotg; in fotg210_udc_probe()
1193 fotg210->phy = devm_usb_get_phy_by_phandle(dev, "usb-phy", 0); in fotg210_udc_probe()
1194 if (IS_ERR(fotg210->phy)) { in fotg210_udc_probe()
1195 ret = PTR_ERR(fotg210->phy); in fotg210_udc_probe()
1199 fotg210->phy = NULL; in fotg210_udc_probe()
1201 ret = usb_phy_init(fotg210->phy); in fotg210_udc_probe()
1210 fotg210->ep[i] = kzalloc(sizeof(struct fotg210_ep), GFP_KERNEL); in fotg210_udc_probe()
1211 if (!fotg210->ep[i]) in fotg210_udc_probe()
1215 fotg210->reg = fotg->base; in fotg210_udc_probe()
1217 spin_lock_init(&fotg210->lock); in fotg210_udc_probe()
1219 platform_set_drvdata(pdev, fotg210); in fotg210_udc_probe()
1221 fotg210->gadget.ops = &fotg210_gadget_ops; in fotg210_udc_probe()
1223 fotg210->gadget.max_speed = USB_SPEED_HIGH; in fotg210_udc_probe()
1224 fotg210->gadget.dev.parent = dev; in fotg210_udc_probe()
1225 fotg210->gadget.dev.dma_mask = dev->dma_mask; in fotg210_udc_probe()
1226 fotg210->gadget.name = udc_name; in fotg210_udc_probe()
1228 INIT_LIST_HEAD(&fotg210->gadget.ep_list); in fotg210_udc_probe()
1231 struct fotg210_ep *ep = fotg210->ep[i]; in fotg210_udc_probe()
1234 INIT_LIST_HEAD(&fotg210->ep[i]->ep.ep_list); in fotg210_udc_probe()
1235 list_add_tail(&fotg210->ep[i]->ep.ep_list, in fotg210_udc_probe()
1236 &fotg210->gadget.ep_list); in fotg210_udc_probe()
1238 ep->fotg210 = fotg210; in fotg210_udc_probe()
1255 usb_ep_set_maxpacket_limit(&fotg210->ep[0]->ep, 0x40); in fotg210_udc_probe()
1256 fotg210->gadget.ep0 = &fotg210->ep[0]->ep; in fotg210_udc_probe()
1257 INIT_LIST_HEAD(&fotg210->gadget.ep0->ep_list); in fotg210_udc_probe()
1259 fotg210->ep0_req = fotg210_ep_alloc_request(&fotg210->ep[0]->ep, in fotg210_udc_probe()
1261 if (fotg210->ep0_req == NULL) in fotg210_udc_probe()
1264 fotg210->ep0_req->complete = fotg210_ep0_complete; in fotg210_udc_probe()
1266 fotg210_init(fotg210); in fotg210_udc_probe()
1268 fotg210_disable_unplug(fotg210); in fotg210_udc_probe()
1271 udc_name, fotg210); in fotg210_udc_probe()
1277 if (!IS_ERR_OR_NULL(fotg210->phy)) in fotg210_udc_probe()
1278 usb_register_notifier(fotg210->phy, &fotg210_phy_notifier); in fotg210_udc_probe()
1280 ret = usb_add_gadget_udc(dev, &fotg210->gadget); in fotg210_udc_probe()
1289 if (!IS_ERR_OR_NULL(fotg210->phy)) in fotg210_udc_probe()
1290 usb_unregister_notifier(fotg210->phy, &fotg210_phy_notifier); in fotg210_udc_probe()
1291 free_irq(irq, fotg210); in fotg210_udc_probe()
1294 fotg210_ep_free_request(&fotg210->ep[0]->ep, fotg210->ep0_req); in fotg210_udc_probe()
1297 iounmap(fotg210->reg); in fotg210_udc_probe()
1301 kfree(fotg210->ep[i]); in fotg210_udc_probe()
1304 kfree(fotg210); in fotg210_udc_probe()