Beispiel #1
0
static irqreturn_t sci_er_interrupt(int irq, void *ptr)
{
	struct uart_port *port = ptr;

	/* Handle errors */
	if (port->type == PORT_SCI) {
		if (sci_handle_errors(port)) {
			/* discard character in rx buffer */
			sci_in(port, SCxSR);
			sci_out(port, SCxSR, SCxSR_RDxF_CLEAR(port));
		}
	} else {
#if defined(SCIF_ORER)
		if((sci_in(port, SCLSR) & SCIF_ORER) != 0) {
			struct tty_struct *tty = port->info->port.tty;

			sci_out(port, SCLSR, 0);
			tty_insert_flip_char(tty, 0, TTY_OVERRUN);
			tty_flip_buffer_push(tty);
			pr_debug("scif: overrun error\n");
		}
#endif
		sci_rx_interrupt(irq, ptr);
	}

	sci_out(port, SCxSR, SCxSR_ERROR_CLEAR(port));

	/* Kick the transmission */
	sci_tx_interrupt(irq, ptr);

	return IRQ_HANDLED;
}
Beispiel #2
0
static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr)
{
        unsigned short ssr_status, scr_status;
        struct uart_port *port = ptr;

        ssr_status = sci_in(port,SCxSR);
        scr_status = sci_in(port,SCSCR);

	/* Tx Interrupt */
        if ((ssr_status & 0x0020) && (scr_status & 0x0080))
                sci_tx_interrupt(irq, ptr);
	/* Rx Interrupt */
        if ((ssr_status & 0x0002) && (scr_status & 0x0040))
                sci_rx_interrupt(irq, ptr);
	/* Error Interrupt */
        if ((ssr_status & 0x0080) && (scr_status & 0x0400))
                sci_er_interrupt(irq, ptr);
	/* Break Interrupt */
        if ((ssr_status & 0x0010) && (scr_status & 0x0200))
                sci_br_interrupt(irq, ptr);

	return IRQ_HANDLED;
}
Beispiel #3
0
static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr)
{
	unsigned short ssr_status, scr_status;
	struct uart_port *port = ptr;
	irqreturn_t ret = IRQ_NONE;

        ssr_status = sci_in(port,SCxSR);
        scr_status = sci_in(port,SCSCR);

	/* Tx Interrupt */
	if ((ssr_status & 0x0020) && (scr_status & SCI_CTRL_FLAGS_TIE))
		ret = sci_tx_interrupt(irq, ptr);
	/* Rx Interrupt */
	if ((ssr_status & 0x0002) && (scr_status & SCI_CTRL_FLAGS_RIE))
		ret = sci_rx_interrupt(irq, ptr);
	/* Error Interrupt */
	if ((ssr_status & 0x0080) && (scr_status & SCI_CTRL_FLAGS_REIE))
		ret = sci_er_interrupt(irq, ptr);
	/* Break Interrupt */
	if ((ssr_status & 0x0010) && (scr_status & SCI_CTRL_FLAGS_REIE))
		ret = sci_br_interrupt(irq, ptr);

	return ret;
}