• Home
  • Raw
  • Download

Lines Matching refs:pipenum

53 static void enable_pipe_irq(struct r8a66597 *r8a66597, u16 pipenum,  in enable_pipe_irq()  argument
61 r8a66597_bset(r8a66597, (1 << pipenum), reg); in enable_pipe_irq()
65 static void disable_pipe_irq(struct r8a66597 *r8a66597, u16 pipenum, in disable_pipe_irq() argument
73 r8a66597_bclr(r8a66597, (1 << pipenum), reg); in disable_pipe_irq()
104 static inline u16 control_reg_get_pid(struct r8a66597 *r8a66597, u16 pipenum) in control_reg_get_pid() argument
109 if (pipenum == 0) { in control_reg_get_pid()
111 } else if (pipenum < R8A66597_MAX_NUM_PIPE) { in control_reg_get_pid()
112 offset = get_pipectr_addr(pipenum); in control_reg_get_pid()
116 pipenum); in control_reg_get_pid()
122 static inline void control_reg_set_pid(struct r8a66597 *r8a66597, u16 pipenum, in control_reg_set_pid() argument
127 if (pipenum == 0) { in control_reg_set_pid()
129 } else if (pipenum < R8A66597_MAX_NUM_PIPE) { in control_reg_set_pid()
130 offset = get_pipectr_addr(pipenum); in control_reg_set_pid()
134 pipenum); in control_reg_set_pid()
138 static inline void pipe_start(struct r8a66597 *r8a66597, u16 pipenum) in pipe_start() argument
140 control_reg_set_pid(r8a66597, pipenum, PID_BUF); in pipe_start()
143 static inline void pipe_stop(struct r8a66597 *r8a66597, u16 pipenum) in pipe_stop() argument
145 control_reg_set_pid(r8a66597, pipenum, PID_NAK); in pipe_stop()
148 static inline void pipe_stall(struct r8a66597 *r8a66597, u16 pipenum) in pipe_stall() argument
150 control_reg_set_pid(r8a66597, pipenum, PID_STALL); in pipe_stall()
153 static inline u16 control_reg_get(struct r8a66597 *r8a66597, u16 pipenum) in control_reg_get() argument
158 if (pipenum == 0) { in control_reg_get()
160 } else if (pipenum < R8A66597_MAX_NUM_PIPE) { in control_reg_get()
161 offset = get_pipectr_addr(pipenum); in control_reg_get()
165 pipenum); in control_reg_get()
171 static inline void control_reg_sqclr(struct r8a66597 *r8a66597, u16 pipenum) in control_reg_sqclr() argument
175 pipe_stop(r8a66597, pipenum); in control_reg_sqclr()
177 if (pipenum == 0) { in control_reg_sqclr()
179 } else if (pipenum < R8A66597_MAX_NUM_PIPE) { in control_reg_sqclr()
180 offset = get_pipectr_addr(pipenum); in control_reg_sqclr()
184 pipenum); in control_reg_sqclr()
188 static void control_reg_sqset(struct r8a66597 *r8a66597, u16 pipenum) in control_reg_sqset() argument
192 pipe_stop(r8a66597, pipenum); in control_reg_sqset()
194 if (pipenum == 0) { in control_reg_sqset()
196 } else if (pipenum < R8A66597_MAX_NUM_PIPE) { in control_reg_sqset()
197 offset = get_pipectr_addr(pipenum); in control_reg_sqset()
201 "unexpect pipe num(%d)\n", pipenum); in control_reg_sqset()
205 static u16 control_reg_sqmon(struct r8a66597 *r8a66597, u16 pipenum) in control_reg_sqmon() argument
209 if (pipenum == 0) { in control_reg_sqmon()
211 } else if (pipenum < R8A66597_MAX_NUM_PIPE) { in control_reg_sqmon()
212 offset = get_pipectr_addr(pipenum); in control_reg_sqmon()
216 "unexpect pipe num(%d)\n", pipenum); in control_reg_sqmon()
222 static u16 save_usb_toggle(struct r8a66597 *r8a66597, u16 pipenum) in save_usb_toggle() argument
224 return control_reg_sqmon(r8a66597, pipenum); in save_usb_toggle()
227 static void restore_usb_toggle(struct r8a66597 *r8a66597, u16 pipenum, in restore_usb_toggle() argument
231 control_reg_sqset(r8a66597, pipenum); in restore_usb_toggle()
233 control_reg_sqclr(r8a66597, pipenum); in restore_usb_toggle()
236 static inline int get_buffer_size(struct r8a66597 *r8a66597, u16 pipenum) in get_buffer_size() argument
241 if (pipenum == 0) { in get_buffer_size()
250 r8a66597_write(r8a66597, pipenum, PIPESEL); in get_buffer_size()
272 static void r8a66597_change_curpipe(struct r8a66597 *r8a66597, u16 pipenum, in r8a66597_change_curpipe() argument
278 if (!pipenum) { in r8a66597_change_curpipe()
283 loop = pipenum; in r8a66597_change_curpipe()
299 static inline void pipe_change(struct r8a66597 *r8a66597, u16 pipenum) in pipe_change() argument
301 struct r8a66597_ep *ep = r8a66597->pipenum2ep[pipenum]; in pipe_change()
306 r8a66597_mdfy(r8a66597, pipenum, CURPIPE, ep->fifosel); in pipe_change()
404 r8a66597_mdfy(r8a66597, ep->pipenum, CURPIPE, ep->fifosel); in pipe_initialize()
415 u16 pipenum, int dma) in r8a66597_ep_setting() argument
422 ep->pipectr = get_pipectr_addr(pipenum); in r8a66597_ep_setting()
423 if (is_bulk_pipe(pipenum) || is_isoc_pipe(pipenum)) { in r8a66597_ep_setting()
424 ep->pipetre = get_pipetre_addr(pipenum); in r8a66597_ep_setting()
425 ep->pipetrn = get_pipetrn_addr(pipenum); in r8a66597_ep_setting()
430 ep->pipenum = pipenum; in r8a66597_ep_setting()
432 r8a66597->pipenum2ep[pipenum] = ep; in r8a66597_ep_setting()
441 u16 pipenum = ep->pipenum; in r8a66597_ep_release() local
443 if (pipenum == 0) in r8a66597_ep_release()
448 ep->pipenum = 0; in r8a66597_ep_release()
464 if (ep->pipenum) /* already allocated pipe */ in alloc_pipe_config()
542 info.pipe = ep->pipenum; in free_pipe_config()
551 static void pipe_irq_enable(struct r8a66597 *r8a66597, u16 pipenum) in pipe_irq_enable() argument
553 enable_irq_ready(r8a66597, pipenum); in pipe_irq_enable()
554 enable_irq_nrdy(r8a66597, pipenum); in pipe_irq_enable()
557 static void pipe_irq_disable(struct r8a66597 *r8a66597, u16 pipenum) in pipe_irq_disable() argument
559 disable_irq_ready(r8a66597, pipenum); in pipe_irq_disable()
560 disable_irq_nrdy(r8a66597, pipenum); in pipe_irq_disable()
576 pipe_change(r8a66597, ep->pipenum); in start_ep0_write()
589 static void disable_fifosel(struct r8a66597 *r8a66597, u16 pipenum, in disable_fifosel() argument
595 if (tmp == pipenum) in disable_fifosel()
599 static void change_bfre_mode(struct r8a66597 *r8a66597, u16 pipenum, in change_bfre_mode() argument
602 struct r8a66597_ep *ep = r8a66597->pipenum2ep[pipenum]; in change_bfre_mode()
606 r8a66597_write(r8a66597, pipenum, PIPESEL); in change_bfre_mode()
612 pipe_stop(r8a66597, pipenum); in change_bfre_mode()
613 disable_fifosel(r8a66597, pipenum, CFIFOSEL); in change_bfre_mode()
614 disable_fifosel(r8a66597, pipenum, D0FIFOSEL); in change_bfre_mode()
615 disable_fifosel(r8a66597, pipenum, D1FIFOSEL); in change_bfre_mode()
617 toggle = save_usb_toggle(r8a66597, pipenum); in change_bfre_mode()
619 r8a66597_write(r8a66597, pipenum, PIPESEL); in change_bfre_mode()
629 restore_usb_toggle(r8a66597, pipenum, toggle); in change_bfre_mode()
642 if (!is_bulk_pipe(ep->pipenum)) in sudmac_alloc_channel()
655 change_bfre_mode(r8a66597, ep->pipenum, 1); in sudmac_alloc_channel()
707 pipe_change(r8a66597, ep->pipenum); in start_packet_write()
708 disable_irq_empty(r8a66597, ep->pipenum); in start_packet_write()
709 pipe_start(r8a66597, ep->pipenum); in start_packet_write()
714 r8a66597_write(r8a66597, ~(1 << ep->pipenum), BRDYSTS); in start_packet_write()
717 pipe_change(r8a66597, ep->pipenum); in start_packet_write()
718 disable_irq_empty(r8a66597, ep->pipenum); in start_packet_write()
719 pipe_start(r8a66597, ep->pipenum); in start_packet_write()
722 pipe_irq_enable(r8a66597, ep->pipenum); in start_packet_write()
727 pipe_change(r8a66597, ep->pipenum); in start_packet_write()
728 disable_irq_nrdy(r8a66597, ep->pipenum); in start_packet_write()
729 pipe_start(r8a66597, ep->pipenum); in start_packet_write()
730 enable_irq_nrdy(r8a66597, ep->pipenum); in start_packet_write()
740 u16 pipenum = ep->pipenum; in start_packet_read() local
742 if (ep->pipenum == 0) { in start_packet_read()
745 pipe_start(r8a66597, pipenum); in start_packet_read()
746 pipe_irq_enable(r8a66597, pipenum); in start_packet_read()
748 pipe_stop(r8a66597, pipenum); in start_packet_read()
750 enable_irq_nrdy(r8a66597, pipenum); in start_packet_read()
760 change_bfre_mode(r8a66597, ep->pipenum, 0); in start_packet_read()
761 pipe_start(r8a66597, pipenum); /* trigger once */ in start_packet_read()
762 pipe_irq_enable(r8a66597, pipenum); in start_packet_read()
764 pipe_change(r8a66597, pipenum); in start_packet_read()
766 pipe_start(r8a66597, pipenum); /* trigger once */ in start_packet_read()
908 if (unlikely(ep->pipenum == 0)) { in transfer_complete()
945 u16 pipenum = ep->pipenum; in irq_ep0_write() local
948 pipe_change(r8a66597, pipenum); in irq_ep0_write()
964 bufsize = get_buffer_size(r8a66597, pipenum); in irq_ep0_write()
983 disable_irq_ready(r8a66597, pipenum); in irq_ep0_write()
984 disable_irq_empty(r8a66597, pipenum); in irq_ep0_write()
986 disable_irq_ready(r8a66597, pipenum); in irq_ep0_write()
987 enable_irq_empty(r8a66597, pipenum); in irq_ep0_write()
989 pipe_start(r8a66597, pipenum); in irq_ep0_write()
999 u16 pipenum = ep->pipenum; in irq_packet_write() local
1002 pipe_change(r8a66597, pipenum); in irq_packet_write()
1005 pipe_stop(r8a66597, pipenum); in irq_packet_write()
1006 pipe_irq_disable(r8a66597, pipenum); in irq_packet_write()
1008 "write fifo not ready. pipnum=%d\n", pipenum); in irq_packet_write()
1013 bufsize = get_buffer_size(r8a66597, pipenum); in irq_packet_write()
1033 disable_irq_ready(r8a66597, pipenum); in irq_packet_write()
1034 enable_irq_empty(r8a66597, pipenum); in irq_packet_write()
1036 disable_irq_empty(r8a66597, pipenum); in irq_packet_write()
1037 pipe_irq_enable(r8a66597, pipenum); in irq_packet_write()
1048 u16 pipenum = ep->pipenum; in irq_packet_read() local
1052 pipe_change(r8a66597, pipenum); in irq_packet_read()
1056 pipe_stop(r8a66597, pipenum); in irq_packet_read()
1057 pipe_irq_disable(r8a66597, pipenum); in irq_packet_read()
1064 bufsize = get_buffer_size(r8a66597, pipenum); in irq_packet_read()
1080 pipe_stop(r8a66597, pipenum); in irq_packet_read()
1081 pipe_irq_disable(r8a66597, pipenum); in irq_packet_read()
1094 if ((ep->pipenum != 0) && finish) in irq_packet_read()
1101 u16 pipenum; in irq_pipe_ready() local
1113 for (pipenum = 1; pipenum < R8A66597_MAX_NUM_PIPE; pipenum++) { in irq_pipe_ready()
1114 check = 1 << pipenum; in irq_pipe_ready()
1117 ep = r8a66597->pipenum2ep[pipenum]; in irq_pipe_ready()
1132 u16 pipenum; in irq_pipe_empty() local
1143 for (pipenum = 1; pipenum < R8A66597_MAX_NUM_PIPE; pipenum++) { in irq_pipe_empty()
1144 check = 1 << pipenum; in irq_pipe_empty()
1147 tmp = control_reg_get(r8a66597, pipenum); in irq_pipe_empty()
1149 disable_irq_empty(r8a66597, pipenum); in irq_pipe_empty()
1150 pipe_irq_disable(r8a66597, pipenum); in irq_pipe_empty()
1151 pipe_stop(r8a66597, pipenum); in irq_pipe_empty()
1152 ep = r8a66597->pipenum2ep[pipenum]; in irq_pipe_empty()
1180 pid = control_reg_get_pid(r8a66597, ep->pipenum); in get_status()
1217 pipe_stop(r8a66597, ep->pipenum); in clear_feature()
1218 control_reg_sqclr(r8a66597, ep->pipenum); in clear_feature()
1233 pipe_start(r8a66597, ep->pipenum); in clear_feature()
1276 pipe_stall(r8a66597, ep->pipenum); in set_feature()
1405 u16 pipenum; in sudmac_finish() local
1410 pipenum = ep->pipenum; in sudmac_finish()
1411 pipe_change(r8a66597, pipenum); in sudmac_finish()
1418 __func__, pipenum); in sudmac_finish()
1437 disable_irq_ready(r8a66597, pipenum); in sudmac_finish()
1438 enable_irq_empty(r8a66597, pipenum); in sudmac_finish()
1441 r8a66597_write(r8a66597, ~(1 << pipenum), BRDYSTS); in sudmac_finish()
1451 u16 pipenum; in r8a66597_sudmac_irq() local
1456 pipenum = (r8a66597_read(r8a66597, D0FIFOSEL) & CURPIPE); in r8a66597_sudmac_irq()
1457 ep = r8a66597->pipenum2ep[pipenum]; in r8a66597_sudmac_irq()
1581 pipe_irq_disable(ep->r8a66597, ep->pipenum); in r8a66597_disable()
1676 pipe_stall(ep->r8a66597, ep->pipenum); in r8a66597_set_halt()
1680 pipe_stop(ep->r8a66597, ep->pipenum); in r8a66597_set_halt()
1713 pipe_stop(ep->r8a66597, ep->pipenum); in r8a66597_fifo_flush()
1952 r8a66597->ep[0].pipenum = 0; in r8a66597_probe()