spi: omap2-mcspi: Add gpio_request and init CS

If GPIO chip select is specified, request the GPIO in the setup function
and release it in the cleanup function.

Signed-off-by: Michael Welling <mwelling@ieee.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
master
Michael Welling 8 years ago committed by Harald Welte
parent a7246e434c
commit f25474f16b

@ -1063,6 +1063,12 @@ static int omap2_mcspi_setup(struct spi_device *spi)
ret);
}
if (gpio_is_valid(spi->cs_gpio)) {
if (gpio_request(spi->cs_gpio, dev_name(&spi->dev)) == 0)
gpio_direction_output(spi->cs_gpio,
!(spi->mode & SPI_CS_HIGH));
}
ret = pm_runtime_get_sync(mcspi->dev);
if (ret < 0)
return ret;

Loading…
Cancel
Save