Lines Matching +full:dsr +full:- +full:override
1 // SPDX-License-Identifier: GPL-2.0+
4 ** serial driver for the Mux console found in some PA-RISC servers.
7 ** (c) Copyright 2002 Hewlett-Packard Company
26 #include <asm/parisc-device.h>
63 #define UART_PUT_CHAR(p, c) __raw_writel((c), (p)->membase + IO_DATA_REG_OFFSET)
64 #define UART_GET_FIFO_CNT(p) __raw_readl((p)->membase + IO_DCOUNT_REG_OFFSET)
67 * get_mux_port_count - Get the number of available ports on the Mux.
73 * are connected. This function can override the IODC and
82 /* If this is the built-in Mux for the K-Class (Eole CAP/MUX), in get_mux_port_count()
86 if(dev->id.hversion == 0x15) in get_mux_port_count()
89 status = pdc_iodc_read(&bytecnt, dev->hpa.start, 0, iodc_data, 32); in get_mux_port_count()
97 * mux_tx_empty - Check if the transmitter fifo is empty.
110 * mux_set_mctrl - Set the current state of the modem control inputs.
114 * The Serial MUX does not support CTS, DCD or DSR so this function
122 * mux_get_mctrl - Returns the current state of modem control inputs.
125 * The Serial MUX does not support CTS, DCD or DSR so these lines are
134 * mux_stop_tx - Stop transmitting characters.
144 * mux_start_tx - Start transmitting characters.
154 * mux_stop_rx - Stop receiving characters.
164 * mux_break_ctl - Control the transmitssion of a break signal.
175 * mux_write - Write chars to the mux fifo.
184 struct circ_buf *xmit = &port->state->xmit; in mux_write()
186 if(port->x_char) { in mux_write()
187 UART_PUT_CHAR(port, port->x_char); in mux_write()
188 port->icount.tx++; in mux_write()
189 port->x_char = 0; in mux_write()
198 count = (port->fifosize) - UART_GET_FIFO_CNT(port); in mux_write()
200 UART_PUT_CHAR(port, xmit->buf[xmit->tail]); in mux_write()
201 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); in mux_write()
202 port->icount.tx++; in mux_write()
206 } while(--count > 0); in mux_write()
219 * mux_read - Read chars from the mux fifo.
227 struct tty_port *tport = &port->state->port; in mux_read()
229 __u32 start_count = port->icount.rx; in mux_read()
232 data = __raw_readl(port->membase + IO_DATA_REG_OFFSET); in mux_read()
240 port->icount.rx++; in mux_read()
243 port->icount.brk++; in mux_read()
254 if (start_count != port->icount.rx) in mux_read()
259 * mux_startup - Initialize the port.
267 mux_ports[port->line].enabled = 1; in mux_startup()
272 * mux_shutdown - Disable the port.
279 mux_ports[port->line].enabled = 0; in mux_shutdown()
283 * mux_set_termios - Chane port parameters.
297 * mux_type - Describe the port.
309 * mux_release_port - Release memory and IO regions.
320 * mux_request_port - Request memory and IO regions.
325 * returns, and it should return -EBUSY on failure.
333 * mux_config_port - Perform port autoconfiguration.
345 port->type = PORT_MUX; in mux_config_port()
349 * mux_verify_port - Verify the port information.
358 if(port->membase == NULL) in mux_verify_port()
359 return -EINVAL; in mux_verify_port()
365 * mux_drv_poll - Mux poll function.
393 while(count--) { in mux_console_write()
441 * mux_probe - Determine if the Serial Mux should claim this device.
454 dev_set_drvdata(&dev->dev, (void *)(long)port_count); in mux_probe()
455 request_mem_region(dev->hpa.start + MUX_OFFSET, in mux_probe()
470 port->iobase = 0; in mux_probe()
471 port->mapbase = dev->hpa.start + MUX_OFFSET + in mux_probe()
473 port->membase = ioremap(port->mapbase, MUX_LINE_OFFSET); in mux_probe()
474 port->iotype = UPIO_MEM; in mux_probe()
475 port->type = PORT_MUX; in mux_probe()
476 port->irq = 0; in mux_probe()
477 port->uartclk = 0; in mux_probe()
478 port->fifosize = MUX_FIFO_SIZE; in mux_probe()
479 port->ops = &mux_pops; in mux_probe()
480 port->flags = UPF_BOOT_AUTOCONF; in mux_probe()
481 port->line = port_cnt; in mux_probe()
482 port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_MUX_CONSOLE); in mux_probe()
484 spin_lock_init(&port->lock); in mux_probe()
496 int port_count = (long)dev_get_drvdata(&dev->dev); in mux_remove()
500 if(mux_ports[i].port.mapbase == dev->hpa.start + MUX_OFFSET) in mux_remove()
510 if(port->membase) in mux_remove()
511 iounmap(port->membase); in mux_remove()
514 release_mem_region(dev->hpa.start + MUX_OFFSET, port_count * MUX_LINE_OFFSET); in mux_remove()
526 { HPHW_A_DIRECT, HVERSION_REV_ANY_ID, 0x15, 0x0000D }, /* All K-class */
554 * mux_init - Serial MUX initialization procedure.
577 * mux_exit - Serial MUX cleanup procedure.