Lines Matching defs:channel

56 #define ZS_WSYNC(channel)	do { } while (0)
126 static unsigned char read_zsreg(struct zilog_channel __iomem *channel,
131 writeb(reg, &channel->control);
133 retval = readb(&channel->control);
139 static void write_zsreg(struct zilog_channel __iomem *channel,
142 writeb(reg, &channel->control);
144 writeb(value, &channel->control);
148 static void sunzilog_clear_fifo(struct zilog_channel __iomem *channel)
155 regval = readb(&channel->control);
160 regval = read_zsreg(channel, R1);
161 readb(&channel->data);
165 writeb(ERR_RES, &channel->control);
167 ZS_WSYNC(channel);
175 static int __load_zsregs(struct zilog_channel __iomem *channel, unsigned char *regs)
183 unsigned char stat = read_zsreg(channel, R1);
189 writeb(ERR_RES, &channel->control);
191 ZS_WSYNC(channel);
193 sunzilog_clear_fifo(channel);
196 write_zsreg(channel, R1,
200 write_zsreg(channel, R4, regs[R4]);
203 write_zsreg(channel, R10, regs[R10]);
206 write_zsreg(channel, R3, regs[R3] & ~RxENAB);
207 write_zsreg(channel, R5, regs[R5] & ~TxENAB);
210 write_zsreg(channel, R6, regs[R6]);
211 write_zsreg(channel, R7, regs[R7]);
219 write_zsreg(channel, R14, regs[R14] & ~BRENAB);
222 write_zsreg(channel, R11, regs[R11]);
225 write_zsreg(channel, R12, regs[R12]);
226 write_zsreg(channel, R13, regs[R13]);
229 write_zsreg(channel, R14, regs[R14]);
232 write_zsreg(channel, R15, (regs[R15] | WR7pEN) & ~FIFOEN);
235 r15 = read_zsreg(channel, R15);
237 write_zsreg(channel, R7, regs[R7p]);
240 write_zsreg(channel, R15, regs[R15] & ~WR7pEN);
249 write_zsreg(channel, R0, RES_EXT_INT); /* First Latch */
250 write_zsreg(channel, R0, RES_EXT_INT); /* Second Latch */
253 write_zsreg(channel, R3, regs[R3]);
254 write_zsreg(channel, R5, regs[R5]);
257 write_zsreg(channel, R1, regs[R1]);
262 /* Reprogram the Zilog channel HW registers with the copies found in the
269 struct zilog_channel __iomem *channel)
275 __load_zsregs(channel, up->curregs);
325 struct zilog_channel __iomem *channel)
335 r1 = read_zsreg(channel, R1);
337 writeb(ERR_RES, &channel->control);
339 ZS_WSYNC(channel);
342 ch = readb(&channel->control);
354 ch = readb(&channel->data);
403 struct zilog_channel __iomem *channel)
407 status = readb(&channel->control);
410 writeb(RES_EXT_INT, &channel->control);
412 ZS_WSYNC(channel);
422 status = readb(&channel->control);
454 struct zilog_channel __iomem *channel)
459 unsigned char status = readb(&channel->control);
477 __load_zsregs(channel, up->curregs);
488 writeb(up->port.x_char, &channel->data);
490 ZS_WSYNC(channel);
507 writeb(xmit->buf[xmit->tail], &channel->data);
509 ZS_WSYNC(channel);
520 writeb(RES_Tx_P, &channel->control);
522 ZS_WSYNC(channel);
530 struct zilog_channel __iomem *channel
536 r3 = read_zsreg(channel, R3);
541 writeb(RES_H_IUS, &channel->control);
543 ZS_WSYNC(channel);
546 port = sunzilog_receive_chars(up, channel);
548 sunzilog_status_handle(up, channel);
550 sunzilog_transmit_chars(up, channel);
559 channel = ZILOG_CHANNEL_FROM_PORT(&up->port);
564 writeb(RES_H_IUS, &channel->control);
566 ZS_WSYNC(channel);
569 port = sunzilog_receive_chars(up, channel);
571 sunzilog_status_handle(up, channel);
573 sunzilog_transmit_chars(up, channel);
591 struct zilog_channel __iomem *channel;
594 channel = ZILOG_CHANNEL_FROM_PORT(port);
595 status = readb(&channel->control);
646 struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port);
663 write_zsreg(channel, R5, up->curregs[R5]);
680 struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port);
686 status = readb(&channel->control);
697 writeb(port->x_char, &channel->data);
699 ZS_WSYNC(channel);
708 writeb(xmit->buf[xmit->tail], &channel->data);
710 ZS_WSYNC(channel);
724 struct zilog_channel __iomem *channel;
729 channel = ZILOG_CHANNEL_FROM_PORT(port);
733 sunzilog_maybe_update_regs(up, channel);
741 struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port);
749 write_zsreg(channel, R15, up->curregs[R15] & ~WR7pEN);
758 struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port);
776 write_zsreg(channel, R5, up->curregs[R5]);
784 struct zilog_channel __iomem *channel;
786 channel = ZILOG_CHANNEL_FROM_PORT(&up->port);
787 up->prev_status = readb(&channel->control);
794 sunzilog_maybe_update_regs(up, channel);
839 struct zilog_channel __iomem *channel;
847 channel = ZILOG_CHANNEL_FROM_PORT(port);
856 sunzilog_maybe_update_regs(up, channel);
1006 struct zilog_channel __iomem *channel
1010 r1 = read_zsreg(channel, R1);
1012 writeb(ERR_RES, &channel->control);
1014 ZS_WSYNC(channel);
1017 ch = readb(&channel->control);
1029 ch = readb(&channel->data);
1130 struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port);
1137 unsigned char val = readb(&channel->control);
1145 writeb(ch, &channel->data);
1147 ZS_WSYNC(channel);
1332 struct zilog_channel __iomem *channel;
1336 channel = ZILOG_CHANNEL_FROM_PORT(&up->port);
1340 write_zsreg(channel, R9, FHWRES);
1342 (void) read_zsreg(channel, R0);
1359 write_zsreg(channel, R9, up->curregs[R9]);
1379 if (__load_zsregs(channel, up->curregs)) {
1385 write_zsreg(channel, R9, up->curregs[R9]);
1588 struct zilog_channel __iomem *channel;
1591 channel = ZILOG_CHANNEL_FROM_PORT(&up->port);
1594 write_zsreg(channel, R9, up->curregs[R9]);
1625 struct zilog_channel __iomem *channel;
1628 channel = ZILOG_CHANNEL_FROM_PORT(&up->port);
1631 write_zsreg(channel, R9, up->curregs[R9]);