STRUCT PCS_DEVICE(9)
struct pcs_device(9) β the Kernel API Manual, but make it a vibe π β¨
NAME π
struct pcs_device β pinctrl device instance. That's the name, bestie: it's the struct for a pinctrl device instance. π
SYNOPSIS π¦
Okay so here's the full struct, no edits, no cap β every field and define exactly as it lives:
struct pcs_device {
struct resource *res;
void __iomem *base;
void *saved_vals;
unsigned size;
struct device *dev;
struct device_node *np;
struct pinctrl_dev *pctl;
unsigned flags;
#define PCS_CONTEXT_LOSS_OFF (1 << 3);
#define PCS_QUIRK_SHARED_IRQ (1 << 2);
#define PCS_FEAT_IRQ (1 << 1);
#define PCS_FEAT_PINCONF (1 << 0);
struct property *missing_nr_pinctrl_cells;
struct pcs_soc_data socdata;
raw_spinlock_t lock;
struct mutex mutex;
unsigned width;
unsigned fmask;
unsigned fshift;
unsigned foff;
unsigned fmax;
bool bits_per_mux;
unsigned bits_per_pin;
struct pcs_data pins;
struct list_head gpiofuncs;
struct list_head irqs;
struct irq_chip chip;
struct irq_domain *domain;
struct pinctrl_desc desc;
unsigned (*read)(void __iomem *reg);
void (*write)(unsigned val, void __iomem *reg);
};
Members π
Every member gets its lil moment, because the whole cast matters:
resβ resources.baseβ virtual address of the controller.saved_valsβ saved values for the controller.sizeβ size of the ioremapped area.devβ device entry.npβ device tree node.pctlβ pin controller device.flagsβ mask ofPCS_FEAT_xxxvalues.missing_nr_pinctrl_cellsβ for legacy binding, may go away. Lowkey don't get too attached, but that's literally what the page says.socdataβ soc specific data.lockβ spinlock for register access.mutexβ mutex protecting the lists.widthβ bits per mux register.fmaskβ function register mask.fshiftβ function register shift.foffβ value to turn mux off.fmaxβ max number of functions infmask.bits_per_muxβ number of bits per mux.bits_per_pinβ number of bits per pin.pinsβ physical pins on the SoC.gpiofuncsβ list of gpio functions.irqsβ list of interrupt registers.chipβ chip container for this instance.domainβ IRQ domain for this instance.descβ pin controller descriptor.readβ register read function to use.writeβ register write function to use.
SEE ALSO π
The kernel file is ./drivers/pinctrl/pinctrl-single.c, and these are the linked faves β go read them, iykyk:
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)pcs_add_pin(9)pcs_allocate_pin_table(9)pcs_add_function(9)pcs_get_pin_by_offset(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)
π Source/version:./drivers/pinctrlΒ· date:October 2026Β· manual:Kernel API Manual. Cute sign-off complete, bestie β periodt. π
π¦ 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