sound/soc/sdca/sdca_interrupts.c
Source file repositories/reference/linux-study-clean/sound/soc/sdca/sdca_interrupts.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/sdca/sdca_interrupts.c- Extension
.c- Size
- 18845 bytes
- Lines
- 712
- Domain
- Driver Families
- Bucket
- sound/soc
- 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.
- 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/bitmap.hlinux/bits.hlinux/cleanup.hlinux/device.hlinux/dev_printk.hlinux/interrupt.hlinux/pm_runtime.hlinux/regmap.hlinux/soundwire/sdw.hlinux/soundwire/sdw_registers.hsound/sdca.hsound/sdca_fdl.hsound/sdca_function.hsound/sdca_hid.hsound/sdca_interrupts.hsound/sdca_jack.hsound/sdca_ump.hsound/soc-component.hsound/soc.h
Detected Declarations
function base_handlerfunction function_status_handlerfunction detected_mode_handlerfunction hid_handlerfunction no_pm_in_progressfunction no_pm_in_progressfunction fdl_owner_handlerfunction sdca_irq_request_lockedfunction sdca_irq_free_lockedfunction sdca_irq_requestfunction sdca_irq_freefunction sdca_irq_data_populatefunction registeredfunction sdca_irq_populatefunction sdca_irq_cleanupfunction irq_enable_flagsfunction sdca_irq_enable_earlyfunction sdca_irq_enablefunction sdca_irq_disable
Annotated Snippet
switch (BIT(mask)) {
case SDCA_CTL_ENTITY_0_FUNCTION_NEEDS_INITIALIZATION:
/*
* FIXME: Should this do init writes?
*
* Currently init writes/cache sync are done from the suspend/resume
* infrastructure. It is unclear in what situations one would receive this
* IRQ outside of that flow. Presumably it would be something like the chip
* crashing. In that case however doing the init writes and a cache sync might
* not be sufficient, for example if the failure was during audio playback
* there could be ordering constraints on the register writes to restore the
* state that are not handled by a simple cache sync.
*/
break;
case SDCA_CTL_ENTITY_0_FUNCTION_FAULT:
dev_err(dev, "function fault\n");
break;
case SDCA_CTL_ENTITY_0_UMP_SEQUENCE_FAULT:
dev_err(dev, "ump sequence fault\n");
break;
case SDCA_CTL_ENTITY_0_FUNCTION_BUSY:
dev_info(dev, "unexpected function busy\n");
break;
case SDCA_CTL_ENTITY_0_DEVICE_NEWLY_ATTACHED:
case SDCA_CTL_ENTITY_0_INTS_DISABLED_ABNORMALLY:
case SDCA_CTL_ENTITY_0_STREAMING_STOPPED_ABNORMALLY:
case SDCA_CTL_ENTITY_0_FUNCTION_HAS_BEEN_RESET:
break;
}
}
ret = regmap_write(interrupt->function_regmap, reg, val & 0x7F);
if (ret < 0) {
dev_err(dev, "failed to clear function status: %d\n", ret);
goto error;
}
irqret = IRQ_HANDLED;
error:
pm_runtime_put(dev);
return irqret;
}
static irqreturn_t detected_mode_handler(int irq, void *data)
{
struct sdca_interrupt *interrupt = data;
struct device *dev = interrupt->dev;
irqreturn_t irqret = IRQ_NONE;
int ret;
ret = pm_runtime_get_sync(dev);
if (ret < 0) {
dev_err(dev, "failed to resume for detected mode: %d\n", ret);
goto error;
}
ret = sdca_jack_process(interrupt);
if (ret)
goto error;
irqret = IRQ_HANDLED;
error:
pm_runtime_put(dev);
return irqret;
}
static irqreturn_t hid_handler(int irq, void *data)
{
struct sdca_interrupt *interrupt = data;
struct device *dev = interrupt->dev;
irqreturn_t irqret = IRQ_NONE;
int ret;
ret = pm_runtime_get_sync(dev);
if (ret < 0) {
dev_err(dev, "failed to resume for hid: %d\n", ret);
goto error;
}
ret = sdca_hid_process_report(interrupt);
if (ret)
goto error;
irqret = IRQ_HANDLED;
error:
pm_runtime_put(dev);
return irqret;
}
#ifdef CONFIG_PM_SLEEP
Annotation
- Immediate include surface: `linux/bitmap.h`, `linux/bits.h`, `linux/cleanup.h`, `linux/device.h`, `linux/dev_printk.h`, `linux/interrupt.h`, `linux/pm_runtime.h`, `linux/regmap.h`.
- Detected declarations: `function base_handler`, `function function_status_handler`, `function detected_mode_handler`, `function hid_handler`, `function no_pm_in_progress`, `function no_pm_in_progress`, `function fdl_owner_handler`, `function sdca_irq_request_locked`, `function sdca_irq_free_locked`, `function sdca_irq_request`.
- Atlas domain: Driver Families / sound/soc.
- 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.