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)
174 static void mux_tx_done(struct uart_port *port)
177 while (UART_GET_FIFO_CNT(port))
183 * @port: Ptr to the uart_port.
188 static void mux_write(struct uart_port *port)
192 uart_port_tx_limited(port, ch,
193 port->fifosize - UART_GET_FIFO_CNT(port),
195 UART_PUT_CHAR(port, ch),
196 mux_tx_done(port));
201 * @port: Ptr to the uart_port.
206 static void mux_read(struct uart_port *port)
208 struct tty_port *tport = &port->state->port;
210 __u32 start_count = port->icount.rx;
213 data = __raw_readl(port->membase + IO_DATA_REG_OFFSET);
221 port->icount.rx++;
224 port->icount.brk++;
225 if(uart_handle_break(port))
229 if (uart_handle_sysrq_char(port, data & 0xffu))
235 if (start_count != port->icount.rx)
240 * mux_startup - Initialize the port.
241 * @port: Ptr to the uart_port.
243 * Grab any resources needed for this port and start the
246 static int mux_startup(struct uart_port *port)
248 mux_ports[port->line].enabled = 1;
253 * mux_shutdown - Disable the port.
254 * @port: Ptr to the uart_port.
256 * Release any resources needed for the port.
258 static void mux_shutdown(struct uart_port *port)
260 mux_ports[port->line].enabled = 0;
264 * mux_set_termios - Chane port parameters.
265 * @port: Ptr to the uart_port.
272 mux_set_termios(struct uart_port *port, struct ktermios *termios,
278 * mux_type - Describe the port.
279 * @port: Ptr to the uart_port.
282 * specified port.
284 static const char *mux_type(struct uart_port *port)
291 * @port: Ptr to the uart_port.
294 * the port.
296 static void mux_release_port(struct uart_port *port)
302 * @port: Ptr to the uart_port.
304 * Request any memory and IO region resources required by the port.
308 static int mux_request_port(struct uart_port *port)
314 * mux_config_port - Perform port autoconfiguration.
315 * @port: Ptr to the uart_port.
318 * Perform any autoconfiguration steps for the port. This function is
319 * called if the UPF_BOOT_AUTOCONF flag is specified for the port.
324 static void mux_config_port(struct uart_port *port, int type)
326 port->type = PORT_MUX;
330 * mux_verify_port - Verify the port information.
331 * @port: Ptr to the uart_port.
334 * Verify the new serial port information contained within serinfo is
335 * suitable for this port type.
337 static int mux_verify_port(struct uart_port *port, struct serial_struct *ser)
339 if(port->membase == NULL)
359 mux_read(&mux_ports[i].port);
360 mux_write(&mux_ports[i].port);
371 while(UART_GET_FIFO_CNT(&mux_ports[0].port))
376 UART_PUT_CHAR(&mux_ports[0].port, '\r');
378 UART_PUT_CHAR(&mux_ports[0].port, *s++);
450 struct uart_port *port = &mux_ports[port_cnt].port;
451 port->iobase = 0;
452 port->mapbase = dev->hpa.start + MUX_OFFSET +
454 port->membase = ioremap(port->mapbase, MUX_LINE_OFFSET);
455 port->iotype = UPIO_MEM;
456 port->type = PORT_MUX;
457 port->irq = 0;
458 port->uartclk = 0;
459 port->fifosize = MUX_FIFO_SIZE;
460 port->ops = &mux_pops;
461 port->flags = UPF_BOOT_AUTOCONF;
462 port->line = port_cnt;
463 port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_MUX_CONSOLE);
465 spin_lock_init(&port->lock);
467 status = uart_add_one_port(&mux_driver, port);
481 if(mux_ports[i].port.mapbase == dev->hpa.start + MUX_OFFSET)
486 /* Release the resources associated with each port on the device. */
488 struct uart_port *port = &mux_ports[i].port;
490 uart_remove_one_port(&mux_driver, port);
491 if(port->membase)
492 iounmap(port->membase);
499 * the serial port detection in the proper order. The idea is we always