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.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -609,6 +609,11 @@ struct spi_controller { · 608 unmodified lines | ||
| 609 | 609 | /* Optimized handlers for SPI memory-like operations. */ |
| 610 | 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 | 617 | /* gpio chip select */ |
| 613 | 618 | int *cs_gpios; |
| 614 | 619 | struct gpio_desc **cs_gpiods; |