drivers/tty/serial/serial_port.c
Source file repositories/reference/linux-study-clean/drivers/tty/serial/serial_port.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/tty/serial/serial_port.c- Extension
.c- Size
- 8386 bytes
- Lines
- 322
- Domain
- Driver Families
- Bucket
- drivers/tty
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/pm_runtime.hlinux/pnp.hlinux/property.hlinux/serial_core.hlinux/spinlock.hserial_base.h
Detected Declarations
function Copyrightfunction serial_port_runtime_resumefunction serial_port_runtime_suspendfunction serial_base_port_set_txfunction serial_base_port_startupfunction serial_base_port_shutdownfunction serial_port_probefunction serial_port_removefunction uart_add_one_portfunction uart_remove_one_portfunction platform_get_irqfunction uart_read_port_propertiesfunction uart_read_and_validate_port_propertiesfunction serial_base_port_initfunction serial_base_port_exitexport uart_add_one_portexport uart_remove_one_portexport uart_read_port_propertiesexport uart_read_and_validate_port_properties
Annotated Snippet
static struct device_driver serial_port_driver = {
.name = "port",
.suppress_bind_attrs = true,
.probe = serial_port_probe,
.remove = serial_port_remove,
.pm = pm_ptr(&serial_port_pm),
};
int serial_base_port_init(void)
{
return serial_base_driver_register(&serial_port_driver);
}
void serial_base_port_exit(void)
{
serial_base_driver_unregister(&serial_port_driver);
}
MODULE_AUTHOR("Tony Lindgren <tony@atomide.com>");
MODULE_DESCRIPTION("Serial controller port driver");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/device.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/pm_runtime.h`, `linux/pnp.h`, `linux/property.h`, `linux/serial_core.h`.
- Detected declarations: `function Copyright`, `function serial_port_runtime_resume`, `function serial_port_runtime_suspend`, `function serial_base_port_set_tx`, `function serial_base_port_startup`, `function serial_base_port_shutdown`, `function serial_port_probe`, `function serial_port_remove`, `function uart_add_one_port`, `function uart_remove_one_port`.
- Atlas domain: Driver Families / drivers/tty.
- Implementation status: pattern implementation candidate.
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.