drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
Source file repositories/reference/linux-study-clean/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c- Extension
.c- Size
- 41899 bytes
- Lines
- 1355
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/bits.hlinux/clk.hlinux/gpio/driver.hlinux/io.hlinux/mod_devicetable.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/reset.hlinux/seq_file.hlinux/spinlock.hlinux/pinctrl/consumer.hlinux/pinctrl/pinconf.hlinux/pinctrl/pinctrl.hlinux/pinctrl/pinmux.hdt-bindings/pinctrl/pinctrl-starfive-jh7100.h../core.h../pinctrl-utils.h../pinmux.h../pinconf.h
Detected Declarations
struct starfive_pinctrlfunction Copyrightfunction starfive_pinmux_to_doutfunction starfive_pinmux_to_doenfunction starfive_pinmux_to_dinfunction starfive_drive_strength_to_max_mAfunction starfive_drive_strength_from_max_mAfunction starfive_pin_to_gpiofunction starfive_gpio_to_pinfunction starfive_pin_dbg_showfunction starfive_dt_node_to_mapfunction starfive_set_muxfunction starfive_padctl_getfunction starfive_padctl_rmwfunction starfive_pinconf_getfunction starfive_pinconf_group_getfunction starfive_pinconf_group_setfunction starfive_pinconf_dbg_showfunction starfive_gpio_get_directionfunction starfive_gpio_direction_inputfunction starfive_gpio_direction_outputfunction starfive_gpio_getfunction starfive_gpio_setfunction starfive_gpio_set_configfunction starfive_gpio_add_pin_rangesfunction starfive_irq_ackfunction starfive_irq_maskfunction starfive_irq_mask_ackfunction starfive_irq_unmaskfunction starfive_irq_set_typefunction starfive_gpio_irq_handlerfunction starfive_gpio_init_hwfunction starfive_disable_clockfunction starfive_probe
Annotated Snippet
struct starfive_pinctrl {
struct gpio_chip gc;
struct pinctrl_gpio_range gpios;
raw_spinlock_t lock;
void __iomem *base;
void __iomem *padctl;
struct pinctrl_dev *pctl;
struct mutex mutex; /* serialize adding groups and functions */
};
static inline unsigned int starfive_pin_to_gpio(const struct starfive_pinctrl *sfp,
unsigned int pin)
{
return pin - sfp->gpios.pin_base;
}
static inline unsigned int starfive_gpio_to_pin(const struct starfive_pinctrl *sfp,
unsigned int gpio)
{
return sfp->gpios.pin_base + gpio;
}
static struct starfive_pinctrl *starfive_from_irq_data(struct irq_data *d)
{
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
return container_of(gc, struct starfive_pinctrl, gc);
}
static struct starfive_pinctrl *starfive_from_irq_desc(struct irq_desc *desc)
{
struct gpio_chip *gc = irq_desc_get_handler_data(desc);
return container_of(gc, struct starfive_pinctrl, gc);
}
static const struct pinctrl_pin_desc starfive_pins[] = {
PINCTRL_PIN(PAD_GPIO(0), "GPIO[0]"),
PINCTRL_PIN(PAD_GPIO(1), "GPIO[1]"),
PINCTRL_PIN(PAD_GPIO(2), "GPIO[2]"),
PINCTRL_PIN(PAD_GPIO(3), "GPIO[3]"),
PINCTRL_PIN(PAD_GPIO(4), "GPIO[4]"),
PINCTRL_PIN(PAD_GPIO(5), "GPIO[5]"),
PINCTRL_PIN(PAD_GPIO(6), "GPIO[6]"),
PINCTRL_PIN(PAD_GPIO(7), "GPIO[7]"),
PINCTRL_PIN(PAD_GPIO(8), "GPIO[8]"),
PINCTRL_PIN(PAD_GPIO(9), "GPIO[9]"),
PINCTRL_PIN(PAD_GPIO(10), "GPIO[10]"),
PINCTRL_PIN(PAD_GPIO(11), "GPIO[11]"),
PINCTRL_PIN(PAD_GPIO(12), "GPIO[12]"),
PINCTRL_PIN(PAD_GPIO(13), "GPIO[13]"),
PINCTRL_PIN(PAD_GPIO(14), "GPIO[14]"),
PINCTRL_PIN(PAD_GPIO(15), "GPIO[15]"),
PINCTRL_PIN(PAD_GPIO(16), "GPIO[16]"),
PINCTRL_PIN(PAD_GPIO(17), "GPIO[17]"),
PINCTRL_PIN(PAD_GPIO(18), "GPIO[18]"),
PINCTRL_PIN(PAD_GPIO(19), "GPIO[19]"),
PINCTRL_PIN(PAD_GPIO(20), "GPIO[20]"),
PINCTRL_PIN(PAD_GPIO(21), "GPIO[21]"),
PINCTRL_PIN(PAD_GPIO(22), "GPIO[22]"),
PINCTRL_PIN(PAD_GPIO(23), "GPIO[23]"),
PINCTRL_PIN(PAD_GPIO(24), "GPIO[24]"),
PINCTRL_PIN(PAD_GPIO(25), "GPIO[25]"),
PINCTRL_PIN(PAD_GPIO(26), "GPIO[26]"),
PINCTRL_PIN(PAD_GPIO(27), "GPIO[27]"),
PINCTRL_PIN(PAD_GPIO(28), "GPIO[28]"),
PINCTRL_PIN(PAD_GPIO(29), "GPIO[29]"),
PINCTRL_PIN(PAD_GPIO(30), "GPIO[30]"),
PINCTRL_PIN(PAD_GPIO(31), "GPIO[31]"),
PINCTRL_PIN(PAD_GPIO(32), "GPIO[32]"),
PINCTRL_PIN(PAD_GPIO(33), "GPIO[33]"),
PINCTRL_PIN(PAD_GPIO(34), "GPIO[34]"),
PINCTRL_PIN(PAD_GPIO(35), "GPIO[35]"),
PINCTRL_PIN(PAD_GPIO(36), "GPIO[36]"),
PINCTRL_PIN(PAD_GPIO(37), "GPIO[37]"),
PINCTRL_PIN(PAD_GPIO(38), "GPIO[38]"),
PINCTRL_PIN(PAD_GPIO(39), "GPIO[39]"),
PINCTRL_PIN(PAD_GPIO(40), "GPIO[40]"),
PINCTRL_PIN(PAD_GPIO(41), "GPIO[41]"),
PINCTRL_PIN(PAD_GPIO(42), "GPIO[42]"),
PINCTRL_PIN(PAD_GPIO(43), "GPIO[43]"),
PINCTRL_PIN(PAD_GPIO(44), "GPIO[44]"),
PINCTRL_PIN(PAD_GPIO(45), "GPIO[45]"),
PINCTRL_PIN(PAD_GPIO(46), "GPIO[46]"),
PINCTRL_PIN(PAD_GPIO(47), "GPIO[47]"),
PINCTRL_PIN(PAD_GPIO(48), "GPIO[48]"),
PINCTRL_PIN(PAD_GPIO(49), "GPIO[49]"),
PINCTRL_PIN(PAD_GPIO(50), "GPIO[50]"),
PINCTRL_PIN(PAD_GPIO(51), "GPIO[51]"),
PINCTRL_PIN(PAD_GPIO(52), "GPIO[52]"),
Annotation
- Immediate include surface: `linux/bits.h`, `linux/clk.h`, `linux/gpio/driver.h`, `linux/io.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`.
- Detected declarations: `struct starfive_pinctrl`, `function Copyright`, `function starfive_pinmux_to_dout`, `function starfive_pinmux_to_doen`, `function starfive_pinmux_to_din`, `function starfive_drive_strength_to_max_mA`, `function starfive_drive_strength_from_max_mA`, `function starfive_pin_to_gpio`, `function starfive_gpio_to_pin`, `function starfive_pin_dbg_show`.
- Atlas domain: Driver Families / drivers/pinctrl.
- Implementation status: source 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.