diff options
author | Darren Hart <dvhart@linux.intel.com> | 2012-03-09 12:51:48 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-09 15:43:19 -0500 |
commit | a8a3ec9df2158d217494c9dd8db8a099ef4fb921 (patch) | |
tree | 902ea3aabd31c27640458c2026e10409153007a2 /drivers/tty | |
parent | e0955acecf311f1079d2cc0d8c36b843b5db4ff6 (diff) |
pch_uart: Use uartclk instead of base_baud
The term "base baud" refers to the fastest baud rate the device can communicate
at. This is clock/16. pch_uart is using base_baud as the clock itself. Rename
the variables to be semantically correct.
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Tomoya MORINAGA <tomoya.rohm@gmail.com>
CC: Feng Tang <feng.tang@intel.com>
CC: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/pch_uart.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c index aa4d07b4a9d5..5178213835c6 100644 --- a/drivers/tty/serial/pch_uart.c +++ b/drivers/tty/serial/pch_uart.c | |||
@@ -206,7 +206,7 @@ enum { | |||
206 | 206 | ||
207 | #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) | 207 | #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) |
208 | 208 | ||
209 | #define DEFAULT_BAUD_RATE 1843200 /* 1.8432MHz */ | 209 | #define DEFAULT_UARTCLK 1843200 /* 1.8432MHz */ |
210 | 210 | ||
211 | struct pch_uart_buffer { | 211 | struct pch_uart_buffer { |
212 | unsigned char *buf; | 212 | unsigned char *buf; |
@@ -221,7 +221,7 @@ struct eg20t_port { | |||
221 | unsigned int iobase; | 221 | unsigned int iobase; |
222 | struct pci_dev *pdev; | 222 | struct pci_dev *pdev; |
223 | int fifo_size; | 223 | int fifo_size; |
224 | int base_baud; | 224 | int uartclk; |
225 | int start_tx; | 225 | int start_tx; |
226 | int start_rx; | 226 | int start_rx; |
227 | int tx_empty; | 227 | int tx_empty; |
@@ -387,7 +387,7 @@ static int pch_uart_hal_set_line(struct eg20t_port *priv, int baud, | |||
387 | unsigned int dll, dlm, lcr; | 387 | unsigned int dll, dlm, lcr; |
388 | int div; | 388 | int div; |
389 | 389 | ||
390 | div = DIV_ROUND_CLOSEST(priv->base_baud / 16, baud); | 390 | div = DIV_ROUND_CLOSEST(priv->uartclk / 16, baud); |
391 | if (div < 0 || USHRT_MAX <= div) { | 391 | if (div < 0 || USHRT_MAX <= div) { |
392 | dev_err(priv->port.dev, "Invalid Baud(div=0x%x)\n", div); | 392 | dev_err(priv->port.dev, "Invalid Baud(div=0x%x)\n", div); |
393 | return -EINVAL; | 393 | return -EINVAL; |
@@ -1205,9 +1205,9 @@ static int pch_uart_startup(struct uart_port *port) | |||
1205 | priv->tx_empty = 1; | 1205 | priv->tx_empty = 1; |
1206 | 1206 | ||
1207 | if (port->uartclk) | 1207 | if (port->uartclk) |
1208 | priv->base_baud = port->uartclk; | 1208 | priv->uartclk = port->uartclk; |
1209 | else | 1209 | else |
1210 | port->uartclk = priv->base_baud; | 1210 | port->uartclk = priv->uartclk; |
1211 | 1211 | ||
1212 | pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_ALL_INT); | 1212 | pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_ALL_INT); |
1213 | ret = pch_uart_hal_set_line(priv, default_baud, | 1213 | ret = pch_uart_hal_set_line(priv, default_baud, |
@@ -1557,7 +1557,7 @@ static int __init pch_console_setup(struct console *co, char *options) | |||
1557 | return -ENODEV; | 1557 | return -ENODEV; |
1558 | 1558 | ||
1559 | /* setup uartclock */ | 1559 | /* setup uartclock */ |
1560 | port->uartclk = DEFAULT_BAUD_RATE; | 1560 | port->uartclk = DEFAULT_UARTCLK; |
1561 | 1561 | ||
1562 | if (options) | 1562 | if (options) |
1563 | uart_parse_options(options, &baud, &parity, &bits, &flow); | 1563 | uart_parse_options(options, &baud, &parity, &bits, &flow); |
@@ -1600,7 +1600,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev, | |||
1600 | unsigned int iobase; | 1600 | unsigned int iobase; |
1601 | unsigned int mapbase; | 1601 | unsigned int mapbase; |
1602 | unsigned char *rxbuf; | 1602 | unsigned char *rxbuf; |
1603 | int fifosize, base_baud; | 1603 | int fifosize, uartclk; |
1604 | int port_type; | 1604 | int port_type; |
1605 | struct pch_uart_driver_data *board; | 1605 | struct pch_uart_driver_data *board; |
1606 | const char *board_name; | 1606 | const char *board_name; |
@@ -1617,12 +1617,12 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev, | |||
1617 | if (!rxbuf) | 1617 | if (!rxbuf) |
1618 | goto init_port_free_txbuf; | 1618 | goto init_port_free_txbuf; |
1619 | 1619 | ||
1620 | base_baud = DEFAULT_BAUD_RATE; | 1620 | uartclk = DEFAULT_UARTCLK; |
1621 | 1621 | ||
1622 | /* quirk for CM-iTC board */ | 1622 | /* quirk for CM-iTC board */ |
1623 | board_name = dmi_get_system_info(DMI_BOARD_NAME); | 1623 | board_name = dmi_get_system_info(DMI_BOARD_NAME); |
1624 | if (board_name && strstr(board_name, "CM-iTC")) | 1624 | if (board_name && strstr(board_name, "CM-iTC")) |
1625 | base_baud = 192000000; /* 192.0MHz */ | 1625 | uartclk = 192000000; /* 192.0MHz */ |
1626 | 1626 | ||
1627 | switch (port_type) { | 1627 | switch (port_type) { |
1628 | case PORT_UNKNOWN: | 1628 | case PORT_UNKNOWN: |
@@ -1648,7 +1648,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev, | |||
1648 | priv->rxbuf.size = PAGE_SIZE; | 1648 | priv->rxbuf.size = PAGE_SIZE; |
1649 | 1649 | ||
1650 | priv->fifo_size = fifosize; | 1650 | priv->fifo_size = fifosize; |
1651 | priv->base_baud = base_baud; | 1651 | priv->uartclk = uartclk; |
1652 | priv->port_type = PORT_MAX_8250 + port_type + 1; | 1652 | priv->port_type = PORT_MAX_8250 + port_type + 1; |
1653 | priv->port.dev = &pdev->dev; | 1653 | priv->port.dev = &pdev->dev; |
1654 | priv->port.iobase = iobase; | 1654 | priv->port.iobase = iobase; |