106-spi-use-gpio_set_value_cansleep-for-setting-chipsele.patch 638 B

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