aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2014-07-23 11:33:06 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-27 14:07:07 -0400
commit7fe090bf48b522de8cd6fe85e2b3252ed74e74f8 (patch)
treebb5c2994d76becef318ec6e2bfbf125e6603db35 /drivers/tty
parent1d6ba284dff546baca58e78546da46be3b48462a (diff)
serial: 8250_dw: Add optional reset control support
The Allwinner A31 and A23 SoCs have a reset controller maintaining the UART in reset by default. This patch adds optional reset support to the driver. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/8250/8250_dw.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index affdcb192aed..501db2f58fd2 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -26,6 +26,7 @@
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/acpi.h> 27#include <linux/acpi.h>
28#include <linux/clk.h> 28#include <linux/clk.h>
29#include <linux/reset.h>
29#include <linux/pm_runtime.h> 30#include <linux/pm_runtime.h>
30 31
31#include <asm/byteorder.h> 32#include <asm/byteorder.h>
@@ -60,6 +61,7 @@ struct dw8250_data {
60 int line; 61 int line;
61 struct clk *clk; 62 struct clk *clk;
62 struct clk *pclk; 63 struct clk *pclk;
64 struct reset_control *rst;
63 struct uart_8250_dma dma; 65 struct uart_8250_dma dma;
64}; 66};
65 67
@@ -383,6 +385,10 @@ static int dw8250_probe(struct platform_device *pdev)
383 } 385 }
384 } 386 }
385 387
388 data->rst = devm_reset_control_get_optional(&pdev->dev, NULL);
389 if (!IS_ERR(data->rst))
390 reset_control_deassert(data->rst);
391
386 data->dma.rx_chan_id = -1; 392 data->dma.rx_chan_id = -1;
387 data->dma.tx_chan_id = -1; 393 data->dma.tx_chan_id = -1;
388 data->dma.rx_param = data; 394 data->dma.rx_param = data;
@@ -426,6 +432,9 @@ static int dw8250_remove(struct platform_device *pdev)
426 432
427 serial8250_unregister_port(data->line); 433 serial8250_unregister_port(data->line);
428 434
435 if (!IS_ERR(data->rst))
436 reset_control_assert(data->rst);
437
429 if (!IS_ERR(data->pclk)) 438 if (!IS_ERR(data->pclk))
430 clk_disable_unprepare(data->pclk); 439 clk_disable_unprepare(data->pclk);
431 440