f3a9b2423ff9bf235f494fc6d3bf65a0b928ce50
[openwrt/staging/florian.git] / target / linux / lantiq / patches-3.2 / 0031-MIPS-lantiq-convert-falcon-debug-uart-to-clkdev-api.patch
1 From 96cc1d1baabe7bc6df02e90bcd78e6dde542d384 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Tue, 21 Feb 2012 14:25:21 +0100
4 Subject: [PATCH 31/73] MIPS: lantiq: convert falcon debug uart to clkdev api
5
6 On Falcon SoCs we have a secondary serial port that can be used to help
7 debug the voice core. For the port to work several clocking bits need to
8 be activated. We convert the code to clkdev api.
9
10 Signed-off-by: John Crispin <blogic@openwrt.org>
11 ---
12 arch/mips/lantiq/falcon/prom.c | 4 +---
13 drivers/tty/serial/lantiq.c | 7 ++++---
14 2 files changed, 5 insertions(+), 6 deletions(-)
15
16 --- a/arch/mips/lantiq/falcon/prom.c
17 +++ b/arch/mips/lantiq/falcon/prom.c
18 @@ -43,10 +43,8 @@ ltq_soc_setup(void)
19 ltq_register_asc(0);
20 ltq_register_wdt();
21 falcon_register_gpio();
22 - if (register_asc1) {
23 + if (register_asc1)
24 ltq_register_asc(1);
25 - ltq_sysctl_activate(SYSCTL_SYS1, ACTS_ASC1_ACT);
26 - }
27 }
28
29 void __init
30 --- a/drivers/tty/serial/lantiq.c
31 +++ b/drivers/tty/serial/lantiq.c
32 @@ -117,6 +117,7 @@ static DEFINE_SPINLOCK(ltq_asc_lock);
33
34 struct ltq_uart_port {
35 struct uart_port port;
36 + struct clk *fpiclk;
37 struct clk *clk;
38 unsigned int tx_irq;
39 unsigned int rx_irq;
40 @@ -319,7 +320,7 @@ lqasc_startup(struct uart_port *port)
41 struct ltq_uart_port *ltq_port = to_ltq_uart_port(port);
42 int retval;
43
44 - port->uartclk = clk_get_rate(ltq_port->clk);
45 + port->uartclk = clk_get_rate(ltq_port->fpiclk);
46
47 ltq_w32_mask(ASCCLC_DISS | ASCCLC_RMCMASK, (1 << ASCCLC_RMCOFFSET),
48 port->membase + LTQ_ASC_CLC);
49 @@ -646,7 +647,7 @@ lqasc_console_setup(struct console *co,
50
51 port = &ltq_port->port;
52
53 - port->uartclk = clk_get_rate(ltq_port->clk);
54 + port->uartclk = clk_get_rate(ltq_port->fpiclk);
55
56 if (options)
57 uart_parse_options(options, &baud, &parity, &bits, &flow);
58 @@ -731,7 +732,7 @@ lqasc_probe(struct platform_device *pdev
59 port->irq = tx_irq; /* unused, just to be backward-compatibe */
60 port->mapbase = mmres->start;
61
62 - ltq_port->clk = clk;
63 + ltq_port->fpiclk = clk;
64
65 ltq_port->tx_irq = tx_irq;
66 ltq_port->rx_irq = rx_irq;