drivers/pinctrl/realtek/pinctrl-rtd.h

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

File Facts

System
Linux kernel
Corpus path
drivers/pinctrl/realtek/pinctrl-rtd.h
Extension
.h
Size
4260 bytes
Lines
175
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 rtd_pin_group_desc {
	const char *name;
	const unsigned int *pins;
	unsigned int num_pins;
};

struct rtd_pin_func_desc {
	const char *name;
	const char * const *groups;
	unsigned int num_groups;
};

struct rtd_pin_mux_desc {
	const char *name;
	u32 mux_value;
};

struct rtd_pin_config_desc {
	const char *name;
	unsigned int reg_offset;
	unsigned int base_bit;
	unsigned int pud_en_offset;
	unsigned int pud_sel_offset;
	unsigned int curr_offset;
	unsigned int smt_offset;
	unsigned int power_offset;
	unsigned int curr_type;
	unsigned int input_volt_offset;
	unsigned int slew_rate_offset;
	unsigned int hvil_offset;
};

struct rtd_pin_sconfig_desc {
	const char *name;
	unsigned int reg_offset;
	unsigned int dcycle_offset;
	unsigned int dcycle_maskbits;
	unsigned int ndrive_offset;
	unsigned int ndrive_maskbits;
	unsigned int pdrive_offset;
	unsigned int pdrive_maskbits;
};

struct rtd_reg_range {
	unsigned int offset;
	size_t len;
};

struct rtd_pin_range {
	const struct rtd_reg_range *ranges;
	const int num_ranges;
};

struct rtd_pin_desc {
	const char *name;
	unsigned int mux_offset;
	u32 mux_mask;
	const struct rtd_pin_mux_desc *functions;
};

struct rtd_pin_reg_list {
	unsigned int reg_offset;
	unsigned int val;
};

#define SHIFT_LEFT(_val, _shift) ((_val) << (_shift))

#define RTK_PIN_MUX(_name, _mux_off, _mux_mask, ...) \
	{ \
		.name = # _name, \
		.mux_offset = _mux_off, \
		.mux_mask = _mux_mask, \
		.functions = (const struct rtd_pin_mux_desc []) { \
			__VA_ARGS__, { } \
		}, \
	}

#define RTK_PIN_CONFIG(_name, _reg_off, _base_bit, _pud_en_off, \
		       _pud_sel_off, _curr_off, _smt_off, _pow_off, _curr_type) \
	{ \
		.name = # _name, \
		.reg_offset = _reg_off, \
		.base_bit = _base_bit, \
		.pud_en_offset = _pud_en_off, \
		.pud_sel_offset = _pud_sel_off, \
		.curr_offset = _curr_off, \
		.smt_offset = _smt_off, \
		.power_offset = _pow_off, \
		.curr_type = _curr_type, \
	}

Annotation

Implementation Notes