[PATCH v1 00/14] mtd: spi-nor: move vendor specific code into vendor modules
From: Michael Walle
Date: Wed Feb 02 2022 - 09:59:08 EST
It turns out that most of the special status register handling is
specific for a particular vendor. I.e. Xilinx has some different
opcodes for the status register read, Micron has an additional FSR
register and Spansion has these flags integrated into the SR.
Create a callback to ready() where a flash chip can register its
own function. This will let us move all the vendor specific stuff
out of the core into the vendor modules.
Please note that this is only compile-time tested.
For sake of consistency and better readability of the code flow,
I also converted the setup() callback to be optional.
Michael Walle (14):
mtd: spi-nor: export more function to be used in vendor modules
mtd: spi-nor: slightly refactor the spi_nor_setup()
mtd: spi-nor: allow a flash to define its own ready() function
mtd: spi-nor: move all xilinx specifics into xilinx.c
mtd: spi-nor: xilinx: rename vendor specific functions and defines
mtd: spi-nor: xilinx: correct the debug message
mtd: spi-nor: move all micron-st specifics into micron-st.c
mtd: spi-nor: micron-st: convert USE_FSR to a manufacturer flag
mtd: spi-nor: micron-st: fix micron_st prefix
mtd: spi-nor: micron-st: rename vendor specific functions and defines
mtd: spi-nor: spansion: slightly rework control flow in late_init()
mtd: spi-nor: move all spansion specifics into spansion.c
mtd: spi-nor: spansion: convert USE_CLSR to a manufacturer flag
mtd: spi-nor: renumber flags
drivers/mtd/spi-nor/core.c | 265 ++------------------------------
drivers/mtd/spi-nor/core.h | 70 ++++-----
drivers/mtd/spi-nor/micron-st.c | 225 ++++++++++++++++++++++-----
drivers/mtd/spi-nor/spansion.c | 133 ++++++++++++----
drivers/mtd/spi-nor/xilinx.c | 79 +++++++++-
include/linux/mtd/spi-nor.h | 18 ---
6 files changed, 417 insertions(+), 373 deletions(-)
--
2.30.2