Skip to content

Commit 7ce0d16

Browse files
committed
mtd: spinand: Add an optional frequency to read from cache macros
While the SPINAND_PAGE_READ_FROM_CACHE_FAST_OP macro is supposed to be able to run at the flash highest supported frequency, it is not the case of the regular read from cache, which may be limited in terms of maximum frequency. Add an optional argument to this macro, which will be used to set the maximum frequency, if any. Signed-off-by: Miquel Raynal <[email protected]>
1 parent 0420872 commit 7ce0d16

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/linux/mtd/spinand.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,12 @@
6262
SPI_MEM_OP_NO_DUMMY, \
6363
SPI_MEM_OP_NO_DATA)
6464

65-
#define SPINAND_PAGE_READ_FROM_CACHE_OP(addr, ndummy, buf, len) \
65+
#define SPINAND_PAGE_READ_FROM_CACHE_OP(addr, ndummy, buf, len, ...) \
6666
SPI_MEM_OP(SPI_MEM_OP_CMD(0x03, 1), \
6767
SPI_MEM_OP_ADDR(2, addr, 1), \
6868
SPI_MEM_OP_DUMMY(ndummy, 1), \
69-
SPI_MEM_OP_DATA_IN(len, buf, 1))
69+
SPI_MEM_OP_DATA_IN(len, buf, 1), \
70+
__VA_OPT__(SPI_MEM_OP_MAX_FREQ(__VA_ARGS__)))
7071

7172
#define SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(addr, ndummy, buf, len) \
7273
SPI_MEM_OP(SPI_MEM_OP_CMD(0x0b, 1), \

0 commit comments

Comments
 (0)