pcs_get_pin_by_offset(9)
π
pcs_get_pin_by_offset β a Kernel API Manual moment (section 9, bestie)
okay so this is pcs_get_pin_by_offset(9) from the Kernel API Manual, and yes we're getting into pinctrl internals, but don't panic β it's literally a one-liner of a concept and it's giving "small but mighty" β¨
πΈ NAME πΈ
pcs_get_pin_by_offset β get a pin index based on the register offset
like, you give it an offset, it gives you back a pin index. that's the whole vibe. π
π¦ SYNOPSIS π¦
int pcs_get_pin_by_offset (struct pcs_device *pcs , unsigned offset );
one function, two args, returns an int. no cap, that's it. π
π§ ARGUMENTS π§
pcsβ the pcs driver instance π (your main character struct, the whole reason we're here)offsetβ register offset from the base β (measured from base, bestie, don't forget the base)
π DESCRIPTION π
okay so real talk β note that this is OK as long as the pins are in a static array. like, that's the condition, that's the caveat, that's the whole tea. π« keep your pins static and you're slaying; don't, and, wellβ¦ π the manpage says nothing else, so neither will I, periodt.
π SEE ALSO π
the whole pinctrl-single.c friend group π
β this is the Kernel file ./drivers/pinctrl/pinctrl-single.c and everyone in it:
struct pcs_func_vals(9)struct pcs_conf_vals(9)struct pcs_conf_type(9)struct pcs_function(9)struct pcs_gpiofunc_range(9)struct pcs_data(9)struct pcs_soc_data(9)struct pcs_device(9)pcs_add_pin(9)pcs_allocate_pin_table(9)pcs_add_function(9)pcs_parse_one_pinctrl_entry(9)pcs_dt_node_to_map(9)pcs_irq_free(9)pcs_free_resources(9)struct pcs_interrupt(9)pcs_irq_set(9)pcs_irq_mask(9)pcs_irq_unmask(9)pcs_irq_set_wake(9)pcs_irq_handle(9)pcs_irq_handler(9)pcs_irq_chain_handler(9)pcs_irq_init_chained_handler(9)pcs_quirk_missing_pinctrl_cells(9)
that's the whole squad fr fr π₯
π friendly reminder bestie: the "pins in a static array" thing is a real caveat, not just a vibe. it's in the DESCRIPTION for a reason, iykyk.
and that's the page! π brought to you by ./drivers/pinctrl, dated October 2026 β mwah, love that for us π see you in the next manpage, bestie π¦π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms