spi: stm32: use explicit CPOL and CPHA mode bits
authorCezary Gapinski <cezary.gapinski@gmail.com>
Mon, 24 Dec 2018 22:00:31 +0000 (23:00 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 7 Jan 2019 18:24:17 +0000 (18:24 +0000)
Driver supports SPI mode 0 to 3 not only the mode 3.
Use SPI_CPOL and SPI_CPHA indicates that these bits
can be changed to obtain modes 0 - 3.

Signed-off-by: Cezary Gapinski <cezary.gapinski@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-stm32.c

index 8310f14fe273fe3703d0b8a6a7e51d2d80d1ea7f..f7056b767477a0cf6c082cba70b7243856edd9c8 100644 (file)
@@ -1142,7 +1142,7 @@ static int stm32_spi_probe(struct platform_device *pdev)
        master->dev.of_node = pdev->dev.of_node;
        master->auto_runtime_pm = true;
        master->bus_num = pdev->id;
-       master->mode_bits = SPI_MODE_3 | SPI_CS_HIGH | SPI_LSB_FIRST |
+       master->mode_bits = SPI_CPHA | SPI_CPOL | SPI_CS_HIGH | SPI_LSB_FIRST |
                            SPI_3WIRE | SPI_LOOP;
        master->bits_per_word_mask = stm32_spi_get_bpw_mask(spi);
        master->max_speed_hz = spi->clk_rate / SPI_MBR_DIV_MIN;