drivers/staging/media/atomisp/pci/hive_isp_css_common/host/irq.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/irq.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/irq.c- Extension
.c- Size
- 9636 bytes
- Lines
- 414
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
assert_support.hirq.hgp_device.hirq_private.h
Detected Declarations
function irq_clear_allfunction irq_enable_channelfunction irq_enable_pulsefunction irq_disable_channelfunction irq_get_channel_idfunction irq_raisefunction any_virq_signalfunction cnd_virq_enable_channelfunction virq_clear_allfunction virq_get_channel_signalsfunction virq_clear_infofunction virq_get_channel_idfunction irq_wait_for_write_completefunction any_irq_channel_enabledfunction virq_get_irq_id
Annotated Snippet
if (IRQ_NESTING_ID[ID] != N_virq_id) {
/* Single level nesting, otherwise we'd need to recurse */
irq_enable_channel(IRQ0_ID, IRQ_NESTING_ID[ID]);
}
} else {
irq_disable_channel(ID, channel_ID);
if ((IRQ_NESTING_ID[ID] != N_virq_id) && !any_irq_channel_enabled(ID)) {
/* Only disable the top if the nested ones are empty */
irq_disable_channel(IRQ0_ID, IRQ_NESTING_ID[ID]);
}
}
return;
}
void virq_clear_all(void)
{
irq_ID_t irq_id;
for (irq_id = (irq_ID_t)0; irq_id < N_IRQ_ID; irq_id++)
irq_clear_all(irq_id);
return;
}
enum hrt_isp_css_irq_status
virq_get_channel_signals(struct virq_info *irq_info)
{
enum hrt_isp_css_irq_status irq_status = hrt_isp_css_irq_status_error;
irq_ID_t ID;
assert(irq_info);
for (ID = (irq_ID_t)0 ; ID < N_IRQ_ID; ID++) {
if (any_irq_channel_enabled(ID)) {
hrt_data irq_data = irq_reg_load(ID,
_HRT_IRQ_CONTROLLER_STATUS_REG_IDX);
if (irq_data != 0) {
/* The error condition is an IRQ pulse received with no IRQ status written */
irq_status = hrt_isp_css_irq_status_success;
}
irq_info->irq_status_reg[ID] |= irq_data;
irq_reg_store(ID,
_HRT_IRQ_CONTROLLER_CLEAR_REG_IDX, irq_data);
irq_wait_for_write_complete(ID);
}
}
return irq_status;
}
void virq_clear_info(struct virq_info *irq_info)
{
irq_ID_t ID;
assert(irq_info);
for (ID = (irq_ID_t)0 ; ID < N_IRQ_ID; ID++)
irq_info->irq_status_reg[ID] = 0;
return;
}
enum hrt_isp_css_irq_status virq_get_channel_id(
enum virq_id *irq_id)
{
unsigned int irq_status = irq_reg_load(IRQ0_ID,
_HRT_IRQ_CONTROLLER_STATUS_REG_IDX);
unsigned int idx;
enum hrt_isp_css_irq_status status = hrt_isp_css_irq_status_success;
irq_ID_t ID;
assert(irq_id);
/* find the first irq bit on device 0 */
for (idx = 0; idx < IRQ_N_CHANNEL[IRQ0_ID]; idx++) {
if (irq_status & (1U << idx))
break;
}
if (idx == IRQ_N_CHANNEL[IRQ0_ID])
return hrt_isp_css_irq_status_error;
/* Check whether there are more bits set on device 0 */
if (irq_status != (1U << idx))
status = hrt_isp_css_irq_status_more_irqs;
Annotation
- Immediate include surface: `assert_support.h`, `irq.h`, `gp_device.h`, `irq_private.h`.
- Detected declarations: `function irq_clear_all`, `function irq_enable_channel`, `function irq_enable_pulse`, `function irq_disable_channel`, `function irq_get_channel_id`, `function irq_raise`, `function any_virq_signal`, `function cnd_virq_enable_channel`, `function virq_clear_all`, `function virq_get_channel_signals`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: source implementation candidate.
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.