drivers/fpga/xilinx-spi.c
Source file repositories/reference/linux-study-clean/drivers/fpga/xilinx-spi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/fpga/xilinx-spi.c- Extension
.c- Size
- 1983 bytes
- Lines
- 90
- Domain
- Driver Families
- Bucket
- drivers/fpga
- 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.
- 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
xilinx-core.hlinux/module.hlinux/mod_devicetable.hlinux/of.hlinux/spi/spi.h
Detected Declarations
function Copyrightfunction xilinx_spi_probe
Annotated Snippet
if (ret) {
dev_err(core->dev, "SPI error in firmware write: %d\n",
ret);
return ret;
}
fw_data += stride;
}
return 0;
}
static int xilinx_spi_probe(struct spi_device *spi)
{
struct xilinx_fpga_core *core;
core = devm_kzalloc(&spi->dev, sizeof(*core), GFP_KERNEL);
if (!core)
return -ENOMEM;
core->dev = &spi->dev;
core->write = xilinx_spi_write;
return xilinx_core_probe(core);
}
static const struct spi_device_id xilinx_spi_ids[] = {
{ "fpga-slave-serial" },
{ },
};
MODULE_DEVICE_TABLE(spi, xilinx_spi_ids);
#ifdef CONFIG_OF
static const struct of_device_id xlnx_spi_of_match[] = {
{
.compatible = "xlnx,fpga-slave-serial",
},
{}
};
MODULE_DEVICE_TABLE(of, xlnx_spi_of_match);
#endif
static struct spi_driver xilinx_slave_spi_driver = {
.driver = {
.name = "xlnx-slave-spi",
.of_match_table = of_match_ptr(xlnx_spi_of_match),
},
.probe = xilinx_spi_probe,
.id_table = xilinx_spi_ids,
};
module_spi_driver(xilinx_slave_spi_driver)
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Anatolij Gustschin <agust@denx.de>");
MODULE_DESCRIPTION("Load Xilinx FPGA firmware over SPI");
Annotation
- Immediate include surface: `xilinx-core.h`, `linux/module.h`, `linux/mod_devicetable.h`, `linux/of.h`, `linux/spi/spi.h`.
- Detected declarations: `function Copyright`, `function xilinx_spi_probe`.
- Atlas domain: Driver Families / drivers/fpga.
- Implementation status: source 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.