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.

Dependency Surface

Detected Declarations

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

Implementation Notes