Skip to content

Commit ec3fa72

Browse files
commodobroonie
authored andcommitted
spi: spidev: use new word_delay field for spi transfers
The `word_delay` field had it's type changed to `struct spi_delay`. This allows users to specify nano-second or clock-cycle delays (if needed). Converting to use `word_delay` is straightforward: it's just assigning the value to `word_delay.value` and hard-coding the `word_delay.unit` to `SPI_DELAY_UNIT_USECS` This keeps the uapi for spidev un-changed. Changing it can be part of another changeset and discussion. Signed-off-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 21e2606 commit ec3fa72

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/spi/spidev.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ static int spidev_message(struct spidev_data *spidev,
267267
k_tmp->bits_per_word = u_tmp->bits_per_word;
268268
k_tmp->delay_usecs = u_tmp->delay_usecs;
269269
k_tmp->speed_hz = u_tmp->speed_hz;
270-
k_tmp->word_delay_usecs = u_tmp->word_delay_usecs;
270+
k_tmp->word_delay.value = u_tmp->word_delay_usecs;
271+
k_tmp->word_delay.unit = SPI_DELAY_UNIT_USECS;
271272
if (!k_tmp->speed_hz)
272273
k_tmp->speed_hz = spidev->speed_hz;
273274
#ifdef VERBOSE

0 commit comments

Comments
 (0)