Lines Matching refs:pipenum

49 static void enable_pipe_irq(struct m66592 *m66592, u16 pipenum,  in enable_pipe_irq()  argument
57 m66592_bset(m66592, (1 << pipenum), reg); in enable_pipe_irq()
61 static void disable_pipe_irq(struct m66592 *m66592, u16 pipenum, in disable_pipe_irq() argument
69 m66592_bclr(m66592, (1 << pipenum), reg); in disable_pipe_irq()
102 static inline u16 control_reg_get_pid(struct m66592 *m66592, u16 pipenum) in control_reg_get_pid() argument
107 if (pipenum == 0) in control_reg_get_pid()
109 else if (pipenum < M66592_MAX_NUM_PIPE) { in control_reg_get_pid()
110 offset = get_pipectr_addr(pipenum); in control_reg_get_pid()
113 pr_err("unexpect pipe num (%d)\n", pipenum); in control_reg_get_pid()
118 static inline void control_reg_set_pid(struct m66592 *m66592, u16 pipenum, in control_reg_set_pid() argument
123 if (pipenum == 0) in control_reg_set_pid()
125 else if (pipenum < M66592_MAX_NUM_PIPE) { in control_reg_set_pid()
126 offset = get_pipectr_addr(pipenum); in control_reg_set_pid()
129 pr_err("unexpect pipe num (%d)\n", pipenum); in control_reg_set_pid()
132 static inline void pipe_start(struct m66592 *m66592, u16 pipenum) in pipe_start() argument
134 control_reg_set_pid(m66592, pipenum, M66592_PID_BUF); in pipe_start()
137 static inline void pipe_stop(struct m66592 *m66592, u16 pipenum) in pipe_stop() argument
139 control_reg_set_pid(m66592, pipenum, M66592_PID_NAK); in pipe_stop()
142 static inline void pipe_stall(struct m66592 *m66592, u16 pipenum) in pipe_stall() argument
144 control_reg_set_pid(m66592, pipenum, M66592_PID_STALL); in pipe_stall()
147 static inline u16 control_reg_get(struct m66592 *m66592, u16 pipenum) in control_reg_get() argument
152 if (pipenum == 0) in control_reg_get()
154 else if (pipenum < M66592_MAX_NUM_PIPE) { in control_reg_get()
155 offset = get_pipectr_addr(pipenum); in control_reg_get()
158 pr_err("unexpect pipe num (%d)\n", pipenum); in control_reg_get()
163 static inline void control_reg_sqclr(struct m66592 *m66592, u16 pipenum) in control_reg_sqclr() argument
167 pipe_stop(m66592, pipenum); in control_reg_sqclr()
169 if (pipenum == 0) in control_reg_sqclr()
171 else if (pipenum < M66592_MAX_NUM_PIPE) { in control_reg_sqclr()
172 offset = get_pipectr_addr(pipenum); in control_reg_sqclr()
175 pr_err("unexpect pipe num(%d)\n", pipenum); in control_reg_sqclr()
178 static inline int get_buffer_size(struct m66592 *m66592, u16 pipenum) in get_buffer_size() argument
183 if (pipenum == 0) { in get_buffer_size()
192 m66592_write(m66592, pipenum, M66592_PIPESEL); in get_buffer_size()
206 static inline void pipe_change(struct m66592 *m66592, u16 pipenum) in pipe_change() argument
208 struct m66592_ep *ep = m66592->pipenum2ep[pipenum]; in pipe_change()
214 m66592_mdfy(m66592, pipenum, M66592_CURPIPE, ep->fifosel); in pipe_change()
311 m66592_mdfy(m66592, ep->pipenum, M66592_CURPIPE, ep->fifosel); in pipe_initialize()
326 u16 pipenum, int dma) in m66592_ep_setting() argument
328 if ((pipenum != 0) && dma) { in m66592_ep_setting()
358 ep->pipectr = get_pipectr_addr(pipenum); in m66592_ep_setting()
359 ep->pipenum = pipenum; in m66592_ep_setting()
361 m66592->pipenum2ep[pipenum] = ep; in m66592_ep_setting()
369 u16 pipenum = ep->pipenum; in m66592_ep_release() local
371 if (pipenum == 0) in m66592_ep_release()
376 ep->pipenum = 0; in m66592_ep_release()
392 BUG_ON(ep->pipenum); in alloc_pipe_config()
465 info.pipe = ep->pipenum; in free_pipe_config()
474 static void pipe_irq_enable(struct m66592 *m66592, u16 pipenum) in pipe_irq_enable() argument
476 enable_irq_ready(m66592, pipenum); in pipe_irq_enable()
477 enable_irq_nrdy(m66592, pipenum); in pipe_irq_enable()
480 static void pipe_irq_disable(struct m66592 *m66592, u16 pipenum) in pipe_irq_disable() argument
482 disable_irq_ready(m66592, pipenum); in pipe_irq_disable()
483 disable_irq_nrdy(m66592, pipenum); in pipe_irq_disable()
498 pipe_change(m66592, ep->pipenum); in start_ep0_write()
518 pipe_change(m66592, ep->pipenum); in start_packet_write()
519 disable_irq_empty(m66592, ep->pipenum); in start_packet_write()
520 pipe_start(m66592, ep->pipenum); in start_packet_write()
524 pipe_irq_enable(m66592, ep->pipenum); in start_packet_write()
532 u16 pipenum = ep->pipenum; in start_packet_read() local
534 if (ep->pipenum == 0) { in start_packet_read()
539 pipe_start(m66592, pipenum); in start_packet_read()
540 pipe_irq_enable(m66592, pipenum); in start_packet_read()
544 pipe_change(m66592, pipenum); in start_packet_read()
551 pipe_start(m66592, pipenum); /* trigger once */ in start_packet_read()
552 pipe_irq_enable(m66592, pipenum); in start_packet_read()
712 if (unlikely(ep->pipenum == 0)) { in transfer_complete()
746 u16 pipenum = ep->pipenum; in irq_ep0_write() local
749 pipe_change(m66592, pipenum); in irq_ep0_write()
764 bufsize = get_buffer_size(m66592, pipenum); in irq_ep0_write()
783 disable_irq_ready(m66592, pipenum); in irq_ep0_write()
784 disable_irq_empty(m66592, pipenum); in irq_ep0_write()
786 disable_irq_ready(m66592, pipenum); in irq_ep0_write()
787 enable_irq_empty(m66592, pipenum); in irq_ep0_write()
789 pipe_start(m66592, pipenum); in irq_ep0_write()
798 u16 pipenum = ep->pipenum; in irq_packet_write() local
801 pipe_change(m66592, pipenum); in irq_packet_write()
804 pipe_stop(m66592, pipenum); in irq_packet_write()
805 pipe_irq_disable(m66592, pipenum); in irq_packet_write()
806 pr_err("write fifo not ready. pipnum=%d\n", pipenum); in irq_packet_write()
811 bufsize = get_buffer_size(m66592, pipenum); in irq_packet_write()
831 disable_irq_ready(m66592, pipenum); in irq_packet_write()
832 enable_irq_empty(m66592, pipenum); in irq_packet_write()
834 disable_irq_empty(m66592, pipenum); in irq_packet_write()
835 pipe_irq_enable(m66592, pipenum); in irq_packet_write()
845 u16 pipenum = ep->pipenum; in irq_packet_read() local
849 pipe_change(m66592, pipenum); in irq_packet_read()
853 pipe_stop(m66592, pipenum); in irq_packet_read()
854 pipe_irq_disable(m66592, pipenum); in irq_packet_read()
861 bufsize = get_buffer_size(m66592, pipenum); in irq_packet_read()
877 pipe_stop(m66592, pipenum); in irq_packet_read()
878 pipe_irq_disable(m66592, pipenum); in irq_packet_read()
890 if ((ep->pipenum != 0) && finish) in irq_packet_read()
897 u16 pipenum; in irq_pipe_ready() local
910 for (pipenum = 1; pipenum < M66592_MAX_NUM_PIPE; pipenum++) { in irq_pipe_ready()
911 check = 1 << pipenum; in irq_pipe_ready()
914 ep = m66592->pipenum2ep[pipenum]; in irq_pipe_ready()
930 u16 pipenum; in irq_pipe_empty() local
941 for (pipenum = 1; pipenum < M66592_MAX_NUM_PIPE; pipenum++) { in irq_pipe_empty()
942 check = 1 << pipenum; in irq_pipe_empty()
945 tmp = control_reg_get(m66592, pipenum); in irq_pipe_empty()
947 disable_irq_empty(m66592, pipenum); in irq_pipe_empty()
948 pipe_irq_disable(m66592, pipenum); in irq_pipe_empty()
949 pipe_stop(m66592, pipenum); in irq_pipe_empty()
950 ep = m66592->pipenum2ep[pipenum]; in irq_pipe_empty()
980 pid = control_reg_get_pid(m66592, ep->pipenum); in get_status()
1015 pipe_stop(m66592, ep->pipenum); in clear_feature()
1016 control_reg_sqclr(m66592, ep->pipenum); in clear_feature()
1028 pipe_start(m66592, ep->pipenum); in clear_feature()
1072 pipe_stall(m66592, ep->pipenum); in set_feature()
1324 pipe_irq_disable(ep->m66592, ep->pipenum); in m66592_disable()
1413 pipe_stall(ep->m66592, ep->pipenum); in m66592_set_halt()
1416 pipe_stop(ep->m66592, ep->pipenum); in m66592_set_halt()
1430 pipe_stop(ep->m66592, ep->pipenum); in m66592_fifo_flush()
1643 m66592->ep[0].pipenum = 0; in m66592_probe()