sound/hda/controllers/cix-ipbloq.c
Source file repositories/reference/linux-study-clean/sound/hda/controllers/cix-ipbloq.c
File Facts
- System
- Linux kernel
- Corpus path
sound/hda/controllers/cix-ipbloq.c- Extension
.c- Size
- 10764 bytes
- Lines
- 435
- Domain
- Driver Families
- Bucket
- sound/hda
- 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.
- 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/clk.hlinux/interrupt.hlinux/io.hlinux/kernel.hlinux/module.hlinux/mutex.hlinux/of.hlinux/of_reserved_mem.hlinux/platform_device.hlinux/pm_runtime.hlinux/reset.hlinux/string.hsound/hda_codec.hhda_controller.h
Detected Declarations
struct cix_ipbloq_hdafunction cix_ipbloq_hda_dev_disconnectfunction cix_ipbloq_hda_dev_freefunction cix_ipbloq_hda_probe_codecfunction cix_ipbloq_hda_initfunction cix_ipbloq_hda_createfunction cix_ipbloq_hda_probefunction cix_ipbloq_hda_removefunction cix_ipbloq_hda_shutdownfunction cix_ipbloq_hda_suspendfunction cix_ipbloq_hda_resumefunction cix_ipbloq_hda_runtime_suspendfunction cix_ipbloq_hda_runtime_resume
Annotated Snippet
struct cix_ipbloq_hda {
struct azx chip;
struct device *dev;
void __iomem *regs;
struct reset_control *reset;
struct clk_bulk_data clocks[2];
unsigned int nclocks;
};
static const struct hda_controller_ops cix_ipbloq_hda_ops;
static int cix_ipbloq_hda_dev_disconnect(struct snd_device *device)
{
struct azx *chip = device->device_data;
chip->bus.shutdown = 1;
return 0;
}
static int cix_ipbloq_hda_dev_free(struct snd_device *device)
{
struct azx *chip = device->device_data;
if (azx_bus(chip)->chip_init) {
azx_stop_all_streams(chip);
azx_stop_chip(chip);
}
azx_free_stream_pages(chip);
azx_free_streams(chip);
snd_hdac_bus_exit(azx_bus(chip));
return 0;
}
static int cix_ipbloq_hda_probe_codec(struct cix_ipbloq_hda *hda)
{
struct azx *chip = &hda->chip;
struct hdac_bus *bus = azx_bus(chip);
int err;
to_hda_bus(bus)->bus_probing = 1;
/* create codec instances */
err = azx_probe_codecs(chip, 8);
if (err < 0) {
dev_err(hda->dev, "probe codecs failed: %d\n", err);
return err;
}
err = azx_codec_configure(chip);
if (err < 0) {
dev_err(hda->dev, "codec configure failed: %d\n", err);
return err;
}
err = snd_card_register(chip->card);
if (err < 0) {
dev_err(hda->dev, "card register failed: %d\n", err);
return err;
}
chip->running = 1;
to_hda_bus(bus)->bus_probing = 0;
snd_hda_set_power_save(&chip->bus, CIX_IPBLOQ_POWER_SAVE_DEFAULT_TIME_MS);
return 0;
}
static int cix_ipbloq_hda_init(struct cix_ipbloq_hda *hda,
struct azx *chip,
struct platform_device *pdev)
{
const char *sname = NULL, *drv_name = "cix-ipbloq-hda";
struct hdac_bus *bus = azx_bus(chip);
struct snd_card *card = chip->card;
struct resource *res;
unsigned short gcap;
int irq_id, err;
hda->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(hda->regs)) {
dev_err(hda->dev, "failed to get and ioremap resource\n");
return PTR_ERR(hda->regs);
}
bus->remap_addr = hda->regs;
Annotation
- Immediate include surface: `linux/clk.h`, `linux/interrupt.h`, `linux/io.h`, `linux/kernel.h`, `linux/module.h`, `linux/mutex.h`, `linux/of.h`, `linux/of_reserved_mem.h`.
- Detected declarations: `struct cix_ipbloq_hda`, `function cix_ipbloq_hda_dev_disconnect`, `function cix_ipbloq_hda_dev_free`, `function cix_ipbloq_hda_probe_codec`, `function cix_ipbloq_hda_init`, `function cix_ipbloq_hda_create`, `function cix_ipbloq_hda_probe`, `function cix_ipbloq_hda_remove`, `function cix_ipbloq_hda_shutdown`, `function cix_ipbloq_hda_suspend`.
- Atlas domain: Driver Families / sound/hda.
- Implementation status: source 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.