aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-img-spfi.c
diff options
context:
space:
mode:
authorAndrew Bresticker <abrestic@chromium.org>2015-04-08 13:03:15 -0400
committerMark Brown <broonie@kernel.org>2015-04-08 16:04:28 -0400
commitba33d8ac0c93fdfbdbc825ef690caab5d57e22c2 (patch)
tree836b32cd51fa1516058d1c7981402cab6f099989 /drivers/spi/spi-img-spfi.c
parent824ab37df006ea2d06e4c4817344c0e8c056b744 (diff)
spi: img-spfi: Reset controller after each message
Imagination has recommended that the SPFI controller be reset after each message, regardless of success or failure. Do this in an unprepare_message() callback. Signed-off-by: Andrew Bresticker <abrestic@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-img-spfi.c')
-rw-r--r--drivers/spi/spi-img-spfi.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/spi/spi-img-spfi.c b/drivers/spi/spi-img-spfi.c
index 3fd7b07c3eef..c37f6e50096e 100644
--- a/drivers/spi/spi-img-spfi.c
+++ b/drivers/spi/spi-img-spfi.c
@@ -414,8 +414,6 @@ static void img_spfi_handle_err(struct spi_master *master,
414 dmaengine_terminate_all(spfi->rx_ch); 414 dmaengine_terminate_all(spfi->rx_ch);
415 } 415 }
416 spin_unlock_irqrestore(&spfi->lock, flags); 416 spin_unlock_irqrestore(&spfi->lock, flags);
417
418 spfi_reset(spfi);
419} 417}
420 418
421static int img_spfi_prepare(struct spi_master *master, struct spi_message *msg) 419static int img_spfi_prepare(struct spi_master *master, struct spi_message *msg)
@@ -437,6 +435,16 @@ static int img_spfi_prepare(struct spi_master *master, struct spi_message *msg)
437 return 0; 435 return 0;
438} 436}
439 437
438static int img_spfi_unprepare(struct spi_master *master,
439 struct spi_message *msg)
440{
441 struct img_spfi *spfi = spi_master_get_devdata(master);
442
443 spfi_reset(spfi);
444
445 return 0;
446}
447
440static void img_spfi_config(struct spi_master *master, struct spi_device *spi, 448static void img_spfi_config(struct spi_master *master, struct spi_device *spi,
441 struct spi_transfer *xfer) 449 struct spi_transfer *xfer)
442{ 450{
@@ -610,6 +618,7 @@ static int img_spfi_probe(struct platform_device *pdev)
610 master->set_cs = img_spfi_set_cs; 618 master->set_cs = img_spfi_set_cs;
611 master->transfer_one = img_spfi_transfer_one; 619 master->transfer_one = img_spfi_transfer_one;
612 master->prepare_message = img_spfi_prepare; 620 master->prepare_message = img_spfi_prepare;
621 master->unprepare_message = img_spfi_unprepare;
613 master->handle_err = img_spfi_handle_err; 622 master->handle_err = img_spfi_handle_err;
614 623
615 spfi->tx_ch = dma_request_slave_channel(spfi->dev, "tx"); 624 spfi->tx_ch = dma_request_slave_channel(spfi->dev, "tx");