Skip to content

Commit 716d0a0

Browse files
chintingkuobroonie
authored andcommitted
spi: aspeed: Enable Quad SPI mode for page program
Ensure the controller switches to quad I/O mode when spi-tx-bus-width dts property is 4 and the Quad SPI program opcode (32h or 34h) is used. Without this change, high-bit data will be lost during page programming. Signed-off-by: Chin-Ting Kuo <chin-ting_kuo@aspeedtech.com> Link: https://patch.msgid.link/20251114101042.1520997-3-chin-ting_kuo@aspeedtech.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent c94f134 commit 716d0a0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/spi/spi-aspeed-smc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,15 @@ static ssize_t aspeed_spi_write_user(struct aspeed_spi_chip *chip,
263263
const struct spi_mem_op *op)
264264
{
265265
int ret;
266+
int io_mode = aspeed_spi_get_io_mode(op);
266267

267268
aspeed_spi_start_user(chip);
268269
ret = aspeed_spi_send_cmd_addr(chip, op->addr.nbytes, op->addr.val, op->cmd.opcode);
269270
if (ret < 0)
270271
goto stop_user;
272+
273+
aspeed_spi_set_io_mode(chip, io_mode);
274+
271275
aspeed_spi_write_to_ahb(chip->ahb_base, op->data.buf.out, op->data.nbytes);
272276
stop_user:
273277
aspeed_spi_stop_user(chip);

0 commit comments

Comments
 (0)