drivers/staging/greybus/uart.c
Source file repositories/reference/linux-study-clean/drivers/staging/greybus/uart.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/greybus/uart.c- Extension
.c- Size
- 25755 bytes
- Lines
- 1030
- Domain
- Driver Families
- Bucket
- drivers/staging
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/kernel.hlinux/errno.hlinux/module.hlinux/sched/signal.hlinux/wait.hlinux/slab.hlinux/uaccess.hlinux/mutex.hlinux/tty.hlinux/serial.hlinux/tty_driver.hlinux/tty_flip.hlinux/idr.hlinux/fs.hlinux/kdev_t.hlinux/kfifo.hlinux/workqueue.hlinux/completion.hlinux/greybus.hgbphy.h
Detected Declarations
struct gb_ttyfunction gb_uart_receive_data_handlerfunction gb_uart_serial_state_handlerfunction gb_uart_receive_credits_handlerfunction gb_uart_request_handlerfunction gb_uart_tx_write_workfunction send_line_codingfunction send_controlfunction send_breakfunction gb_uart_wait_for_all_creditsfunction gb_uart_flushfunction alloc_minorfunction release_minorfunction gb_tty_installfunction gb_tty_openfunction gb_tty_closefunction gb_tty_cleanupfunction gb_tty_hangupfunction gb_tty_writefunction gb_tty_write_roomfunction gb_tty_chars_in_bufferfunction gb_tty_break_ctlfunction gb_tty_set_termiosfunction gb_tty_tiocmgetfunction gb_tty_tiocmsetfunction gb_tty_throttlefunction gb_tty_unthrottlefunction get_serial_infofunction set_serial_infofunction wait_serial_changefunction gb_tty_get_icountfunction gb_tty_ioctlfunction gb_tty_dtr_rtsfunction gb_tty_port_activatefunction gb_tty_port_shutdownfunction gb_tty_port_destructfunction gb_uart_probefunction gb_uart_removefunction gb_tty_initfunction gb_tty_exitfunction gb_uart_driver_initfunction gb_uart_driver_exitmodule init gb_uart_driver_init
Annotated Snippet
module_init(gb_uart_driver_init);
static void gb_uart_driver_exit(void)
{
gb_gbphy_deregister(&uart_driver);
gb_tty_exit();
}
module_exit(gb_uart_driver_exit);
MODULE_DESCRIPTION("UART driver for the Greybus 'generic' UART module");
MODULE_LICENSE("GPL v2");
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/errno.h`, `linux/module.h`, `linux/sched/signal.h`, `linux/wait.h`, `linux/slab.h`, `linux/uaccess.h`, `linux/mutex.h`.
- Detected declarations: `struct gb_tty`, `function gb_uart_receive_data_handler`, `function gb_uart_serial_state_handler`, `function gb_uart_receive_credits_handler`, `function gb_uart_request_handler`, `function gb_uart_tx_write_work`, `function send_line_coding`, `function send_control`, `function send_break`, `function gb_uart_wait_for_all_credits`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.