Lines Matching refs:sport

160 static void linflex_put_char(struct uart_port *sport, unsigned char c)
164 writeb(c, sport->membase + BDRL);
167 while (((status = readl(sport->membase + UARTSR)) &
172 writel(status | LINFLEXD_UARTSR_DTFTFF, sport->membase + UARTSR);
175 static inline void linflex_transmit_buffer(struct uart_port *sport)
177 struct circ_buf *xmit = &sport->state->xmit;
180 linflex_put_char(sport, xmit->buf[xmit->tail]);
181 uart_xmit_advance(sport, 1);
185 uart_write_wakeup(sport);
188 linflex_stop_tx(sport);
202 struct uart_port *sport = dev_id;
203 struct circ_buf *xmit = &sport->state->xmit;
206 uart_port_lock_irqsave(sport, &flags);
208 if (sport->x_char) {
209 linflex_put_char(sport, sport->x_char);
213 if (uart_circ_empty(xmit) || uart_tx_stopped(sport)) {
214 linflex_stop_tx(sport);
218 linflex_transmit_buffer(sport);
220 uart_port_unlock_irqrestore(sport, flags);
226 struct uart_port *sport = dev_id;
228 struct tty_port *port = &sport->state->port;
233 uart_port_lock_irqsave(sport, &flags);
235 status = readl(sport->membase + UARTSR);
237 rx = readb(sport->membase + BDRM);
240 sport->icount.rx++;
245 sport->icount.overrun++;
249 sport->icount.brk++;
251 sport->icount.frame++;
254 sport->icount.parity++;
257 writel(status, sport->membase + UARTSR);
258 status = readl(sport->membase + UARTSR);
261 uart_handle_break(sport);
263 if (uart_handle_sysrq_char(sport, (unsigned char)rx))
269 uart_port_unlock_irqrestore(sport, flags);
278 struct uart_port *sport = dev_id;
281 status = readl(sport->membase + UARTSR);
314 static void linflex_setup_watermark(struct uart_port *sport)
319 ier = readl(sport->membase + LINIER);
321 writel(ier, sport->membase + LINIER);
323 cr = readl(sport->membase + UARTCR);
325 writel(cr, sport->membase + UARTCR);
332 writel(cr1, sport->membase + LINCR1);
335 while ((readl(sport->membase + LINSR)
349 writel(LINFLEXD_UARTCR_UART, sport->membase + UARTCR);
354 writel(cr, sport->membase + UARTCR);
358 writel(cr1, sport->membase + LINCR1);
360 ier = readl(sport->membase + LINIER);
364 writel(ier, sport->membase + LINIER);
622 static void linflex_string_write(struct uart_port *sport, const char *s,
627 ier = readl(sport->membase + LINIER);
628 linflex_stop_tx(sport);
630 cr = readl(sport->membase + UARTCR);
632 writel(cr, sport->membase + UARTCR);
634 uart_console_write(sport, s, count, linflex_console_putchar);
636 writel(ier, sport->membase + LINIER);
642 struct uart_port *sport = linflex_ports[co->index];
646 if (sport->sysrq)
649 locked = uart_port_trylock_irqsave(sport, &flags);
651 uart_port_lock_irqsave(sport, &flags);
653 linflex_string_write(sport, s, count);
656 uart_port_unlock_irqrestore(sport, flags);
664 linflex_console_get_options(struct uart_port *sport, int *parity, int *bits)
668 cr = readl(sport->membase + UARTCR);
694 struct uart_port *sport;
710 sport = linflex_ports[co->index];
711 if (!sport)
717 linflex_console_get_options(sport, &parity, &bits);
719 if (earlycon_port && sport->mapbase == earlycon_port->mapbase) {
733 linflex_setup_watermark(sport);
735 ret = uart_set_options(sport, co, baud, parity, bits, flow);
809 struct uart_port *sport;
813 sport = devm_kzalloc(&pdev->dev, sizeof(*sport), GFP_KERNEL);
814 if (!sport)
828 sport->line = ret;
830 sport->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
831 if (IS_ERR(sport->membase))
832 return PTR_ERR(sport->membase);
833 sport->mapbase = res->start;
839 sport->dev = &pdev->dev;
840 sport->iotype = UPIO_MEM;
841 sport->irq = ret;
842 sport->ops = &linflex_pops;
843 sport->flags = UPF_BOOT_AUTOCONF;
844 sport->has_sysrq = IS_ENABLED(CONFIG_SERIAL_FSL_LINFLEXUART_CONSOLE);
846 linflex_ports[sport->line] = sport;
848 platform_set_drvdata(pdev, sport);
850 return uart_add_one_port(&linflex_reg, sport);
855 struct uart_port *sport = platform_get_drvdata(pdev);
857 uart_remove_one_port(&linflex_reg, sport);
863 struct uart_port *sport = dev_get_drvdata(dev);
865 uart_suspend_port(&linflex_reg, sport);
872 struct uart_port *sport = dev_get_drvdata(dev);
874 uart_resume_port(&linflex_reg, sport);