diff options
Diffstat (limited to 'drivers/tty/serial/amba-pl011.c')
-rw-r--r-- | drivers/tty/serial/amba-pl011.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index d984a97043b3..8d94c194f090 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c | |||
@@ -341,6 +341,7 @@ static void pl011_dma_probe_initcall(struct device *dev, struct uart_amba_port * | |||
341 | dmaengine_slave_config(chan, &rx_conf); | 341 | dmaengine_slave_config(chan, &rx_conf); |
342 | uap->dmarx.chan = chan; | 342 | uap->dmarx.chan = chan; |
343 | 343 | ||
344 | uap->dmarx.auto_poll_rate = false; | ||
344 | if (plat && plat->dma_rx_poll_enable) { | 345 | if (plat && plat->dma_rx_poll_enable) { |
345 | /* Set poll rate if specified. */ | 346 | /* Set poll rate if specified. */ |
346 | if (plat->dma_rx_poll_rate) { | 347 | if (plat->dma_rx_poll_rate) { |
@@ -361,9 +362,24 @@ static void pl011_dma_probe_initcall(struct device *dev, struct uart_amba_port * | |||
361 | plat->dma_rx_poll_timeout; | 362 | plat->dma_rx_poll_timeout; |
362 | else | 363 | else |
363 | uap->dmarx.poll_timeout = 3000; | 364 | uap->dmarx.poll_timeout = 3000; |
364 | } else | 365 | } else if (!plat && dev->of_node) { |
365 | uap->dmarx.auto_poll_rate = false; | 366 | uap->dmarx.auto_poll_rate = of_property_read_bool( |
366 | 367 | dev->of_node, "auto-poll"); | |
368 | if (uap->dmarx.auto_poll_rate) { | ||
369 | u32 x; | ||
370 | |||
371 | if (0 == of_property_read_u32(dev->of_node, | ||
372 | "poll-rate-ms", &x)) | ||
373 | uap->dmarx.poll_rate = x; | ||
374 | else | ||
375 | uap->dmarx.poll_rate = 100; | ||
376 | if (0 == of_property_read_u32(dev->of_node, | ||
377 | "poll-timeout-ms", &x)) | ||
378 | uap->dmarx.poll_timeout = x; | ||
379 | else | ||
380 | uap->dmarx.poll_timeout = 3000; | ||
381 | } | ||
382 | } | ||
367 | dev_info(uap->port.dev, "DMA channel RX %s\n", | 383 | dev_info(uap->port.dev, "DMA channel RX %s\n", |
368 | dma_chan_name(uap->dmarx.chan)); | 384 | dma_chan_name(uap->dmarx.chan)); |
369 | } | 385 | } |