drivers/pinctrl/samsung/pinctrl-exynos.c
Source file repositories/reference/linux-study-clean/drivers/pinctrl/samsung/pinctrl-exynos.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/samsung/pinctrl-exynos.c- Extension
.c- Size
- 31536 bytes
- Lines
- 1106
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/clk.hlinux/device.hlinux/interrupt.hlinux/irqdomain.hlinux/irq.hlinux/irqchip/chained_irq.hlinux/of.hlinux/of_irq.hlinux/slab.hlinux/spinlock.hlinux/string_choices.hlinux/regmap.hlinux/err.hlinux/soc/samsung/exynos-pmu.hlinux/soc/samsung/exynos-regs-pmu.hpinctrl-samsung.hpinctrl-exynos.h
Detected Declarations
struct exynos_irq_chipstruct exynos_eint_gpio_savefunction exynos_irq_maskfunction exynos_irq_ackfunction exynos_irq_unmaskfunction exynos_irq_set_typefunction exynos_irq_set_affinityfunction exynos_irq_request_resourcesfunction exynos_irq_release_resourcesfunction exynos_eint_irq_mapfunction exynos_eint_gpio_irqfunction exynos_eint_update_flt_regfunction filterfunction exynos_eint_gpio_initfunction gs101_wkup_irq_set_wakefunction gs101_pinctrl_set_eint_wakeup_maskfunction exynos_wkup_irq_set_wakefunction exynos_pinctrl_set_eint_wakeup_maskfunction s5pv210_pinctrl_set_eint_wakeup_maskfunction exynos_irq_eint0_15function exynos_irq_demux_eintfunction exynos_irq_demux_eint16_31function exynos_eint_wkup_initfunction for_each_child_of_nodefunction exynos_set_wakeupfunction exynos_pinctrl_suspendfunction gs101_pinctrl_suspendfunction exynosautov920_pinctrl_suspendfunction gs101_pinctrl_resumefunction exynos_pinctrl_resumefunction exynosautov920_pinctrl_resumefunction exynos_retention_enablefunction exynos_retention_disablefunction exynos_retention_init
Annotated Snippet
struct exynos_irq_chip {
struct irq_chip chip;
u32 eint_con;
u32 eint_mask;
u32 eint_pend;
u32 eint_num_wakeup_reg;
u32 eint_wake_mask_reg;
void (*set_eint_wakeup_mask)(struct samsung_pinctrl_drv_data *drvdata,
struct exynos_irq_chip *irq_chip);
};
static u32 eint_wake_mask_values[MAX_WAKEUP_REG] = { EXYNOS_EINT_WAKEUP_MASK_DISABLED,
EXYNOS_EINT_WAKEUP_MASK_DISABLED,
EXYNOS_EINT_WAKEUP_MASK_DISABLED};
static inline struct exynos_irq_chip *to_exynos_irq_chip(struct irq_chip *chip)
{
return container_of(chip, struct exynos_irq_chip, chip);
}
static void exynos_irq_mask(struct irq_data *irqd)
{
struct irq_chip *chip = irq_data_get_irq_chip(irqd);
struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip);
struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
unsigned long reg_mask;
unsigned int mask;
unsigned long flags;
if (bank->eint_mask_offset)
reg_mask = bank->pctl_offset + bank->eint_mask_offset;
else
reg_mask = our_chip->eint_mask + bank->eint_offset;
if (clk_enable(bank->drvdata->pclk)) {
dev_err(bank->gpio_chip.parent,
"unable to enable clock for masking IRQ\n");
return;
}
raw_spin_lock_irqsave(&bank->slock, flags);
mask = readl(bank->eint_base + reg_mask);
mask |= 1 << irqd->hwirq;
writel(mask, bank->eint_base + reg_mask);
raw_spin_unlock_irqrestore(&bank->slock, flags);
clk_disable(bank->drvdata->pclk);
}
static void exynos_irq_ack(struct irq_data *irqd)
{
struct irq_chip *chip = irq_data_get_irq_chip(irqd);
struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip);
struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
unsigned long reg_pend;
if (bank->eint_pend_offset)
reg_pend = bank->pctl_offset + bank->eint_pend_offset;
else
reg_pend = our_chip->eint_pend + bank->eint_offset;
if (clk_enable(bank->drvdata->pclk)) {
dev_err(bank->gpio_chip.parent,
"unable to enable clock to ack IRQ\n");
return;
}
writel(1 << irqd->hwirq, bank->eint_base + reg_pend);
clk_disable(bank->drvdata->pclk);
}
static void exynos_irq_unmask(struct irq_data *irqd)
{
struct irq_chip *chip = irq_data_get_irq_chip(irqd);
struct exynos_irq_chip *our_chip = to_exynos_irq_chip(chip);
struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
unsigned long reg_mask;
unsigned int mask;
unsigned long flags;
/*
* Ack level interrupts right before unmask
*
* If we don't do this we'll get a double-interrupt. Level triggered
* interrupts must not fire an interrupt if the level is not
* _currently_ active, even if it was active while the interrupt was
Annotation
- Immediate include surface: `linux/clk.h`, `linux/device.h`, `linux/interrupt.h`, `linux/irqdomain.h`, `linux/irq.h`, `linux/irqchip/chained_irq.h`, `linux/of.h`, `linux/of_irq.h`.
- Detected declarations: `struct exynos_irq_chip`, `struct exynos_eint_gpio_save`, `function exynos_irq_mask`, `function exynos_irq_ack`, `function exynos_irq_unmask`, `function exynos_irq_set_type`, `function exynos_irq_set_affinity`, `function exynos_irq_request_resources`, `function exynos_irq_release_resources`, `function exynos_eint_irq_map`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.