Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4e02f6d authored by Shimoda, Yoshihiro's avatar Shimoda, Yoshihiro Committed by Paul Mundt
Browse files

serial: sh-sci: Update break_ctl handling for all SCSPTR-capable regtypes.



This updates the earlier break_ctl support regardless of regtype so long
as the requisite SCSPTR exists. This is the same approach used by
sci_init_pins() for providing a generic solution now that we're able to
detect register capabilities on a per-port basis.

Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent ee565105
Loading
Loading
Loading
Loading
+18 −18
Original line number Original line Diff line number Diff line
@@ -1565,10 +1565,18 @@ static void sci_enable_ms(struct uart_port *port)
static void sci_break_ctl(struct uart_port *port, int break_state)
static void sci_break_ctl(struct uart_port *port, int break_state)
{
{
	struct sci_port *s = to_sci_port(port);
	struct sci_port *s = to_sci_port(port);
	struct plat_sci_reg *reg = sci_regmap[s->cfg->regtype] + SCSPTR;
	unsigned short scscr, scsptr;
	unsigned short scscr, scsptr;


	switch (s->cfg->regtype) {
	/* check wheter the port has SCSPTR */
	case SCIx_SH4_SCIF_REGTYPE:
	if (!reg->size) {
		/*
		 * Not supported by hardware. Most parts couple break and rx
		 * interrupts together, with break detection always enabled.
		 */
		return;
	}

	scsptr = serial_port_in(port, SCSPTR);
	scsptr = serial_port_in(port, SCSPTR);
	scscr = serial_port_in(port, SCSCR);
	scscr = serial_port_in(port, SCSCR);


@@ -1582,14 +1590,6 @@ static void sci_break_ctl(struct uart_port *port, int break_state)


	serial_port_out(port, SCSPTR, scsptr);
	serial_port_out(port, SCSPTR, scsptr);
	serial_port_out(port, SCSCR, scscr);
	serial_port_out(port, SCSCR, scscr);
		break;
	default:
		/*
		 * Not supported by hardware. Most parts couple break and rx
		 * interrupts together, with break detection always enabled.
		 */
		break;
	}
}
}


#ifdef CONFIG_SERIAL_SH_SCI_DMA
#ifdef CONFIG_SERIAL_SH_SCI_DMA