History

spi: implement SW control for CS times

This change implements CS control for setup, hold & inactive delays. The `cs_setup` delay is completely new, and can help with cases where asserting the CS, also brings the device out of power-sleep, where there needs to be a longer (than usual), before transferring data. The `cs_hold` time can overlap with the `delay` (or `delay_usecs`) from an SPI transfer. The main difference is that `cs_hold` implies that CS will be de-asserted. The `cs_inactive` delay does not have a clear use-case yet. It has been implemented mostly because the `spi_set_cs_timing()` function implements it. To some degree, this could overlap or replace `cs_change_delay`, but this will require more consideration/investigation in the future. All these delays have been added to the `spi_controller` struct, as they would typically be configured by calling `spi_set_cs_timing()` after an `spi_setup()` call. Software-mode for CS control, implies that the `set_cs_timing()` hook has not been provided for the `spi_controller` object.

Alexandru Ardelean committed 7 years ago

Commit 25093bd1 parent 81059362 files · +49 −1Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/spi/spi.h+5−0
@@ -609,6 +609,11 @@ struct spi_controller { · 608 unmodified lines
609 /* Optimized handlers for SPI memory-like operations. */609 /* Optimized handlers for SPI memory-like operations. */
610 const struct spi_controller_mem_ops *mem_ops;610 const struct spi_controller_mem_ops *mem_ops;
611 611
612 /* CS delays */
613 struct spi_delay cs_setup;
614 struct spi_delay cs_hold;
615 struct spi_delay cs_inactive;
616
612 /* gpio chip select */617 /* gpio chip select */
613 int *cs_gpios;618 int *cs_gpios;
614 struct gpio_desc **cs_gpiods;619 struct gpio_desc **cs_gpiods;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t