Sleeping is safe inside spi_transfer_one_message, and some
GPIO chips are running on slow busses (such as I2C GPIO
expanders) and need to sleep for setting values.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
*/
if (!(spi->mode & SPI_NO_CS)) {
if (spi->cs_gpiod)
- gpiod_set_value(spi->cs_gpiod, !enable);
+ gpiod_set_value_cansleep(spi->cs_gpiod,
+ !enable);
else
- gpio_set_value(spi->cs_gpio, !enable);
+ gpio_set_value_cansleep(spi->cs_gpio, !enable);
}
/* Some SPI masters need both GPIO CS & slave_select */
if ((spi->controller->flags & SPI_MASTER_GPIO_SS) &&