Lines Matching refs:ci

24 #include "ci.h"
52 static int reprime_dtd(struct ci_hdrc *ci, struct ci_hw_ep *hwep,
66 static inline int ep_to_bit(struct ci_hdrc *ci, int n)
68 int fill = 16 - ci->hw_ep_max / 2;
70 if (n >= ci->hw_ep_max / 2)
78 * @ci: the controller
83 static int hw_device_state(struct ci_hdrc *ci, u32 dma)
86 hw_write(ci, OP_ENDPTLISTADDR, ~0, dma);
88 hw_write(ci, OP_USBINTR, ~0,
91 hw_write(ci, OP_USBINTR, ~0, 0);
98 * @ci: the controller
104 static int hw_ep_flush(struct ci_hdrc *ci, int num, int dir)
110 hw_write(ci, OP_ENDPTFLUSH, ~0, BIT(n));
111 while (hw_read(ci, OP_ENDPTFLUSH, BIT(n)))
113 } while (hw_read(ci, OP_ENDPTSTAT, BIT(n)));
120 * @ci: the controller
126 static int hw_ep_disable(struct ci_hdrc *ci, int num, int dir)
128 hw_write(ci, OP_ENDPTCTRL + num,
135 * @ci: the controller
142 static int hw_ep_enable(struct ci_hdrc *ci, int num, int dir, int type)
165 hw_write(ci, OP_ENDPTCTRL + num, mask, data);
171 * @ci: the controller
177 static int hw_ep_get_halt(struct ci_hdrc *ci, int num, int dir)
181 return hw_read(ci, OP_ENDPTCTRL + num, mask) ? 1 : 0;
186 * @ci: the controller
193 static int hw_ep_prime(struct ci_hdrc *ci, int num, int dir, int is_ctrl)
200 if (is_ctrl && dir == RX && hw_read(ci, OP_ENDPTSETUPSTAT, BIT(num)))
203 hw_write(ci, OP_ENDPTPRIME, ~0, BIT(n));
205 while (hw_read(ci, OP_ENDPTPRIME, BIT(n)))
207 if (is_ctrl && dir == RX && hw_read(ci, OP_ENDPTSETUPSTAT, BIT(num)))
217 * @ci: the controller
224 static int hw_ep_set_halt(struct ci_hdrc *ci, int num, int dir, int value)
235 hw_write(ci, reg, mask_xs|mask_xr,
237 } while (value != hw_ep_get_halt(ci, num, dir));
244 * @ci: the controller
248 static int hw_port_is_high_speed(struct ci_hdrc *ci)
250 return ci->hw_bank.lpm ? hw_read(ci, OP_DEVLC, DEVLC_PSPD) :
251 hw_read(ci, OP_PORTSC, PORTSC_HSP);
257 * @ci: the controller
262 static int hw_test_and_clear_complete(struct ci_hdrc *ci, int n)
264 n = ep_to_bit(ci, n);
265 return hw_test_and_clear(ci, OP_ENDPTCOMPLETE, BIT(n));
271 * @ci: the controller
275 static u32 hw_test_and_clear_intr_active(struct ci_hdrc *ci)
277 u32 reg = hw_read_intr_status(ci) & hw_read_intr_enable(ci);
279 hw_write(ci, OP_USBSTS, ~0, reg);
286 * @ci: the controller
290 static int hw_test_and_clear_setup_guard(struct ci_hdrc *ci)
292 return hw_test_and_write(ci, OP_USBCMD, USBCMD_SUTW, 0);
298 * @ci: the controller
302 static int hw_test_and_set_setup_guard(struct ci_hdrc *ci)
304 return hw_test_and_write(ci, OP_USBCMD, USBCMD_SUTW, USBCMD_SUTW);
309 * @ci: the controller
315 static void hw_usb_set_address(struct ci_hdrc *ci, u8 value)
317 hw_write(ci, OP_DEVICEADDR, DEVICEADDR_USBADR,
324 * @ci: the controller
328 static int hw_usb_reset(struct ci_hdrc *ci)
330 hw_usb_set_address(ci, 0);
333 hw_write(ci, OP_ENDPTFLUSH, ~0, ~0);
336 hw_write(ci, OP_ENDPTSETUPSTAT, 0, 0);
339 hw_write(ci, OP_ENDPTCOMPLETE, 0, 0);
342 while (hw_read(ci, OP_ENDPTPRIME, ~0))
515 dev_err(hwep->ci->dev, "not supported operation for sg\n");
521 dev_err(hwep->ci->dev, "not page aligned sg buffer\n");
552 struct ci_hdrc *ci = hwep->ci;
562 ret = usb_gadget_map_request_by_dev(ci->dev->parent,
605 if (ci->rev == CI_REVISION_22) {
606 if (!hw_read(ci, OP_ENDPTSTAT, BIT(n)))
607 reprime_dtd(ci, hwep, prevlastnode);
610 if (hw_read(ci, OP_ENDPTPRIME, BIT(n)))
613 hw_write(ci, OP_USBCMD, USBCMD_ATDTW, USBCMD_ATDTW);
614 tmp_stat = hw_read(ci, OP_ENDPTSTAT, BIT(n));
615 } while (!hw_read(ci, OP_USBCMD, USBCMD_ATDTW));
616 hw_write(ci, OP_USBCMD, USBCMD_ATDTW, 0);
635 ret = hw_ep_prime(ci, hwep->num, hwep->dir,
654 static int reprime_dtd(struct ci_hdrc *ci, struct ci_hw_ep *hwep,
661 return hw_ep_prime(ci, hwep->num, hwep->dir,
678 struct ci_hdrc *ci = hwep->ci;
691 if (ci->rev == CI_REVISION_24 ||
692 ci->rev == CI_REVISION_22)
693 if (!hw_read(ci, OP_ENDPTSTAT, BIT(n)))
694 reprime_dtd(ci, hwep, node);
733 usb_gadget_unmap_request_by_dev(hwep->ci->dev->parent,
759 hw_ep_flush(hwep->ci, hwep->num, hwep->dir);
813 retval |= hw_ep_set_halt(hwep->ci, hwep->num, hwep->dir, value);
837 struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget);
844 usb_ep_fifo_flush(&ci->ep0out->ep);
845 usb_ep_fifo_flush(&ci->ep0in->ep);
852 if (ci->status != NULL) {
853 usb_ep_free_request(&ci->ep0in->ep, ci->status);
854 ci->status = NULL;
857 spin_lock_irqsave(&ci->lock, flags);
858 ci->gadget.speed = USB_SPEED_UNKNOWN;
859 ci->remote_wakeup = 0;
860 ci->suspended = 0;
861 spin_unlock_irqrestore(&ci->lock, flags);
871 * @ci: UDC device
875 static void isr_reset_handler(struct ci_hdrc *ci)
876 __releases(ci->lock)
877 __acquires(ci->lock)
881 spin_unlock(&ci->lock);
882 if (ci->gadget.speed != USB_SPEED_UNKNOWN)
883 usb_gadget_udc_reset(&ci->gadget, ci->driver);
885 retval = _gadget_stop_activity(&ci->gadget);
889 retval = hw_usb_reset(ci);
893 ci->status = usb_ep_alloc_request(&ci->ep0in->ep, GFP_ATOMIC);
894 if (ci->status == NULL)
898 spin_lock(&ci->lock);
901 dev_err(ci->dev, "error: %i\n", retval);
934 struct ci_hdrc *ci = hwep->ci;
942 hwep = (ci->ep0_dir == RX) ?
943 ci->ep0out : ci->ep0in;
946 dev_warn(hwep->ci->dev, "endpoint ctrl %X nuked\n",
953 dev_err(hwep->ci->dev, "request length too big for isochronous\n");
959 dev_err(hwep->ci->dev, "request already in queue\n");
979 * @ci: ci struct
984 static int isr_get_status_response(struct ci_hdrc *ci,
989 struct ci_hw_ep *hwep = ci->ep0in;
1012 *(u16 *)req->buf = (ci->remote_wakeup << 1) |
1013 ci->gadget.is_selfpowered;
1019 *(u16 *)req->buf = hw_ep_get_halt(ci, num, dir);
1049 struct ci_hdrc *ci = req->context;
1055 if (ci->setaddr) {
1056 hw_usb_set_address(ci, ci->address);
1057 ci->setaddr = false;
1058 if (ci->address)
1059 usb_gadget_set_state(&ci->gadget, USB_STATE_ADDRESS);
1062 spin_lock_irqsave(&ci->lock, flags);
1063 if (ci->test_mode)
1064 hw_port_test_set(ci, ci->test_mode);
1065 spin_unlock_irqrestore(&ci->lock, flags);
1070 * @ci: ci struct
1074 static int isr_setup_status_phase(struct ci_hdrc *ci)
1081 * being called with ci->status equal to NULL.
1084 if (WARN_ON_ONCE(!ci->status))
1087 hwep = (ci->ep0_dir == TX) ? ci->ep0out : ci->ep0in;
1088 ci->status->context = ci;
1089 ci->status->complete = isr_setup_status_complete;
1091 return _ep_queue(&hwep->ep, ci->status, GFP_ATOMIC);
1119 hweptemp = hwep->ci->ep0in;
1131 static int otg_a_alt_hnp_support(struct ci_hdrc *ci)
1133 dev_warn(&ci->gadget.dev,
1135 return isr_setup_status_phase(ci);
1140 * @ci: UDC descriptor
1144 static void isr_setup_packet_handler(struct ci_hdrc *ci)
1145 __releases(ci->lock)
1146 __acquires(ci->lock)
1148 struct ci_hw_ep *hwep = &ci->ci_hw_ep[0];
1157 _ep_nuke(ci->ep0out);
1158 _ep_nuke(ci->ep0in);
1162 hw_test_and_set_setup_guard(ci);
1164 } while (!hw_test_and_clear_setup_guard(ci));
1168 ci->ep0_dir = (type & USB_DIR_IN) ? TX : RX;
1181 num += ci->hw_ep_max / 2;
1182 if (!ci->ci_hw_ep[num].wedge) {
1183 spin_unlock(&ci->lock);
1185 &ci->ci_hw_ep[num].ep);
1186 spin_lock(&ci->lock);
1190 err = isr_setup_status_phase(ci);
1196 ci->remote_wakeup = 0;
1197 err = isr_setup_status_phase(ci);
1211 err = isr_get_status_response(ci, &req);
1219 ci->address = (u8)le16_to_cpu(req.wValue);
1220 ci->setaddr = true;
1221 err = isr_setup_status_phase(ci);
1233 num += ci->hw_ep_max / 2;
1235 spin_unlock(&ci->lock);
1236 err = _ep_set_halt(&ci->ci_hw_ep[num].ep, 1, false);
1237 spin_lock(&ci->lock);
1239 isr_setup_status_phase(ci);
1245 ci->remote_wakeup = 1;
1246 err = isr_setup_status_phase(ci);
1256 ci->test_mode = tmode;
1258 ci);
1265 if (ci_otg_is_fsm_mode(ci)) {
1266 ci->gadget.b_hnp_enable = 1;
1268 ci);
1272 if (ci_otg_is_fsm_mode(ci))
1273 err = otg_a_alt_hnp_support(ci);
1276 if (ci_otg_is_fsm_mode(ci)) {
1277 ci->gadget.a_hnp_support = 1;
1279 ci);
1292 ci->ep0_dir = TX;
1294 spin_unlock(&ci->lock);
1295 err = ci->driver->setup(&ci->gadget, &req);
1296 spin_lock(&ci->lock);
1301 spin_unlock(&ci->lock);
1303 dev_err(ci->dev, "error: _ep_set_halt\n");
1304 spin_lock(&ci->lock);
1310 * @ci: UDC descriptor
1314 static void isr_tr_complete_handler(struct ci_hdrc *ci)
1315 __releases(ci->lock)
1316 __acquires(ci->lock)
1321 for (i = 0; i < ci->hw_ep_max; i++) {
1322 struct ci_hw_ep *hwep = &ci->ci_hw_ep[i];
1327 if (hw_test_and_clear_complete(ci, i)) {
1331 err = isr_setup_status_phase(ci);
1333 spin_unlock(&ci->lock);
1335 dev_err(ci->dev,
1337 spin_lock(&ci->lock);
1344 hw_test_and_clear(ci, OP_ENDPTSETUPSTAT, BIT(0)))
1345 isr_setup_packet_handler(ci);
1373 dev_warn(hwep->ci->dev, "enabling a non-empty endpoint!\n");
1404 dev_err(hwep->ci->dev, "Set control xfer at non-ep0\n");
1413 retval |= hw_ep_enable(hwep->ci, hwep->num, hwep->dir,
1437 if (hwep->ci->gadget.speed == USB_SPEED_UNKNOWN) {
1447 retval |= hw_ep_disable(hwep->ci, hwep->num, hwep->dir);
1496 dev_err(hwep->ci->dev, "freeing queued request\n");
1530 if (hwep->ci->gadget.speed == USB_SPEED_UNKNOWN) {
1557 if (hwep->ci->gadget.speed != USB_SPEED_UNKNOWN)
1558 hw_ep_flush(hwep->ci, hwep->num, hwep->dir);
1569 usb_gadget_unmap_request(&hwep->ci->gadget, req, hwep->dir);
1624 dev_err(hwep->ci->dev, "%02X: -EINVAL\n", _usb_addr(hwep));
1629 if (hwep->ci->gadget.speed == USB_SPEED_UNKNOWN) {
1634 hw_ep_flush(hwep->ci, hwep->num, hwep->dir);
1661 struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget);
1665 spin_lock_irqsave(&ci->lock, flags);
1666 ret = hw_read(ci, OP_FRINDEX, 0x3fff);
1667 spin_unlock_irqrestore(&ci->lock, flags);
1676 struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget);
1679 pm_runtime_get_sync(ci->dev);
1680 hw_device_reset(ci);
1681 spin_lock_irq(&ci->lock);
1682 if (ci->driver) {
1683 hw_device_state(ci, ci->ep0out->qh.dma);
1685 spin_unlock_irq(&ci->lock);
1688 spin_unlock_irq(&ci->lock);
1692 if (ci->driver)
1693 ci->driver->disconnect(&ci->gadget);
1694 hw_device_state(ci, 0);
1695 if (ci->platdata->notify_event)
1696 ci->platdata->notify_event(ci,
1698 _gadget_stop_activity(&ci->gadget);
1699 pm_runtime_put_sync(ci->dev);
1706 struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget);
1710 spin_lock_irqsave(&ci->lock, flags);
1711 ci->vbus_active = is_active;
1712 spin_unlock_irqrestore(&ci->lock, flags);
1714 if (ci->usb_phy)
1715 usb_phy_set_charger_state(ci->usb_phy, is_active ?
1718 if (ci->platdata->notify_event)
1719 ret = ci->platdata->notify_event(ci,
1722 if (ci->usb_phy) {
1724 usb_phy_set_event(ci->usb_phy, USB_EVENT_VBUS);
1726 usb_phy_set_event(ci->usb_phy, USB_EVENT_NONE);
1729 if (ci->driver)
1737 struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget);
1741 spin_lock_irqsave(&ci->lock, flags);
1742 if (ci->gadget.speed == USB_SPEED_UNKNOWN) {
1743 spin_unlock_irqrestore(&ci->lock, flags);
1746 if (!ci->remote_wakeup) {
1750 if (!hw_read(ci, OP_PORTSC, PORTSC_SUSP)) {
1754 hw_write(ci, OP_PORTSC, PORTSC_FPR, PORTSC_FPR);
1756 spin_unlock_irqrestore(&ci->lock, flags);
1762 struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget);
1764 if (ci->usb_phy)
1765 return usb_phy_set_power(ci->usb_phy, ma);
1771 struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget);
1772 struct ci_hw_ep *hwep = ci->ep0in;
1787 struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget);
1793 if (ci_otg_is_fsm_mode(ci) || ci->role == CI_ROLE_HOST)
1796 pm_runtime_get_sync(ci->dev);
1798 hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
1800 hw_write(ci, OP_USBCMD, USBCMD_RS, 0);
1801 pm_runtime_put_sync(ci->dev);
1815 struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget);
1819 list_for_each_entry_reverse(ep, &ci->gadget.ep_list, ep_list) {
1845 static int init_eps(struct ci_hdrc *ci)
1849 for (i = 0; i < ci->hw_ep_max/2; i++)
1851 int k = i + j * ci->hw_ep_max/2;
1852 struct ci_hw_ep *hwep = &ci->ci_hw_ep[k];
1857 hwep->ci = ci;
1858 hwep->lock = &ci->lock;
1859 hwep->td_pool = ci->td_pool;
1885 hwep->qh.ptr = dma_pool_zalloc(ci->qh_pool, GFP_KERNEL,
1896 ci->ep0out = hwep;
1898 ci->ep0in = hwep;
1904 list_add_tail(&hwep->ep.ep_list, &ci->gadget.ep_list);
1910 static void destroy_eps(struct ci_hdrc *ci)
1914 for (i = 0; i < ci->hw_ep_max; i++) {
1915 struct ci_hw_ep *hwep = &ci->ci_hw_ep[i];
1919 dma_pool_free(ci->qh_pool, hwep->qh.ptr, hwep->qh.dma);
1933 struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget);
1939 ci->ep0out->ep.desc = &ctrl_endpt_out_desc;
1940 retval = usb_ep_enable(&ci->ep0out->ep);
1944 ci->ep0in->ep.desc = &ctrl_endpt_in_desc;
1945 retval = usb_ep_enable(&ci->ep0in->ep);
1949 ci->driver = driver;
1952 if (ci_otg_is_fsm_mode(ci) && ci->fsm.id) {
1953 ci_hdrc_otg_fsm_start(ci);
1957 if (ci->vbus_active)
1960 usb_udc_vbus_handler(&ci->gadget, false);
1965 static void ci_udc_stop_for_otg_fsm(struct ci_hdrc *ci)
1967 if (!ci_otg_is_fsm_mode(ci))
1970 mutex_lock(&ci->fsm.lock);
1971 if (ci->fsm.otg->state == OTG_STATE_A_PERIPHERAL) {
1972 ci->fsm.a_bidl_adis_tmout = 1;
1973 ci_hdrc_otg_fsm_start(ci);
1974 } else if (ci->fsm.otg->state == OTG_STATE_B_PERIPHERAL) {
1975 ci->fsm.protocol = PROTO_UNDEF;
1976 ci->fsm.otg->state = OTG_STATE_UNDEFINED;
1978 mutex_unlock(&ci->fsm.lock);
1986 struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget);
1989 spin_lock_irqsave(&ci->lock, flags);
1990 ci->driver = NULL;
1992 if (ci->vbus_active) {
1993 hw_device_state(ci, 0);
1994 spin_unlock_irqrestore(&ci->lock, flags);
1995 if (ci->platdata->notify_event)
1996 ci->platdata->notify_event(ci,
1998 _gadget_stop_activity(&ci->gadget);
1999 spin_lock_irqsave(&ci->lock, flags);
2000 pm_runtime_put(ci->dev);
2003 spin_unlock_irqrestore(&ci->lock, flags);
2005 ci_udc_stop_for_otg_fsm(ci);
2013 * udc_irq: ci interrupt handler
2018 static irqreturn_t udc_irq(struct ci_hdrc *ci)
2023 if (ci == NULL)
2026 spin_lock(&ci->lock);
2028 if (ci->platdata->flags & CI_HDRC_REGS_SHARED) {
2029 if (hw_read(ci, OP_USBMODE, USBMODE_CM) !=
2031 spin_unlock(&ci->lock);
2035 intr = hw_test_and_clear_intr_active(ci);
2040 isr_reset_handler(ci);
2043 ci->gadget.speed = hw_port_is_high_speed(ci) ?
2045 if (ci->usb_phy)
2046 usb_phy_set_event(ci->usb_phy,
2048 if (ci->suspended) {
2049 if (ci->driver->resume) {
2050 spin_unlock(&ci->lock);
2051 ci->driver->resume(&ci->gadget);
2052 spin_lock(&ci->lock);
2054 ci->suspended = 0;
2055 usb_gadget_set_state(&ci->gadget,
2056 ci->resume_state);
2061 isr_tr_complete_handler(ci);
2063 if ((USBi_SLI & intr) && !(ci->suspended)) {
2064 ci->suspended = 1;
2065 ci->resume_state = ci->gadget.state;
2066 if (ci->gadget.speed != USB_SPEED_UNKNOWN &&
2067 ci->driver->suspend) {
2068 spin_unlock(&ci->lock);
2069 ci->driver->suspend(&ci->gadget);
2070 spin_lock(&ci->lock);
2072 usb_gadget_set_state(&ci->gadget,
2079 spin_unlock(&ci->lock);
2086 * @ci: chipidea controller
2088 static int udc_start(struct ci_hdrc *ci)
2090 struct device *dev = ci->dev;
2091 struct usb_otg_caps *otg_caps = &ci->platdata->ci_otg_caps;
2094 ci->gadget.ops = &usb_gadget_ops;
2095 ci->gadget.speed = USB_SPEED_UNKNOWN;
2096 ci->gadget.max_speed = USB_SPEED_HIGH;
2097 ci->gadget.name = ci->platdata->name;
2098 ci->gadget.otg_caps = otg_caps;
2099 ci->gadget.sg_supported = 1;
2100 ci->gadget.irq = ci->irq;
2102 if (ci->platdata->flags & CI_HDRC_REQUIRES_ALIGNED_DMA)
2103 ci->gadget.quirk_avoids_skb_reserve = 1;
2105 if (ci->is_otg && (otg_caps->hnp_support || otg_caps->srp_support ||
2107 ci->gadget.is_otg = 1;
2109 INIT_LIST_HEAD(&ci->gadget.ep_list);
2112 ci->qh_pool = dma_pool_create("ci_hw_qh", dev->parent,
2115 if (ci->qh_pool == NULL)
2118 ci->td_pool = dma_pool_create("ci_hw_td", dev->parent,
2121 if (ci->td_pool == NULL) {
2126 retval = init_eps(ci);
2130 ci->gadget.ep0 = &ci->ep0in->ep;
2132 retval = usb_add_gadget_udc(dev, &ci->gadget);
2139 destroy_eps(ci);
2141 dma_pool_destroy(ci->td_pool);
2143 dma_pool_destroy(ci->qh_pool);
2152 void ci_hdrc_gadget_destroy(struct ci_hdrc *ci)
2154 if (!ci->roles[CI_ROLE_GADGET])
2157 usb_del_gadget_udc(&ci->gadget);
2159 destroy_eps(ci);
2161 dma_pool_destroy(ci->td_pool);
2162 dma_pool_destroy(ci->qh_pool);
2165 static int udc_id_switch_for_device(struct ci_hdrc *ci)
2167 if (ci->platdata->pins_device)
2168 pinctrl_select_state(ci->platdata->pctl,
2169 ci->platdata->pins_device);
2171 if (ci->is_otg)
2173 hw_write_otgsc(ci, OTGSC_BSVIS | OTGSC_BSVIE,
2179 static void udc_id_switch_for_host(struct ci_hdrc *ci)
2185 if (ci->is_otg)
2186 hw_write_otgsc(ci, OTGSC_BSVIE | OTGSC_BSVIS, OTGSC_BSVIS);
2188 ci->vbus_active = 0;
2190 if (ci->platdata->pins_device && ci->platdata->pins_default)
2191 pinctrl_select_state(ci->platdata->pctl,
2192 ci->platdata->pins_default);
2196 static void udc_suspend(struct ci_hdrc *ci)
2203 if (hw_read(ci, OP_ENDPTLISTADDR, ~0) == 0)
2204 hw_write(ci, OP_ENDPTLISTADDR, ~0, ~0);
2207 static void udc_resume(struct ci_hdrc *ci, bool power_lost)
2210 if (ci->is_otg)
2211 hw_write_otgsc(ci, OTGSC_BSVIS | OTGSC_BSVIE,
2213 if (ci->vbus_active)
2214 usb_gadget_vbus_disconnect(&ci->gadget);
2218 if (hw_read(ci, OP_ENDPTLISTADDR, ~0) == 0xFFFFFFFF)
2219 hw_write(ci, OP_ENDPTLISTADDR, ~0, 0);
2225 * @ci: the controller
2229 int ci_hdrc_gadget_init(struct ci_hdrc *ci)
2234 if (!hw_read(ci, CAP_DCCPARAMS, DCCPARAMS_DC))
2237 rdrv = devm_kzalloc(ci->dev, sizeof(*rdrv), GFP_KERNEL);
2250 ret = udc_start(ci);
2252 ci->roles[CI_ROLE_GADGET] = rdrv;