drivers/spi/spi-topcliff-pch.c
Source file repositories/reference/linux-study-clean/drivers/spi/spi-topcliff-pch.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/spi/spi-topcliff-pch.c- Extension
.c- Size
- 45418 bytes
- Lines
- 1686
- Domain
- Driver Families
- Bucket
- drivers/spi
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/delay.hlinux/pci.hlinux/wait.hlinux/spi/spi.hlinux/interrupt.hlinux/sched.hlinux/spi/spidev.hlinux/module.hlinux/device.hlinux/platform_device.hlinux/dmaengine.hlinux/pch_dma.h
Detected Declarations
struct pch_spi_dma_ctrlstruct pch_spi_datastruct pch_spi_board_datastruct pch_pd_dev_savefunction pch_spi_writeregfunction pch_spi_readregfunction pch_spi_setclr_regfunction pch_spi_set_host_modefunction pch_spi_clear_fifofunction pch_spi_handler_subfunction pch_spi_handlerfunction pch_spi_set_baud_ratefunction pch_spi_set_bits_per_wordfunction pch_spi_setup_transferfunction pch_spi_resetfunction pch_spi_transferfunction pch_spi_select_chipfunction pch_spi_set_txfunction pch_spi_nomore_transferfunction list_for_each_entry_safefunction pch_spi_set_irfunction pch_spi_copy_rx_datafunction pch_spi_copy_rx_data_for_dmafunction pch_spi_start_transferfunction pch_dma_rx_completefunction pch_spi_filterfunction pch_spi_request_dmafunction pch_spi_release_dmafunction pch_spi_handle_dmafunction pch_spi_process_messagesfunction list_for_each_entry_safefunction pch_spi_free_resourcesfunction pch_spi_get_resourcesfunction pch_free_dma_buffunction pch_alloc_dma_buffunction pch_spi_pd_probefunction pch_spi_pd_removefunction pch_spi_pd_suspendfunction pch_spi_pd_resumefunction pch_spi_probefunction pch_spi_removefunction pch_spi_suspendfunction pch_spi_resumefunction pch_spi_initfunction pch_spi_exitmodule init pch_spi_init
Annotated Snippet
static struct pci_driver pch_spi_pcidev_driver = {
.name = "pch_spi",
.id_table = pch_spi_pcidev_id,
.probe = pch_spi_probe,
.remove = pch_spi_remove,
.driver.pm = &pch_spi_pm_ops,
};
static int __init pch_spi_init(void)
{
int ret;
ret = platform_driver_register(&pch_spi_pd_driver);
if (ret)
return ret;
ret = pci_register_driver(&pch_spi_pcidev_driver);
if (ret) {
platform_driver_unregister(&pch_spi_pd_driver);
return ret;
}
return 0;
}
module_init(pch_spi_init);
static void __exit pch_spi_exit(void)
{
pci_unregister_driver(&pch_spi_pcidev_driver);
platform_driver_unregister(&pch_spi_pd_driver);
}
module_exit(pch_spi_exit);
module_param(use_dma, int, 0644);
MODULE_PARM_DESC(use_dma,
"to use DMA for data transfers pass 1 else 0; default 1");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Intel EG20T PCH/LAPIS Semiconductor ML7xxx IOH SPI Driver");
MODULE_DEVICE_TABLE(pci, pch_spi_pcidev_id);
Annotation
- Immediate include surface: `linux/delay.h`, `linux/pci.h`, `linux/wait.h`, `linux/spi/spi.h`, `linux/interrupt.h`, `linux/sched.h`, `linux/spi/spidev.h`, `linux/module.h`.
- Detected declarations: `struct pch_spi_dma_ctrl`, `struct pch_spi_data`, `struct pch_spi_board_data`, `struct pch_pd_dev_save`, `function pch_spi_writereg`, `function pch_spi_readreg`, `function pch_spi_setclr_reg`, `function pch_spi_set_host_mode`, `function pch_spi_clear_fifo`, `function pch_spi_handler_sub`.
- Atlas domain: Driver Families / drivers/spi.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.