drivers/pinctrl/pinctrl-rk805.c
Source file repositories/reference/linux-study-clean/drivers/pinctrl/pinctrl-rk805.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/pinctrl-rk805.c- Extension
.c- Size
- 17520 bytes
- Lines
- 703
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/gpio/driver.hlinux/kernel.hlinux/module.hlinux/mfd/rk808.hlinux/platform_device.hlinux/pm.hlinux/property.hlinux/slab.hlinux/pinctrl/consumer.hlinux/pinctrl/machine.hlinux/pinctrl/pinctrl.hlinux/pinctrl/pinconf-generic.hlinux/pinctrl/pinconf.hlinux/pinctrl/pinmux.hcore.hpinconf.hpinctrl-utils.h
Detected Declarations
struct rk805_pin_functionstruct rk805_pin_groupstruct rk805_pin_configstruct rk805_pctrl_infoenum rk805_pinmux_optionenum rk806_pinmux_optionenum rk816_pinmux_optionfunction rk805_gpio_getfunction rk805_gpio_setfunction rk805_gpio_direction_outputfunction rk805_gpio_get_directionfunction rk805_pinctrl_get_groups_countfunction rk805_pinctrl_get_group_pinsfunction rk805_pinctrl_get_funcs_countfunction rk805_pinctrl_get_func_groupsfunction _rk805_pinctrl_set_muxfunction rk805_pinctrl_set_muxfunction rk805_pinctrl_gpio_request_enablefunction rk805_pmx_gpio_set_directionfunction rk805_pinconf_getfunction rk805_pinconf_setfunction rk805_pinctrl_probe
Annotated Snippet
struct rk805_pin_function {
const char *name;
const char *const *groups;
unsigned int ngroups;
int mux_option;
};
struct rk805_pin_group {
const char *name;
const unsigned int pins[1];
unsigned int npins;
};
/*
* @reg: gpio setting register;
* @fun_reg: functions select register;
* @fun_mask: functions select mask value, when set is gpio;
* @dir_mask: input or output mask value, when set is output, otherwise input;
* @val_mask: gpio set value, when set is level high, otherwise low;
*
* Different PMIC has different pin features, belowing 3 mask members are not
* all necessary for every PMIC. For example, RK805 has 2 pins that can be used
* as output only GPIOs, so func_mask and dir_mask are not needed. RK816 has 1
* pin that can be used as TS/GPIO, so fun_mask, dir_mask and val_mask are all
* necessary.
*/
struct rk805_pin_config {
u8 reg;
u8 fun_reg;
u8 fun_msk;
u8 dir_msk;
u8 val_msk;
};
struct rk805_pctrl_info {
struct rk808 *rk808;
struct device *dev;
struct pinctrl_dev *pctl;
struct gpio_chip gpio_chip;
struct pinctrl_desc pinctrl_desc;
const struct rk805_pin_function *functions;
unsigned int num_functions;
const struct rk805_pin_group *groups;
int num_pin_groups;
const struct pinctrl_pin_desc *pins;
unsigned int num_pins;
const struct rk805_pin_config *pin_cfg;
};
enum rk805_pinmux_option {
RK805_PINMUX_GPIO,
};
enum rk806_pinmux_option {
RK806_PINMUX_FUN0 = 0,
RK806_PINMUX_FUN1,
RK806_PINMUX_FUN2,
RK806_PINMUX_FUN3,
RK806_PINMUX_FUN4,
RK806_PINMUX_FUN5,
};
enum rk816_pinmux_option {
RK816_PINMUX_THERMISTOR,
RK816_PINMUX_GPIO,
};
enum {
RK805_GPIO0,
RK805_GPIO1,
};
enum {
RK806_GPIO_DVS1,
RK806_GPIO_DVS2,
RK806_GPIO_DVS3
};
enum {
RK816_GPIO0,
};
static const char *const rk805_gpio_groups[] = {
"gpio0",
"gpio1",
};
static const char *const rk806_gpio_groups[] = {
"gpio_pwrctrl1",
"gpio_pwrctrl2",
Annotation
- Immediate include surface: `linux/gpio/driver.h`, `linux/kernel.h`, `linux/module.h`, `linux/mfd/rk808.h`, `linux/platform_device.h`, `linux/pm.h`, `linux/property.h`, `linux/slab.h`.
- Detected declarations: `struct rk805_pin_function`, `struct rk805_pin_group`, `struct rk805_pin_config`, `struct rk805_pctrl_info`, `enum rk805_pinmux_option`, `enum rk806_pinmux_option`, `enum rk816_pinmux_option`, `function rk805_gpio_get`, `function rk805_gpio_set`, `function rk805_gpio_direction_output`.
- 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.