STRUCT NAND_CHIP_OPS(9)
π NAME π
okay so welcome to the Kernel API Manual bestie, this is the page for struct nand_chip_ops β literally just NAND chip operations π
that's the whole vibe, it's a bundle of function pointers that say "here's how you talk to this chip."
β¨ SYNOPSIS β¨
here's the shape of it, no cap, copy it exactly:
struct nand_chip_ops {
int (*suspend)(struct nand_chip *chip);
void (*resume)(struct nand_chip *chip);
int (*lock_area)(struct nand_chip *chip, loff_t ofs, uint64_t len);
int (*unlock_area)(struct nand_chip *chip, loff_t ofs, uint64_t len);
int (*setup_read_retry)(struct nand_chip *chip, int retry_mode);
int (*choose_interface_config)(struct nand_chip *chip, struct nand_interface_config *iface);
};
π Members π
okay so let's meet the squad, one by one π«Ά
suspendβ the suspend operation. your chip gets told to go nap π΄resumeβ the resume operation. wake up babe, we're doing NAND stuff again β¨lock_areaβ the lock operation. takes achip, anofs(loff_t) and alen(uint64_t), and locks that area down πunlock_areaβ the unlock operation. samechip,ofs,lentrio, but now we're freeing it πsetup_read_retryβ sets the read-retry mode (and the manpage is very clear on this: it's mostly needed for MLC NANDs, so if you're on MLC, this is your main character π₯ it takes thechipplus anint retry_mode)choose_interface_configβ picks the best interface configuration π― takes thechipand astruct nand_interface_config *iface, and goes off to find the slayest possible setup
π SEE ALSO π
the source of truth lives in the kernel file ./include/linux/mtd/rawnand.h, and the whole friend group is here β like, all of them, I'm not skipping a single one π
struct nand_parameters(9)struct nand_id(9)struct nand_ecc_step_info(9)struct nand_ecc_caps(9)struct nand_ecc_ctrl(9)struct nand_sdr_timings(9)struct nand_nvddr_timings(9)enum nand_interface_type(9)struct nand_interface_config(9)nand_interface_is_sdr(9)nand_interface_is_nvddr(9)nand_get_sdr_timings(9)nand_get_nvddr_timings(9)struct nand_op_cmd_instr(9)struct nand_op_addr_instr(9)struct nand_op_data_instr(9)struct nand_op_waitrdy_instr(9)enum nand_op_instr_type(9)struct nand_op_instr(9)struct nand_subop(9)struct nand_op_parser_addr_constraints(9)struct nand_op_parser_data_constraints(9)struct nand_op_parser_pattern_elem(9)struct nand_op_parser_pattern(9)struct nand_op_parser(9)struct nand_operation(9)struct nand_controller_ops(9)struct nand_controller(9)struct nand_legacy(9)struct nand_manufacturer(9)struct nand_secure_region(9)struct nand_chip(9)nand_get_interface_config(9)struct nand_flash_dev(9)nand_opcode_8bits(9)nand_get_data_buf(9)
anyway that's the whole page bestie, go read rawnand.h and slay π
ok and for the credits moment because we always do the credits moment: this lil page came out of./include/linux/mtd, dated October 2026, and it's filed understruct nand_chip_ops(9). iconic, no notes ππΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms