Lines Matching refs:sl811

78 static void port_power(struct sl811 *sl811, int is_on)  in port_power()  argument
80 struct usb_hcd *hcd = sl811_to_hcd(sl811); in port_power()
84 if (sl811->port1 & USB_PORT_STAT_POWER) in port_power()
87 sl811->port1 = USB_PORT_STAT_POWER; in port_power()
88 sl811->irq_enable = SL11H_INTMASK_INSRMV; in port_power()
90 sl811->port1 = 0; in port_power()
91 sl811->irq_enable = 0; in port_power()
94 sl811->ctrl1 = 0; in port_power()
95 sl811_write(sl811, SL11H_IRQ_ENABLE, 0); in port_power()
96 sl811_write(sl811, SL11H_IRQ_STATUS, ~0); in port_power()
98 if (sl811->board && sl811->board->port_power) { in port_power()
102 sl811->board->port_power(hcd->self.controller, is_on); in port_power()
106 if (sl811->board && sl811->board->reset) in port_power()
107 sl811->board->reset(hcd->self.controller); in port_power()
109 sl811_write(sl811, SL11H_CTLREG1, SL11H_CTL1MASK_SE0); in port_power()
113 sl811_write(sl811, SL11H_IRQ_ENABLE, 0); in port_power()
114 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); in port_power()
115 sl811_write(sl811, SL811HS_CTLREG2, SL811HS_CTL2_INIT); in port_power()
116 sl811_write(sl811, SL11H_IRQ_ENABLE, sl811->irq_enable); in port_power()
135 struct sl811 *sl811, in setup_packet() argument
148 data_reg = sl811->data_reg; in setup_packet()
149 sl811_write_buf(sl811, addr, urb->setup_packet, len); in setup_packet()
152 sl811_write(sl811, bank + SL11H_BUFADDRREG, addr); in setup_packet()
158 sl811_write(sl811, bank + SL11H_HOSTCTLREG, in setup_packet()
166 struct sl811 *sl811, in status_packet() argument
177 data_reg = sl811->data_reg; in status_packet()
180 sl811_write(sl811, bank + SL11H_BUFADDRREG, 0); in status_packet()
189 sl811_write(sl811, bank + SL11H_HOSTCTLREG, control); in status_packet()
200 struct sl811 *sl811, in in_packet() argument
217 data_reg = sl811->data_reg; in in_packet()
220 sl811_write(sl811, bank + SL11H_BUFADDRREG, addr); in in_packet()
225 sl811_write(sl811, bank + SL11H_HOSTCTLREG, control); in in_packet()
236 struct sl811 *sl811, in out_packet() argument
258 data_reg = sl811->data_reg; in out_packet()
260 sl811_write_buf(sl811, addr, buf, len); in out_packet()
263 sl811_write(sl811, bank + SL11H_BUFADDRREG, addr); in out_packet()
268 sl811_write(sl811, bank + SL11H_HOSTCTLREG, in out_packet()
279 static inline void sofirq_on(struct sl811 *sl811) in sofirq_on() argument
281 if (sl811->irq_enable & SL11H_INTMASK_SOFINTR) in sofirq_on()
283 dev_dbg(sl811_to_hcd(sl811)->self.controller, "sof irq on\n"); in sofirq_on()
284 sl811->irq_enable |= SL11H_INTMASK_SOFINTR; in sofirq_on()
287 static inline void sofirq_off(struct sl811 *sl811) in sofirq_off() argument
289 if (!(sl811->irq_enable & SL11H_INTMASK_SOFINTR)) in sofirq_off()
291 dev_dbg(sl811_to_hcd(sl811)->self.controller, "sof irq off\n"); in sofirq_off()
292 sl811->irq_enable &= ~SL11H_INTMASK_SOFINTR; in sofirq_off()
302 static struct sl811h_ep *start(struct sl811 *sl811, u8 bank) in start() argument
310 if (sl811->next_periodic) { in start()
311 ep = sl811->next_periodic; in start()
312 sl811->next_periodic = ep->next; in start()
314 if (sl811->next_async) in start()
315 ep = sl811->next_async; in start()
316 else if (!list_empty(&sl811->async)) in start()
317 ep = container_of(sl811->async.next, in start()
327 if ((bank && sl811->active_b == ep) || sl811->active_a == ep) in start()
331 if (ep->schedule.next == &sl811->async) in start()
332 sl811->next_async = NULL; in start()
334 sl811->next_async = container_of(ep->schedule.next, in start()
339 dev_dbg(sl811_to_hcd(sl811)->self.controller, in start()
350 fclock = sl811_read(sl811, SL11H_SOFTMRREG) << 6; in start()
362 sl811->stat_overrun++; in start()
363 sofirq_on(sl811); in start()
370 sl811->stat_overrun++; in start()
381 in_packet(sl811, ep, urb, bank, control); in start()
384 out_packet(sl811, ep, urb, bank, control); in start()
387 setup_packet(sl811, ep, urb, bank, control); in start()
390 status_packet(sl811, ep, urb, bank, control); in start()
393 dev_dbg(sl811_to_hcd(sl811)->self.controller, in start()
402 static inline void start_transfer(struct sl811 *sl811) in start_transfer() argument
404 if (sl811->port1 & USB_PORT_STAT_SUSPEND) in start_transfer()
406 if (sl811->active_a == NULL) { in start_transfer()
407 sl811->active_a = start(sl811, SL811_EP_A(SL811_HOST_BUF)); in start_transfer()
408 if (sl811->active_a != NULL) in start_transfer()
409 sl811->jiffies_a = jiffies + MIN_JIFFIES; in start_transfer()
412 if (sl811->active_b == NULL) { in start_transfer()
413 sl811->active_b = start(sl811, SL811_EP_B(SL811_HOST_BUF)); in start_transfer()
414 if (sl811->active_b != NULL) in start_transfer()
415 sl811->jiffies_b = jiffies + MIN_JIFFIES; in start_transfer()
421 struct sl811 *sl811, in finish_request() argument
425 ) __releases(sl811->lock) __acquires(sl811->lock) in finish_request()
432 usb_hcd_unlink_urb_from_ep(sl811_to_hcd(sl811), urb); in finish_request()
433 spin_unlock(&sl811->lock); in finish_request()
434 usb_hcd_giveback_urb(sl811_to_hcd(sl811), urb, status); in finish_request()
435 spin_lock(&sl811->lock); in finish_request()
444 if (ep == sl811->next_async) in finish_request()
445 sl811->next_async = NULL; in finish_request()
450 dev_dbg(sl811_to_hcd(sl811)->self.controller, in finish_request()
454 struct sl811h_ep **prev = &sl811->periodic[i]; in finish_request()
460 sl811->load[i] -= ep->load; in finish_request()
463 sl811->periodic_count--; in finish_request()
464 sl811_to_hcd(sl811)->self.bandwidth_allocated in finish_request()
466 if (ep == sl811->next_periodic) in finish_request()
467 sl811->next_periodic = ep->next; in finish_request()
470 if (sl811->periodic_count == 0) in finish_request()
471 sofirq_off(sl811); in finish_request()
475 done(struct sl811 *sl811, struct sl811h_ep *ep, u8 bank) in done() argument
484 status = sl811_read(sl811, bank + SL11H_PKTSTATREG); in done()
527 len = ep->maxpacket - sl811_read(sl811, in done()
534 sl811_read_buf(sl811, SL811HS_PACKET_BUF(bank == 0), in done()
585 finish_request(sl811, ep, urb, urbstat); in done()
589 static inline u8 checkdone(struct sl811 *sl811) in checkdone() argument
594 if (sl811->active_a && time_before_eq(sl811->jiffies_a, jiffies)) { in checkdone()
595 ctl = sl811_read(sl811, SL811_EP_A(SL11H_HOSTCTLREG)); in checkdone()
597 sl811_write(sl811, SL811_EP_A(SL11H_HOSTCTLREG), 0); in checkdone()
598 dev_dbg(sl811_to_hcd(sl811)->self.controller, in checkdone()
602 sl811_read(sl811, SL811_EP_A(SL11H_PKTSTATREG))); in checkdone()
606 if (sl811->active_b && time_before_eq(sl811->jiffies_b, jiffies)) { in checkdone()
607 ctl = sl811_read(sl811, SL811_EP_B(SL11H_HOSTCTLREG)); in checkdone()
609 sl811_write(sl811, SL811_EP_B(SL11H_HOSTCTLREG), 0); in checkdone()
610 dev_dbg(sl811_to_hcd(sl811)->self.controller, in checkdone()
614 sl811_read(sl811, SL811_EP_B(SL11H_PKTSTATREG))); in checkdone()
624 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_irq() local
629 spin_lock(&sl811->lock); in sl811h_irq()
632 irqstat = sl811_read(sl811, SL11H_IRQ_STATUS) & ~SL11H_INTMASK_DP; in sl811h_irq()
634 sl811_write(sl811, SL11H_IRQ_STATUS, irqstat); in sl811h_irq()
635 irqstat &= sl811->irq_enable; in sl811h_irq()
641 irqstat = checkdone(sl811); in sl811h_irq()
643 sl811->stat_lost++; in sl811h_irq()
651 done(sl811, sl811->active_a, SL811_EP_A(SL811_HOST_BUF)); in sl811h_irq()
652 sl811->active_a = NULL; in sl811h_irq()
653 sl811->stat_a++; in sl811h_irq()
657 done(sl811, sl811->active_b, SL811_EP_B(SL811_HOST_BUF)); in sl811h_irq()
658 sl811->active_b = NULL; in sl811h_irq()
659 sl811->stat_b++; in sl811h_irq()
665 index = sl811->frame++ % (PERIODIC_SIZE - 1); in sl811h_irq()
666 sl811->stat_sof++; in sl811h_irq()
672 if (sl811->next_periodic) { in sl811h_irq()
674 sl811->stat_overrun++; in sl811h_irq()
676 if (sl811->periodic[index]) in sl811h_irq()
677 sl811->next_periodic = sl811->periodic[index]; in sl811h_irq()
682 sl811->stat_insrmv++; in sl811h_irq()
685 sl811->stat_wake = 0; in sl811h_irq()
686 sl811->stat_sof = 0; in sl811h_irq()
687 sl811->stat_a = 0; in sl811h_irq()
688 sl811->stat_b = 0; in sl811h_irq()
689 sl811->stat_lost = 0; in sl811h_irq()
691 sl811->ctrl1 = 0; in sl811h_irq()
692 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); in sl811h_irq()
694 sl811->irq_enable = SL11H_INTMASK_INSRMV; in sl811h_irq()
695 sl811_write(sl811, SL11H_IRQ_ENABLE, sl811->irq_enable); in sl811h_irq()
698 if (sl811->active_a) { in sl811h_irq()
699 sl811_write(sl811, SL811_EP_A(SL11H_HOSTCTLREG), 0); in sl811h_irq()
700 finish_request(sl811, sl811->active_a, in sl811h_irq()
701 container_of(sl811->active_a in sl811h_irq()
705 sl811->active_a = NULL; in sl811h_irq()
708 if (sl811->active_b) { in sl811h_irq()
709 sl811_write(sl811, SL811_EP_B(SL11H_HOSTCTLREG), 0); in sl811h_irq()
710 finish_request(sl811, sl811->active_b, in sl811h_irq()
711 container_of(sl811->active_b in sl811h_irq()
715 sl811->active_b = NULL; in sl811h_irq()
723 sl811->port1 &= ~USB_PORT_STAT_CONNECTION; in sl811h_irq()
725 sl811->port1 |= USB_PORT_STAT_CONNECTION; in sl811h_irq()
727 sl811->port1 |= USB_PORT_STAT_C_CONNECTION << 16; in sl811h_irq()
730 if (sl811->port1 & USB_PORT_STAT_SUSPEND) { in sl811h_irq()
732 sl811->port1 |= USB_PORT_STAT_C_SUSPEND << 16; in sl811h_irq()
733 sl811->stat_wake++; in sl811h_irq()
739 if (sl811->port1 & USB_PORT_STAT_ENABLE) in sl811h_irq()
740 start_transfer(sl811); in sl811h_irq()
746 if (sl811->periodic_count == 0 && list_empty(&sl811->async)) in sl811h_irq()
747 sofirq_off(sl811); in sl811h_irq()
748 sl811_write(sl811, SL11H_IRQ_ENABLE, sl811->irq_enable); in sl811h_irq()
750 spin_unlock(&sl811->lock); in sl811h_irq()
766 static int balance(struct sl811 *sl811, u16 period, u16 load) in balance() argument
774 if (branch < 0 || sl811->load[branch] > sl811->load[i]) { in balance()
778 if ((sl811->load[j] + load) in balance()
797 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_urb_enqueue() local
821 spin_lock_irqsave(&sl811->lock, flags); in sl811h_urb_enqueue()
824 if (!(sl811->port1 & USB_PORT_STAT_ENABLE) in sl811h_urb_enqueue()
870 if (!(sl811->ctrl1 & SL11H_CTL1MASK_LSPD)) in sl811h_urb_enqueue()
898 list_add_tail(&ep->schedule, &sl811->async); in sl811h_urb_enqueue()
909 urb->start_frame = (sl811->frame & (PERIODIC_SIZE - 1)) in sl811h_urb_enqueue()
914 retval = balance(sl811, ep->period, ep->load); in sl811h_urb_enqueue()
919 urb->start_frame = (sl811->frame & (PERIODIC_SIZE - 1)) in sl811h_urb_enqueue()
929 struct sl811h_ep **prev = &sl811->periodic[i]; in sl811h_urb_enqueue()
942 sl811->load[i] += ep->load; in sl811h_urb_enqueue()
944 sl811->periodic_count++; in sl811h_urb_enqueue()
946 sofirq_on(sl811); in sl811h_urb_enqueue()
950 start_transfer(sl811); in sl811h_urb_enqueue()
951 sl811_write(sl811, SL11H_IRQ_ENABLE, sl811->irq_enable); in sl811h_urb_enqueue()
956 spin_unlock_irqrestore(&sl811->lock, flags); in sl811h_urb_enqueue()
962 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_urb_dequeue() local
968 spin_lock_irqsave(&sl811->lock, flags); in sl811h_urb_dequeue()
983 } else if (sl811->active_a == ep) { in sl811h_urb_dequeue()
984 if (time_before_eq(sl811->jiffies_a, jiffies)) { in sl811h_urb_dequeue()
988 sl811_read(sl811, in sl811h_urb_dequeue()
990 sl811_read(sl811, in sl811h_urb_dequeue()
992 sl811_write(sl811, SL811_EP_A(SL11H_HOSTCTLREG), in sl811h_urb_dequeue()
994 sl811->active_a = NULL; in sl811h_urb_dequeue()
998 } else if (sl811->active_b == ep) { in sl811h_urb_dequeue()
999 if (time_before_eq(sl811->jiffies_a, jiffies)) { in sl811h_urb_dequeue()
1003 sl811_read(sl811, in sl811h_urb_dequeue()
1005 sl811_read(sl811, in sl811h_urb_dequeue()
1007 sl811_write(sl811, SL811_EP_B(SL11H_HOSTCTLREG), in sl811h_urb_dequeue()
1009 sl811->active_b = NULL; in sl811h_urb_dequeue()
1018 finish_request(sl811, ep, urb, 0); in sl811h_urb_dequeue()
1020 dev_dbg(sl811_to_hcd(sl811)->self.controller, in sl811h_urb_dequeue()
1022 (sl811->active_a == ep) ? "A" : "B"); in sl811h_urb_dequeue()
1026 spin_unlock_irqrestore(&sl811->lock, flags); in sl811h_urb_dequeue()
1051 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_get_frame() local
1057 return sl811->frame; in sl811h_get_frame()
1067 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_hub_status_data() local
1075 if (!timer_pending(&sl811->timer)) { in sl811h_hub_status_data()
1077 sl811->stat_lost++; in sl811h_hub_status_data()
1082 if (!(sl811->port1 & (0xffff << 16))) in sl811h_hub_status_data()
1092 struct sl811 *sl811, in sl811h_hub_descriptor() argument
1105 if (sl811->board && sl811->board->port_power) { in sl811h_hub_descriptor()
1106 desc->bPwrOn2PwrGood = sl811->board->potpg; in sl811h_hub_descriptor()
1126 struct sl811 *sl811 = from_timer(sl811, t, timer); in sl811h_timer() local
1129 u8 signaling = sl811->ctrl1 & SL11H_CTL1MASK_FORCE; in sl811h_timer()
1134 spin_lock_irqsave(&sl811->lock, flags); in sl811h_timer()
1137 sl811->ctrl1 &= ~SL11H_CTL1MASK_FORCE; in sl811h_timer()
1138 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); in sl811h_timer()
1141 irqstat = sl811_read(sl811, SL11H_IRQ_STATUS); in sl811h_timer()
1145 dev_dbg(sl811_to_hcd(sl811)->self.controller, "end reset\n"); in sl811h_timer()
1146 sl811->port1 = (USB_PORT_STAT_C_RESET << 16) in sl811h_timer()
1148 sl811->ctrl1 = 0; in sl811h_timer()
1154 dev_dbg(sl811_to_hcd(sl811)->self.controller, "end resume\n"); in sl811h_timer()
1155 sl811->port1 &= ~USB_PORT_STAT_SUSPEND; in sl811h_timer()
1158 dev_dbg(sl811_to_hcd(sl811)->self.controller, in sl811h_timer()
1162 sl811_write(sl811, SL11H_IRQ_STATUS, irqstat); in sl811h_timer()
1166 if (sl811->port1 & USB_PORT_STAT_CONNECTION) in sl811h_timer()
1167 sl811->port1 |= (USB_PORT_STAT_C_CONNECTION << 16) in sl811h_timer()
1169 sl811->port1 &= ~mask; in sl811h_timer()
1170 sl811->irq_enable = SL11H_INTMASK_INSRMV; in sl811h_timer()
1172 sl811->port1 |= mask; in sl811h_timer()
1174 sl811->port1 &= ~USB_PORT_STAT_LOW_SPEED; in sl811h_timer()
1175 sl811->irq_enable = SL11H_INTMASK_INSRMV | SL11H_INTMASK_RD; in sl811h_timer()
1178 if (sl811->port1 & USB_PORT_STAT_CONNECTION) { in sl811h_timer()
1181 sl811->irq_enable |= SL11H_INTMASK_DONE_A; in sl811h_timer()
1183 sl811->irq_enable |= SL11H_INTMASK_DONE_B; in sl811h_timer()
1185 if (sl811->port1 & USB_PORT_STAT_LOW_SPEED) { in sl811h_timer()
1186 sl811->ctrl1 |= SL11H_CTL1MASK_LSPD; in sl811h_timer()
1191 sl811->ctrl1 |= SL11H_CTL1MASK_SOF_ENA; in sl811h_timer()
1192 sl811_write(sl811, SL11H_SOFLOWREG, 0xe0); in sl811h_timer()
1193 sl811_write(sl811, SL811HS_CTLREG2, ctrl2); in sl811h_timer()
1196 sl811_write(sl811, SL811_EP_A(SL11H_BUFLNTHREG), 0); in sl811h_timer()
1197 writeb(SL_SOF, sl811->data_reg); in sl811h_timer()
1198 writeb(0, sl811->data_reg); in sl811h_timer()
1199 sl811_write(sl811, SL811_EP_A(SL11H_HOSTCTLREG), in sl811h_timer()
1204 sl811->ctrl1 = 0; in sl811h_timer()
1206 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); in sl811h_timer()
1209 sl811_write(sl811, SL11H_IRQ_ENABLE, sl811->irq_enable); in sl811h_timer()
1210 spin_unlock_irqrestore(&sl811->lock, flags); in sl811h_timer()
1222 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_hub_control() local
1226 spin_lock_irqsave(&sl811->lock, flags); in sl811h_hub_control()
1245 sl811->port1 &= USB_PORT_STAT_POWER; in sl811h_hub_control()
1246 sl811->ctrl1 = 0; in sl811h_hub_control()
1247 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); in sl811h_hub_control()
1248 sl811->irq_enable = SL11H_INTMASK_INSRMV; in sl811h_hub_control()
1249 sl811_write(sl811, SL11H_IRQ_ENABLE, in sl811h_hub_control()
1250 sl811->irq_enable); in sl811h_hub_control()
1253 if (!(sl811->port1 & USB_PORT_STAT_SUSPEND)) in sl811h_hub_control()
1258 sl811->irq_enable = 0; in sl811h_hub_control()
1259 sl811_write(sl811, SL11H_IRQ_ENABLE, in sl811h_hub_control()
1260 sl811->irq_enable); in sl811h_hub_control()
1261 sl811->ctrl1 |= SL11H_CTL1MASK_K; in sl811h_hub_control()
1262 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); in sl811h_hub_control()
1264 mod_timer(&sl811->timer, jiffies in sl811h_hub_control()
1268 port_power(sl811, 0); in sl811h_hub_control()
1279 sl811->port1 &= ~(1 << wValue); in sl811h_hub_control()
1282 sl811h_hub_descriptor(sl811, (struct usb_hub_descriptor *) buf); in sl811h_hub_control()
1290 put_unaligned_le32(sl811->port1, buf); in sl811h_hub_control()
1295 sl811->port1); in sl811h_hub_control()
1302 if (sl811->port1 & USB_PORT_STAT_RESET) in sl811h_hub_control()
1304 if (!(sl811->port1 & USB_PORT_STAT_ENABLE)) in sl811h_hub_control()
1308 sl811->ctrl1 &= ~SL11H_CTL1MASK_SOF_ENA; in sl811h_hub_control()
1309 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); in sl811h_hub_control()
1312 port_power(sl811, 1); in sl811h_hub_control()
1315 if (sl811->port1 & USB_PORT_STAT_SUSPEND) in sl811h_hub_control()
1317 if (!(sl811->port1 & USB_PORT_STAT_POWER)) in sl811h_hub_control()
1321 sl811->irq_enable = 0; in sl811h_hub_control()
1322 sl811_write(sl811, SL11H_IRQ_ENABLE, in sl811h_hub_control()
1323 sl811->irq_enable); in sl811h_hub_control()
1324 sl811->ctrl1 = SL11H_CTL1MASK_SE0; in sl811h_hub_control()
1325 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); in sl811h_hub_control()
1326 sl811->port1 |= USB_PORT_STAT_RESET; in sl811h_hub_control()
1327 mod_timer(&sl811->timer, jiffies in sl811h_hub_control()
1333 sl811->port1 |= 1 << wValue; in sl811h_hub_control()
1342 spin_unlock_irqrestore(&sl811->lock, flags); in sl811h_hub_control()
1387 struct sl811 *sl811 = s->private; in sl811h_debug_show() local
1392 sl811_to_hcd(sl811)->product_desc, in sl811h_debug_show()
1394 sl811->port1); in sl811h_debug_show()
1396 seq_printf(s, "insert/remove: %ld\n", sl811->stat_insrmv); in sl811h_debug_show()
1399 sl811->stat_a, sl811->stat_b, in sl811h_debug_show()
1400 sl811->stat_wake, sl811->stat_sof, in sl811h_debug_show()
1401 sl811->stat_overrun, sl811->stat_lost); in sl811h_debug_show()
1403 spin_lock_irq(&sl811->lock); in sl811h_debug_show()
1405 if (sl811->ctrl1 & SL11H_CTL1MASK_SUSPEND) in sl811h_debug_show()
1408 u8 t = sl811_read(sl811, SL11H_CTLREG1); in sl811h_debug_show()
1422 sl811_read(sl811, SL11H_IRQ_ENABLE)); in sl811h_debug_show()
1424 sl811_read(sl811, SL11H_IRQ_STATUS)); in sl811h_debug_show()
1426 sl811_read(sl811, SL11H_SOFTMRREG) << 6); in sl811h_debug_show()
1429 seq_printf(s, "A: qh%p ctl %02x sts %02x\n", sl811->active_a, in sl811h_debug_show()
1430 sl811_read(sl811, SL811_EP_A(SL11H_HOSTCTLREG)), in sl811h_debug_show()
1431 sl811_read(sl811, SL811_EP_A(SL11H_PKTSTATREG))); in sl811h_debug_show()
1432 seq_printf(s, "B: qh%p ctl %02x sts %02x\n", sl811->active_b, in sl811h_debug_show()
1433 sl811_read(sl811, SL811_EP_B(SL11H_HOSTCTLREG)), in sl811h_debug_show()
1434 sl811_read(sl811, SL811_EP_B(SL11H_PKTSTATREG))); in sl811h_debug_show()
1436 list_for_each_entry (ep, &sl811->async, schedule) { in sl811h_debug_show()
1441 (ep == sl811->active_a) ? "(A) " : "", in sl811h_debug_show()
1442 (ep == sl811->active_b) ? "(B) " : "", in sl811h_debug_show()
1459 if (!list_empty(&sl811->async)) in sl811h_debug_show()
1465 ep = sl811->periodic[i]; in sl811h_debug_show()
1468 seq_printf(s, "%2d [%3d]:\n", i, sl811->load[i]); in sl811h_debug_show()
1475 (ep == sl811->active_a) ? "(A) " : "", in sl811h_debug_show()
1476 (ep == sl811->active_b) ? "(B) " : "", in sl811h_debug_show()
1490 spin_unlock_irq(&sl811->lock); in sl811h_debug_show()
1498 static void create_debug_file(struct sl811 *sl811) in create_debug_file() argument
1500 debugfs_create_file("sl811h", S_IRUGO, usb_debug_root, sl811, in create_debug_file()
1504 static void remove_debug_file(struct sl811 *sl811) in remove_debug_file() argument
1514 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_stop() local
1519 spin_lock_irqsave(&sl811->lock, flags); in sl811h_stop()
1520 port_power(sl811, 0); in sl811h_stop()
1521 spin_unlock_irqrestore(&sl811->lock, flags); in sl811h_stop()
1527 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_start() local
1532 if (sl811->board) { in sl811h_start()
1535 sl811->board->can_wakeup); in sl811h_start()
1536 hcd->power_budget = sl811->board->power * 2; in sl811h_start()
1540 port_power(sl811, 1); in sl811h_start()
1549 .hcd_priv_size = sizeof(struct sl811),
1588 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_remove() local
1591 remove_debug_file(sl811); in sl811h_remove()
1597 iounmap(sl811->data_reg); in sl811h_remove()
1601 iounmap(sl811->addr_reg); in sl811h_remove()
1610 struct sl811 *sl811; in sl811h_probe() local
1670 sl811 = hcd_to_sl811(hcd); in sl811h_probe()
1672 spin_lock_init(&sl811->lock); in sl811h_probe()
1673 INIT_LIST_HEAD(&sl811->async); in sl811h_probe()
1674 sl811->board = dev_get_platdata(&dev->dev); in sl811h_probe()
1675 timer_setup(&sl811->timer, sl811h_timer, 0); in sl811h_probe()
1676 sl811->addr_reg = addr_reg; in sl811h_probe()
1677 sl811->data_reg = data_reg; in sl811h_probe()
1679 spin_lock_irq(&sl811->lock); in sl811h_probe()
1680 port_power(sl811, 0); in sl811h_probe()
1681 spin_unlock_irq(&sl811->lock); in sl811h_probe()
1684 tmp = sl811_read(sl811, SL11H_HWREVREG); in sl811h_probe()
1715 create_debug_file(sl811); in sl811h_probe()
1741 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_suspend() local
1751 port_power(sl811, 0); in sl811h_suspend()
1761 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_resume() local
1766 if (!sl811->port1 || !device_can_wakeup(&hcd->self.root_hub->dev)) { in sl811h_resume()
1767 sl811->port1 = 0; in sl811h_resume()
1768 port_power(sl811, 1); in sl811h_resume()