spi->chip_select < pdata->num_chipselect &&
pdata->chip_sel[spi->chip_select] != SPI_INTERN_CS) {
spi->cs_gpio = pdata->chip_sel[spi->chip_select];
- ----- retval = gpio_request_one(spi->cs_gpio,
- ----- flags, dev_name(&spi->dev));
+ +++++ retval = gpio_direction_output(
+ +++++ spi->cs_gpio, !(spi->mode & SPI_CS_HIGH));
internal_cs = false;
}
------ }
------ if (retval) {
------ dev_err(&spi->dev, "GPIO %d setup failed (%d)\n",
------ spi->cs_gpio, retval);
------ return retval;
------ }
++++++ if (retval) {
++++++ dev_err(&spi->dev, "GPIO %d setup failed (%d)\n",
++++++ spi->cs_gpio, retval);
++++++ return retval;
++++++ }
------ if (internal_cs)
------ set_io_bits(dspi->base + SPIPC0, 1 << spi->chip_select);
++++++ if (internal_cs)
++++++ set_io_bits(dspi->base + SPIPC0, 1 << spi->chip_select);
++++++ }
if (spi->mode & SPI_READY)
set_io_bits(dspi->base + SPIPC0, SPIPC0_SPIENA_MASK);