]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mtd: spi-nor: swp: Create helpers for building the SR register
authorMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 26 May 2026 14:56:38 +0000 (16:56 +0200)
committerPratyush Yadav <pratyush@kernel.org>
Tue, 26 May 2026 15:21:04 +0000 (17:21 +0200)
commit290e83833688b4df0da746af4c5fb87dbed2834a
tree0f7ac6884a3c28fa915f484e8ce20fbc42ab53b3
parentba32a259dd32af911e4f4fd49cdd7f32a40ccde5
mtd: spi-nor: swp: Create helpers for building the SR register

The status register contains 3 or 4 BP (Block Protect) bits, 0 or 1
TB (Top/Bottom) bit, soon 0 or 1 CMP (Complement) bit. The last BP bit
and the TB bit locations change between vendors. The whole logic of
buildling the content of the status register based on some input
conditions is used two times and soon will be used 4 times.

Create dedicated helpers for these steps.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Pratyush Yadav <pratyush@kernel.org>
drivers/mtd/spi-nor/swp.c