131-spi-use-gpio_set_value_cansleep-for-setting-chipsele.patch 592 B

1234567891011121314151617181920
  1. From: Felix Fietkau <nbd@nbd.name>
  2. Subject: spi: use gpio_set_value_cansleep for setting chipselect GPIO
  3. Sleeping is safe inside spi_transfer_one_message, and some GPIO chips
  4. need to sleep for setting values
  5. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  6. ---
  7. --- a/drivers/spi/spi.c
  8. +++ b/drivers/spi/spi.c
  9. @@ -700,7 +700,7 @@ static void spi_set_cs(struct spi_device
  10. enable = !enable;
  11. if (gpio_is_valid(spi->cs_gpio))
  12. - gpio_set_value(spi->cs_gpio, !enable);
  13. + gpio_set_value_cansleep(spi->cs_gpio, !enable);
  14. else if (spi->master->set_cs)
  15. spi->master->set_cs(spi, !enable);
  16. }