drivers/pinctrl/pinctrl-amdisp.h

Source file repositories/reference/linux-study-clean/drivers/pinctrl/pinctrl-amdisp.h

File Facts

System
Linux kernel
Corpus path
drivers/pinctrl/pinctrl-amdisp.h
Extension
.h
Size
2140 bytes
Lines
96
Domain
Driver Families
Bucket
drivers/pinctrl
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 amdisp_function {
	const char *name;
	const char * const *groups;
	unsigned int ngroups;
};

#define FUNCTION(fname)					\
	[mux_##fname] = {				\
		.name = #fname,				\
		.groups = fname##_groups,		\
		.ngroups = ARRAY_SIZE(fname##_groups),	\
	}

static const struct amdisp_function amdisp_functions[] = {
	FUNCTION(gpio),
};

/**
 * struct amdisp_pingroup - a pinmux group
 * @name:  Name of the pinmux group.
 * @pins:  List of pins for this group.
 * @npins: Number of entries in @pins.
 * @funcs: List of functions belongs to this group.
 * @nfuncs: Number of entries in @funcs.
 * @offset: Group offset in amdisp pinmux groups.
 */
struct amdisp_pingroup {
	const char *name;
	const unsigned int *pins;
	unsigned int npins;
	unsigned int *funcs;
	unsigned int nfuncs;
	unsigned int offset;
};

#define PINGROUP(id, f0)					\
	{							\
		.name = "gpio" #id,				\
		.pins = gpio##id##_pins,			\
		.npins = ARRAY_SIZE(gpio##id##_pins),		\
		.funcs = (int[]){				\
			mux_##f0,				\
		},						\
		.nfuncs = 1,					\
		.offset = id,					\
	}

static const struct amdisp_pingroup amdisp_groups[] = {
	PINGROUP(0, gpio),
	PINGROUP(1, gpio),
	PINGROUP(2, gpio),
};

Annotation

Implementation Notes