Lines Matching refs:udc

95 	struct pxa_udc *udc = s->private;  in state_dbg_show()  local
98 if (!udc->driver) in state_dbg_show()
106 udc->driver ? udc->driver->driver.name : "(none)"); in state_dbg_show()
108 tmp = udc_readl(udc, UDCCR); in state_dbg_show()
127 udc_readl(udc, UDCICR0), udc_readl(udc, UDCICR1)); in state_dbg_show()
129 udc_readl(udc, UDCISR0), udc_readl(udc, UDCISR1)); in state_dbg_show()
130 seq_printf(s, "udcfnr=%d\n", udc_readl(udc, UDCFNR)); in state_dbg_show()
132 udc->stats.irqs_reset, udc->stats.irqs_suspend, in state_dbg_show()
133 udc->stats.irqs_resume, udc->stats.irqs_reconfig); in state_dbg_show()
140 struct pxa_udc *udc = s->private; in queues_dbg_show() local
145 if (!udc->driver) in queues_dbg_show()
150 ep = &udc->pxa_ep[i]; in queues_dbg_show()
172 struct pxa_udc *udc = s->private; in eps_dbg_show() local
177 if (!udc->driver) in eps_dbg_show()
180 ep = &udc->pxa_ep[0]; in eps_dbg_show()
192 ep = &udc->pxa_ep[i]; in eps_dbg_show()
193 tmp = i? udc_ep_readl(ep, UDCCR) : udc_readl(udc, UDCCR); in eps_dbg_show()
245 static void pxa_init_debugfs(struct pxa_udc *udc) in pxa_init_debugfs() argument
249 root = debugfs_create_dir(udc->gadget.name, NULL); in pxa_init_debugfs()
253 state = debugfs_create_file("udcstate", 0400, root, udc, in pxa_init_debugfs()
257 queues = debugfs_create_file("queues", 0400, root, udc, in pxa_init_debugfs()
261 eps = debugfs_create_file("epstate", 0400, root, udc, in pxa_init_debugfs()
266 udc->debugfs_root = root; in pxa_init_debugfs()
267 udc->debugfs_state = state; in pxa_init_debugfs()
268 udc->debugfs_queues = queues; in pxa_init_debugfs()
269 udc->debugfs_eps = eps; in pxa_init_debugfs()
278 dev_err(udc->dev, "debugfs is not available\n"); in pxa_init_debugfs()
281 static void pxa_cleanup_debugfs(struct pxa_udc *udc) in pxa_cleanup_debugfs() argument
283 debugfs_remove(udc->debugfs_eps); in pxa_cleanup_debugfs()
284 debugfs_remove(udc->debugfs_queues); in pxa_cleanup_debugfs()
285 debugfs_remove(udc->debugfs_state); in pxa_cleanup_debugfs()
286 debugfs_remove(udc->debugfs_root); in pxa_cleanup_debugfs()
287 udc->debugfs_eps = NULL; in pxa_cleanup_debugfs()
288 udc->debugfs_queues = NULL; in pxa_cleanup_debugfs()
289 udc->debugfs_state = NULL; in pxa_cleanup_debugfs()
290 udc->debugfs_root = NULL; in pxa_cleanup_debugfs()
294 static inline void pxa_init_debugfs(struct pxa_udc *udc) in pxa_init_debugfs() argument
298 static inline void pxa_cleanup_debugfs(struct pxa_udc *udc) in pxa_cleanup_debugfs() argument
353 static struct pxa_ep *find_pxa_ep(struct pxa_udc *udc, in find_pxa_ep() argument
358 int cfg = udc->config; in find_pxa_ep()
359 int iface = udc->last_interface; in find_pxa_ep()
360 int alt = udc->last_alternate; in find_pxa_ep()
362 if (udc_usb_ep == &udc->udc_usb_ep[0]) in find_pxa_ep()
363 return &udc->pxa_ep[0]; in find_pxa_ep()
366 ep = &udc->pxa_ep[i]; in find_pxa_ep()
383 static void update_pxa_ep_matches(struct pxa_udc *udc) in update_pxa_ep_matches() argument
389 udc_usb_ep = &udc->udc_usb_ep[i]; in update_pxa_ep_matches()
391 udc_usb_ep->pxa_ep = find_pxa_ep(udc, udc_usb_ep); in update_pxa_ep_matches()
401 struct pxa_udc *udc = ep->dev; in pio_irq_enable() local
403 u32 udcicr0 = udc_readl(udc, UDCICR0); in pio_irq_enable()
404 u32 udcicr1 = udc_readl(udc, UDCICR1); in pio_irq_enable()
407 udc_writel(udc, UDCICR0, udcicr0 | (3 << (index * 2))); in pio_irq_enable()
409 udc_writel(udc, UDCICR1, udcicr1 | (3 << ((index - 16) * 2))); in pio_irq_enable()
418 struct pxa_udc *udc = ep->dev; in pio_irq_disable() local
420 u32 udcicr0 = udc_readl(udc, UDCICR0); in pio_irq_disable()
421 u32 udcicr1 = udc_readl(udc, UDCICR1); in pio_irq_disable()
424 udc_writel(udc, UDCICR0, udcicr0 & ~(3 << (index * 2))); in pio_irq_disable()
426 udc_writel(udc, UDCICR1, udcicr1 & ~(3 << ((index - 16) * 2))); in pio_irq_disable()
436 static inline void udc_set_mask_UDCCR(struct pxa_udc *udc, int mask) in udc_set_mask_UDCCR() argument
438 u32 udccr = udc_readl(udc, UDCCR); in udc_set_mask_UDCCR()
439 udc_writel(udc, UDCCR, in udc_set_mask_UDCCR()
450 static inline void udc_clear_mask_UDCCR(struct pxa_udc *udc, int mask) in udc_clear_mask_UDCCR() argument
452 u32 udccr = udc_readl(udc, UDCCR); in udc_clear_mask_UDCCR()
453 udc_writel(udc, UDCCR, in udc_clear_mask_UDCCR()
548 static void set_ep0state(struct pxa_udc *udc, int state) in set_ep0state() argument
550 struct pxa_ep *ep = &udc->pxa_ep[0]; in set_ep0state()
551 char *old_stname = EP0_STNAME(udc); in set_ep0state()
553 udc->ep0state = state; in set_ep0state()
555 EP0_STNAME(udc), udc_ep_readl(ep, UDCCSR), in set_ep0state()
1395 struct pxa_udc *udc; in pxa_ep_enable() local
1428 udc = ep->dev; in pxa_ep_enable()
1430 if (!udc->driver || udc->gadget.speed == USB_SPEED_UNKNOWN) { in pxa_ep_enable()
1499 static void dplus_pullup(struct pxa_udc *udc, int on) in dplus_pullup() argument
1501 if (udc->gpiod) { in dplus_pullup()
1502 gpiod_set_value(udc->gpiod, on); in dplus_pullup()
1503 } else if (udc->udc_command) { in dplus_pullup()
1505 udc->udc_command(PXA2XX_UDC_CMD_CONNECT); in dplus_pullup()
1507 udc->udc_command(PXA2XX_UDC_CMD_DISCONNECT); in dplus_pullup()
1509 udc->pullup_on = on; in dplus_pullup()
1518 struct pxa_udc *udc = to_gadget_udc(_gadget); in pxa_udc_get_frame() local
1520 return (udc_readl(udc, UDCFNR) & 0x7ff); in pxa_udc_get_frame()
1531 struct pxa_udc *udc = to_gadget_udc(_gadget); in pxa_udc_wakeup() local
1534 if ((udc_readl(udc, UDCCR) & UDCCR_DWRE) == 0) in pxa_udc_wakeup()
1536 udc_set_mask_UDCCR(udc, UDCCR_UDR); in pxa_udc_wakeup()
1540 static void udc_enable(struct pxa_udc *udc);
1541 static void udc_disable(struct pxa_udc *udc);
1556 static int should_enable_udc(struct pxa_udc *udc) in should_enable_udc() argument
1560 put_on = ((udc->pullup_on) && (udc->driver)); in should_enable_udc()
1561 put_on &= ((udc->vbus_sensed) || (IS_ERR_OR_NULL(udc->transceiver))); in should_enable_udc()
1577 static int should_disable_udc(struct pxa_udc *udc) in should_disable_udc() argument
1581 put_off = ((!udc->pullup_on) || (!udc->driver)); in should_disable_udc()
1582 put_off |= ((!udc->vbus_sensed) && (!IS_ERR_OR_NULL(udc->transceiver))); in should_disable_udc()
1596 struct pxa_udc *udc = to_gadget_udc(_gadget); in pxa_udc_pullup() local
1598 if (!udc->gpiod && !udc->udc_command) in pxa_udc_pullup()
1601 dplus_pullup(udc, is_active); in pxa_udc_pullup()
1603 if (should_enable_udc(udc)) in pxa_udc_pullup()
1604 udc_enable(udc); in pxa_udc_pullup()
1605 if (should_disable_udc(udc)) in pxa_udc_pullup()
1606 udc_disable(udc); in pxa_udc_pullup()
1610 static void udc_enable(struct pxa_udc *udc);
1611 static void udc_disable(struct pxa_udc *udc);
1625 struct pxa_udc *udc = to_gadget_udc(_gadget); in pxa_udc_vbus_session() local
1627 udc->vbus_sensed = is_active; in pxa_udc_vbus_session()
1628 if (should_enable_udc(udc)) in pxa_udc_vbus_session()
1629 udc_enable(udc); in pxa_udc_vbus_session()
1630 if (should_disable_udc(udc)) in pxa_udc_vbus_session()
1631 udc_disable(udc); in pxa_udc_vbus_session()
1650 struct pxa_udc *udc; in pxa_udc_vbus_draw() local
1652 udc = to_gadget_udc(_gadget); in pxa_udc_vbus_draw()
1653 if (!IS_ERR_OR_NULL(udc->transceiver)) in pxa_udc_vbus_draw()
1654 return usb_phy_set_power(udc->transceiver, mA); in pxa_udc_vbus_draw()
1680 static void udc_disable(struct pxa_udc *udc) in udc_disable() argument
1682 if (!udc->enabled) in udc_disable()
1685 udc_writel(udc, UDCICR0, 0); in udc_disable()
1686 udc_writel(udc, UDCICR1, 0); in udc_disable()
1688 udc_clear_mask_UDCCR(udc, UDCCR_UDE); in udc_disable()
1690 ep0_idle(udc); in udc_disable()
1691 udc->gadget.speed = USB_SPEED_UNKNOWN; in udc_disable()
1692 clk_disable(udc->clk); in udc_disable()
1694 udc->enabled = 0; in udc_disable()
1740 static void udc_enable(struct pxa_udc *udc) in udc_enable() argument
1742 if (udc->enabled) in udc_enable()
1745 clk_enable(udc->clk); in udc_enable()
1746 udc_writel(udc, UDCICR0, 0); in udc_enable()
1747 udc_writel(udc, UDCICR1, 0); in udc_enable()
1748 udc_clear_mask_UDCCR(udc, UDCCR_UDE); in udc_enable()
1750 ep0_idle(udc); in udc_enable()
1751 udc->gadget.speed = USB_SPEED_FULL; in udc_enable()
1752 memset(&udc->stats, 0, sizeof(udc->stats)); in udc_enable()
1754 pxa_eps_setup(udc); in udc_enable()
1755 udc_set_mask_UDCCR(udc, UDCCR_UDE); in udc_enable()
1756 ep_write_UDCCSR(&udc->pxa_ep[0], UDCCSR0_ACM); in udc_enable()
1758 if (udc_readl(udc, UDCCR) & UDCCR_EMCE) in udc_enable()
1759 dev_err(udc->dev, "Configuration errors, udc disabled\n"); in udc_enable()
1767 udc_writel(udc, UDCICR1, in udc_enable()
1772 pio_irq_enable(&udc->pxa_ep[0]); in udc_enable()
1774 udc->enabled = 1; in udc_enable()
1795 struct pxa_udc *udc = to_pxa(g); in pxa27x_udc_start() local
1799 udc->driver = driver; in pxa27x_udc_start()
1801 if (!IS_ERR_OR_NULL(udc->transceiver)) { in pxa27x_udc_start()
1802 retval = otg_set_peripheral(udc->transceiver->otg, in pxa27x_udc_start()
1803 &udc->gadget); in pxa27x_udc_start()
1805 dev_err(udc->dev, "can't bind to transceiver\n"); in pxa27x_udc_start()
1810 if (should_enable_udc(udc)) in pxa27x_udc_start()
1811 udc_enable(udc); in pxa27x_udc_start()
1815 udc->driver = NULL; in pxa27x_udc_start()
1827 static void stop_activity(struct pxa_udc *udc, struct usb_gadget_driver *driver) in stop_activity() argument
1832 if (udc->gadget.speed == USB_SPEED_UNKNOWN) in stop_activity()
1834 udc->gadget.speed = USB_SPEED_UNKNOWN; in stop_activity()
1837 pxa_ep_disable(&udc->udc_usb_ep[i].usb_ep); in stop_activity()
1848 struct pxa_udc *udc = to_pxa(g); in pxa27x_udc_stop() local
1850 stop_activity(udc, NULL); in pxa27x_udc_stop()
1851 udc_disable(udc); in pxa27x_udc_stop()
1853 udc->driver = NULL; in pxa27x_udc_stop()
1855 if (!IS_ERR_OR_NULL(udc->transceiver)) in pxa27x_udc_stop()
1856 return otg_set_peripheral(udc->transceiver->otg, NULL); in pxa27x_udc_stop()
1865 static void handle_ep0_ctrl_req(struct pxa_udc *udc, in handle_ep0_ctrl_req() argument
1868 struct pxa_ep *ep = &udc->pxa_ep[0]; in handle_ep0_ctrl_req()
1910 set_ep0state(udc, IN_DATA_STAGE); in handle_ep0_ctrl_req()
1912 set_ep0state(udc, OUT_DATA_STAGE); in handle_ep0_ctrl_req()
1918 i = udc->driver->setup(&udc->gadget, &u.r); in handle_ep0_ctrl_req()
1929 set_ep0state(udc, STALL); in handle_ep0_ctrl_req()
1981 static void handle_ep0(struct pxa_udc *udc, int fifo_irq, int opc_irq) in handle_ep0() argument
1984 struct pxa_ep *ep = &udc->pxa_ep[0]; in handle_ep0()
1993 EP0_STNAME(udc), req, udccsr0, udc_ep_readl(ep, UDCBCR), in handle_ep0()
2000 ep0_idle(udc); in handle_ep0()
2005 set_ep0state(udc, SETUP_STAGE); in handle_ep0()
2008 switch (udc->ep0state) { in handle_ep0()
2020 handle_ep0_ctrl_req(udc, req); in handle_ep0()
2046 ep0_idle(udc); in handle_ep0()
2052 ep0_idle(udc); in handle_ep0()
2128 static void pxa27x_change_configuration(struct pxa_udc *udc, int config) in pxa27x_change_configuration() argument
2132 dev_dbg(udc->dev, "config=%d\n", config); in pxa27x_change_configuration()
2134 udc->config = config; in pxa27x_change_configuration()
2135 udc->last_interface = 0; in pxa27x_change_configuration()
2136 udc->last_alternate = 0; in pxa27x_change_configuration()
2144 set_ep0state(udc, WAIT_ACK_SET_CONF_INTERF); in pxa27x_change_configuration()
2145 udc->driver->setup(&udc->gadget, &req); in pxa27x_change_configuration()
2146 ep_write_UDCCSR(&udc->pxa_ep[0], UDCCSR0_AREN); in pxa27x_change_configuration()
2158 static void pxa27x_change_interface(struct pxa_udc *udc, int iface, int alt) in pxa27x_change_interface() argument
2162 dev_dbg(udc->dev, "interface=%d, alternate setting=%d\n", iface, alt); in pxa27x_change_interface()
2164 udc->last_interface = iface; in pxa27x_change_interface()
2165 udc->last_alternate = alt; in pxa27x_change_interface()
2173 set_ep0state(udc, WAIT_ACK_SET_CONF_INTERF); in pxa27x_change_interface()
2174 udc->driver->setup(&udc->gadget, &req); in pxa27x_change_interface()
2175 ep_write_UDCCSR(&udc->pxa_ep[0], UDCCSR0_AREN); in pxa27x_change_interface()
2185 static void irq_handle_data(int irq, struct pxa_udc *udc) in irq_handle_data() argument
2189 u32 udcisr0 = udc_readl(udc, UDCISR0) & UDCCISR0_EP_MASK; in irq_handle_data()
2190 u32 udcisr1 = udc_readl(udc, UDCISR1) & UDCCISR1_EP_MASK; in irq_handle_data()
2193 udc->pxa_ep[0].stats.irqs++; in irq_handle_data()
2194 udc_writel(udc, UDCISR0, UDCISR_INT(0, UDCISR_INT_MASK)); in irq_handle_data()
2195 handle_ep0(udc, !!(udcisr0 & UDCICR_FIFOERR), in irq_handle_data()
2204 udc_writel(udc, UDCISR0, UDCISR_INT(i, UDCISR_INT_MASK)); in irq_handle_data()
2206 WARN_ON(i >= ARRAY_SIZE(udc->pxa_ep)); in irq_handle_data()
2207 if (i < ARRAY_SIZE(udc->pxa_ep)) { in irq_handle_data()
2208 ep = &udc->pxa_ep[i]; in irq_handle_data()
2215 udc_writel(udc, UDCISR1, UDCISR_INT(i - 16, UDCISR_INT_MASK)); in irq_handle_data()
2219 WARN_ON(i >= ARRAY_SIZE(udc->pxa_ep)); in irq_handle_data()
2220 if (i < ARRAY_SIZE(udc->pxa_ep)) { in irq_handle_data()
2221 ep = &udc->pxa_ep[i]; in irq_handle_data()
2233 static void irq_udc_suspend(struct pxa_udc *udc) in irq_udc_suspend() argument
2235 udc_writel(udc, UDCISR1, UDCISR1_IRSU); in irq_udc_suspend()
2236 udc->stats.irqs_suspend++; in irq_udc_suspend()
2238 if (udc->gadget.speed != USB_SPEED_UNKNOWN in irq_udc_suspend()
2239 && udc->driver && udc->driver->suspend) in irq_udc_suspend()
2240 udc->driver->suspend(&udc->gadget); in irq_udc_suspend()
2241 ep0_idle(udc); in irq_udc_suspend()
2248 static void irq_udc_resume(struct pxa_udc *udc) in irq_udc_resume() argument
2250 udc_writel(udc, UDCISR1, UDCISR1_IRRU); in irq_udc_resume()
2251 udc->stats.irqs_resume++; in irq_udc_resume()
2253 if (udc->gadget.speed != USB_SPEED_UNKNOWN in irq_udc_resume()
2254 && udc->driver && udc->driver->resume) in irq_udc_resume()
2255 udc->driver->resume(&udc->gadget); in irq_udc_resume()
2262 static void irq_udc_reconfig(struct pxa_udc *udc) in irq_udc_reconfig() argument
2265 u32 udccr = udc_readl(udc, UDCCR); in irq_udc_reconfig()
2267 udc_writel(udc, UDCISR1, UDCISR1_IRCC); in irq_udc_reconfig()
2268 udc->stats.irqs_reconfig++; in irq_udc_reconfig()
2271 config_change = (config != udc->config); in irq_udc_reconfig()
2272 pxa27x_change_configuration(udc, config); in irq_udc_reconfig()
2276 pxa27x_change_interface(udc, interface, alternate); in irq_udc_reconfig()
2279 update_pxa_ep_matches(udc); in irq_udc_reconfig()
2280 udc_set_mask_UDCCR(udc, UDCCR_SMAC); in irq_udc_reconfig()
2287 static void irq_udc_reset(struct pxa_udc *udc) in irq_udc_reset() argument
2289 u32 udccr = udc_readl(udc, UDCCR); in irq_udc_reset()
2290 struct pxa_ep *ep = &udc->pxa_ep[0]; in irq_udc_reset()
2292 dev_info(udc->dev, "USB reset\n"); in irq_udc_reset()
2293 udc_writel(udc, UDCISR1, UDCISR1_IRRS); in irq_udc_reset()
2294 udc->stats.irqs_reset++; in irq_udc_reset()
2297 dev_dbg(udc->dev, "USB reset start\n"); in irq_udc_reset()
2298 stop_activity(udc, udc->driver); in irq_udc_reset()
2300 udc->gadget.speed = USB_SPEED_FULL; in irq_udc_reset()
2301 memset(&udc->stats, 0, sizeof udc->stats); in irq_udc_reset()
2305 ep0_idle(udc); in irq_udc_reset()
2317 struct pxa_udc *udc = _dev; in pxa_udc_irq() local
2318 u32 udcisr0 = udc_readl(udc, UDCISR0); in pxa_udc_irq()
2319 u32 udcisr1 = udc_readl(udc, UDCISR1); in pxa_udc_irq()
2320 u32 udccr = udc_readl(udc, UDCCR); in pxa_udc_irq()
2323 dev_vdbg(udc->dev, "Interrupt, UDCISR0:0x%08x, UDCISR1:0x%08x, " in pxa_udc_irq()
2328 irq_udc_suspend(udc); in pxa_udc_irq()
2330 irq_udc_resume(udc); in pxa_udc_irq()
2332 irq_udc_reconfig(udc); in pxa_udc_irq()
2334 irq_udc_reset(udc); in pxa_udc_irq()
2337 irq_handle_data(irq, udc); in pxa_udc_irq()
2407 struct pxa_udc *udc = &memory; in pxa_udc_probe() local
2421 udc->gpiod = gpio_to_desc(mach->gpio_pullup); in pxa_udc_probe()
2423 udc->udc_command = mach->udc_command; in pxa_udc_probe()
2425 udc->gpiod = devm_gpiod_get(&pdev->dev, NULL); in pxa_udc_probe()
2429 udc->regs = devm_ioremap_resource(&pdev->dev, regs); in pxa_udc_probe()
2430 if (IS_ERR(udc->regs)) in pxa_udc_probe()
2431 return PTR_ERR(udc->regs); in pxa_udc_probe()
2432 udc->irq = platform_get_irq(pdev, 0); in pxa_udc_probe()
2433 if (udc->irq < 0) in pxa_udc_probe()
2434 return udc->irq; in pxa_udc_probe()
2436 udc->dev = &pdev->dev; in pxa_udc_probe()
2437 udc->transceiver = usb_get_phy(USB_PHY_TYPE_USB2); in pxa_udc_probe()
2439 if (IS_ERR(udc->gpiod)) { in pxa_udc_probe()
2441 PTR_ERR(udc->gpiod)); in pxa_udc_probe()
2442 return PTR_ERR(udc->gpiod); in pxa_udc_probe()
2444 if (udc->gpiod) in pxa_udc_probe()
2445 gpiod_direction_output(udc->gpiod, 0); in pxa_udc_probe()
2447 udc->clk = devm_clk_get(&pdev->dev, NULL); in pxa_udc_probe()
2448 if (IS_ERR(udc->clk)) in pxa_udc_probe()
2449 return PTR_ERR(udc->clk); in pxa_udc_probe()
2451 retval = clk_prepare(udc->clk); in pxa_udc_probe()
2455 udc->vbus_sensed = 0; in pxa_udc_probe()
2457 the_controller = udc; in pxa_udc_probe()
2458 platform_set_drvdata(pdev, udc); in pxa_udc_probe()
2459 udc_init_data(udc); in pxa_udc_probe()
2462 retval = devm_request_irq(&pdev->dev, udc->irq, pxa_udc_irq, in pxa_udc_probe()
2463 IRQF_SHARED, driver_name, udc); in pxa_udc_probe()
2465 dev_err(udc->dev, "%s: can't get irq %i, err %d\n", in pxa_udc_probe()
2466 driver_name, udc->irq, retval); in pxa_udc_probe()
2470 retval = usb_add_gadget_udc(&pdev->dev, &udc->gadget); in pxa_udc_probe()
2474 pxa_init_debugfs(udc); in pxa_udc_probe()
2475 if (should_enable_udc(udc)) in pxa_udc_probe()
2476 udc_enable(udc); in pxa_udc_probe()
2479 clk_unprepare(udc->clk); in pxa_udc_probe()
2489 struct pxa_udc *udc = platform_get_drvdata(_dev); in pxa_udc_remove() local
2491 usb_del_gadget_udc(&udc->gadget); in pxa_udc_remove()
2492 pxa_cleanup_debugfs(udc); in pxa_udc_remove()
2494 usb_put_phy(udc->transceiver); in pxa_udc_remove()
2496 udc->transceiver = NULL; in pxa_udc_remove()
2498 clk_unprepare(udc->clk); in pxa_udc_remove()
2505 struct pxa_udc *udc = platform_get_drvdata(_dev); in pxa_udc_shutdown() local
2507 if (udc_readl(udc, UDCCR) & UDCCR_UDE) in pxa_udc_shutdown()
2508 udc_disable(udc); in pxa_udc_shutdown()
2528 struct pxa_udc *udc = platform_get_drvdata(_dev); in pxa_udc_suspend() local
2531 ep = &udc->pxa_ep[0]; in pxa_udc_suspend()
2532 udc->udccsr0 = udc_ep_readl(ep, UDCCSR); in pxa_udc_suspend()
2534 udc_disable(udc); in pxa_udc_suspend()
2535 udc->pullup_resume = udc->pullup_on; in pxa_udc_suspend()
2536 dplus_pullup(udc, 0); in pxa_udc_suspend()
2538 if (udc->driver) in pxa_udc_suspend()
2539 udc->driver->disconnect(&udc->gadget); in pxa_udc_suspend()
2553 struct pxa_udc *udc = platform_get_drvdata(_dev); in pxa_udc_resume() local
2556 ep = &udc->pxa_ep[0]; in pxa_udc_resume()
2557 udc_ep_writel(ep, UDCCSR, udc->udccsr0 & (UDCCSR0_FST | UDCCSR0_DME)); in pxa_udc_resume()
2559 dplus_pullup(udc, udc->pullup_resume); in pxa_udc_resume()
2560 if (should_enable_udc(udc)) in pxa_udc_resume()
2561 udc_enable(udc); in pxa_udc_resume()