drivers/gpu/drm/i915/display/intel_lpe_audio.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_lpe_audio.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_lpe_audio.c- Extension
.c- Size
- 10607 bytes
- Lines
- 368
- Domain
- Driver Families
- Bucket
- drivers/gpu
- 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/acpi.hlinux/delay.hlinux/device.hlinux/irq.hlinux/pci.hlinux/platform_device.hlinux/pm_runtime.hdrm/drm_print.hdrm/intel/intel_lpe_audio.hdrm/intel/pci_config.hintel_audio_regs.hintel_de.hintel_lpe_audio.h
Detected Declarations
function filesfunction lpe_audio_platdev_destroyfunction lpe_audio_irq_unmaskfunction lpe_audio_irq_initfunction lpe_audio_detectfunction lpe_audio_setupfunction intel_lpe_audio_irq_handlerfunction intel_lpe_audio_initfunction intel_lpe_audio_teardownfunction intel_lpe_audio_notify
Annotated Snippet
if (!pci_dev_present(atom_hdaudio_ids)) {
drm_info(display->drm,
"HDaudio controller not detected, using LPE audio instead\n");
lpe_present = true;
}
}
return lpe_present;
}
static int lpe_audio_setup(struct intel_display *display)
{
int ret;
display->audio.lpe.irq = irq_alloc_desc(0);
if (display->audio.lpe.irq < 0) {
drm_err(display->drm, "Failed to allocate IRQ desc: %d\n",
display->audio.lpe.irq);
ret = display->audio.lpe.irq;
goto err;
}
drm_dbg(display->drm, "irq = %d\n", display->audio.lpe.irq);
ret = lpe_audio_irq_init(display);
if (ret) {
drm_err(display->drm,
"Failed to initialize irqchip for lpe audio: %d\n",
ret);
goto err_free_irq;
}
display->audio.lpe.platdev = lpe_audio_platdev_create(display);
if (IS_ERR(display->audio.lpe.platdev)) {
ret = PTR_ERR(display->audio.lpe.platdev);
drm_err(display->drm,
"Failed to create lpe audio platform device: %d\n",
ret);
goto err_free_irq;
}
/* enable chicken bit; at least this is required for Dell Wyse 3040
* with DP outputs (but only sometimes by some reason!)
*/
intel_de_write(display, VLV_AUD_CHICKEN_BIT_REG,
VLV_CHICKEN_BIT_DBG_ENABLE);
return 0;
err_free_irq:
irq_free_desc(display->audio.lpe.irq);
err:
display->audio.lpe.irq = -1;
display->audio.lpe.platdev = NULL;
return ret;
}
/**
* intel_lpe_audio_irq_handler() - forwards the LPE audio irq
* @display: display device
*
* the LPE Audio irq is forwarded to the irq handler registered by LPE audio
* driver.
*/
void intel_lpe_audio_irq_handler(struct intel_display *display)
{
int ret;
if (!HAS_LPE_AUDIO(display))
return;
ret = generic_handle_irq(display->audio.lpe.irq);
if (ret)
drm_err_ratelimited(display->drm,
"error handling LPE audio irq: %d\n", ret);
}
/**
* intel_lpe_audio_init() - detect and setup the bridge between HDMI LPE Audio
* driver and i915
* @display: display device
*
* Return: 0 if successful. non-zero if detection or
* llocation/initialization fails
*/
int intel_lpe_audio_init(struct intel_display *display)
{
int ret = -ENODEV;
if (lpe_audio_detect(display)) {
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/delay.h`, `linux/device.h`, `linux/irq.h`, `linux/pci.h`, `linux/platform_device.h`, `linux/pm_runtime.h`, `drm/drm_print.h`.
- Detected declarations: `function files`, `function lpe_audio_platdev_destroy`, `function lpe_audio_irq_unmask`, `function lpe_audio_irq_init`, `function lpe_audio_detect`, `function lpe_audio_setup`, `function intel_lpe_audio_irq_handler`, `function intel_lpe_audio_init`, `function intel_lpe_audio_teardown`, `function intel_lpe_audio_notify`.
- Atlas domain: Driver Families / drivers/gpu.
- 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.