Lines Matching refs:sl811
77 static void port_power(struct sl811 *sl811, int is_on) in port_power() argument
79 struct usb_hcd *hcd = sl811_to_hcd(sl811); in port_power()
83 if (sl811->port1 & USB_PORT_STAT_POWER) in port_power()
86 sl811->port1 = USB_PORT_STAT_POWER; in port_power()
87 sl811->irq_enable = SL11H_INTMASK_INSRMV; in port_power()
89 sl811->port1 = 0; in port_power()
90 sl811->irq_enable = 0; in port_power()
93 sl811->ctrl1 = 0; in port_power()
94 sl811_write(sl811, SL11H_IRQ_ENABLE, 0); in port_power()
95 sl811_write(sl811, SL11H_IRQ_STATUS, ~0); in port_power()
97 if (sl811->board && sl811->board->port_power) { in port_power()
101 sl811->board->port_power(hcd->self.controller, is_on); in port_power()
105 if (sl811->board && sl811->board->reset) in port_power()
106 sl811->board->reset(hcd->self.controller); in port_power()
108 sl811_write(sl811, SL11H_CTLREG1, SL11H_CTL1MASK_SE0); in port_power()
112 sl811_write(sl811, SL11H_IRQ_ENABLE, 0); in port_power()
113 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); in port_power()
114 sl811_write(sl811, SL811HS_CTLREG2, SL811HS_CTL2_INIT); in port_power()
115 sl811_write(sl811, SL11H_IRQ_ENABLE, sl811->irq_enable); in port_power()
134 struct sl811 *sl811, in setup_packet() argument
147 data_reg = sl811->data_reg; in setup_packet()
148 sl811_write_buf(sl811, addr, urb->setup_packet, len); in setup_packet()
151 sl811_write(sl811, bank + SL11H_BUFADDRREG, addr); in setup_packet()
157 sl811_write(sl811, bank + SL11H_HOSTCTLREG, in setup_packet()
165 struct sl811 *sl811, in status_packet() argument
176 data_reg = sl811->data_reg; in status_packet()
179 sl811_write(sl811, bank + SL11H_BUFADDRREG, 0); in status_packet()
188 sl811_write(sl811, bank + SL11H_HOSTCTLREG, control); in status_packet()
199 struct sl811 *sl811, in in_packet() argument
216 data_reg = sl811->data_reg; in in_packet()
219 sl811_write(sl811, bank + SL11H_BUFADDRREG, addr); in in_packet()
224 sl811_write(sl811, bank + SL11H_HOSTCTLREG, control); in in_packet()
235 struct sl811 *sl811, in out_packet() argument
257 data_reg = sl811->data_reg; in out_packet()
259 sl811_write_buf(sl811, addr, buf, len); in out_packet()
262 sl811_write(sl811, bank + SL11H_BUFADDRREG, addr); in out_packet()
267 sl811_write(sl811, bank + SL11H_HOSTCTLREG, in out_packet()
278 static inline void sofirq_on(struct sl811 *sl811) in sofirq_on() argument
280 if (sl811->irq_enable & SL11H_INTMASK_SOFINTR) in sofirq_on()
282 dev_dbg(sl811_to_hcd(sl811)->self.controller, "sof irq on\n"); in sofirq_on()
283 sl811->irq_enable |= SL11H_INTMASK_SOFINTR; in sofirq_on()
286 static inline void sofirq_off(struct sl811 *sl811) in sofirq_off() argument
288 if (!(sl811->irq_enable & SL11H_INTMASK_SOFINTR)) in sofirq_off()
290 dev_dbg(sl811_to_hcd(sl811)->self.controller, "sof irq off\n"); in sofirq_off()
291 sl811->irq_enable &= ~SL11H_INTMASK_SOFINTR; in sofirq_off()
301 static struct sl811h_ep *start(struct sl811 *sl811, u8 bank) in start() argument
309 if (sl811->next_periodic) { in start()
310 ep = sl811->next_periodic; in start()
311 sl811->next_periodic = ep->next; in start()
313 if (sl811->next_async) in start()
314 ep = sl811->next_async; in start()
315 else if (!list_empty(&sl811->async)) in start()
316 ep = container_of(sl811->async.next, in start()
326 if ((bank && sl811->active_b == ep) || sl811->active_a == ep) in start()
330 if (ep->schedule.next == &sl811->async) in start()
331 sl811->next_async = NULL; in start()
333 sl811->next_async = container_of(ep->schedule.next, in start()
338 dev_dbg(sl811_to_hcd(sl811)->self.controller, in start()
349 fclock = sl811_read(sl811, SL11H_SOFTMRREG) << 6; in start()
361 sl811->stat_overrun++; in start()
362 sofirq_on(sl811); in start()
369 sl811->stat_overrun++; in start()
380 in_packet(sl811, ep, urb, bank, control); in start()
383 out_packet(sl811, ep, urb, bank, control); in start()
386 setup_packet(sl811, ep, urb, bank, control); in start()
389 status_packet(sl811, ep, urb, bank, control); in start()
392 dev_dbg(sl811_to_hcd(sl811)->self.controller, in start()
401 static inline void start_transfer(struct sl811 *sl811) in start_transfer() argument
403 if (sl811->port1 & USB_PORT_STAT_SUSPEND) in start_transfer()
405 if (sl811->active_a == NULL) { in start_transfer()
406 sl811->active_a = start(sl811, SL811_EP_A(SL811_HOST_BUF)); in start_transfer()
407 if (sl811->active_a != NULL) in start_transfer()
408 sl811->jiffies_a = jiffies + MIN_JIFFIES; in start_transfer()
411 if (sl811->active_b == NULL) { in start_transfer()
412 sl811->active_b = start(sl811, SL811_EP_B(SL811_HOST_BUF)); in start_transfer()
413 if (sl811->active_b != NULL) in start_transfer()
414 sl811->jiffies_b = jiffies + MIN_JIFFIES; in start_transfer()
420 struct sl811 *sl811, in finish_request() argument
424 ) __releases(sl811->lock) __acquires(sl811->lock) in finish_request()
431 usb_hcd_unlink_urb_from_ep(sl811_to_hcd(sl811), urb); in finish_request()
432 spin_unlock(&sl811->lock); in finish_request()
433 usb_hcd_giveback_urb(sl811_to_hcd(sl811), urb, status); in finish_request()
434 spin_lock(&sl811->lock); in finish_request()
443 if (ep == sl811->next_async) in finish_request()
444 sl811->next_async = NULL; in finish_request()
449 dev_dbg(sl811_to_hcd(sl811)->self.controller, in finish_request()
453 struct sl811h_ep **prev = &sl811->periodic[i]; in finish_request()
459 sl811->load[i] -= ep->load; in finish_request()
462 sl811->periodic_count--; in finish_request()
463 sl811_to_hcd(sl811)->self.bandwidth_allocated in finish_request()
465 if (ep == sl811->next_periodic) in finish_request()
466 sl811->next_periodic = ep->next; in finish_request()
469 if (sl811->periodic_count == 0) in finish_request()
470 sofirq_off(sl811); in finish_request()
474 done(struct sl811 *sl811, struct sl811h_ep *ep, u8 bank) in done() argument
483 status = sl811_read(sl811, bank + SL11H_PKTSTATREG); in done()
526 len = ep->maxpacket - sl811_read(sl811, in done()
533 sl811_read_buf(sl811, SL811HS_PACKET_BUF(bank == 0), in done()
584 finish_request(sl811, ep, urb, urbstat); in done()
587 static inline u8 checkdone(struct sl811 *sl811) in checkdone() argument
592 if (sl811->active_a && time_before_eq(sl811->jiffies_a, jiffies)) { in checkdone()
593 ctl = sl811_read(sl811, SL811_EP_A(SL11H_HOSTCTLREG)); in checkdone()
595 sl811_write(sl811, SL811_EP_A(SL11H_HOSTCTLREG), 0); in checkdone()
596 dev_dbg(sl811_to_hcd(sl811)->self.controller, in checkdone()
600 sl811_read(sl811, SL811_EP_A(SL11H_PKTSTATREG))); in checkdone()
604 if (sl811->active_b && time_before_eq(sl811->jiffies_b, jiffies)) { in checkdone()
605 ctl = sl811_read(sl811, SL811_EP_B(SL11H_HOSTCTLREG)); in checkdone()
607 sl811_write(sl811, SL811_EP_B(SL11H_HOSTCTLREG), 0); in checkdone()
608 dev_dbg(sl811_to_hcd(sl811)->self.controller, in checkdone()
612 sl811_read(sl811, SL811_EP_B(SL11H_PKTSTATREG))); in checkdone()
621 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_irq() local
626 spin_lock(&sl811->lock); in sl811h_irq()
629 irqstat = sl811_read(sl811, SL11H_IRQ_STATUS) & ~SL11H_INTMASK_DP; in sl811h_irq()
631 sl811_write(sl811, SL11H_IRQ_STATUS, irqstat); in sl811h_irq()
632 irqstat &= sl811->irq_enable; in sl811h_irq()
638 irqstat = checkdone(sl811); in sl811h_irq()
640 sl811->stat_lost++; in sl811h_irq()
648 done(sl811, sl811->active_a, SL811_EP_A(SL811_HOST_BUF)); in sl811h_irq()
649 sl811->active_a = NULL; in sl811h_irq()
650 sl811->stat_a++; in sl811h_irq()
654 done(sl811, sl811->active_b, SL811_EP_B(SL811_HOST_BUF)); in sl811h_irq()
655 sl811->active_b = NULL; in sl811h_irq()
656 sl811->stat_b++; in sl811h_irq()
662 index = sl811->frame++ % (PERIODIC_SIZE - 1); in sl811h_irq()
663 sl811->stat_sof++; in sl811h_irq()
669 if (sl811->next_periodic) { in sl811h_irq()
671 sl811->stat_overrun++; in sl811h_irq()
673 if (sl811->periodic[index]) in sl811h_irq()
674 sl811->next_periodic = sl811->periodic[index]; in sl811h_irq()
679 sl811->stat_insrmv++; in sl811h_irq()
682 sl811->stat_wake = 0; in sl811h_irq()
683 sl811->stat_sof = 0; in sl811h_irq()
684 sl811->stat_a = 0; in sl811h_irq()
685 sl811->stat_b = 0; in sl811h_irq()
686 sl811->stat_lost = 0; in sl811h_irq()
688 sl811->ctrl1 = 0; in sl811h_irq()
689 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); in sl811h_irq()
691 sl811->irq_enable = SL11H_INTMASK_INSRMV; in sl811h_irq()
692 sl811_write(sl811, SL11H_IRQ_ENABLE, sl811->irq_enable); in sl811h_irq()
695 if (sl811->active_a) { in sl811h_irq()
696 sl811_write(sl811, SL811_EP_A(SL11H_HOSTCTLREG), 0); in sl811h_irq()
697 finish_request(sl811, sl811->active_a, in sl811h_irq()
698 container_of(sl811->active_a in sl811h_irq()
702 sl811->active_a = NULL; in sl811h_irq()
705 if (sl811->active_b) { in sl811h_irq()
706 sl811_write(sl811, SL811_EP_B(SL11H_HOSTCTLREG), 0); in sl811h_irq()
707 finish_request(sl811, sl811->active_b, in sl811h_irq()
708 container_of(sl811->active_b in sl811h_irq()
712 sl811->active_b = NULL; in sl811h_irq()
720 sl811->port1 &= ~USB_PORT_STAT_CONNECTION; in sl811h_irq()
722 sl811->port1 |= USB_PORT_STAT_CONNECTION; in sl811h_irq()
724 sl811->port1 |= USB_PORT_STAT_C_CONNECTION << 16; in sl811h_irq()
727 if (sl811->port1 & USB_PORT_STAT_SUSPEND) { in sl811h_irq()
729 sl811->port1 |= USB_PORT_STAT_C_SUSPEND << 16; in sl811h_irq()
730 sl811->stat_wake++; in sl811h_irq()
736 if (sl811->port1 & USB_PORT_STAT_ENABLE) in sl811h_irq()
737 start_transfer(sl811); in sl811h_irq()
743 if (sl811->periodic_count == 0 && list_empty(&sl811->async)) in sl811h_irq()
744 sofirq_off(sl811); in sl811h_irq()
745 sl811_write(sl811, SL11H_IRQ_ENABLE, sl811->irq_enable); in sl811h_irq()
747 spin_unlock(&sl811->lock); in sl811h_irq()
763 static int balance(struct sl811 *sl811, u16 period, u16 load) in balance() argument
771 if (branch < 0 || sl811->load[branch] > sl811->load[i]) { in balance()
775 if ((sl811->load[j] + load) in balance()
794 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_urb_enqueue() local
818 spin_lock_irqsave(&sl811->lock, flags); in sl811h_urb_enqueue()
821 if (!(sl811->port1 & USB_PORT_STAT_ENABLE) in sl811h_urb_enqueue()
867 if (!(sl811->ctrl1 & SL11H_CTL1MASK_LSPD)) in sl811h_urb_enqueue()
895 list_add_tail(&ep->schedule, &sl811->async); in sl811h_urb_enqueue()
906 urb->start_frame = (sl811->frame & (PERIODIC_SIZE - 1)) in sl811h_urb_enqueue()
911 retval = balance(sl811, ep->period, ep->load); in sl811h_urb_enqueue()
916 urb->start_frame = (sl811->frame & (PERIODIC_SIZE - 1)) in sl811h_urb_enqueue()
926 struct sl811h_ep **prev = &sl811->periodic[i]; in sl811h_urb_enqueue()
939 sl811->load[i] += ep->load; in sl811h_urb_enqueue()
941 sl811->periodic_count++; in sl811h_urb_enqueue()
943 sofirq_on(sl811); in sl811h_urb_enqueue()
947 start_transfer(sl811); in sl811h_urb_enqueue()
948 sl811_write(sl811, SL11H_IRQ_ENABLE, sl811->irq_enable); in sl811h_urb_enqueue()
953 spin_unlock_irqrestore(&sl811->lock, flags); in sl811h_urb_enqueue()
959 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_urb_dequeue() local
965 spin_lock_irqsave(&sl811->lock, flags); in sl811h_urb_dequeue()
980 } else if (sl811->active_a == ep) { in sl811h_urb_dequeue()
981 if (time_before_eq(sl811->jiffies_a, jiffies)) { in sl811h_urb_dequeue()
985 sl811_read(sl811, in sl811h_urb_dequeue()
987 sl811_read(sl811, in sl811h_urb_dequeue()
989 sl811_write(sl811, SL811_EP_A(SL11H_HOSTCTLREG), in sl811h_urb_dequeue()
991 sl811->active_a = NULL; in sl811h_urb_dequeue()
995 } else if (sl811->active_b == ep) { in sl811h_urb_dequeue()
996 if (time_before_eq(sl811->jiffies_a, jiffies)) { in sl811h_urb_dequeue()
1000 sl811_read(sl811, in sl811h_urb_dequeue()
1002 sl811_read(sl811, in sl811h_urb_dequeue()
1004 sl811_write(sl811, SL811_EP_B(SL11H_HOSTCTLREG), in sl811h_urb_dequeue()
1006 sl811->active_b = NULL; in sl811h_urb_dequeue()
1015 finish_request(sl811, ep, urb, 0); in sl811h_urb_dequeue()
1017 dev_dbg(sl811_to_hcd(sl811)->self.controller, in sl811h_urb_dequeue()
1019 (sl811->active_a == ep) ? "A" : "B"); in sl811h_urb_dequeue()
1023 spin_unlock_irqrestore(&sl811->lock, flags); in sl811h_urb_dequeue()
1048 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_get_frame() local
1054 return sl811->frame; in sl811h_get_frame()
1064 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_hub_status_data() local
1072 if (!timer_pending(&sl811->timer)) { in sl811h_hub_status_data()
1074 sl811->stat_lost++; in sl811h_hub_status_data()
1079 if (!(sl811->port1 & (0xffff << 16))) in sl811h_hub_status_data()
1089 struct sl811 *sl811, in sl811h_hub_descriptor() argument
1102 if (sl811->board && sl811->board->port_power) { in sl811h_hub_descriptor()
1103 desc->bPwrOn2PwrGood = sl811->board->potpg; in sl811h_hub_descriptor()
1123 struct sl811 *sl811 = (void *) _sl811; in sl811h_timer() local
1126 u8 signaling = sl811->ctrl1 & SL11H_CTL1MASK_FORCE; in sl811h_timer()
1131 spin_lock_irqsave(&sl811->lock, flags); in sl811h_timer()
1134 sl811->ctrl1 &= ~SL11H_CTL1MASK_FORCE; in sl811h_timer()
1135 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); in sl811h_timer()
1138 irqstat = sl811_read(sl811, SL11H_IRQ_STATUS); in sl811h_timer()
1142 dev_dbg(sl811_to_hcd(sl811)->self.controller, "end reset\n"); in sl811h_timer()
1143 sl811->port1 = (USB_PORT_STAT_C_RESET << 16) in sl811h_timer()
1145 sl811->ctrl1 = 0; in sl811h_timer()
1151 dev_dbg(sl811_to_hcd(sl811)->self.controller, "end resume\n"); in sl811h_timer()
1152 sl811->port1 &= ~USB_PORT_STAT_SUSPEND; in sl811h_timer()
1155 dev_dbg(sl811_to_hcd(sl811)->self.controller, in sl811h_timer()
1159 sl811_write(sl811, SL11H_IRQ_STATUS, irqstat); in sl811h_timer()
1163 if (sl811->port1 & USB_PORT_STAT_CONNECTION) in sl811h_timer()
1164 sl811->port1 |= (USB_PORT_STAT_C_CONNECTION << 16) in sl811h_timer()
1166 sl811->port1 &= ~mask; in sl811h_timer()
1167 sl811->irq_enable = SL11H_INTMASK_INSRMV; in sl811h_timer()
1169 sl811->port1 |= mask; in sl811h_timer()
1171 sl811->port1 &= ~USB_PORT_STAT_LOW_SPEED; in sl811h_timer()
1172 sl811->irq_enable = SL11H_INTMASK_INSRMV | SL11H_INTMASK_RD; in sl811h_timer()
1175 if (sl811->port1 & USB_PORT_STAT_CONNECTION) { in sl811h_timer()
1178 sl811->irq_enable |= SL11H_INTMASK_DONE_A; in sl811h_timer()
1180 sl811->irq_enable |= SL11H_INTMASK_DONE_B; in sl811h_timer()
1182 if (sl811->port1 & USB_PORT_STAT_LOW_SPEED) { in sl811h_timer()
1183 sl811->ctrl1 |= SL11H_CTL1MASK_LSPD; in sl811h_timer()
1188 sl811->ctrl1 |= SL11H_CTL1MASK_SOF_ENA; in sl811h_timer()
1189 sl811_write(sl811, SL11H_SOFLOWREG, 0xe0); in sl811h_timer()
1190 sl811_write(sl811, SL811HS_CTLREG2, ctrl2); in sl811h_timer()
1193 sl811_write(sl811, SL811_EP_A(SL11H_BUFLNTHREG), 0); in sl811h_timer()
1194 writeb(SL_SOF, sl811->data_reg); in sl811h_timer()
1195 writeb(0, sl811->data_reg); in sl811h_timer()
1196 sl811_write(sl811, SL811_EP_A(SL11H_HOSTCTLREG), in sl811h_timer()
1201 sl811->ctrl1 = 0; in sl811h_timer()
1203 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); in sl811h_timer()
1206 sl811_write(sl811, SL11H_IRQ_ENABLE, sl811->irq_enable); in sl811h_timer()
1207 spin_unlock_irqrestore(&sl811->lock, flags); in sl811h_timer()
1219 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_hub_control() local
1223 spin_lock_irqsave(&sl811->lock, flags); in sl811h_hub_control()
1242 sl811->port1 &= USB_PORT_STAT_POWER; in sl811h_hub_control()
1243 sl811->ctrl1 = 0; in sl811h_hub_control()
1244 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); in sl811h_hub_control()
1245 sl811->irq_enable = SL11H_INTMASK_INSRMV; in sl811h_hub_control()
1246 sl811_write(sl811, SL11H_IRQ_ENABLE, in sl811h_hub_control()
1247 sl811->irq_enable); in sl811h_hub_control()
1250 if (!(sl811->port1 & USB_PORT_STAT_SUSPEND)) in sl811h_hub_control()
1255 sl811->irq_enable = 0; in sl811h_hub_control()
1256 sl811_write(sl811, SL11H_IRQ_ENABLE, in sl811h_hub_control()
1257 sl811->irq_enable); in sl811h_hub_control()
1258 sl811->ctrl1 |= SL11H_CTL1MASK_K; in sl811h_hub_control()
1259 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); in sl811h_hub_control()
1261 mod_timer(&sl811->timer, jiffies in sl811h_hub_control()
1265 port_power(sl811, 0); in sl811h_hub_control()
1276 sl811->port1 &= ~(1 << wValue); in sl811h_hub_control()
1279 sl811h_hub_descriptor(sl811, (struct usb_hub_descriptor *) buf); in sl811h_hub_control()
1287 put_unaligned_le32(sl811->port1, buf); in sl811h_hub_control()
1293 sl811->port1); in sl811h_hub_control()
1300 if (sl811->port1 & USB_PORT_STAT_RESET) in sl811h_hub_control()
1302 if (!(sl811->port1 & USB_PORT_STAT_ENABLE)) in sl811h_hub_control()
1306 sl811->ctrl1 &= ~SL11H_CTL1MASK_SOF_ENA; in sl811h_hub_control()
1307 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); in sl811h_hub_control()
1310 port_power(sl811, 1); in sl811h_hub_control()
1313 if (sl811->port1 & USB_PORT_STAT_SUSPEND) in sl811h_hub_control()
1315 if (!(sl811->port1 & USB_PORT_STAT_POWER)) in sl811h_hub_control()
1319 sl811->irq_enable = 0; in sl811h_hub_control()
1320 sl811_write(sl811, SL11H_IRQ_ENABLE, in sl811h_hub_control()
1321 sl811->irq_enable); in sl811h_hub_control()
1322 sl811->ctrl1 = SL11H_CTL1MASK_SE0; in sl811h_hub_control()
1323 sl811_write(sl811, SL11H_CTLREG1, sl811->ctrl1); in sl811h_hub_control()
1324 sl811->port1 |= USB_PORT_STAT_RESET; in sl811h_hub_control()
1325 mod_timer(&sl811->timer, jiffies in sl811h_hub_control()
1331 sl811->port1 |= 1 << wValue; in sl811h_hub_control()
1340 spin_unlock_irqrestore(&sl811->lock, flags); in sl811h_hub_control()
1385 struct sl811 *sl811 = s->private; in sl811h_show() local
1390 sl811_to_hcd(sl811)->product_desc, in sl811h_show()
1392 sl811->port1); in sl811h_show()
1394 seq_printf(s, "insert/remove: %ld\n", sl811->stat_insrmv); in sl811h_show()
1397 sl811->stat_a, sl811->stat_b, in sl811h_show()
1398 sl811->stat_wake, sl811->stat_sof, in sl811h_show()
1399 sl811->stat_overrun, sl811->stat_lost); in sl811h_show()
1401 spin_lock_irq(&sl811->lock); in sl811h_show()
1403 if (sl811->ctrl1 & SL11H_CTL1MASK_SUSPEND) in sl811h_show()
1406 u8 t = sl811_read(sl811, SL11H_CTLREG1); in sl811h_show()
1420 sl811_read(sl811, SL11H_IRQ_ENABLE)); in sl811h_show()
1422 sl811_read(sl811, SL11H_IRQ_STATUS)); in sl811h_show()
1424 sl811_read(sl811, SL11H_SOFTMRREG) << 6); in sl811h_show()
1427 seq_printf(s, "A: qh%p ctl %02x sts %02x\n", sl811->active_a, in sl811h_show()
1428 sl811_read(sl811, SL811_EP_A(SL11H_HOSTCTLREG)), in sl811h_show()
1429 sl811_read(sl811, SL811_EP_A(SL11H_PKTSTATREG))); in sl811h_show()
1430 seq_printf(s, "B: qh%p ctl %02x sts %02x\n", sl811->active_b, in sl811h_show()
1431 sl811_read(sl811, SL811_EP_B(SL11H_HOSTCTLREG)), in sl811h_show()
1432 sl811_read(sl811, SL811_EP_B(SL11H_PKTSTATREG))); in sl811h_show()
1434 list_for_each_entry (ep, &sl811->async, schedule) { in sl811h_show()
1439 (ep == sl811->active_a) ? "(A) " : "", in sl811h_show()
1440 (ep == sl811->active_b) ? "(B) " : "", in sl811h_show()
1457 if (!list_empty(&sl811->async)) in sl811h_show()
1463 ep = sl811->periodic[i]; in sl811h_show()
1466 seq_printf(s, "%2d [%3d]:\n", i, sl811->load[i]); in sl811h_show()
1473 (ep == sl811->active_a) ? "(A) " : "", in sl811h_show()
1474 (ep == sl811->active_b) ? "(B) " : "", in sl811h_show()
1488 spin_unlock_irq(&sl811->lock); in sl811h_show()
1507 static void create_debug_file(struct sl811 *sl811) in create_debug_file() argument
1509 sl811->debug_file = debugfs_create_file("sl811h", S_IRUGO, in create_debug_file()
1510 usb_debug_root, sl811, in create_debug_file()
1514 static void remove_debug_file(struct sl811 *sl811) in remove_debug_file() argument
1516 debugfs_remove(sl811->debug_file); in remove_debug_file()
1524 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_stop() local
1529 spin_lock_irqsave(&sl811->lock, flags); in sl811h_stop()
1530 port_power(sl811, 0); in sl811h_stop()
1531 spin_unlock_irqrestore(&sl811->lock, flags); in sl811h_stop()
1537 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_start() local
1542 if (sl811->board) { in sl811h_start()
1545 sl811->board->can_wakeup); in sl811h_start()
1546 hcd->power_budget = sl811->board->power * 2; in sl811h_start()
1550 port_power(sl811, 1); in sl811h_start()
1559 .hcd_priv_size = sizeof(struct sl811),
1598 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_remove() local
1601 remove_debug_file(sl811); in sl811h_remove()
1607 iounmap(sl811->data_reg); in sl811h_remove()
1611 iounmap(sl811->addr_reg); in sl811h_remove()
1621 struct sl811 *sl811; in sl811h_probe() local
1689 sl811 = hcd_to_sl811(hcd); in sl811h_probe()
1691 spin_lock_init(&sl811->lock); in sl811h_probe()
1692 INIT_LIST_HEAD(&sl811->async); in sl811h_probe()
1693 sl811->board = dev_get_platdata(&dev->dev); in sl811h_probe()
1694 setup_timer(&sl811->timer, sl811h_timer, (unsigned long)sl811); in sl811h_probe()
1695 sl811->addr_reg = addr_reg; in sl811h_probe()
1696 sl811->data_reg = data_reg; in sl811h_probe()
1698 spin_lock_irq(&sl811->lock); in sl811h_probe()
1699 port_power(sl811, 0); in sl811h_probe()
1700 spin_unlock_irq(&sl811->lock); in sl811h_probe()
1703 tmp = sl811_read(sl811, SL11H_HWREVREG); in sl811h_probe()
1734 create_debug_file(sl811); in sl811h_probe()
1760 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_suspend() local
1770 port_power(sl811, 0); in sl811h_suspend()
1780 struct sl811 *sl811 = hcd_to_sl811(hcd); in sl811h_resume() local
1785 if (!sl811->port1 || !device_can_wakeup(&hcd->self.root_hub->dev)) { in sl811h_resume()
1786 sl811->port1 = 0; in sl811h_resume()
1787 port_power(sl811, 1); in sl811h_resume()