drivers/pinctrl/meson/pinctrl-meson.c
Source file repositories/reference/linux-study-clean/drivers/pinctrl/meson/pinctrl-meson.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/meson/pinctrl-meson.c- Extension
.c- Size
- 18966 bytes
- Lines
- 773
- Domain
- Driver Families
- Bucket
- drivers/pinctrl
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/device.hlinux/gpio/driver.hlinux/init.hlinux/io.hlinux/of.hlinux/of_address.hlinux/pinctrl/pinconf-generic.hlinux/pinctrl/pinconf.hlinux/pinctrl/pinctrl.hlinux/pinctrl/pinmux.hlinux/platform_device.hlinux/property.hlinux/regmap.hlinux/seq_file.h../core.h../pinctrl-utils.hpinctrl-meson.h
Detected Declarations
function meson_get_bankfunction meson_calc_reg_and_bitfunction meson_get_groups_countfunction meson_get_group_pinsfunction meson_pin_dbg_showfunction meson_pmx_get_funcs_countfunction meson_pmx_get_groupsfunction meson_pinconf_set_gpio_bitfunction meson_pinconf_get_gpio_bitfunction meson_pinconf_set_outputfunction meson_pinconf_get_outputfunction meson_pinconf_set_drivefunction meson_pinconf_get_drivefunction meson_pinconf_set_output_drivefunction meson_pinconf_disable_biasfunction meson_pinconf_enable_biasfunction meson_pinconf_set_drive_strengthfunction meson_pinconf_setfunction meson_pinconf_get_pullfunction meson_pinconf_get_drive_strengthfunction meson_pinconf_getfunction meson_pinconf_group_setfunction meson_pinconf_group_getfunction meson_gpio_get_directionfunction meson_gpio_direction_inputfunction meson_gpio_direction_outputfunction meson_gpio_setfunction meson_gpio_getfunction meson_gpiolib_registerfunction meson_pinctrl_parse_dtfunction meson8_aobus_parse_dt_extrafunction meson_a1_parse_dt_extrafunction meson_pinctrl_probeexport meson_pmx_get_funcs_countexport meson_pmx_get_func_nameexport meson_pmx_get_groupsexport meson8_aobus_parse_dt_extraexport meson_a1_parse_dt_extraexport meson_pinctrl_probe
Annotated Snippet
switch (param) {
case PIN_CONFIG_DRIVE_STRENGTH_UA:
case PIN_CONFIG_OUTPUT_ENABLE:
case PIN_CONFIG_LEVEL:
arg = pinconf_to_config_argument(configs[i]);
break;
default:
break;
}
switch (param) {
case PIN_CONFIG_BIAS_DISABLE:
ret = meson_pinconf_disable_bias(pc, pin);
break;
case PIN_CONFIG_BIAS_PULL_UP:
ret = meson_pinconf_enable_bias(pc, pin, true);
break;
case PIN_CONFIG_BIAS_PULL_DOWN:
ret = meson_pinconf_enable_bias(pc, pin, false);
break;
case PIN_CONFIG_DRIVE_STRENGTH_UA:
ret = meson_pinconf_set_drive_strength(pc, pin, arg);
break;
case PIN_CONFIG_OUTPUT_ENABLE:
ret = meson_pinconf_set_output(pc, pin, arg);
break;
case PIN_CONFIG_LEVEL:
ret = meson_pinconf_set_output_drive(pc, pin, arg);
break;
default:
ret = -ENOTSUPP;
}
if (ret)
return ret;
}
return 0;
}
static int meson_pinconf_get_pull(struct meson_pinctrl *pc, unsigned int pin)
{
const struct meson_bank *bank;
unsigned int reg, bit, val;
int ret, conf;
ret = meson_get_bank(pc, pin, &bank);
if (ret)
return ret;
meson_calc_reg_and_bit(bank, pin, MESON_REG_PULLEN, ®, &bit);
ret = regmap_read(pc->reg_pullen, reg, &val);
if (ret)
return ret;
if (!(val & BIT(bit))) {
conf = PIN_CONFIG_BIAS_DISABLE;
} else {
meson_calc_reg_and_bit(bank, pin, MESON_REG_PULL, ®, &bit);
ret = regmap_read(pc->reg_pull, reg, &val);
if (ret)
return ret;
if (val & BIT(bit))
conf = PIN_CONFIG_BIAS_PULL_UP;
else
conf = PIN_CONFIG_BIAS_PULL_DOWN;
}
return conf;
}
static int meson_pinconf_get_drive_strength(struct meson_pinctrl *pc,
unsigned int pin,
u16 *drive_strength_ua)
{
const struct meson_bank *bank;
unsigned int reg, bit;
unsigned int val;
int ret;
if (!pc->reg_ds)
return -ENOTSUPP;
ret = meson_get_bank(pc, pin, &bank);
if (ret)
return ret;
Annotation
- Immediate include surface: `linux/device.h`, `linux/gpio/driver.h`, `linux/init.h`, `linux/io.h`, `linux/of.h`, `linux/of_address.h`, `linux/pinctrl/pinconf-generic.h`, `linux/pinctrl/pinconf.h`.
- Detected declarations: `function meson_get_bank`, `function meson_calc_reg_and_bit`, `function meson_get_groups_count`, `function meson_get_group_pins`, `function meson_pin_dbg_show`, `function meson_pmx_get_funcs_count`, `function meson_pmx_get_groups`, `function meson_pinconf_set_gpio_bit`, `function meson_pinconf_get_gpio_bit`, `function meson_pinconf_set_output`.
- Atlas domain: Driver Families / drivers/pinctrl.
- Implementation status: integration 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.