Commit 6f03541f authored by Sekhar Nori's avatar Sekhar Nori Committed by Greg Kroah-Hartman

serial: 8250_omap: refactor mdr1 update

The silicon errata[1] workaround implemented in a follow-on
patch, "serial: 8250_omap: workaround errata on disabling
UART after using DMA", requires MDR1 register programming.

Extract MDR1 register update into helper function,
omap8250_update_mdr1() to help with that.

[1] Advisory 21 in http://www.ti.com/lit/er/sprz408b/sprz408b.pdfSigned-off-by: default avatarSekhar Nori <nsekhar@ti.com>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Reviewed-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d879aeaa
...@@ -232,6 +232,15 @@ static void omap8250_update_scr(struct uart_8250_port *up, ...@@ -232,6 +232,15 @@ static void omap8250_update_scr(struct uart_8250_port *up,
serial_out(up, UART_OMAP_SCR, priv->scr); serial_out(up, UART_OMAP_SCR, priv->scr);
} }
static void omap8250_update_mdr1(struct uart_8250_port *up,
struct omap8250_priv *priv)
{
if (priv->habit & UART_ERRATA_i202_MDR1_ACCESS)
omap_8250_mdr1_errataset(up, priv);
else
serial_out(up, UART_OMAP_MDR1, priv->mdr1);
}
static void omap8250_restore_regs(struct uart_8250_port *up) static void omap8250_restore_regs(struct uart_8250_port *up)
{ {
struct omap8250_priv *priv = up->port.private_data; struct omap8250_priv *priv = up->port.private_data;
...@@ -282,11 +291,9 @@ static void omap8250_restore_regs(struct uart_8250_port *up) ...@@ -282,11 +291,9 @@ static void omap8250_restore_regs(struct uart_8250_port *up)
serial_out(up, UART_XOFF1, priv->xoff); serial_out(up, UART_XOFF1, priv->xoff);
serial_out(up, UART_LCR, up->lcr); serial_out(up, UART_LCR, up->lcr);
/* need mode A for FCR */
if (priv->habit & UART_ERRATA_i202_MDR1_ACCESS) omap8250_update_mdr1(up, priv);
omap_8250_mdr1_errataset(up, priv);
else
serial_out(up, UART_OMAP_MDR1, priv->mdr1);
up->port.ops->set_mctrl(&up->port, up->port.mctrl); up->port.ops->set_mctrl(&up->port, up->port.mctrl);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment