Lines Matching refs:udc
92 struct pxa_udc *udc = s->private; in state_dbg_show() local
95 if (!udc->driver) in state_dbg_show()
103 udc->driver ? udc->driver->driver.name : "(none)"); in state_dbg_show()
105 tmp = udc_readl(udc, UDCCR); in state_dbg_show()
124 udc_readl(udc, UDCICR0), udc_readl(udc, UDCICR1)); in state_dbg_show()
126 udc_readl(udc, UDCISR0), udc_readl(udc, UDCISR1)); in state_dbg_show()
127 seq_printf(s, "udcfnr=%d\n", udc_readl(udc, UDCFNR)); in state_dbg_show()
129 udc->stats.irqs_reset, udc->stats.irqs_suspend, in state_dbg_show()
130 udc->stats.irqs_resume, udc->stats.irqs_reconfig); in state_dbg_show()
138 struct pxa_udc *udc = s->private; in queues_dbg_show() local
143 if (!udc->driver) in queues_dbg_show()
148 ep = &udc->pxa_ep[i]; in queues_dbg_show()
171 struct pxa_udc *udc = s->private; in eps_dbg_show() local
176 if (!udc->driver) in eps_dbg_show()
179 ep = &udc->pxa_ep[0]; in eps_dbg_show()
191 ep = &udc->pxa_ep[i]; in eps_dbg_show()
192 tmp = i? udc_ep_readl(ep, UDCCR) : udc_readl(udc, UDCCR); in eps_dbg_show()
206 static void pxa_init_debugfs(struct pxa_udc *udc) in pxa_init_debugfs() argument
210 root = debugfs_create_dir(udc->gadget.name, NULL); in pxa_init_debugfs()
211 udc->debugfs_root = root; in pxa_init_debugfs()
213 debugfs_create_file("udcstate", 0400, root, udc, &state_dbg_fops); in pxa_init_debugfs()
214 debugfs_create_file("queues", 0400, root, udc, &queues_dbg_fops); in pxa_init_debugfs()
215 debugfs_create_file("epstate", 0400, root, udc, &eps_dbg_fops); in pxa_init_debugfs()
218 static void pxa_cleanup_debugfs(struct pxa_udc *udc) in pxa_cleanup_debugfs() argument
220 debugfs_remove_recursive(udc->debugfs_root); in pxa_cleanup_debugfs()
224 static inline void pxa_init_debugfs(struct pxa_udc *udc) in pxa_init_debugfs() argument
228 static inline void pxa_cleanup_debugfs(struct pxa_udc *udc) in pxa_cleanup_debugfs() argument
283 static struct pxa_ep *find_pxa_ep(struct pxa_udc *udc, in find_pxa_ep() argument
288 int cfg = udc->config; in find_pxa_ep()
289 int iface = udc->last_interface; in find_pxa_ep()
290 int alt = udc->last_alternate; in find_pxa_ep()
292 if (udc_usb_ep == &udc->udc_usb_ep[0]) in find_pxa_ep()
293 return &udc->pxa_ep[0]; in find_pxa_ep()
296 ep = &udc->pxa_ep[i]; in find_pxa_ep()
313 static void update_pxa_ep_matches(struct pxa_udc *udc) in update_pxa_ep_matches() argument
319 udc_usb_ep = &udc->udc_usb_ep[i]; in update_pxa_ep_matches()
321 udc_usb_ep->pxa_ep = find_pxa_ep(udc, udc_usb_ep); in update_pxa_ep_matches()
331 struct pxa_udc *udc = ep->dev; in pio_irq_enable() local
333 u32 udcicr0 = udc_readl(udc, UDCICR0); in pio_irq_enable()
334 u32 udcicr1 = udc_readl(udc, UDCICR1); in pio_irq_enable()
337 udc_writel(udc, UDCICR0, udcicr0 | (3 << (index * 2))); in pio_irq_enable()
339 udc_writel(udc, UDCICR1, udcicr1 | (3 << ((index - 16) * 2))); in pio_irq_enable()
348 struct pxa_udc *udc = ep->dev; in pio_irq_disable() local
350 u32 udcicr0 = udc_readl(udc, UDCICR0); in pio_irq_disable()
351 u32 udcicr1 = udc_readl(udc, UDCICR1); in pio_irq_disable()
354 udc_writel(udc, UDCICR0, udcicr0 & ~(3 << (index * 2))); in pio_irq_disable()
356 udc_writel(udc, UDCICR1, udcicr1 & ~(3 << ((index - 16) * 2))); in pio_irq_disable()
366 static inline void udc_set_mask_UDCCR(struct pxa_udc *udc, int mask) in udc_set_mask_UDCCR() argument
368 u32 udccr = udc_readl(udc, UDCCR); in udc_set_mask_UDCCR()
369 udc_writel(udc, UDCCR, in udc_set_mask_UDCCR()
380 static inline void udc_clear_mask_UDCCR(struct pxa_udc *udc, int mask) in udc_clear_mask_UDCCR() argument
382 u32 udccr = udc_readl(udc, UDCCR); in udc_clear_mask_UDCCR()
383 udc_writel(udc, UDCCR, in udc_clear_mask_UDCCR()
478 static void set_ep0state(struct pxa_udc *udc, int state) in set_ep0state() argument
480 struct pxa_ep *ep = &udc->pxa_ep[0]; in set_ep0state()
481 char *old_stname = EP0_STNAME(udc); in set_ep0state()
483 udc->ep0state = state; in set_ep0state()
485 EP0_STNAME(udc), udc_ep_readl(ep, UDCCSR), in set_ep0state()
1322 struct pxa_udc *udc; in pxa_ep_enable() local
1355 udc = ep->dev; in pxa_ep_enable()
1357 if (!udc->driver || udc->gadget.speed == USB_SPEED_UNKNOWN) { in pxa_ep_enable()
1426 static void dplus_pullup(struct pxa_udc *udc, int on) in dplus_pullup() argument
1428 if (udc->gpiod) { in dplus_pullup()
1429 gpiod_set_value(udc->gpiod, on); in dplus_pullup()
1430 } else if (udc->udc_command) { in dplus_pullup()
1432 udc->udc_command(PXA2XX_UDC_CMD_CONNECT); in dplus_pullup()
1434 udc->udc_command(PXA2XX_UDC_CMD_DISCONNECT); in dplus_pullup()
1436 udc->pullup_on = on; in dplus_pullup()
1445 struct pxa_udc *udc = to_gadget_udc(_gadget); in pxa_udc_get_frame() local
1447 return (udc_readl(udc, UDCFNR) & 0x7ff); in pxa_udc_get_frame()
1458 struct pxa_udc *udc = to_gadget_udc(_gadget); in pxa_udc_wakeup() local
1461 if ((udc_readl(udc, UDCCR) & UDCCR_DWRE) == 0) in pxa_udc_wakeup()
1463 udc_set_mask_UDCCR(udc, UDCCR_UDR); in pxa_udc_wakeup()
1467 static void udc_enable(struct pxa_udc *udc);
1468 static void udc_disable(struct pxa_udc *udc);
1483 static int should_enable_udc(struct pxa_udc *udc) in should_enable_udc() argument
1487 put_on = ((udc->pullup_on) && (udc->driver)); in should_enable_udc()
1488 put_on &= ((udc->vbus_sensed) || (IS_ERR_OR_NULL(udc->transceiver))); in should_enable_udc()
1504 static int should_disable_udc(struct pxa_udc *udc) in should_disable_udc() argument
1508 put_off = ((!udc->pullup_on) || (!udc->driver)); in should_disable_udc()
1509 put_off |= ((!udc->vbus_sensed) && (!IS_ERR_OR_NULL(udc->transceiver))); in should_disable_udc()
1523 struct pxa_udc *udc = to_gadget_udc(_gadget); in pxa_udc_pullup() local
1525 if (!udc->gpiod && !udc->udc_command) in pxa_udc_pullup()
1528 dplus_pullup(udc, is_active); in pxa_udc_pullup()
1530 if (should_enable_udc(udc)) in pxa_udc_pullup()
1531 udc_enable(udc); in pxa_udc_pullup()
1532 if (should_disable_udc(udc)) in pxa_udc_pullup()
1533 udc_disable(udc); in pxa_udc_pullup()
1549 struct pxa_udc *udc = to_gadget_udc(_gadget); in pxa_udc_vbus_session() local
1551 udc->vbus_sensed = is_active; in pxa_udc_vbus_session()
1552 if (should_enable_udc(udc)) in pxa_udc_vbus_session()
1553 udc_enable(udc); in pxa_udc_vbus_session()
1554 if (should_disable_udc(udc)) in pxa_udc_vbus_session()
1555 udc_disable(udc); in pxa_udc_vbus_session()
1574 struct pxa_udc *udc; in pxa_udc_vbus_draw() local
1576 udc = to_gadget_udc(_gadget); in pxa_udc_vbus_draw()
1577 if (!IS_ERR_OR_NULL(udc->transceiver)) in pxa_udc_vbus_draw()
1578 return usb_phy_set_power(udc->transceiver, mA); in pxa_udc_vbus_draw()
1635 static void udc_disable(struct pxa_udc *udc) in udc_disable() argument
1637 if (!udc->enabled) in udc_disable()
1640 udc_writel(udc, UDCICR0, 0); in udc_disable()
1641 udc_writel(udc, UDCICR1, 0); in udc_disable()
1643 udc_clear_mask_UDCCR(udc, UDCCR_UDE); in udc_disable()
1645 ep0_idle(udc); in udc_disable()
1646 udc->gadget.speed = USB_SPEED_UNKNOWN; in udc_disable()
1647 clk_disable(udc->clk); in udc_disable()
1649 udc->enabled = 0; in udc_disable()
1696 static void udc_enable(struct pxa_udc *udc) in udc_enable() argument
1698 if (udc->enabled) in udc_enable()
1701 clk_enable(udc->clk); in udc_enable()
1702 udc_writel(udc, UDCICR0, 0); in udc_enable()
1703 udc_writel(udc, UDCICR1, 0); in udc_enable()
1704 udc_clear_mask_UDCCR(udc, UDCCR_UDE); in udc_enable()
1706 ep0_idle(udc); in udc_enable()
1707 udc->gadget.speed = USB_SPEED_FULL; in udc_enable()
1708 memset(&udc->stats, 0, sizeof(udc->stats)); in udc_enable()
1710 pxa_eps_setup(udc); in udc_enable()
1711 udc_set_mask_UDCCR(udc, UDCCR_UDE); in udc_enable()
1712 ep_write_UDCCSR(&udc->pxa_ep[0], UDCCSR0_ACM); in udc_enable()
1714 if (udc_readl(udc, UDCCR) & UDCCR_EMCE) in udc_enable()
1715 dev_err(udc->dev, "Configuration errors, udc disabled\n"); in udc_enable()
1723 udc_writel(udc, UDCICR1, in udc_enable()
1728 pio_irq_enable(&udc->pxa_ep[0]); in udc_enable()
1730 udc->enabled = 1; in udc_enable()
1751 struct pxa_udc *udc = to_pxa(g); in pxa27x_udc_start() local
1755 udc->driver = driver; in pxa27x_udc_start()
1757 if (!IS_ERR_OR_NULL(udc->transceiver)) { in pxa27x_udc_start()
1758 retval = otg_set_peripheral(udc->transceiver->otg, in pxa27x_udc_start()
1759 &udc->gadget); in pxa27x_udc_start()
1761 dev_err(udc->dev, "can't bind to transceiver\n"); in pxa27x_udc_start()
1766 if (should_enable_udc(udc)) in pxa27x_udc_start()
1767 udc_enable(udc); in pxa27x_udc_start()
1771 udc->driver = NULL; in pxa27x_udc_start()
1783 static void stop_activity(struct pxa_udc *udc) in stop_activity() argument
1787 udc->gadget.speed = USB_SPEED_UNKNOWN; in stop_activity()
1790 pxa_ep_disable(&udc->udc_usb_ep[i].usb_ep); in stop_activity()
1801 struct pxa_udc *udc = to_pxa(g); in pxa27x_udc_stop() local
1803 stop_activity(udc); in pxa27x_udc_stop()
1804 udc_disable(udc); in pxa27x_udc_stop()
1806 udc->driver = NULL; in pxa27x_udc_stop()
1808 if (!IS_ERR_OR_NULL(udc->transceiver)) in pxa27x_udc_stop()
1809 return otg_set_peripheral(udc->transceiver->otg, NULL); in pxa27x_udc_stop()
1818 static void handle_ep0_ctrl_req(struct pxa_udc *udc, in handle_ep0_ctrl_req() argument
1821 struct pxa_ep *ep = &udc->pxa_ep[0]; in handle_ep0_ctrl_req()
1863 set_ep0state(udc, IN_DATA_STAGE); in handle_ep0_ctrl_req()
1865 set_ep0state(udc, OUT_DATA_STAGE); in handle_ep0_ctrl_req()
1871 i = udc->driver->setup(&udc->gadget, &u.r); in handle_ep0_ctrl_req()
1882 set_ep0state(udc, STALL); in handle_ep0_ctrl_req()
1934 static void handle_ep0(struct pxa_udc *udc, int fifo_irq, int opc_irq) in handle_ep0() argument
1937 struct pxa_ep *ep = &udc->pxa_ep[0]; in handle_ep0()
1946 EP0_STNAME(udc), req, udccsr0, udc_ep_readl(ep, UDCBCR), in handle_ep0()
1953 ep0_idle(udc); in handle_ep0()
1958 set_ep0state(udc, SETUP_STAGE); in handle_ep0()
1961 switch (udc->ep0state) { in handle_ep0()
1973 handle_ep0_ctrl_req(udc, req); in handle_ep0()
1999 ep0_idle(udc); in handle_ep0()
2005 ep0_idle(udc); in handle_ep0()
2081 static void pxa27x_change_configuration(struct pxa_udc *udc, int config) in pxa27x_change_configuration() argument
2085 dev_dbg(udc->dev, "config=%d\n", config); in pxa27x_change_configuration()
2087 udc->config = config; in pxa27x_change_configuration()
2088 udc->last_interface = 0; in pxa27x_change_configuration()
2089 udc->last_alternate = 0; in pxa27x_change_configuration()
2097 set_ep0state(udc, WAIT_ACK_SET_CONF_INTERF); in pxa27x_change_configuration()
2098 udc->driver->setup(&udc->gadget, &req); in pxa27x_change_configuration()
2099 ep_write_UDCCSR(&udc->pxa_ep[0], UDCCSR0_AREN); in pxa27x_change_configuration()
2111 static void pxa27x_change_interface(struct pxa_udc *udc, int iface, int alt) in pxa27x_change_interface() argument
2115 dev_dbg(udc->dev, "interface=%d, alternate setting=%d\n", iface, alt); in pxa27x_change_interface()
2117 udc->last_interface = iface; in pxa27x_change_interface()
2118 udc->last_alternate = alt; in pxa27x_change_interface()
2126 set_ep0state(udc, WAIT_ACK_SET_CONF_INTERF); in pxa27x_change_interface()
2127 udc->driver->setup(&udc->gadget, &req); in pxa27x_change_interface()
2128 ep_write_UDCCSR(&udc->pxa_ep[0], UDCCSR0_AREN); in pxa27x_change_interface()
2138 static void irq_handle_data(int irq, struct pxa_udc *udc) in irq_handle_data() argument
2142 u32 udcisr0 = udc_readl(udc, UDCISR0) & UDCCISR0_EP_MASK; in irq_handle_data()
2143 u32 udcisr1 = udc_readl(udc, UDCISR1) & UDCCISR1_EP_MASK; in irq_handle_data()
2146 udc->pxa_ep[0].stats.irqs++; in irq_handle_data()
2147 udc_writel(udc, UDCISR0, UDCISR_INT(0, UDCISR_INT_MASK)); in irq_handle_data()
2148 handle_ep0(udc, !!(udcisr0 & UDCICR_FIFOERR), in irq_handle_data()
2157 udc_writel(udc, UDCISR0, UDCISR_INT(i, UDCISR_INT_MASK)); in irq_handle_data()
2159 WARN_ON(i >= ARRAY_SIZE(udc->pxa_ep)); in irq_handle_data()
2160 if (i < ARRAY_SIZE(udc->pxa_ep)) { in irq_handle_data()
2161 ep = &udc->pxa_ep[i]; in irq_handle_data()
2168 udc_writel(udc, UDCISR1, UDCISR_INT(i - 16, UDCISR_INT_MASK)); in irq_handle_data()
2172 WARN_ON(i >= ARRAY_SIZE(udc->pxa_ep)); in irq_handle_data()
2173 if (i < ARRAY_SIZE(udc->pxa_ep)) { in irq_handle_data()
2174 ep = &udc->pxa_ep[i]; in irq_handle_data()
2186 static void irq_udc_suspend(struct pxa_udc *udc) in irq_udc_suspend() argument
2188 udc_writel(udc, UDCISR1, UDCISR1_IRSU); in irq_udc_suspend()
2189 udc->stats.irqs_suspend++; in irq_udc_suspend()
2191 if (udc->gadget.speed != USB_SPEED_UNKNOWN in irq_udc_suspend()
2192 && udc->driver && udc->driver->suspend) in irq_udc_suspend()
2193 udc->driver->suspend(&udc->gadget); in irq_udc_suspend()
2194 ep0_idle(udc); in irq_udc_suspend()
2201 static void irq_udc_resume(struct pxa_udc *udc) in irq_udc_resume() argument
2203 udc_writel(udc, UDCISR1, UDCISR1_IRRU); in irq_udc_resume()
2204 udc->stats.irqs_resume++; in irq_udc_resume()
2206 if (udc->gadget.speed != USB_SPEED_UNKNOWN in irq_udc_resume()
2207 && udc->driver && udc->driver->resume) in irq_udc_resume()
2208 udc->driver->resume(&udc->gadget); in irq_udc_resume()
2215 static void irq_udc_reconfig(struct pxa_udc *udc) in irq_udc_reconfig() argument
2218 u32 udccr = udc_readl(udc, UDCCR); in irq_udc_reconfig()
2220 udc_writel(udc, UDCISR1, UDCISR1_IRCC); in irq_udc_reconfig()
2221 udc->stats.irqs_reconfig++; in irq_udc_reconfig()
2224 config_change = (config != udc->config); in irq_udc_reconfig()
2225 pxa27x_change_configuration(udc, config); in irq_udc_reconfig()
2229 pxa27x_change_interface(udc, interface, alternate); in irq_udc_reconfig()
2232 update_pxa_ep_matches(udc); in irq_udc_reconfig()
2233 udc_set_mask_UDCCR(udc, UDCCR_SMAC); in irq_udc_reconfig()
2240 static void irq_udc_reset(struct pxa_udc *udc) in irq_udc_reset() argument
2242 u32 udccr = udc_readl(udc, UDCCR); in irq_udc_reset()
2243 struct pxa_ep *ep = &udc->pxa_ep[0]; in irq_udc_reset()
2245 dev_info(udc->dev, "USB reset\n"); in irq_udc_reset()
2246 udc_writel(udc, UDCISR1, UDCISR1_IRRS); in irq_udc_reset()
2247 udc->stats.irqs_reset++; in irq_udc_reset()
2250 dev_dbg(udc->dev, "USB reset start\n"); in irq_udc_reset()
2251 stop_activity(udc); in irq_udc_reset()
2253 udc->gadget.speed = USB_SPEED_FULL; in irq_udc_reset()
2254 memset(&udc->stats, 0, sizeof udc->stats); in irq_udc_reset()
2258 ep0_idle(udc); in irq_udc_reset()
2270 struct pxa_udc *udc = _dev; in pxa_udc_irq() local
2271 u32 udcisr0 = udc_readl(udc, UDCISR0); in pxa_udc_irq()
2272 u32 udcisr1 = udc_readl(udc, UDCISR1); in pxa_udc_irq()
2273 u32 udccr = udc_readl(udc, UDCCR); in pxa_udc_irq()
2276 dev_vdbg(udc->dev, "Interrupt, UDCISR0:0x%08x, UDCISR1:0x%08x, " in pxa_udc_irq()
2281 irq_udc_suspend(udc); in pxa_udc_irq()
2283 irq_udc_resume(udc); in pxa_udc_irq()
2285 irq_udc_reconfig(udc); in pxa_udc_irq()
2287 irq_udc_reset(udc); in pxa_udc_irq()
2290 irq_handle_data(irq, udc); in pxa_udc_irq()
2360 struct pxa_udc *udc = &memory; in pxa_udc_probe() local
2374 udc->gpiod = gpio_to_desc(mach->gpio_pullup); in pxa_udc_probe()
2376 udc->udc_command = mach->udc_command; in pxa_udc_probe()
2378 udc->gpiod = devm_gpiod_get(&pdev->dev, NULL, GPIOD_ASIS); in pxa_udc_probe()
2382 udc->regs = devm_ioremap_resource(&pdev->dev, regs); in pxa_udc_probe()
2383 if (IS_ERR(udc->regs)) in pxa_udc_probe()
2384 return PTR_ERR(udc->regs); in pxa_udc_probe()
2385 udc->irq = platform_get_irq(pdev, 0); in pxa_udc_probe()
2386 if (udc->irq < 0) in pxa_udc_probe()
2387 return udc->irq; in pxa_udc_probe()
2389 udc->dev = &pdev->dev; in pxa_udc_probe()
2391 udc->transceiver = in pxa_udc_probe()
2392 devm_usb_get_phy_by_phandle(udc->dev, "phys", 0); in pxa_udc_probe()
2393 if (IS_ERR(udc->transceiver)) in pxa_udc_probe()
2394 return PTR_ERR(udc->transceiver); in pxa_udc_probe()
2396 udc->transceiver = usb_get_phy(USB_PHY_TYPE_USB2); in pxa_udc_probe()
2399 if (IS_ERR(udc->gpiod)) { in pxa_udc_probe()
2401 PTR_ERR(udc->gpiod)); in pxa_udc_probe()
2402 return PTR_ERR(udc->gpiod); in pxa_udc_probe()
2404 if (udc->gpiod) in pxa_udc_probe()
2405 gpiod_direction_output(udc->gpiod, 0); in pxa_udc_probe()
2407 udc->clk = devm_clk_get(&pdev->dev, NULL); in pxa_udc_probe()
2408 if (IS_ERR(udc->clk)) in pxa_udc_probe()
2409 return PTR_ERR(udc->clk); in pxa_udc_probe()
2411 retval = clk_prepare(udc->clk); in pxa_udc_probe()
2415 udc->vbus_sensed = 0; in pxa_udc_probe()
2417 the_controller = udc; in pxa_udc_probe()
2418 platform_set_drvdata(pdev, udc); in pxa_udc_probe()
2419 udc_init_data(udc); in pxa_udc_probe()
2422 retval = devm_request_irq(&pdev->dev, udc->irq, pxa_udc_irq, in pxa_udc_probe()
2423 IRQF_SHARED, driver_name, udc); in pxa_udc_probe()
2425 dev_err(udc->dev, "%s: can't get irq %i, err %d\n", in pxa_udc_probe()
2426 driver_name, udc->irq, retval); in pxa_udc_probe()
2430 if (!IS_ERR_OR_NULL(udc->transceiver)) in pxa_udc_probe()
2431 usb_register_notifier(udc->transceiver, &pxa27x_udc_phy); in pxa_udc_probe()
2432 retval = usb_add_gadget_udc(&pdev->dev, &udc->gadget); in pxa_udc_probe()
2436 pxa_init_debugfs(udc); in pxa_udc_probe()
2437 if (should_enable_udc(udc)) in pxa_udc_probe()
2438 udc_enable(udc); in pxa_udc_probe()
2442 if (!IS_ERR_OR_NULL(udc->transceiver)) in pxa_udc_probe()
2443 usb_unregister_notifier(udc->transceiver, &pxa27x_udc_phy); in pxa_udc_probe()
2445 clk_unprepare(udc->clk); in pxa_udc_probe()
2455 struct pxa_udc *udc = platform_get_drvdata(_dev); in pxa_udc_remove() local
2457 usb_del_gadget_udc(&udc->gadget); in pxa_udc_remove()
2458 pxa_cleanup_debugfs(udc); in pxa_udc_remove()
2460 if (!IS_ERR_OR_NULL(udc->transceiver)) { in pxa_udc_remove()
2461 usb_unregister_notifier(udc->transceiver, &pxa27x_udc_phy); in pxa_udc_remove()
2462 usb_put_phy(udc->transceiver); in pxa_udc_remove()
2465 udc->transceiver = NULL; in pxa_udc_remove()
2467 clk_unprepare(udc->clk); in pxa_udc_remove()
2474 struct pxa_udc *udc = platform_get_drvdata(_dev); in pxa_udc_shutdown() local
2476 if (udc_readl(udc, UDCCR) & UDCCR_UDE) in pxa_udc_shutdown()
2477 udc_disable(udc); in pxa_udc_shutdown()
2497 struct pxa_udc *udc = platform_get_drvdata(_dev); in pxa_udc_suspend() local
2500 ep = &udc->pxa_ep[0]; in pxa_udc_suspend()
2501 udc->udccsr0 = udc_ep_readl(ep, UDCCSR); in pxa_udc_suspend()
2503 udc_disable(udc); in pxa_udc_suspend()
2504 udc->pullup_resume = udc->pullup_on; in pxa_udc_suspend()
2505 dplus_pullup(udc, 0); in pxa_udc_suspend()
2507 if (udc->driver) in pxa_udc_suspend()
2508 udc->driver->disconnect(&udc->gadget); in pxa_udc_suspend()
2522 struct pxa_udc *udc = platform_get_drvdata(_dev); in pxa_udc_resume() local
2525 ep = &udc->pxa_ep[0]; in pxa_udc_resume()
2526 udc_ep_writel(ep, UDCCSR, udc->udccsr0 & (UDCCSR0_FST | UDCCSR0_DME)); in pxa_udc_resume()
2528 dplus_pullup(udc, udc->pullup_resume); in pxa_udc_resume()
2529 if (should_enable_udc(udc)) in pxa_udc_resume()
2530 udc_enable(udc); in pxa_udc_resume()