1 From 3b11721314a100e40634a80062d0d2cce1dc83dc Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Fri, 3 Aug 2012 09:54:27 +0200
4 Subject: [PATCH 12/25] tty support
7 drivers/tty/serial/lantiq.c | 25 +++++++++++++++++++++----
8 1 files changed, 21 insertions(+), 4 deletions(-)
10 diff --git a/drivers/tty/serial/lantiq.c b/drivers/tty/serial/lantiq.c
11 index 96c1cac..82956de 100644
12 --- a/drivers/tty/serial/lantiq.c
13 +++ b/drivers/tty/serial/lantiq.c
15 #define ASCFSTAT_TXFREEMASK 0x3F000000
16 #define ASCFSTAT_TXFREEOFF 24
18 +#define MUXC_SIF_RX_PIN 112
19 +#define MUXC_SIF_TX_PIN 113
21 static void lqasc_tx_chars(struct uart_port *port);
22 static struct ltq_uart_port *lqasc_port[MAXPORTS];
23 static struct uart_driver lqasc_reg;
24 @@ -114,6 +117,7 @@ static DEFINE_SPINLOCK(ltq_asc_lock);
26 struct ltq_uart_port {
27 struct uart_port port;
32 @@ -316,7 +320,7 @@ lqasc_startup(struct uart_port *port)
33 struct ltq_uart_port *ltq_port = to_ltq_uart_port(port);
36 - port->uartclk = clk_get_rate(ltq_port->clk);
37 + port->uartclk = clk_get_rate(ltq_port->fpiclk);
39 ltq_w32_mask(ASCCLC_DISS | ASCCLC_RMCMASK, (1 << ASCCLC_RMCOFFSET),
40 port->membase + LTQ_ASC_CLC);
41 @@ -529,6 +533,19 @@ lqasc_request_port(struct uart_port *port)
42 if (port->membase == NULL)
45 + if (ltq_is_falcon() && (port->line == 1)) {
46 + struct ltq_uart_port *ltq_port = lqasc_port[pdev->id];
47 + if (ltq_gpio_request(&pdev->dev, MUXC_SIF_RX_PIN,
50 + if (ltq_gpio_request(&pdev->dev, MUXC_SIF_TX_PIN,
53 + ltq_port->clk = clk_get(&pdev->dev, NULL);
54 + if (IS_ERR(ltq_port->clk))
55 + return PTR_ERR(ltq_port->clk);
56 + clk_enable(ltq_port->clk);
61 @@ -630,7 +647,7 @@ lqasc_console_setup(struct console *co, char *options)
63 port = <q_port->port;
65 - port->uartclk = clk_get_rate(ltq_port->clk);
66 + port->uartclk = clk_get_rate(ltq_port->fpiclk);
69 uart_parse_options(options, &baud, &parity, &bits, &flow);
70 @@ -686,7 +703,7 @@ lqasc_probe(struct platform_device *pdev)
71 if (lqasc_port[pdev->id] != NULL)
74 - clk = clk_get(&pdev->dev, "fpi");
75 + clk = clk_get_fpi();
77 pr_err("failed to get fpi clk\n");
79 @@ -715,7 +732,7 @@ lqasc_probe(struct platform_device *pdev)
80 port->irq = tx_irq; /* unused, just to be backward-compatibe */
81 port->mapbase = mmres->start;
83 - ltq_port->clk = clk;
84 + ltq_port->fpiclk = clk;
86 ltq_port->tx_irq = tx_irq;
87 ltq_port->rx_irq = rx_irq;