Lines Matching refs:uap

61 	struct uart_amba_port *uap =  in pl010_stop_tx()  local
65 cr = readb(uap->port.membase + UART010_CR); in pl010_stop_tx()
67 writel(cr, uap->port.membase + UART010_CR); in pl010_stop_tx()
72 struct uart_amba_port *uap = in pl010_start_tx() local
76 cr = readb(uap->port.membase + UART010_CR); in pl010_start_tx()
78 writel(cr, uap->port.membase + UART010_CR); in pl010_start_tx()
83 struct uart_amba_port *uap = in pl010_stop_rx() local
87 cr = readb(uap->port.membase + UART010_CR); in pl010_stop_rx()
89 writel(cr, uap->port.membase + UART010_CR); in pl010_stop_rx()
94 struct uart_amba_port *uap = (struct uart_amba_port *)port; in pl010_disable_ms() local
97 cr = readb(uap->port.membase + UART010_CR); in pl010_disable_ms()
99 writel(cr, uap->port.membase + UART010_CR); in pl010_disable_ms()
104 struct uart_amba_port *uap = in pl010_enable_ms() local
108 cr = readb(uap->port.membase + UART010_CR); in pl010_enable_ms()
110 writel(cr, uap->port.membase + UART010_CR); in pl010_enable_ms()
176 static void pl010_modem_status(struct uart_amba_port *uap) in pl010_modem_status() argument
178 struct uart_port *port = &uap->port; in pl010_modem_status()
185 delta = status ^ uap->old_status; in pl010_modem_status()
186 uap->old_status = status; in pl010_modem_status()
205 struct uart_amba_port *uap = dev_id; in pl010_int() local
206 struct uart_port *port = &uap->port; in pl010_int()
218 pl010_modem_status(uap); in pl010_int()
261 struct uart_amba_port *uap = in pl010_set_mctrl() local
264 if (uap->data) in pl010_set_mctrl()
265 uap->data->set_mctrl(uap->dev, port->membase, mctrl); in pl010_set_mctrl()
285 struct uart_amba_port *uap = in pl010_startup() local
292 retval = clk_prepare_enable(uap->clk); in pl010_startup()
296 port->uartclk = clk_get_rate(uap->clk); in pl010_startup()
301 retval = request_irq(port->irq, pl010_int, 0, "uart-pl010", uap); in pl010_startup()
308 uap->old_status = readb(port->membase + UART01x_FR) & UART01x_FR_MODEM_ANY; in pl010_startup()
319 clk_disable_unprepare(uap->clk); in pl010_startup()
326 struct uart_amba_port *uap = in pl010_shutdown() local
332 free_irq(port->irq, uap); in pl010_shutdown()
347 clk_disable_unprepare(uap->clk); in pl010_shutdown()
547 struct uart_amba_port *uap = amba_ports[co->index]; in pl010_console_write() local
548 struct uart_port *port = &uap->port; in pl010_console_write()
551 clk_enable(uap->clk); in pl010_console_write()
571 clk_disable(uap->clk); in pl010_console_write()
575 pl010_console_get_options(struct uart_amba_port *uap, int *baud, in pl010_console_get_options() argument
578 if (readb(uap->port.membase + UART010_CR) & UART01x_CR_UARTEN) { in pl010_console_get_options()
580 lcr_h = readb(uap->port.membase + UART010_LCRH); in pl010_console_get_options()
595 quot = readb(uap->port.membase + UART010_LCRL) | in pl010_console_get_options()
596 readb(uap->port.membase + UART010_LCRM) << 8; in pl010_console_get_options()
597 *baud = uap->port.uartclk / (16 * (quot + 1)); in pl010_console_get_options()
603 struct uart_amba_port *uap; in pl010_console_setup() local
617 uap = amba_ports[co->index]; in pl010_console_setup()
618 if (!uap) in pl010_console_setup()
621 ret = clk_prepare(uap->clk); in pl010_console_setup()
625 uap->port.uartclk = clk_get_rate(uap->clk); in pl010_console_setup()
630 pl010_console_get_options(uap, &baud, &parity, &bits); in pl010_console_setup()
632 return uart_set_options(&uap->port, co, baud, parity, bits, flow); in pl010_console_setup()
664 struct uart_amba_port *uap; in pl010_probe() local
675 uap = devm_kzalloc(&dev->dev, sizeof(struct uart_amba_port), in pl010_probe()
677 if (!uap) in pl010_probe()
685 uap->clk = devm_clk_get(&dev->dev, NULL); in pl010_probe()
686 if (IS_ERR(uap->clk)) in pl010_probe()
687 return PTR_ERR(uap->clk); in pl010_probe()
689 uap->port.dev = &dev->dev; in pl010_probe()
690 uap->port.mapbase = dev->res.start; in pl010_probe()
691 uap->port.membase = base; in pl010_probe()
692 uap->port.iotype = UPIO_MEM; in pl010_probe()
693 uap->port.irq = dev->irq[0]; in pl010_probe()
694 uap->port.fifosize = 16; in pl010_probe()
695 uap->port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_AMBA_PL010_CONSOLE); in pl010_probe()
696 uap->port.ops = &amba_pl010_pops; in pl010_probe()
697 uap->port.flags = UPF_BOOT_AUTOCONF; in pl010_probe()
698 uap->port.line = i; in pl010_probe()
699 uap->dev = dev; in pl010_probe()
700 uap->data = dev_get_platdata(&dev->dev); in pl010_probe()
702 amba_ports[i] = uap; in pl010_probe()
704 amba_set_drvdata(dev, uap); in pl010_probe()
711 dev_err(uap->port.dev, in pl010_probe()
718 ret = uart_add_one_port(&amba_reg, &uap->port); in pl010_probe()
727 struct uart_amba_port *uap = amba_get_drvdata(dev); in pl010_remove() local
731 uart_remove_one_port(&amba_reg, &uap->port); in pl010_remove()
734 if (amba_ports[i] == uap) in pl010_remove()
746 struct uart_amba_port *uap = dev_get_drvdata(dev); in pl010_suspend() local
748 if (uap) in pl010_suspend()
749 uart_suspend_port(&amba_reg, &uap->port); in pl010_suspend()
756 struct uart_amba_port *uap = dev_get_drvdata(dev); in pl010_resume() local
758 if (uap) in pl010_resume()
759 uart_resume_port(&amba_reg, &uap->port); in pl010_resume()