Lines Matching full:uart

3  * MEN 16z135 High Speed UART
132 * @uart: The UART port
136 static inline void men_z135_reg_set(struct men_z135_port *uart, in men_z135_reg_set() argument
139 struct uart_port *port = &uart->port; in men_z135_reg_set()
143 spin_lock_irqsave(&uart->lock, flags); in men_z135_reg_set()
149 spin_unlock_irqrestore(&uart->lock, flags); in men_z135_reg_set()
154 * @uart: The UART port
158 static void men_z135_reg_clr(struct men_z135_port *uart, in men_z135_reg_clr() argument
161 struct uart_port *port = &uart->port; in men_z135_reg_clr()
165 spin_lock_irqsave(&uart->lock, flags); in men_z135_reg_clr()
171 spin_unlock_irqrestore(&uart->lock, flags); in men_z135_reg_clr()
176 * @uart: The UART port
181 static void men_z135_handle_modem_status(struct men_z135_port *uart) in men_z135_handle_modem_status() argument
185 msr = (uart->stat_reg >> 8) & 0xff; in men_z135_handle_modem_status()
188 uart_handle_dcd_change(&uart->port, in men_z135_handle_modem_status()
191 uart_handle_cts_change(&uart->port, in men_z135_handle_modem_status()
195 static void men_z135_handle_lsr(struct men_z135_port *uart) in men_z135_handle_lsr() argument
197 struct uart_port *port = &uart->port; in men_z135_handle_lsr()
200 lsr = (uart->stat_reg >> 16) & 0xff; in men_z135_handle_lsr()
216 * @uart: The UART port
220 static u16 get_rx_fifo_content(struct men_z135_port *uart) in get_rx_fifo_content() argument
222 struct uart_port *port = &uart->port; in get_rx_fifo_content()
239 * @uart: Pointer to struct men_z135_port
243 static void men_z135_handle_rx(struct men_z135_port *uart) in men_z135_handle_rx() argument
245 struct uart_port *port = &uart->port; in men_z135_handle_rx()
251 size = get_rx_fifo_content(uart); in men_z135_handle_rx()
264 dev_warn(&uart->mdev->dev, in men_z135_handle_rx()
271 memcpy_fromio(uart->rxbuf, port->membase + MEN_Z135_RX_RAM, room); in men_z135_handle_rx()
276 copied = tty_insert_flip_string(tport, uart->rxbuf, room); in men_z135_handle_rx()
278 dev_warn(&uart->mdev->dev, in men_z135_handle_rx()
290 * @uart: Pointer to struct men_z135_port
293 static void men_z135_handle_tx(struct men_z135_port *uart) in men_z135_handle_tx() argument
295 struct uart_port *port = &uart->port; in men_z135_handle_tx()
329 dev_err(&uart->mdev->dev, in men_z135_handle_tx()
366 men_z135_reg_set(uart, MEN_Z135_CONF_REG, MEN_Z135_IER_TXCIEN); in men_z135_handle_tx()
368 men_z135_reg_clr(uart, MEN_Z135_CONF_REG, MEN_Z135_IER_TXCIEN); in men_z135_handle_tx()
378 * @data: Pointer to UART port
387 struct men_z135_port *uart = (struct men_z135_port *)data; in men_z135_intr() local
388 struct uart_port *port = &uart->port; in men_z135_intr()
392 uart->stat_reg = ioread32(port->membase + MEN_Z135_STAT_REG); in men_z135_intr()
393 irq_id = IRQ_ID(uart->stat_reg); in men_z135_intr()
403 men_z135_handle_lsr(uart); in men_z135_intr()
409 dev_dbg(&uart->mdev->dev, "Character Timeout Indication\n"); in men_z135_intr()
410 men_z135_handle_rx(uart); in men_z135_intr()
415 men_z135_handle_tx(uart); in men_z135_intr()
420 men_z135_handle_modem_status(uart); in men_z135_intr()
431 * @uart: z135 private uart port structure
436 static int men_z135_request_irq(struct men_z135_port *uart) in men_z135_request_irq() argument
438 struct device *dev = &uart->mdev->dev; in men_z135_request_irq()
439 struct uart_port *port = &uart->port; in men_z135_request_irq()
443 "men_z135_intr", uart); in men_z135_request_irq()
452 * @port: The UART port
473 * @port: The UART port
516 * @port: The UART port
541 * @port: The UART port
549 struct men_z135_port *uart = to_men_z135(port); in men_z135_stop_tx() local
551 men_z135_reg_clr(uart, MEN_Z135_CONF_REG, MEN_Z135_IER_TXCIEN); in men_z135_stop_tx()
556 * port: The UART port
562 struct men_z135_port *uart = to_men_z135(port); in men_z135_disable_ms() local
564 men_z135_reg_clr(uart, MEN_Z135_CONF_REG, MEN_Z135_IER_MSIEN); in men_z135_disable_ms()
569 * @port: The UART port
576 struct men_z135_port *uart = to_men_z135(port); in men_z135_start_tx() local
578 if (uart->automode) in men_z135_start_tx()
581 men_z135_handle_tx(uart); in men_z135_start_tx()
586 * @port: The UART port
592 struct men_z135_port *uart = to_men_z135(port); in men_z135_stop_rx() local
594 men_z135_reg_clr(uart, MEN_Z135_CONF_REG, MEN_Z135_IER_RXCIEN); in men_z135_stop_rx()
605 struct men_z135_port *uart = to_men_z135(port); in men_z135_enable_ms() local
607 men_z135_reg_set(uart, MEN_Z135_CONF_REG, MEN_Z135_IER_MSIEN); in men_z135_enable_ms()
612 struct men_z135_port *uart = to_men_z135(port); in men_z135_startup() local
616 err = men_z135_request_irq(uart); in men_z135_startup()
638 struct men_z135_port *uart = to_men_z135(port); in men_z135_shutdown() local
643 men_z135_reg_clr(uart, MEN_Z135_CONF_REG, conf_reg); in men_z135_shutdown()
645 free_irq(uart->port.irq, uart); in men_z135_shutdown()
652 struct men_z135_port *uart = to_men_z135(port); in men_z135_set_termios() local
696 uart->automode = true; in men_z135_set_termios()
700 uart->automode = false; in men_z135_set_termios()
732 struct men_z135_port *uart = to_men_z135(port); in men_z135_release_port() local
737 mcb_release_mem(uart->mem); in men_z135_release_port()
742 struct men_z135_port *uart = to_men_z135(port); in men_z135_request_port() local
743 struct mcb_device *mdev = uart->mdev; in men_z135_request_port()
746 mem = mcb_request_mem(uart->mdev, dev_name(&mdev->dev)); in men_z135_request_port()
751 uart->mem = mem; in men_z135_request_port()
807 * new uart port to the tty layer.
812 struct men_z135_port *uart; in men_z135_probe() local
819 uart = devm_kzalloc(dev, sizeof(struct men_z135_port), GFP_KERNEL); in men_z135_probe()
820 if (!uart) in men_z135_probe()
823 uart->rxbuf = (unsigned char *)__get_free_page(GFP_KERNEL); in men_z135_probe()
824 if (!uart->rxbuf) in men_z135_probe()
829 mcb_set_drvdata(mdev, uart); in men_z135_probe()
831 uart->port.uartclk = MEN_Z135_BASECLK * 16; in men_z135_probe()
832 uart->port.fifosize = MEN_Z135_FIFO_SIZE; in men_z135_probe()
833 uart->port.iotype = UPIO_MEM; in men_z135_probe()
834 uart->port.ops = &men_z135_ops; in men_z135_probe()
835 uart->port.irq = mcb_get_irq(mdev); in men_z135_probe()
836 uart->port.iotype = UPIO_MEM; in men_z135_probe()
837 uart->port.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP; in men_z135_probe()
838 uart->port.line = line++; in men_z135_probe()
839 uart->port.dev = dev; in men_z135_probe()
840 uart->port.type = PORT_MEN_Z135; in men_z135_probe()
841 uart->port.mapbase = mem->start; in men_z135_probe()
842 uart->port.membase = NULL; in men_z135_probe()
843 uart->mdev = mdev; in men_z135_probe()
845 spin_lock_init(&uart->lock); in men_z135_probe()
847 err = uart_add_one_port(&men_z135_driver, &uart->port); in men_z135_probe()
854 free_page((unsigned long) uart->rxbuf); in men_z135_probe()
855 dev_err(dev, "Failed to add UART: %d\n", err); in men_z135_probe()
867 struct men_z135_port *uart = mcb_get_drvdata(mdev); in men_z135_remove() local
870 uart_remove_one_port(&men_z135_driver, &uart->port); in men_z135_remove()
871 free_page((unsigned long) uart->rxbuf); in men_z135_remove()
882 .name = "z135-uart",
902 pr_err("Failed to register UART: %d\n", err); in men_z135_init()
931 MODULE_DESCRIPTION("MEN 16z135 High Speed UART");