提交 8e698614 编写于 作者: P Paul Mundt

serial: sh-sci: Convert from old SCSR control flags to common defines.

Many of these flags were duplicated, and as we now need this visibility
to set them from the platform code, we can just use the linux/serial_sci.h
variants instead.
Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
上级 706622c9
......@@ -376,9 +376,9 @@ static void sci_transmit_chars(struct uart_port *port)
if (!(status & SCxSR_TDxE(port))) {
ctrl = sci_in(port, SCSCR);
if (uart_circ_empty(xmit))
ctrl &= ~SCI_CTRL_FLAGS_TIE;
ctrl &= ~SCSCR_TIE;
else
ctrl |= SCI_CTRL_FLAGS_TIE;
ctrl |= SCSCR_TIE;
sci_out(port, SCSCR, ctrl);
return;
}
......@@ -420,7 +420,7 @@ static void sci_transmit_chars(struct uart_port *port)
sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port));
}
ctrl |= SCI_CTRL_FLAGS_TIE;
ctrl |= SCSCR_TIE;
sci_out(port, SCSCR, ctrl);
}
}
......@@ -721,16 +721,16 @@ static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr)
scr_status = sci_in(port, SCSCR);
/* Tx Interrupt */
if ((ssr_status & 0x0020) && (scr_status & SCI_CTRL_FLAGS_TIE))
if ((ssr_status & 0x0020) && (scr_status & SCSCR_TIE))
ret = sci_tx_interrupt(irq, ptr);
/* Rx Interrupt */
if ((ssr_status & 0x0002) && (scr_status & SCI_CTRL_FLAGS_RIE))
if ((ssr_status & 0x0002) && (scr_status & SCSCR_RIE))
ret = sci_rx_interrupt(irq, ptr);
/* Error Interrupt */
if ((ssr_status & 0x0080) && (scr_status & SCI_CTRL_FLAGS_REIE))
if ((ssr_status & 0x0080) && (scr_status & SCSCR_REIE))
ret = sci_er_interrupt(irq, ptr);
/* Break Interrupt */
if ((ssr_status & 0x0010) && (scr_status & SCI_CTRL_FLAGS_REIE))
if ((ssr_status & 0x0010) && (scr_status & SCSCR_REIE))
ret = sci_br_interrupt(irq, ptr);
return ret;
......@@ -861,7 +861,7 @@ static void sci_start_tx(struct uart_port *port)
/* Set TIE (Transmit Interrupt Enable) bit in SCSCR */
ctrl = sci_in(port, SCSCR);
ctrl |= SCI_CTRL_FLAGS_TIE;
ctrl |= SCSCR_TIE;
sci_out(port, SCSCR, ctrl);
}
......@@ -871,7 +871,7 @@ static void sci_stop_tx(struct uart_port *port)
/* Clear TIE (Transmit Interrupt Enable) bit in SCSCR */
ctrl = sci_in(port, SCSCR);
ctrl &= ~SCI_CTRL_FLAGS_TIE;
ctrl &= ~SCSCR_TIE;
sci_out(port, SCSCR, ctrl);
}
......@@ -881,7 +881,7 @@ static void sci_start_rx(struct uart_port *port, unsigned int tty_start)
/* Set RIE (Receive Interrupt Enable) bit in SCSCR */
ctrl = sci_in(port, SCSCR);
ctrl |= SCI_CTRL_FLAGS_RIE | SCI_CTRL_FLAGS_REIE;
ctrl |= SCSCR_RIE | SCSCR_REIE;
sci_out(port, SCSCR, ctrl);
}
......@@ -891,7 +891,7 @@ static void sci_stop_rx(struct uart_port *port)
/* Clear RIE (Receive Interrupt Enable) bit in SCSCR */
ctrl = sci_in(port, SCSCR);
ctrl &= ~(SCI_CTRL_FLAGS_RIE | SCI_CTRL_FLAGS_REIE);
ctrl &= ~(SCSCR_RIE | SCSCR_REIE);
sci_out(port, SCSCR, ctrl);
}
......
......@@ -138,32 +138,6 @@
# error CPU subtype not defined
#endif
/* SCSCR */
#define SCI_CTRL_FLAGS_TIE 0x80 /* all */
#define SCI_CTRL_FLAGS_RIE 0x40 /* all */
#define SCI_CTRL_FLAGS_TE 0x20 /* all */
#define SCI_CTRL_FLAGS_RE 0x10 /* all */
#if defined(CONFIG_CPU_SUBTYPE_SH7750) || \
defined(CONFIG_CPU_SUBTYPE_SH7091) || \
defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
defined(CONFIG_CPU_SUBTYPE_SH7722) || \
defined(CONFIG_CPU_SUBTYPE_SH7750S) || \
defined(CONFIG_CPU_SUBTYPE_SH7751) || \
defined(CONFIG_CPU_SUBTYPE_SH7751R) || \
defined(CONFIG_CPU_SUBTYPE_SH7763) || \
defined(CONFIG_CPU_SUBTYPE_SH7780) || \
defined(CONFIG_CPU_SUBTYPE_SH7785) || \
defined(CONFIG_CPU_SUBTYPE_SH7786) || \
defined(CONFIG_CPU_SUBTYPE_SHX3)
#define SCI_CTRL_FLAGS_REIE 0x08 /* 7750 SCIF */
#else
#define SCI_CTRL_FLAGS_REIE 0
#endif
/* SCI_CTRL_FLAGS_MPIE 0x08 * 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */
/* SCI_CTRL_FLAGS_TEIE 0x04 * 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */
/* SCI_CTRL_FLAGS_CKE1 0x02 * all */
/* SCI_CTRL_FLAGS_CKE0 0x01 * 7707 SCI/SCIF, 7708 SCI, 7709 SCI/SCIF, 7750 SCI */
/* SCxSR SCI */
#define SCI_TDRE 0x80 /* 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */
#define SCI_RDRF 0x40 /* 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册