diff options
author | Jarkko Nikula <jarkko.nikula@linux.intel.com> | 2015-09-15 09:26:17 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-09-16 15:54:32 -0400 |
commit | 95a8fde23ef426aeee579bc99f35dc854e711225 (patch) | |
tree | bef9504ac890c1bfea45ebfda3ae99b2725b339f | |
parent | 6ff33f3902c3b1c5d0db6b1e2c70b6d76fba357f (diff) |
spi: spi-bfin5xx: Calculate transfer speed unconditionally
SPI core validates the transfer speed and defaults to spi->max_speed_hz in
case the transfer speed is not set so code here won't use the
chip->baud value (which is derived from spi->max_speed_hz).
Please note driver uses chip->baud at the beginning of message transmission
by calling the bfin_spi_restore_state() but then programs per transfer
speed in bfin_spi_pump_transfers(). I'm not familiar with the HW so I don't
know would it be possible to remove chip->baud completely by either using
constant value in bfin_spi_restore_state() or by removing the baud register
write there.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/spi/spi-bfin5xx.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/spi/spi-bfin5xx.c b/drivers/spi/spi-bfin5xx.c index a3d65b4f4944..1e91325bf39c 100644 --- a/drivers/spi/spi-bfin5xx.c +++ b/drivers/spi/spi-bfin5xx.c | |||
@@ -661,11 +661,7 @@ static void bfin_spi_pump_transfers(unsigned long data) | |||
661 | message->state = RUNNING_STATE; | 661 | message->state = RUNNING_STATE; |
662 | dma_config = 0; | 662 | dma_config = 0; |
663 | 663 | ||
664 | /* Speed setup (surely valid because already checked) */ | 664 | bfin_write(&drv_data->regs->baud, hz_to_spi_baud(transfer->speed_hz)); |
665 | if (transfer->speed_hz) | ||
666 | bfin_write(&drv_data->regs->baud, hz_to_spi_baud(transfer->speed_hz)); | ||
667 | else | ||
668 | bfin_write(&drv_data->regs->baud, chip->baud); | ||
669 | 665 | ||
670 | bfin_write(&drv_data->regs->stat, BIT_STAT_CLR); | 666 | bfin_write(&drv_data->regs->stat, BIT_STAT_CLR); |
671 | bfin_spi_cs_active(drv_data, chip); | 667 | bfin_spi_cs_active(drv_data, chip); |