Lines Matching refs:uart

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()
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()
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()
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()
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()
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()
326 dev_err(&uart->mdev->dev, in men_z135_handle_tx()
357 men_z135_reg_set(uart, MEN_Z135_CONF_REG, MEN_Z135_IER_TXCIEN); in men_z135_handle_tx()
359 men_z135_reg_clr(uart, MEN_Z135_CONF_REG, MEN_Z135_IER_TXCIEN); in men_z135_handle_tx()
378 struct men_z135_port *uart = (struct men_z135_port *)data; in men_z135_intr() local
379 struct uart_port *port = &uart->port; in men_z135_intr()
383 uart->stat_reg = ioread32(port->membase + MEN_Z135_STAT_REG); in men_z135_intr()
384 irq_id = IRQ_ID(uart->stat_reg); in men_z135_intr()
394 men_z135_handle_lsr(uart); in men_z135_intr()
400 dev_dbg(&uart->mdev->dev, "Character Timeout Indication\n"); in men_z135_intr()
401 men_z135_handle_rx(uart); in men_z135_intr()
406 men_z135_handle_tx(uart); in men_z135_intr()
411 men_z135_handle_modem_status(uart); in men_z135_intr()
427 static int men_z135_request_irq(struct men_z135_port *uart) in men_z135_request_irq() argument
429 struct device *dev = &uart->mdev->dev; in men_z135_request_irq()
430 struct uart_port *port = &uart->port; in men_z135_request_irq()
434 "men_z135_intr", uart); in men_z135_request_irq()
540 struct men_z135_port *uart = to_men_z135(port); in men_z135_stop_tx() local
542 men_z135_reg_clr(uart, MEN_Z135_CONF_REG, MEN_Z135_IER_TXCIEN); in men_z135_stop_tx()
553 struct men_z135_port *uart = to_men_z135(port); in men_z135_disable_ms() local
555 men_z135_reg_clr(uart, MEN_Z135_CONF_REG, MEN_Z135_IER_MSIEN); in men_z135_disable_ms()
567 struct men_z135_port *uart = to_men_z135(port); in men_z135_start_tx() local
569 if (uart->automode) in men_z135_start_tx()
572 men_z135_handle_tx(uart); in men_z135_start_tx()
583 struct men_z135_port *uart = to_men_z135(port); in men_z135_stop_rx() local
585 men_z135_reg_clr(uart, MEN_Z135_CONF_REG, MEN_Z135_IER_RXCIEN); in men_z135_stop_rx()
596 struct men_z135_port *uart = to_men_z135(port); in men_z135_enable_ms() local
598 men_z135_reg_set(uart, MEN_Z135_CONF_REG, MEN_Z135_IER_MSIEN); in men_z135_enable_ms()
603 struct men_z135_port *uart = to_men_z135(port); in men_z135_startup() local
607 err = men_z135_request_irq(uart); in men_z135_startup()
629 struct men_z135_port *uart = to_men_z135(port); in men_z135_shutdown() local
634 men_z135_reg_clr(uart, MEN_Z135_CONF_REG, conf_reg); in men_z135_shutdown()
636 free_irq(uart->port.irq, uart); in men_z135_shutdown()
643 struct men_z135_port *uart = to_men_z135(port); in men_z135_set_termios() local
687 uart->automode = true; in men_z135_set_termios()
691 uart->automode = false; in men_z135_set_termios()
723 struct men_z135_port *uart = to_men_z135(port); in men_z135_release_port() local
728 mcb_release_mem(uart->mem); in men_z135_release_port()
733 struct men_z135_port *uart = to_men_z135(port); in men_z135_request_port() local
734 struct mcb_device *mdev = uart->mdev; in men_z135_request_port()
737 mem = mcb_request_mem(uart->mdev, dev_name(&mdev->dev)); in men_z135_request_port()
742 uart->mem = mem; in men_z135_request_port()
803 struct men_z135_port *uart; in men_z135_probe() local
810 uart = devm_kzalloc(dev, sizeof(struct men_z135_port), GFP_KERNEL); in men_z135_probe()
811 if (!uart) in men_z135_probe()
814 uart->rxbuf = (unsigned char *)__get_free_page(GFP_KERNEL); in men_z135_probe()
815 if (!uart->rxbuf) in men_z135_probe()
820 mcb_set_drvdata(mdev, uart); in men_z135_probe()
822 uart->port.uartclk = MEN_Z135_BASECLK * 16; in men_z135_probe()
823 uart->port.fifosize = MEN_Z135_FIFO_SIZE; in men_z135_probe()
824 uart->port.iotype = UPIO_MEM; in men_z135_probe()
825 uart->port.ops = &men_z135_ops; in men_z135_probe()
826 uart->port.irq = mcb_get_irq(mdev); in men_z135_probe()
827 uart->port.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP; in men_z135_probe()
828 uart->port.line = line++; in men_z135_probe()
829 uart->port.dev = dev; in men_z135_probe()
830 uart->port.type = PORT_MEN_Z135; in men_z135_probe()
831 uart->port.mapbase = mem->start; in men_z135_probe()
832 uart->port.membase = NULL; in men_z135_probe()
833 uart->mdev = mdev; in men_z135_probe()
835 spin_lock_init(&uart->lock); in men_z135_probe()
837 err = uart_add_one_port(&men_z135_driver, &uart->port); in men_z135_probe()
844 free_page((unsigned long) uart->rxbuf); in men_z135_probe()
857 struct men_z135_port *uart = mcb_get_drvdata(mdev); in men_z135_remove() local
860 uart_remove_one_port(&men_z135_driver, &uart->port); in men_z135_remove()
861 free_page((unsigned long) uart->rxbuf); in men_z135_remove()