sound/soc/sdca/sdca_fdl.c
Source file repositories/reference/linux-study-clean/sound/soc/sdca/sdca_fdl.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/sdca/sdca_fdl.c- Extension
.c- Size
- 13735 bytes
- Lines
- 502
- 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.
- 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/device.hlinux/dev_printk.hlinux/dmi.hlinux/firmware.hlinux/module.hlinux/pci.hlinux/pm_runtime.hlinux/regmap.hlinux/sprintf.hlinux/soundwire/sdw.hlinux/soundwire/sdw_registers.hsound/sdca.hsound/sdca_fdl.hsound/sdca_function.hsound/sdca_interrupts.hsound/sdca_ump.h
Detected Declarations
function sdca_reset_functionfunction sdca_fdl_syncfunction fdl_load_filefunction fdl_endfunction sdca_fdl_timeout_workfunction fdl_status_processfunction sdca_fdl_processfunction scoped_guardfunction sdca_fdl_alloc_state
Annotated Snippet
if (!time) {
dev_dbg(dev, "no new FDL starts\n");
nfdl--;
continue;
}
time = wait_for_completion_timeout(&fdl_state->done,
done_timeout);
if (!time) {
dev_err(dev, "timed out waiting for FDL to complete\n");
goto error;
}
}
if (!nfdl)
return 0;
}
dev_err(dev, "too many FDL requests\n");
error:
for (j = 0; j < SDCA_MAX_INTERRUPTS; j++) {
struct sdca_interrupt *interrupt = &info->irqs[j];
struct fdl_state *fdl_state;
if (interrupt->function != function ||
!interrupt->entity || !interrupt->control ||
interrupt->entity->type != SDCA_ENTITY_TYPE_XU ||
interrupt->control->sel != SDCA_CTL_XU_FDL_CURRENTOWNER)
continue;
disable_irq(interrupt->irq);
fdl_state = interrupt->priv;
sdca_ump_cancel_timeout(&fdl_state->timeout);
}
return -ETIMEDOUT;
}
EXPORT_SYMBOL_NS_GPL(sdca_fdl_sync, "SND_SOC_SDCA");
static char *fdl_get_sku_filename(struct device *dev,
struct sdca_fdl_file *fdl_file)
{
struct device *parent = dev;
const char *product_vendor;
const char *product_sku;
/*
* Try to find pci_dev manually because the card may not be ready to be
* used for snd_soc_card_get_pci_ssid yet
*/
while (parent) {
if (dev_is_pci(parent)) {
struct pci_dev *pci_dev = to_pci_dev(parent);
return kasprintf(GFP_KERNEL, "sdca/%x/%x/%x/%x.bin",
fdl_file->vendor_id,
pci_dev->subsystem_vendor,
pci_dev->subsystem_device,
fdl_file->file_id);
} else {
parent = parent->parent;
}
}
product_vendor = dmi_get_system_info(DMI_SYS_VENDOR);
if (!product_vendor || !strcmp(product_vendor, "Default string"))
product_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
if (!product_vendor || !strcmp(product_vendor, "Default string"))
product_vendor = dmi_get_system_info(DMI_CHASSIS_VENDOR);
if (!product_vendor)
product_vendor = "unknown";
product_sku = dmi_get_system_info(DMI_PRODUCT_SKU);
if (!product_sku || !strcmp(product_sku, "Default string"))
product_sku = dmi_get_system_info(DMI_PRODUCT_NAME);
if (!product_sku)
product_sku = "unknown";
return kasprintf(GFP_KERNEL, "sdca/%x/%s/%s/%x.bin", fdl_file->vendor_id,
product_vendor, product_sku, fdl_file->file_id);
}
static int fdl_load_file(struct sdca_interrupt *interrupt,
struct sdca_fdl_set *set, int file_index)
{
struct device *dev = interrupt->dev;
struct sdca_fdl_data *fdl_data = &interrupt->function->fdl_data;
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/device.h`, `linux/dev_printk.h`, `linux/dmi.h`, `linux/firmware.h`, `linux/module.h`, `linux/pci.h`, `linux/pm_runtime.h`.
- Detected declarations: `function sdca_reset_function`, `function sdca_fdl_sync`, `function fdl_load_file`, `function fdl_end`, `function sdca_fdl_timeout_work`, `function fdl_status_process`, `function sdca_fdl_process`, `function scoped_guard`, `function sdca_fdl_alloc_state`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: integration 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.