drivers/macintosh/macio_asic.c
Source file repositories/reference/linux-study-clean/drivers/macintosh/macio_asic.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/macintosh/macio_asic.c- Extension
.c- Size
- 20858 bytes
- Lines
- 799
- Domain
- Driver Families
- Bucket
- drivers/macintosh
- 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.
- 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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/string.hlinux/kernel.hlinux/pci.hlinux/pci_ids.hlinux/init.hlinux/module.hlinux/slab.hlinux/of.hlinux/of_address.hlinux/of_device.hlinux/of_platform.hlinux/of_irq.hasm/machdep.hasm/macio.hasm/pmac_feature.h
Detected Declarations
struct macio_devresfunction macio_bus_matchfunction macio_dev_putfunction macio_device_probefunction macio_device_removefunction macio_device_shutdownfunction macio_device_suspendfunction macio_device_resumefunction macio_device_modaliasfunction macio_bus_driver_initfunction macio_release_devfunction macio_resource_quirksfunction of_node_is_typefunction macio_create_fixup_irqfunction macio_add_missing_resourcesfunction macio_setup_interruptsfunction macio_setup_resourcesfunction macio_add_one_devicefunction macio_skip_devicefunction macio_pci_add_devicesfunction for_each_child_of_nodefunction for_each_child_of_nodefunction macio_register_driverfunction macio_unregister_driverfunction maciom_releasefunction macio_enable_devresfunction find_macio_drfunction macio_request_resourcefunction macio_release_resourcefunction macio_request_resourcesfunction macio_release_resourcesfunction macio_pci_probefunction macio_pci_removefunction macio_module_initmodule init macio_module_initexport macio_register_driverexport macio_unregister_driverexport macio_dev_getexport macio_dev_putexport macio_request_resourceexport macio_release_resourceexport macio_request_resourcesexport macio_release_resourcesexport macio_enable_devres
Annotated Snippet
static int macio_bus_match(struct device *dev, const struct device_driver *drv)
{
const struct of_device_id * matches = drv->of_match_table;
if (!matches)
return 0;
return of_match_device(matches, dev) != NULL;
}
struct macio_dev *macio_dev_get(struct macio_dev *dev)
{
struct device *tmp;
if (!dev)
return NULL;
tmp = get_device(&dev->ofdev.dev);
if (tmp)
return to_macio_device(tmp);
else
return NULL;
}
void macio_dev_put(struct macio_dev *dev)
{
if (dev)
put_device(&dev->ofdev.dev);
}
static int macio_device_probe(struct device *dev)
{
int error = -ENODEV;
struct macio_driver *drv;
struct macio_dev *macio_dev;
const struct of_device_id *match;
drv = to_macio_driver(dev->driver);
macio_dev = to_macio_device(dev);
if (!drv->probe)
return error;
macio_dev_get(macio_dev);
match = of_match_device(drv->driver.of_match_table, dev);
if (match)
error = drv->probe(macio_dev, match);
if (error)
macio_dev_put(macio_dev);
return error;
}
static void macio_device_remove(struct device *dev)
{
struct macio_dev * macio_dev = to_macio_device(dev);
struct macio_driver * drv = to_macio_driver(dev->driver);
if (dev->driver && drv->remove)
drv->remove(macio_dev);
macio_dev_put(macio_dev);
}
static void macio_device_shutdown(struct device *dev)
{
struct macio_dev * macio_dev = to_macio_device(dev);
struct macio_driver * drv = to_macio_driver(dev->driver);
if (dev->driver && drv->shutdown)
drv->shutdown(macio_dev);
}
static int macio_device_suspend(struct device *dev, pm_message_t state)
{
struct macio_dev * macio_dev = to_macio_device(dev);
struct macio_driver * drv = to_macio_driver(dev->driver);
if (dev->driver && drv->suspend)
return drv->suspend(macio_dev, state);
return 0;
}
static int macio_device_resume(struct device * dev)
{
struct macio_dev * macio_dev = to_macio_device(dev);
struct macio_driver * drv = to_macio_driver(dev->driver);
if (dev->driver && drv->resume)
return drv->resume(macio_dev);
Annotation
- Immediate include surface: `linux/string.h`, `linux/kernel.h`, `linux/pci.h`, `linux/pci_ids.h`, `linux/init.h`, `linux/module.h`, `linux/slab.h`, `linux/of.h`.
- Detected declarations: `struct macio_devres`, `function macio_bus_match`, `function macio_dev_put`, `function macio_device_probe`, `function macio_device_remove`, `function macio_device_shutdown`, `function macio_device_suspend`, `function macio_device_resume`, `function macio_device_modalias`, `function macio_bus_driver_init`.
- Atlas domain: Driver Families / drivers/macintosh.
- Implementation status: pattern 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.