* [PATCH] sh73a0 KZM9G CTS/RTS prototype
@ 2015-03-19 2:05 Magnus Damm
0 siblings, 0 replies; only message in thread
From: Magnus Damm @ 2015-03-19 2:05 UTC (permalink / raw)
To: linux-sh
From: Magnus Damm <damm+renesas@opensource.se>
This is a hack that enables console serial port hardware
flow control for the KZM9G board. Not for upstream merge.
Not-Yet-Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---
arch/arm/boot/dts/sh73a0-kzm9g.dts | 1 +
drivers/tty/serial/sh-sci.c | 12 ++++++++++++
2 files changed, 13 insertions(+)
--- 0001/arch/arm/boot/dts/sh73a0-kzm9g.dts
+++ work/arch/arm/boot/dts/sh73a0-kzm9g.dts 2015-03-19 10:05:46.586786623 +0900
@@ -370,6 +370,7 @@
pinctrl-0 = <&scifa4_pins>;
pinctrl-names = "default";
+ ctsrts;
status = "okay";
};
--- 0006/drivers/tty/serial/sh-sci.c
+++ work/drivers/tty/serial/sh-sci.c 2015-03-19 10:09:14.726785875 +0900
@@ -573,6 +573,9 @@ static void sci_init_ctsrts_scifab(struc
{
unsigned short control, data;
+ printk("xxx SCIFAB hw flow control: %s\n",
+ hwflow_enabled ? "on" : "off");
+
/* SCIFA/SCIFB CTS/RTS pin configuration depends on user space.
*
* In case of CTS - (SCPDR.CTSD is always accessible):
@@ -2048,6 +2051,9 @@ static void sci_set_termios(struct uart_
} else
serial_port_out(port, SCSMR, smr_val);
+ /* hard code modem control enablement for now */
+ termios->c_cflag |= CRTSCTS;
+
sci_init_pins(port, termios->c_cflag);
reg = sci_getreg(port, SCFCR);
@@ -2055,6 +2061,10 @@ static void sci_set_termios(struct uart_
unsigned short ctrl = serial_port_in(port, SCFCR);
if (s->cfg->capabilities & SCIx_HAVE_RTSCTS) {
+
+ printk("xxx enabling hw flow control: %s\n",
+ (termios->c_cflag & CRTSCTS) ? "on" : "off");
+
if (termios->c_cflag & CRTSCTS)
ctrl |= SCFCR_MCE;
else
@@ -2640,6 +2650,8 @@ sci_parse_dt(struct platform_device *pde
p->type = info->type;
p->regtype = info->regtype;
p->scscr = SCSCR_RE | SCSCR_TE;
+ if (of_property_read_bool(np, "ctsrts"))
+ p->capabilities = SCIx_HAVE_RTSCTS;
return p;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-03-19 2:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-19 2:05 [PATCH] sh73a0 KZM9G CTS/RTS prototype Magnus Damm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).