Lines Matching refs:ep_num
57 int ep_num = endpoint->endpoint_address & USB_ENDPOINT_NUMBER_MASK; in udc_write_urb() local
71 usbdbg("write urb on ep %d", ep_num); in udc_write_urb()
86 if (ep_num) in udc_write_urb()
87 writel(UDCCSR_PC ,UDCCSN(ep_num)); in udc_write_urb()
90 writel(data32[endpoint->sent / 4 + i], UDCDN(ep_num)); in udc_write_urb()
93 writeb(data8[endpoint->sent + w * 4 + i], UDCDN(ep_num)); in udc_write_urb()
97 writel(ep_num ? UDCCSR_SP : UDCCSR0_IPR, UDCCSN(ep_num)); in udc_write_urb()
100 if (ep_num) { in udc_write_urb()
101 while (!(readl(UDCCSN(ep_num)) & UDCCSR_PC)) { in udc_write_urb()
111 if (ep_num) { in udc_write_urb()
124 if ((endpoint->sent >= urb->actual_length) && (!ep_num)) { in udc_write_urb()
138 int ep_num = endpoint->endpoint_address & USB_ENDPOINT_NUMBER_MASK; in udc_read_urb() local
142 usbdbg("read urb on ep %d", ep_num); in udc_read_urb()
150 if (readl(UDCCSN(ep_num)) & UDCCSR_BNE) in udc_read_urb()
151 n = readl(UDCBCN(ep_num)) & 0x3ff; in udc_read_urb()
157 data32[urb->actual_length / 4 + i / 4] = readl(UDCDN(ep_num)); in udc_read_urb()
373 int ep_num = ep_addr & USB_ENDPOINT_NUMBER_MASK; in udc_handle_ep() local
376 u32 flags = readl(UDCCSN(ep_num)) & (UDCCSR_SST | UDCCSR_TRN); in udc_handle_ep()
378 writel(flags, UDCCSN(ep_num)); in udc_handle_ep()
385 writel(UDCCSR_PC, UDCCSN(ep_num)); in udc_handle_ep()
406 int ep_num, i; in udc_irq() local
453 ep_num = (endpoint[i].endpoint_address) & in udc_irq()
455 if (!ep_num) in udc_irq()
459 UDCISR_INT(ep_num, UDC_INT_PACKETCMP)) { in udc_irq()
460 writel(UDCISR_INT(ep_num, UDC_INT_PACKETCMP), in udc_irq()
486 static void pio_irq_enable(int ep_num) in pio_irq_enable() argument
488 if (ep_num < 16) in pio_irq_enable()
489 writel(readl(UDCICR0) | 3 << (ep_num * 2), UDCICR0); in pio_irq_enable()
491 ep_num -= 16; in pio_irq_enable()
492 writel(readl(UDCICR1) | 3 << (ep_num * 2), UDCICR1); in pio_irq_enable()
501 void udc_set_nak(int ep_num) in udc_set_nak() argument
512 void udc_unset_nak(int ep_num) in udc_unset_nak() argument
526 int ep_num, ep_addr, ep_isout, ep_type, ep_size; in udc_setup_ep() local
537 ep_num = endpoint->endpoint_address & USB_ENDPOINT_NUMBER_MASK; in udc_setup_ep()
538 if (ep_num >= UDC_MAX_ENDPOINTS) { in udc_setup_ep()
539 usberr("unable to setup ep %d!", ep_num); in udc_setup_ep()
543 pio_irq_enable(ep_num); in udc_setup_ep()
544 if (ep_num == 0) { in udc_setup_ep()
557 ep_num = ep_addr & USB_ENDPOINT_NUMBER_MASK; in udc_setup_ep()
563 ep_addr, ep_num, in udc_setup_ep()
576 tmp |= (ep_num << UDCCONR_EN_S) & UDCCONR_EN; in udc_setup_ep()
582 writel(tmp, UDCCN(ep_num)); in udc_setup_ep()
584 usbdbg("UDCCR%c = %x", 'A' + ep_num-1, readl(UDCCN(ep_num))); in udc_setup_ep()
585 usbdbg("UDCCSR%c = %x", 'A' + ep_num-1, readl(UDCCSN(ep_num))); in udc_setup_ep()