drivers/pinctrl/intel/pinctrl-tangier.c
Source file repositories/reference/linux-study-clean/drivers/pinctrl/intel/pinctrl-tangier.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/intel/pinctrl-tangier.c- Extension
.c- Size
- 13487 bytes
- Lines
- 579
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bits.hlinux/cleanup.hlinux/device.hlinux/err.hlinux/errno.hlinux/export.hlinux/io.hlinux/module.hlinux/overflow.hlinux/platform_device.hlinux/property.hlinux/seq_file.hlinux/spinlock.hlinux/types.hlinux/pinctrl/pinconf-generic.hlinux/pinctrl/pinconf.hlinux/pinctrl/pinctrl.hlinux/pinctrl/pinmux.h../core.hpinctrl-intel.hpinctrl-tangier.h
Detected Declarations
function Copyrightfunction tng_buf_availablefunction tng_read_bufcfgfunction tng_update_bufcfgfunction tng_get_groups_countfunction tng_get_group_pinsfunction tng_pin_dbg_showfunction tng_get_functions_countfunction tng_get_function_groupsfunction tng_pinmux_set_muxfunction tng_gpio_request_enablefunction tng_config_getfunction tng_config_set_pinfunction tng_config_setfunction tng_config_group_getfunction tng_config_group_setfunction devm_tng_pinctrl_probe
Annotated Snippet
switch (term) {
case BUFCFG_PUPD_VAL_910:
arg = 910;
break;
case BUFCFG_PUPD_VAL_2K:
arg = 2000;
break;
case BUFCFG_PUPD_VAL_20K:
arg = 20000;
break;
case BUFCFG_PUPD_VAL_50K:
arg = 50000;
break;
}
break;
case PIN_CONFIG_BIAS_PULL_DOWN:
if ((value & BUFCFG_Px_EN_MASK) != BUFCFG_PD_EN)
return -EINVAL;
switch (term) {
case BUFCFG_PUPD_VAL_910:
arg = 910;
break;
case BUFCFG_PUPD_VAL_2K:
arg = 2000;
break;
case BUFCFG_PUPD_VAL_20K:
arg = 20000;
break;
case BUFCFG_PUPD_VAL_50K:
arg = 50000;
break;
}
break;
case PIN_CONFIG_DRIVE_PUSH_PULL:
if (value & BUFCFG_OD_EN)
return -EINVAL;
break;
case PIN_CONFIG_DRIVE_OPEN_DRAIN:
if (!(value & BUFCFG_OD_EN))
return -EINVAL;
break;
case PIN_CONFIG_SLEW_RATE:
if (value & BUFCFG_SLEWSEL)
arg = 1;
break;
default:
return -ENOTSUPP;
}
*config = pinconf_to_config_packed(param, arg);
return 0;
}
static int tng_config_set_pin(struct tng_pinctrl *tp, unsigned int pin,
unsigned long config)
{
unsigned int param = pinconf_to_config_param(config);
unsigned int arg = pinconf_to_config_argument(config);
u32 mask, term, value = 0;
switch (param) {
case PIN_CONFIG_BIAS_DISABLE:
mask = BUFCFG_Px_EN_MASK | BUFCFG_PUPD_VAL_MASK;
break;
case PIN_CONFIG_BIAS_PULL_UP:
switch (arg) {
case 50000:
term = BUFCFG_PUPD_VAL_50K;
break;
case 1: /* Set default strength value in case none is given */
case 20000:
term = BUFCFG_PUPD_VAL_20K;
break;
case 2000:
term = BUFCFG_PUPD_VAL_2K;
break;
case 910:
term = BUFCFG_PUPD_VAL_910;
break;
default:
return -EINVAL;
Annotation
- Immediate include surface: `linux/bits.h`, `linux/cleanup.h`, `linux/device.h`, `linux/err.h`, `linux/errno.h`, `linux/export.h`, `linux/io.h`, `linux/module.h`.
- Detected declarations: `function Copyright`, `function tng_buf_available`, `function tng_read_bufcfg`, `function tng_update_bufcfg`, `function tng_get_groups_count`, `function tng_get_group_pins`, `function tng_pin_dbg_show`, `function tng_get_functions_count`, `function tng_get_function_groups`, `function tng_pinmux_set_mux`.
- Atlas domain: Driver Families / drivers/pinctrl.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.