Lines Matching +full:serial +full:- +full:output
1 // SPDX-License-Identifier: GPL-2.0+
7 * This provide a test serial port. It provides an emulated serial port where
8 * a test program and read out the serial output and inject serial input for
9 * U-Boot.
18 #include <serial.h>
30 * Sandbox U-Boot.
33 * serial_buf_write == serial_buf_read -> empty buffer
34 * (serial_buf_write + 1) % 16 == serial_buf_read -> full buffer
41 int colour; /* Text colour to use for output, -1 for none */
49 * output_ansi_colour() - Output an ANSI colour code
51 * @colour: Colour to output (0-7)
58 os_write(1, ansi_code, sizeof(ansi_code) - 1); in output_ansi_colour()
71 if (state->term_raw != STATE_TERM_COOKED) in sandbox_serial_probe()
72 os_tty_raw(0, state->term_raw == STATE_TERM_RAW_WITH_SIGS); in sandbox_serial_probe()
73 priv->start_of_line = 0; in sandbox_serial_probe()
75 if (state->term_raw != STATE_TERM_RAW) in sandbox_serial_probe()
83 struct sandbox_serial_platdata *plat = dev->platdata; in sandbox_serial_remove()
85 if (plat->colour != -1) in sandbox_serial_remove()
94 struct sandbox_serial_platdata *plat = dev->platdata; in sandbox_serial_putc()
96 if (priv->start_of_line && plat->colour != -1) { in sandbox_serial_putc()
97 priv->start_of_line = false; in sandbox_serial_putc()
98 output_ansi_colour(plat->colour); in sandbox_serial_putc()
103 priv->start_of_line = true; in sandbox_serial_putc()
141 return -EAGAIN; /* buffer empty */ in sandbox_serial_getc()
171 return -EINVAL; in sandbox_serial_getconfig()
186 return -ENOTSUPP; /* not supported in driver*/ in sandbox_serial_setconfig()
204 return -EINVAL; in sandbox_serial_getinfo()
219 struct sandbox_serial_platdata *plat = dev->platdata; in sandbox_serial_ofdata_to_platdata()
223 plat->colour = -1; in sandbox_serial_ofdata_to_platdata()
224 colour = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), in sandbox_serial_ofdata_to_platdata()
225 "sandbox,text-colour", NULL); in sandbox_serial_ofdata_to_platdata()
229 plat->colour = i; in sandbox_serial_ofdata_to_platdata()
248 { .compatible = "sandbox,serial" },
266 .colour = -1,