Lines Matching refs:sport
160 static inline void linflex_transmit_buffer(struct uart_port *sport) in linflex_transmit_buffer() argument
162 struct circ_buf *xmit = &sport->state->xmit; in linflex_transmit_buffer()
168 writeb(c, sport->membase + BDRL); in linflex_transmit_buffer()
171 while (((status = readl(sport->membase + UARTSR)) & in linflex_transmit_buffer()
177 sport->icount.tx++; in linflex_transmit_buffer()
180 sport->membase + UARTSR); in linflex_transmit_buffer()
184 uart_write_wakeup(sport); in linflex_transmit_buffer()
187 linflex_stop_tx(sport); in linflex_transmit_buffer()
201 struct uart_port *sport = dev_id; in linflex_txint() local
202 struct circ_buf *xmit = &sport->state->xmit; in linflex_txint()
206 spin_lock_irqsave(&sport->lock, flags); in linflex_txint()
208 if (sport->x_char) { in linflex_txint()
209 writeb(sport->x_char, sport->membase + BDRL); in linflex_txint()
212 while (((status = readl(sport->membase + UARTSR)) & in linflex_txint()
217 sport->membase + UARTSR); in linflex_txint()
222 if (uart_circ_empty(xmit) || uart_tx_stopped(sport)) { in linflex_txint()
223 linflex_stop_tx(sport); in linflex_txint()
227 linflex_transmit_buffer(sport); in linflex_txint()
230 uart_write_wakeup(sport); in linflex_txint()
233 spin_unlock_irqrestore(&sport->lock, flags); in linflex_txint()
239 struct uart_port *sport = dev_id; in linflex_rxint() local
241 struct tty_port *port = &sport->state->port; in linflex_rxint()
246 spin_lock_irqsave(&sport->lock, flags); in linflex_rxint()
248 status = readl(sport->membase + UARTSR); in linflex_rxint()
250 rx = readb(sport->membase + BDRM); in linflex_rxint()
253 sport->icount.rx++; in linflex_rxint()
271 sport->membase + UARTSR); in linflex_rxint()
272 status = readl(sport->membase + UARTSR); in linflex_rxint()
275 uart_handle_break(sport); in linflex_rxint()
277 if (uart_handle_sysrq_char(sport, (unsigned char)rx)) in linflex_rxint()
283 spin_unlock_irqrestore(&sport->lock, flags); in linflex_rxint()
292 struct uart_port *sport = dev_id; in linflex_int() local
295 status = readl(sport->membase + UARTSR); in linflex_int()
328 static void linflex_setup_watermark(struct uart_port *sport) in linflex_setup_watermark() argument
333 ier = readl(sport->membase + LINIER); in linflex_setup_watermark()
335 writel(ier, sport->membase + LINIER); in linflex_setup_watermark()
337 cr = readl(sport->membase + UARTCR); in linflex_setup_watermark()
339 writel(cr, sport->membase + UARTCR); in linflex_setup_watermark()
346 writel(cr1, sport->membase + LINCR1); in linflex_setup_watermark()
349 while ((readl(sport->membase + LINSR) in linflex_setup_watermark()
363 writel(LINFLEXD_UARTCR_UART, sport->membase + UARTCR); in linflex_setup_watermark()
368 writel(cr, sport->membase + UARTCR); in linflex_setup_watermark()
372 writel(cr1, sport->membase + LINCR1); in linflex_setup_watermark()
374 ier = readl(sport->membase + LINIER); in linflex_setup_watermark()
378 writel(ier, sport->membase + LINIER); in linflex_setup_watermark()
636 static void linflex_string_write(struct uart_port *sport, const char *s, in linflex_string_write() argument
641 ier = readl(sport->membase + LINIER); in linflex_string_write()
642 linflex_stop_tx(sport); in linflex_string_write()
644 cr = readl(sport->membase + UARTCR); in linflex_string_write()
646 writel(cr, sport->membase + UARTCR); in linflex_string_write()
648 uart_console_write(sport, s, count, linflex_console_putchar); in linflex_string_write()
650 writel(ier, sport->membase + LINIER); in linflex_string_write()
656 struct uart_port *sport = linflex_ports[co->index]; in linflex_console_write() local
660 if (sport->sysrq) in linflex_console_write()
663 locked = spin_trylock_irqsave(&sport->lock, flags); in linflex_console_write()
665 spin_lock_irqsave(&sport->lock, flags); in linflex_console_write()
667 linflex_string_write(sport, s, count); in linflex_console_write()
670 spin_unlock_irqrestore(&sport->lock, flags); in linflex_console_write()
678 linflex_console_get_options(struct uart_port *sport, int *parity, int *bits) in linflex_console_get_options() argument
682 cr = readl(sport->membase + UARTCR); in linflex_console_get_options()
708 struct uart_port *sport; in linflex_console_setup() local
724 sport = linflex_ports[co->index]; in linflex_console_setup()
725 if (!sport) in linflex_console_setup()
731 linflex_console_get_options(sport, &parity, &bits); in linflex_console_setup()
733 if (earlycon_port && sport->mapbase == earlycon_port->mapbase) { in linflex_console_setup()
747 linflex_setup_watermark(sport); in linflex_console_setup()
749 ret = uart_set_options(sport, co, baud, parity, bits, flow); in linflex_console_setup()
823 struct uart_port *sport; in linflex_probe() local
827 sport = devm_kzalloc(&pdev->dev, sizeof(*sport), GFP_KERNEL); in linflex_probe()
828 if (!sport) in linflex_probe()
842 sport->line = ret; in linflex_probe()
848 sport->mapbase = res->start; in linflex_probe()
849 sport->membase = devm_ioremap_resource(&pdev->dev, res); in linflex_probe()
850 if (IS_ERR(sport->membase)) in linflex_probe()
851 return PTR_ERR(sport->membase); in linflex_probe()
853 sport->dev = &pdev->dev; in linflex_probe()
854 sport->type = PORT_LINFLEXUART; in linflex_probe()
855 sport->iotype = UPIO_MEM; in linflex_probe()
856 sport->irq = platform_get_irq(pdev, 0); in linflex_probe()
857 sport->ops = &linflex_pops; in linflex_probe()
858 sport->flags = UPF_BOOT_AUTOCONF; in linflex_probe()
859 sport->has_sysrq = IS_ENABLED(CONFIG_SERIAL_FSL_LINFLEXUART_CONSOLE); in linflex_probe()
861 linflex_ports[sport->line] = sport; in linflex_probe()
863 platform_set_drvdata(pdev, sport); in linflex_probe()
865 ret = uart_add_one_port(&linflex_reg, sport); in linflex_probe()
874 struct uart_port *sport = platform_get_drvdata(pdev); in linflex_remove() local
876 uart_remove_one_port(&linflex_reg, sport); in linflex_remove()
884 struct uart_port *sport = dev_get_drvdata(dev); in linflex_suspend() local
886 uart_suspend_port(&linflex_reg, sport); in linflex_suspend()
893 struct uart_port *sport = dev_get_drvdata(dev); in linflex_resume() local
895 uart_resume_port(&linflex_reg, sport); in linflex_resume()