STRUCT PLATFORM_NAND_CTRL(9)
β¨ struct platform_nand_ctrl(9) β¨
okay so picture this: it's giving Kernel API Manual energy, and today's main character is struct platform_nand_ctrl β the controller level device structure. that's the whole vibe. bestie, this is the struct you reach for when you're working at the controller layer of NAND flash, and honestly? she's iconic. π
π NAME π
struct platform_nand_ctrl β the controller level device structure. literally what it says on the tin, no cap. πΈ
π¦ SYNOPSIS π¦
here's the whole glow-up, verbatim, don't touch the code bestie:
struct platform_nand_ctrl {
int (*probe)(struct platform_device *pdev);
void (*remove)(struct platform_device *pdev);
int (*dev_ready)(struct nand_chip *chip);
void (*select_chip)(struct nand_chip *chip, int cs);
void (*cmd_ctrl)(struct nand_chip *chip, int dat, unsigned int
ctrl);
void (*write_buf)(struct nand_chip *chip, const uint8_t *buf, int
len);
void (*read_buf)(struct nand_chip *chip, uint8_t *buf, int len);
void *priv;
};
like, look at all those function pointers. she's fully stacked. π«Ά
π Members π
okay let's meet the cast, one by one, no skipping π
probeβ the platform specific function that probes/sets up the hardware. it's the "hey bestie, wake up, we're doing this" moment. β¨removeβ the platform specific function that removes/tears down the hardware. it's the goodbye. π tear down responsibly.dev_readyβ the platform specific function that reads the ready/busy pin. she's just checking in on you, that's all. πselect_chipβ the platform specific chip select function. picking your fave, one chip at a time πcmd_ctrlβ the platform specific function for controllingALE/CLE/nCE. also used to write command and address. miss girl is doing so much work, highkey the busiest one here π₯write_bufβ the platform specific function for write buffer. sending the data out πread_bufβ the platform specific function for read buffer. receiving the data in. the way that these two are a matched set, i can't πprivβ private data to transport driver specific settings. it's the little handbag where your driver keeps its own stuff π
π Description π
okay so the important thing, and i need you to hear me on this:
all fields are optional and depend on the hardware driver requirements π
every single one. optional. none of them are the moment until your hardware driver says they are. so don't stress about filling the whole struct, just fill what your hardware actually needs. fr fr. π¦
π SEE ALSO π
go read these next, bestie, i'm obsessed with cross-referencing:
- the kernel file
./include/linux/mtd/platnand.h struct platform_nand_chip(9)struct platform_nand_data(9)
and that's the tea π this little write-up lives in ./include/linux/mtd, dated October 2026 β same header/footer energy, just cuter. mwah, go read your structs ππ§ββοΈ
π¦ 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