drivers/mtd/nand/raw/ingenic/ingenic_ecc.h
Source file repositories/reference/linux-study-clean/drivers/mtd/nand/raw/ingenic/ingenic_ecc.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/mtd/nand/raw/ingenic/ingenic_ecc.h- Extension
.h- Size
- 2124 bytes
- Lines
- 84
- Domain
- Driver Families
- Bucket
- drivers/mtd
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/compiler_types.hlinux/err.hlinux/mutex.hlinux/types.huapi/asm-generic/errno-base.h
Detected Declarations
struct clkstruct devicestruct ingenic_eccstruct platform_devicestruct ingenic_ecc_paramsstruct ingenic_ecc_opsstruct ingenic_eccfunction ingenic_ecc_calculatefunction ingenic_ecc_correctfunction ingenic_ecc_release
Annotated Snippet
struct ingenic_ecc_params {
int size;
int bytes;
int strength;
};
#if IS_ENABLED(CONFIG_MTD_NAND_INGENIC_ECC)
int ingenic_ecc_calculate(struct ingenic_ecc *ecc,
struct ingenic_ecc_params *params,
const u8 *buf, u8 *ecc_code);
int ingenic_ecc_correct(struct ingenic_ecc *ecc,
struct ingenic_ecc_params *params, u8 *buf,
u8 *ecc_code);
void ingenic_ecc_release(struct ingenic_ecc *ecc);
struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *np);
#else /* CONFIG_MTD_NAND_INGENIC_ECC */
static inline int ingenic_ecc_calculate(struct ingenic_ecc *ecc,
struct ingenic_ecc_params *params,
const u8 *buf, u8 *ecc_code)
{
return -ENODEV;
}
static inline int ingenic_ecc_correct(struct ingenic_ecc *ecc,
struct ingenic_ecc_params *params, u8 *buf,
u8 *ecc_code)
{
return -ENODEV;
}
static inline void ingenic_ecc_release(struct ingenic_ecc *ecc)
{
}
static inline struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *np)
{
return ERR_PTR(-ENODEV);
}
#endif /* CONFIG_MTD_NAND_INGENIC_ECC */
struct ingenic_ecc_ops {
void (*disable)(struct ingenic_ecc *ecc);
int (*calculate)(struct ingenic_ecc *ecc,
struct ingenic_ecc_params *params,
const u8 *buf, u8 *ecc_code);
int (*correct)(struct ingenic_ecc *ecc,
struct ingenic_ecc_params *params,
u8 *buf, u8 *ecc_code);
};
struct ingenic_ecc {
struct device *dev;
const struct ingenic_ecc_ops *ops;
void __iomem *base;
struct clk *clk;
struct mutex lock;
};
int ingenic_ecc_probe(struct platform_device *pdev);
#endif /* __DRIVERS_MTD_NAND_INGENIC_ECC_INTERNAL_H__ */
Annotation
- Immediate include surface: `linux/compiler_types.h`, `linux/err.h`, `linux/mutex.h`, `linux/types.h`, `uapi/asm-generic/errno-base.h`.
- Detected declarations: `struct clk`, `struct device`, `struct ingenic_ecc`, `struct platform_device`, `struct ingenic_ecc_params`, `struct ingenic_ecc_ops`, `struct ingenic_ecc`, `function ingenic_ecc_calculate`, `function ingenic_ecc_correct`, `function ingenic_ecc_release`.
- Atlas domain: Driver Families / drivers/mtd.
- 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.