Lines Matching refs:pipenum
52 static void enable_pipe_irq(struct m66592 *m66592, u16 pipenum, in enable_pipe_irq() argument
60 m66592_bset(m66592, (1 << pipenum), reg); in enable_pipe_irq()
64 static void disable_pipe_irq(struct m66592 *m66592, u16 pipenum, in disable_pipe_irq() argument
72 m66592_bclr(m66592, (1 << pipenum), reg); in disable_pipe_irq()
105 static inline u16 control_reg_get_pid(struct m66592 *m66592, u16 pipenum) in control_reg_get_pid() argument
110 if (pipenum == 0) in control_reg_get_pid()
112 else if (pipenum < M66592_MAX_NUM_PIPE) { in control_reg_get_pid()
113 offset = get_pipectr_addr(pipenum); in control_reg_get_pid()
116 pr_err("unexpect pipe num (%d)\n", pipenum); in control_reg_get_pid()
121 static inline void control_reg_set_pid(struct m66592 *m66592, u16 pipenum, in control_reg_set_pid() argument
126 if (pipenum == 0) in control_reg_set_pid()
128 else if (pipenum < M66592_MAX_NUM_PIPE) { in control_reg_set_pid()
129 offset = get_pipectr_addr(pipenum); in control_reg_set_pid()
132 pr_err("unexpect pipe num (%d)\n", pipenum); in control_reg_set_pid()
135 static inline void pipe_start(struct m66592 *m66592, u16 pipenum) in pipe_start() argument
137 control_reg_set_pid(m66592, pipenum, M66592_PID_BUF); in pipe_start()
140 static inline void pipe_stop(struct m66592 *m66592, u16 pipenum) in pipe_stop() argument
142 control_reg_set_pid(m66592, pipenum, M66592_PID_NAK); in pipe_stop()
145 static inline void pipe_stall(struct m66592 *m66592, u16 pipenum) in pipe_stall() argument
147 control_reg_set_pid(m66592, pipenum, M66592_PID_STALL); in pipe_stall()
150 static inline u16 control_reg_get(struct m66592 *m66592, u16 pipenum) in control_reg_get() argument
155 if (pipenum == 0) in control_reg_get()
157 else if (pipenum < M66592_MAX_NUM_PIPE) { in control_reg_get()
158 offset = get_pipectr_addr(pipenum); in control_reg_get()
161 pr_err("unexpect pipe num (%d)\n", pipenum); in control_reg_get()
166 static inline void control_reg_sqclr(struct m66592 *m66592, u16 pipenum) in control_reg_sqclr() argument
170 pipe_stop(m66592, pipenum); in control_reg_sqclr()
172 if (pipenum == 0) in control_reg_sqclr()
174 else if (pipenum < M66592_MAX_NUM_PIPE) { in control_reg_sqclr()
175 offset = get_pipectr_addr(pipenum); in control_reg_sqclr()
178 pr_err("unexpect pipe num(%d)\n", pipenum); in control_reg_sqclr()
181 static inline int get_buffer_size(struct m66592 *m66592, u16 pipenum) in get_buffer_size() argument
186 if (pipenum == 0) { in get_buffer_size()
195 m66592_write(m66592, pipenum, M66592_PIPESEL); in get_buffer_size()
209 static inline void pipe_change(struct m66592 *m66592, u16 pipenum) in pipe_change() argument
211 struct m66592_ep *ep = m66592->pipenum2ep[pipenum]; in pipe_change()
217 m66592_mdfy(m66592, pipenum, M66592_CURPIPE, ep->fifosel); in pipe_change()
314 m66592_mdfy(m66592, ep->pipenum, M66592_CURPIPE, ep->fifosel); in pipe_initialize()
329 u16 pipenum, int dma) in m66592_ep_setting() argument
331 if ((pipenum != 0) && dma) { in m66592_ep_setting()
361 ep->pipectr = get_pipectr_addr(pipenum); in m66592_ep_setting()
362 ep->pipenum = pipenum; in m66592_ep_setting()
364 m66592->pipenum2ep[pipenum] = ep; in m66592_ep_setting()
372 u16 pipenum = ep->pipenum; in m66592_ep_release() local
374 if (pipenum == 0) in m66592_ep_release()
379 ep->pipenum = 0; in m66592_ep_release()
395 BUG_ON(ep->pipenum); in alloc_pipe_config()
468 info.pipe = ep->pipenum; in free_pipe_config()
477 static void pipe_irq_enable(struct m66592 *m66592, u16 pipenum) in pipe_irq_enable() argument
479 enable_irq_ready(m66592, pipenum); in pipe_irq_enable()
480 enable_irq_nrdy(m66592, pipenum); in pipe_irq_enable()
483 static void pipe_irq_disable(struct m66592 *m66592, u16 pipenum) in pipe_irq_disable() argument
485 disable_irq_ready(m66592, pipenum); in pipe_irq_disable()
486 disable_irq_nrdy(m66592, pipenum); in pipe_irq_disable()
501 pipe_change(m66592, ep->pipenum); in start_ep0_write()
521 pipe_change(m66592, ep->pipenum); in start_packet_write()
522 disable_irq_empty(m66592, ep->pipenum); in start_packet_write()
523 pipe_start(m66592, ep->pipenum); in start_packet_write()
527 pipe_irq_enable(m66592, ep->pipenum); in start_packet_write()
535 u16 pipenum = ep->pipenum; in start_packet_read() local
537 if (ep->pipenum == 0) { in start_packet_read()
542 pipe_start(m66592, pipenum); in start_packet_read()
543 pipe_irq_enable(m66592, pipenum); in start_packet_read()
547 pipe_change(m66592, pipenum); in start_packet_read()
554 pipe_start(m66592, pipenum); /* trigger once */ in start_packet_read()
555 pipe_irq_enable(m66592, pipenum); in start_packet_read()
715 if (unlikely(ep->pipenum == 0)) { in transfer_complete()
749 u16 pipenum = ep->pipenum; in irq_ep0_write() local
752 pipe_change(m66592, pipenum); in irq_ep0_write()
767 bufsize = get_buffer_size(m66592, pipenum); in irq_ep0_write()
786 disable_irq_ready(m66592, pipenum); in irq_ep0_write()
787 disable_irq_empty(m66592, pipenum); in irq_ep0_write()
789 disable_irq_ready(m66592, pipenum); in irq_ep0_write()
790 enable_irq_empty(m66592, pipenum); in irq_ep0_write()
792 pipe_start(m66592, pipenum); in irq_ep0_write()
801 u16 pipenum = ep->pipenum; in irq_packet_write() local
804 pipe_change(m66592, pipenum); in irq_packet_write()
807 pipe_stop(m66592, pipenum); in irq_packet_write()
808 pipe_irq_disable(m66592, pipenum); in irq_packet_write()
809 pr_err("write fifo not ready. pipnum=%d\n", pipenum); in irq_packet_write()
814 bufsize = get_buffer_size(m66592, pipenum); in irq_packet_write()
834 disable_irq_ready(m66592, pipenum); in irq_packet_write()
835 enable_irq_empty(m66592, pipenum); in irq_packet_write()
837 disable_irq_empty(m66592, pipenum); in irq_packet_write()
838 pipe_irq_enable(m66592, pipenum); in irq_packet_write()
848 u16 pipenum = ep->pipenum; in irq_packet_read() local
852 pipe_change(m66592, pipenum); in irq_packet_read()
856 pipe_stop(m66592, pipenum); in irq_packet_read()
857 pipe_irq_disable(m66592, pipenum); in irq_packet_read()
864 bufsize = get_buffer_size(m66592, pipenum); in irq_packet_read()
880 pipe_stop(m66592, pipenum); in irq_packet_read()
881 pipe_irq_disable(m66592, pipenum); in irq_packet_read()
893 if ((ep->pipenum != 0) && finish) in irq_packet_read()
900 u16 pipenum; in irq_pipe_ready() local
913 for (pipenum = 1; pipenum < M66592_MAX_NUM_PIPE; pipenum++) { in irq_pipe_ready()
914 check = 1 << pipenum; in irq_pipe_ready()
917 ep = m66592->pipenum2ep[pipenum]; in irq_pipe_ready()
933 u16 pipenum; in irq_pipe_empty() local
944 for (pipenum = 1; pipenum < M66592_MAX_NUM_PIPE; pipenum++) { in irq_pipe_empty()
945 check = 1 << pipenum; in irq_pipe_empty()
948 tmp = control_reg_get(m66592, pipenum); in irq_pipe_empty()
950 disable_irq_empty(m66592, pipenum); in irq_pipe_empty()
951 pipe_irq_disable(m66592, pipenum); in irq_pipe_empty()
952 pipe_stop(m66592, pipenum); in irq_pipe_empty()
953 ep = m66592->pipenum2ep[pipenum]; in irq_pipe_empty()
983 pid = control_reg_get_pid(m66592, ep->pipenum); in get_status()
1018 pipe_stop(m66592, ep->pipenum); in clear_feature()
1019 control_reg_sqclr(m66592, ep->pipenum); in clear_feature()
1031 pipe_start(m66592, ep->pipenum); in clear_feature()
1075 pipe_stall(m66592, ep->pipenum); in set_feature()
1331 pipe_irq_disable(ep->m66592, ep->pipenum); in m66592_disable()
1426 pipe_stall(ep->m66592, ep->pipenum); in m66592_set_halt()
1429 pipe_stop(ep->m66592, ep->pipenum); in m66592_set_halt()
1445 pipe_stop(ep->m66592, ep->pipenum); in m66592_fifo_flush()
1660 m66592->ep[0].pipenum = 0; in m66592_probe()