drivers/tty/serial/sh-sci-common.h
Source file repositories/reference/linux-study-clean/drivers/tty/serial/sh-sci-common.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/tty/serial/sh-sci-common.h- Extension
.h- Size
- 4877 bytes
- Lines
- 185
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/serial_core.h
Detected Declarations
struct plat_sci_regstruct sci_port_params_bitsstruct sci_common_regsstruct sci_port_paramsstruct sci_port_opsstruct sci_of_datastruct sci_portenum SCI_PORT_TYPEenum SCI_CLKS
Annotated Snippet
struct plat_sci_reg {
u8 offset;
u8 size;
};
struct sci_port_params_bits {
unsigned int rxtx_enable;
unsigned int te_clear;
unsigned int poll_sent_bits;
};
struct sci_common_regs {
unsigned int status;
unsigned int control;
};
/* The actual number of needed registers. This is used by sci only */
#define SCI_NR_REGS 20
struct sci_port_params {
const struct plat_sci_reg regs[SCI_NR_REGS];
const struct sci_common_regs *common_regs;
const struct sci_port_params_bits *param_bits;
unsigned int fifosize;
unsigned int overrun_reg;
unsigned int overrun_mask;
unsigned int sampling_rate_mask;
unsigned int error_mask;
unsigned int error_clear;
};
struct sci_port_ops {
u32 (*read_reg)(struct uart_port *port, int reg);
void (*write_reg)(struct uart_port *port, int reg, int value);
void (*clear_SCxSR)(struct uart_port *port, unsigned int mask);
void (*transmit_chars)(struct uart_port *port);
void (*receive_chars)(struct uart_port *port);
void (*poll_put_char)(struct uart_port *port, unsigned char c);
int (*set_rtrg)(struct uart_port *port, int rx_trig);
int (*rtrg_enabled)(struct uart_port *port);
void (*shutdown_complete)(struct uart_port *port);
void (*prepare_console_write)(struct uart_port *port, u32 ctrl);
void (*finish_console_write)(struct uart_port *port, u32 ctrl);
void (*console_save)(struct uart_port *port);
void (*console_restore)(struct uart_port *port);
size_t (*suspend_regs_size)(void);
};
struct sci_of_data {
const struct sci_port_params *params;
const struct uart_ops *uart_ops;
const struct sci_port_ops *ops;
unsigned short regtype;
unsigned short type;
};
struct sci_port {
struct uart_port port;
/* Platform configuration */
const struct sci_port_params *params;
const struct plat_sci_port *cfg;
unsigned int sampling_rate_mask;
resource_size_t reg_size;
struct mctrl_gpios *gpios;
/* Clocks */
struct clk *clks[SCI_NUM_CLKS];
unsigned long clk_rates[SCI_NUM_CLKS];
int irqs[SCIx_NR_IRQS];
char *irqstr[SCIx_NR_IRQS];
struct dma_chan *chan_tx;
struct dma_chan *chan_rx;
struct reset_control *rstc;
struct sci_suspend_regs *suspend_regs;
#ifdef CONFIG_SERIAL_SH_SCI_DMA
struct dma_chan *chan_tx_saved;
struct dma_chan *chan_rx_saved;
dma_cookie_t cookie_tx;
dma_cookie_t cookie_rx[2];
Annotation
- Immediate include surface: `linux/serial_core.h`.
- Detected declarations: `struct plat_sci_reg`, `struct sci_port_params_bits`, `struct sci_common_regs`, `struct sci_port_params`, `struct sci_port_ops`, `struct sci_of_data`, `struct sci_port`, `enum SCI_PORT_TYPE`, `enum SCI_CLKS`.
- Atlas domain: Driver Families / drivers/tty.
- Implementation status: source 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.