Lines Matching +full:- +full:uart
1 // SPDX-License-Identifier: GPL-2.0+
3 * drivers/tty/serial/8250/8250_pxa.c -- driver for PXA on-board UARTS
37 serial8250_suspend_port(data->line); in serial_pxa_suspend()
46 serial8250_resume_port(data->line); in serial_pxa_resume()
56 { .compatible = "mrvl,pxa-uart", },
57 { .compatible = "mrvl,mmp-uart", },
62 /* Uart divisor latch write */
82 struct pxa8250_data *data = port->private_data; in serial_pxa_pm()
85 clk_prepare_enable(data->clk); in serial_pxa_pm()
87 clk_disable_unprepare(data->clk); in serial_pxa_pm()
92 struct uart_8250_port uart = {}; in serial_pxa_probe() local
103 return -ENODEV; in serial_pxa_probe()
105 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); in serial_pxa_probe()
107 return -ENOMEM; in serial_pxa_probe()
109 data->clk = devm_clk_get(&pdev->dev, NULL); in serial_pxa_probe()
110 if (IS_ERR(data->clk)) in serial_pxa_probe()
111 return PTR_ERR(data->clk); in serial_pxa_probe()
113 ret = clk_prepare(data->clk); in serial_pxa_probe()
117 ret = of_alias_get_id(pdev->dev.of_node, "serial"); in serial_pxa_probe()
119 uart.port.line = ret; in serial_pxa_probe()
121 uart.port.type = PORT_XSCALE; in serial_pxa_probe()
122 uart.port.iotype = UPIO_MEM32; in serial_pxa_probe()
123 uart.port.mapbase = mmres->start; in serial_pxa_probe()
124 uart.port.regshift = 2; in serial_pxa_probe()
125 uart.port.irq = irq; in serial_pxa_probe()
126 uart.port.fifosize = 64; in serial_pxa_probe()
127 uart.port.flags = UPF_IOREMAP | UPF_SKIP_TEST | UPF_FIXED_TYPE; in serial_pxa_probe()
128 uart.port.dev = &pdev->dev; in serial_pxa_probe()
129 uart.port.uartclk = clk_get_rate(data->clk); in serial_pxa_probe()
130 uart.port.pm = serial_pxa_pm; in serial_pxa_probe()
131 uart.port.private_data = data; in serial_pxa_probe()
132 uart.dl_write = serial_pxa_dl_write; in serial_pxa_probe()
134 ret = serial8250_register_8250_port(&uart); in serial_pxa_probe()
138 data->line = ret; in serial_pxa_probe()
145 clk_unprepare(data->clk); in serial_pxa_probe()
153 serial8250_unregister_port(data->line); in serial_pxa_remove()
155 clk_unprepare(data->clk); in serial_pxa_remove()
163 .name = "pxa2xx-uart",
175 struct uart_port *port = &device->port; in early_serial_pxa_setup()
177 if (!(device->port.membase || device->port.iobase)) in early_serial_pxa_setup()
178 return -ENODEV; in early_serial_pxa_setup()
180 port->regshift = 2; in early_serial_pxa_setup()
183 OF_EARLYCON_DECLARE(early_pxa, "mrvl,pxa-uart", early_serial_pxa_setup);
184 OF_EARLYCON_DECLARE(mmp, "mrvl,mmp-uart", early_serial_pxa_setup);
189 MODULE_ALIAS("platform:pxa2xx-uart");