Skip to content

spi: aspeed: Respect transfer-specific bit width#5

Draft
mfield4 wants to merge 1 commit into
AspeedTech-BMC:aspeed-master-v6.18from
mfield4:spi-respect-txrx-nbits
Draft

spi: aspeed: Respect transfer-specific bit width#5
mfield4 wants to merge 1 commit into
AspeedTech-BMC:aspeed-master-v6.18from
mfield4:spi-respect-txrx-nbits

Conversation

@mfield4
Copy link
Copy Markdown

@mfield4 mfield4 commented Jun 3, 2026

The ASPEED SPI driver previously configured the controller's transfer mode (dual, quad, or single) based globally on the target device's capability flags (spi->mode & SPI_TX_DUAL/QUAD), ignoring the requested width of individual transfers in the message sequence. This deviates from the Linux SPI subsystem design, which expects command, address, and dummy phases of a transaction to default to single-bit transmission, with multi-bit mode restricted strictly to the data payload transfers that request it via tx_nbits or rx_nbits.

Fix this by dynamically adjusting the controller's IO mode for each transfer segment. The dual or quad IO mode is activated only if both the individual transfer requests the multi-bit width (tx_nbits/rx_nbits) and the device globally supports that mode (spi->mode). All other transfers remain in the default single-bit mode.

The ASPEED SPI driver previously configured the controller's transfer mode
(dual, quad, or single) based globally on the target device's capability
flags (spi->mode & SPI_TX_DUAL/QUAD), ignoring the requested width of
individual transfers in the message sequence. This deviates from the Linux
SPI subsystem design, which expects command, address, and dummy phases of
a transaction to default to single-bit transmission, with multi-bit mode
restricted strictly to the data payload transfers that request it via
tx_nbits or rx_nbits.

Fix this by dynamically adjusting the controller's IO mode for each
transfer segment. The dual or quad IO mode is activated only if both the
individual transfer requests the multi-bit width (tx_nbits/rx_nbits) and
the device globally supports that mode (spi->mode). All other transfers
remain in the default single-bit mode.
@mfield4 mfield4 marked this pull request as draft June 4, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant