drivers/tty/serial/8250/8250_omap.c
Source file repositories/reference/linux-study-clean/drivers/tty/serial/8250/8250_omap.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/tty/serial/8250/8250_omap.c- Extension
.c- Size
- 51053 bytes
- Lines
- 1894
- Domain
- Driver Families
- Bucket
- drivers/tty
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/atomic.hlinux/clk.hlinux/device.hlinux/io.hlinux/module.hlinux/serial_8250.hlinux/serial_reg.hlinux/tty_flip.hlinux/platform_device.hlinux/slab.hlinux/of.hlinux/of_irq.hlinux/delay.hlinux/pm_runtime.hlinux/console.hlinux/pm_qos.hlinux/pm_wakeirq.hlinux/dma-mapping.hlinux/sys_soc.hlinux/reboot.hlinux/pinctrl/consumer.h8250.h
Detected Declarations
struct omap8250_privstruct omap8250_dma_paramsstruct omap8250_platdatafunction omap_8250_rx_dma_flushfunction omap8250_restore_regsfunction omap8250_set_mctrlfunction i202function omap_8250_get_divisorfunction omap8250_update_scrfunction omap8250_update_mdr1function omap8250_restore_regsfunction omap_8250_set_termios_atomicfunction omap_8250_set_termiosfunction omap_8250_pmfunction omap_serial_fill_features_erratasfunction omap8250_uart_qos_workfunction omap8250_irqfunction serial_port_infunction omap_8250_startupfunction omap_8250_shutdownfunction omap_8250_throttlefunction omap_8250_unthrottlefunction omap8250_rs485_configfunction mctrl_gpio_to_gpiodfunction __dma_rx_do_completefunction __dma_rx_completefunction omap_8250_rx_dma_flushfunction omap_8250_rx_dmafunction omap_8250_dma_tx_completefunction omap_8250_tx_dmafunction serial8250_tx_charsfunction handle_rx_dmafunction omap_8250_handle_rx_dmafunction am654_8250_handle_uart_errorsfunction am654_8250_handle_rx_dmafunction serial8250_handle_irqfunction the_no_dma_filter_fnfunction omap_8250_rx_dmafunction omap8250_no_handle_irqfunction omap8250_select_wakeup_pinctrlfunction omap8250_probefunction omap8250_removefunction omap8250_preparefunction omap8250_completefunction omap8250_suspendfunction omap8250_resumefunction omap8250_lost_contextfunction uart_write
Annotated Snippet
struct omap8250_priv {
void __iomem *membase;
int line;
u8 habit;
u8 mdr1;
u8 mdr3;
u8 efr;
u8 scr;
u8 wer;
u8 xon;
u8 xoff;
u8 delayed_restore;
u16 quot;
u8 tx_trigger;
u8 rx_trigger;
atomic_t active;
bool is_suspending;
int wakeirq;
u32 latency;
u32 calc_latency;
struct pm_qos_request pm_qos_request;
struct work_struct qos_work;
struct uart_8250_dma omap8250_dma;
spinlock_t rx_dma_lock;
bool rx_dma_broken;
bool throttled;
struct pinctrl *pinctrl;
struct pinctrl_state *pinctrl_wakeup;
};
struct omap8250_dma_params {
u32 rx_size;
u8 rx_trigger;
u8 tx_trigger;
};
struct omap8250_platdata {
struct omap8250_dma_params *dma_params;
u8 habit;
};
#ifdef CONFIG_SERIAL_8250_DMA
static void omap_8250_rx_dma_flush(struct uart_8250_port *p);
#else
static inline void omap_8250_rx_dma_flush(struct uart_8250_port *p) { }
#endif
static u32 uart_read(struct omap8250_priv *priv, u32 reg)
{
return readl(priv->membase + (reg << OMAP_UART_REGSHIFT));
}
/*
* Called on runtime PM resume path from omap8250_restore_regs(), and
* omap8250_set_mctrl().
*/
static void __omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl)
{
struct uart_8250_port *up = up_to_u8250p(port);
struct omap8250_priv *priv = port->private_data;
u8 lcr;
serial8250_do_set_mctrl(port, mctrl);
if (!mctrl_gpio_to_gpiod(up->gpios, UART_GPIO_RTS)) {
/*
* Turn off autoRTS if RTS is lowered and restore autoRTS
* setting if RTS is raised
*/
lcr = serial_in(up, UART_LCR);
serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
if ((mctrl & TIOCM_RTS) && (port->status & UPSTAT_AUTORTS))
priv->efr |= UART_EFR_RTS;
else
priv->efr &= ~UART_EFR_RTS;
serial_out(up, UART_EFR, priv->efr);
serial_out(up, UART_LCR, lcr);
}
}
static void omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl)
{
int err;
err = pm_runtime_resume_and_get(port->dev);
if (err)
return;
Annotation
- Immediate include surface: `linux/atomic.h`, `linux/clk.h`, `linux/device.h`, `linux/io.h`, `linux/module.h`, `linux/serial_8250.h`, `linux/serial_reg.h`, `linux/tty_flip.h`.
- Detected declarations: `struct omap8250_priv`, `struct omap8250_dma_params`, `struct omap8250_platdata`, `function omap_8250_rx_dma_flush`, `function omap8250_restore_regs`, `function omap8250_set_mctrl`, `function i202`, `function omap_8250_get_divisor`, `function omap8250_update_scr`, `function omap8250_update_mdr1`.
- Atlas domain: Driver Families / drivers/tty.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.