diff options
author | Michal Suchanek <hramrach@gmail.com> | 2016-06-13 17:46:50 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-06-14 10:04:42 +0100 |
commit | 794912cff6dba8b5e93948243299bb0b2cb11277 (patch) | |
tree | ae2ee6e5e2a4dac0b8e98aea1697adc0fee73329 /drivers/spi/spi-sun4i.c | |
parent | 1a695a905c18548062509178b98bc91e67510864 (diff) | |
download | linux-794912cff6dba8b5e93948243299bb0b2cb11277.tar.gz linux-794912cff6dba8b5e93948243299bb0b2cb11277.tar.xz |
spi: sunxi: expose maximum transfer size limit
The sun4i spi hardware can trasfer at most 63 bytes of data without DMA
support so report the limitation. Same for sun6i.
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-sun4i.c')
-rw-r--r-- | drivers/spi/spi-sun4i.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c index 1ddd9e2309b6..07ce7c97750e 100644 --- a/drivers/spi/spi-sun4i.c +++ b/drivers/spi/spi-sun4i.c @@ -167,6 +167,11 @@ static void sun4i_spi_set_cs(struct spi_device *spi, bool enable) sun4i_spi_write(sspi, SUN4I_CTL_REG, reg); } +static size_t sun4i_spi_max_transfer_size(struct spi_device *spi) +{ + return SUN4I_FIFO_DEPTH - 1; +} + static int sun4i_spi_transfer_one(struct spi_master *master, struct spi_device *spi, struct spi_transfer *tfr) @@ -394,6 +399,7 @@ static int sun4i_spi_probe(struct platform_device *pdev) master->bits_per_word_mask = SPI_BPW_MASK(8); master->dev.of_node = pdev->dev.of_node; master->auto_runtime_pm = true; + master->max_transfer_size = sun4i_spi_max_transfer_size; sspi->hclk = devm_clk_get(&pdev->dev, "ahb"); if (IS_ERR(sspi->hclk)) { |