@@ -564,6 +564,11 @@ static void sci_init_ctsrts_default(stru
serial_port_out(port, SCSPTR, status); /* Set RTS = 0 */
}
+static bool sci_cts_asserted_scifab(struct uart_port *port)
+{
+ return !(serial_port_in(port, SCPDR) & SCPDR_CTSD);
+}
+
static void sci_init_ctsrts_scifab(struct uart_port *port, bool hwflow_enabled)
{
unsigned short control, data;
@@ -1315,8 +1320,16 @@ static unsigned int sci_get_mctrl(struct
* else is wired up. Keep it simple and simply assert DSR/CAR.
*/
- if (s->cfg->capabilities & SCIx_HAVE_RTSCTS)
- cts_asserted = sci_cts_asserted_default(port);
+ if (s->cfg->capabilities & SCIx_HAVE_RTSCTS) {
+ switch (s->cfg->type) {
+ case PORT_SCIFA:
+ case PORT_SCIFB:
+ cts_asserted = sci_cts_asserted_scifab(port);
+ break;
+ default:
+ cts_asserted = sci_cts_asserted_default(port);
+ }
+ }
return TIOCM_DSR | TIOCM_CAR | (cts_asserted ? TIOCM_CTS : 0);
}
@@ -72,6 +72,7 @@
/* SCPDR (Serial Port Data Register) */
#define SCPDR_RTSD (1 << 4) /* Serial Port RTS Output Pin Data */
+#define SCPDR_CTSD (1 << 3) /* Serial Port CTS Input Pin Data */
enum {
SCIx_PROBE_REGTYPE,