spi: sun4i: Set bits_per_word_mask to only support 8 bits word length
authorAxel Lin <axel.lin@ingics.com>
Sun, 2 Mar 2014 14:25:10 +0000 (22:25 +0800)
committerMark Brown <broonie@linaro.org>
Tue, 4 Mar 2014 03:08:05 +0000 (11:08 +0800)
This controller only supports 8 bits word length.
Set bits_per_word_mask so spi core will reject transfers that attempt to use
an unsupported bits_per_word value.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-sun4i.c

index 3f82705..d266a87 100644 (file)
@@ -392,6 +392,7 @@ static int sun4i_spi_probe(struct platform_device *pdev)
        master->transfer_one = sun4i_spi_transfer_one;
        master->num_chipselect = 4;
        master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST;
+       master->bits_per_word_mask = SPI_BPW_MASK(8);
        master->dev.of_node = pdev->dev.of_node;
        master->auto_runtime_pm = true;