* [PATCH 1/3] serial: sccnxp: Report actual baudrate back to core
@ 2012-09-24 17:12 Alexander Shiyan
2012-09-24 17:12 ` [PATCH 2/3] serial: sccnxp: Remove mask termios caps for SW flow control Alexander Shiyan
2012-09-24 17:12 ` [PATCH 3/3] serial: sccnxp: Make 'default' choice in switch last Alexander Shiyan
0 siblings, 2 replies; 3+ messages in thread
From: Alexander Shiyan @ 2012-09-24 17:12 UTC (permalink / raw)
To: linux-serial; +Cc: Alan Cox, Greg Kroah-Hartman, Alexander Shiyan
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
drivers/tty/serial/sccnxp.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c
index 29dda9b..478630b 100644
--- a/drivers/tty/serial/sccnxp.c
+++ b/drivers/tty/serial/sccnxp.c
@@ -213,7 +213,7 @@ const struct baud_table baud_std[] = {
{ 0, 0, 0, 0 }
};
-static void sccnxp_set_baud(struct uart_port *port, int baud)
+static int sccnxp_set_baud(struct uart_port *port, int baud)
{
struct sccnxp_port *s = dev_get_drvdata(port->dev);
int div_std, tmp_baud, bestbaud = baud, besterr = -1;
@@ -244,8 +244,11 @@ static void sccnxp_set_baud(struct uart_port *port, int baud)
sccnxp_port_write(port, SCCNXP_ACR_REG, acr | ACR_TIMER_MODE);
sccnxp_port_write(port, SCCNXP_CSR_REG, (csr << 4) | csr);
- dev_dbg(port->dev, "Baudrate desired: %i, calculated: %i\n",
- baud, bestbaud);
+ if (baud != bestbaud)
+ dev_dbg(port->dev, "Baudrate desired: %i, calculated: %i\n",
+ baud, bestbaud);
+
+ return bestbaud;
}
static void sccnxp_enable_irq(struct uart_port *port, int mask)
@@ -587,11 +590,14 @@ static void sccnxp_set_termios(struct uart_port *port,
baud = uart_get_baud_rate(port, termios, old, 50,
(s->flags & SCCNXP_HAVE_MR0) ?
230400 : 38400);
- sccnxp_set_baud(port, baud);
+ baud = sccnxp_set_baud(port, baud);
/* Update timeout according to new baud rate */
uart_update_timeout(port, termios->c_cflag, baud);
+ if (tty_termios_baud_rate(termios))
+ tty_termios_encode_baud_rate(termios, baud, baud);
+
/* Enable RX & TX */
sccnxp_port_write(port, SCCNXP_CR_REG, CR_RX_ENABLE | CR_TX_ENABLE);
--
1.7.8.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/3] serial: sccnxp: Remove mask termios caps for SW flow control
2012-09-24 17:12 [PATCH 1/3] serial: sccnxp: Report actual baudrate back to core Alexander Shiyan
@ 2012-09-24 17:12 ` Alexander Shiyan
2012-09-24 17:12 ` [PATCH 3/3] serial: sccnxp: Make 'default' choice in switch last Alexander Shiyan
1 sibling, 0 replies; 3+ messages in thread
From: Alexander Shiyan @ 2012-09-24 17:12 UTC (permalink / raw)
To: linux-serial; +Cc: Alan Cox, Greg Kroah-Hartman, Alexander Shiyan
The kernel will handle IXON/IXOFF/IXANY in software if the hardware
doesn't do it.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
drivers/tty/serial/sccnxp.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c
index 478630b..22e9b8f 100644
--- a/drivers/tty/serial/sccnxp.c
+++ b/drivers/tty/serial/sccnxp.c
@@ -531,7 +531,6 @@ static void sccnxp_set_termios(struct uart_port *port,
/* Mask termios capabilities we don't support */
termios->c_cflag &= ~CMSPAR;
- termios->c_iflag &= ~(IXON | IXOFF | IXANY);
/* Disable RX & TX, reset break condition, status and FIFOs */
sccnxp_port_write(port, SCCNXP_CR_REG, CR_CMD_RX_RESET |
--
1.7.8.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 3/3] serial: sccnxp: Make 'default' choice in switch last
2012-09-24 17:12 [PATCH 1/3] serial: sccnxp: Report actual baudrate back to core Alexander Shiyan
2012-09-24 17:12 ` [PATCH 2/3] serial: sccnxp: Remove mask termios caps for SW flow control Alexander Shiyan
@ 2012-09-24 17:12 ` Alexander Shiyan
1 sibling, 0 replies; 3+ messages in thread
From: Alexander Shiyan @ 2012-09-24 17:12 UTC (permalink / raw)
To: linux-serial; +Cc: Alan Cox, Greg Kroah-Hartman, Alexander Shiyan
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
drivers/tty/serial/sccnxp.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c
index 22e9b8f..d3054dc 100644
--- a/drivers/tty/serial/sccnxp.c
+++ b/drivers/tty/serial/sccnxp.c
@@ -550,8 +550,8 @@ static void sccnxp_set_termios(struct uart_port *port,
case CS7:
mr1 = MR1_BITS_7;
break;
- default:
case CS8:
+ default:
mr1 = MR1_BITS_8;
break;
}
--
1.7.8.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-09-24 17:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-24 17:12 [PATCH 1/3] serial: sccnxp: Report actual baudrate back to core Alexander Shiyan
2012-09-24 17:12 ` [PATCH 2/3] serial: sccnxp: Remove mask termios caps for SW flow control Alexander Shiyan
2012-09-24 17:12 ` [PATCH 3/3] serial: sccnxp: Make 'default' choice in switch last 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).