summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/sh-sci.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-06-08 18:51:32 +0900
committerPaul Mundt <lethal@linux-sh.org>2011-06-08 18:51:32 +0900
commit514820eb982eb85677ed2ecef9710e90e24fbdab (patch)
tree656eb4a0d96ec3e6ac843109cccec862bfcc988e /drivers/tty/serial/sh-sci.c
parentdebf9507166eede1e676d27d3298cdfb27399cb4 (diff)
downloadblackbird-op-linux-514820eb982eb85677ed2ecef9710e90e24fbdab.tar.gz
blackbird-op-linux-514820eb982eb85677ed2ecef9710e90e24fbdab.zip
serial: sh-sci: Consolidate RXD pin handling.
Non-SCI parts do not have the special port reg necessary for cases where the RX and SCI pins are muxed and need to be manually polled, so these like always fall back on the normal FIFO processing paths. SH7760 is in a class in and of itself with regards to mapping its SIM card interface via the SCI port class despite not having any of the RXD lines wired up and so implicitly behaving more like a SCIF in this regard. Out of the other CPUs, some support the port check via the same block while others do it through an external SuperI/O, so it's not even possible to perform the check relative to the ioremapped cookie offset, so the separate read semantics are preserved here, too. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/tty/serial/sh-sci.c')
-rw-r--r--drivers/tty/serial/sh-sci.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index bb27885ea2e5..3248ddaa889d 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -363,6 +363,19 @@ static int sci_rxfill(struct uart_port *port)
return (sci_in(port, SCxSR) & SCxSR_RDxF(port)) != 0;
}
+/*
+ * SCI helper for checking the state of the muxed port/RXD pins.
+ */
+static inline int sci_rxd_in(struct uart_port *port)
+{
+ struct sci_port *s = to_sci_port(port);
+
+ if (s->cfg->port_reg <= 0)
+ return 1;
+
+ return !!__raw_readb(s->cfg->port_reg);
+}
+
/* ********************************************************************** *
* the interrupt related routines *
* ********************************************************************** */
OpenPOWER on IntegriCloud