Lines Matching refs:u132
112 struct u132 *u132; member
147 struct u132 *u132; member
173 struct u132 *u132; member
177 struct u132 { struct
212 #define u132_read_pcimem(u132, member, data) \ argument
213 usb_ftdi_elan_read_pcimem(u132->platform_dev, offsetof(struct \
215 #define u132_write_pcimem(u132, member, data) \ argument
216 usb_ftdi_elan_write_pcimem(u132->platform_dev, offsetof(struct \
218 static inline struct u132 *udev_to_u132(struct u132_udev *udev) in udev_to_u132()
221 return container_of(udev, struct u132, udev[udev_number]); in udev_to_u132()
224 static inline struct u132 *hcd_to_u132(struct usb_hcd *hcd) in hcd_to_u132()
226 return (struct u132 *)(hcd->hcd_priv); in hcd_to_u132()
229 static inline struct usb_hcd *u132_to_hcd(struct u132 *u132) in u132_to_hcd() argument
231 return container_of((void *)u132, struct usb_hcd, hcd_priv); in u132_to_hcd()
234 static inline void u132_disable(struct u132 *u132) in u132_disable() argument
236 u132_to_hcd(u132)->state = HC_STATE_HALT; in u132_disable()
240 #define kref_to_u132(d) container_of(d, struct u132, kref)
250 struct u132 *u132 = kref_to_u132(kref); in u132_hcd_delete() local
251 struct platform_device *pdev = u132->platform_dev; in u132_hcd_delete()
252 struct usb_hcd *hcd = u132_to_hcd(u132); in u132_hcd_delete()
253 u132->going += 1; in u132_hcd_delete()
257 dev_warn(&u132->platform_dev->dev, "FREEING the hcd=%p and thus the u13" in u132_hcd_delete()
258 "2=%p going=%d pdev=%p\n", hcd, u132, u132->going, pdev); in u132_hcd_delete()
262 static inline void u132_u132_put_kref(struct u132 *u132) in u132_u132_put_kref() argument
264 kref_put(&u132->kref, u132_hcd_delete); in u132_u132_put_kref()
267 static inline void u132_u132_init_kref(struct u132 *u132) in u132_u132_init_kref() argument
269 kref_init(&u132->kref); in u132_u132_init_kref()
281 static inline void u132_udev_put_kref(struct u132 *u132, struct u132_udev *udev) in u132_udev_put_kref() argument
286 static inline void u132_udev_get_kref(struct u132 *u132, struct u132_udev *udev) in u132_udev_get_kref() argument
291 static inline void u132_udev_init_kref(struct u132 *u132, in u132_udev_init_kref() argument
297 static inline void u132_ring_put_kref(struct u132 *u132, struct u132_ring *ring) in u132_ring_put_kref() argument
299 kref_put(&u132->kref, u132_hcd_delete); in u132_ring_put_kref()
302 static void u132_ring_requeue_work(struct u132 *u132, struct u132_ring *ring, in u132_ring_requeue_work() argument
310 kref_put(&u132->kref, u132_hcd_delete); in u132_ring_requeue_work()
313 static void u132_ring_queue_work(struct u132 *u132, struct u132_ring *ring, in u132_ring_queue_work() argument
316 kref_get(&u132->kref); in u132_ring_queue_work()
317 u132_ring_requeue_work(u132, ring, delta); in u132_ring_queue_work()
320 static void u132_ring_cancel_work(struct u132 *u132, struct u132_ring *ring) in u132_ring_cancel_work() argument
323 kref_put(&u132->kref, u132_hcd_delete); in u132_ring_cancel_work()
329 struct u132 *u132 = endp->u132; in u132_endp_delete() local
332 u8 address = u132->addr[usb_addr].address; in u132_endp_delete()
333 struct u132_udev *udev = &u132->udev[address]; in u132_endp_delete()
353 u132_udev_put_kref(u132, udev); in u132_endp_delete()
357 u132_udev_put_kref(u132, udev); in u132_endp_delete()
359 u132->endp[endp_number - 1] = NULL; in u132_endp_delete()
362 u132_u132_put_kref(u132); in u132_endp_delete()
365 static inline void u132_endp_put_kref(struct u132 *u132, struct u132_endp *endp) in u132_endp_put_kref() argument
370 static inline void u132_endp_get_kref(struct u132 *u132, struct u132_endp *endp) in u132_endp_get_kref() argument
375 static inline void u132_endp_init_kref(struct u132 *u132, in u132_endp_init_kref() argument
379 kref_get(&u132->kref); in u132_endp_init_kref()
382 static void u132_endp_queue_work(struct u132 *u132, struct u132_endp *endp, in u132_endp_queue_work() argument
389 static void u132_endp_cancel_work(struct u132 *u132, struct u132_endp *endp) in u132_endp_cancel_work() argument
395 static inline void u132_monitor_put_kref(struct u132 *u132) in u132_monitor_put_kref() argument
397 kref_put(&u132->kref, u132_hcd_delete); in u132_monitor_put_kref()
400 static void u132_monitor_queue_work(struct u132 *u132, unsigned int delta) in u132_monitor_queue_work() argument
402 if (queue_delayed_work(workqueue, &u132->monitor, delta)) in u132_monitor_queue_work()
403 kref_get(&u132->kref); in u132_monitor_queue_work()
406 static void u132_monitor_requeue_work(struct u132 *u132, unsigned int delta) in u132_monitor_requeue_work() argument
408 if (!queue_delayed_work(workqueue, &u132->monitor, delta)) in u132_monitor_requeue_work()
409 kref_put(&u132->kref, u132_hcd_delete); in u132_monitor_requeue_work()
412 static void u132_monitor_cancel_work(struct u132 *u132) in u132_monitor_cancel_work() argument
414 if (cancel_delayed_work(&u132->monitor)) in u132_monitor_cancel_work()
415 kref_put(&u132->kref, u132_hcd_delete); in u132_monitor_cancel_work()
418 static int read_roothub_info(struct u132 *u132) in read_roothub_info() argument
422 retval = u132_read_pcimem(u132, revision, &revision); in read_roothub_info()
424 dev_err(&u132->platform_dev->dev, "error %d accessing device co" in read_roothub_info()
430 dev_err(&u132->platform_dev->dev, "device revision is not valid" in read_roothub_info()
434 retval = u132_read_pcimem(u132, control, &u132->hc_control); in read_roothub_info()
436 dev_err(&u132->platform_dev->dev, "error %d accessing device co" in read_roothub_info()
440 retval = u132_read_pcimem(u132, roothub.status, in read_roothub_info()
441 &u132->hc_roothub_status); in read_roothub_info()
443 dev_err(&u132->platform_dev->dev, "error %d accessing device re" in read_roothub_info()
447 retval = u132_read_pcimem(u132, roothub.a, &u132->hc_roothub_a); in read_roothub_info()
449 dev_err(&u132->platform_dev->dev, "error %d accessing device re" in read_roothub_info()
454 int I = u132->num_ports; in read_roothub_info()
457 retval = u132_read_pcimem(u132, roothub.portstatus[i], in read_roothub_info()
458 &u132->hc_roothub_portstatus[i]); in read_roothub_info()
460 dev_err(&u132->platform_dev->dev, "error %d acc" in read_roothub_info()
473 struct u132 *u132 = container_of(work, struct u132, monitor.work); in u132_hcd_monitor_work() local
474 if (u132->going > 1) { in u132_hcd_monitor_work()
475 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_hcd_monitor_work()
476 , u132->going); in u132_hcd_monitor_work()
477 u132_monitor_put_kref(u132); in u132_hcd_monitor_work()
479 } else if (u132->going > 0) { in u132_hcd_monitor_work()
480 dev_err(&u132->platform_dev->dev, "device is being removed\n"); in u132_hcd_monitor_work()
481 u132_monitor_put_kref(u132); in u132_hcd_monitor_work()
485 mutex_lock(&u132->sw_lock); in u132_hcd_monitor_work()
486 retval = read_roothub_info(u132); in u132_hcd_monitor_work()
488 struct usb_hcd *hcd = u132_to_hcd(u132); in u132_hcd_monitor_work()
489 u132_disable(u132); in u132_hcd_monitor_work()
490 u132->going = 1; in u132_hcd_monitor_work()
491 mutex_unlock(&u132->sw_lock); in u132_hcd_monitor_work()
493 ftdi_elan_gone_away(u132->platform_dev); in u132_hcd_monitor_work()
494 u132_monitor_put_kref(u132); in u132_hcd_monitor_work()
497 u132_monitor_requeue_work(u132, 500); in u132_hcd_monitor_work()
498 mutex_unlock(&u132->sw_lock); in u132_hcd_monitor_work()
504 static void u132_hcd_giveback_urb(struct u132 *u132, struct u132_endp *endp, in u132_hcd_giveback_urb() argument
509 struct usb_hcd *hcd = u132_to_hcd(u132); in u132_hcd_giveback_urb()
528 mutex_lock(&u132->scheduler_lock); in u132_hcd_giveback_urb()
531 u132_ring_cancel_work(u132, ring); in u132_hcd_giveback_urb()
532 u132_ring_queue_work(u132, ring, 0); in u132_hcd_giveback_urb()
533 mutex_unlock(&u132->scheduler_lock); in u132_hcd_giveback_urb()
534 u132_endp_put_kref(u132, endp); in u132_hcd_giveback_urb()
538 static void u132_hcd_forget_urb(struct u132 *u132, struct u132_endp *endp, in u132_hcd_forget_urb() argument
541 u132_endp_put_kref(u132, endp); in u132_hcd_forget_urb()
544 static void u132_hcd_abandon_urb(struct u132 *u132, struct u132_endp *endp, in u132_hcd_abandon_urb() argument
548 struct usb_hcd *hcd = u132_to_hcd(u132); in u132_hcd_abandon_urb()
570 static inline int edset_input(struct u132 *u132, struct u132_ring *ring, in edset_input() argument
576 return usb_ftdi_elan_edset_input(u132->platform_dev, ring->number, endp, in edset_input()
580 static inline int edset_setup(struct u132 *u132, struct u132_ring *ring, in edset_setup() argument
586 return usb_ftdi_elan_edset_setup(u132->platform_dev, ring->number, endp, in edset_setup()
590 static inline int edset_single(struct u132 *u132, struct u132_ring *ring, in edset_single() argument
596 return usb_ftdi_elan_edset_single(u132->platform_dev, ring->number, in edset_single()
600 static inline int edset_output(struct u132 *u132, struct u132_ring *ring, in edset_output() argument
606 return usb_ftdi_elan_edset_output(u132->platform_dev, ring->number, in edset_output()
620 struct u132 *u132 = endp->u132; in u132_hcd_interrupt_recv() local
621 u8 address = u132->addr[endp->usb_addr].address; in u132_hcd_interrupt_recv()
622 struct u132_udev *udev = &u132->udev[address]; in u132_hcd_interrupt_recv()
623 mutex_lock(&u132->scheduler_lock); in u132_hcd_interrupt_recv()
624 if (u132->going > 1) { in u132_hcd_interrupt_recv()
625 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_hcd_interrupt_recv()
626 , u132->going); in u132_hcd_interrupt_recv()
627 mutex_unlock(&u132->scheduler_lock); in u132_hcd_interrupt_recv()
628 u132_hcd_forget_urb(u132, endp, urb, -ENODEV); in u132_hcd_interrupt_recv()
632 mutex_unlock(&u132->scheduler_lock); in u132_hcd_interrupt_recv()
633 u132_hcd_giveback_urb(u132, endp, urb, -EINTR); in u132_hcd_interrupt_recv()
635 } else if (u132->going > 0) { in u132_hcd_interrupt_recv()
636 dev_err(&u132->platform_dev->dev, "device is being removed " in u132_hcd_interrupt_recv()
638 mutex_unlock(&u132->scheduler_lock); in u132_hcd_interrupt_recv()
639 u132_hcd_giveback_urb(u132, endp, urb, -ENODEV); in u132_hcd_interrupt_recv()
658 mutex_unlock(&u132->scheduler_lock); in u132_hcd_interrupt_recv()
659 retval = edset_single(u132, ring, endp, urb, in u132_hcd_interrupt_recv()
663 u132_hcd_giveback_urb(u132, endp, urb, in u132_hcd_interrupt_recv()
670 u132_ring_cancel_work(u132, ring); in u132_hcd_interrupt_recv()
671 u132_ring_queue_work(u132, ring, 0); in u132_hcd_interrupt_recv()
672 mutex_unlock(&u132->scheduler_lock); in u132_hcd_interrupt_recv()
673 u132_endp_put_kref(u132, endp); in u132_hcd_interrupt_recv()
681 mutex_unlock(&u132->scheduler_lock); in u132_hcd_interrupt_recv()
682 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_interrupt_recv()
697 dev_err(&u132->platform_dev->dev, "urb=%p givin" in u132_hcd_interrupt_recv()
701 mutex_unlock(&u132->scheduler_lock); in u132_hcd_interrupt_recv()
702 u132_hcd_giveback_urb(u132, endp, urb, in u132_hcd_interrupt_recv()
707 dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " in u132_hcd_interrupt_recv()
709 mutex_unlock(&u132->scheduler_lock); in u132_hcd_interrupt_recv()
710 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_interrupt_recv()
720 struct u132 *u132 = endp->u132; in u132_hcd_bulk_output_sent() local
721 u8 address = u132->addr[endp->usb_addr].address; in u132_hcd_bulk_output_sent()
722 mutex_lock(&u132->scheduler_lock); in u132_hcd_bulk_output_sent()
723 if (u132->going > 1) { in u132_hcd_bulk_output_sent()
724 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_hcd_bulk_output_sent()
725 , u132->going); in u132_hcd_bulk_output_sent()
726 mutex_unlock(&u132->scheduler_lock); in u132_hcd_bulk_output_sent()
727 u132_hcd_forget_urb(u132, endp, urb, -ENODEV); in u132_hcd_bulk_output_sent()
731 mutex_unlock(&u132->scheduler_lock); in u132_hcd_bulk_output_sent()
732 u132_hcd_giveback_urb(u132, endp, urb, -EINTR); in u132_hcd_bulk_output_sent()
734 } else if (u132->going > 0) { in u132_hcd_bulk_output_sent()
735 dev_err(&u132->platform_dev->dev, "device is being removed " in u132_hcd_bulk_output_sent()
737 mutex_unlock(&u132->scheduler_lock); in u132_hcd_bulk_output_sent()
738 u132_hcd_giveback_urb(u132, endp, urb, -ENODEV); in u132_hcd_bulk_output_sent()
746 mutex_unlock(&u132->scheduler_lock); in u132_hcd_bulk_output_sent()
747 retval = edset_output(u132, ring, endp, urb, address, in u132_hcd_bulk_output_sent()
750 u132_hcd_giveback_urb(u132, endp, urb, retval); in u132_hcd_bulk_output_sent()
753 mutex_unlock(&u132->scheduler_lock); in u132_hcd_bulk_output_sent()
754 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_bulk_output_sent()
758 dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " in u132_hcd_bulk_output_sent()
760 mutex_unlock(&u132->scheduler_lock); in u132_hcd_bulk_output_sent()
761 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_bulk_output_sent()
771 struct u132 *u132 = endp->u132; in u132_hcd_bulk_input_recv() local
772 u8 address = u132->addr[endp->usb_addr].address; in u132_hcd_bulk_input_recv()
773 struct u132_udev *udev = &u132->udev[address]; in u132_hcd_bulk_input_recv()
774 mutex_lock(&u132->scheduler_lock); in u132_hcd_bulk_input_recv()
775 if (u132->going > 1) { in u132_hcd_bulk_input_recv()
776 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_hcd_bulk_input_recv()
777 , u132->going); in u132_hcd_bulk_input_recv()
778 mutex_unlock(&u132->scheduler_lock); in u132_hcd_bulk_input_recv()
779 u132_hcd_forget_urb(u132, endp, urb, -ENODEV); in u132_hcd_bulk_input_recv()
783 mutex_unlock(&u132->scheduler_lock); in u132_hcd_bulk_input_recv()
784 u132_hcd_giveback_urb(u132, endp, urb, -EINTR); in u132_hcd_bulk_input_recv()
786 } else if (u132->going > 0) { in u132_hcd_bulk_input_recv()
787 dev_err(&u132->platform_dev->dev, "device is being removed " in u132_hcd_bulk_input_recv()
789 mutex_unlock(&u132->scheduler_lock); in u132_hcd_bulk_input_recv()
790 u132_hcd_giveback_urb(u132, endp, urb, -ENODEV); in u132_hcd_bulk_input_recv()
808 mutex_unlock(&u132->scheduler_lock); in u132_hcd_bulk_input_recv()
809 retval = usb_ftdi_elan_edset_input(u132->platform_dev, in u132_hcd_bulk_input_recv()
814 u132_hcd_giveback_urb(u132, endp, urb, retval); in u132_hcd_bulk_input_recv()
820 mutex_unlock(&u132->scheduler_lock); in u132_hcd_bulk_input_recv()
821 u132_hcd_giveback_urb(u132, endp, urb, in u132_hcd_bulk_input_recv()
829 mutex_unlock(&u132->scheduler_lock); in u132_hcd_bulk_input_recv()
830 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_bulk_input_recv()
836 dev_warn(&u132->platform_dev->dev, "urb=%p(SHORT NOT OK" in u132_hcd_bulk_input_recv()
839 mutex_unlock(&u132->scheduler_lock); in u132_hcd_bulk_input_recv()
840 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_bulk_input_recv()
845 mutex_unlock(&u132->scheduler_lock); in u132_hcd_bulk_input_recv()
846 u132_hcd_giveback_urb(u132, endp, urb, in u132_hcd_bulk_input_recv()
852 dev_err(&u132->platform_dev->dev, "urb=%p giving back B" in u132_hcd_bulk_input_recv()
855 mutex_unlock(&u132->scheduler_lock); in u132_hcd_bulk_input_recv()
856 u132_hcd_giveback_urb(u132, endp, urb, in u132_hcd_bulk_input_recv()
861 dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " in u132_hcd_bulk_input_recv()
863 mutex_unlock(&u132->scheduler_lock); in u132_hcd_bulk_input_recv()
864 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_bulk_input_recv()
874 struct u132 *u132 = endp->u132; in u132_hcd_configure_empty_sent() local
875 mutex_lock(&u132->scheduler_lock); in u132_hcd_configure_empty_sent()
876 if (u132->going > 1) { in u132_hcd_configure_empty_sent()
877 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_hcd_configure_empty_sent()
878 , u132->going); in u132_hcd_configure_empty_sent()
879 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_empty_sent()
880 u132_hcd_forget_urb(u132, endp, urb, -ENODEV); in u132_hcd_configure_empty_sent()
884 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_empty_sent()
885 u132_hcd_giveback_urb(u132, endp, urb, -EINTR); in u132_hcd_configure_empty_sent()
887 } else if (u132->going > 0) { in u132_hcd_configure_empty_sent()
888 dev_err(&u132->platform_dev->dev, "device is being removed " in u132_hcd_configure_empty_sent()
890 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_empty_sent()
891 u132_hcd_giveback_urb(u132, endp, urb, -ENODEV); in u132_hcd_configure_empty_sent()
894 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_empty_sent()
895 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_configure_empty_sent()
898 dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " in u132_hcd_configure_empty_sent()
900 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_empty_sent()
901 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_configure_empty_sent()
911 struct u132 *u132 = endp->u132; in u132_hcd_configure_input_recv() local
912 u8 address = u132->addr[endp->usb_addr].address; in u132_hcd_configure_input_recv()
913 mutex_lock(&u132->scheduler_lock); in u132_hcd_configure_input_recv()
914 if (u132->going > 1) { in u132_hcd_configure_input_recv()
915 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_hcd_configure_input_recv()
916 , u132->going); in u132_hcd_configure_input_recv()
917 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_input_recv()
918 u132_hcd_forget_urb(u132, endp, urb, -ENODEV); in u132_hcd_configure_input_recv()
922 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_input_recv()
923 u132_hcd_giveback_urb(u132, endp, urb, -EINTR); in u132_hcd_configure_input_recv()
925 } else if (u132->going > 0) { in u132_hcd_configure_input_recv()
926 dev_err(&u132->platform_dev->dev, "device is being removed " in u132_hcd_configure_input_recv()
928 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_input_recv()
929 u132_hcd_giveback_urb(u132, endp, urb, -ENODEV); in u132_hcd_configure_input_recv()
945 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_input_recv()
946 retval = usb_ftdi_elan_edset_empty(u132->platform_dev, in u132_hcd_configure_input_recv()
951 u132_hcd_giveback_urb(u132, endp, urb, retval); in u132_hcd_configure_input_recv()
954 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_input_recv()
955 dev_warn(&u132->platform_dev->dev, "giving back SETUP I" in u132_hcd_configure_input_recv()
957 u132_hcd_giveback_urb(u132, endp, urb, in u132_hcd_configure_input_recv()
961 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_input_recv()
962 dev_err(&u132->platform_dev->dev, "giving back SETUP IN" in u132_hcd_configure_input_recv()
965 u132_hcd_giveback_urb(u132, endp, urb, in u132_hcd_configure_input_recv()
970 dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " in u132_hcd_configure_input_recv()
972 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_input_recv()
973 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_configure_input_recv()
983 struct u132 *u132 = endp->u132; in u132_hcd_configure_empty_recv() local
984 mutex_lock(&u132->scheduler_lock); in u132_hcd_configure_empty_recv()
985 if (u132->going > 1) { in u132_hcd_configure_empty_recv()
986 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_hcd_configure_empty_recv()
987 , u132->going); in u132_hcd_configure_empty_recv()
988 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_empty_recv()
989 u132_hcd_forget_urb(u132, endp, urb, -ENODEV); in u132_hcd_configure_empty_recv()
993 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_empty_recv()
994 u132_hcd_giveback_urb(u132, endp, urb, -EINTR); in u132_hcd_configure_empty_recv()
996 } else if (u132->going > 0) { in u132_hcd_configure_empty_recv()
997 dev_err(&u132->platform_dev->dev, "device is being removed " in u132_hcd_configure_empty_recv()
999 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_empty_recv()
1000 u132_hcd_giveback_urb(u132, endp, urb, -ENODEV); in u132_hcd_configure_empty_recv()
1003 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_empty_recv()
1004 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_configure_empty_recv()
1007 dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " in u132_hcd_configure_empty_recv()
1009 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_empty_recv()
1010 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_configure_empty_recv()
1020 struct u132 *u132 = endp->u132; in u132_hcd_configure_setup_sent() local
1021 u8 address = u132->addr[endp->usb_addr].address; in u132_hcd_configure_setup_sent()
1022 mutex_lock(&u132->scheduler_lock); in u132_hcd_configure_setup_sent()
1023 if (u132->going > 1) { in u132_hcd_configure_setup_sent()
1024 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_hcd_configure_setup_sent()
1025 , u132->going); in u132_hcd_configure_setup_sent()
1026 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_setup_sent()
1027 u132_hcd_forget_urb(u132, endp, urb, -ENODEV); in u132_hcd_configure_setup_sent()
1031 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_setup_sent()
1032 u132_hcd_giveback_urb(u132, endp, urb, -EINTR); in u132_hcd_configure_setup_sent()
1034 } else if (u132->going > 0) { in u132_hcd_configure_setup_sent()
1035 dev_err(&u132->platform_dev->dev, "device is being removed " in u132_hcd_configure_setup_sent()
1037 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_setup_sent()
1038 u132_hcd_giveback_urb(u132, endp, urb, -ENODEV); in u132_hcd_configure_setup_sent()
1044 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_setup_sent()
1045 retval = usb_ftdi_elan_edset_input(u132->platform_dev, in u132_hcd_configure_setup_sent()
1050 u132_hcd_giveback_urb(u132, endp, urb, retval); in u132_hcd_configure_setup_sent()
1055 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_setup_sent()
1056 retval = usb_ftdi_elan_edset_input(u132->platform_dev, in u132_hcd_configure_setup_sent()
1061 u132_hcd_giveback_urb(u132, endp, urb, retval); in u132_hcd_configure_setup_sent()
1065 dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " in u132_hcd_configure_setup_sent()
1067 mutex_unlock(&u132->scheduler_lock); in u132_hcd_configure_setup_sent()
1068 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_configure_setup_sent()
1078 struct u132 *u132 = endp->u132; in u132_hcd_enumeration_empty_recv() local
1079 u8 address = u132->addr[endp->usb_addr].address; in u132_hcd_enumeration_empty_recv()
1080 struct u132_udev *udev = &u132->udev[address]; in u132_hcd_enumeration_empty_recv()
1081 mutex_lock(&u132->scheduler_lock); in u132_hcd_enumeration_empty_recv()
1082 if (u132->going > 1) { in u132_hcd_enumeration_empty_recv()
1083 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_hcd_enumeration_empty_recv()
1084 , u132->going); in u132_hcd_enumeration_empty_recv()
1085 mutex_unlock(&u132->scheduler_lock); in u132_hcd_enumeration_empty_recv()
1086 u132_hcd_forget_urb(u132, endp, urb, -ENODEV); in u132_hcd_enumeration_empty_recv()
1090 mutex_unlock(&u132->scheduler_lock); in u132_hcd_enumeration_empty_recv()
1091 u132_hcd_giveback_urb(u132, endp, urb, -EINTR); in u132_hcd_enumeration_empty_recv()
1093 } else if (u132->going > 0) { in u132_hcd_enumeration_empty_recv()
1094 dev_err(&u132->platform_dev->dev, "device is being removed " in u132_hcd_enumeration_empty_recv()
1096 mutex_unlock(&u132->scheduler_lock); in u132_hcd_enumeration_empty_recv()
1097 u132_hcd_giveback_urb(u132, endp, urb, -ENODEV); in u132_hcd_enumeration_empty_recv()
1100 u132->addr[0].address = 0; in u132_hcd_enumeration_empty_recv()
1102 mutex_unlock(&u132->scheduler_lock); in u132_hcd_enumeration_empty_recv()
1103 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_enumeration_empty_recv()
1106 dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " in u132_hcd_enumeration_empty_recv()
1108 mutex_unlock(&u132->scheduler_lock); in u132_hcd_enumeration_empty_recv()
1109 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_enumeration_empty_recv()
1119 struct u132 *u132 = endp->u132; in u132_hcd_enumeration_address_sent() local
1120 mutex_lock(&u132->scheduler_lock); in u132_hcd_enumeration_address_sent()
1121 if (u132->going > 1) { in u132_hcd_enumeration_address_sent()
1122 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_hcd_enumeration_address_sent()
1123 , u132->going); in u132_hcd_enumeration_address_sent()
1124 mutex_unlock(&u132->scheduler_lock); in u132_hcd_enumeration_address_sent()
1125 u132_hcd_forget_urb(u132, endp, urb, -ENODEV); in u132_hcd_enumeration_address_sent()
1129 mutex_unlock(&u132->scheduler_lock); in u132_hcd_enumeration_address_sent()
1130 u132_hcd_giveback_urb(u132, endp, urb, -EINTR); in u132_hcd_enumeration_address_sent()
1132 } else if (u132->going > 0) { in u132_hcd_enumeration_address_sent()
1133 dev_err(&u132->platform_dev->dev, "device is being removed " in u132_hcd_enumeration_address_sent()
1135 mutex_unlock(&u132->scheduler_lock); in u132_hcd_enumeration_address_sent()
1136 u132_hcd_giveback_urb(u132, endp, urb, -ENODEV); in u132_hcd_enumeration_address_sent()
1141 mutex_unlock(&u132->scheduler_lock); in u132_hcd_enumeration_address_sent()
1142 retval = usb_ftdi_elan_edset_input(u132->platform_dev, in u132_hcd_enumeration_address_sent()
1146 u132_hcd_giveback_urb(u132, endp, urb, retval); in u132_hcd_enumeration_address_sent()
1149 dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " in u132_hcd_enumeration_address_sent()
1151 mutex_unlock(&u132->scheduler_lock); in u132_hcd_enumeration_address_sent()
1152 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_enumeration_address_sent()
1162 struct u132 *u132 = endp->u132; in u132_hcd_initial_empty_sent() local
1163 mutex_lock(&u132->scheduler_lock); in u132_hcd_initial_empty_sent()
1164 if (u132->going > 1) { in u132_hcd_initial_empty_sent()
1165 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_hcd_initial_empty_sent()
1166 , u132->going); in u132_hcd_initial_empty_sent()
1167 mutex_unlock(&u132->scheduler_lock); in u132_hcd_initial_empty_sent()
1168 u132_hcd_forget_urb(u132, endp, urb, -ENODEV); in u132_hcd_initial_empty_sent()
1172 mutex_unlock(&u132->scheduler_lock); in u132_hcd_initial_empty_sent()
1173 u132_hcd_giveback_urb(u132, endp, urb, -EINTR); in u132_hcd_initial_empty_sent()
1175 } else if (u132->going > 0) { in u132_hcd_initial_empty_sent()
1176 dev_err(&u132->platform_dev->dev, "device is being removed " in u132_hcd_initial_empty_sent()
1178 mutex_unlock(&u132->scheduler_lock); in u132_hcd_initial_empty_sent()
1179 u132_hcd_giveback_urb(u132, endp, urb, -ENODEV); in u132_hcd_initial_empty_sent()
1182 mutex_unlock(&u132->scheduler_lock); in u132_hcd_initial_empty_sent()
1183 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_initial_empty_sent()
1186 dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " in u132_hcd_initial_empty_sent()
1188 mutex_unlock(&u132->scheduler_lock); in u132_hcd_initial_empty_sent()
1189 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_initial_empty_sent()
1199 struct u132 *u132 = endp->u132; in u132_hcd_initial_input_recv() local
1200 u8 address = u132->addr[endp->usb_addr].address; in u132_hcd_initial_input_recv()
1201 mutex_lock(&u132->scheduler_lock); in u132_hcd_initial_input_recv()
1202 if (u132->going > 1) { in u132_hcd_initial_input_recv()
1203 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_hcd_initial_input_recv()
1204 , u132->going); in u132_hcd_initial_input_recv()
1205 mutex_unlock(&u132->scheduler_lock); in u132_hcd_initial_input_recv()
1206 u132_hcd_forget_urb(u132, endp, urb, -ENODEV); in u132_hcd_initial_input_recv()
1210 mutex_unlock(&u132->scheduler_lock); in u132_hcd_initial_input_recv()
1211 u132_hcd_giveback_urb(u132, endp, urb, -EINTR); in u132_hcd_initial_input_recv()
1213 } else if (u132->going > 0) { in u132_hcd_initial_input_recv()
1214 dev_err(&u132->platform_dev->dev, "device is being removed " in u132_hcd_initial_input_recv()
1216 mutex_unlock(&u132->scheduler_lock); in u132_hcd_initial_input_recv()
1217 u132_hcd_giveback_urb(u132, endp, urb, -ENODEV); in u132_hcd_initial_input_recv()
1230 mutex_unlock(&u132->scheduler_lock); in u132_hcd_initial_input_recv()
1231 retval = usb_ftdi_elan_edset_empty(u132->platform_dev, in u132_hcd_initial_input_recv()
1235 u132_hcd_giveback_urb(u132, endp, urb, retval); in u132_hcd_initial_input_recv()
1238 dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " in u132_hcd_initial_input_recv()
1240 mutex_unlock(&u132->scheduler_lock); in u132_hcd_initial_input_recv()
1241 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_initial_input_recv()
1251 struct u132 *u132 = endp->u132; in u132_hcd_initial_setup_sent() local
1252 u8 address = u132->addr[endp->usb_addr].address; in u132_hcd_initial_setup_sent()
1253 mutex_lock(&u132->scheduler_lock); in u132_hcd_initial_setup_sent()
1254 if (u132->going > 1) { in u132_hcd_initial_setup_sent()
1255 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_hcd_initial_setup_sent()
1256 , u132->going); in u132_hcd_initial_setup_sent()
1257 mutex_unlock(&u132->scheduler_lock); in u132_hcd_initial_setup_sent()
1258 u132_hcd_forget_urb(u132, endp, urb, -ENODEV); in u132_hcd_initial_setup_sent()
1262 mutex_unlock(&u132->scheduler_lock); in u132_hcd_initial_setup_sent()
1263 u132_hcd_giveback_urb(u132, endp, urb, -EINTR); in u132_hcd_initial_setup_sent()
1265 } else if (u132->going > 0) { in u132_hcd_initial_setup_sent()
1266 dev_err(&u132->platform_dev->dev, "device is being removed " in u132_hcd_initial_setup_sent()
1268 mutex_unlock(&u132->scheduler_lock); in u132_hcd_initial_setup_sent()
1269 u132_hcd_giveback_urb(u132, endp, urb, -ENODEV); in u132_hcd_initial_setup_sent()
1274 mutex_unlock(&u132->scheduler_lock); in u132_hcd_initial_setup_sent()
1275 retval = usb_ftdi_elan_edset_input(u132->platform_dev, in u132_hcd_initial_setup_sent()
1279 u132_hcd_giveback_urb(u132, endp, urb, retval); in u132_hcd_initial_setup_sent()
1282 dev_err(&u132->platform_dev->dev, "CALLBACK called urb=%p " in u132_hcd_initial_setup_sent()
1284 mutex_unlock(&u132->scheduler_lock); in u132_hcd_initial_setup_sent()
1285 u132_hcd_giveback_urb(u132, endp, urb, 0); in u132_hcd_initial_setup_sent()
1298 struct u132 *u132 = ring->u132; in u132_hcd_ring_work_scheduler() local
1299 mutex_lock(&u132->scheduler_lock); in u132_hcd_ring_work_scheduler()
1301 mutex_unlock(&u132->scheduler_lock); in u132_hcd_ring_work_scheduler()
1302 u132_ring_put_kref(u132, ring); in u132_hcd_ring_work_scheduler()
1312 u132_endp_cancel_work(u132, last_endp); in u132_hcd_ring_work_scheduler()
1313 u132_endp_queue_work(u132, last_endp, 0); in u132_hcd_ring_work_scheduler()
1314 mutex_unlock(&u132->scheduler_lock); in u132_hcd_ring_work_scheduler()
1315 u132_ring_put_kref(u132, ring); in u132_hcd_ring_work_scheduler()
1326 u132_endp_cancel_work(u132, last_endp); in u132_hcd_ring_work_scheduler()
1327 u132_endp_queue_work(u132, last_endp, 0); in u132_hcd_ring_work_scheduler()
1328 mutex_unlock(&u132->scheduler_lock); in u132_hcd_ring_work_scheduler()
1329 u132_ring_put_kref(u132, ring); in u132_hcd_ring_work_scheduler()
1337 u132_ring_requeue_work(u132, ring, wakeup); in u132_hcd_ring_work_scheduler()
1338 mutex_unlock(&u132->scheduler_lock); in u132_hcd_ring_work_scheduler()
1341 mutex_unlock(&u132->scheduler_lock); in u132_hcd_ring_work_scheduler()
1342 u132_ring_put_kref(u132, ring); in u132_hcd_ring_work_scheduler()
1346 mutex_unlock(&u132->scheduler_lock); in u132_hcd_ring_work_scheduler()
1347 u132_ring_put_kref(u132, ring); in u132_hcd_ring_work_scheduler()
1357 struct u132 *u132 = endp->u132; in u132_hcd_endp_work_scheduler() local
1358 mutex_lock(&u132->scheduler_lock); in u132_hcd_endp_work_scheduler()
1363 usb_ftdi_elan_edset_flush(u132->platform_dev, in u132_hcd_endp_work_scheduler()
1365 mutex_unlock(&u132->scheduler_lock); in u132_hcd_endp_work_scheduler()
1366 u132_endp_put_kref(u132, endp); in u132_hcd_endp_work_scheduler()
1369 mutex_unlock(&u132->scheduler_lock); in u132_hcd_endp_work_scheduler()
1370 u132_endp_put_kref(u132, endp); in u132_hcd_endp_work_scheduler()
1373 mutex_unlock(&u132->scheduler_lock); in u132_hcd_endp_work_scheduler()
1374 u132_endp_put_kref(u132, endp); in u132_hcd_endp_work_scheduler()
1377 mutex_unlock(&u132->scheduler_lock); in u132_hcd_endp_work_scheduler()
1378 u132_endp_put_kref(u132, endp); in u132_hcd_endp_work_scheduler()
1381 u8 address = u132->addr[endp->usb_addr].address; in u132_hcd_endp_work_scheduler()
1383 mutex_unlock(&u132->scheduler_lock); in u132_hcd_endp_work_scheduler()
1384 u132_endp_put_kref(u132, endp); in u132_hcd_endp_work_scheduler()
1393 mutex_unlock(&u132->scheduler_lock); in u132_hcd_endp_work_scheduler()
1394 retval = edset_single(u132, ring, endp, urb, address, in u132_hcd_endp_work_scheduler()
1397 u132_hcd_giveback_urb(u132, endp, urb, retval); in u132_hcd_endp_work_scheduler()
1401 u8 address = u132->addr[endp->usb_addr].address; in u132_hcd_endp_work_scheduler()
1403 mutex_unlock(&u132->scheduler_lock); in u132_hcd_endp_work_scheduler()
1404 u132_endp_put_kref(u132, endp); in u132_hcd_endp_work_scheduler()
1413 mutex_unlock(&u132->scheduler_lock); in u132_hcd_endp_work_scheduler()
1414 retval = edset_setup(u132, ring, endp, urb, address, in u132_hcd_endp_work_scheduler()
1417 u132_hcd_giveback_urb(u132, endp, urb, retval); in u132_hcd_endp_work_scheduler()
1426 mutex_unlock(&u132->scheduler_lock); in u132_hcd_endp_work_scheduler()
1427 retval = edset_setup(u132, ring, endp, urb, 0, 0x2, in u132_hcd_endp_work_scheduler()
1430 u132_hcd_giveback_urb(u132, endp, urb, retval); in u132_hcd_endp_work_scheduler()
1436 address = u132->addr[endp->usb_addr].address; in u132_hcd_endp_work_scheduler()
1440 mutex_unlock(&u132->scheduler_lock); in u132_hcd_endp_work_scheduler()
1441 retval = edset_setup(u132, ring, endp, urb, address, in u132_hcd_endp_work_scheduler()
1444 u132_hcd_giveback_urb(u132, endp, urb, retval); in u132_hcd_endp_work_scheduler()
1449 u8 address = u132->addr[endp->usb_addr].address; in u132_hcd_endp_work_scheduler()
1451 mutex_unlock(&u132->scheduler_lock); in u132_hcd_endp_work_scheduler()
1452 u132_endp_put_kref(u132, endp); in u132_hcd_endp_work_scheduler()
1461 mutex_unlock(&u132->scheduler_lock); in u132_hcd_endp_work_scheduler()
1462 retval = edset_input(u132, ring, endp, urb, in u132_hcd_endp_work_scheduler()
1467 u132_hcd_giveback_urb(u132, endp, urb, in u132_hcd_endp_work_scheduler()
1472 u8 address = u132->addr[endp->usb_addr].address; in u132_hcd_endp_work_scheduler()
1474 mutex_unlock(&u132->scheduler_lock); in u132_hcd_endp_work_scheduler()
1475 u132_endp_put_kref(u132, endp); in u132_hcd_endp_work_scheduler()
1484 mutex_unlock(&u132->scheduler_lock); in u132_hcd_endp_work_scheduler()
1485 retval = edset_output(u132, ring, endp, urb, in u132_hcd_endp_work_scheduler()
1490 u132_hcd_giveback_urb(u132, endp, urb, in u132_hcd_endp_work_scheduler()
1499 static void port_power(struct u132 *u132, int pn, int is_on) in port_power() argument
1501 u132->port[pn].power = is_on; in port_power()
1506 static void u132_power(struct u132 *u132, int is_on) in u132_power() argument
1508 struct usb_hcd *hcd = u132_to_hcd(u132) in u132_power()
1511 if (u132->power) in u132_power()
1513 u132->power = 1; in u132_power()
1515 u132->power = 0; in u132_power()
1520 static int u132_periodic_reinit(struct u132 *u132) in u132_periodic_reinit() argument
1523 u32 fi = u132->hc_fminterval & 0x03fff; in u132_periodic_reinit()
1526 retval = u132_read_pcimem(u132, fminterval, &fminterval); in u132_periodic_reinit()
1530 retval = u132_write_pcimem(u132, fminterval, in u132_periodic_reinit()
1531 (fit ^ FIT) | u132->hc_fminterval); in u132_periodic_reinit()
1534 return u132_write_pcimem(u132, periodicstart, in u132_periodic_reinit()
1553 static int u132_init(struct u132 *u132) in u132_init() argument
1557 u132_disable(u132); in u132_init()
1558 u132->next_statechange = jiffies; in u132_init()
1559 retval = u132_write_pcimem(u132, intrdisable, OHCI_INTR_MIE); in u132_init()
1562 retval = u132_read_pcimem(u132, control, &control); in u132_init()
1565 if (u132->num_ports == 0) { in u132_init()
1567 retval = u132_read_pcimem(u132, roothub.a, &rh_a); in u132_init()
1570 u132->num_ports = rh_a & RH_A_NDP; in u132_init()
1571 retval = read_roothub_info(u132); in u132_init()
1575 if (u132->num_ports > MAX_U132_PORTS) in u132_init()
1586 static int u132_run(struct u132 *u132) in u132_run() argument
1596 int first = u132->hc_fminterval == 0; in u132_run()
1599 u132_disable(u132); in u132_run()
1602 retval = u132_read_pcimem(u132, fminterval, &temp); in u132_run()
1605 u132->hc_fminterval = temp & 0x3fff; in u132_run()
1606 u132->hc_fminterval |= FSMP(u132->hc_fminterval) << 16; in u132_run()
1608 retval = u132_read_pcimem(u132, control, &u132->hc_control); in u132_run()
1611 dev_info(&u132->platform_dev->dev, "resetting from state '%s', control " in u132_run()
1612 "= %08X\n", hcfs2string(u132->hc_control & OHCI_CTRL_HCFS), in u132_run()
1613 u132->hc_control); in u132_run()
1614 switch (u132->hc_control & OHCI_CTRL_HCFS) { in u132_run()
1620 u132->hc_control &= OHCI_CTRL_RWC; in u132_run()
1621 u132->hc_control |= OHCI_USB_RESUME; in u132_run()
1625 u132->hc_control &= OHCI_CTRL_RWC; in u132_run()
1626 u132->hc_control |= OHCI_USB_RESET; in u132_run()
1630 retval = u132_write_pcimem(u132, control, u132->hc_control); in u132_run()
1633 retval = u132_read_pcimem(u132, control, &control); in u132_run()
1637 retval = u132_read_pcimem(u132, roothub.a, &roothub_a); in u132_run()
1642 for (temp = 0; temp < u132->num_ports; temp++) { in u132_run()
1643 retval = u132_write_pcimem(u132, in u132_run()
1649 retval = u132_read_pcimem(u132, control, &control); in u132_run()
1653 retval = u132_read_pcimem(u132, cmdstatus, &status); in u132_run()
1656 retval = u132_write_pcimem(u132, cmdstatus, OHCI_HCR); in u132_run()
1660 retval = u132_read_pcimem(u132, cmdstatus, &status); in u132_run()
1665 dev_err(&u132->platform_dev->dev, "USB HC reset" in u132_run()
1674 if (u132->flags & OHCI_QUIRK_INITRESET) { in u132_run()
1675 retval = u132_write_pcimem(u132, control, u132->hc_control); in u132_run()
1678 retval = u132_read_pcimem(u132, control, &control); in u132_run()
1682 retval = u132_write_pcimem(u132, ed_controlhead, 0x00000000); in u132_run()
1685 retval = u132_write_pcimem(u132, ed_bulkhead, 0x11000000); in u132_run()
1688 retval = u132_write_pcimem(u132, hcca, 0x00000000); in u132_run()
1691 retval = u132_periodic_reinit(u132); in u132_run()
1694 retval = u132_read_pcimem(u132, fminterval, &fminterval); in u132_run()
1697 retval = u132_read_pcimem(u132, periodicstart, &periodicstart); in u132_run()
1701 if (!(u132->flags & OHCI_QUIRK_INITRESET)) { in u132_run()
1702 u132->flags |= OHCI_QUIRK_INITRESET; in u132_run()
1705 dev_err(&u132->platform_dev->dev, "init err(%08x %04x)" in u132_run()
1708 u132->hc_control &= OHCI_CTRL_RWC; in u132_run()
1709 u132->hc_control |= OHCI_CONTROL_INIT | OHCI_CTRL_BLE | OHCI_USB_OPER; in u132_run()
1710 retval = u132_write_pcimem(u132, control, u132->hc_control); in u132_run()
1713 retval = u132_write_pcimem(u132, cmdstatus, OHCI_BLF); in u132_run()
1716 retval = u132_read_pcimem(u132, cmdstatus, &cmdstatus); in u132_run()
1719 retval = u132_read_pcimem(u132, control, &control); in u132_run()
1722 u132_to_hcd(u132)->state = HC_STATE_RUNNING; in u132_run()
1723 retval = u132_write_pcimem(u132, roothub.status, RH_HS_DRWE); in u132_run()
1726 retval = u132_write_pcimem(u132, intrstatus, mask); in u132_run()
1729 retval = u132_write_pcimem(u132, intrdisable, in u132_run()
1735 retval = u132_read_pcimem(u132, roothub.a, &roothub_a); in u132_run()
1739 if (u132->flags & OHCI_QUIRK_SUPERIO) { in u132_run()
1742 retval = u132_write_pcimem(u132, roothub.a, roothub_a); in u132_run()
1745 } else if ((u132->flags & OHCI_QUIRK_AMD756) || distrust_firmware) { in u132_run()
1747 retval = u132_write_pcimem(u132, roothub.a, roothub_a); in u132_run()
1751 retval = u132_write_pcimem(u132, roothub.status, RH_HS_LPSC); in u132_run()
1754 retval = u132_write_pcimem(u132, roothub.b, in u132_run()
1758 retval = u132_read_pcimem(u132, control, &control); in u132_run()
1762 u132_to_hcd(u132)->state = HC_STATE_RUNNING; in u132_run()
1768 struct u132 *u132 = hcd_to_u132(hcd); in u132_hcd_stop() local
1769 if (u132->going > 1) { in u132_hcd_stop()
1770 dev_err(&u132->platform_dev->dev, "u132 device %p(hcd=%p) has b" in u132_hcd_stop()
1771 "een removed %d\n", u132, hcd, u132->going); in u132_hcd_stop()
1772 } else if (u132->going > 0) { in u132_hcd_stop()
1773 dev_err(&u132->platform_dev->dev, "device hcd=%p is being remov" in u132_hcd_stop()
1776 mutex_lock(&u132->sw_lock); in u132_hcd_stop()
1778 u132_power(u132, 0); in u132_hcd_stop()
1779 mutex_unlock(&u132->sw_lock); in u132_hcd_stop()
1785 struct u132 *u132 = hcd_to_u132(hcd); in u132_hcd_start() local
1786 if (u132->going > 1) { in u132_hcd_start()
1787 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_hcd_start()
1788 , u132->going); in u132_hcd_start()
1790 } else if (u132->going > 0) { in u132_hcd_start()
1791 dev_err(&u132->platform_dev->dev, "device is being removed\n"); in u132_hcd_start()
1801 mutex_lock(&u132->sw_lock); in u132_hcd_start()
1804 u132->flags = OHCI_QUIRK_AMD756; in u132_hcd_start()
1806 dev_err(&u132->platform_dev->dev, "WARNING: OPTi workar" in u132_hcd_start()
1809 u132->flags |= OHCI_QUIRK_ZFMICRO; in u132_hcd_start()
1810 retval = u132_run(u132); in u132_hcd_start()
1812 u132_disable(u132); in u132_hcd_start()
1813 u132->going = 1; in u132_hcd_start()
1816 mutex_unlock(&u132->sw_lock); in u132_hcd_start()
1819 dev_err(&u132->platform_dev->dev, "platform_device missing\n"); in u132_hcd_start()
1826 struct u132 *u132 = hcd_to_u132(hcd); in u132_hcd_reset() local
1827 if (u132->going > 1) { in u132_hcd_reset()
1828 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_hcd_reset()
1829 , u132->going); in u132_hcd_reset()
1831 } else if (u132->going > 0) { in u132_hcd_reset()
1832 dev_err(&u132->platform_dev->dev, "device is being removed\n"); in u132_hcd_reset()
1836 mutex_lock(&u132->sw_lock); in u132_hcd_reset()
1837 retval = u132_init(u132); in u132_hcd_reset()
1839 u132_disable(u132); in u132_hcd_reset()
1840 u132->going = 1; in u132_hcd_reset()
1842 mutex_unlock(&u132->sw_lock); in u132_hcd_reset()
1847 static int create_endpoint_and_queue_int(struct u132 *u132, in create_endpoint_and_queue_int() argument
1863 rc = usb_hcd_link_urb_to_ep(u132_to_hcd(u132), urb); in create_endpoint_and_queue_int()
1870 endp_number = ++u132->num_endpoints; in create_endpoint_and_queue_int()
1871 urb->ep->hcpriv = u132->endp[endp_number - 1] = endp; in create_endpoint_and_queue_int()
1874 ring = endp->ring = &u132->ring[0]; in create_endpoint_and_queue_int()
1887 endp->u132 = u132; in create_endpoint_and_queue_int()
1890 u132_endp_init_kref(u132, endp); in create_endpoint_and_queue_int()
1897 u132_udev_get_kref(u132, udev); in create_endpoint_and_queue_int()
1904 u132_udev_get_kref(u132, udev); in create_endpoint_and_queue_int()
1906 urb->hcpriv = u132; in create_endpoint_and_queue_int()
1917 u132_endp_queue_work(u132, endp, msecs_to_jiffies(urb->interval)); in create_endpoint_and_queue_int()
1921 static int queue_int_on_old_endpoint(struct u132 *u132, in queue_int_on_old_endpoint() argument
1926 urb->hcpriv = u132; in queue_int_on_old_endpoint()
1945 static int create_endpoint_and_queue_bulk(struct u132 *u132, in create_endpoint_and_queue_bulk() argument
1962 rc = usb_hcd_link_urb_to_ep(u132_to_hcd(u132), urb); in create_endpoint_and_queue_bulk()
1969 endp_number = ++u132->num_endpoints; in create_endpoint_and_queue_bulk()
1970 urb->ep->hcpriv = u132->endp[endp_number - 1] = endp; in create_endpoint_and_queue_bulk()
1978 endp->u132 = u132; in create_endpoint_and_queue_bulk()
1981 u132_endp_init_kref(u132, endp); in create_endpoint_and_queue_bulk()
1989 u132_udev_get_kref(u132, udev); in create_endpoint_and_queue_bulk()
1997 u132_udev_get_kref(u132, udev); in create_endpoint_and_queue_bulk()
1999 ring = endp->ring = &u132->ring[ring_number - 1]; in create_endpoint_and_queue_bulk()
2007 urb->hcpriv = u132; in create_endpoint_and_queue_bulk()
2016 u132_endp_queue_work(u132, endp, 0); in create_endpoint_and_queue_bulk()
2020 static int queue_bulk_on_old_endpoint(struct u132 *u132, struct u132_udev *udev, in queue_bulk_on_old_endpoint() argument
2025 urb->hcpriv = u132; in queue_bulk_on_old_endpoint()
2042 static int create_endpoint_and_queue_control(struct u132 *u132, in create_endpoint_and_queue_control() argument
2058 rc = usb_hcd_link_urb_to_ep(u132_to_hcd(u132), urb); in create_endpoint_and_queue_control()
2065 endp_number = ++u132->num_endpoints; in create_endpoint_and_queue_control()
2066 urb->ep->hcpriv = u132->endp[endp_number - 1] = endp; in create_endpoint_and_queue_control()
2069 ring = endp->ring = &u132->ring[0]; in create_endpoint_and_queue_control()
2082 endp->u132 = u132; in create_endpoint_and_queue_control()
2084 u132_endp_init_kref(u132, endp); in create_endpoint_and_queue_control()
2085 u132_endp_get_kref(u132, endp); in create_endpoint_and_queue_control()
2087 u8 address = u132->addr[usb_addr].address; in create_endpoint_and_queue_control()
2088 struct u132_udev *udev = &u132->udev[address]; in create_endpoint_and_queue_control()
2095 u132_udev_init_kref(u132, udev); in create_endpoint_and_queue_control()
2096 u132_udev_get_kref(u132, udev); in create_endpoint_and_queue_control()
2099 urb->hcpriv = u132; in create_endpoint_and_queue_control()
2105 u132_endp_queue_work(u132, endp, 0); in create_endpoint_and_queue_control()
2108 u8 address = u132->addr[usb_addr].address; in create_endpoint_and_queue_control()
2109 struct u132_udev *udev = &u132->udev[address]; in create_endpoint_and_queue_control()
2116 u132_udev_get_kref(u132, udev); in create_endpoint_and_queue_control()
2120 urb->hcpriv = u132; in create_endpoint_and_queue_control()
2126 u132_endp_queue_work(u132, endp, 0); in create_endpoint_and_queue_control()
2131 static int queue_control_on_old_endpoint(struct u132 *u132, in queue_control_on_old_endpoint() argument
2138 urb->hcpriv = u132; in queue_control_on_old_endpoint()
2157 struct u132_addr *addr = &u132->addr[usb_dev->devnum]; in queue_control_on_old_endpoint()
2161 struct u132_udev *udev = &u132->udev[++i]; in queue_control_on_old_endpoint()
2166 u132->addr[0].address = i; in queue_control_on_old_endpoint()
2170 u132_udev_init_kref(u132, udev); in queue_control_on_old_endpoint()
2173 u132_udev_get_kref(u132, udev); in queue_control_on_old_endpoint()
2179 u132_udev_get_kref(u132, udev); in queue_control_on_old_endpoint()
2184 dev_err(&u132->platform_dev->dev, "run out of d" in queue_control_on_old_endpoint()
2188 urb->hcpriv = u132; in queue_control_on_old_endpoint()
2208 u8 address = u132->addr[usb_addr].address; in queue_control_on_old_endpoint()
2209 struct u132_udev *udev = &u132->udev[address]; in queue_control_on_old_endpoint()
2210 urb->hcpriv = u132; in queue_control_on_old_endpoint()
2234 struct u132 *u132 = hcd_to_u132(hcd); in u132_urb_enqueue() local
2241 if (u132->going > 1) { in u132_urb_enqueue()
2242 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_urb_enqueue()
2243 , u132->going); in u132_urb_enqueue()
2245 } else if (u132->going > 0) { in u132_urb_enqueue()
2246 dev_err(&u132->platform_dev->dev, "device is being removed " in u132_urb_enqueue()
2254 u8 address = u132->addr[usb_addr].address; in u132_urb_enqueue()
2255 struct u132_udev *udev = &u132->udev[address]; in u132_urb_enqueue()
2266 u132, udev, urb, in u132_urb_enqueue()
2279 u132_endp_queue_work(u132, endp, in u132_urb_enqueue()
2284 } else if (u132->num_endpoints == MAX_U132_ENDPS) { in u132_urb_enqueue()
2287 return create_endpoint_and_queue_int(u132, udev, in u132_urb_enqueue()
2292 dev_err(&u132->platform_dev->dev, "the hardware does no" in u132_urb_enqueue()
2296 u8 address = u132->addr[usb_addr].address; in u132_urb_enqueue()
2297 struct u132_udev *udev = &u132->udev[address]; in u132_urb_enqueue()
2308 u132, udev, urb, in u132_urb_enqueue()
2321 u132_endp_queue_work(u132, endp, 0); in u132_urb_enqueue()
2324 } else if (u132->num_endpoints == MAX_U132_ENDPS) { in u132_urb_enqueue()
2327 return create_endpoint_and_queue_bulk(u132, in u132_urb_enqueue()
2357 u132, urb, usb_dev, in u132_urb_enqueue()
2369 u132_endp_queue_work(u132, endp, 0); in u132_urb_enqueue()
2372 } else if (u132->num_endpoints == MAX_U132_ENDPS) { in u132_urb_enqueue()
2375 return create_endpoint_and_queue_control(u132, in u132_urb_enqueue()
2382 static int dequeue_from_overflow_chain(struct u132 *u132, in dequeue_from_overflow_chain() argument
2389 struct usb_hcd *hcd = u132_to_hcd(u132); in dequeue_from_overflow_chain()
2398 dev_err(&u132->platform_dev->dev, "urb=%p not found in endp[%d]=%p ring" in dequeue_from_overflow_chain()
2407 static int u132_endp_urb_dequeue(struct u132 *u132, struct u132_endp *endp, in u132_endp_urb_dequeue() argument
2414 rc = usb_hcd_check_unlink_urb(u132_to_hcd(u132), urb, status); in u132_endp_urb_dequeue()
2420 dev_err(&u132->platform_dev->dev, "urb=%p not found in endp[%d]" in u132_endp_urb_dequeue()
2432 u132_endp_queue_work(u132, endp, 0); in u132_endp_urb_dequeue()
2437 u132_hcd_abandon_urb(u132, endp, urb, status); in u132_endp_urb_dequeue()
2461 struct usb_hcd *hcd = u132_to_hcd(u132); in u132_endp_urb_dequeue()
2482 dev_err(&u132->platform_dev->dev, "urb=%p not found in " in u132_endp_urb_dequeue()
2495 usb_hcd_unlink_urb_from_ep(u132_to_hcd(u132), urb); in u132_endp_urb_dequeue()
2496 retval = dequeue_from_overflow_chain(u132, endp, in u132_endp_urb_dequeue()
2506 struct u132 *u132 = hcd_to_u132(hcd); in u132_urb_dequeue() local
2507 if (u132->going > 2) { in u132_urb_dequeue()
2508 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_urb_dequeue()
2509 , u132->going); in u132_urb_dequeue()
2514 u8 address = u132->addr[usb_addr].address; in u132_urb_dequeue()
2515 struct u132_udev *udev = &u132->udev[address]; in u132_urb_dequeue()
2518 struct u132_endp *endp = u132->endp[endp_number - 1]; in u132_urb_dequeue()
2519 return u132_endp_urb_dequeue(u132, endp, urb, status); in u132_urb_dequeue()
2522 struct u132_endp *endp = u132->endp[endp_number - 1]; in u132_urb_dequeue()
2523 return u132_endp_urb_dequeue(u132, endp, urb, status); in u132_urb_dequeue()
2531 struct u132 *u132 = hcd_to_u132(hcd); in u132_endpoint_disable() local
2532 if (u132->going > 2) { in u132_endpoint_disable()
2533 dev_err(&u132->platform_dev->dev, "u132 device %p(hcd=%p hep=%p" in u132_endpoint_disable()
2534 ") has been removed %d\n", u132, hcd, hep, in u132_endpoint_disable()
2535 u132->going); in u132_endpoint_disable()
2539 u132_endp_put_kref(u132, endp); in u132_endpoint_disable()
2545 struct u132 *u132 = hcd_to_u132(hcd); in u132_get_frame() local
2546 if (u132->going > 1) { in u132_get_frame()
2547 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_get_frame()
2548 , u132->going); in u132_get_frame()
2550 } else if (u132->going > 0) { in u132_get_frame()
2551 dev_err(&u132->platform_dev->dev, "device is being removed\n"); in u132_get_frame()
2554 dev_err(&u132->platform_dev->dev, "TODO: u132_get_frame\n"); in u132_get_frame()
2560 static int u132_roothub_descriptor(struct u132 *u132, in u132_roothub_descriptor() argument
2567 retval = u132_read_pcimem(u132, roothub.a, &rh_a); in u132_roothub_descriptor()
2573 desc->bNbrPorts = u132->num_ports; in u132_roothub_descriptor()
2574 temp = 1 + (u132->num_ports / 8); in u132_roothub_descriptor()
2586 retval = u132_read_pcimem(u132, roothub.b, &rh_b); in u132_roothub_descriptor()
2592 if (u132->num_ports > 7) { in u132_roothub_descriptor()
2600 static int u132_roothub_status(struct u132 *u132, __le32 *desc) in u132_roothub_status() argument
2603 int ret_status = u132_read_pcimem(u132, roothub.status, &rh_status); in u132_roothub_status()
2608 static int u132_roothub_portstatus(struct u132 *u132, __le32 *desc, u16 wIndex) in u132_roothub_portstatus() argument
2610 if (wIndex == 0 || wIndex > u132->num_ports) { in u132_roothub_portstatus()
2615 int ret_portstatus = u132_read_pcimem(u132, in u132_roothub_portstatus()
2619 dev_info(&u132->platform_dev->dev, "Port %d Status Chan" in u132_roothub_portstatus()
2632 static int u132_roothub_portreset(struct u132 *u132, int port_index) in u132_roothub_portreset() argument
2638 retval = u132_read_pcimem(u132, fmnumber, &fmnumber); in u132_roothub_portreset()
2646 retval = u132_read_pcimem(u132, in u132_roothub_portreset()
2659 retval = u132_write_pcimem(u132, in u132_roothub_portreset()
2668 retval = u132_write_pcimem(u132, roothub.portstatus[port_index], in u132_roothub_portreset()
2673 retval = u132_read_pcimem(u132, fmnumber, &fmnumber); in u132_roothub_portreset()
2681 static int u132_roothub_setportfeature(struct u132 *u132, u16 wValue, in u132_roothub_setportfeature() argument
2684 if (wIndex == 0 || wIndex > u132->num_ports) { in u132_roothub_setportfeature()
2688 struct u132_port *port = &u132->port[port_index]; in u132_roothub_setportfeature()
2692 return u132_write_pcimem(u132, in u132_roothub_setportfeature()
2695 return u132_write_pcimem(u132, in u132_roothub_setportfeature()
2698 return u132_roothub_portreset(u132, port_index); in u132_roothub_setportfeature()
2705 static int u132_roothub_clearportfeature(struct u132 *u132, u16 wValue, in u132_roothub_clearportfeature() argument
2708 if (wIndex == 0 || wIndex > u132->num_ports) { in u132_roothub_clearportfeature()
2713 struct u132_port *port = &u132->port[port_index]; in u132_roothub_clearportfeature()
2724 if ((u132->hc_control & OHCI_CTRL_HCFS) in u132_roothub_clearportfeature()
2726 dev_err(&u132->platform_dev->dev, "TODO resume_" in u132_roothub_clearportfeature()
2748 return u132_write_pcimem(u132, roothub.portstatus[port_index], in u132_roothub_clearportfeature()
2757 struct u132 *u132 = hcd_to_u132(hcd); in u132_hub_status_data() local
2758 if (u132->going > 1) { in u132_hub_status_data()
2759 dev_err(&u132->platform_dev->dev, "device hcd=%p has been remov" in u132_hub_status_data()
2760 "ed %d\n", hcd, u132->going); in u132_hub_status_data()
2762 } else if (u132->going > 0) { in u132_hub_status_data()
2763 dev_err(&u132->platform_dev->dev, "device hcd=%p is being remov" in u132_hub_status_data()
2768 if (u132->flags & OHCI_QUIRK_AMD756) { in u132_hub_status_data()
2769 if ((u132->hc_roothub_a & RH_A_NDP) > MAX_ROOT_PORTS) { in u132_hub_status_data()
2770 dev_err(&u132->platform_dev->dev, "bogus NDP, r" in u132_hub_status_data()
2772 u132->hc_roothub_a & RH_A_NDP); in u132_hub_status_data()
2776 if (u132->hc_roothub_status & (RH_HS_LPSC | RH_HS_OCIC)) in u132_hub_status_data()
2780 if (u132->num_ports > 7) { in u132_hub_status_data()
2784 for (i = 0; i < u132->num_ports; i++) { in u132_hub_status_data()
2785 if (u132->hc_roothub_portstatus[i] & (RH_PS_CSC | in u132_hub_status_data()
2795 if (!(u132->hc_roothub_portstatus[i] & RH_PS_CCS)) in u132_hub_status_data()
2798 if ((u132->hc_roothub_portstatus[i] & RH_PS_PSS)) in u132_hub_status_data()
2809 struct u132 *u132 = hcd_to_u132(hcd); in u132_hub_control() local
2810 if (u132->going > 1) { in u132_hub_control()
2811 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_hub_control()
2812 , u132->going); in u132_hub_control()
2814 } else if (u132->going > 0) { in u132_hub_control()
2815 dev_err(&u132->platform_dev->dev, "device is being removed\n"); in u132_hub_control()
2819 mutex_lock(&u132->sw_lock); in u132_hub_control()
2840 retval = u132_roothub_clearportfeature(u132, in u132_hub_control()
2847 retval = u132_roothub_descriptor(u132, in u132_hub_control()
2854 retval = u132_roothub_status(u132, in u132_hub_control()
2861 retval = u132_roothub_portstatus(u132, in u132_hub_control()
2868 retval = u132_roothub_setportfeature(u132, in u132_hub_control()
2877 u132_disable(u132); in u132_hub_control()
2878 u132->going = 1; in u132_hub_control()
2884 mutex_unlock(&u132->sw_lock); in u132_hub_control()
2891 struct u132 *u132 = hcd_to_u132(hcd); in u132_start_port_reset() local
2892 if (u132->going > 1) { in u132_start_port_reset()
2893 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_start_port_reset()
2894 , u132->going); in u132_start_port_reset()
2896 } else if (u132->going > 0) { in u132_start_port_reset()
2897 dev_err(&u132->platform_dev->dev, "device is being removed\n"); in u132_start_port_reset()
2907 struct u132 *u132 = hcd_to_u132(hcd); in u132_bus_suspend() local
2908 if (u132->going > 1) { in u132_bus_suspend()
2909 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_bus_suspend()
2910 , u132->going); in u132_bus_suspend()
2912 } else if (u132->going > 0) { in u132_bus_suspend()
2913 dev_err(&u132->platform_dev->dev, "device is being removed\n"); in u132_bus_suspend()
2921 struct u132 *u132 = hcd_to_u132(hcd); in u132_bus_resume() local
2922 if (u132->going > 1) { in u132_bus_resume()
2923 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_bus_resume()
2924 , u132->going); in u132_bus_resume()
2926 } else if (u132->going > 0) { in u132_bus_resume()
2927 dev_err(&u132->platform_dev->dev, "device is being removed\n"); in u132_bus_resume()
2939 .hcd_priv_size = sizeof(struct u132),
2966 struct u132 *u132 = hcd_to_u132(hcd); in u132_remove() local
2967 if (u132->going++ > 1) { in u132_remove()
2968 dev_err(&u132->platform_dev->dev, "already being remove" in u132_remove()
2974 dev_err(&u132->platform_dev->dev, "removing device u132" in u132_remove()
2975 ".%d\n", u132->sequence_num); in u132_remove()
2977 mutex_lock(&u132->sw_lock); in u132_remove()
2978 u132_monitor_cancel_work(u132); in u132_remove()
2980 struct u132_ring *ring = &u132->ring[rings]; in u132_remove()
2981 u132_ring_cancel_work(u132, ring); in u132_remove()
2984 struct u132_endp *endp = u132->endp[endps]; in u132_remove()
2986 u132_endp_cancel_work(u132, endp); in u132_remove()
2988 u132->going += 1; in u132_remove()
2990 u132->sequence_num); in u132_remove()
2991 mutex_unlock(&u132->sw_lock); in u132_remove()
2993 u132_u132_put_kref(u132); in u132_remove()
3000 static void u132_initialise(struct u132 *u132, struct platform_device *pdev) in u132_initialise() argument
3007 u132->board = dev_get_platdata(&pdev->dev); in u132_initialise()
3008 u132->platform_dev = pdev; in u132_initialise()
3009 u132->power = 0; in u132_initialise()
3010 u132->reset = 0; in u132_initialise()
3011 mutex_init(&u132->sw_lock); in u132_initialise()
3012 mutex_init(&u132->scheduler_lock); in u132_initialise()
3014 struct u132_ring *ring = &u132->ring[rings]; in u132_initialise()
3015 ring->u132 = u132; in u132_initialise()
3022 mutex_lock(&u132->sw_lock); in u132_initialise()
3023 INIT_DELAYED_WORK(&u132->monitor, u132_hcd_monitor_work); in u132_initialise()
3025 struct u132_port *port = &u132->port[ports]; in u132_initialise()
3026 port->u132 = u132; in u132_initialise()
3033 struct u132_addr *addr = &u132->addr[addrs]; in u132_initialise()
3037 struct u132_udev *udev = &u132->udev[udevs]; in u132_initialise()
3052 u132->endp[endps] = NULL; in u132_initialise()
3054 mutex_unlock(&u132->sw_lock); in u132_initialise()
3085 struct u132 *u132 = hcd_to_u132(hcd); in u132_probe() local
3089 u132->sequence_num = ++u132_instances; in u132_probe()
3091 u132_u132_init_kref(u132); in u132_probe()
3092 u132_initialise(u132, pdev); in u132_probe()
3096 dev_err(&u132->platform_dev->dev, "init error %d\n", in u132_probe()
3098 u132_u132_put_kref(u132); in u132_probe()
3102 u132_monitor_queue_work(u132, 100); in u132_probe()
3117 struct u132 *u132 = hcd_to_u132(hcd); in u132_suspend() local
3118 if (u132->going > 1) { in u132_suspend()
3119 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_suspend()
3120 , u132->going); in u132_suspend()
3122 } else if (u132->going > 0) { in u132_suspend()
3123 dev_err(&u132->platform_dev->dev, "device is being removed\n"); in u132_suspend()
3136 port_power(u132, ports, 0); in u132_suspend()
3147 struct u132 *u132 = hcd_to_u132(hcd); in u132_resume() local
3148 if (u132->going > 1) { in u132_resume()
3149 dev_err(&u132->platform_dev->dev, "device has been removed %d\n" in u132_resume()
3150 , u132->going); in u132_resume()
3152 } else if (u132->going > 0) { in u132_resume()
3153 dev_err(&u132->platform_dev->dev, "device is being removed\n"); in u132_resume()
3157 if (!u132->port[0].power) { in u132_resume()
3160 port_power(u132, ports, 1); in u132_resume()