drivers/mfd/arizona-irq.c
Source file repositories/reference/linux-study-clean/drivers/mfd/arizona-irq.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mfd/arizona-irq.c- Extension
.c- Size
- 10841 bytes
- Lines
- 454
- Domain
- Driver Families
- Bucket
- drivers/mfd
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/gpio.hlinux/interrupt.hlinux/irq.hlinux/irqdomain.hlinux/module.hlinux/pm_runtime.hlinux/regmap.hlinux/regulator/consumer.hlinux/slab.hlinux/mfd/arizona/core.hlinux/mfd/arizona/registers.harizona.h
Detected Declarations
function arizona_map_irqfunction arizona_request_irqfunction arizona_free_irqfunction arizona_set_irq_wakefunction arizona_boot_donefunction arizona_ctrlif_errfunction arizona_irq_threadfunction gpio_get_value_cansleepfunction arizona_irq_enablefunction arizona_irq_mapfunction arizona_irq_initfunction arizona_irq_exitexport arizona_request_irqexport arizona_free_irqexport arizona_set_irq_wake
Annotated Snippet
if (arizona->aod_irq_chip) {
/*
* Check the AOD status register to determine whether
* the nested IRQ handler should be called.
*/
ret = regmap_read(arizona->regmap,
ARIZONA_AOD_IRQ1, &val);
if (ret)
dev_warn(arizona->dev,
"Failed to read AOD IRQ1 %d\n", ret);
else if (val)
handle_nested_irq(
irq_find_mapping(arizona->virq, 0));
}
/*
* Check if one of the main interrupts is asserted and only
* check that domain if it is.
*/
ret = regmap_read(arizona->regmap, ARIZONA_IRQ_PIN_STATUS,
&val);
if (ret == 0 && val & ARIZONA_IRQ1_STS) {
handle_nested_irq(irq_find_mapping(arizona->virq, 1));
} else if (ret != 0) {
dev_err(arizona->dev,
"Failed to read main IRQ status: %d\n", ret);
}
#ifdef CONFIG_GPIOLIB_LEGACY
/*
* Poll the IRQ pin status to see if we're really done
* if the interrupt controller can't do it for us.
*/
if (!arizona->pdata.irq_gpio) {
break;
} else if (arizona->pdata.irq_flags & IRQF_TRIGGER_RISING &&
gpio_get_value_cansleep(arizona->pdata.irq_gpio)) {
poll = true;
} else if (arizona->pdata.irq_flags & IRQF_TRIGGER_FALLING &&
!gpio_get_value_cansleep(arizona->pdata.irq_gpio)) {
poll = true;
}
#endif
} while (poll);
pm_runtime_put_autosuspend(arizona->dev);
return IRQ_HANDLED;
}
static void arizona_irq_enable(struct irq_data *data)
{
}
static void arizona_irq_disable(struct irq_data *data)
{
}
static int arizona_irq_set_wake(struct irq_data *data, unsigned int on)
{
struct arizona *arizona = irq_data_get_irq_chip_data(data);
return irq_set_irq_wake(arizona->irq, on);
}
static struct irq_chip arizona_irq_chip = {
.name = "arizona",
.irq_disable = arizona_irq_disable,
.irq_enable = arizona_irq_enable,
.irq_set_wake = arizona_irq_set_wake,
};
static struct lock_class_key arizona_irq_lock_class;
static struct lock_class_key arizona_irq_request_class;
static int arizona_irq_map(struct irq_domain *h, unsigned int virq,
irq_hw_number_t hw)
{
struct arizona *data = h->host_data;
irq_set_chip_data(virq, data);
irq_set_lockdep_class(virq, &arizona_irq_lock_class,
&arizona_irq_request_class);
irq_set_chip_and_handler(virq, &arizona_irq_chip, handle_simple_irq);
irq_set_nested_thread(virq, 1);
irq_set_noprobe(virq);
return 0;
}
static const struct irq_domain_ops arizona_domain_ops = {
Annotation
- Immediate include surface: `linux/delay.h`, `linux/gpio.h`, `linux/interrupt.h`, `linux/irq.h`, `linux/irqdomain.h`, `linux/module.h`, `linux/pm_runtime.h`, `linux/regmap.h`.
- Detected declarations: `function arizona_map_irq`, `function arizona_request_irq`, `function arizona_free_irq`, `function arizona_set_irq_wake`, `function arizona_boot_done`, `function arizona_ctrlif_err`, `function arizona_irq_thread`, `function gpio_get_value_cansleep`, `function arizona_irq_enable`, `function arizona_irq_map`.
- Atlas domain: Driver Families / drivers/mfd.
- Implementation status: integration implementation candidate.
- 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.