drivers/tty/serial/sccnxp.c
Source file repositories/reference/linux-study-clean/drivers/tty/serial/sccnxp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/tty/serial/sccnxp.c- Extension
.c- Size
- 27060 bytes
- Lines
- 1063
- 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/clk.hlinux/delay.hlinux/err.hlinux/module.hlinux/mod_devicetable.hlinux/device.hlinux/console.hlinux/serial_core.hlinux/serial.hlinux/io.hlinux/tty.hlinux/tty_flip.hlinux/spinlock.hlinux/platform_device.hlinux/platform_data/serial-sccnxp.hlinux/regulator/consumer.h
Detected Declarations
struct sccnxp_chipstruct sccnxp_portfunction sccnxp_readfunction sccnxp_writefunction sccnxp_port_readfunction sccnxp_port_writefunction sccnxp_update_best_errfunction sccnxp_set_baudfunction sccnxp_enable_irqfunction sccnxp_disable_irqfunction sccnxp_set_bitfunction sccnxp_handle_rxfunction sccnxp_handle_txfunction sccnxp_handle_eventsfunction sccnxp_timerfunction sccnxp_istfunction sccnxp_start_txfunction sccnxp_stop_txfunction sccnxp_tx_emptyfunction sccnxp_set_mctrlfunction sccnxp_get_mctrlfunction sccnxp_break_ctlfunction sccnxp_set_termiosfunction sccnxp_startupfunction sccnxp_shutdownfunction sccnxp_release_portfunction sccnxp_config_portfunction sccnxp_verify_portfunction sccnxp_console_putcharfunction sccnxp_console_writefunction sccnxp_console_setupfunction sccnxp_probefunction sccnxp_remove
Annotated Snippet
struct sccnxp_chip {
const char *name;
unsigned int nr;
unsigned long freq_min;
unsigned long freq_std;
unsigned long freq_max;
unsigned int flags;
unsigned int fifosize;
/* Time between read/write cycles */
unsigned int trwd;
};
struct sccnxp_port {
struct uart_driver uart;
struct uart_port port[SCCNXP_MAX_UARTS];
bool opened[SCCNXP_MAX_UARTS];
int irq;
u8 imr;
struct sccnxp_chip *chip;
#ifdef CONFIG_SERIAL_SCCNXP_CONSOLE
struct console console;
#endif
spinlock_t lock;
bool poll;
struct timer_list timer;
struct sccnxp_pdata pdata;
struct regulator *regulator;
};
static const struct sccnxp_chip sc2681 = {
.name = "SC2681",
.nr = 2,
.freq_min = 1000000,
.freq_std = 3686400,
.freq_max = 4000000,
.flags = SCCNXP_HAVE_IO,
.fifosize = 3,
.trwd = 200,
};
static const struct sccnxp_chip sc2691 = {
.name = "SC2691",
.nr = 1,
.freq_min = 1000000,
.freq_std = 3686400,
.freq_max = 4000000,
.flags = 0,
.fifosize = 3,
.trwd = 150,
};
static const struct sccnxp_chip sc2692 = {
.name = "SC2692",
.nr = 2,
.freq_min = 1000000,
.freq_std = 3686400,
.freq_max = 4000000,
.flags = SCCNXP_HAVE_IO,
.fifosize = 3,
.trwd = 30,
};
static const struct sccnxp_chip sc2891 = {
.name = "SC2891",
.nr = 1,
.freq_min = 100000,
.freq_std = 3686400,
.freq_max = 8000000,
.flags = SCCNXP_HAVE_IO | SCCNXP_HAVE_MR0,
.fifosize = 16,
.trwd = 27,
};
static const struct sccnxp_chip sc2892 = {
.name = "SC2892",
.nr = 2,
.freq_min = 100000,
.freq_std = 3686400,
.freq_max = 8000000,
.flags = SCCNXP_HAVE_IO | SCCNXP_HAVE_MR0,
.fifosize = 16,
.trwd = 17,
};
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/err.h`, `linux/module.h`, `linux/mod_devicetable.h`, `linux/device.h`, `linux/console.h`, `linux/serial_core.h`.
- Detected declarations: `struct sccnxp_chip`, `struct sccnxp_port`, `function sccnxp_read`, `function sccnxp_write`, `function sccnxp_port_read`, `function sccnxp_port_write`, `function sccnxp_update_best_err`, `function sccnxp_set_baud`, `function sccnxp_enable_irq`, `function sccnxp_disable_irq`.
- 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.