diff options
author | Deepak K <deepak.k@ti.com> | 2011-11-09 07:03:38 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-12-14 19:05:24 -0500 |
commit | c86845db77ce220f77e6645b18800744684946ac (patch) | |
tree | f110531ca7ae25eb8193bd47f5ad78254eee92cc /drivers/tty | |
parent | 634bd6e4817cd6a7109be8d2eee5c578a283d1ee (diff) |
ARM: OMAP2+: UART: Allow UART parameters to be configured from board file.
The following UART parameters are defined within the UART driver:
1). Whether the UART uses DMA (dma_enabled), by default set to 0
2). The size of dma buffer (set to 4096 bytes)
3). The time after which the dma should stop if no more data is received.
4). The auto suspend delay that will be passed for pm_runtime_autosuspend
where uart will be disabled after timeout
Different UARTs may be used for different purpose such as the console,
for interfacing bluetooth chip, for interfacing to a modem chip, etc.
Therefore, it is necessary to be able to customize the above settings
for a given board on a per UART basis.
This change allows these parameters to be configured from the board file
and allows the parameters to be configured for each UART independently.
If a board does not define its own custom parameters for the UARTs, then
use the default parameters in the structure "omap_serial_default_info".
The default parameters are defined to be the same as the current settings
in the UART driver to avoid breaking the UART for any cuurnelty supported
boards. By default, make all boards use the default UART parameters.
Signed-off-by: Deepak K <deepak.k@ti.com>
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de> (for drivers/tty changes)
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/omap-serial.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 45a25a01c44d..d60e001cf60f 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c | |||
@@ -43,8 +43,6 @@ | |||
43 | #include <plat/dmtimer.h> | 43 | #include <plat/dmtimer.h> |
44 | #include <plat/omap-serial.h> | 44 | #include <plat/omap-serial.h> |
45 | 45 | ||
46 | #define OMAP_UART_AUTOSUSPEND_DELAY -1 | ||
47 | |||
48 | static struct uart_omap_port *ui[OMAP_MAX_HSUART_PORTS]; | 46 | static struct uart_omap_port *ui[OMAP_MAX_HSUART_PORTS]; |
49 | 47 | ||
50 | /* Forward declaration of functions */ | 48 | /* Forward declaration of functions */ |
@@ -1376,8 +1374,8 @@ static int serial_omap_probe(struct platform_device *pdev) | |||
1376 | up->uart_dma.uart_dma_tx = dma_tx->start; | 1374 | up->uart_dma.uart_dma_tx = dma_tx->start; |
1377 | up->uart_dma.uart_dma_rx = dma_rx->start; | 1375 | up->uart_dma.uart_dma_rx = dma_rx->start; |
1378 | up->use_dma = 1; | 1376 | up->use_dma = 1; |
1379 | up->uart_dma.rx_buf_size = 4096; | 1377 | up->uart_dma.rx_buf_size = omap_up_info->dma_rx_buf_size; |
1380 | up->uart_dma.rx_timeout = 2; | 1378 | up->uart_dma.rx_timeout = omap_up_info->dma_rx_timeout; |
1381 | spin_lock_init(&(up->uart_dma.tx_lock)); | 1379 | spin_lock_init(&(up->uart_dma.tx_lock)); |
1382 | spin_lock_init(&(up->uart_dma.rx_lock)); | 1380 | spin_lock_init(&(up->uart_dma.rx_lock)); |
1383 | up->uart_dma.tx_dma_channel = OMAP_UART_DMA_CH_FREE; | 1381 | up->uart_dma.tx_dma_channel = OMAP_UART_DMA_CH_FREE; |
@@ -1386,7 +1384,7 @@ static int serial_omap_probe(struct platform_device *pdev) | |||
1386 | 1384 | ||
1387 | pm_runtime_use_autosuspend(&pdev->dev); | 1385 | pm_runtime_use_autosuspend(&pdev->dev); |
1388 | pm_runtime_set_autosuspend_delay(&pdev->dev, | 1386 | pm_runtime_set_autosuspend_delay(&pdev->dev, |
1389 | OMAP_UART_AUTOSUSPEND_DELAY); | 1387 | omap_up_info->autosuspend_timeout); |
1390 | 1388 | ||
1391 | pm_runtime_irq_safe(&pdev->dev); | 1389 | pm_runtime_irq_safe(&pdev->dev); |
1392 | pm_runtime_enable(&pdev->dev); | 1390 | pm_runtime_enable(&pdev->dev); |