drivers/media/radio/radio-isa.c

Source file repositories/reference/linux-study-clean/drivers/media/radio/radio-isa.c

File Facts

System
Linux kernel
Corpus path
drivers/media/radio/radio-isa.c
Extension
.c
Size
9938 bytes
Lines
378
Domain
Driver Families
Bucket
drivers/media
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.

Dependency Surface

Detected Declarations

Annotated Snippet

if (request_region(io, drv->region_size, v4l2_dev->name)) {
				bool found = ops->probe(isa, io);

				release_region(io, drv->region_size);
				if (found) {
					isa->io = io;
					break;
				}
			}
		}
	}

	if (!radio_isa_valid_io(drv, isa->io)) {
		int i;

		if (isa->io < 0)
			return -ENODEV;
		v4l2_err(v4l2_dev, "you must set an I/O address with io=0x%03x",
				drv->io_ports[0]);
		for (i = 1; i < drv->num_of_io_ports; i++)
			printk(KERN_CONT "/0x%03x", drv->io_ports[i]);
		printk(KERN_CONT ".\n");
		kfree(isa);
		return -EINVAL;
	}

	return radio_isa_common_probe(isa, pdev, drv->radio_nr_params[dev],
					drv->region_size);
}
EXPORT_SYMBOL_GPL(radio_isa_probe);

void radio_isa_remove(struct device *pdev, unsigned int dev)
{
	struct radio_isa_card *isa = dev_get_drvdata(pdev);

	radio_isa_common_remove(isa, isa->drv->region_size);
}
EXPORT_SYMBOL_GPL(radio_isa_remove);

#ifdef CONFIG_PNP
int radio_isa_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
{
	struct pnp_driver *pnp_drv = to_pnp_driver(dev->dev.driver);
	struct radio_isa_driver *drv = container_of(pnp_drv,
					struct radio_isa_driver, pnp_driver);
	struct radio_isa_card *isa;

	if (!pnp_port_valid(dev, 0))
		return -ENODEV;

	isa = radio_isa_alloc(drv, &dev->dev);
	if (!isa)
		return -ENOMEM;

	isa->io = pnp_port_start(dev, 0);

	return radio_isa_common_probe(isa, &dev->dev, drv->radio_nr_params[0],
					pnp_port_len(dev, 0));
}
EXPORT_SYMBOL_GPL(radio_isa_pnp_probe);

void radio_isa_pnp_remove(struct pnp_dev *dev)
{
	struct radio_isa_card *isa = dev_get_drvdata(&dev->dev);

	radio_isa_common_remove(isa, pnp_port_len(dev, 0));
}
EXPORT_SYMBOL_GPL(radio_isa_pnp_remove);
#endif

Annotation

Implementation Notes