Lines Matching +full:bcm2835 +full:- +full:rng

1 // SPDX-License-Identifier: GPL-2.0+
3 * Base port operations for 8250/16550-type serial ports
244 * tx_loadsz is set to 63-bytes instead of 64-bytes to implement
245 * workaround of errata A-008006 which states that tx_loadsz should
257 .name = "Palmchip BK-3103",
343 offset = offset << p->regshift; in hub6_serial_in()
344 outb(p->hub6 - 1 + offset, p->iobase); in hub6_serial_in()
345 return inb(p->iobase + 1); in hub6_serial_in()
350 offset = offset << p->regshift; in hub6_serial_out()
351 outb(p->hub6 - 1 + offset, p->iobase); in hub6_serial_out()
352 outb(value, p->iobase + 1); in hub6_serial_out()
357 offset = offset << p->regshift; in mem_serial_in()
358 return readb(p->membase + offset); in mem_serial_in()
363 offset = offset << p->regshift; in mem_serial_out()
364 writeb(value, p->membase + offset); in mem_serial_out()
369 offset = offset << p->regshift; in mem16_serial_out()
370 writew(value, p->membase + offset); in mem16_serial_out()
375 offset = offset << p->regshift; in mem16_serial_in()
376 return readw(p->membase + offset); in mem16_serial_in()
381 offset = offset << p->regshift; in mem32_serial_out()
382 writel(value, p->membase + offset); in mem32_serial_out()
387 offset = offset << p->regshift; in mem32_serial_in()
388 return readl(p->membase + offset); in mem32_serial_in()
393 offset = offset << p->regshift; in mem32be_serial_out()
394 iowrite32be(value, p->membase + offset); in mem32be_serial_out()
399 offset = offset << p->regshift; in mem32be_serial_in()
400 return ioread32be(p->membase + offset); in mem32be_serial_in()
405 offset = offset << p->regshift; in io_serial_in()
406 return inb(p->iobase + offset); in io_serial_in()
411 offset = offset << p->regshift; in io_serial_out()
412 outb(value, p->iobase + offset); in io_serial_out()
421 up->dl_read = default_serial_dl_read; in set_io_from_upio()
422 up->dl_write = default_serial_dl_write; in set_io_from_upio()
424 switch (p->iotype) { in set_io_from_upio()
426 p->serial_in = hub6_serial_in; in set_io_from_upio()
427 p->serial_out = hub6_serial_out; in set_io_from_upio()
431 p->serial_in = mem_serial_in; in set_io_from_upio()
432 p->serial_out = mem_serial_out; in set_io_from_upio()
436 p->serial_in = mem16_serial_in; in set_io_from_upio()
437 p->serial_out = mem16_serial_out; in set_io_from_upio()
441 p->serial_in = mem32_serial_in; in set_io_from_upio()
442 p->serial_out = mem32_serial_out; in set_io_from_upio()
446 p->serial_in = mem32be_serial_in; in set_io_from_upio()
447 p->serial_out = mem32be_serial_out; in set_io_from_upio()
451 p->serial_in = io_serial_in; in set_io_from_upio()
452 p->serial_out = io_serial_out; in set_io_from_upio()
456 up->cur_iotype = p->iotype; in set_io_from_upio()
457 p->handle_irq = serial8250_default_handle_irq; in set_io_from_upio()
463 switch (p->iotype) { in serial_port_out_sync()
469 p->serial_out(p, offset, value); in serial_port_out_sync()
470 p->serial_in(p, UART_LCR); /* safe, no side-effects */ in serial_port_out_sync()
473 p->serial_out(p, offset, value); in serial_port_out_sync()
482 if (p->capabilities & UART_CAP_FIFO) { in serial8250_clear_fifos()
496 serial_out(p, UART_FCR, p->fcr); in serial8250_clear_and_reinit_fifos()
502 if (!(p->capabilities & UART_CAP_RPM)) in serial8250_rpm_get()
504 pm_runtime_get_sync(p->port.dev); in serial8250_rpm_get()
510 if (!(p->capabilities & UART_CAP_RPM)) in serial8250_rpm_put()
512 pm_runtime_mark_last_busy(p->port.dev); in serial8250_rpm_put()
513 pm_runtime_put_autosuspend(p->port.dev); in serial8250_rpm_put()
518 * serial8250_em485_init() - put uart_8250_port into rs485 emulating
531 * or from any other callback protected with p->port.lock spinlock.
535 * Return 0 - success, -errno - otherwise
540 lockdep_assert_held_once(&p->port.lock); in serial8250_em485_init()
542 if (p->em485) in serial8250_em485_init()
545 p->em485 = kmalloc(sizeof(struct uart_8250_em485), GFP_ATOMIC); in serial8250_em485_init()
546 if (!p->em485) in serial8250_em485_init()
547 return -ENOMEM; in serial8250_em485_init()
549 hrtimer_init(&p->em485->stop_tx_timer, CLOCK_MONOTONIC, in serial8250_em485_init()
551 hrtimer_init(&p->em485->start_tx_timer, CLOCK_MONOTONIC, in serial8250_em485_init()
553 p->em485->stop_tx_timer.function = &serial8250_em485_handle_stop_tx; in serial8250_em485_init()
554 p->em485->start_tx_timer.function = &serial8250_em485_handle_start_tx; in serial8250_em485_init()
555 p->em485->port = p; in serial8250_em485_init()
556 p->em485->active_timer = NULL; in serial8250_em485_init()
557 p->em485->tx_stopped = true; in serial8250_em485_init()
560 if (p->em485->tx_stopped) in serial8250_em485_init()
561 p->rs485_stop_tx(p); in serial8250_em485_init()
567 * serial8250_em485_destroy() - put uart_8250_port into normal state
575 * or from any other callback protected with p->port.lock spinlock.
581 if (!p->em485) in serial8250_em485_destroy()
584 hrtimer_cancel(&p->em485->start_tx_timer); in serial8250_em485_destroy()
585 hrtimer_cancel(&p->em485->stop_tx_timer); in serial8250_em485_destroy()
587 kfree(p->em485); in serial8250_em485_destroy()
588 p->em485 = NULL; in serial8250_em485_destroy()
601 * serial8250_em485_config() - generic ->rs485_config() callback
619 if (rs485->flags & SER_RS485_ENABLED) in serial8250_em485_config()
636 if (!(p->capabilities & UART_CAP_RPM)) in serial8250_rpm_get_tx()
639 rpm_active = xchg(&p->rpm_tx_active, 1); in serial8250_rpm_get_tx()
642 pm_runtime_get_sync(p->port.dev); in serial8250_rpm_get_tx()
650 if (!(p->capabilities & UART_CAP_RPM)) in serial8250_rpm_put_tx()
653 rpm_active = xchg(&p->rpm_tx_active, 0); in serial8250_rpm_put_tx()
656 pm_runtime_mark_last_busy(p->port.dev); in serial8250_rpm_put_tx()
657 pm_runtime_put_autosuspend(p->port.dev); in serial8250_rpm_put_tx()
672 if (p->capabilities & UART_CAP_SLEEP) { in serial8250_set_sleep()
674 uart_port_lock_irq(&p->port); in serial8250_set_sleep()
675 if (p->capabilities & UART_CAP_EFR) { in serial8250_set_sleep()
683 if (p->capabilities & UART_CAP_EFR) { in serial8250_set_sleep()
688 uart_port_unlock_irq(&p->port); in serial8250_set_sleep()
696 if (up->capabilities & UART_CAP_UUE) in serial8250_clear_IER()
722 up->port.uartclk = SERIAL_RSA_BAUD_BASE * 16; in __enable_rsa()
729 if (up->port.type == PORT_RSA) { in enable_rsa()
730 if (up->port.uartclk != SERIAL_RSA_BAUD_BASE * 16) { in enable_rsa()
731 uart_port_lock_irq(&up->port); in enable_rsa()
733 uart_port_unlock_irq(&up->port); in enable_rsa()
735 if (up->port.uartclk == SERIAL_RSA_BAUD_BASE * 16) in enable_rsa()
751 if (up->port.type == PORT_RSA && in disable_rsa()
752 up->port.uartclk == SERIAL_RSA_BAUD_BASE * 16) { in disable_rsa()
753 uart_port_lock_irq(&up->port); in disable_rsa()
765 up->port.uartclk = SERIAL_RSA_BAUD_BASE_LO * 16; in disable_rsa()
766 uart_port_unlock_irq(&up->port); in disable_rsa()
794 mdelay(20);/* FIXME - schedule_timeout */ in size_fifo()
808 * Read UART ID using the divisor method - set DLL and DLM to zero
846 up->capabilities |= UART_CAP_EFR | UART_CAP_SLEEP; in autoconfig_has_efr()
851 * If we have to do this here because some non-National in autoconfig_has_efr()
865 up->acr = 0; in autoconfig_has_efr()
878 up->port.type = PORT_16C950; in autoconfig_has_efr()
886 up->bugs |= UART_BUG_QUOT; in autoconfig_has_efr()
894 * 0x10 - XR16C850 and the DLL contains the chip revision. in autoconfig_has_efr()
895 * 0x12 - XR16C2850. in autoconfig_has_efr()
896 * 0x14 - XR16C854. in autoconfig_has_efr()
903 up->port.type = PORT_16850; in autoconfig_has_efr()
914 * I've had problems doing this in the past. -TYT in autoconfig_has_efr()
917 up->port.type = PORT_16654; in autoconfig_has_efr()
919 up->port.type = PORT_16650V2; in autoconfig_has_efr()
924 * this category - the original 8250 and the 16450. The
931 up->port.type = PORT_8250; in autoconfig_8250()
941 up->port.type = PORT_16450; in autoconfig_8250()
949 * http://linux.derkeiler.com/Mailing-Lists/Kernel/2004-11/4812.html in broken_efr()
969 lockdep_assert_held_once(&up->port.lock); in autoconfig_16550a()
971 up->port.type = PORT_16550A; in autoconfig_16550a()
972 up->capabilities |= UART_CAP_FIFO; in autoconfig_16550a()
975 !(up->port.flags & UPF_FULL_PROBE)) in autoconfig_16550a()
987 up->port.type = PORT_16650; in autoconfig_16550a()
988 up->capabilities |= UART_CAP_EFR | UART_CAP_SLEEP; in autoconfig_16550a()
998 up->port.type = PORT_16550A_FSL64; in autoconfig_16550a()
1022 * it's changed. If so, set baud_base in EXCR2 to 921600. -- dwmw2 in autoconfig_16550a()
1050 up->port.uartclk = 921600*16; in autoconfig_16550a()
1051 up->port.type = PORT_NS16550A; in autoconfig_16550a()
1052 up->capabilities |= UART_NATSEMI; in autoconfig_16550a()
1079 up->port.type = PORT_16750; in autoconfig_16550a()
1080 up->capabilities |= UART_CAP_AFE | UART_CAP_SLEEP; in autoconfig_16550a()
1106 up->port.type = PORT_XSCALE; in autoconfig_16550a()
1107 up->capabilities |= UART_CAP_UUE | UART_CAP_RTOIE; in autoconfig_16550a()
1123 if (up->port.type == PORT_16550A && size_fifo(up) == 64) { in autoconfig_16550a()
1124 up->port.type = PORT_U6_16550A; in autoconfig_16550a()
1125 up->capabilities |= UART_CAP_AFE; in autoconfig_16550a()
1140 struct uart_port *port = &up->port; in autoconfig()
1144 if (!port->iobase && !port->mapbase && !port->membase) in autoconfig()
1148 port->name, port->iobase, port->membase); in autoconfig()
1151 * We really do need global IRQs disabled here - we're going to in autoconfig()
1158 up->capabilities = 0; in autoconfig()
1159 up->bugs = 0; in autoconfig()
1161 if (!(port->flags & UPF_BUGGY_UART)) { in autoconfig()
1168 * assumption is that 0x80 is a non-existent port; in autoconfig()
1212 * that conflicts with COM 1-4 --- we hope! in autoconfig()
1214 if (!(port->flags & UPF_SKIP_TEST)) { in autoconfig()
1246 port->type = PORT_16550; in autoconfig()
1252 port->type = PORT_UNKNOWN; in autoconfig()
1260 if (port->type == PORT_16550A && up->probe & UART_PROBE_RSA && in autoconfig()
1262 port->type = PORT_RSA; in autoconfig()
1267 port->fifosize = uart_config[up->port.type].fifo_size; in autoconfig()
1268 old_capabilities = up->capabilities; in autoconfig()
1269 up->capabilities = uart_config[port->type].flags; in autoconfig()
1270 up->tx_loadsz = uart_config[port->type].tx_loadsz; in autoconfig()
1272 if (port->type == PORT_UNKNOWN) in autoconfig()
1279 if (port->type == PORT_RSA) in autoconfig()
1293 if (port->type == PORT_16550A && port->iotype == UPIO_PORT) in autoconfig()
1296 if (up->capabilities != old_capabilities) { in autoconfig()
1297 dev_warn(port->dev, "detected caps %08x should be %08x\n", in autoconfig()
1298 old_capabilities, up->capabilities); in autoconfig()
1302 DEBUG_AUTOCONF("type=%s\n", uart_config[port->type].name); in autoconfig()
1307 struct uart_port *port = &up->port; in autoconfig_irq()
1314 if (port->flags & UPF_FOURPORT) { in autoconfig_irq()
1315 ICP = (port->iobase & 0xfe0) | 0x1f; in autoconfig_irq()
1333 if (port->flags & UPF_FOURPORT) { in autoconfig_irq()
1357 if (port->flags & UPF_FOURPORT) in autoconfig_irq()
1360 port->irq = (irq > 0) ? irq : 0; in autoconfig_irq()
1368 lockdep_assert_held_once(&port->lock); in serial8250_stop_rx()
1372 up->ier &= ~(UART_IER_RLSI | UART_IER_RDI); in serial8250_stop_rx()
1373 up->port.read_status_mask &= ~UART_LSR_DR; in serial8250_stop_rx()
1374 serial_port_out(port, UART_IER, up->ier); in serial8250_stop_rx()
1380 * serial8250_em485_stop_tx() - generic ->rs485_stop_tx() callback
1390 lockdep_assert_held_once(&p->port.lock); in serial8250_em485_stop_tx()
1392 if (p->port.rs485.flags & SER_RS485_RTS_AFTER_SEND) in serial8250_em485_stop_tx()
1400 * received during the half-duplex transmission. in serial8250_em485_stop_tx()
1403 if (!(p->port.rs485.flags & SER_RS485_RX_DURING_TX)) { in serial8250_em485_stop_tx()
1406 p->ier |= UART_IER_RLSI | UART_IER_RDI; in serial8250_em485_stop_tx()
1407 serial_port_out(&p->port, UART_IER, p->ier); in serial8250_em485_stop_tx()
1416 struct uart_8250_port *p = em485->port; in serial8250_em485_handle_stop_tx()
1420 uart_port_lock_irqsave(&p->port, &flags); in serial8250_em485_handle_stop_tx()
1421 if (em485->active_timer == &em485->stop_tx_timer) { in serial8250_em485_handle_stop_tx()
1422 p->rs485_stop_tx(p); in serial8250_em485_handle_stop_tx()
1423 em485->active_timer = NULL; in serial8250_em485_handle_stop_tx()
1424 em485->tx_stopped = true; in serial8250_em485_handle_stop_tx()
1426 uart_port_unlock_irqrestore(&p->port, flags); in serial8250_em485_handle_stop_tx()
1439 struct uart_8250_em485 *em485 = p->em485; in __stop_tx_rs485()
1442 lockdep_assert_held_once(&p->port.lock); in __stop_tx_rs485()
1444 stop_delay += (u64)p->port.rs485.delay_rts_after_send * NSEC_PER_MSEC; in __stop_tx_rs485()
1451 em485->active_timer = &em485->stop_tx_timer; in __stop_tx_rs485()
1452 hrtimer_start(&em485->stop_tx_timer, ns_to_ktime(stop_delay), HRTIMER_MODE_REL); in __stop_tx_rs485()
1454 p->rs485_stop_tx(p); in __stop_tx_rs485()
1455 em485->active_timer = NULL; in __stop_tx_rs485()
1456 em485->tx_stopped = true; in __stop_tx_rs485()
1462 struct uart_8250_em485 *em485 = p->em485; in __stop_tx()
1479 if (!(p->capabilities & UART_CAP_NOTEMT)) in __stop_tx()
1488 stop_delay = p->port.frame_time + DIV_ROUND_UP(p->port.frame_time, 7); in __stop_tx()
1508 if (port->type == PORT_16C950) { in serial8250_stop_tx()
1509 up->acr |= UART_ACR_TXDIS; in serial8250_stop_tx()
1510 serial_icr_write(up, UART_ACR, up->acr); in serial8250_stop_tx()
1519 if (up->dma && !up->dma->tx_dma(up)) in __start_tx()
1523 if (up->bugs & UART_BUG_TXEN) { in __start_tx()
1532 * Re-enable the transmitter if we disabled it. in __start_tx()
1534 if (port->type == PORT_16C950 && up->acr & UART_ACR_TXDIS) { in __start_tx()
1535 up->acr &= ~UART_ACR_TXDIS; in __start_tx()
1536 serial_icr_write(up, UART_ACR, up->acr); in __start_tx()
1541 * serial8250_em485_start_tx() - generic ->rs485_start_tx() callback
1554 if (!(up->port.rs485.flags & SER_RS485_RX_DURING_TX)) in serial8250_em485_start_tx()
1555 serial8250_stop_rx(&up->port); in serial8250_em485_start_tx()
1557 if (up->port.rs485.flags & SER_RS485_RTS_ON_SEND) in serial8250_em485_start_tx()
1569 struct uart_8250_em485 *em485 = up->em485; in start_tx_rs485()
1573 * em485->active_timer != &em485->stop_tx_timer, it might happen that in start_tx_rs485()
1575 * chars is send and em485->active_timer == &em485->stop_tx_timer again. in start_tx_rs485()
1578 * em485->active_timer when &em485->stop_tx_timer is armed again. in start_tx_rs485()
1580 if (em485->active_timer == &em485->stop_tx_timer) in start_tx_rs485()
1581 hrtimer_try_to_cancel(&em485->stop_tx_timer); in start_tx_rs485()
1583 em485->active_timer = NULL; in start_tx_rs485()
1585 if (em485->tx_stopped) { in start_tx_rs485()
1586 em485->tx_stopped = false; in start_tx_rs485()
1588 up->rs485_start_tx(up); in start_tx_rs485()
1590 if (up->port.rs485.delay_rts_before_send > 0) { in start_tx_rs485()
1591 em485->active_timer = &em485->start_tx_timer; in start_tx_rs485()
1592 start_hrtimer_ms(&em485->start_tx_timer, in start_tx_rs485()
1593 up->port.rs485.delay_rts_before_send); in start_tx_rs485()
1605 struct uart_8250_port *p = em485->port; in serial8250_em485_handle_start_tx()
1608 uart_port_lock_irqsave(&p->port, &flags); in serial8250_em485_handle_start_tx()
1609 if (em485->active_timer == &em485->start_tx_timer) { in serial8250_em485_handle_start_tx()
1610 __start_tx(&p->port); in serial8250_em485_handle_start_tx()
1611 em485->active_timer = NULL; in serial8250_em485_handle_start_tx()
1613 uart_port_unlock_irqrestore(&p->port, flags); in serial8250_em485_handle_start_tx()
1621 struct uart_8250_em485 *em485 = up->em485; in serial8250_start_tx()
1624 lockdep_assert_held_once(&port->lock); in serial8250_start_tx()
1626 if (!port->x_char && kfifo_is_empty(&port->state->port.xmit_fifo)) in serial8250_start_tx()
1632 if ((em485->active_timer == &em485->start_tx_timer) || in serial8250_start_tx()
1641 port->throttle(port); in serial8250_throttle()
1646 port->unthrottle(port); in serial8250_unthrottle()
1654 lockdep_assert_held_once(&port->lock); in serial8250_disable_ms()
1657 if (up->bugs & UART_BUG_NOMSR) in serial8250_disable_ms()
1660 mctrl_gpio_disable_ms(up->gpios); in serial8250_disable_ms()
1662 up->ier &= ~UART_IER_MSI; in serial8250_disable_ms()
1663 serial_port_out(port, UART_IER, up->ier); in serial8250_disable_ms()
1671 lockdep_assert_held_once(&port->lock); in serial8250_enable_ms()
1674 if (up->bugs & UART_BUG_NOMSR) in serial8250_enable_ms()
1677 mctrl_gpio_enable_ms(up->gpios); in serial8250_enable_ms()
1679 up->ier |= UART_IER_MSI; in serial8250_enable_ms()
1682 serial_port_out(port, UART_IER, up->ier); in serial8250_enable_ms()
1688 struct uart_port *port = &up->port; in serial8250_read_char()
1703 port->icount.rx++; in serial8250_read_char()
1705 lsr |= up->lsr_saved_flags; in serial8250_read_char()
1706 up->lsr_saved_flags = 0; in serial8250_read_char()
1711 port->icount.brk++; in serial8250_read_char()
1721 port->icount.parity++; in serial8250_read_char()
1723 port->icount.frame++; in serial8250_read_char()
1725 port->icount.overrun++; in serial8250_read_char()
1730 lsr &= port->read_status_mask; in serial8250_read_char()
1733 dev_dbg(port->dev, "handling break\n"); in serial8250_read_char()
1748 * serial8250_rx_chars - Read characters. The first LSR value must be passed in.
1750 * Returns LSR bits. The caller should rely only on non-Rx related LSR bits
1756 struct uart_port *port = &up->port; in serial8250_rx_chars()
1761 if (--max_count == 0) in serial8250_rx_chars()
1766 tty_flip_buffer_push(&port->state->port); in serial8250_rx_chars()
1773 struct uart_port *port = &up->port; in serial8250_tx_chars()
1774 struct tty_port *tport = &port->state->port; in serial8250_tx_chars()
1777 if (port->x_char) { in serial8250_tx_chars()
1785 if (kfifo_is_empty(&tport->xmit_fifo)) { in serial8250_tx_chars()
1790 count = up->tx_loadsz; in serial8250_tx_chars()
1798 if (up->bugs & UART_BUG_TXRACE) { in serial8250_tx_chars()
1804 * Delay back-to-back writes by a read cycle to avoid in serial8250_tx_chars()
1806 * side-effects and discard the result. in serial8250_tx_chars()
1811 if ((up->capabilities & UART_CAP_HFIFO) && in serial8250_tx_chars()
1814 /* The BCM2835 MINI UART THRE bit is really a not-full bit. */ in serial8250_tx_chars()
1815 if ((up->capabilities & UART_CAP_MINI) && in serial8250_tx_chars()
1818 } while (--count > 0); in serial8250_tx_chars()
1820 if (kfifo_len(&tport->xmit_fifo) < WAKEUP_CHARS) in serial8250_tx_chars()
1828 if (kfifo_is_empty(&tport->xmit_fifo) && in serial8250_tx_chars()
1829 !(up->capabilities & UART_CAP_RPM)) in serial8250_tx_chars()
1837 struct uart_port *port = &up->port; in serial8250_modem_status()
1840 status |= up->msr_saved_flags; in serial8250_modem_status()
1841 up->msr_saved_flags = 0; in serial8250_modem_status()
1842 if (status & UART_MSR_ANY_DELTA && up->ier & UART_IER_MSI && in serial8250_modem_status()
1843 port->state != NULL) { in serial8250_modem_status()
1845 port->icount.rng++; in serial8250_modem_status()
1847 port->icount.dsr++; in serial8250_modem_status()
1853 wake_up_interruptible(&port->state->port.delta_msr_wait); in serial8250_modem_status()
1875 if (!up->dma->rx_running) in handle_rx_dma()
1883 return up->dma->rx_dma(up); in handle_rx_dma()
1892 struct tty_port *tport = &port->state->port; in serial8250_handle_irq()
1913 (port->status & (UPSTAT_AUTOCTS | UPSTAT_AUTORTS)) && in serial8250_handle_irq()
1914 !(port->read_status_mask & UART_LSR_DR)) in serial8250_handle_irq()
1920 d = irq_get_irq_data(port->irq); in serial8250_handle_irq()
1922 pm_wakeup_event(tport->tty->dev, 0); in serial8250_handle_irq()
1923 if (!up->dma || handle_rx_dma(up, iir)) in serial8250_handle_irq()
1927 if ((status & UART_LSR_THRE) && (up->ier & UART_IER_THRI)) { in serial8250_handle_irq()
1928 if (!up->dma || up->dma->tx_err) in serial8250_handle_irq()
1930 else if (!up->dma->tx_running) in serial8250_handle_irq()
2008 if (up->gpios) in serial8250_do_get_mctrl()
2009 return mctrl_gpio_get(up->gpios, &val); in serial8250_do_get_mctrl()
2017 if (port->get_mctrl) in serial8250_get_mctrl()
2018 return port->get_mctrl(port); in serial8250_get_mctrl()
2029 mcr |= up->mcr; in serial8250_do_set_mctrl()
2037 if (port->rs485.flags & SER_RS485_ENABLED) in serial8250_set_mctrl()
2040 if (port->set_mctrl) in serial8250_set_mctrl()
2041 port->set_mctrl(port, mctrl); in serial8250_set_mctrl()
2053 if (break_state == -1) in serial8250_break_ctl()
2054 up->lcr |= UART_LCR_SBC; in serial8250_break_ctl()
2056 up->lcr &= ~UART_LCR_SBC; in serial8250_break_ctl()
2057 serial_port_out(port, UART_LCR, up->lcr); in serial8250_break_ctl()
2072 if (--tmout == 0) in wait_for_lsr()
2089 if (up->port.flags & UPF_CONS_FLOW) { in wait_for_xmitr()
2090 for (tmout = 1000000; tmout; tmout--) { in wait_for_xmitr()
2092 up->msr_saved_flags |= msr & MSR_SAVE_FLAGS; in wait_for_xmitr()
2175 if (!port->fifosize) in serial8250_do_startup()
2176 port->fifosize = uart_config[port->type].fifo_size; in serial8250_do_startup()
2177 if (!up->tx_loadsz) in serial8250_do_startup()
2178 up->tx_loadsz = uart_config[port->type].tx_loadsz; in serial8250_do_startup()
2179 if (!up->capabilities) in serial8250_do_startup()
2180 up->capabilities = uart_config[port->type].flags; in serial8250_do_startup()
2181 up->mcr = 0; in serial8250_do_startup()
2183 if (port->iotype != up->cur_iotype) in serial8250_do_startup()
2187 if (port->type == PORT_16C950) { in serial8250_do_startup()
2194 up->acr = 0; in serial8250_do_startup()
2206 if (port->type == PORT_DA830) { in serial8250_do_startup()
2252 if (!(port->flags & UPF_BUGGY_UART) && in serial8250_do_startup()
2254 dev_info_ratelimited(port->dev, "LSR safety check engaged!\n"); in serial8250_do_startup()
2255 retval = -ENODEV; in serial8250_do_startup()
2262 if (port->type == PORT_16850) { in serial8250_do_startup()
2281 if (((port->type == PORT_ALTR_16550_F32) || in serial8250_do_startup()
2282 (port->type == PORT_ALTR_16550_F64) || in serial8250_do_startup()
2283 (port->type == PORT_ALTR_16550_F128)) && (port->fifosize > 1)) { in serial8250_do_startup()
2284 /* Bounds checking of TX threshold (valid 0 to fifosize-2) */ in serial8250_do_startup()
2285 if ((up->tx_loadsz < 2) || (up->tx_loadsz > port->fifosize)) { in serial8250_do_startup()
2286 dev_err(port->dev, "TX FIFO Threshold errors, skipping\n"); in serial8250_do_startup()
2291 port->fifosize - up->tx_loadsz); in serial8250_do_startup()
2292 port->handle_irq = serial8250_tx_threshold_handle_irq; in serial8250_do_startup()
2297 if (port->irq && (up->port.flags & UPF_SHARE_IRQ)) in serial8250_do_startup()
2298 up->port.irqflags |= IRQF_SHARED; in serial8250_do_startup()
2300 retval = up->ops->setup_irq(up); in serial8250_do_startup()
2304 if (port->irq && !(up->port.flags & UPF_NO_THRE_TEST)) { in serial8250_do_startup()
2307 if (port->irqflags & IRQF_SHARED) in serial8250_do_startup()
2308 disable_irq_nosync(port->irq); in serial8250_do_startup()
2328 udelay(1); /* allow a working UART time to re-assert THRE */ in serial8250_do_startup()
2334 if (port->irqflags & IRQF_SHARED) in serial8250_do_startup()
2335 enable_irq(port->irq); in serial8250_do_startup()
2343 up->port.flags & UPF_BUG_THRE) { in serial8250_do_startup()
2344 up->bugs |= UART_BUG_THRE; in serial8250_do_startup()
2348 up->ops->setup_timer(up); in serial8250_do_startup()
2356 if (up->port.flags & UPF_FOURPORT) { in serial8250_do_startup()
2357 if (!up->port.irq) in serial8250_do_startup()
2358 up->port.mctrl |= TIOCM_OUT1; in serial8250_do_startup()
2363 if (port->irq) in serial8250_do_startup()
2364 up->port.mctrl |= TIOCM_OUT2; in serial8250_do_startup()
2366 serial8250_set_mctrl(port, port->mctrl); in serial8250_do_startup()
2379 if (up->port.quirks & UPQ_NO_TXEN_TEST) in serial8250_do_startup()
2392 if (!(up->bugs & UART_BUG_TXEN)) { in serial8250_do_startup()
2393 up->bugs |= UART_BUG_TXEN; in serial8250_do_startup()
2394 dev_dbg(port->dev, "enabling bad tx status workarounds\n"); in serial8250_do_startup()
2397 up->bugs &= ~UART_BUG_TXEN; in serial8250_do_startup()
2412 up->lsr_saved_flags = 0; in serial8250_do_startup()
2413 up->msr_saved_flags = 0; in serial8250_do_startup()
2418 if (up->dma) { in serial8250_do_startup()
2426 dev_warn_ratelimited(port->dev, "%s\n", msg); in serial8250_do_startup()
2427 up->dma = NULL; in serial8250_do_startup()
2433 * enable until after the FIFOs are enabled; otherwise, an already- in serial8250_do_startup()
2436 up->ier = UART_IER_RLSI | UART_IER_RDI; in serial8250_do_startup()
2438 if (port->flags & UPF_FOURPORT) { in serial8250_do_startup()
2443 icp = (port->iobase & 0xfe0) | 0x01f; in serial8250_do_startup()
2456 if (port->startup) in serial8250_startup()
2457 return port->startup(port); in serial8250_startup()
2473 up->ier = 0; in serial8250_do_shutdown()
2477 synchronize_irq(port->irq); in serial8250_do_shutdown()
2479 if (up->dma) in serial8250_do_shutdown()
2483 if (port->flags & UPF_FOURPORT) { in serial8250_do_shutdown()
2485 inb((port->iobase & 0xfe0) | 0x1f); in serial8250_do_shutdown()
2486 port->mctrl |= TIOCM_OUT1; in serial8250_do_shutdown()
2488 port->mctrl &= ~TIOCM_OUT2; in serial8250_do_shutdown()
2490 serial8250_set_mctrl(port, port->mctrl); in serial8250_do_shutdown()
2514 up->ops->release_irq(up); in serial8250_do_shutdown()
2520 if (port->shutdown) in serial8250_shutdown()
2521 port->shutdown(port); in serial8250_shutdown()
2530 upf_t magic_multiplier = port->flags & UPF_MAGIC_MULTIPLIER; in serial8250_do_get_divisor()
2553 * if set to 1 and high-speed operation has been enabled with the in serial8250_do_get_divisor()
2566 if (magic_multiplier && baud >= port->uartclk / 6) in serial8250_do_get_divisor()
2568 else if (magic_multiplier && baud >= port->uartclk / 12) in serial8250_do_get_divisor()
2576 if (up->bugs & UART_BUG_QUOT && (quot & 0xff) == 0) in serial8250_do_get_divisor()
2586 if (port->get_divisor) in serial8250_get_divisor()
2587 return port->get_divisor(port, baud, frac); in serial8250_get_divisor()
2629 if (up->capabilities & UART_NATSEMI) in serial8250_do_set_divisor()
2632 serial_port_out(port, UART_LCR, up->lcr | UART_LCR_DLAB); in serial8250_do_set_divisor()
2641 if (port->set_divisor) in serial8250_set_divisor()
2642 port->set_divisor(port, baud, quot, quot_frac); in serial8250_set_divisor()
2651 unsigned int tolerance = port->uartclk / 100; in serial8250_get_baud_rate()
2660 if (port->flags & UPF_MAGIC_MULTIPLIER) { in serial8250_get_baud_rate()
2661 min = port->uartclk / 16 / UART_DIV_MAX >> 1; in serial8250_get_baud_rate()
2662 max = (port->uartclk + tolerance) / 4; in serial8250_get_baud_rate()
2664 min = port->uartclk / 16 / UART_DIV_MAX; in serial8250_get_baud_rate()
2665 max = (port->uartclk + tolerance) / 16; in serial8250_get_baud_rate()
2684 struct tty_port *tport = &port->state->port; in serial8250_update_uartclk()
2689 mutex_lock(&tport->mutex); in serial8250_update_uartclk()
2690 port->uartclk = uartclk; in serial8250_update_uartclk()
2691 mutex_unlock(&tport->mutex); in serial8250_update_uartclk()
2695 down_write(&tty->termios_rwsem); in serial8250_update_uartclk()
2696 mutex_lock(&tport->mutex); in serial8250_update_uartclk()
2698 if (port->uartclk == uartclk) in serial8250_update_uartclk()
2701 port->uartclk = uartclk; in serial8250_update_uartclk()
2706 serial8250_do_set_termios(port, &tty->termios, NULL); in serial8250_update_uartclk()
2709 mutex_unlock(&tport->mutex); in serial8250_update_uartclk()
2710 up_write(&tty->termios_rwsem); in serial8250_update_uartclk()
2724 if (up->capabilities & UART_CAP_MINI) { in serial8250_do_set_termios()
2725 termios->c_cflag &= ~(CSTOPB | PARENB | PARODD | CMSPAR); in serial8250_do_set_termios()
2726 if ((termios->c_cflag & CSIZE) == CS5 || in serial8250_do_set_termios()
2727 (termios->c_cflag & CSIZE) == CS6) in serial8250_do_set_termios()
2728 termios->c_cflag = (termios->c_cflag & ~CSIZE) | CS7; in serial8250_do_set_termios()
2730 cval = serial8250_compute_lcr(up, termios->c_cflag); in serial8250_do_set_termios()
2744 up->lcr = cval; /* Save computed LCR */ in serial8250_do_set_termios()
2746 if (up->capabilities & UART_CAP_FIFO && port->fifosize > 1) { in serial8250_do_set_termios()
2747 if (baud < 2400 && !up->dma) { in serial8250_do_set_termios()
2748 up->fcr &= ~UART_FCR_TRIGGER_MASK; in serial8250_do_set_termios()
2749 up->fcr |= UART_FCR_TRIGGER_1; in serial8250_do_set_termios()
2754 * MCR-based auto flow control. When AFE is enabled, RTS will be in serial8250_do_set_termios()
2758 if (up->capabilities & UART_CAP_AFE) { in serial8250_do_set_termios()
2759 up->mcr &= ~UART_MCR_AFE; in serial8250_do_set_termios()
2760 if (termios->c_cflag & CRTSCTS) in serial8250_do_set_termios()
2761 up->mcr |= UART_MCR_AFE; in serial8250_do_set_termios()
2765 * Update the per-port timeout. in serial8250_do_set_termios()
2767 uart_update_timeout(port, termios->c_cflag, baud); in serial8250_do_set_termios()
2769 port->read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; in serial8250_do_set_termios()
2770 if (termios->c_iflag & INPCK) in serial8250_do_set_termios()
2771 port->read_status_mask |= UART_LSR_FE | UART_LSR_PE; in serial8250_do_set_termios()
2772 if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK)) in serial8250_do_set_termios()
2773 port->read_status_mask |= UART_LSR_BI; in serial8250_do_set_termios()
2778 port->ignore_status_mask = 0; in serial8250_do_set_termios()
2779 if (termios->c_iflag & IGNPAR) in serial8250_do_set_termios()
2780 port->ignore_status_mask |= UART_LSR_PE | UART_LSR_FE; in serial8250_do_set_termios()
2781 if (termios->c_iflag & IGNBRK) { in serial8250_do_set_termios()
2782 port->ignore_status_mask |= UART_LSR_BI; in serial8250_do_set_termios()
2787 if (termios->c_iflag & IGNPAR) in serial8250_do_set_termios()
2788 port->ignore_status_mask |= UART_LSR_OE; in serial8250_do_set_termios()
2794 if ((termios->c_cflag & CREAD) == 0) in serial8250_do_set_termios()
2795 port->ignore_status_mask |= UART_LSR_DR; in serial8250_do_set_termios()
2800 up->ier &= ~UART_IER_MSI; in serial8250_do_set_termios()
2801 if (!(up->bugs & UART_BUG_NOMSR) && in serial8250_do_set_termios()
2802 UART_ENABLE_MS(&up->port, termios->c_cflag)) in serial8250_do_set_termios()
2803 up->ier |= UART_IER_MSI; in serial8250_do_set_termios()
2804 if (up->capabilities & UART_CAP_UUE) in serial8250_do_set_termios()
2805 up->ier |= UART_IER_UUE; in serial8250_do_set_termios()
2806 if (up->capabilities & UART_CAP_RTOIE) in serial8250_do_set_termios()
2807 up->ier |= UART_IER_RTOIE; in serial8250_do_set_termios()
2809 serial_port_out(port, UART_IER, up->ier); in serial8250_do_set_termios()
2811 if (up->capabilities & UART_CAP_EFR) { in serial8250_do_set_termios()
2815 * - TI16C752 requires control thresholds to be set. in serial8250_do_set_termios()
2816 * - UART_MCR_RTS is ineffective if auto-RTS mode is enabled. in serial8250_do_set_termios()
2818 if (termios->c_cflag & CRTSCTS) in serial8250_do_set_termios()
2822 if (port->flags & UPF_EXAR_EFR) in serial8250_do_set_termios()
2831 * LCR DLAB must be set to enable 64-byte FIFO mode. If the FCR in serial8250_do_set_termios()
2834 if (port->type == PORT_16750) in serial8250_do_set_termios()
2835 serial_port_out(port, UART_FCR, up->fcr); in serial8250_do_set_termios()
2837 serial_port_out(port, UART_LCR, up->lcr); /* reset DLAB */ in serial8250_do_set_termios()
2838 if (port->type != PORT_16750) { in serial8250_do_set_termios()
2840 if (up->fcr & UART_FCR_ENABLE_FIFO) in serial8250_do_set_termios()
2842 serial_port_out(port, UART_FCR, up->fcr); /* set fcr */ in serial8250_do_set_termios()
2844 serial8250_set_mctrl(port, port->mctrl); in serial8250_do_set_termios()
2858 if (port->set_termios) in serial8250_set_termios()
2859 port->set_termios(port, termios, old); in serial8250_set_termios()
2866 if (termios->c_line == N_PPS) { in serial8250_do_set_ldisc()
2867 port->flags |= UPF_HARDPPS_CD; in serial8250_do_set_ldisc()
2872 port->flags &= ~UPF_HARDPPS_CD; in serial8250_do_set_ldisc()
2873 if (!UART_ENABLE_MS(port, termios->c_cflag)) { in serial8250_do_set_ldisc()
2885 if (port->set_ldisc) in serial8250_set_ldisc()
2886 port->set_ldisc(port, termios); in serial8250_set_ldisc()
2904 if (port->pm) in serial8250_pm()
2905 port->pm(port, state, oldstate); in serial8250_pm()
2912 if (pt->port.mapsize) in serial8250_port_size()
2913 return pt->port.mapsize; in serial8250_port_size()
2915 return 0x16 << pt->port.regshift; in serial8250_port_size()
2917 return 8 << pt->port.regshift; in serial8250_port_size()
2926 struct uart_port *port = &up->port; in serial8250_request_std_resource()
2929 switch (port->iotype) { in serial8250_request_std_resource()
2936 if (!port->mapbase) { in serial8250_request_std_resource()
2937 ret = -EINVAL; in serial8250_request_std_resource()
2941 if (!request_mem_region(port->mapbase, size, "serial")) { in serial8250_request_std_resource()
2942 ret = -EBUSY; in serial8250_request_std_resource()
2946 if (port->flags & UPF_IOREMAP) { in serial8250_request_std_resource()
2947 port->membase = ioremap(port->mapbase, size); in serial8250_request_std_resource()
2948 if (!port->membase) { in serial8250_request_std_resource()
2949 release_mem_region(port->mapbase, size); in serial8250_request_std_resource()
2950 ret = -ENOMEM; in serial8250_request_std_resource()
2957 if (!request_region(port->iobase, size, "serial")) in serial8250_request_std_resource()
2958 ret = -EBUSY; in serial8250_request_std_resource()
2967 struct uart_port *port = &up->port; in serial8250_release_std_resource()
2969 switch (port->iotype) { in serial8250_release_std_resource()
2976 if (!port->mapbase) in serial8250_release_std_resource()
2979 if (port->flags & UPF_IOREMAP) { in serial8250_release_std_resource()
2980 iounmap(port->membase); in serial8250_release_std_resource()
2981 port->membase = NULL; in serial8250_release_std_resource()
2984 release_mem_region(port->mapbase, size); in serial8250_release_std_resource()
2989 release_region(port->iobase, size); in serial8250_release_std_resource()
3010 const struct serial8250_config *conf_type = &uart_config[up->port.type]; in fcr_get_rxtrig_bytes()
3013 bytes = conf_type->rxtrig_bytes[UART_FCR_R_TRIG_BITS(up->fcr)]; in fcr_get_rxtrig_bytes()
3015 return bytes ? bytes : -EOPNOTSUPP; in fcr_get_rxtrig_bytes()
3020 const struct serial8250_config *conf_type = &uart_config[up->port.type]; in bytes_to_fcr_rxtrig()
3023 if (!conf_type->rxtrig_bytes[UART_FCR_R_TRIG_BITS(UART_FCR_R_TRIG_00)]) in bytes_to_fcr_rxtrig()
3024 return -EOPNOTSUPP; in bytes_to_fcr_rxtrig()
3027 if (bytes < conf_type->rxtrig_bytes[i]) in bytes_to_fcr_rxtrig()
3029 return (--i) << UART_FCR_R_TRIG_SHIFT; in bytes_to_fcr_rxtrig()
3038 struct uart_port *uport = state->uart_port; in do_get_rxtrig()
3041 if (!(up->capabilities & UART_CAP_FIFO) || uport->fifosize <= 1) in do_get_rxtrig()
3042 return -EINVAL; in do_get_rxtrig()
3051 mutex_lock(&port->mutex); in do_serial8250_get_rxtrig()
3053 mutex_unlock(&port->mutex); in do_serial8250_get_rxtrig()
3074 struct uart_port *uport = state->uart_port; in do_set_rxtrig()
3078 if (!(up->capabilities & UART_CAP_FIFO) || uport->fifosize <= 1) in do_set_rxtrig()
3079 return -EINVAL; in do_set_rxtrig()
3086 up->fcr &= ~UART_FCR_TRIGGER_MASK; in do_set_rxtrig()
3087 up->fcr |= (unsigned char)rxtrig; in do_set_rxtrig()
3088 serial_out(up, UART_FCR, up->fcr); in do_set_rxtrig()
3096 mutex_lock(&port->mutex); in do_serial8250_set_rxtrig()
3098 mutex_unlock(&port->mutex); in do_serial8250_set_rxtrig()
3111 return -EINVAL; in rx_trig_bytes_store()
3137 const struct serial8250_config *conf_type = &uart_config[up->port.type]; in register_dev_spec_attr_grp()
3139 if (conf_type->rxtrig_bytes[0]) in register_dev_spec_attr_grp()
3140 up->port.attr_group = &serial8250_dev_attr_group; in register_dev_spec_attr_grp()
3156 if (port->iotype != up->cur_iotype) in serial8250_config_port()
3163 if (port->type == PORT_TEGRA) in serial8250_config_port()
3164 up->bugs |= UART_BUG_NOMSR; in serial8250_config_port()
3166 if (port->type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ) in serial8250_config_port()
3169 if (port->type == PORT_UNKNOWN) in serial8250_config_port()
3173 up->fcr = uart_config[up->port.type].fcr; in serial8250_config_port()
3179 if (ser->irq >= nr_irqs || ser->irq < 0 || in serial8250_verify_port()
3180 ser->baud_base < 9600 || ser->type < PORT_UNKNOWN || in serial8250_verify_port()
3181 ser->type >= ARRAY_SIZE(uart_config) || ser->type == PORT_CIRRUS || in serial8250_verify_port()
3182 ser->type == PORT_STARTECH) in serial8250_verify_port()
3183 return -EINVAL; in serial8250_verify_port()
3189 int type = port->type; in serial8250_type()
3225 struct uart_port *port = &up->port; in serial8250_init_port()
3227 spin_lock_init(&port->lock); in serial8250_init_port()
3228 port->ctrl_id = 0; in serial8250_init_port()
3229 port->pm = NULL; in serial8250_init_port()
3230 port->ops = &serial8250_pops; in serial8250_init_port()
3231 port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_8250_CONSOLE); in serial8250_init_port()
3233 up->cur_iotype = 0xFF; in serial8250_init_port()
3239 struct uart_port *port = &up->port; in serial8250_set_defaults()
3241 if (up->port.flags & UPF_FIXED_TYPE) { in serial8250_set_defaults()
3242 unsigned int type = up->port.type; in serial8250_set_defaults()
3244 if (!up->port.fifosize) in serial8250_set_defaults()
3245 up->port.fifosize = uart_config[type].fifo_size; in serial8250_set_defaults()
3246 if (!up->tx_loadsz) in serial8250_set_defaults()
3247 up->tx_loadsz = uart_config[type].tx_loadsz; in serial8250_set_defaults()
3248 if (!up->capabilities) in serial8250_set_defaults()
3249 up->capabilities = uart_config[type].flags; in serial8250_set_defaults()
3255 if (up->dma) { in serial8250_set_defaults()
3256 if (!up->dma->tx_dma) in serial8250_set_defaults()
3257 up->dma->tx_dma = serial8250_tx_dma; in serial8250_set_defaults()
3258 if (!up->dma->rx_dma) in serial8250_set_defaults()
3259 up->dma->rx_dma = serial8250_rx_dma; in serial8250_set_defaults()
3275 * Restore serial console when h/w power-off detected
3279 struct uart_port *port = &up->port; in serial8250_console_restore()
3283 termios.c_cflag = port->cons->cflag; in serial8250_console_restore()
3284 termios.c_ispeed = port->cons->ispeed; in serial8250_console_restore()
3285 termios.c_ospeed = port->cons->ospeed; in serial8250_console_restore()
3286 if (port->state->port.tty && termios.c_cflag == 0) { in serial8250_console_restore()
3287 termios.c_cflag = port->state->port.tty->termios.c_cflag; in serial8250_console_restore()
3288 termios.c_ispeed = port->state->port.tty->termios.c_ispeed; in serial8250_console_restore()
3289 termios.c_ospeed = port->state->port.tty->termios.c_ospeed; in serial8250_console_restore()
3296 serial_port_out(port, UART_LCR, up->lcr); in serial8250_console_restore()
3297 serial8250_out_MCR(up, up->mcr | UART_MCR_DTR | UART_MCR_RTS); in serial8250_console_restore()
3311 unsigned int fifosize = up->tx_loadsz; in serial8250_console_fifo_write()
3341 struct uart_8250_em485 *em485 = up->em485; in serial8250_console_write()
3342 struct uart_port *port = &up->port; in serial8250_console_write()
3361 if (up->canary && (up->canary != serial_port_in(port, UART_SCR))) { in serial8250_console_write()
3363 up->canary = 0; in serial8250_console_write()
3367 if (em485->tx_stopped) in serial8250_console_write()
3368 up->rs485_start_tx(up); in serial8250_console_write()
3369 mdelay(port->rs485.delay_rts_before_send); in serial8250_console_write()
3372 use_fifo = (up->capabilities & UART_CAP_FIFO) && in serial8250_console_write()
3377 !(up->capabilities & UART_CAP_MINI) && in serial8250_console_write()
3381 up->tx_loadsz > 1 && in serial8250_console_write()
3382 (up->fcr & UART_FCR_ENABLE_FIFO) && in serial8250_console_write()
3383 port->state && in serial8250_console_write()
3384 test_bit(TTY_PORT_INITIALIZED, &port->state->port.iflags) && in serial8250_console_write()
3390 !(up->port.flags & UPF_CONS_FLOW); in serial8250_console_write()
3404 mdelay(port->rs485.delay_rts_after_send); in serial8250_console_write()
3405 if (em485->tx_stopped) in serial8250_console_write()
3406 up->rs485_stop_tx(up); in serial8250_console_write()
3418 if (up->msr_saved_flags) in serial8250_console_write()
3437 return (port->uartclk / 16) / quot; in probe_baud()
3448 if (!port->iobase && !port->membase) in serial8250_console_setup()
3449 return -ENODEV; in serial8250_console_setup()
3456 ret = uart_set_options(port, port->cons, baud, parity, bits, flow); in serial8250_console_setup()
3460 if (port->dev) in serial8250_console_setup()
3461 pm_runtime_get_sync(port->dev); in serial8250_console_setup()
3468 if (port->dev) in serial8250_console_exit()
3469 pm_runtime_put_sync(port->dev); in serial8250_console_exit()
3476 MODULE_DESCRIPTION("Base port operations for 8250/16550-type serial ports");