STRUCT NAND_CHIP_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ 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 a chip, an ofs (loff_t) and a len (uint64_t), and locks that area down πŸ”’
  • unlock_area β€” the unlock operation. same chip, ofs, len trio, 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 the chip plus an int retry_mode)
  • choose_interface_config β€” picks the best interface configuration 🎯 takes the chip and a struct 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 under struct nand_chip_ops(9). iconic, no notes πŸ‘‘πŸŒΈ
πŸ“¦ where this page comes from