drivers/pinctrl/samsung/pinctrl-s3c64xx.c
Source file repositories/reference/linux-study-clean/drivers/pinctrl/samsung/pinctrl-s3c64xx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pinctrl/samsung/pinctrl-s3c64xx.c- Extension
.c- Size
- 20336 bytes
- Lines
- 821
- 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/init.hlinux/device.hlinux/interrupt.hlinux/irqdomain.hlinux/irq.hlinux/of_irq.hlinux/io.hlinux/irqchip/chained_irq.hlinux/slab.hlinux/err.hpinctrl-samsung.h
Detected Declarations
struct s3c64xx_eint0_datastruct s3c64xx_eint0_domain_datastruct s3c64xx_eint_gpio_datafunction s3c64xx_irq_get_triggerfunction s3c64xx_pud_value_initfunction s3c64xx_irq_set_handlerfunction s3c64xx_irq_set_functionfunction configurationfunction s3c64xx_gpio_irq_unmaskfunction s3c64xx_gpio_irq_maskfunction s3c64xx_gpio_irq_ackfunction s3c64xx_gpio_irq_set_typefunction s3c64xx_gpio_irq_mapfunction s3c64xx_eint_gpio_irqfunction s3c64xx_eint_gpio_initfunction s3c64xx_eint0_irq_set_maskfunction s3c64xx_eint0_irq_unmaskfunction s3c64xx_eint0_irq_maskfunction s3c64xx_eint0_irq_ackfunction s3c64xx_eint0_irq_set_typefunction s3c64xx_irq_demux_eintfunction s3c64xx_demux_eint0_3function s3c64xx_demux_eint4_11function s3c64xx_demux_eint12_19function s3c64xx_demux_eint20_27function s3c64xx_eint0_irq_mapfunction s3c64xx_eint_eint0_initfunction for_each_child_of_node
Annotated Snippet
struct s3c64xx_eint0_data {
struct samsung_pinctrl_drv_data *drvdata;
struct irq_domain *domains[NUM_EINT0];
u8 pins[NUM_EINT0];
};
/**
* struct s3c64xx_eint0_domain_data - EINT0 per-domain data
* @bank: pin bank related to the domain
* @eints: EINT0 interrupts related to the domain
*/
struct s3c64xx_eint0_domain_data {
struct samsung_pin_bank *bank;
u8 eints[];
};
/**
* struct s3c64xx_eint_gpio_data - GPIO EINT data
* @drvdata: pin controller driver data
* @domains: array of domains related to EINT interrupt groups
*/
struct s3c64xx_eint_gpio_data {
struct samsung_pinctrl_drv_data *drvdata;
struct irq_domain *domains[];
};
/*
* Common functions for S3C64xx EINT configuration
*/
static int s3c64xx_irq_get_trigger(unsigned int type)
{
int trigger;
switch (type) {
case IRQ_TYPE_EDGE_RISING:
trigger = EINT_EDGE_RISING;
break;
case IRQ_TYPE_EDGE_FALLING:
trigger = EINT_EDGE_FALLING;
break;
case IRQ_TYPE_EDGE_BOTH:
trigger = EINT_EDGE_BOTH;
break;
case IRQ_TYPE_LEVEL_HIGH:
trigger = EINT_LEVEL_HIGH;
break;
case IRQ_TYPE_LEVEL_LOW:
trigger = EINT_LEVEL_LOW;
break;
default:
return -EINVAL;
}
return trigger;
}
static void s3c64xx_pud_value_init(struct samsung_pinctrl_drv_data *drvdata)
{
unsigned int *pud_val = drvdata->pud_val;
pud_val[PUD_PULL_DISABLE] = S3C_PIN_PULL_DISABLE;
pud_val[PUD_PULL_DOWN] = S3C_PIN_PULL_DOWN;
pud_val[PUD_PULL_UP] = S3C_PIN_PULL_UP;
}
static void s3c64xx_irq_set_handler(struct irq_data *d, unsigned int type)
{
/* Edge- and level-triggered interrupts need different handlers */
if (type & IRQ_TYPE_EDGE_BOTH)
irq_set_handler_locked(d, handle_edge_irq);
else
irq_set_handler_locked(d, handle_level_irq);
}
static void s3c64xx_irq_set_function(struct samsung_pinctrl_drv_data *d,
struct samsung_pin_bank *bank, int pin)
{
const struct samsung_pin_bank_type *bank_type = bank->type;
unsigned long flags;
void __iomem *reg;
u8 shift;
u32 mask;
u32 val;
/* Make sure that pin is configured as interrupt */
reg = d->virt_base + bank->pctl_offset;
shift = pin;
if (bank_type->fld_width[PINCFG_TYPE_FUNC] * shift >= 32) {
/* 4-bit bank type with 2 con regs */
Annotation
- Immediate include surface: `linux/init.h`, `linux/device.h`, `linux/interrupt.h`, `linux/irqdomain.h`, `linux/irq.h`, `linux/of_irq.h`, `linux/io.h`, `linux/irqchip/chained_irq.h`.
- Detected declarations: `struct s3c64xx_eint0_data`, `struct s3c64xx_eint0_domain_data`, `struct s3c64xx_eint_gpio_data`, `function s3c64xx_irq_get_trigger`, `function s3c64xx_pud_value_init`, `function s3c64xx_irq_set_handler`, `function s3c64xx_irq_set_function`, `function configuration`, `function s3c64xx_gpio_irq_unmask`, `function s3c64xx_gpio_irq_mask`.
- 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.