Re: [PATCH V1] spi: Add support for Double Transfer Rate (DTR) mode

From: Mukesh Kumar Savaliya
Date: Thu Mar 27 2025 - 06:11:50 EST


Thanks Tudor !

On 3/26/2025 8:18 PM, Tudor Ambarus wrote:


On 3/26/25 2:25 PM, Mukesh Kumar Savaliya wrote:
Hi Mark, thanks for your comment.

On 3/26/2025 6:34 PM, Mark Brown wrote:
On Wed, Mar 26, 2025 at 02:09:54PM +0530, Mukesh Kumar Savaliya wrote:

This change introduces a new field `dtr_mode` in the `spi_transfer`
structure. The `dtr_mode` field allows protocol drivers to indicate if
Double Transfer Rate (DTR) mode is supported for a given transfer. When
`dtr_mode` is set to true, the SPI controller will use DTR mode
otherwise, it will default to single transfer mode.

The QSPI controller driver uses this flag and configures single or
double
transfer rate using the controller register.

We should have a flag in the controller indicating if it supports this,
and code in the core which returns an error if a driver attempts to use
it when the controller doesn't support it.
Have added below in spi.h which can be set by client and controller
driver should be using it to decide mode.

+ bool        dtr_mode;

since default it's false, should continue with SDR.
I believe for QSPI, it supports SDR or DDR, but it's not applicable to
standard SPI right ? So not sure in which case we should return an error ?


Please check how spimem is dealing with DTR, same ideas shall be applied
for spi transfers.

Yes, i just got it. Have kept my proposal aligning to this. Looks similar to spi_mem_controller_is_capable(). Please review reply to Mark if that is matching expectations OR have more suggestion/corrections.
Cheers,
ta