* [PATCH 1/2] serial: sccnxp: Reset break and overrun bits in RX handler
@ 2013-01-21 15:38 Alexander Shiyan
2013-01-21 15:38 ` [PATCH 2/2] serial: sccnxp: Make baudrate table struct static Alexander Shiyan
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Shiyan @ 2013-01-21 15:38 UTC (permalink / raw)
To: linux-serial; +Cc: Alan Cox, Greg Kroah-Hartman, Alexander Shiyan
This patch adds a hardware reset the break and overflow bits for
these events. Without resetting the bits they will be reported to
the core every time, when once occur.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
drivers/tty/serial/sccnxp.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c
index 3fd83e3..79d6aeb 100644
--- a/drivers/tty/serial/sccnxp.c
+++ b/drivers/tty/serial/sccnxp.c
@@ -309,14 +309,19 @@ static void sccnxp_handle_rx(struct uart_port *port)
if (unlikely(sr)) {
if (sr & SR_BRK) {
port->icount.brk++;
+ sccnxp_port_write(port, SCCNXP_CR_REG,
+ CR_CMD_BREAK_RESET);
if (uart_handle_break(port))
continue;
} else if (sr & SR_PE)
port->icount.parity++;
else if (sr & SR_FE)
port->icount.frame++;
- else if (sr & SR_OVR)
+ else if (sr & SR_OVR) {
port->icount.overrun++;
+ sccnxp_port_write(port, SCCNXP_CR_REG,
+ CR_CMD_STATUS_RESET);
+ }
sr &= port->read_status_mask;
if (sr & SR_BRK)
--
1.7.12.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] serial: sccnxp: Make baudrate table struct static
2013-01-21 15:38 [PATCH 1/2] serial: sccnxp: Reset break and overrun bits in RX handler Alexander Shiyan
@ 2013-01-21 15:38 ` Alexander Shiyan
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Shiyan @ 2013-01-21 15:38 UTC (permalink / raw)
To: linux-serial; +Cc: Alan Cox, Greg Kroah-Hartman, Alexander Shiyan
This struct is used only for driver, so it should be static.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
drivers/tty/serial/sccnxp.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c
index 79d6aeb..f9cad65 100644
--- a/drivers/tty/serial/sccnxp.c
+++ b/drivers/tty/serial/sccnxp.c
@@ -179,14 +179,12 @@ static int sccnxp_update_best_err(int a, int b, int *besterr)
return 1;
}
-struct baud_table {
+static const struct {
u8 csr;
u8 acr;
u8 mr0;
int baud;
-};
-
-const struct baud_table baud_std[] = {
+} baud_std[] = {
{ 0, ACR_BAUD0, MR0_BAUD_NORMAL, 50, },
{ 0, ACR_BAUD1, MR0_BAUD_NORMAL, 75, },
{ 1, ACR_BAUD0, MR0_BAUD_NORMAL, 110, },
--
1.7.12.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-21 15:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-21 15:38 [PATCH 1/2] serial: sccnxp: Reset break and overrun bits in RX handler Alexander Shiyan
2013-01-21 15:38 ` [PATCH 2/2] serial: sccnxp: Make baudrate table struct static Alexander Shiyan
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).