1 // SPDX-License-Identifier: GPL-2.0
3 * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o.
5 * Copyright (C) 2004 Infineon IFAP DC COM CPE
6 * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org>
7 * Copyright (C) 2007 John Crispin <john@phrozen.org>
8 * Copyright (C) 2010 Thomas Langer, <thomas.langer@lantiq.com>
11 #include <linux/clk.h>
12 #include <linux/console.h>
13 #include <linux/device.h>
14 #include <linux/gpio.h>
15 #include <linux/init.h>
17 #include <linux/ioport.h>
18 #include <linux/lantiq.h>
19 #include <linux/of_address.h>
20 #include <linux/of_irq.h>
21 #include <linux/of_platform.h>
22 #include <linux/serial.h>
23 #include <linux/serial_core.h>
24 #include <linux/slab.h>
25 #include <linux/sysrq.h>
26 #include <linux/tty.h>
27 #include <linux/tty_flip.h>
29 #define PORT_LTQ_ASC 111
31 #define UART_DUMMY_UER_RX 1
32 #define DRVNAME "lantiq,asc"
34 #define LTQ_ASC_TBUF (0x0020 + 3)
35 #define LTQ_ASC_RBUF (0x0024 + 3)
37 #define LTQ_ASC_TBUF 0x0020
38 #define LTQ_ASC_RBUF 0x0024
40 #define LTQ_ASC_FSTAT 0x0048
41 #define LTQ_ASC_WHBSTATE 0x0018
42 #define LTQ_ASC_STATE 0x0014
43 #define LTQ_ASC_IRNCR 0x00F8
44 #define LTQ_ASC_CLC 0x0000
45 #define LTQ_ASC_ID 0x0008
46 #define LTQ_ASC_PISEL 0x0004
47 #define LTQ_ASC_TXFCON 0x0044
48 #define LTQ_ASC_RXFCON 0x0040
49 #define LTQ_ASC_CON 0x0010
50 #define LTQ_ASC_BG 0x0050
51 #define LTQ_ASC_IRNREN 0x00F4
53 #define ASC_IRNREN_TX 0x1
54 #define ASC_IRNREN_RX 0x2
55 #define ASC_IRNREN_ERR 0x4
56 #define ASC_IRNREN_TX_BUF 0x8
57 #define ASC_IRNCR_TIR 0x1
58 #define ASC_IRNCR_RIR 0x2
59 #define ASC_IRNCR_EIR 0x4
61 #define ASCOPT_CSIZE 0x3
64 #define ASCCLC_DISS 0x2
65 #define ASCCLC_RMCMASK 0x0000FF00
66 #define ASCCLC_RMCOFFSET 8
67 #define ASCCON_M_8ASYNC 0x0
68 #define ASCCON_M_7ASYNC 0x2
69 #define ASCCON_ODD 0x00000020
70 #define ASCCON_STP 0x00000080
71 #define ASCCON_BRS 0x00000100
72 #define ASCCON_FDE 0x00000200
73 #define ASCCON_R 0x00008000
74 #define ASCCON_FEN 0x00020000
75 #define ASCCON_ROEN 0x00080000
76 #define ASCCON_TOEN 0x00100000
77 #define ASCSTATE_PE 0x00010000
78 #define ASCSTATE_FE 0x00020000
79 #define ASCSTATE_ROE 0x00080000
80 #define ASCSTATE_ANY (ASCSTATE_ROE|ASCSTATE_PE|ASCSTATE_FE)
81 #define ASCWHBSTATE_CLRREN 0x00000001
82 #define ASCWHBSTATE_SETREN 0x00000002
83 #define ASCWHBSTATE_CLRPE 0x00000004
84 #define ASCWHBSTATE_CLRFE 0x00000008
85 #define ASCWHBSTATE_CLRROE 0x00000020
86 #define ASCTXFCON_TXFEN 0x0001
87 #define ASCTXFCON_TXFFLU 0x0002
88 #define ASCTXFCON_TXFITLMASK 0x3F00
89 #define ASCTXFCON_TXFITLOFF 8
90 #define ASCRXFCON_RXFEN 0x0001
91 #define ASCRXFCON_RXFFLU 0x0002
92 #define ASCRXFCON_RXFITLMASK 0x3F00
93 #define ASCRXFCON_RXFITLOFF 8
94 #define ASCFSTAT_RXFFLMASK 0x003F
95 #define ASCFSTAT_TXFFLMASK 0x3F00
96 #define ASCFSTAT_TXFREEMASK 0x3F000000
97 #define ASCFSTAT_TXFREEOFF 24
99 static void lqasc_tx_chars(struct uart_port
*port
);
100 static struct ltq_uart_port
*lqasc_port
[MAXPORTS
];
101 static struct uart_driver lqasc_reg
;
102 static DEFINE_SPINLOCK(ltq_asc_lock
);
104 struct ltq_uart_port
{
105 struct uart_port port
;
106 /* clock used to derive divider */
108 /* clock gating of the ASC core */
112 unsigned int err_irq
;
115 static inline void asc_update_bits(u32 clear
, u32 set
, void __iomem
*reg
)
117 u32 tmp
= __raw_readl(reg
);
119 __raw_writel((tmp
& ~clear
) | set
, reg
);
123 ltq_uart_port
*to_ltq_uart_port(struct uart_port
*port
)
125 return container_of(port
, struct ltq_uart_port
, port
);
129 lqasc_stop_tx(struct uart_port
*port
)
135 lqasc_start_tx(struct uart_port
*port
)
138 spin_lock_irqsave(<q_asc_lock
, flags
);
139 lqasc_tx_chars(port
);
140 spin_unlock_irqrestore(<q_asc_lock
, flags
);
145 lqasc_stop_rx(struct uart_port
*port
)
147 __raw_writel(ASCWHBSTATE_CLRREN
, port
->membase
+ LTQ_ASC_WHBSTATE
);
151 lqasc_rx_chars(struct uart_port
*port
)
153 struct tty_port
*tport
= &port
->state
->port
;
154 unsigned int ch
= 0, rsr
= 0, fifocnt
;
156 fifocnt
= __raw_readl(port
->membase
+ LTQ_ASC_FSTAT
) &
159 u8 flag
= TTY_NORMAL
;
160 ch
= readb(port
->membase
+ LTQ_ASC_RBUF
);
161 rsr
= (__raw_readl(port
->membase
+ LTQ_ASC_STATE
)
162 & ASCSTATE_ANY
) | UART_DUMMY_UER_RX
;
163 tty_flip_buffer_push(tport
);
167 * Note that the error handling code is
168 * out of the main execution path
170 if (rsr
& ASCSTATE_ANY
) {
171 if (rsr
& ASCSTATE_PE
) {
172 port
->icount
.parity
++;
173 asc_update_bits(0, ASCWHBSTATE_CLRPE
,
174 port
->membase
+ LTQ_ASC_WHBSTATE
);
175 } else if (rsr
& ASCSTATE_FE
) {
176 port
->icount
.frame
++;
177 asc_update_bits(0, ASCWHBSTATE_CLRFE
,
178 port
->membase
+ LTQ_ASC_WHBSTATE
);
180 if (rsr
& ASCSTATE_ROE
) {
181 port
->icount
.overrun
++;
182 asc_update_bits(0, ASCWHBSTATE_CLRROE
,
183 port
->membase
+ LTQ_ASC_WHBSTATE
);
186 rsr
&= port
->read_status_mask
;
188 if (rsr
& ASCSTATE_PE
)
190 else if (rsr
& ASCSTATE_FE
)
194 if ((rsr
& port
->ignore_status_mask
) == 0)
195 tty_insert_flip_char(tport
, ch
, flag
);
197 if (rsr
& ASCSTATE_ROE
)
199 * Overrun is special, since it's reported
200 * immediately, and doesn't affect the current
203 tty_insert_flip_char(tport
, 0, TTY_OVERRUN
);
207 tty_flip_buffer_push(tport
);
213 lqasc_tx_chars(struct uart_port
*port
)
215 struct circ_buf
*xmit
= &port
->state
->xmit
;
216 if (uart_tx_stopped(port
)) {
221 while (((__raw_readl(port
->membase
+ LTQ_ASC_FSTAT
) &
222 ASCFSTAT_TXFREEMASK
) >> ASCFSTAT_TXFREEOFF
) != 0) {
224 writeb(port
->x_char
, port
->membase
+ LTQ_ASC_TBUF
);
230 if (uart_circ_empty(xmit
))
233 writeb(port
->state
->xmit
.buf
[port
->state
->xmit
.tail
],
234 port
->membase
+ LTQ_ASC_TBUF
);
235 xmit
->tail
= (xmit
->tail
+ 1) & (UART_XMIT_SIZE
- 1);
239 if (uart_circ_chars_pending(xmit
) < WAKEUP_CHARS
)
240 uart_write_wakeup(port
);
244 lqasc_tx_int(int irq
, void *_port
)
247 struct uart_port
*port
= (struct uart_port
*)_port
;
248 spin_lock_irqsave(<q_asc_lock
, flags
);
249 __raw_writel(ASC_IRNCR_TIR
, port
->membase
+ LTQ_ASC_IRNCR
);
250 spin_unlock_irqrestore(<q_asc_lock
, flags
);
251 lqasc_start_tx(port
);
256 lqasc_err_int(int irq
, void *_port
)
259 struct uart_port
*port
= (struct uart_port
*)_port
;
260 spin_lock_irqsave(<q_asc_lock
, flags
);
261 /* clear any pending interrupts */
262 asc_update_bits(0, ASCWHBSTATE_CLRPE
| ASCWHBSTATE_CLRFE
|
263 ASCWHBSTATE_CLRROE
, port
->membase
+ LTQ_ASC_WHBSTATE
);
264 spin_unlock_irqrestore(<q_asc_lock
, flags
);
269 lqasc_rx_int(int irq
, void *_port
)
272 struct uart_port
*port
= (struct uart_port
*)_port
;
273 spin_lock_irqsave(<q_asc_lock
, flags
);
274 __raw_writel(ASC_IRNCR_RIR
, port
->membase
+ LTQ_ASC_IRNCR
);
275 lqasc_rx_chars(port
);
276 spin_unlock_irqrestore(<q_asc_lock
, flags
);
281 lqasc_tx_empty(struct uart_port
*port
)
284 status
= __raw_readl(port
->membase
+ LTQ_ASC_FSTAT
) &
286 return status
? 0 : TIOCSER_TEMT
;
290 lqasc_get_mctrl(struct uart_port
*port
)
292 return TIOCM_CTS
| TIOCM_CAR
| TIOCM_DSR
;
296 lqasc_set_mctrl(struct uart_port
*port
, u_int mctrl
)
301 lqasc_break_ctl(struct uart_port
*port
, int break_state
)
306 lqasc_startup(struct uart_port
*port
)
308 struct ltq_uart_port
*ltq_port
= to_ltq_uart_port(port
);
311 if (!IS_ERR(ltq_port
->clk
))
312 clk_prepare_enable(ltq_port
->clk
);
313 port
->uartclk
= clk_get_rate(ltq_port
->freqclk
);
315 asc_update_bits(ASCCLC_DISS
| ASCCLC_RMCMASK
, (1 << ASCCLC_RMCOFFSET
),
316 port
->membase
+ LTQ_ASC_CLC
);
318 __raw_writel(0, port
->membase
+ LTQ_ASC_PISEL
);
320 ((TXFIFO_FL
<< ASCTXFCON_TXFITLOFF
) & ASCTXFCON_TXFITLMASK
) |
321 ASCTXFCON_TXFEN
| ASCTXFCON_TXFFLU
,
322 port
->membase
+ LTQ_ASC_TXFCON
);
324 ((RXFIFO_FL
<< ASCRXFCON_RXFITLOFF
) & ASCRXFCON_RXFITLMASK
)
325 | ASCRXFCON_RXFEN
| ASCRXFCON_RXFFLU
,
326 port
->membase
+ LTQ_ASC_RXFCON
);
327 /* make sure other settings are written to hardware before
328 * setting enable bits
331 asc_update_bits(0, ASCCON_M_8ASYNC
| ASCCON_FEN
| ASCCON_TOEN
|
332 ASCCON_ROEN
, port
->membase
+ LTQ_ASC_CON
);
334 retval
= request_irq(ltq_port
->tx_irq
, lqasc_tx_int
,
337 pr_err("failed to request lqasc_tx_int\n");
341 retval
= request_irq(ltq_port
->rx_irq
, lqasc_rx_int
,
344 pr_err("failed to request lqasc_rx_int\n");
348 retval
= request_irq(ltq_port
->err_irq
, lqasc_err_int
,
351 pr_err("failed to request lqasc_err_int\n");
355 __raw_writel(ASC_IRNREN_RX
| ASC_IRNREN_ERR
| ASC_IRNREN_TX
,
356 port
->membase
+ LTQ_ASC_IRNREN
);
360 free_irq(ltq_port
->rx_irq
, port
);
362 free_irq(ltq_port
->tx_irq
, port
);
367 lqasc_shutdown(struct uart_port
*port
)
369 struct ltq_uart_port
*ltq_port
= to_ltq_uart_port(port
);
370 free_irq(ltq_port
->tx_irq
, port
);
371 free_irq(ltq_port
->rx_irq
, port
);
372 free_irq(ltq_port
->err_irq
, port
);
374 __raw_writel(0, port
->membase
+ LTQ_ASC_CON
);
375 asc_update_bits(ASCRXFCON_RXFEN
, ASCRXFCON_RXFFLU
,
376 port
->membase
+ LTQ_ASC_RXFCON
);
377 asc_update_bits(ASCTXFCON_TXFEN
, ASCTXFCON_TXFFLU
,
378 port
->membase
+ LTQ_ASC_TXFCON
);
379 if (!IS_ERR(ltq_port
->clk
))
380 clk_disable_unprepare(ltq_port
->clk
);
384 lqasc_set_termios(struct uart_port
*port
,
385 struct ktermios
*new, struct ktermios
*old
)
389 unsigned int divisor
;
391 unsigned int con
= 0;
394 cflag
= new->c_cflag
;
395 iflag
= new->c_iflag
;
397 switch (cflag
& CSIZE
) {
399 con
= ASCCON_M_7ASYNC
;
405 new->c_cflag
&= ~ CSIZE
;
407 con
= ASCCON_M_8ASYNC
;
411 cflag
&= ~CMSPAR
; /* Mark/Space parity is not supported */
416 if (cflag
& PARENB
) {
417 if (!(cflag
& PARODD
))
423 port
->read_status_mask
= ASCSTATE_ROE
;
425 port
->read_status_mask
|= ASCSTATE_FE
| ASCSTATE_PE
;
427 port
->ignore_status_mask
= 0;
429 port
->ignore_status_mask
|= ASCSTATE_FE
| ASCSTATE_PE
;
431 if (iflag
& IGNBRK
) {
433 * If we're ignoring parity and break indicators,
434 * ignore overruns too (for real raw support).
437 port
->ignore_status_mask
|= ASCSTATE_ROE
;
440 if ((cflag
& CREAD
) == 0)
441 port
->ignore_status_mask
|= UART_DUMMY_UER_RX
;
443 /* set error signals - framing, parity and overrun, enable receiver */
444 con
|= ASCCON_FEN
| ASCCON_TOEN
| ASCCON_ROEN
;
446 spin_lock_irqsave(<q_asc_lock
, flags
);
449 asc_update_bits(0, con
, port
->membase
+ LTQ_ASC_CON
);
451 /* Set baud rate - take a divider of 2 into account */
452 baud
= uart_get_baud_rate(port
, new, old
, 0, port
->uartclk
/ 16);
453 divisor
= uart_get_divisor(port
, baud
);
454 divisor
= divisor
/ 2 - 1;
456 /* disable the baudrate generator */
457 asc_update_bits(ASCCON_R
, 0, port
->membase
+ LTQ_ASC_CON
);
459 /* make sure the fractional divider is off */
460 asc_update_bits(ASCCON_FDE
, 0, port
->membase
+ LTQ_ASC_CON
);
462 /* set up to use divisor of 2 */
463 asc_update_bits(ASCCON_BRS
, 0, port
->membase
+ LTQ_ASC_CON
);
465 /* now we can write the new baudrate into the register */
466 __raw_writel(divisor
, port
->membase
+ LTQ_ASC_BG
);
468 /* turn the baudrate generator back on */
469 asc_update_bits(0, ASCCON_R
, port
->membase
+ LTQ_ASC_CON
);
472 __raw_writel(ASCWHBSTATE_SETREN
, port
->membase
+ LTQ_ASC_WHBSTATE
);
474 spin_unlock_irqrestore(<q_asc_lock
, flags
);
476 /* Don't rewrite B0 */
477 if (tty_termios_baud_rate(new))
478 tty_termios_encode_baud_rate(new, baud
, baud
);
480 uart_update_timeout(port
, cflag
, baud
);
484 lqasc_type(struct uart_port
*port
)
486 if (port
->type
== PORT_LTQ_ASC
)
493 lqasc_release_port(struct uart_port
*port
)
495 struct platform_device
*pdev
= to_platform_device(port
->dev
);
497 if (port
->flags
& UPF_IOREMAP
) {
498 devm_iounmap(&pdev
->dev
, port
->membase
);
499 port
->membase
= NULL
;
504 lqasc_request_port(struct uart_port
*port
)
506 struct platform_device
*pdev
= to_platform_device(port
->dev
);
507 struct resource
*res
;
510 res
= platform_get_resource(pdev
, IORESOURCE_MEM
, 0);
512 dev_err(&pdev
->dev
, "cannot obtain I/O memory region");
515 size
= resource_size(res
);
517 res
= devm_request_mem_region(&pdev
->dev
, res
->start
,
518 size
, dev_name(&pdev
->dev
));
520 dev_err(&pdev
->dev
, "cannot request I/O memory region");
524 if (port
->flags
& UPF_IOREMAP
) {
525 port
->membase
= devm_ioremap_nocache(&pdev
->dev
,
526 port
->mapbase
, size
);
527 if (port
->membase
== NULL
)
534 lqasc_config_port(struct uart_port
*port
, int flags
)
536 if (flags
& UART_CONFIG_TYPE
) {
537 port
->type
= PORT_LTQ_ASC
;
538 lqasc_request_port(port
);
543 lqasc_verify_port(struct uart_port
*port
,
544 struct serial_struct
*ser
)
547 if (ser
->type
!= PORT_UNKNOWN
&& ser
->type
!= PORT_LTQ_ASC
)
549 if (ser
->irq
< 0 || ser
->irq
>= NR_IRQS
)
551 if (ser
->baud_base
< 9600)
556 static const struct uart_ops lqasc_pops
= {
557 .tx_empty
= lqasc_tx_empty
,
558 .set_mctrl
= lqasc_set_mctrl
,
559 .get_mctrl
= lqasc_get_mctrl
,
560 .stop_tx
= lqasc_stop_tx
,
561 .start_tx
= lqasc_start_tx
,
562 .stop_rx
= lqasc_stop_rx
,
563 .break_ctl
= lqasc_break_ctl
,
564 .startup
= lqasc_startup
,
565 .shutdown
= lqasc_shutdown
,
566 .set_termios
= lqasc_set_termios
,
568 .release_port
= lqasc_release_port
,
569 .request_port
= lqasc_request_port
,
570 .config_port
= lqasc_config_port
,
571 .verify_port
= lqasc_verify_port
,
575 lqasc_console_putchar(struct uart_port
*port
, int ch
)
583 fifofree
= (__raw_readl(port
->membase
+ LTQ_ASC_FSTAT
)
584 & ASCFSTAT_TXFREEMASK
) >> ASCFSTAT_TXFREEOFF
;
585 } while (fifofree
== 0);
586 writeb(ch
, port
->membase
+ LTQ_ASC_TBUF
);
589 static void lqasc_serial_port_write(struct uart_port
*port
, const char *s
,
594 spin_lock_irqsave(<q_asc_lock
, flags
);
595 uart_console_write(port
, s
, count
, lqasc_console_putchar
);
596 spin_unlock_irqrestore(<q_asc_lock
, flags
);
600 lqasc_console_write(struct console
*co
, const char *s
, u_int count
)
602 struct ltq_uart_port
*ltq_port
;
604 if (co
->index
>= MAXPORTS
)
607 ltq_port
= lqasc_port
[co
->index
];
611 lqasc_serial_port_write(<q_port
->port
, s
, count
);
615 lqasc_console_setup(struct console
*co
, char *options
)
617 struct ltq_uart_port
*ltq_port
;
618 struct uart_port
*port
;
624 if (co
->index
>= MAXPORTS
)
627 ltq_port
= lqasc_port
[co
->index
];
631 port
= <q_port
->port
;
633 if (!IS_ERR(ltq_port
->clk
))
634 clk_prepare_enable(ltq_port
->clk
);
636 port
->uartclk
= clk_get_rate(ltq_port
->freqclk
);
639 uart_parse_options(options
, &baud
, &parity
, &bits
, &flow
);
640 return uart_set_options(port
, co
, baud
, parity
, bits
, flow
);
643 static struct console lqasc_console
= {
645 .write
= lqasc_console_write
,
646 .device
= uart_console_device
,
647 .setup
= lqasc_console_setup
,
648 .flags
= CON_PRINTBUFFER
,
654 lqasc_console_init(void)
656 register_console(&lqasc_console
);
659 console_initcall(lqasc_console_init
);
661 static void lqasc_serial_early_console_write(struct console
*co
,
665 struct earlycon_device
*dev
= co
->data
;
667 lqasc_serial_port_write(&dev
->port
, s
, count
);
671 lqasc_serial_early_console_setup(struct earlycon_device
*device
,
674 if (!device
->port
.membase
)
677 device
->con
->write
= lqasc_serial_early_console_write
;
680 OF_EARLYCON_DECLARE(lantiq
, DRVNAME
, lqasc_serial_early_console_setup
);
682 static struct uart_driver lqasc_reg
= {
683 .owner
= THIS_MODULE
,
684 .driver_name
= DRVNAME
,
685 .dev_name
= "ttyLTQ",
689 .cons
= &lqasc_console
,
693 lqasc_probe(struct platform_device
*pdev
)
695 struct device_node
*node
= pdev
->dev
.of_node
;
696 struct ltq_uart_port
*ltq_port
;
697 struct uart_port
*port
;
698 struct resource
*mmres
, irqres
[3];
702 mmres
= platform_get_resource(pdev
, IORESOURCE_MEM
, 0);
703 ret
= of_irq_to_resource_table(node
, irqres
, 3);
704 if (!mmres
|| (ret
!= 3)) {
706 "failed to get memory/irq for serial port\n");
711 line
= of_alias_get_id(node
, "serial");
713 if (IS_ENABLED(CONFIG_LANTIQ
)) {
714 if (mmres
->start
== CPHYSADDR(LTQ_EARLY_ASC
))
719 dev_err(&pdev
->dev
, "failed to get alias id, errno %d\n",
725 if (lqasc_port
[line
]) {
726 dev_err(&pdev
->dev
, "port %d already allocated\n", line
);
730 ltq_port
= devm_kzalloc(&pdev
->dev
, sizeof(struct ltq_uart_port
),
735 port
= <q_port
->port
;
737 port
->iotype
= SERIAL_IO_MEM
;
738 port
->flags
= UPF_BOOT_AUTOCONF
| UPF_IOREMAP
;
739 port
->ops
= &lqasc_pops
;
741 port
->type
= PORT_LTQ_ASC
,
743 port
->dev
= &pdev
->dev
;
744 /* unused, just to be backward-compatible */
745 port
->irq
= irqres
[0].start
;
746 port
->mapbase
= mmres
->start
;
748 if (IS_ENABLED(CONFIG_LANTIQ
) && !IS_ENABLED(CONFIG_COMMON_CLK
))
749 ltq_port
->freqclk
= clk_get_fpi();
751 ltq_port
->freqclk
= devm_clk_get(&pdev
->dev
, "freq");
754 if (IS_ERR(ltq_port
->freqclk
)) {
755 pr_err("failed to get fpi clk\n");
759 /* not all asc ports have clock gates, lets ignore the return code */
760 if (IS_ENABLED(CONFIG_LANTIQ
) && !IS_ENABLED(CONFIG_COMMON_CLK
))
761 ltq_port
->clk
= clk_get(&pdev
->dev
, NULL
);
763 ltq_port
->clk
= devm_clk_get(&pdev
->dev
, "asc");
765 ltq_port
->tx_irq
= irqres
[0].start
;
766 ltq_port
->rx_irq
= irqres
[1].start
;
767 ltq_port
->err_irq
= irqres
[2].start
;
769 lqasc_port
[line
] = ltq_port
;
770 platform_set_drvdata(pdev
, ltq_port
);
772 ret
= uart_add_one_port(&lqasc_reg
, port
);
777 static const struct of_device_id ltq_asc_match
[] = {
778 { .compatible
= DRVNAME
},
782 static struct platform_driver lqasc_driver
= {
785 .of_match_table
= ltq_asc_match
,
794 ret
= uart_register_driver(&lqasc_reg
);
798 ret
= platform_driver_probe(&lqasc_driver
, lqasc_probe
);
800 uart_unregister_driver(&lqasc_reg
);
804 device_initcall(init_lqasc
);