Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mtd: spinand: Decouple write enable and write disable operations

In order to introduce templates for all operations and not only for page
helpers (in order to introduce octal DDR support), decouple the WR_EN
and WR_DIS operations into two separate macros.

Adapt the callers accordingly.

There is no functional change.

Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

+11 -5
+1 -1
drivers/mtd/nand/spi/core.c
··· 362 362 363 363 int spinand_write_enable_op(struct spinand_device *spinand) 364 364 { 365 - struct spi_mem_op op = SPINAND_WR_EN_DIS_1S_0_0_OP(true); 365 + struct spi_mem_op op = SPINAND_WR_EN_1S_0_0_OP; 366 366 367 367 return spi_mem_exec_op(spinand->spimem, &op); 368 368 }
+1 -1
drivers/mtd/nand/spi/esmt.c
··· 138 138 static int f50l1g41lb_otp_lock(struct spinand_device *spinand, loff_t from, 139 139 size_t len) 140 140 { 141 - struct spi_mem_op write_op = SPINAND_WR_EN_DIS_1S_0_0_OP(true); 141 + struct spi_mem_op write_op = SPINAND_WR_EN_1S_0_0_OP; 142 142 struct spi_mem_op exec_op = SPINAND_PROG_EXEC_1S_1S_0_OP(0); 143 143 u8 status; 144 144 int ret;
+1 -1
drivers/mtd/nand/spi/micron.c
··· 251 251 static int mt29f2g01abagd_otp_lock(struct spinand_device *spinand, loff_t from, 252 252 size_t len) 253 253 { 254 - struct spi_mem_op write_op = SPINAND_WR_EN_DIS_1S_0_0_OP(true); 254 + struct spi_mem_op write_op = SPINAND_WR_EN_1S_0_0_OP; 255 255 struct spi_mem_op exec_op = SPINAND_PROG_EXEC_1S_1S_0_OP(0); 256 256 u8 status; 257 257 int ret;
+8 -2
include/linux/mtd/spinand.h
··· 26 26 SPI_MEM_OP_NO_DUMMY, \ 27 27 SPI_MEM_OP_NO_DATA) 28 28 29 - #define SPINAND_WR_EN_DIS_1S_0_0_OP(enable) \ 30 - SPI_MEM_OP(SPI_MEM_OP_CMD((enable) ? 0x06 : 0x04, 1), \ 29 + #define SPINAND_WR_EN_1S_0_0_OP \ 30 + SPI_MEM_OP(SPI_MEM_OP_CMD(0x06, 1), \ 31 + SPI_MEM_OP_NO_ADDR, \ 32 + SPI_MEM_OP_NO_DUMMY, \ 33 + SPI_MEM_OP_NO_DATA) 34 + 35 + #define SPINAND_WR_DIS_1S_0_0_OP \ 36 + SPI_MEM_OP(SPI_MEM_OP_CMD(0x04, 1), \ 31 37 SPI_MEM_OP_NO_ADDR, \ 32 38 SPI_MEM_OP_NO_DUMMY, \ 33 39 SPI_MEM_OP_NO_DATA)