drivers/mtd/nand/raw/cs553x_nand.c
Source file repositories/reference/linux-study-clean/drivers/mtd/nand/raw/cs553x_nand.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mtd/nand/raw/cs553x_nand.c- Extension
.c- Size
- 10996 bytes
- Lines
- 422
- Domain
- Driver Families
- Bucket
- drivers/mtd
- 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.
- 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/kernel.hlinux/slab.hlinux/init.hlinux/module.hlinux/delay.hlinux/mtd/mtd.hlinux/mtd/rawnand.hlinux/mtd/partitions.hlinux/iopoll.hasm/msr.h
Detected Declarations
struct cs553x_nand_controllerfunction to_cs553xfunction cs553x_write_ctrl_bytefunction cs553x_data_infunction cs553x_data_outfunction cs553x_wait_readyfunction cs553x_exec_instrfunction cs553x_exec_opfunction cs_enable_hweccfunction cs_calculate_eccfunction cs553x_attach_chipfunction cs553x_init_onefunction is_geodefunction cs553x_initfunction cs553x_cleanupmodule init cs553x_init
Annotated Snippet
module_init(cs553x_init);
static void __exit cs553x_cleanup(void)
{
int i;
for (i = 0; i < NR_CS553X_CONTROLLERS; i++) {
struct cs553x_nand_controller *controller = controllers[i];
struct nand_chip *this = &controller->chip;
struct mtd_info *mtd = nand_to_mtd(this);
int ret;
if (!mtd)
continue;
/* Release resources, unregister device */
ret = mtd_device_unregister(mtd);
WARN_ON(ret);
nand_cleanup(this);
kfree(mtd->name);
controllers[i] = NULL;
/* unmap physical address */
iounmap(controller->mmio);
/* Free the MTD device structure */
kfree(controller);
}
}
module_exit(cs553x_cleanup);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
MODULE_DESCRIPTION("NAND controller driver for AMD CS5535/CS5536 companion chip");
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/slab.h`, `linux/init.h`, `linux/module.h`, `linux/delay.h`, `linux/mtd/mtd.h`, `linux/mtd/rawnand.h`, `linux/mtd/partitions.h`.
- Detected declarations: `struct cs553x_nand_controller`, `function to_cs553x`, `function cs553x_write_ctrl_byte`, `function cs553x_data_in`, `function cs553x_data_out`, `function cs553x_wait_ready`, `function cs553x_exec_instr`, `function cs553x_exec_op`, `function cs_enable_hwecc`, `function cs_calculate_ecc`.
- Atlas domain: Driver Families / drivers/mtd.
- Implementation status: integration 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.