drivers/pinctrl/mediatek/pinctrl-mtk-common.h
Source file repositories/reference/linux-study-clean/drivers/pinctrl/mediatek/pinctrl-mtk-common.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/mediatek/pinctrl-mtk-common.h- Extension
.h- Size
- 9250 bytes
- Lines
- 312
- 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.
- 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/pinctrl/pinctrl.hlinux/regmap.hlinux/pinctrl/pinconf-generic.hmtk-eint.h
Detected Declarations
struct mtk_desc_functionstruct mtk_desc_eintstruct mtk_desc_pinstruct mtk_pinctrl_groupstruct mtk_drv_group_descstruct mtk_pin_drv_grpstruct mtk_pin_spec_pupd_set_sameregstruct mtk_pin_ies_smt_setstruct mtk_eint_offsetsstruct mtk_pinctrl_devdatastruct mtk_pinctrl
Annotated Snippet
struct mtk_desc_function {
const char *name;
unsigned char muxval;
};
struct mtk_desc_eint {
unsigned char eintmux;
unsigned char eintnum;
};
struct mtk_desc_pin {
struct pinctrl_pin_desc pin;
const struct mtk_desc_eint eint;
const struct mtk_desc_function *functions;
};
#define MTK_PIN(_pin, _pad, _chip, _eint, ...) \
{ \
.pin = _pin, \
.eint = _eint, \
.functions = (struct mtk_desc_function[]){ \
__VA_ARGS__, { } }, \
}
#define MTK_EINT_FUNCTION(_eintmux, _eintnum) \
{ \
.eintmux = _eintmux, \
.eintnum = _eintnum, \
}
#define MTK_FUNCTION(_val, _name) \
{ \
.muxval = _val, \
.name = _name, \
}
#define SET_ADDR(x, y) (x + (y->devdata->port_align))
#define CLR_ADDR(x, y) (x + (y->devdata->port_align << 1))
struct mtk_pinctrl_group {
const char *name;
unsigned long config;
unsigned pin;
};
/**
* struct mtk_drv_group_desc - Provide driving group data.
* @max_drv: The maximum current of this group.
* @min_drv: The minimum current of this group.
* @low_bit: The lowest bit of this group.
* @high_bit: The highest bit of this group.
* @step: The step current of this group.
*/
struct mtk_drv_group_desc {
unsigned char min_drv;
unsigned char max_drv;
unsigned char low_bit;
unsigned char high_bit;
unsigned char step;
};
#define MTK_DRV_GRP(_min, _max, _low, _high, _step) \
{ \
.min_drv = _min, \
.max_drv = _max, \
.low_bit = _low, \
.high_bit = _high, \
.step = _step, \
}
/**
* struct mtk_pin_drv_grp - Provide each pin driving info.
* @pin: The pin number.
* @offset: The offset of driving register for this pin.
* @bit: The bit of driving register for this pin.
* @grp: The group for this pin belongs to.
*/
struct mtk_pin_drv_grp {
unsigned short pin;
unsigned short offset;
unsigned char bit;
unsigned char grp;
};
#define MTK_PIN_DRV_GRP(_pin, _offset, _bit, _grp) \
{ \
.pin = _pin, \
.offset = _offset, \
.bit = _bit, \
.grp = _grp, \
Annotation
- Immediate include surface: `linux/pinctrl/pinctrl.h`, `linux/regmap.h`, `linux/pinctrl/pinconf-generic.h`, `mtk-eint.h`.
- Detected declarations: `struct mtk_desc_function`, `struct mtk_desc_eint`, `struct mtk_desc_pin`, `struct mtk_pinctrl_group`, `struct mtk_drv_group_desc`, `struct mtk_pin_drv_grp`, `struct mtk_pin_spec_pupd_set_samereg`, `struct mtk_pin_ies_smt_set`, `struct mtk_eint_offsets`, `struct mtk_pinctrl_devdata`.
- Atlas domain: Driver Families / drivers/pinctrl.
- 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.