drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h

Source file repositories/reference/linux-study-clean/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h

File Facts

System
Linux kernel
Corpus path
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h
Extension
.h
Size
11507 bytes
Lines
375
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 mtk_pin_field {
	u8  index;
	u32 offset;
	u32 mask;
	u8  bitpos;
	u8  next;
};

/* struct mtk_pin_field_calc - the structure that holds the range providing
 *			       the guide used to look up the relevant field
 * @s_pin:		the start pin within the range
 * @e_pin:		the end pin within the range
 * @i_base:		the index pointing to the entry in base address list
 * @s_addr:		the start address for the range
 * @x_addrs:		the address distance between two consecutive registers
 *			within the range
 * @s_bit:		the start bit for the first register within the range
 * @x_bits:		the bit distance between two consecutive pins within
 *			the range
 * @sz_reg:		the size of bits in a register
 * @fixed:		the consecutive pins share the same bits with the 1st
 *			pin
 */
struct mtk_pin_field_calc {
	u16 s_pin;
	u16 e_pin;
	u8  i_base;
	u32 s_addr;
	u8  x_addrs;
	u8  s_bit;
	u8  x_bits;
	u8  sz_reg;
	u8  fixed;
};

/**
 * struct mtk_pin_rsel - the structure that provides bias resistance selection.
 * @s_pin:		the start pin within the rsel range
 * @e_pin:		the end pin within the rsel range
 * @rsel_index:	the rsel bias resistance index
 * @up_rsel:	the pullup rsel bias resistance value
 * @down_rsel:	the pulldown rsel bias resistance value
 */
struct mtk_pin_rsel {
	u16 s_pin;
	u16 e_pin;
	u16 rsel_index;
	u32 up_rsel;
	u32 down_rsel;
};

/* struct mtk_pin_reg_calc - the structure that holds all ranges used to
 *			     determine which register the pin would make use of
 *			     for certain pin attribute.
 * @range:		     the start address for the range
 * @nranges:		     the number of items in the range
 */
struct mtk_pin_reg_calc {
	const struct mtk_pin_field_calc *range;
	unsigned int nranges;
};

/**
 * struct mtk_func_desc - the structure that providing information
 *			  all the funcs for this pin
 * @name:		the name of function
 * @muxval:		the mux to the function
 */
struct mtk_func_desc {
	const char *name;
	u8 muxval;
};

/**
 * struct mtk_eint_desc - the structure that providing information
 *			       for eint data per pin
 * @eint_m:		the eint mux for this pin
 * @eitn_n:		the eint number for this pin
 */
struct mtk_eint_desc {
	u16 eint_m;
	u16 eint_n;
};

/**
 * struct mtk_pin_desc - the structure that providing information
 *			       for each pin of chips
 * @number:		unique pin number from the global pin number space
 * @name:		name for this pin
 * @eint:		the eint data for this pin

Annotation

Implementation Notes