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()
1741 static void udc_enable(struct pxa_udc *udc) in udc_enable() argument
1743 if (udc->enabled) in udc_enable()
1746 clk_enable(udc->clk); in udc_enable()
1747 udc_writel(udc, UDCICR0, 0); in udc_enable()
1748 udc_writel(udc, UDCICR1, 0); in udc_enable()
1749 udc_clear_mask_UDCCR(udc, UDCCR_UDE); in udc_enable()
1751 ep0_idle(udc); in udc_enable()
1752 udc->gadget.speed = USB_SPEED_FULL; in udc_enable()
1753 memset(&udc->stats, 0, sizeof(udc->stats)); in udc_enable()
1755 pxa_eps_setup(udc); in udc_enable()
1756 udc_set_mask_UDCCR(udc, UDCCR_UDE); in udc_enable()
1757 ep_write_UDCCSR(&udc->pxa_ep[0], UDCCSR0_ACM); in udc_enable()
1759 if (udc_readl(udc, UDCCR) & UDCCR_EMCE) in udc_enable()
1760 dev_err(udc->dev, "Configuration errors, udc disabled\n"); in udc_enable()
1768 udc_writel(udc, UDCICR1, in udc_enable()
1773 pio_irq_enable(&udc->pxa_ep[0]); in udc_enable()
1775 udc->enabled = 1; in udc_enable()
1796 struct pxa_udc *udc = to_pxa(g); in pxa27x_udc_start() local
1800 udc->driver = driver; in pxa27x_udc_start()
1802 if (!IS_ERR_OR_NULL(udc->transceiver)) { in pxa27x_udc_start()
1803 retval = otg_set_peripheral(udc->transceiver->otg, in pxa27x_udc_start()
1804 &udc->gadget); in pxa27x_udc_start()
1806 dev_err(udc->dev, "can't bind to transceiver\n"); in pxa27x_udc_start()
1811 if (should_enable_udc(udc)) in pxa27x_udc_start()
1812 udc_enable(udc); in pxa27x_udc_start()
1816 udc->driver = NULL; in pxa27x_udc_start()
1828 static void stop_activity(struct pxa_udc *udc, struct usb_gadget_driver *driver) in stop_activity() argument
1833 if (udc->gadget.speed == USB_SPEED_UNKNOWN) in stop_activity()
1835 udc->gadget.speed = USB_SPEED_UNKNOWN; in stop_activity()
1838 pxa_ep_disable(&udc->udc_usb_ep[i].usb_ep); in stop_activity()
1849 struct pxa_udc *udc = to_pxa(g); in pxa27x_udc_stop() local
1851 stop_activity(udc, NULL); in pxa27x_udc_stop()
1852 udc_disable(udc); in pxa27x_udc_stop()
1854 udc->driver = NULL; in pxa27x_udc_stop()
1856 if (!IS_ERR_OR_NULL(udc->transceiver)) in pxa27x_udc_stop()
1857 return otg_set_peripheral(udc->transceiver->otg, NULL); in pxa27x_udc_stop()
1866 static void handle_ep0_ctrl_req(struct pxa_udc *udc, in handle_ep0_ctrl_req() argument
1869 struct pxa_ep *ep = &udc->pxa_ep[0]; in handle_ep0_ctrl_req()
1911 set_ep0state(udc, IN_DATA_STAGE); in handle_ep0_ctrl_req()
1913 set_ep0state(udc, OUT_DATA_STAGE); in handle_ep0_ctrl_req()
1919 i = udc->driver->setup(&udc->gadget, &u.r); in handle_ep0_ctrl_req()
1930 set_ep0state(udc, STALL); in handle_ep0_ctrl_req()
1982 static void handle_ep0(struct pxa_udc *udc, int fifo_irq, int opc_irq) in handle_ep0() argument
1985 struct pxa_ep *ep = &udc->pxa_ep[0]; in handle_ep0()
1994 EP0_STNAME(udc), req, udccsr0, udc_ep_readl(ep, UDCBCR), in handle_ep0()
2001 ep0_idle(udc); in handle_ep0()
2006 set_ep0state(udc, SETUP_STAGE); in handle_ep0()
2009 switch (udc->ep0state) { in handle_ep0()
2021 handle_ep0_ctrl_req(udc, req); in handle_ep0()
2047 ep0_idle(udc); in handle_ep0()
2053 ep0_idle(udc); in handle_ep0()
2129 static void pxa27x_change_configuration(struct pxa_udc *udc, int config) in pxa27x_change_configuration() argument
2133 dev_dbg(udc->dev, "config=%d\n", config); in pxa27x_change_configuration()
2135 udc->config = config; in pxa27x_change_configuration()
2136 udc->last_interface = 0; in pxa27x_change_configuration()
2137 udc->last_alternate = 0; in pxa27x_change_configuration()
2145 set_ep0state(udc, WAIT_ACK_SET_CONF_INTERF); in pxa27x_change_configuration()
2146 udc->driver->setup(&udc->gadget, &req); in pxa27x_change_configuration()
2147 ep_write_UDCCSR(&udc->pxa_ep[0], UDCCSR0_AREN); in pxa27x_change_configuration()
2159 static void pxa27x_change_interface(struct pxa_udc *udc, int iface, int alt) in pxa27x_change_interface() argument
2163 dev_dbg(udc->dev, "interface=%d, alternate setting=%d\n", iface, alt); in pxa27x_change_interface()
2165 udc->last_interface = iface; in pxa27x_change_interface()
2166 udc->last_alternate = alt; in pxa27x_change_interface()
2174 set_ep0state(udc, WAIT_ACK_SET_CONF_INTERF); in pxa27x_change_interface()
2175 udc->driver->setup(&udc->gadget, &req); in pxa27x_change_interface()
2176 ep_write_UDCCSR(&udc->pxa_ep[0], UDCCSR0_AREN); in pxa27x_change_interface()
2186 static void irq_handle_data(int irq, struct pxa_udc *udc) in irq_handle_data() argument
2190 u32 udcisr0 = udc_readl(udc, UDCISR0) & UDCCISR0_EP_MASK; in irq_handle_data()
2191 u32 udcisr1 = udc_readl(udc, UDCISR1) & UDCCISR1_EP_MASK; in irq_handle_data()
2194 udc->pxa_ep[0].stats.irqs++; in irq_handle_data()
2195 udc_writel(udc, UDCISR0, UDCISR_INT(0, UDCISR_INT_MASK)); in irq_handle_data()
2196 handle_ep0(udc, !!(udcisr0 & UDCICR_FIFOERR), in irq_handle_data()
2205 udc_writel(udc, UDCISR0, UDCISR_INT(i, UDCISR_INT_MASK)); in irq_handle_data()
2207 WARN_ON(i >= ARRAY_SIZE(udc->pxa_ep)); in irq_handle_data()
2208 if (i < ARRAY_SIZE(udc->pxa_ep)) { in irq_handle_data()
2209 ep = &udc->pxa_ep[i]; in irq_handle_data()
2216 udc_writel(udc, UDCISR1, UDCISR_INT(i - 16, UDCISR_INT_MASK)); in irq_handle_data()
2220 WARN_ON(i >= ARRAY_SIZE(udc->pxa_ep)); in irq_handle_data()
2221 if (i < ARRAY_SIZE(udc->pxa_ep)) { in irq_handle_data()
2222 ep = &udc->pxa_ep[i]; in irq_handle_data()
2234 static void irq_udc_suspend(struct pxa_udc *udc) in irq_udc_suspend() argument
2236 udc_writel(udc, UDCISR1, UDCISR1_IRSU); in irq_udc_suspend()
2237 udc->stats.irqs_suspend++; in irq_udc_suspend()
2239 if (udc->gadget.speed != USB_SPEED_UNKNOWN in irq_udc_suspend()
2240 && udc->driver && udc->driver->suspend) in irq_udc_suspend()
2241 udc->driver->suspend(&udc->gadget); in irq_udc_suspend()
2242 ep0_idle(udc); in irq_udc_suspend()
2249 static void irq_udc_resume(struct pxa_udc *udc) in irq_udc_resume() argument
2251 udc_writel(udc, UDCISR1, UDCISR1_IRRU); in irq_udc_resume()
2252 udc->stats.irqs_resume++; in irq_udc_resume()
2254 if (udc->gadget.speed != USB_SPEED_UNKNOWN in irq_udc_resume()
2255 && udc->driver && udc->driver->resume) in irq_udc_resume()
2256 udc->driver->resume(&udc->gadget); in irq_udc_resume()
2263 static void irq_udc_reconfig(struct pxa_udc *udc) in irq_udc_reconfig() argument
2266 u32 udccr = udc_readl(udc, UDCCR); in irq_udc_reconfig()
2268 udc_writel(udc, UDCISR1, UDCISR1_IRCC); in irq_udc_reconfig()
2269 udc->stats.irqs_reconfig++; in irq_udc_reconfig()
2272 config_change = (config != udc->config); in irq_udc_reconfig()
2273 pxa27x_change_configuration(udc, config); in irq_udc_reconfig()
2277 pxa27x_change_interface(udc, interface, alternate); in irq_udc_reconfig()
2280 update_pxa_ep_matches(udc); in irq_udc_reconfig()
2281 udc_set_mask_UDCCR(udc, UDCCR_SMAC); in irq_udc_reconfig()
2288 static void irq_udc_reset(struct pxa_udc *udc) in irq_udc_reset() argument
2290 u32 udccr = udc_readl(udc, UDCCR); in irq_udc_reset()
2291 struct pxa_ep *ep = &udc->pxa_ep[0]; in irq_udc_reset()
2293 dev_info(udc->dev, "USB reset\n"); in irq_udc_reset()
2294 udc_writel(udc, UDCISR1, UDCISR1_IRRS); in irq_udc_reset()
2295 udc->stats.irqs_reset++; in irq_udc_reset()
2298 dev_dbg(udc->dev, "USB reset start\n"); in irq_udc_reset()
2299 stop_activity(udc, udc->driver); in irq_udc_reset()
2301 udc->gadget.speed = USB_SPEED_FULL; in irq_udc_reset()
2302 memset(&udc->stats, 0, sizeof udc->stats); in irq_udc_reset()
2306 ep0_idle(udc); in irq_udc_reset()
2318 struct pxa_udc *udc = _dev; in pxa_udc_irq() local
2319 u32 udcisr0 = udc_readl(udc, UDCISR0); in pxa_udc_irq()
2320 u32 udcisr1 = udc_readl(udc, UDCISR1); in pxa_udc_irq()
2321 u32 udccr = udc_readl(udc, UDCCR); in pxa_udc_irq()
2324 dev_vdbg(udc->dev, "Interrupt, UDCISR0:0x%08x, UDCISR1:0x%08x, " in pxa_udc_irq()
2329 irq_udc_suspend(udc); in pxa_udc_irq()
2331 irq_udc_resume(udc); in pxa_udc_irq()
2333 irq_udc_reconfig(udc); in pxa_udc_irq()
2335 irq_udc_reset(udc); in pxa_udc_irq()
2338 irq_handle_data(irq, udc); in pxa_udc_irq()
2408 struct pxa_udc *udc = &memory; in pxa_udc_probe() local
2422 udc->gpiod = gpio_to_desc(mach->gpio_pullup); in pxa_udc_probe()
2424 udc->udc_command = mach->udc_command; in pxa_udc_probe()
2426 udc->gpiod = devm_gpiod_get(&pdev->dev, NULL, GPIOD_ASIS); in pxa_udc_probe()
2430 udc->regs = devm_ioremap_resource(&pdev->dev, regs); in pxa_udc_probe()
2431 if (IS_ERR(udc->regs)) in pxa_udc_probe()
2432 return PTR_ERR(udc->regs); in pxa_udc_probe()
2433 udc->irq = platform_get_irq(pdev, 0); in pxa_udc_probe()
2434 if (udc->irq < 0) in pxa_udc_probe()
2435 return udc->irq; in pxa_udc_probe()
2437 udc->dev = &pdev->dev; in pxa_udc_probe()
2438 udc->transceiver = usb_get_phy(USB_PHY_TYPE_USB2); in pxa_udc_probe()
2440 if (IS_ERR(udc->gpiod)) { in pxa_udc_probe()
2442 PTR_ERR(udc->gpiod)); in pxa_udc_probe()
2443 return PTR_ERR(udc->gpiod); in pxa_udc_probe()
2445 if (udc->gpiod) in pxa_udc_probe()
2446 gpiod_direction_output(udc->gpiod, 0); in pxa_udc_probe()
2448 udc->clk = devm_clk_get(&pdev->dev, NULL); in pxa_udc_probe()
2449 if (IS_ERR(udc->clk)) in pxa_udc_probe()
2450 return PTR_ERR(udc->clk); in pxa_udc_probe()
2452 retval = clk_prepare(udc->clk); in pxa_udc_probe()
2456 udc->vbus_sensed = 0; in pxa_udc_probe()
2458 the_controller = udc; in pxa_udc_probe()
2459 platform_set_drvdata(pdev, udc); in pxa_udc_probe()
2460 udc_init_data(udc); in pxa_udc_probe()
2463 retval = devm_request_irq(&pdev->dev, udc->irq, pxa_udc_irq, in pxa_udc_probe()
2464 IRQF_SHARED, driver_name, udc); in pxa_udc_probe()
2466 dev_err(udc->dev, "%s: can't get irq %i, err %d\n", in pxa_udc_probe()
2467 driver_name, udc->irq, retval); in pxa_udc_probe()
2471 retval = usb_add_gadget_udc(&pdev->dev, &udc->gadget); in pxa_udc_probe()
2475 pxa_init_debugfs(udc); in pxa_udc_probe()
2476 if (should_enable_udc(udc)) in pxa_udc_probe()
2477 udc_enable(udc); in pxa_udc_probe()
2480 clk_unprepare(udc->clk); in pxa_udc_probe()
2490 struct pxa_udc *udc = platform_get_drvdata(_dev); in pxa_udc_remove() local
2492 usb_del_gadget_udc(&udc->gadget); in pxa_udc_remove()
2493 pxa_cleanup_debugfs(udc); in pxa_udc_remove()
2495 usb_put_phy(udc->transceiver); in pxa_udc_remove()
2497 udc->transceiver = NULL; in pxa_udc_remove()
2499 clk_unprepare(udc->clk); in pxa_udc_remove()
2506 struct pxa_udc *udc = platform_get_drvdata(_dev); in pxa_udc_shutdown() local
2508 if (udc_readl(udc, UDCCR) & UDCCR_UDE) in pxa_udc_shutdown()
2509 udc_disable(udc); in pxa_udc_shutdown()
2529 struct pxa_udc *udc = platform_get_drvdata(_dev); in pxa_udc_suspend() local
2532 ep = &udc->pxa_ep[0]; in pxa_udc_suspend()
2533 udc->udccsr0 = udc_ep_readl(ep, UDCCSR); in pxa_udc_suspend()
2535 udc_disable(udc); in pxa_udc_suspend()
2536 udc->pullup_resume = udc->pullup_on; in pxa_udc_suspend()
2537 dplus_pullup(udc, 0); in pxa_udc_suspend()
2539 if (udc->driver) in pxa_udc_suspend()
2540 udc->driver->disconnect(&udc->gadget); in pxa_udc_suspend()
2554 struct pxa_udc *udc = platform_get_drvdata(_dev); in pxa_udc_resume() local
2557 ep = &udc->pxa_ep[0]; in pxa_udc_resume()
2558 udc_ep_writel(ep, UDCCSR, udc->udccsr0 & (UDCCSR0_FST | UDCCSR0_DME)); in pxa_udc_resume()
2560 dplus_pullup(udc, udc->pullup_resume); in pxa_udc_resume()
2561 if (should_enable_udc(udc)) in pxa_udc_resume()
2562 udc_enable(udc); in pxa_udc_resume()