Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a06b430f authored by Michael Welling's avatar Michael Welling Committed by Mark Brown
Browse files

spi: omap2-mcspi: Fix GPIO chip select support



The OMAP2_MCSPI_CHCONF_FORCE must be toggled even when using GPIO
chip selects. This patch conditionally calls the omap2_mcspi_set_cs
function to do so when using GPIO chip selects.

Signed-off-by: default avatarMichael Welling <mwelling@ieee.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 4373f8b6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1108,6 +1108,9 @@ static int omap2_mcspi_work_one(struct omap2_mcspi *mcspi,

	omap2_mcspi_set_enable(spi, 0);

	if (gpio_is_valid(spi->cs_gpio))
		omap2_mcspi_set_cs(spi, spi->mode & SPI_CS_HIGH);

	if (par_override ||
	    (t->speed_hz != spi->max_speed_hz) ||
	    (t->bits_per_word != spi->bits_per_word)) {
@@ -1192,6 +1195,9 @@ static int omap2_mcspi_work_one(struct omap2_mcspi *mcspi,

	omap2_mcspi_set_enable(spi, 0);

	if (gpio_is_valid(spi->cs_gpio))
		omap2_mcspi_set_cs(spi, !(spi->mode & SPI_CS_HIGH));

	if (mcspi->fifo_depth > 0 && t)
		omap2_mcspi_set_fifo(spi, t, 0);