diff options
author | Mark Brown <broonie@kernel.org> | 2022-07-06 20:37:43 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-07-06 20:37:43 +0100 |
commit | 5b1a01c16292208be9a1ccc170c99c747df0c4c4 (patch) | |
tree | 4ac95e21046005270cb8c757922de2e19bef2fe3 /drivers/spi | |
parent | 30554a1f0fd6a5d2e2413bdc05389995d5611736 (diff) | |
parent | 6ece49c56965544262523dae4a071ace3db63507 (diff) |
spi: Merge AMD fix
Work around problems with large transfers.
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-amd.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/spi/spi-amd.c b/drivers/spi/spi-amd.c index cba6a4486c24..efdcbe6c4c26 100644 --- a/drivers/spi/spi-amd.c +++ b/drivers/spi/spi-amd.c @@ -33,6 +33,7 @@ #define AMD_SPI_RX_COUNT_REG 0x4B #define AMD_SPI_STATUS_REG 0x4C +#define AMD_SPI_FIFO_SIZE 70 #define AMD_SPI_MEM_SIZE 200 /* M_CMD OP codes for SPI */ @@ -270,6 +271,11 @@ static int amd_spi_master_transfer(struct spi_master *master, return 0; } +static size_t amd_spi_max_transfer_size(struct spi_device *spi) +{ + return AMD_SPI_FIFO_SIZE; +} + static int amd_spi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -302,6 +308,8 @@ static int amd_spi_probe(struct platform_device *pdev) master->flags = SPI_MASTER_HALF_DUPLEX; master->setup = amd_spi_master_setup; master->transfer_one_message = amd_spi_master_transfer; + master->max_transfer_size = amd_spi_max_transfer_size; + master->max_message_size = amd_spi_max_transfer_size; /* Register the controller with SPI framework */ err = devm_spi_register_master(dev, master); |