From c967164e54d6af120deef83b2f1f49e1dd593406 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Thu, 24 Nov 2011 20:20:53 +0900 Subject: [PATCH] --- yaml --- r: 283581 b: refs/heads/master c: dc7e3ef7dade7041fb1809f2a5403efac655a791 h: refs/heads/master i: 283579: abf11f84001ae02f1859a4c2c667c1044faef2c0 v: v3 --- [refs] | 2 +- trunk/drivers/tty/serial/sh-sci.c | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 5eecf5b86ef2..d56ac8e50093 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cdf7c42fece7c641fcb85cfbf190fdc2a95d19ac +refs/heads/master: dc7e3ef7dade7041fb1809f2a5403efac655a791 diff --git a/trunk/drivers/tty/serial/sh-sci.c b/trunk/drivers/tty/serial/sh-sci.c index 680d34af71f9..46deaaec836d 100644 --- a/trunk/drivers/tty/serial/sh-sci.c +++ b/trunk/drivers/tty/serial/sh-sci.c @@ -1113,10 +1113,23 @@ static unsigned int sci_tx_empty(struct uart_port *port) * handled via the ->init_pins() op, which is a bit of a one-way street, * lacking any ability to defer pin control -- this will later be * converted over to the GPIO framework). + * + * Other modes (such as loopback) are supported generically on certain + * port types, but not others. For these it's sufficient to test for the + * existence of the support register and simply ignore the port type. */ static void sci_set_mctrl(struct uart_port *port, unsigned int mctrl) { - /* Nothing to do here. */ + if (mctrl & TIOCM_LOOP) { + struct plat_sci_reg *reg; + + /* + * Standard loopback mode for SCFCR ports. + */ + reg = sci_getreg(port, SCFCR); + if (reg->size) + sci_out(port, SCFCR, sci_in(port, SCFCR) | 1); + } } static unsigned int sci_get_mctrl(struct uart_port *port)