@@ -449,7 +449,17 @@ static int bcm2835aux_spi_setup(struct spi_device *spi)
return -EINVAL;
}
- return 0;
+ /* with gpio-cs set the GPIO to the correct level
+ * and as output (in case the dt has the gpio not configured
+ * as output but native cs)
+ */
+ ret = gpio_direction_output(spi->cs_gpio,
+ (spi->mode & SPI_CS_HIGH) ? 0 : 1);
+ if (ret)
+ dev_err(&spi->dev, "could not set gpio %i as output: %i\n",
+ spi->cs_gpio, ret);
+
+ return ret;
}
static int bcm2835aux_spi_probe(struct platform_device *pdev)