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