spi_nor_soft_reset(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ spi_nor_soft_reset(9) ✨

okay so bestie, welcome to the Kernel API Manual πŸ’… this one's a lil function that hits the factory-reset button on your flash chip, and honestly? she's iconic for it πŸŽ€


🌸 NAME 🌸

spi_nor_soft_reset β€” perform a software reset 🫢


⭐ SYNOPSIS ⭐

void spi_nor_soft_reset (struct spi_nor *nor );

πŸ’œ ARGUMENTS πŸ’œ

  • nor β€” pointer to struct spi_nor πŸ’– that's it, that's the whole input, she takes one (1) pointer and she's off

🌈 DESCRIPTION 🌈

So what she does is run a "Soft Reset and Enter Default Protocol Mode" sequence, which resets the device allll the way back to its power-on-reset state ✨ like a little factory reset moment, no cap. Which is genuinely useful when your software has been out here making changes to device (volatile) registers and needs to reset it before shutting down β€” for example πŸ™ˆ

⚠️ okay important, real talk: not every flash supports this sequence. The same set of opcodes might be used for some other operation on a flash that doesn't support this. So don't just assume, bestie 😭

You can find out whether this sequence is supported via SFDP in the BFPT table πŸ‘‘


πŸ¦‹ RETURN πŸ¦‹

0 on success, -errno otherwise πŸ’€ (so like, zero means slay, negative means the kernel is telling you exactly what went wrong, iykyk)


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/mtd/spi-nor/core.c β€” and the whole girlies of the spi_nor cinematic universe, all (9):


and that's the whole page, bestie πŸ’œ go forth and reset things responsibly, mwah 🧚

shoutout to ./drivers/mtd/spi-nor for hosting this masterpiece, and October 2026 for the timestamp β€” see you in the docs, periodt πŸ’…βœ¨

πŸ“¦ where this page comes from