Lines Matching +full:dcd +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>
67 #define UART_PUT_CHAR(p, c) __raw_writel((c), (p)->membase + IO_DATA_REG_OFFSET)
68 #define UART_GET_FIFO_CNT(p) __raw_readl((p)->membase + IO_DCOUNT_REG_OFFSET)
71 * get_mux_port_count - Get the number of available ports on the Mux.
77 * are connected. This function can override the IODC and
86 /* If this is the built-in Mux for the K-Class (Eole CAP/MUX), in get_mux_port_count()
90 if(dev->id.hversion == 0x15) in get_mux_port_count()
93 status = pdc_iodc_read(&bytecnt, dev->hpa.start, 0, iodc_data, 32); in get_mux_port_count()
101 * mux_tx_empty - Check if the transmitter fifo is empty.
114 * mux_set_mctrl - Set the current state of the modem control inputs.
118 * The Serial MUX does not support CTS, DCD or DSR so this function
126 * mux_get_mctrl - Returns the current state of modem control inputs.
129 * The Serial MUX does not support CTS, DCD or DSR so these lines are
138 * mux_stop_tx - Stop transmitting characters.
148 * mux_start_tx - Start transmitting characters.
158 * mux_stop_rx - Stop receiving characters.
168 * mux_break_ctl - Control the transmitssion of a break signal.
179 * mux_write - Write chars to the mux fifo.
188 struct circ_buf *xmit = &port->state->xmit; in mux_write()
190 if(port->x_char) { in mux_write()
191 UART_PUT_CHAR(port, port->x_char); in mux_write()
192 port->icount.tx++; in mux_write()
193 port->x_char = 0; in mux_write()
202 count = (port->fifosize) - UART_GET_FIFO_CNT(port); in mux_write()
204 UART_PUT_CHAR(port, xmit->buf[xmit->tail]); in mux_write()
205 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); in mux_write()
206 port->icount.tx++; in mux_write()
210 } while(--count > 0); in mux_write()
223 * mux_read - Read chars from the mux fifo.
231 struct tty_port *tport = &port->state->port; in mux_read()
233 __u32 start_count = port->icount.rx; in mux_read()
236 data = __raw_readl(port->membase + IO_DATA_REG_OFFSET); in mux_read()
244 port->icount.rx++; in mux_read()
247 port->icount.brk++; in mux_read()
258 if (start_count != port->icount.rx) in mux_read()
263 * mux_startup - Initialize the port.
271 mux_ports[port->line].enabled = 1; in mux_startup()
276 * mux_shutdown - Disable the port.
283 mux_ports[port->line].enabled = 0; in mux_shutdown()
287 * mux_set_termios - Chane port parameters.
301 * mux_type - Describe the port.
313 * mux_release_port - Release memory and IO regions.
324 * mux_request_port - Request memory and IO regions.
329 * returns, and it should return -EBUSY on failure.
337 * mux_config_port - Perform port autoconfiguration.
349 port->type = PORT_MUX; in mux_config_port()
353 * mux_verify_port - Verify the port information.
362 if(port->membase == NULL) in mux_verify_port()
363 return -EINVAL; in mux_verify_port()
369 * mux_drv_poll - Mux poll function.
397 while(count--) { in mux_console_write()
445 * mux_probe - Determine if the Serial Mux should claim this device.
458 dev_set_drvdata(&dev->dev, (void *)(long)port_count); in mux_probe()
459 request_mem_region(dev->hpa.start + MUX_OFFSET, in mux_probe()
474 port->iobase = 0; in mux_probe()
475 port->mapbase = dev->hpa.start + MUX_OFFSET + in mux_probe()
477 port->membase = ioremap_nocache(port->mapbase, MUX_LINE_OFFSET); in mux_probe()
478 port->iotype = UPIO_MEM; in mux_probe()
479 port->type = PORT_MUX; in mux_probe()
480 port->irq = 0; in mux_probe()
481 port->uartclk = 0; in mux_probe()
482 port->fifosize = MUX_FIFO_SIZE; in mux_probe()
483 port->ops = &mux_pops; in mux_probe()
484 port->flags = UPF_BOOT_AUTOCONF; in mux_probe()
485 port->line = port_cnt; in mux_probe()
487 /* The port->timeout needs to match what is present in in mux_probe()
492 port->timeout = HZ / 50; in mux_probe()
493 spin_lock_init(&port->lock); in mux_probe()
505 int port_count = (long)dev_get_drvdata(&dev->dev); in mux_remove()
509 if(mux_ports[i].port.mapbase == dev->hpa.start + MUX_OFFSET) in mux_remove()
519 if(port->membase) in mux_remove()
520 iounmap(port->membase); in mux_remove()
523 release_mem_region(dev->hpa.start + MUX_OFFSET, port_count * MUX_LINE_OFFSET); in mux_remove()
536 { HPHW_A_DIRECT, HVERSION_REV_ANY_ID, 0x15, 0x0000D }, /* All K-class */
564 * mux_init - Serial MUX initialization procedure.
587 * mux_exit - Serial MUX cleanup procedure.