Skip to content

Commit 4728f07

Browse files
Pratyush Yadavbroonie
authored andcommitted
spi: spi-mtk-nor: reject DTR ops
Double Transfer Rate (DTR) ops are added in spi-mem. But this controller doesn't support DTR transactions. Since we don't use the default supports_op(), which rejects all DTR ops, do that explicitly in our supports_op(). Signed-off-by: Pratyush Yadav <[email protected]> Reviewed-by: Tudor Ambarus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 5c81c27 commit 4728f07

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/spi/spi-mtk-nor.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,12 @@ static bool mtk_nor_supports_op(struct spi_mem *mem,
211211
if (op->cmd.buswidth != 1)
212212
return false;
213213

214+
/* DTR ops not supported. */
215+
if (op->cmd.dtr || op->addr.dtr || op->dummy.dtr || op->data.dtr)
216+
return false;
217+
if (op->cmd.nbytes != 1)
218+
return false;
219+
214220
if ((op->addr.nbytes == 3) || (op->addr.nbytes == 4)) {
215221
if ((op->data.dir == SPI_MEM_DATA_IN) && mtk_nor_match_read(op))
216222
return true;

0 commit comments

Comments
 (0)