Lines Matching +full:auto +full:- +full:baud
1 // SPDX-License-Identifier: GPL-2.0+
9 * Copyright 2014 Oleksij Rempel <linux@rempel-privat.de>
11 * Copyright 2008-2010 Freescale Semiconductor, Inc.
34 #include <linux/dma-mapping.h>
90 #define AUART_LINECTRL_WLEN(v) ((((v) - 5) & 0x3) << 5)
138 * RW. Receive Timeout Counter Value: number of 8-bit-time to wait before
140 * input is idle, then the watchdog counter will decrement each bit-time. Note
141 * 7-bit-time is added to the programmed value, so a value of zero will set
142 * the counter to 7-bit-time, a value of 0x1 gives 15-bit-time and so on. Also
146 * value is 0x3 (31 bit-time).
149 /* TIMEOUT = (100*7+1)*(1/BAUD) */
218 /* Auto-Boud Timeout */
273 /* RW. Enable Auto Direction Control. */
280 /* RW. Enable Auto Address Detect (AAD). */
284 /* RW. Enable RS-485/EIA-485 Normal Multidrop Mode (NMM) */
294 * is in periods of the baud clock.
299 /* WO. Auto-baud time-out interrupt clear bit. */
301 /* WO. End of auto-baud interrupt clear bit. */
305 /* Auto-baud mode select bit. 0 - Mode 0, 1 - Mode 1. */
308 * Auto-baud start (auto-baud is running). Auto-baud run bit. This bit is
309 * automatically cleared after auto-baud completion.
320 /* RW. Baud Rate Mode: 1 - Enable sync mode. 0 - async mode. */
322 /* RW. 1 - MSB bit send frist; 0 - LSB bit frist. */
324 /* RW. 1 - sample rate = 8 x Baudrate; 0 - sample rate = 16 x Baudrate. */
326 /* RW. 1 - Set word length to 9bit. 0 - use ASM9260_BM_LCTRL_WLEN */
338 /* RW. 1 - ISO7816 mode; 0 - USART mode */
376 /* The size of the array - must be last */
446 .compatible = "fsl,imx28-auart",
449 .compatible = "fsl,imx23-auart",
452 .compatible = "alphascale,asm9260-auart",
460 return s->devtype == IMX28_AUART; in is_imx28_auart()
465 return s->devtype == ASM9260_AUART; in is_asm9260_auart()
470 return s->flags & MXS_AUART_DMA_ENABLED; in auart_dma_enabled()
476 return uap->vendor->reg_offset[reg]; in mxs_reg_to_offset()
482 void __iomem *addr = uap->port.membase + mxs_reg_to_offset(uap, reg); in mxs_read()
490 void __iomem *addr = uap->port.membase + mxs_reg_to_offset(uap, reg); in mxs_write()
498 void __iomem *addr = uap->port.membase + mxs_reg_to_offset(uap, reg); in mxs_set()
506 void __iomem *addr = uap->port.membase + mxs_reg_to_offset(uap, reg); in mxs_clr()
520 struct circ_buf *xmit = &s->port.state->xmit; in dma_tx_callback()
522 dma_unmap_sg(s->dev, &s->tx_sgl, 1, DMA_TO_DEVICE); in dma_tx_callback()
525 clear_bit(MXS_AUART_DMA_TX_SYNC, &s->flags); in dma_tx_callback()
530 uart_write_wakeup(&s->port); in dma_tx_callback()
538 struct scatterlist *sgl = &s->tx_sgl; in mxs_auart_dma_tx()
539 struct dma_chan *channel = s->tx_dma_chan; in mxs_auart_dma_tx()
547 dev_err(s->dev, "step 1 error\n"); in mxs_auart_dma_tx()
548 return -EINVAL; in mxs_auart_dma_tx()
552 sg_init_one(sgl, s->tx_dma_buf, size); in mxs_auart_dma_tx()
553 dma_map_sg(s->dev, sgl, 1, DMA_TO_DEVICE); in mxs_auart_dma_tx()
557 dev_err(s->dev, "step 2 error\n"); in mxs_auart_dma_tx()
558 return -EINVAL; in mxs_auart_dma_tx()
562 desc->callback = dma_tx_callback; in mxs_auart_dma_tx()
563 desc->callback_param = s; in mxs_auart_dma_tx()
571 struct circ_buf *xmit = &s->port.state->xmit; in mxs_auart_tx_chars()
578 void *buffer = s->tx_dma_buf; in mxs_auart_tx_chars()
580 if (test_and_set_bit(MXS_AUART_DMA_TX_SYNC, &s->flags)) in mxs_auart_tx_chars()
583 while (!uart_circ_empty(xmit) && !uart_tx_stopped(&s->port)) { in mxs_auart_tx_chars()
584 size = min_t(u32, UART_XMIT_SIZE - i, in mxs_auart_tx_chars()
585 CIRC_CNT_TO_END(xmit->head, in mxs_auart_tx_chars()
586 xmit->tail, in mxs_auart_tx_chars()
588 memcpy(buffer + i, xmit->buf + xmit->tail, size); in mxs_auart_tx_chars()
589 xmit->tail = (xmit->tail + size) & (UART_XMIT_SIZE - 1); in mxs_auart_tx_chars()
596 if (uart_tx_stopped(&s->port)) in mxs_auart_tx_chars()
597 mxs_auart_stop_tx(&s->port); in mxs_auart_tx_chars()
602 clear_bit(MXS_AUART_DMA_TX_SYNC, &s->flags); in mxs_auart_tx_chars()
608 pending = uart_port_tx_flags(&s->port, ch, UART_TX_NOSTOP, in mxs_auart_tx_chars()
616 if (uart_tx_stopped(&s->port)) in mxs_auart_tx_chars()
617 mxs_auart_stop_tx(&s->port); in mxs_auart_tx_chars()
629 s->port.icount.rx++; in mxs_auart_rx_char()
632 s->port.icount.brk++; in mxs_auart_rx_char()
633 if (uart_handle_break(&s->port)) in mxs_auart_rx_char()
636 s->port.icount.parity++; in mxs_auart_rx_char()
638 s->port.icount.frame++; in mxs_auart_rx_char()
644 stat &= s->port.read_status_mask; in mxs_auart_rx_char()
654 s->port.icount.overrun++; in mxs_auart_rx_char()
656 if (uart_handle_sysrq_char(&s->port, c)) in mxs_auart_rx_char()
659 uart_insert_char(&s->port, stat, AUART_STAT_OERR, c, flag); in mxs_auart_rx_char()
676 tty_flip_buffer_push(&s->port.state->port); in mxs_auart_rx_chars()
687 if (u->type != PORT_UNKNOWN && u->type != PORT_IMX) in mxs_auart_verify_port()
688 return -EINVAL; in mxs_auart_verify_port()
700 return dev_name(s->dev); in mxs_auart_type()
723 mctrl_gpio_set(s->gpios, mctrl); in mxs_auart_set_mctrl()
731 mctrl_diff = mctrl ^ s->mctrl_prev; in mxs_auart_modem_status()
732 s->mctrl_prev = mctrl; in mxs_auart_modem_status()
733 if (mctrl_diff & MCTRL_ANY_DELTA && s->ms_irq_enabled && in mxs_auart_modem_status()
734 s->port.state != NULL) { in mxs_auart_modem_status()
736 s->port.icount.rng++; in mxs_auart_modem_status()
738 s->port.icount.dsr++; in mxs_auart_modem_status()
740 uart_handle_dcd_change(&s->port, mctrl & TIOCM_CD); in mxs_auart_modem_status()
742 uart_handle_cts_change(&s->port, mctrl & TIOCM_CTS); in mxs_auart_modem_status()
744 wake_up_interruptible(&s->port.state->port.delta_msr_wait); in mxs_auart_modem_status()
758 return mctrl_gpio_get(s->gpios, &mctrl); in mxs_auart_get_mctrl()
771 if (s->ms_irq_enabled) in mxs_auart_enable_ms()
774 s->ms_irq_enabled = true; in mxs_auart_enable_ms()
776 if (s->gpio_irq[UART_GPIO_CTS] >= 0) in mxs_auart_enable_ms()
777 enable_irq(s->gpio_irq[UART_GPIO_CTS]); in mxs_auart_enable_ms()
780 if (s->gpio_irq[UART_GPIO_DSR] >= 0) in mxs_auart_enable_ms()
781 enable_irq(s->gpio_irq[UART_GPIO_DSR]); in mxs_auart_enable_ms()
783 if (s->gpio_irq[UART_GPIO_RI] >= 0) in mxs_auart_enable_ms()
784 enable_irq(s->gpio_irq[UART_GPIO_RI]); in mxs_auart_enable_ms()
786 if (s->gpio_irq[UART_GPIO_DCD] >= 0) in mxs_auart_enable_ms()
787 enable_irq(s->gpio_irq[UART_GPIO_DCD]); in mxs_auart_enable_ms()
800 if (!s->ms_irq_enabled) in mxs_auart_disable_ms()
803 s->ms_irq_enabled = false; in mxs_auart_disable_ms()
805 if (s->gpio_irq[UART_GPIO_CTS] >= 0) in mxs_auart_disable_ms()
806 disable_irq(s->gpio_irq[UART_GPIO_CTS]); in mxs_auart_disable_ms()
809 if (s->gpio_irq[UART_GPIO_DSR] >= 0) in mxs_auart_disable_ms()
810 disable_irq(s->gpio_irq[UART_GPIO_DSR]); in mxs_auart_disable_ms()
812 if (s->gpio_irq[UART_GPIO_RI] >= 0) in mxs_auart_disable_ms()
813 disable_irq(s->gpio_irq[UART_GPIO_RI]); in mxs_auart_disable_ms()
815 if (s->gpio_irq[UART_GPIO_DCD] >= 0) in mxs_auart_disable_ms()
816 disable_irq(s->gpio_irq[UART_GPIO_DCD]); in mxs_auart_disable_ms()
823 struct tty_port *port = &s->port.state->port; in dma_rx_callback()
827 dma_unmap_sg(s->dev, &s->rx_sgl, 1, DMA_FROM_DEVICE); in dma_rx_callback()
834 tty_insert_flip_string(port, s->rx_dma_buf, count); in dma_rx_callback()
846 struct scatterlist *sgl = &s->rx_sgl; in mxs_auart_dma_prep_rx()
847 struct dma_chan *channel = s->rx_dma_chan; in mxs_auart_dma_prep_rx()
857 dev_err(s->dev, "step 1 error\n"); in mxs_auart_dma_prep_rx()
858 return -EINVAL; in mxs_auart_dma_prep_rx()
862 sg_init_one(sgl, s->rx_dma_buf, UART_XMIT_SIZE); in mxs_auart_dma_prep_rx()
863 dma_map_sg(s->dev, sgl, 1, DMA_FROM_DEVICE); in mxs_auart_dma_prep_rx()
867 dev_err(s->dev, "step 2 error\n"); in mxs_auart_dma_prep_rx()
868 return -1; in mxs_auart_dma_prep_rx()
872 desc->callback = dma_rx_callback; in mxs_auart_dma_prep_rx()
873 desc->callback_param = s; in mxs_auart_dma_prep_rx()
881 if (s->tx_dma_chan) { in mxs_auart_dma_exit_channel()
882 dma_release_channel(s->tx_dma_chan); in mxs_auart_dma_exit_channel()
883 s->tx_dma_chan = NULL; in mxs_auart_dma_exit_channel()
885 if (s->rx_dma_chan) { in mxs_auart_dma_exit_channel()
886 dma_release_channel(s->rx_dma_chan); in mxs_auart_dma_exit_channel()
887 s->rx_dma_chan = NULL; in mxs_auart_dma_exit_channel()
890 kfree(s->tx_dma_buf); in mxs_auart_dma_exit_channel()
891 kfree(s->rx_dma_buf); in mxs_auart_dma_exit_channel()
892 s->tx_dma_buf = NULL; in mxs_auart_dma_exit_channel()
893 s->rx_dma_buf = NULL; in mxs_auart_dma_exit_channel()
903 s->flags &= ~MXS_AUART_DMA_ENABLED; in mxs_auart_dma_exit()
904 clear_bit(MXS_AUART_DMA_TX_SYNC, &s->flags); in mxs_auart_dma_exit()
905 clear_bit(MXS_AUART_DMA_RX_READY, &s->flags); in mxs_auart_dma_exit()
914 s->rx_dma_chan = dma_request_slave_channel(s->dev, "rx"); in mxs_auart_dma_init()
915 if (!s->rx_dma_chan) in mxs_auart_dma_init()
917 s->rx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA); in mxs_auart_dma_init()
918 if (!s->rx_dma_buf) in mxs_auart_dma_init()
922 s->tx_dma_chan = dma_request_slave_channel(s->dev, "tx"); in mxs_auart_dma_init()
923 if (!s->tx_dma_chan) in mxs_auart_dma_init()
925 s->tx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA); in mxs_auart_dma_init()
926 if (!s->tx_dma_buf) in mxs_auart_dma_init()
930 s->flags |= MXS_AUART_DMA_ENABLED; in mxs_auart_dma_init()
931 dev_dbg(s->dev, "enabled the DMA support."); in mxs_auart_dma_init()
934 s->port.fifosize = UART_XMIT_SIZE; in mxs_auart_dma_init()
940 return -EINVAL; in mxs_auart_dma_init()
944 #define RTS_AT_AUART() !mctrl_gpio_to_gpiod(s->gpios, UART_GPIO_RTS)
945 #define CTS_AT_AUART() !mctrl_gpio_to_gpiod(s->gpios, UART_GPIO_CTS)
952 unsigned int cflag, baud, baud_min, baud_max; in mxs_auart_settermios() local
954 cflag = termios->c_cflag; in mxs_auart_settermios()
970 u->read_status_mask = AUART_STAT_OERR; in mxs_auart_settermios()
972 if (termios->c_iflag & INPCK) in mxs_auart_settermios()
973 u->read_status_mask |= AUART_STAT_PERR; in mxs_auart_settermios()
974 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) in mxs_auart_settermios()
975 u->read_status_mask |= AUART_STAT_BERR; in mxs_auart_settermios()
980 u->ignore_status_mask = 0; in mxs_auart_settermios()
981 if (termios->c_iflag & IGNPAR) in mxs_auart_settermios()
982 u->ignore_status_mask |= AUART_STAT_PERR; in mxs_auart_settermios()
983 if (termios->c_iflag & IGNBRK) { in mxs_auart_settermios()
984 u->ignore_status_mask |= AUART_STAT_BERR; in mxs_auart_settermios()
989 if (termios->c_iflag & IGNPAR) in mxs_auart_settermios()
990 u->ignore_status_mask |= AUART_STAT_OERR; in mxs_auart_settermios()
1015 && test_bit(MXS_AUART_RTSCTS, &s->flags)) { in mxs_auart_settermios()
1028 /* set baud rate */ in mxs_auart_settermios()
1030 baud = uart_get_baud_rate(u, termios, old, in mxs_auart_settermios()
1031 u->uartclk * 4 / 0x3FFFFF, in mxs_auart_settermios()
1032 u->uartclk / 16); in mxs_auart_settermios()
1033 div = u->uartclk * 4 / baud; in mxs_auart_settermios()
1035 baud_min = DIV_ROUND_UP(u->uartclk * 32, in mxs_auart_settermios()
1037 baud_max = u->uartclk * 32 / AUART_LINECTRL_BAUD_DIV_MIN; in mxs_auart_settermios()
1038 baud = uart_get_baud_rate(u, termios, old, baud_min, baud_max); in mxs_auart_settermios()
1039 div = DIV_ROUND_CLOSEST(u->uartclk * 32, baud); in mxs_auart_settermios()
1048 uart_update_timeout(u, termios->c_cflag, baud); in mxs_auart_settermios()
1052 !test_and_set_bit(MXS_AUART_DMA_RX_READY, &s->flags)) { in mxs_auart_settermios()
1059 dev_err(s->dev, "We can not start up the DMA.\n"); in mxs_auart_settermios()
1063 /* CTS flow-control and modem-status interrupts */ in mxs_auart_settermios()
1064 if (UART_ENABLE_MS(u, termios->c_cflag)) in mxs_auart_settermios()
1073 if (termios->c_line == N_PPS) { in mxs_auart_set_ldisc()
1074 port->flags |= UPF_HARDPPS_CD; in mxs_auart_set_ldisc()
1077 port->flags &= ~UPF_HARDPPS_CD; in mxs_auart_set_ldisc()
1085 u32 mctrl_temp = s->mctrl_prev; in mxs_auart_irq_handle()
1087 uart_port_lock(&s->port); in mxs_auart_irq_handle()
1099 if (irq == s->gpio_irq[UART_GPIO_CTS] || in mxs_auart_irq_handle()
1100 irq == s->gpio_irq[UART_GPIO_DCD] || in mxs_auart_irq_handle()
1101 irq == s->gpio_irq[UART_GPIO_DSR] || in mxs_auart_irq_handle()
1102 irq == s->gpio_irq[UART_GPIO_RI]) in mxs_auart_irq_handle()
1104 mctrl_gpio_get(s->gpios, &mctrl_temp)); in mxs_auart_irq_handle()
1107 if (CTS_AT_AUART() && s->ms_irq_enabled) in mxs_auart_irq_handle()
1108 uart_handle_cts_change(&s->port, in mxs_auart_irq_handle()
1125 uart_port_unlock(&s->port); in mxs_auart_irq_handle()
1167 dev_err(s->dev, "Failed to reset the unit."); in mxs_auart_reset_assert()
1175 ret = clk_prepare_enable(s->clk); in mxs_auart_startup()
1193 u->fifosize = MXS_AUART_FIFO_SIZE; in mxs_auart_startup()
1202 mctrl_gpio_get(s->gpios, &s->mctrl_prev); in mxs_auart_startup()
1204 s->ms_irq_enabled = false; in mxs_auart_startup()
1227 clk_disable_unprepare(s->clk); in mxs_auart_shutdown()
1304 if (!to--) in mxs_auart_console_putchar()
1320 if (co->index >= MXS_AUART_PORTS || co->index < 0) in auart_console_write()
1323 s = auart_port[co->index]; in auart_console_write()
1324 port = &s->port; in auart_console_write()
1326 clk_enable(s->clk); in auart_console_write()
1340 if (!to--) in auart_console_write()
1355 clk_disable(s->clk); in auart_console_write()
1359 auart_console_get_options(struct mxs_auart_port *s, int *baud, in auart_console_get_options() argument
1362 struct uart_port *port = &s->port; in auart_console_get_options()
1384 >> (AUART_LINECTRL_BAUD_DIVINT_SHIFT - 6); in auart_console_get_options()
1390 *baud = (port->uartclk << 2) / quot; in auart_console_get_options()
1397 int baud = 9600; in auart_console_setup() local
1408 if (co->index == -1 || co->index >= ARRAY_SIZE(auart_port)) in auart_console_setup()
1409 co->index = 0; in auart_console_setup()
1410 s = auart_port[co->index]; in auart_console_setup()
1412 return -ENODEV; in auart_console_setup()
1414 ret = clk_prepare_enable(s->clk); in auart_console_setup()
1419 uart_parse_options(options, &baud, &parity, &bits, &flow); in auart_console_setup()
1421 auart_console_get_options(s, &baud, &parity, &bits); in auart_console_setup()
1423 ret = uart_set_options(&s->port, co, baud, parity, bits, flow); in auart_console_setup()
1425 clk_disable_unprepare(s->clk); in auart_console_setup()
1436 .index = -1,
1456 s->vendor = &vendor_alphascale_asm9260; in mxs_init_regs()
1458 s->vendor = &vendor_freescale_stmp37xx; in mxs_init_regs()
1467 s->clk = devm_clk_get(&pdev->dev, NULL); in mxs_get_clks()
1468 return PTR_ERR_OR_ZERO(s->clk); in mxs_get_clks()
1471 s->clk = devm_clk_get(s->dev, "mod"); in mxs_get_clks()
1472 if (IS_ERR(s->clk)) { in mxs_get_clks()
1473 dev_err(s->dev, "Failed to get \"mod\" clk\n"); in mxs_get_clks()
1474 return PTR_ERR(s->clk); in mxs_get_clks()
1477 s->clk_ahb = devm_clk_get(s->dev, "ahb"); in mxs_get_clks()
1478 if (IS_ERR(s->clk_ahb)) { in mxs_get_clks()
1479 dev_err(s->dev, "Failed to get \"ahb\" clk\n"); in mxs_get_clks()
1480 return PTR_ERR(s->clk_ahb); in mxs_get_clks()
1483 err = clk_prepare_enable(s->clk_ahb); in mxs_get_clks()
1485 dev_err(s->dev, "Failed to enable ahb_clk!\n"); in mxs_get_clks()
1489 err = clk_set_rate(s->clk, clk_get_rate(s->clk_ahb)); in mxs_get_clks()
1491 dev_err(s->dev, "Failed to set rate!\n"); in mxs_get_clks()
1495 err = clk_prepare_enable(s->clk); in mxs_get_clks()
1497 dev_err(s->dev, "Failed to enable clk!\n"); in mxs_get_clks()
1504 clk_disable_unprepare(s->clk_ahb); in mxs_get_clks()
1513 s->gpios = mctrl_gpio_init_noauto(dev, 0); in mxs_auart_init_gpios()
1514 if (IS_ERR(s->gpios)) in mxs_auart_init_gpios()
1515 return PTR_ERR(s->gpios); in mxs_auart_init_gpios()
1519 if (test_bit(MXS_AUART_RTSCTS, &s->flags)) in mxs_auart_init_gpios()
1522 clear_bit(MXS_AUART_RTSCTS, &s->flags); in mxs_auart_init_gpios()
1526 gpiod = mctrl_gpio_to_gpiod(s->gpios, i); in mxs_auart_init_gpios()
1528 s->gpio_irq[i] = gpiod_to_irq(gpiod); in mxs_auart_init_gpios()
1530 s->gpio_irq[i] = -EINVAL; in mxs_auart_init_gpios()
1541 if (s->gpio_irq[i] >= 0) in mxs_auart_free_gpio_irq()
1542 free_irq(s->gpio_irq[i], s); in mxs_auart_free_gpio_irq()
1547 int *irq = s->gpio_irq; in mxs_auart_request_gpio_irq()
1557 IRQ_TYPE_EDGE_BOTH, dev_name(s->dev), s); in mxs_auart_request_gpio_irq()
1559 dev_err(s->dev, "%s - Can't get %d irq\n", in mxs_auart_request_gpio_irq()
1567 while (err && (i-- > 0)) in mxs_auart_request_gpio_irq()
1576 struct device_node *np = pdev->dev.of_node; in mxs_auart_probe()
1582 s = devm_kzalloc(&pdev->dev, sizeof(*s), GFP_KERNEL); in mxs_auart_probe()
1584 return -ENOMEM; in mxs_auart_probe()
1586 s->port.dev = &pdev->dev; in mxs_auart_probe()
1587 s->dev = &pdev->dev; in mxs_auart_probe()
1591 dev_err(&pdev->dev, "failed to get alias id: %d\n", ret); in mxs_auart_probe()
1594 s->port.line = ret; in mxs_auart_probe()
1596 if (of_property_read_bool(np, "uart-has-rtscts") || in mxs_auart_probe()
1597 of_property_read_bool(np, "fsl,uart-has-rtscts") /* deprecated */) in mxs_auart_probe()
1598 set_bit(MXS_AUART_RTSCTS, &s->flags); in mxs_auart_probe()
1600 if (s->port.line >= ARRAY_SIZE(auart_port)) { in mxs_auart_probe()
1601 dev_err(&pdev->dev, "serial%d out of range\n", s->port.line); in mxs_auart_probe()
1602 return -EINVAL; in mxs_auart_probe()
1605 s->devtype = (enum mxs_auart_type)of_device_get_match_data(&pdev->dev); in mxs_auart_probe()
1613 ret = -ENXIO; in mxs_auart_probe()
1617 s->port.mapbase = r->start; in mxs_auart_probe()
1618 s->port.membase = ioremap(r->start, resource_size(r)); in mxs_auart_probe()
1619 if (!s->port.membase) { in mxs_auart_probe()
1620 ret = -ENOMEM; in mxs_auart_probe()
1623 s->port.ops = &mxs_auart_ops; in mxs_auart_probe()
1624 s->port.iotype = UPIO_MEM; in mxs_auart_probe()
1625 s->port.fifosize = MXS_AUART_FIFO_SIZE; in mxs_auart_probe()
1626 s->port.uartclk = clk_get_rate(s->clk); in mxs_auart_probe()
1627 s->port.type = PORT_IMX; in mxs_auart_probe()
1628 s->port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_MXS_AUART_CONSOLE); in mxs_auart_probe()
1632 s->mctrl_prev = 0; in mxs_auart_probe()
1640 s->port.irq = irq; in mxs_auart_probe()
1641 ret = devm_request_irq(&pdev->dev, irq, mxs_auart_irq_handle, 0, in mxs_auart_probe()
1642 dev_name(&pdev->dev), s); in mxs_auart_probe()
1648 ret = mxs_auart_init_gpios(s, &pdev->dev); in mxs_auart_probe()
1650 dev_err(&pdev->dev, "Failed to initialize GPIOs.\n"); in mxs_auart_probe()
1661 auart_port[s->port.line] = s; in mxs_auart_probe()
1665 ret = uart_add_one_port(&auart_driver, &s->port); in mxs_auart_probe()
1671 dev_info(&pdev->dev, "Found APPUART ASM9260\n"); in mxs_auart_probe()
1674 dev_info(&pdev->dev, "Found APPUART %d.%d.%d\n", in mxs_auart_probe()
1683 auart_port[pdev->id] = NULL; in mxs_auart_probe()
1686 iounmap(s->port.membase); in mxs_auart_probe()
1690 clk_disable_unprepare(s->clk); in mxs_auart_probe()
1691 clk_disable_unprepare(s->clk_ahb); in mxs_auart_probe()
1700 uart_remove_one_port(&auart_driver, &s->port); in mxs_auart_remove()
1701 auart_port[pdev->id] = NULL; in mxs_auart_remove()
1703 iounmap(s->port.membase); in mxs_auart_remove()
1705 clk_disable_unprepare(s->clk); in mxs_auart_remove()
1706 clk_disable_unprepare(s->clk_ahb); in mxs_auart_remove()
1716 .name = "mxs-auart",
1750 MODULE_ALIAS("platform:mxs-auart");