Lines Matching +full:mixed +full:- +full:signals

1 // SPDX-License-Identifier: GPL-2.0
21 * The driver passes all usbtests 1-14.
40 2. Implement platform-specific delay function possibly
42 include/linux/usb-isp116x.h for more info. Some broken
83 static const char hcd_name[] = "isp116x-hcd";
85 /*-----------------------------------------------------------------*/
88 Write len bytes to fifo, pad till 32-bit boundary
99 /* doesn't get mixed up */ in write_ptddata_to_fifo()
103 for (; len > 1; len -= 2) { in write_ptddata_to_fifo()
112 for (; len > 1; len -= 2) { in write_ptddata_to_fifo()
125 Read len bytes from fifo and then read till 32-bit boundary.
136 /* doesn't get mixed up */ in read_ptddata_from_fifo()
140 for (; len > 1; len -= 2) { in read_ptddata_from_fifo()
150 for (; len > 1; len -= 2) { in read_ptddata_from_fifo()
170 int buflen = isp116x->atl_last_dir == PTD_DIR_IN in pack_fifo()
171 ? isp116x->atl_bufshrt : isp116x->atl_buflen; in pack_fifo()
176 for (ep = isp116x->atl_active; ep; ep = ep->active) { in pack_fifo()
177 ptd = &ep->ptd; in pack_fifo()
179 dump_ptd_out_data(ptd, ep->data); in pack_fifo()
180 isp116x_write_data16(isp116x, ptd->count); in pack_fifo()
181 isp116x_write_data16(isp116x, ptd->mps); in pack_fifo()
182 isp116x_write_data16(isp116x, ptd->len); in pack_fifo()
183 isp116x_write_data16(isp116x, ptd->faddr); in pack_fifo()
184 buflen -= sizeof(struct ptd); in pack_fifo()
186 if (ep->active || (isp116x->atl_last_dir != PTD_DIR_IN)) { in pack_fifo()
187 write_ptddata_to_fifo(isp116x, ep->data, ep->length); in pack_fifo()
188 buflen -= ALIGN(ep->length, 4); in pack_fifo()
202 int buflen = isp116x->atl_last_dir == PTD_DIR_IN in unpack_fifo()
203 ? isp116x->atl_buflen : isp116x->atl_bufshrt; in unpack_fifo()
208 for (ep = isp116x->atl_active; ep; ep = ep->active) { in unpack_fifo()
209 ptd = &ep->ptd; in unpack_fifo()
210 ptd->count = isp116x_read_data16(isp116x); in unpack_fifo()
211 ptd->mps = isp116x_read_data16(isp116x); in unpack_fifo()
212 ptd->len = isp116x_read_data16(isp116x); in unpack_fifo()
213 ptd->faddr = isp116x_read_data16(isp116x); in unpack_fifo()
214 buflen -= sizeof(struct ptd); in unpack_fifo()
216 if (ep->active || (isp116x->atl_last_dir == PTD_DIR_IN)) { in unpack_fifo()
217 read_ptddata_from_fifo(isp116x, ep->data, ep->length); in unpack_fifo()
218 buflen -= ALIGN(ep->length, 4); in unpack_fifo()
221 dump_ptd_in_data(ptd, ep->data); in unpack_fifo()
226 /*---------------------------------------------------------------*/
238 for (ep = isp116x->atl_active; ep; ep = ep->active) { in preproc_atl_queue()
241 BUG_ON(list_empty(&ep->hep->urb_list)); in preproc_atl_queue()
242 urb = container_of(ep->hep->urb_list.next, in preproc_atl_queue()
244 ptd = &ep->ptd; in preproc_atl_queue()
245 len = ep->length; in preproc_atl_queue()
246 ep->data = (unsigned char *)urb->transfer_buffer in preproc_atl_queue()
247 + urb->actual_length; in preproc_atl_queue()
249 switch (ep->nextpid) { in preproc_atl_queue()
251 toggle = usb_gettoggle(urb->dev, ep->epnum, 0); in preproc_atl_queue()
255 toggle = usb_gettoggle(urb->dev, ep->epnum, 1); in preproc_atl_queue()
260 ep->data = urb->setup_packet; in preproc_atl_queue()
265 dir = (urb->transfer_buffer_length in preproc_atl_queue()
266 && usb_pipein(urb->pipe)) in preproc_atl_queue()
270 ERR("%s %d: ep->nextpid %d\n", __func__, __LINE__, in preproc_atl_queue()
271 ep->nextpid); in preproc_atl_queue()
275 ptd->count = PTD_CC_MSK | PTD_ACTIVE_MSK | PTD_TOGGLE(toggle); in preproc_atl_queue()
276 ptd->mps = PTD_MPS(ep->maxpacket) in preproc_atl_queue()
277 | PTD_SPD(urb->dev->speed == USB_SPEED_LOW) in preproc_atl_queue()
278 | PTD_EP(ep->epnum); in preproc_atl_queue()
279 ptd->len = PTD_LEN(len) | PTD_DIR(dir); in preproc_atl_queue()
280 ptd->faddr = PTD_FA(usb_pipedevice(urb->pipe)); in preproc_atl_queue()
281 if (!ep->active) { in preproc_atl_queue()
282 ptd->mps |= PTD_LAST_MSK; in preproc_atl_queue()
283 isp116x->atl_last_dir = dir; in preproc_atl_queue()
285 isp116x->atl_bufshrt = sizeof(struct ptd) + isp116x->atl_buflen; in preproc_atl_queue()
286 isp116x->atl_buflen = isp116x->atl_bufshrt + ALIGN(len, 4); in preproc_atl_queue()
296 __releases(isp116x->lock) __acquires(isp116x->lock) in finish_request()
300 ep->error_count = 0; in finish_request()
302 if (usb_pipecontrol(urb->pipe)) in finish_request()
303 ep->nextpid = USB_PID_SETUP; in finish_request()
308 spin_unlock(&isp116x->lock); in finish_request()
310 spin_lock(&isp116x->lock); in finish_request()
313 if (!list_empty(&ep->hep->urb_list)) in finish_request()
317 if (!list_empty(&ep->schedule)) { in finish_request()
318 list_del_init(&ep->schedule); in finish_request()
323 DBG("deschedule qh%d/%p branch %d\n", ep->period, ep, ep->branch); in finish_request()
324 for (i = ep->branch; i < PERIODIC_SIZE; i += ep->period) { in finish_request()
326 struct isp116x_ep **prev = &isp116x->periodic[i]; in finish_request()
329 prev = &temp->next; in finish_request()
331 *prev = ep->next; in finish_request()
332 isp116x->load[i] -= ep->load; in finish_request()
334 ep->branch = PERIODIC_SIZE; in finish_request()
335 isp116x_to_hcd(isp116x)->self.bandwidth_allocated -= in finish_request()
336 ep->load / ep->period; in finish_request()
339 if (!--isp116x->periodic_count) { in finish_request()
340 isp116x->irqenb &= ~HCuPINT_SOF; in finish_request()
341 isp116x->irqenb |= HCuPINT_ATL; in finish_request()
358 for (ep = isp116x->atl_active; ep; ep = ep->active) { in postproc_atl_queue()
359 BUG_ON(list_empty(&ep->hep->urb_list)); in postproc_atl_queue()
361 container_of(ep->hep->urb_list.next, struct urb, urb_list); in postproc_atl_queue()
362 udev = urb->dev; in postproc_atl_queue()
363 ptd = &ep->ptd; in postproc_atl_queue()
366 status = -EINPROGRESS; in postproc_atl_queue()
374 if (!(urb->transfer_flags & URB_SHORT_NOT_OK) || in postproc_atl_queue()
375 usb_pipecontrol(urb->pipe)) { in postproc_atl_queue()
380 ep->error_count = 1; in postproc_atl_queue()
381 usb_settoggle(udev, ep->epnum, in postproc_atl_queue()
382 ep->nextpid == USB_PID_OUT, in postproc_atl_queue()
384 urb->actual_length += PTD_GET_COUNT(ptd); in postproc_atl_queue()
391 && (++ep->error_count >= 3 || cc == TD_CC_STALL in postproc_atl_queue()
394 if (ep->nextpid == USB_PID_ACK) in postproc_atl_queue()
395 ep->nextpid = 0; in postproc_atl_queue()
398 /* According to usb spec, zero-length Int transfer signals in postproc_atl_queue()
401 if (usb_pipeint(urb->pipe) && !PTD_GET_LEN(ptd)) { in postproc_atl_queue()
408 if (ep->error_count in postproc_atl_queue()
410 ep->error_count = 0; in postproc_atl_queue()
414 if (ep->nextpid == USB_PID_OUT) in postproc_atl_queue()
415 usb_settoggle(udev, ep->epnum, 1, PTD_GET_TOGGLE(ptd) in postproc_atl_queue()
416 ^ (ep->error_count > 0)); in postproc_atl_queue()
417 else if (ep->nextpid == USB_PID_IN) in postproc_atl_queue()
418 usb_settoggle(udev, ep->epnum, 0, PTD_GET_TOGGLE(ptd) in postproc_atl_queue()
419 ^ (ep->error_count > 0)); in postproc_atl_queue()
421 switch (ep->nextpid) { in postproc_atl_queue()
424 urb->actual_length += PTD_GET_COUNT(ptd); in postproc_atl_queue()
428 if (urb->transfer_buffer_length != urb->actual_length) { in postproc_atl_queue()
432 if (urb->transfer_flags & URB_ZERO_PACKET in postproc_atl_queue()
433 && ep->nextpid == USB_PID_OUT in postproc_atl_queue()
434 && !(PTD_GET_COUNT(ptd) % ep->maxpacket)) { in postproc_atl_queue()
440 if (usb_pipecontrol(urb->pipe)) in postproc_atl_queue()
441 ep->nextpid = USB_PID_ACK; in postproc_atl_queue()
449 if (urb->transfer_buffer_length == urb->actual_length) in postproc_atl_queue()
450 ep->nextpid = USB_PID_ACK; in postproc_atl_queue()
451 else if (usb_pipeout(urb->pipe)) { in postproc_atl_queue()
453 ep->nextpid = USB_PID_OUT; in postproc_atl_queue()
456 ep->nextpid = USB_PID_IN; in postproc_atl_queue()
464 ep->nextpid = 0; in postproc_atl_queue()
471 if (status != -EINPROGRESS || urb->unlinked) in postproc_atl_queue()
487 if (atomic_read(&isp116x->atl_finishing)) in start_atl_transfers()
490 if (!HC_IS_RUNNING(isp116x_to_hcd(isp116x)->state)) in start_atl_transfers()
497 isp116x->atl_active = NULL; in start_atl_transfers()
498 isp116x->atl_buflen = isp116x->atl_bufshrt = 0; in start_atl_transfers()
501 if (isp116x->periodic_count) { in start_atl_transfers()
502 isp116x->fmindex = index = in start_atl_transfers()
503 (isp116x->fmindex + 1) & (PERIODIC_SIZE - 1); in start_atl_transfers()
504 load = isp116x->load[index]; in start_atl_transfers()
508 isp116x->atl_active = last_ep = in start_atl_transfers()
509 isp116x->periodic[index]; in start_atl_transfers()
510 while (last_ep->next) in start_atl_transfers()
511 last_ep = (last_ep->active = last_ep->next); in start_atl_transfers()
512 last_ep->active = NULL; in start_atl_transfers()
517 list_for_each_entry(ep, &isp116x->async, schedule) { in start_atl_transfers()
518 urb = container_of(ep->hep->urb_list.next, in start_atl_transfers()
520 speed = urb->dev->speed; in start_atl_transfers()
524 if (ep->nextpid == USB_PID_SETUP) { in start_atl_transfers()
526 } else if (ep->nextpid == USB_PID_ACK) { in start_atl_transfers()
530 len = (MAX_LOAD_LIMIT - load) / byte_time; in start_atl_transfers()
540 (urb->transfer_buffer_length - in start_atl_transfers()
541 urb->actual_length)) { in start_atl_transfers()
542 len -= len % ep->maxpacket; in start_atl_transfers()
546 len = urb->transfer_buffer_length - in start_atl_transfers()
547 urb->actual_length; in start_atl_transfers()
555 ep->active = NULL; in start_atl_transfers()
556 ep->length = len; in start_atl_transfers()
558 last_ep->active = ep; in start_atl_transfers()
560 isp116x->atl_active = ep; in start_atl_transfers()
565 if ((&isp116x->async)->next != (&isp116x->async)->prev) in start_atl_transfers()
566 list_move(&isp116x->async, (&isp116x->async)->next); in start_atl_transfers()
568 if (isp116x->atl_active) { in start_atl_transfers()
579 if (!isp116x->atl_active) in finish_atl_transfers()
585 atomic_inc(&isp116x->atl_finishing); in finish_atl_transfers()
588 atomic_dec(&isp116x->atl_finishing); in finish_atl_transfers()
597 spin_lock(&isp116x->lock); in isp116x_irq()
614 hcd->state = HC_STATE_HALT; in isp116x_irq()
623 mod_timer(&hcd->rh_timer, jiffies in isp116x_irq()
626 DBG("---- remote wakeup\n"); in isp116x_irq()
637 isp116x_write_reg16(isp116x, HCuPINTENB, isp116x->irqenb); in isp116x_irq()
639 spin_unlock(&isp116x->lock); in isp116x_irq()
643 /*-----------------------------------------------------------------*/
654 int i, branch = -ENOSPC; in balance()
659 if (branch < 0 || isp116x->load[branch] > isp116x->load[i]) { in balance()
663 if ((isp116x->load[j] + load) in balance()
675 /* NB! ALL the code above this point runs with isp116x->lock
679 /*-----------------------------------------------------------------*/
686 struct usb_device *udev = urb->dev; in isp116x_urb_enqueue()
687 unsigned int pipe = urb->pipe; in isp116x_urb_enqueue()
691 struct usb_host_endpoint *hep = urb->ep; in isp116x_urb_enqueue()
702 return -ENXIO; in isp116x_urb_enqueue()
705 if (!hep->hcpriv) { in isp116x_urb_enqueue()
708 return -ENOMEM; in isp116x_urb_enqueue()
711 spin_lock_irqsave(&isp116x->lock, flags); in isp116x_urb_enqueue()
712 if (!HC_IS_RUNNING(hcd->state)) { in isp116x_urb_enqueue()
714 ret = -ENODEV; in isp116x_urb_enqueue()
723 if (hep->hcpriv) in isp116x_urb_enqueue()
724 ep = hep->hcpriv; in isp116x_urb_enqueue()
726 INIT_LIST_HEAD(&ep->schedule); in isp116x_urb_enqueue()
727 ep->udev = udev; in isp116x_urb_enqueue()
728 ep->epnum = epnum; in isp116x_urb_enqueue()
729 ep->maxpacket = usb_maxpacket(udev, urb->pipe); in isp116x_urb_enqueue()
733 ep->nextpid = USB_PID_SETUP; in isp116x_urb_enqueue()
735 ep->nextpid = USB_PID_OUT; in isp116x_urb_enqueue()
737 ep->nextpid = USB_PID_IN; in isp116x_urb_enqueue()
740 if (urb->interval) { in isp116x_urb_enqueue()
751 if (urb->interval < 2) in isp116x_urb_enqueue()
752 urb->interval = 2; in isp116x_urb_enqueue()
753 if (urb->interval > 2 * PERIODIC_SIZE) in isp116x_urb_enqueue()
754 urb->interval = 2 * PERIODIC_SIZE; in isp116x_urb_enqueue()
755 ep->period = urb->interval >> 1; in isp116x_urb_enqueue()
756 ep->branch = PERIODIC_SIZE; in isp116x_urb_enqueue()
757 ep->load = usb_calc_bus_time(udev->speed, in isp116x_urb_enqueue()
763 hep->hcpriv = ep; in isp116x_urb_enqueue()
764 ep->hep = hep; in isp116x_urb_enqueue()
771 if (list_empty(&ep->schedule)) in isp116x_urb_enqueue()
772 list_add_tail(&ep->schedule, &isp116x->async); in isp116x_urb_enqueue()
775 urb->interval = ep->period; in isp116x_urb_enqueue()
776 ep->length = min_t(u32, ep->maxpacket, in isp116x_urb_enqueue()
777 urb->transfer_buffer_length); in isp116x_urb_enqueue()
780 if (ep->branch < PERIODIC_SIZE) in isp116x_urb_enqueue()
783 ep->branch = ret = balance(isp116x, ep->period, ep->load); in isp116x_urb_enqueue()
788 urb->start_frame = (isp116x->fmindex & (PERIODIC_SIZE - 1)) in isp116x_urb_enqueue()
789 + ep->branch; in isp116x_urb_enqueue()
794 DBG("schedule qh%d/%p branch %d\n", ep->period, ep, ep->branch); in isp116x_urb_enqueue()
795 for (i = ep->branch; i < PERIODIC_SIZE; i += ep->period) { in isp116x_urb_enqueue()
796 struct isp116x_ep **prev = &isp116x->periodic[i]; in isp116x_urb_enqueue()
800 if (ep->period > here->period) in isp116x_urb_enqueue()
802 prev = &here->next; in isp116x_urb_enqueue()
806 ep->next = here; in isp116x_urb_enqueue()
809 isp116x->load[i] += ep->load; in isp116x_urb_enqueue()
811 hcd->self.bandwidth_allocated += ep->load / ep->period; in isp116x_urb_enqueue()
814 if (!isp116x->periodic_count++) { in isp116x_urb_enqueue()
815 isp116x->irqenb &= ~HCuPINT_ATL; in isp116x_urb_enqueue()
816 isp116x->irqenb |= HCuPINT_SOF; in isp116x_urb_enqueue()
818 isp116x->irqenb); in isp116x_urb_enqueue()
822 urb->hcpriv = hep; in isp116x_urb_enqueue()
829 spin_unlock_irqrestore(&isp116x->lock, flags); in isp116x_urb_enqueue()
845 spin_lock_irqsave(&isp116x->lock, flags); in isp116x_urb_dequeue()
850 hep = urb->hcpriv; in isp116x_urb_dequeue()
851 ep = hep->hcpriv; in isp116x_urb_dequeue()
852 WARN_ON(hep != ep->hep); in isp116x_urb_dequeue()
855 if (ep->hep->urb_list.next == &urb->urb_list) in isp116x_urb_dequeue()
857 for (ep_act = isp116x->atl_active; ep_act; in isp116x_urb_dequeue()
858 ep_act = ep_act->active) in isp116x_urb_dequeue()
869 spin_unlock_irqrestore(&isp116x->lock, flags); in isp116x_urb_dequeue()
877 struct isp116x_ep *ep = hep->hcpriv; in isp116x_endpoint_disable()
883 for (i = 0; i < 100 && !list_empty(&hep->urb_list); i++) in isp116x_endpoint_disable()
885 if (!list_empty(&hep->urb_list)) in isp116x_endpoint_disable()
889 hep->hcpriv = NULL; in isp116x_endpoint_disable()
898 spin_lock_irqsave(&isp116x->lock, flags); in isp116x_get_frame()
900 spin_unlock_irqrestore(&isp116x->lock, flags); in isp116x_get_frame()
905 Adapted from ohci-hub.c. Currently we don't support autosuspend.
913 if (!HC_IS_RUNNING(hcd->state)) in isp116x_hub_status_data()
914 return -ESHUTDOWN; in isp116x_hub_status_data()
918 if (timer_pending(&hcd->rh_timer)) in isp116x_hub_status_data()
921 ports = isp116x->rhdesca & RH_A_NDP; in isp116x_hub_status_data()
922 spin_lock_irqsave(&isp116x->lock, flags); in isp116x_hub_status_data()
923 isp116x->rhstatus = isp116x_read_reg32(isp116x, HCRHSTATUS); in isp116x_hub_status_data()
924 if (isp116x->rhstatus & (RH_HS_LPSC | RH_HS_OCIC)) in isp116x_hub_status_data()
938 spin_unlock_irqrestore(&isp116x->lock, flags); in isp116x_hub_status_data()
945 u32 reg = isp116x->rhdesca; in isp116x_hub_descriptor()
947 desc->bDescriptorType = USB_DT_HUB; in isp116x_hub_descriptor()
948 desc->bDescLength = 9; in isp116x_hub_descriptor()
949 desc->bHubContrCurrent = 0; in isp116x_hub_descriptor()
950 desc->bNbrPorts = (u8) (reg & 0x3); in isp116x_hub_descriptor()
952 desc->wHubCharacteristics = cpu_to_le16((u16) ((reg >> 8) & in isp116x_hub_descriptor()
956 desc->bPwrOn2PwrGood = (u8) ((reg >> 24) & 0xff); in isp116x_hub_descriptor()
958 desc->u.hs.DeviceRemovable[0] = 0; in isp116x_hub_descriptor()
959 desc->u.hs.DeviceRemovable[1] = ~0; in isp116x_hub_descriptor()
979 spin_lock_irqsave(&isp116x->lock, flags); in root_port_reset()
990 spin_unlock_irqrestore(&isp116x->lock, flags); in root_port_reset()
996 spin_unlock_irqrestore(&isp116x->lock, flags); in root_port_reset()
1001 /* Adapted from ohci-hub.c */
1009 int ports = isp116x->rhdesca & RH_A_NDP; in isp116x_hub_control()
1018 spin_lock_irqsave(&isp116x->lock, flags); in isp116x_hub_control()
1020 spin_unlock_irqrestore(&isp116x->lock, flags); in isp116x_hub_control()
1053 spin_lock_irqsave(&isp116x->lock, flags); in isp116x_hub_control()
1054 tmp = isp116x_read_reg32(isp116x, (--wIndex) ? HCRHPORT2 : HCRHPORT1); in isp116x_hub_control()
1055 spin_unlock_irqrestore(&isp116x->lock, flags); in isp116x_hub_control()
1063 wIndex--; in isp116x_hub_control()
1101 spin_lock_irqsave(&isp116x->lock, flags); in isp116x_hub_control()
1104 spin_unlock_irqrestore(&isp116x->lock, flags); in isp116x_hub_control()
1110 wIndex--; in isp116x_hub_control()
1114 spin_lock_irqsave(&isp116x->lock, flags); in isp116x_hub_control()
1117 spin_unlock_irqrestore(&isp116x->lock, flags); in isp116x_hub_control()
1121 spin_lock_irqsave(&isp116x->lock, flags); in isp116x_hub_control()
1124 spin_unlock_irqrestore(&isp116x->lock, flags); in isp116x_hub_control()
1139 ret = -EPIPE; in isp116x_hub_control()
1144 /*-----------------------------------------------------------------*/
1172 struct isp116x *isp116x = s->private; in isp116x_debug_show()
1175 isp116x_to_hcd(isp116x)->product_desc, hcd_name, in isp116x_debug_show()
1178 if (HC_IS_SUSPENDED(isp116x_to_hcd(isp116x)->state)) { in isp116x_debug_show()
1182 if (!HC_IS_RUNNING(isp116x_to_hcd(isp116x)->state)) { in isp116x_debug_show()
1187 spin_lock_irq(&isp116x->lock); in isp116x_debug_show()
1193 spin_unlock_irq(&isp116x->lock); in isp116x_debug_show()
1218 /*-----------------------------------------------------------------*/
1221 Software reset - can be called from any contect.
1229 spin_lock_irqsave(&isp116x->lock, flags); in isp116x_sw_reset()
1232 while (--retries) { in isp116x_sw_reset()
1240 ret = -ETIME; in isp116x_sw_reset()
1242 spin_unlock_irqrestore(&isp116x->lock, flags); in isp116x_sw_reset()
1260 spin_lock_irq(&isp116x->lock); in isp116x_reset()
1262 spin_unlock_irq(&isp116x->lock); in isp116x_reset()
1271 ret = -ENODEV; in isp116x_reset()
1282 spin_lock_irqsave(&isp116x->lock, flags); in isp116x_stop()
1291 spin_unlock_irqrestore(&isp116x->lock, flags); in isp116x_stop()
1302 struct isp116x_platform_data *board = isp116x->board; in isp116x_start()
1306 spin_lock_irqsave(&isp116x->lock, flags); in isp116x_start()
1315 spin_unlock_irqrestore(&isp116x->lock, flags); in isp116x_start()
1316 return -ENODEV; in isp116x_start()
1320 hcd->uses_new_polling = 1; in isp116x_start()
1325 /* ----- HW conf */ in isp116x_start()
1327 if (board->sel15Kres) in isp116x_start()
1330 if (board->remote_wakeup_enable) in isp116x_start()
1332 if (board->oc_enable) in isp116x_start()
1334 if (board->int_act_high) in isp116x_start()
1336 if (board->int_edge_triggered) in isp116x_start()
1340 /* ----- Root hub conf */ in isp116x_start()
1349 isp116x->rhdesca = isp116x_read_reg32(isp116x, HCRHDESCA); in isp116x_start()
1353 isp116x->rhdescb = isp116x_read_reg32(isp116x, HCRHDESCB); in isp116x_start()
1356 if (board->remote_wakeup_enable) { in isp116x_start()
1357 if (!device_can_wakeup(hcd->self.controller)) in isp116x_start()
1358 device_init_wakeup(hcd->self.controller, 1); in isp116x_start()
1362 isp116x->rhstatus = isp116x_read_reg32(isp116x, HCRHSTATUS); in isp116x_start()
1366 hcd->state = HC_STATE_RUNNING; in isp116x_start()
1369 isp116x->intenb = HCINT_MIE | HCINT_RHSC | HCINT_UE; in isp116x_start()
1370 if (board->remote_wakeup_enable) in isp116x_start()
1371 isp116x->intenb |= HCINT_RD; in isp116x_start()
1372 isp116x->irqenb = HCuPINT_ATL | HCuPINT_OPR; /* | HCuPINT_SUSP; */ in isp116x_start()
1373 isp116x_write_reg32(isp116x, HCINTENB, isp116x->intenb); in isp116x_start()
1374 isp116x_write_reg16(isp116x, HCuPINTENB, isp116x->irqenb); in isp116x_start()
1378 if (board->remote_wakeup_enable) in isp116x_start()
1387 spin_unlock_irqrestore(&isp116x->lock, flags); in isp116x_start()
1400 spin_lock_irqsave(&isp116x->lock, flags); in isp116x_bus_suspend()
1405 spin_unlock_irqrestore(&isp116x->lock, flags); in isp116x_bus_suspend()
1408 if (hcd->self.root_hub->do_remote_wakeup) in isp116x_bus_suspend()
1412 spin_lock_irqsave(&isp116x->lock, flags); in isp116x_bus_suspend()
1414 spin_unlock_irqrestore(&isp116x->lock, flags); in isp116x_bus_suspend()
1424 ret = -EBUSY; in isp116x_bus_suspend()
1427 spin_unlock_irqrestore(&isp116x->lock, flags); in isp116x_bus_suspend()
1440 spin_lock_irq(&isp116x->lock); in isp116x_bus_resume()
1452 spin_unlock_irq(&isp116x->lock); in isp116x_bus_resume()
1457 spin_unlock_irq(&isp116x->lock); in isp116x_bus_resume()
1463 if ((isp116x->rhdesca & RH_A_NDP) == 2) in isp116x_bus_resume()
1469 val = isp116x->rhdesca & RH_A_NDP; in isp116x_bus_resume()
1470 while (val--) { in isp116x_bus_resume()
1480 spin_unlock_irq(&isp116x->lock); in isp116x_bus_resume()
1482 hcd->state = HC_STATE_RESUMING; in isp116x_bus_resume()
1486 spin_lock_irq(&isp116x->lock); in isp116x_bus_resume()
1490 spin_unlock_irq(&isp116x->lock); in isp116x_bus_resume()
1491 hcd->state = HC_STATE_RUNNING; in isp116x_bus_resume()
1527 /*----------------------------------------------------------------*/
1541 iounmap(isp116x->data_reg); in isp116x_remove()
1544 release_mem_region(res->start, 2); in isp116x_remove()
1545 iounmap(isp116x->addr_reg); in isp116x_remove()
1548 release_mem_region(res->start, 2); in isp116x_remove()
1565 return -ENODEV; in isp116x_probe()
1567 if (pdev->num_resources < 3) { in isp116x_probe()
1568 ret = -ENODEV; in isp116x_probe()
1577 ret = -ENODEV; in isp116x_probe()
1581 irq = ires->start; in isp116x_probe()
1582 irqflags = ires->flags & IRQF_TRIGGER_MASK; in isp116x_probe()
1584 if (!request_mem_region(addr->start, 2, hcd_name)) { in isp116x_probe()
1585 ret = -EBUSY; in isp116x_probe()
1588 addr_reg = ioremap(addr->start, resource_size(addr)); in isp116x_probe()
1590 ret = -ENOMEM; in isp116x_probe()
1593 if (!request_mem_region(data->start, 2, hcd_name)) { in isp116x_probe()
1594 ret = -EBUSY; in isp116x_probe()
1597 data_reg = ioremap(data->start, resource_size(data)); in isp116x_probe()
1599 ret = -ENOMEM; in isp116x_probe()
1604 hcd = usb_create_hcd(&isp116x_hc_driver, &pdev->dev, dev_name(&pdev->dev)); in isp116x_probe()
1606 ret = -ENOMEM; in isp116x_probe()
1610 hcd->rsrc_start = addr->start; in isp116x_probe()
1612 isp116x->data_reg = data_reg; in isp116x_probe()
1613 isp116x->addr_reg = addr_reg; in isp116x_probe()
1614 spin_lock_init(&isp116x->lock); in isp116x_probe()
1615 INIT_LIST_HEAD(&isp116x->async); in isp116x_probe()
1616 isp116x->board = dev_get_platdata(&pdev->dev); in isp116x_probe()
1618 if (!isp116x->board) { in isp116x_probe()
1620 ret = -ENODEV; in isp116x_probe()
1626 ERR("See comments in drivers/usb/host/isp116x-hcd.c\n"); in isp116x_probe()
1627 ret = -ENODEV; in isp116x_probe()
1635 device_wakeup_enable(hcd->self.controller); in isp116x_probe()
1646 release_mem_region(data->start, 2); in isp116x_probe()
1650 release_mem_region(addr->start, 2); in isp116x_probe()
1683 MODULE_ALIAS("platform:isp116x-hcd");