aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Jackson <Andrew.Jackson@arm.com>2014-11-07 09:14:23 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-07 11:35:56 -0500
commit98267d33e2da8cd386212856a22f4a64b32834ab (patch)
treeb38b5fc5c105436b7bd9fb5a2ff65aa6c8ec747f
parent2d3b7d6e7dc8785f9a6c0e4d38188dd1a0859d11 (diff)
serial: pl011: Add device tree support for RX DMA polling
Add equivalent attributes to those provided in the platform data for use when RX DMA is enabled. Signed-off-by: Andrew Jackson <Andrew.Jackson@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--Documentation/devicetree/bindings/serial/pl011.txt19
-rw-r--r--drivers/tty/serial/amba-pl011.c22
2 files changed, 31 insertions, 10 deletions
diff --git a/Documentation/devicetree/bindings/serial/pl011.txt b/Documentation/devicetree/bindings/serial/pl011.txt
index 5d2e840ae65c..0e05340055e1 100644
--- a/Documentation/devicetree/bindings/serial/pl011.txt
+++ b/Documentation/devicetree/bindings/serial/pl011.txt
@@ -6,12 +6,17 @@ Required properties:
6- interrupts: exactly one interrupt specifier 6- interrupts: exactly one interrupt specifier
7 7
8Optional properties: 8Optional properties:
9- pinctrl: When present, must have one state named "sleep" 9- pinctrl: When present, must have one state named "sleep"
10 and one state named "default" 10 and one state named "default"
11- clocks: When present, must refer to exactly one clock named 11- clocks: When present, must refer to exactly one clock named
12 "apb_pclk" 12 "apb_pclk"
13- dmas: When present, may have one or two dma channels. 13- dmas: When present, may have one or two dma channels.
14 The first one must be named "rx", the second one 14 The first one must be named "rx", the second one
15 must be named "tx". 15 must be named "tx".
16- auto-poll: Enables polling when using RX DMA.
17- poll-rate-ms: Rate at which poll occurs when auto-poll is set,
18 default 100ms.
19- poll-timeout-ms: Poll timeout when auto-poll is set, default
20 3000ms.
16 21
17See also bindings/arm/primecell.txt 22See also bindings/arm/primecell.txt
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 }