drivers/media/pci/cx25821/cx25821-alsa.c

Source file repositories/reference/linux-study-clean/drivers/media/pci/cx25821/cx25821-alsa.c

File Facts

System
Linux kernel
Corpus path
drivers/media/pci/cx25821/cx25821-alsa.c
Extension
.c
Size
20528 bytes
Lines
821
Domain
Driver Families
Bucket
drivers/media
Inferred role
Driver Families: operation-table or driver-model contract
Status
pattern 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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct device_driver *drv = driver_find("cx25821", &pci_bus_type);
	int ret;

	ret = driver_for_each_device(drv, NULL, NULL, cx25821_alsa_exit_callback);
	if (ret)
		pr_err("%s failed to find a cx25821 driver.\n", __func__);
}

static int cx25821_alsa_init_callback(struct device *dev, void *data)
{
	struct v4l2_device *v4l2_dev = dev_get_drvdata(dev);
	struct cx25821_dev *cxdev = get_cx25821(v4l2_dev);

	cx25821_audio_initdev(cxdev);
	return 0;
}

/*
 * Module initializer
 *
 * Loops through present saa7134 cards, and assigns an ALSA device
 * to each one
 *
 */
static int cx25821_alsa_init(void)
{
	struct device_driver *drv = driver_find("cx25821", &pci_bus_type);

	return driver_for_each_device(drv, NULL, NULL, cx25821_alsa_init_callback);

}

late_initcall(cx25821_alsa_init);
module_exit(cx25821_audio_fini);

Annotation

Implementation Notes