diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2019-02-21 10:59:58 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-02-21 14:03:35 -0500 |
commit | b89fefda7d4e3a649129584d855be233c7465264 (patch) | |
tree | dec8ed140af6e85ce12887d97d21a8f458990337 /drivers/spi/spi-gpio.c | |
parent | ef070b4e4aa25bb5f8632ad196644026c11903bf (diff) |
spi: spi-gpio: fix SPI_CS_HIGH capability
spi-gpio is capable of dealing with active-high chip-selects.
Unfortunately, commit 4b859db2c606 ("spi: spi-gpio: add SPI_3WIRE
support") broke this by setting master->mode_bits, which overrides
the setting in the spi-bitbang code. Fix this.
[Fixed a trivial conflict with SPI_3WIRE_HIZ support -- broonie]
Fixes: 4b859db2c606 ("spi: spi-gpio: add SPI_3WIRE support")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/spi/spi-gpio.c')
-rw-r--r-- | drivers/spi/spi-gpio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c index a4aee26028cd..53b35c56a557 100644 --- a/drivers/spi/spi-gpio.c +++ b/drivers/spi/spi-gpio.c | |||
@@ -428,7 +428,8 @@ static int spi_gpio_probe(struct platform_device *pdev) | |||
428 | return status; | 428 | return status; |
429 | 429 | ||
430 | master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 32); | 430 | master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 32); |
431 | master->mode_bits = SPI_3WIRE | SPI_3WIRE_HIZ | SPI_CPHA | SPI_CPOL; | 431 | master->mode_bits = SPI_3WIRE | SPI_3WIRE_HIZ | SPI_CPHA | SPI_CPOL | |
432 | SPI_CS_HIGH; | ||
432 | master->flags = master_flags; | 433 | master->flags = master_flags; |
433 | master->bus_num = pdev->id; | 434 | master->bus_num = pdev->id; |
434 | /* The master needs to think there is a chipselect even if not connected */ | 435 | /* The master needs to think there is a chipselect even if not connected */ |
@@ -455,7 +456,6 @@ static int spi_gpio_probe(struct platform_device *pdev) | |||
455 | spi_gpio->bitbang.txrx_word[SPI_MODE_3] = spi_gpio_spec_txrx_word_mode3; | 456 | spi_gpio->bitbang.txrx_word[SPI_MODE_3] = spi_gpio_spec_txrx_word_mode3; |
456 | } | 457 | } |
457 | spi_gpio->bitbang.setup_transfer = spi_bitbang_setup_transfer; | 458 | spi_gpio->bitbang.setup_transfer = spi_bitbang_setup_transfer; |
458 | spi_gpio->bitbang.flags = SPI_CS_HIGH; | ||
459 | 459 | ||
460 | status = spi_bitbang_start(&spi_gpio->bitbang); | 460 | status = spi_bitbang_start(&spi_gpio->bitbang); |
461 | if (status) | 461 | if (status) |