Lines Matching +full:rx +full:- +full:input
1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2011-2015 Vladimir Zapolskiy <vz@mleia.com>
21 struct hsuart_regs *hsuart = priv->hsuart; in lpc32xx_serial_setbrg()
25 div = (get_serial_clock() / 14 + baudrate / 2) / baudrate - 1; in lpc32xx_serial_setbrg()
29 writel(div, &hsuart->rate); in lpc32xx_serial_setbrg()
37 struct hsuart_regs *hsuart = priv->hsuart; in lpc32xx_serial_getc()
39 if (!(readl(&hsuart->level) & HSUART_LEVEL_RX)) in lpc32xx_serial_getc()
40 return -EAGAIN; in lpc32xx_serial_getc()
42 return readl(&hsuart->rx) & HSUART_RX_DATA; in lpc32xx_serial_getc()
48 struct hsuart_regs *hsuart = priv->hsuart; in lpc32xx_serial_putc()
51 if (readl(&hsuart->level) & HSUART_LEVEL_TX) in lpc32xx_serial_putc()
52 return -EAGAIN; in lpc32xx_serial_putc()
54 writel(c, &hsuart->tx); in lpc32xx_serial_putc()
59 static int lpc32xx_serial_pending(struct udevice *dev, bool input) in lpc32xx_serial_pending() argument
62 struct hsuart_regs *hsuart = priv->hsuart; in lpc32xx_serial_pending()
64 if (input) { in lpc32xx_serial_pending()
65 if (readl(&hsuart->level) & HSUART_LEVEL_RX) in lpc32xx_serial_pending()
68 if (readl(&hsuart->level) & HSUART_LEVEL_TX) in lpc32xx_serial_pending()
77 /* Disable hardware RTS and CTS flow control, set up RX and TX FIFO */ in lpc32xx_serial_init()
80 &hsuart->ctrl); in lpc32xx_serial_init()
90 priv->hsuart = (struct hsuart_regs *)platdata->base; in lpc32xx_hsuart_probe()
92 lpc32xx_serial_init(priv->hsuart); in lpc32xx_hsuart_probe()