Lines Matching refs:port

9 ** This Driver currently only supports the console (port 0) on the MUX.
47 struct uart_port port;
74 * return the true port count.
83 * we only need to allocate resources for 1 port since the
98 * @port: Ptr to the uart_port.
100 * This function test if the transmitter fifo for the port
101 * described by 'port' is empty. If it is empty, this function
104 static unsigned int mux_tx_empty(struct uart_port *port)
106 return UART_GET_FIFO_CNT(port) ? 0 : TIOCSER_TEMT;
117 static void mux_set_mctrl(struct uart_port *port, unsigned int mctrl)
123 * @port: Ptr to the uart_port.
128 static unsigned int mux_get_mctrl(struct uart_port *port)
135 * @port: Ptr to the uart_port.
139 static void mux_stop_tx(struct uart_port *port)
145 * @port: Ptr to the uart_port.
149 static void mux_start_tx(struct uart_port *port)
155 * @port: Ptr to the uart_port.
159 static void mux_stop_rx(struct uart_port *port)
165 * @port: Ptr to the uart_port.
170 static void mux_break_ctl(struct uart_port *port, int break_state)
176 * @port: Ptr to the uart_port.
181 static void mux_write(struct uart_port *port)
184 struct circ_buf *xmit = &port->state->xmit;
186 if(port->x_char) {
187 UART_PUT_CHAR(port, port->x_char);
188 port->icount.tx++;
189 port->x_char = 0;
193 if(uart_circ_empty(xmit) || uart_tx_stopped(port)) {
194 mux_stop_tx(port);
198 count = (port->fifosize) - UART_GET_FIFO_CNT(port);
200 UART_PUT_CHAR(port, xmit->buf[xmit->tail]);
202 port->icount.tx++;
208 while(UART_GET_FIFO_CNT(port))
212 uart_write_wakeup(port);
215 mux_stop_tx(port);
220 * @port: Ptr to the uart_port.
225 static void mux_read(struct uart_port *port)
227 struct tty_port *tport = &port->state->port;
229 __u32 start_count = port->icount.rx;
232 data = __raw_readl(port->membase + IO_DATA_REG_OFFSET);
240 port->icount.rx++;
243 port->icount.brk++;
244 if(uart_handle_break(port))
248 if (uart_handle_sysrq_char(port, data & 0xffu))
254 if (start_count != port->icount.rx)
259 * mux_startup - Initialize the port.
260 * @port: Ptr to the uart_port.
262 * Grab any resources needed for this port and start the
265 static int mux_startup(struct uart_port *port)
267 mux_ports[port->line].enabled = 1;
272 * mux_shutdown - Disable the port.
273 * @port: Ptr to the uart_port.
275 * Release any resources needed for the port.
277 static void mux_shutdown(struct uart_port *port)
279 mux_ports[port->line].enabled = 0;
283 * mux_set_termios - Chane port parameters.
284 * @port: Ptr to the uart_port.
291 mux_set_termios(struct uart_port *port, struct ktermios *termios,
297 * mux_type - Describe the port.
298 * @port: Ptr to the uart_port.
301 * specified port.
303 static const char *mux_type(struct uart_port *port)
310 * @port: Ptr to the uart_port.
313 * the port.
315 static void mux_release_port(struct uart_port *port)
321 * @port: Ptr to the uart_port.
323 * Request any memory and IO region resources required by the port.
327 static int mux_request_port(struct uart_port *port)
333 * mux_config_port - Perform port autoconfiguration.
334 * @port: Ptr to the uart_port.
337 * Perform any autoconfiguration steps for the port. This function is
338 * called if the UPF_BOOT_AUTOCONF flag is specified for the port.
343 static void mux_config_port(struct uart_port *port, int type)
345 port->type = PORT_MUX;
349 * mux_verify_port - Verify the port information.
350 * @port: Ptr to the uart_port.
353 * Verify the new serial port information contained within serinfo is
354 * suitable for this port type.
356 static int mux_verify_port(struct uart_port *port, struct serial_struct *ser)
358 if(port->membase == NULL)
378 mux_read(&mux_ports[i].port);
379 mux_write(&mux_ports[i].port);
390 while(UART_GET_FIFO_CNT(&mux_ports[0].port))
395 UART_PUT_CHAR(&mux_ports[0].port, '\r');
397 UART_PUT_CHAR(&mux_ports[0].port, *s++);
469 struct uart_port *port = &mux_ports[port_cnt].port;
470 port->iobase = 0;
471 port->mapbase = dev->hpa.start + MUX_OFFSET +
473 port->membase = ioremap(port->mapbase, MUX_LINE_OFFSET);
474 port->iotype = UPIO_MEM;
475 port->type = PORT_MUX;
476 port->irq = 0;
477 port->uartclk = 0;
478 port->fifosize = MUX_FIFO_SIZE;
479 port->ops = &mux_pops;
480 port->flags = UPF_BOOT_AUTOCONF;
481 port->line = port_cnt;
482 port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_MUX_CONSOLE);
484 /* The port->timeout needs to match what is present in
489 port->timeout = HZ / 50;
490 spin_lock_init(&port->lock);
492 status = uart_add_one_port(&mux_driver, port);
506 if(mux_ports[i].port.mapbase == dev->hpa.start + MUX_OFFSET)
511 /* Release the resources associated with each port on the device. */
513 struct uart_port *port = &mux_ports[i].port;
515 uart_remove_one_port(&mux_driver, port);
516 if(port->membase)
517 iounmap(port->membase);
525 * the serial port detection in the proper order. The idea is we always